Documentation ¶
Index ¶
- func BroadcastTransaction(tx StacksTransaction, network *stacks.StacksNetwork) (string, error)
- func SerializePostConditions(postConditions []PostCondition) ([]byte, error)
- func SignTransaction(tx StacksTransaction, privateKey []byte) error
- func VerifyTransaction(tx StacksTransaction, publicKey []byte) (bool, error)
- type AssetInfo
- type BaseTransaction
- type ContractCallPayload
- type ContractCallTransaction
- func (t *ContractCallTransaction) Clone() StacksTransaction
- func (t *ContractCallTransaction) Deserialize(data []byte) error
- func (t *ContractCallTransaction) GetAuth() *TransactionAuth
- func (t *ContractCallTransaction) GetPayload() Payload
- func (t *ContractCallTransaction) Serialize() ([]byte, error)
- func (t *ContractCallTransaction) Sign(privateKey []byte) error
- func (t *ContractCallTransaction) Verify(publicKey []byte) (bool, error)
- type CustomError
- type NonceInfo
- type Payload
- type PostCondition
- type PostConditionContractPrincipal
- type PostConditionFungible
- type PostConditionNonFungible
- type PostConditionOriginPrincipal
- type PostConditionPrincipal
- type PostConditionSTX
- type PostConditionStandardPrincipal
- type SmartContractPayload
- type SmartContractTransaction
- func (t *SmartContractTransaction) Clone() StacksTransaction
- func (t *SmartContractTransaction) Deserialize(data []byte) error
- func (t *SmartContractTransaction) GetAuth() *TransactionAuth
- func (t *SmartContractTransaction) GetPayload() Payload
- func (t *SmartContractTransaction) Serialize() ([]byte, error)
- type SpendingCondition
- type StacksTransaction
- type TokenTransferPayload
- type TokenTransferTransaction
- func (t *TokenTransferTransaction) Clone() StacksTransaction
- func (t *TokenTransferTransaction) Deserialize(data []byte) error
- func (t *TokenTransferTransaction) GetAuth() *TransactionAuth
- func (t *TokenTransferTransaction) GetPayload() Payload
- func (t *TokenTransferTransaction) Serialize() ([]byte, error)
- func (t *TokenTransferTransaction) Sign(privateKey []byte) error
- func (t *TokenTransferTransaction) Verify(publicKey []byte) (bool, error)
- type TransactionAuth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BroadcastTransaction ¶
func BroadcastTransaction(tx StacksTransaction, network *stacks.StacksNetwork) (string, error)
func SerializePostConditions ¶
func SerializePostConditions(postConditions []PostCondition) ([]byte, error)
func SignTransaction ¶
func SignTransaction(tx StacksTransaction, privateKey []byte) error
func VerifyTransaction ¶
func VerifyTransaction(tx StacksTransaction, publicKey []byte) (bool, error)
Types ¶
type AssetInfo ¶ added in v0.5.0
type AssetInfo struct { Contract *clarity.ContractPrincipal AssetName string }
func (*AssetInfo) Deserialize ¶ added in v0.5.0
type BaseTransaction ¶
type BaseTransaction struct { Version stacks.TransactionVersion ChainID stacks.ChainID Auth TransactionAuth PostConditionMode stacks.PostConditionMode PostConditions []PostCondition /** @deprecated Not used, starting with Stacks 2.5. Still needed for serialization. */ AnchorMode stacks.AnchorMode }
type ContractCallPayload ¶
type ContractCallPayload struct { ContractAddress clarity.ClarityValue // Can be either StandardPrincipal or ContractPrincipal ContractName string FunctionName string FunctionArgs []clarity.ClarityValue }
func NewContractCallPayload ¶
func NewContractCallPayload(contractAddress string, contractName string, functionName string, functionArgs []clarity.ClarityValue) (*ContractCallPayload, error)
func (*ContractCallPayload) Deserialize ¶
func (p *ContractCallPayload) Deserialize(data []byte) (int, error)
func (*ContractCallPayload) Serialize ¶
func (p *ContractCallPayload) Serialize() ([]byte, error)
type ContractCallTransaction ¶
type ContractCallTransaction struct { BaseTransaction Payload ContractCallPayload }
func MakeContractCall ¶
func MakeContractCall( contractAddress string, contractName string, functionName string, functionArgs []clarity.ClarityValue, network stacks.StacksNetwork, senderAddress string, senderKey []byte, fee *big.Int, nonce *big.Int, postConditionMode stacks.PostConditionMode, postConditions []PostCondition, ) (*ContractCallTransaction, error)
func NewContractCallTransaction ¶
func NewContractCallTransaction( contractAddress string, contractName string, functionName string, functionArgs []clarity.ClarityValue, version stacks.TransactionVersion, chainID stacks.ChainID, signer [20]byte, nonce uint64, fee uint64, postConditionMode stacks.PostConditionMode, postConditions []PostCondition, ) (*ContractCallTransaction, error)
func (*ContractCallTransaction) Clone ¶
func (t *ContractCallTransaction) Clone() StacksTransaction
func (*ContractCallTransaction) Deserialize ¶
func (t *ContractCallTransaction) Deserialize(data []byte) error
func (*ContractCallTransaction) GetAuth ¶
func (t *ContractCallTransaction) GetAuth() *TransactionAuth
func (*ContractCallTransaction) GetPayload ¶
func (t *ContractCallTransaction) GetPayload() Payload
func (*ContractCallTransaction) Serialize ¶
func (t *ContractCallTransaction) Serialize() ([]byte, error)
func (*ContractCallTransaction) Sign ¶
func (t *ContractCallTransaction) Sign(privateKey []byte) error
type CustomError ¶
func (*CustomError) Error ¶
func (e *CustomError) Error() string
type PostCondition ¶
type PostCondition interface { Serialize() ([]byte, error) Deserialize([]byte) (int, error) GetType() stacks.PostConditionType }
func DeserializePostCondition ¶ added in v0.5.0
func DeserializePostCondition(data []byte) (PostCondition, int, error)
func DeserializePostConditions ¶
func DeserializePostConditions(data []byte) ([]PostCondition, int, error)
type PostConditionContractPrincipal ¶ added in v0.5.0
type PostConditionContractPrincipal struct {
Contract *clarity.ContractPrincipal
}
func (*PostConditionContractPrincipal) Deserialize ¶ added in v0.5.0
func (pc *PostConditionContractPrincipal) Deserialize(data []byte) (int, error)
func (*PostConditionContractPrincipal) GetID ¶ added in v0.5.0
func (pc *PostConditionContractPrincipal) GetID() stacks.PostConditionPrincipalType
func (*PostConditionContractPrincipal) Serialize ¶ added in v0.5.0
func (pc *PostConditionContractPrincipal) Serialize() ([]byte, error)
type PostConditionFungible ¶ added in v0.5.0
type PostConditionFungible struct { Principal PostConditionPrincipal ConditionCode stacks.FungibleConditionCode Amount uint64 Asset *AssetInfo }
func (*PostConditionFungible) Deserialize ¶ added in v0.5.0
func (pc *PostConditionFungible) Deserialize(data []byte) (int, error)
func (*PostConditionFungible) GetType ¶ added in v0.5.0
func (pc *PostConditionFungible) GetType() stacks.PostConditionType
func (*PostConditionFungible) Serialize ¶ added in v0.5.0
func (pc *PostConditionFungible) Serialize() ([]byte, error)
type PostConditionNonFungible ¶ added in v0.5.0
type PostConditionNonFungible struct { Principal PostConditionPrincipal ConditionCode stacks.NonFungibleConditionCode Asset *AssetInfo AssetValue clarity.ClarityValue }
func (*PostConditionNonFungible) Deserialize ¶ added in v0.5.0
func (pc *PostConditionNonFungible) Deserialize(data []byte) (int, error)
func (*PostConditionNonFungible) GetType ¶ added in v0.5.0
func (pc *PostConditionNonFungible) GetType() stacks.PostConditionType
func (*PostConditionNonFungible) Serialize ¶ added in v0.5.0
func (pc *PostConditionNonFungible) Serialize() ([]byte, error)
type PostConditionOriginPrincipal ¶ added in v0.5.0
type PostConditionOriginPrincipal struct { }
func (*PostConditionOriginPrincipal) Deserialize ¶ added in v0.5.0
func (pc *PostConditionOriginPrincipal) Deserialize(data []byte) (int, error)
func (*PostConditionOriginPrincipal) GetID ¶ added in v0.5.0
func (pc *PostConditionOriginPrincipal) GetID() stacks.PostConditionPrincipalType
func (*PostConditionOriginPrincipal) Serialize ¶ added in v0.5.0
func (pc *PostConditionOriginPrincipal) Serialize() ([]byte, error)
type PostConditionPrincipal ¶ added in v0.5.0
type PostConditionPrincipal interface { Serialize() ([]byte, error) Deserialize([]byte) (int, error) GetID() stacks.PostConditionPrincipalType }
func DeserializePostConditionPrincipal ¶ added in v0.5.0
func DeserializePostConditionPrincipal(data []byte) (PostConditionPrincipal, int, error)
type PostConditionSTX ¶ added in v0.5.0
type PostConditionSTX struct { Principal PostConditionPrincipal ConditionCode stacks.FungibleConditionCode Amount uint64 }
func (*PostConditionSTX) Deserialize ¶ added in v0.5.0
func (pc *PostConditionSTX) Deserialize(data []byte) (int, error)
func (*PostConditionSTX) GetType ¶ added in v0.5.0
func (pc *PostConditionSTX) GetType() stacks.PostConditionType
func (*PostConditionSTX) Serialize ¶ added in v0.5.0
func (pc *PostConditionSTX) Serialize() ([]byte, error)
type PostConditionStandardPrincipal ¶ added in v0.5.0
type PostConditionStandardPrincipal struct {
Address *clarity.StandardPrincipal
}
func (*PostConditionStandardPrincipal) Deserialize ¶ added in v0.5.0
func (pc *PostConditionStandardPrincipal) Deserialize(data []byte) (int, error)
func (*PostConditionStandardPrincipal) GetID ¶ added in v0.5.0
func (pc *PostConditionStandardPrincipal) GetID() stacks.PostConditionPrincipalType
func (*PostConditionStandardPrincipal) Serialize ¶ added in v0.5.0
func (pc *PostConditionStandardPrincipal) Serialize() ([]byte, error)
type SmartContractPayload ¶ added in v0.3.0
type SmartContractPayload struct { ContractName string CodeBody string ClarityVersion stacks.ClarityVersion }
func NewSmartContractPayload ¶ added in v0.3.0
func NewSmartContractPayload(contractName string, codeBody string, clarityVersion stacks.ClarityVersion) (*SmartContractPayload, error)
func (*SmartContractPayload) Deserialize ¶ added in v0.3.0
func (p *SmartContractPayload) Deserialize(data []byte) (int, error)
func (*SmartContractPayload) Serialize ¶ added in v0.3.0
func (p *SmartContractPayload) Serialize() ([]byte, error)
type SmartContractTransaction ¶ added in v0.3.0
type SmartContractTransaction struct { BaseTransaction Payload SmartContractPayload }
func MakeContractDeploy ¶ added in v0.3.0
func MakeContractDeploy( contractName string, codeBody string, clarityVersion stacks.ClarityVersion, network stacks.StacksNetwork, senderAddress string, senderKey []byte, fee *big.Int, nonce *big.Int, postConditionMode stacks.PostConditionMode, postConditions []PostCondition, ) (*SmartContractTransaction, error)
func NewSmartContractTransaction ¶ added in v0.3.0
func NewSmartContractTransaction( contractName string, codeBody string, clarityVersion stacks.ClarityVersion, version stacks.TransactionVersion, chainID stacks.ChainID, signer [20]byte, nonce uint64, fee uint64, postConditionMode stacks.PostConditionMode, postConditions []PostCondition, ) (*SmartContractTransaction, error)
func (*SmartContractTransaction) Clone ¶ added in v0.3.0
func (t *SmartContractTransaction) Clone() StacksTransaction
func (*SmartContractTransaction) Deserialize ¶ added in v0.3.0
func (t *SmartContractTransaction) Deserialize(data []byte) error
func (*SmartContractTransaction) GetAuth ¶ added in v0.3.0
func (t *SmartContractTransaction) GetAuth() *TransactionAuth
func (*SmartContractTransaction) GetPayload ¶ added in v0.3.0
func (t *SmartContractTransaction) GetPayload() Payload
func (*SmartContractTransaction) Serialize ¶ added in v0.3.0
func (t *SmartContractTransaction) Serialize() ([]byte, error)
type SpendingCondition ¶
type SpendingCondition struct { HashMode stacks.AddressHashMode Signer [20]byte Nonce uint64 Fee uint64 KeyEncoding stacks.PubKeyEncoding Signature [stacks.RecoverableECDSASigLengthBytes]byte }
func (*SpendingCondition) Deserialize ¶
func (sc *SpendingCondition) Deserialize(data []byte) (int, error)
func (*SpendingCondition) Serialize ¶
func (sc *SpendingCondition) Serialize() ([]byte, error)
type StacksTransaction ¶
type StacksTransaction interface { Serialize() ([]byte, error) Deserialize([]byte) error GetAuth() *TransactionAuth GetPayload() Payload Clone() StacksTransaction }
func DeserializeTransaction ¶
func DeserializeTransaction(data []byte) (StacksTransaction, error)
type TokenTransferPayload ¶
type TokenTransferPayload struct { Recipient clarity.ClarityValue // Can be either StandardPrincipal or ContractPrincipal Amount uint64 Memo string }
func NewTokenTransferPayload ¶
func NewTokenTransferPayload(recipient string, amount uint64, memo string) (*TokenTransferPayload, error)
func (*TokenTransferPayload) Deserialize ¶
func (p *TokenTransferPayload) Deserialize(data []byte) (int, error)
func (*TokenTransferPayload) Serialize ¶
func (p *TokenTransferPayload) Serialize() ([]byte, error)
type TokenTransferTransaction ¶
type TokenTransferTransaction struct { BaseTransaction Payload TokenTransferPayload }
func MakeSTXTokenTransfer ¶
func NewTokenTransferTransaction ¶
func NewTokenTransferTransaction( recipient string, amount uint64, memo string, version stacks.TransactionVersion, chainID stacks.ChainID, signer [20]byte, nonce uint64, fee uint64, postConditionMode stacks.PostConditionMode, postConditions []PostCondition, ) (*TokenTransferTransaction, error)
func (*TokenTransferTransaction) Clone ¶
func (t *TokenTransferTransaction) Clone() StacksTransaction
func (*TokenTransferTransaction) Deserialize ¶
func (t *TokenTransferTransaction) Deserialize(data []byte) error
func (*TokenTransferTransaction) GetAuth ¶
func (t *TokenTransferTransaction) GetAuth() *TransactionAuth
func (*TokenTransferTransaction) GetPayload ¶
func (t *TokenTransferTransaction) GetPayload() Payload
func (*TokenTransferTransaction) Serialize ¶
func (t *TokenTransferTransaction) Serialize() ([]byte, error)
func (*TokenTransferTransaction) Sign ¶
func (t *TokenTransferTransaction) Sign(privateKey []byte) error
type TransactionAuth ¶
type TransactionAuth struct { AuthType stacks.AuthType OriginAuth SpendingCondition SponsorAuth *SpendingCondition }
func (*TransactionAuth) Deserialize ¶
func (auth *TransactionAuth) Deserialize(data []byte) (int, error)
func (*TransactionAuth) Serialize ¶
func (auth *TransactionAuth) Serialize() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.