Documentation ¶
Index ¶
- Constants
- func DeserializeCVUint(src []byte) (*big.Int, error)
- func SerializeCVTuple(tuple CVTuple) []byte
- func SerializeCVUint(value *big.Int) []byte
- type AddressTransaction
- type Block
- type CVTuple
- type ClarityValue
- type ContractCall
- type ContractLog
- type DataMapEntry
- type Event
- type FunctionArg
- type GetAddressTransactionsResponse
- type GetBlockTransactionsResponse
- type StacksClient
- func (c *StacksClient) GetAddressTransactions(address string, limit, offset int) (GetAddressTransactionsResponse, error)
- func (c *StacksClient) GetAllBlockTransactions(height int) ([]Transaction, error)
- func (c *StacksClient) GetDataMapEntry(contractId, mapName, key string) ([]byte, error)
- func (c *StacksClient) GetLatestBlock() (Block, error)
- func (c *StacksClient) GetTransactionAt(txID string) (Transaction, error)
- type Transaction
Constants ¶
View Source
const ( StacksURL = "https://api.mainnet.hiro.so" DefaultSleepBetweenCalls = 1000 // ms DefaultRefreshDelay = 10000 // ms MaxPageLimit = 50 )
Variables ¶
This section is empty.
Functions ¶
func DeserializeCVUint ¶
DeserializeCVUint converts a clarity 128-bit uint value into a `big.Int`.
func SerializeCVTuple ¶
SerializeCVTuple converts a clarity value tuple into its binary representation that can be used to call stacks smart contract functions.
func SerializeCVUint ¶ added in v1.4.544
SerializeCVUint converts a `big.Int` instance into Clarity value binary representation.
Types ¶
type AddressTransaction ¶
type AddressTransaction struct {
Tx Transaction `json:"tx"`
}
type CVTuple ¶
func DeserializeCVTuple ¶
DeserializeCVTuple converts binary representation of a clarity value tuple into a `CVTuple` map. IMPORTANT: this function supports a limited amount of Clarity types at the moment, therefore it should NOT be used as a complete solution to deserialize any arbitrary Clarity tuple.
type ClarityValue ¶ added in v1.4.544
type ContractCall ¶
type ContractCall struct { ContractID string `json:"contract_id"` FunctionName string `json:"function_name"` FunctionArgs []FunctionArg `json:"function_args"` }
type ContractLog ¶ added in v1.4.544
type ContractLog struct { ContractID string `json:"contract_id"` Topic string `json:"topic"` Value ClarityValue `json:"value"` }
type DataMapEntry ¶
type Event ¶ added in v1.4.544
type Event struct { Index int `json:"event_index"` Type string `json:"event_type"` ContractLog ContractLog `json:"contract_log"` }
type FunctionArg ¶
type FunctionArg struct { ClarityValue Name string `json:"name"` Type string `json:"type"` }
type GetAddressTransactionsResponse ¶
type GetAddressTransactionsResponse struct { Limit int `json:"limit"` Offset int `json:"offset"` Total int `json:"total"` Results []AddressTransaction `json:"results"` }
type GetBlockTransactionsResponse ¶
type GetBlockTransactionsResponse struct { Limit int `json:"limit"` Offset int `json:"offset"` Total int `json:"total"` Results []Transaction `json:"results"` }
type StacksClient ¶
type StacksClient struct {
// contains filtered or unexported fields
}
func NewStacksClient ¶
func (*StacksClient) GetAddressTransactions ¶
func (c *StacksClient) GetAddressTransactions(address string, limit, offset int) (GetAddressTransactionsResponse, error)
func (*StacksClient) GetAllBlockTransactions ¶
func (c *StacksClient) GetAllBlockTransactions(height int) ([]Transaction, error)
func (*StacksClient) GetDataMapEntry ¶
func (c *StacksClient) GetDataMapEntry(contractId, mapName, key string) ([]byte, error)
func (*StacksClient) GetLatestBlock ¶
func (c *StacksClient) GetLatestBlock() (Block, error)
func (*StacksClient) GetTransactionAt ¶
func (c *StacksClient) GetTransactionAt(txID string) (Transaction, error)
type Transaction ¶
type Transaction struct { TxID string `json:"tx_id"` SenderAddress string `json:"sender_address"` BlockHash string `json:"block_hash"` BlockHeight int `json:"block_height"` BlockTime int `json:"block_time"` TxStatus string `json:"tx_status"` TxType string `json:"tx_type"` TxResult ClarityValue `json:"tx_result"` ContractCall ContractCall `json:"contract_call"` Events []Event `json:"events"` }
Click to show internal directories.
Click to hide internal directories.