hiro

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultApiBase = "https://api.hiro.so"

Variables

This section is empty.

Functions

func ContractValidateSplit

func ContractValidateSplit(c string) ([]string, error)

Types

type APIClient

type APIClient struct {
	BaseURL string
	Client  *http.Client
}

func NewAPIClient

func NewAPIClient(baseURL string) *APIClient

func (*APIClient) GetAccountBalance

func (c *APIClient) GetAccountBalance(principal string) (BalanceResponse, error)

func (*APIClient) GetAllTokens

func (c *APIClient) GetAllTokens() ([]TokenResult, error)

func (*APIClient) GetContractDetails

func (c *APIClient) GetContractDetails(contractID string) (ContractDetailsResponse, error)

func (*APIClient) GetContractReadOnly

func (c *APIClient) GetContractReadOnly(id string, function string, responseType string, arguments []string) (string, error)

func (*APIClient) GetContractSource

func (c *APIClient) GetContractSource(id string) (string, error)

func (*APIClient) GetNFTHoldings

func (c *APIClient) GetNFTHoldings(principal string) ([]NFTHoldingResponseResults, error)

func (*APIClient) GetTokenHolders

func (c *APIClient) GetTokenHolders(contractID string, block int) (ContractHoldersResponse, error)

type Balance

type Balance struct {
	Balance       string `json:"balance"`
	TotalSent     string `json:"total_sent"`
	TotalReceived string `json:"total_received"`
}

type BalanceResponse

type BalanceResponse struct {
	Stx               Balance           `json:"stx"`
	FungibleTokens    FungibleTokens    `json:"fungible_tokens"`
	NonFungibleTokens NonFungibleTokens `json:"non_fungible_tokens"`
}

type ContractDetailsResponse

type ContractDetailsResponse struct {
	TxID           string `json:"tx_id"`
	Canonical      bool   `json:"canonical"`
	ContractID     string `json:"contract_id"`
	BlockHeight    int    `json:"block_height"`
	ClarityVersion int    `json:"clarity_version"`
	SourceCode     string `json:"source_code"`
	ABI            string `json:"abi"`
}

type ContractHoldersResponse

type ContractHoldersResponse map[string]string

type ContractSourceResponse

type ContractSourceResponse struct {
	Source        string `json:"source"`
	PublishHeight int    `json:"publish_height"`
	Proof         string `json:"proof"`
}

type FungibleTokens

type FungibleTokens map[string]Balance

type NFTHoldingResponse

type NFTHoldingResponse struct {
	Limit   int                         `json:"limit"`
	Offset  int                         `json:"offset"`
	Total   int                         `json:"total"`
	Results []NFTHoldingResponseResults `json:"results"`
}

type NFTHoldingResponseResults

type NFTHoldingResponseResults struct {
	AssetIdentifier string                         `json:"asset_identifier"`
	Value           NFTHoldingResponseResultsValue `json:"value"`
	BlockHeight     int                            `json:"block_height"`
	TxID            string                         `json:"tx_id"`
}

type NFTHoldingResponseResultsValue

type NFTHoldingResponseResultsValue struct {
	Hex  string `json:"hex"`
	Repr string `json:"repr"`
}

type NonFungibleTokens

type NonFungibleTokens map[string]struct {
	Count         string `json:"count"`
	TotalSent     string `json:"total_sent"`
	TotalReceived string `json:"total_received"`
}

type ReadOnlyPayload

type ReadOnlyPayload struct {
	Sender    string   `json:"sender"`
	Arguments []string `json:"arguments"`
}

type ReadOnlyResponse

type ReadOnlyResponse struct {
	Okay   bool   `json:"okay"`
	Result string `json:"result"`
}

type Response

type Response struct {
	Limit   int           `json:"limit"`
	Offset  int           `json:"offset"`
	Total   int           `json:"total"`
	Results []TokenResult `json:"results"`
}

type TokenResult

type TokenResult struct {
	Name              string `json:"name"`
	Symbol            string `json:"symbol"`
	Decimals          int    `json:"decimals"`
	TotalSupply       string `json:"total_supply"`
	TokenURI          string `json:"token_uri"`
	Description       string `json:"description"`
	ImageURI          string `json:"image_uri"`
	ImageCanonicalURI string `json:"image_canonical_uri"`
	TxID              string `json:"tx_id"`
	SenderAddress     string `json:"sender_address"`
	ContractPrincipal string `json:"contract_principal"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL