Documentation ¶
Index ¶
- Constants
- func DeserializeCVUint(src []byte) (*big.Int, error)
- func SerializeCVTuple(tuple CVTuple) []byte
- type AddressTransaction
- type Block
- type CVTuple
- type ContractCall
- type DataMapEntry
- 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
- type TxResult
Constants ¶
View Source
const ( StacksURL = "https://api.mainnet.hiro.so" DefaultSleepBetweenCalls = 1000 // 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.
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 only supports uint and bool values at the moment, therefore it should NOT be used as a complete solution to deserialize any arbitrary clarity tuple.
type ContractCall ¶
type ContractCall struct { ContractID string `json:"contract_id"` FunctionName string `json:"function_name"` FunctionArgs []FunctionArg `json:"function_args"` }
type DataMapEntry ¶
type FunctionArg ¶
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 TxResult `json:"tx_result"` ContractCall ContractCall `json:"contract_call"` }
Click to show internal directories.
Click to hide internal directories.