Documentation ¶
Index ¶
- Constants
- func BigToHex(in *big.Int) string
- func ContractCall(senderKey string, from string, to string, memo string, amount *big.Int, ...) (string, error)
- func GetAddressFromPublicKey(pubKey string) (string, error)
- func GetPublicKey(privKeyHex string) (string, error)
- func NewAddress(privKeyHex string) (string, error)
- func Serialize(stacksTransaction StacksTransaction) []byte
- func SerializePayload(payload Payload) []byte
- func Stack(contractAddress, contractName, functionName, poxAddress string, ...) (string, error)
- func Transfer(privateKey string, to string, memo string, amount *big.Int, nonce *big.Int, ...) (string, error)
- func Txid(stacksTransaction StacksTransaction) string
- func ValidAddress(address string) bool
- type Address
- type AssetInfo
- type BooleanCV
- type BufferCV
- type BytesReader
- type ClarityValue
- type ContractCallPayload
- type ContractPrincipal
- type ContractPrincipalCV
- type DecodeBtcAddressBean
- type FungiblePostCondition
- type IntCV
- type KeyValuePair
- type LPList
- type LegacyAddress
- type LengthPrefixedString
- type ListCV
- type Memo
- type Message
- type MessageSignature
- type NextSignature
- type NoneCV
- type Payload
- type PostCondition
- type PostConditionInterface
- type PostConditionPrincipal
- type PostConditionPrincipalInterface
- type PrincipalCV
- type ResponseCV
- type STXPostCondition
- type SignedContractCallOptions
- type SignedTokenTransferOptions
- type Signer
- type SingleSigSpendingCondition
- type SomeCV
- type StacksMessage
- type StacksPrivateKey
- type StacksPublicKey
- type StacksTransaction
- type StacksTransferSig
- type StandardAuthorization
- type StandardPrincipalCV
- type StringCV
- type TokenTransferPayload
- type TransactionRes
- type TransactionSigner
- type TupleCV
- type TupleData
- type UintCV
Constants ¶
View Source
const ( SerializeP2PKH = 0 SerializeP2SH = 1 SerializeP2WPKH = 2 SerializeP2WSH = 3 )
View Source
const ( Int = 0 Uint = 1 Buffer = 2 BoolTrue = 3 BoolFalse = 4 PrincipalStandard = 5 PrincipalContract = 6 ResponseOk = 7 ResponseErr = 8 OptionalNone = 9 OptionalSome = 10 List = 11 Tuple = 12 IntASCII = 13 IntUTF8 = 14 )
View Source
const ( ADDRESS = 0 PRINCIPAL = 1 LENGTHPREFIXEDSTRING = 2 MEMOSTRING = 3 ASSETINFO = 4 POSTCONDITION = 5 PUBLICKEY = 6 LENGTHPREFIXEDLIST = 7 PAYLOAD = 8 MESSAGESIGNATURE = 9 TRANSACTIONAUTHFIELD = 10 )
View Source
const ( PostConditionModeAllow = 1 PostConditionModeDeny = 2 )
View Source
const ( PostConditionPrincipalIDORIGIN = 1 PostConditionPrincipalIDSTANDARD = 2 PostConditionPrincipalIDCONTRACT = 3 )
View Source
const ( Origin = 0x01 Standard = 0x02 Contract = 0x03 )
View Source
const ( STX = 0x00 Fungible = 0x01 NonFungible = 0x02 )
View Source
const (
MaxBufferSize = 1024 * 4
)
Variables ¶
This section is empty.
Functions ¶
func ContractCall ¶
func GetAddressFromPublicKey ¶
func GetPublicKey ¶
func NewAddress ¶
func Serialize ¶
func Serialize(stacksTransaction StacksTransaction) []byte
func SerializePayload ¶
func Stack ¶
func Stack(contractAddress, contractName, functionName, poxAddress string, amount, height, cycle *big.Int, senderKey string, nonce, fee *big.Int) (string, error)
Stack Deprecated
func Txid ¶
func Txid(stacksTransaction StacksTransaction) string
func ValidAddress ¶
Types ¶
type Address ¶
type BytesReader ¶
type BytesReader struct {
// contains filtered or unexported fields
}
func NewBytesReader ¶
func NewBytesReader(arr []byte) *BytesReader
func (*BytesReader) ReadBytes ¶
func (br *BytesReader) ReadBytes(length int) []byte
func (*BytesReader) ReadUInt8 ¶
func (br *BytesReader) ReadUInt8() uint8
type ClarityValue ¶
type ClarityValue interface { Message }
func DeserializeCV ¶
func DeserializeCV(serializedClarityValue string) ClarityValue
func DeserializeJson ¶
func DeserializeJson(args []interface{}) []ClarityValue
func NewUntilBurnBlockHeight ¶
func NewUntilBurnBlockHeight(untilBurnBlockHeight *big.Int) ClarityValue
type ContractCallPayload ¶
type ContractCallPayload struct {
// contains filtered or unexported fields
}
func CreateContractCallPayload ¶
func CreateContractCallPayload(contractAddress, contractName, functionName string, functionArgs []ClarityValue) *ContractCallPayload
type ContractPrincipal ¶
type ContractPrincipal struct { PostConditionPrincipal // contains filtered or unexported fields }
type ContractPrincipalCV ¶
type ContractPrincipalCV struct { Type_ int `json:"type"` Address Address `json:"address"` ContractName LengthPrefixedString `json:"contractName"` }
func NewContractPrincipalCV ¶
func NewContractPrincipalCV(principal string) (*ContractPrincipalCV, error)
func (ContractPrincipalCV) GetType ¶
func (c ContractPrincipalCV) GetType() int
type DecodeBtcAddressBean ¶
type DecodeBtcAddressBean struct {
// contains filtered or unexported fields
}
type FungiblePostCondition ¶
type FungiblePostCondition struct { PostCondition // contains filtered or unexported fields }
func (FungiblePostCondition) GetType ¶
func (f FungiblePostCondition) GetType() int
type KeyValuePair ¶
type KeyValuePair struct { Name string Value ClarityValue }
type LPList ¶
type LPList struct { Type int `json:"type"` LengthPrefixBytes int `json:"lengthPrefixBytes"` Values []PostConditionInterface `json:"values"` }
type LegacyAddress ¶
func FromBase58 ¶
func FromBase58(b58 string) (*LegacyAddress, error)
type LengthPrefixedString ¶
type LengthPrefixedString struct { Content string `json:"content"` LengthPrefixBytes int `json:"lengthPrefixBytes"` MaxLengthBytes int `json:"maxLengthBytes"` Type int `json:"type"` }
func (LengthPrefixedString) GetType ¶
func (l LengthPrefixedString) GetType() int
type ListCV ¶
type ListCV struct { Type_ int `json:"type"` List []ClarityValue `json:"list"` }
type MessageSignature ¶
type NextSignature ¶
type NextSignature struct {
// contains filtered or unexported fields
}
type PostCondition ¶
type PostCondition struct { StacksMessage ConditionType int // Principal PostConditionPrincipal Principal PostConditionPrincipalInterface ConditionCode int }
func (PostCondition) GetType ¶
func (p PostCondition) GetType() int
type PostConditionInterface ¶
type PostConditionInterface interface { Message // contains filtered or unexported methods }
func DeserializePostCondition ¶
func DeserializePostCondition(postCondition string) PostConditionInterface
type PostConditionPrincipal ¶
type PostConditionPrincipalInterface ¶
type PostConditionPrincipalInterface interface {
// contains filtered or unexported methods
}
type PrincipalCV ¶
type ResponseCV ¶
type ResponseCV struct { Type_ int `json:"type"` Value ClarityValue `json:"value"` }
func (ResponseCV) GetType ¶
func (r ResponseCV) GetType() int
type STXPostCondition ¶
type STXPostCondition struct { PostCondition // contains filtered or unexported fields }
func (STXPostCondition) GetType ¶
func (s STXPostCondition) GetType() int
type SignedContractCallOptions ¶
type SignedContractCallOptions struct { ContractAddress string `json:"contractAddress"` ContractName string `json:"contractName"` FunctionName string `json:"functionName"` FunctionArgs []ClarityValue `json:"functionArgs"` SendKey string `json:"sendKey"` ValidateWithAbi bool `json:"validateWithAbi"` Fee big.Int `json:"fee"` Nonce big.Int `json:"nonce"` AnchorMode int `json:"anchorMode"` PostConditionMode int `json:"postConditionMode"` PostConditions []PostConditionInterface `json:"postConditions"` SerializePostConditions []string `json:"serializePostConditions"` }
type SomeCV ¶
type SomeCV struct { Type_ int `json:"type"` Value ClarityValue `json:"value"` }
type StacksMessage ¶
type StacksMessage struct {
Type int `json:"type"`
}
type StacksPrivateKey ¶
type StacksPublicKey ¶
type StacksTransaction ¶
type StacksTransaction struct { Version int `json:"version"` ChainId int64 `json:"chainId"` Auth StandardAuthorization `json:"auth"` AnchorMode int `json:"anchorMode"` Payload Payload `json:"payload"` PostConditionMode int `json:"postConditionMode"` PostConditions LPList `json:"postConditions"` }
func MakeContractCall ¶
func MakeContractCall(txOptions *SignedContractCallOptions) (*StacksTransaction, error)
type StacksTransferSig ¶
type StandardAuthorization ¶
type StandardAuthorization struct { AuthType uint64 `json:"authType"` SpendingCondition *SingleSigSpendingCondition `json:"spendingCondition"` SponsorSpendingCondition *SingleSigSpendingCondition `json:"sponsorSpendingCondition"` }
type StandardPrincipalCV ¶
func NewStandardPrincipalCV ¶
func NewStandardPrincipalCV(address string) *StandardPrincipalCV
func (StandardPrincipalCV) GetType ¶
func (s StandardPrincipalCV) GetType() int
type TokenTransferPayload ¶
type TokenTransferPayload struct { Type_ int `json:"type"` PayloadType int `json:"payloadType"` Recipient *StandardPrincipalCV `json:"recipient"` Amount big.Int `json:"amount"` Memo *Memo `json:"memo"` }
type TransactionRes ¶
type TransactionSigner ¶
type TransactionSigner struct {
// contains filtered or unexported fields
}
type TupleCV ¶
type TupleCV struct { Type int `json:"type"` Data map[string]ClarityValue `json:"data"` }
func GetPoxAddress ¶
Click to show internal directories.
Click to hide internal directories.