Documentation ¶
Index ¶
- Variables
- type API
- func (api *API) AccountNumberAndSequence(address string) (uint64, uint64, error)
- func (api *API) Address(address string) (*AddressResult, error)
- func (api *API) AddressBalance(address string) (sdk.Coins, error)
- func (api *API) BaseCoin() string
- func (api *API) BroadcastTxCommit(data []byte) (*TxSyncResponse, error)
- func (api *API) BroadcastTxSync(data []byte) (*TxSyncResponse, error)
- func (api *API) ChainID() string
- func (api *API) Close() error
- func (api *API) Coins() ([]Coin, error)
- func (api *API) GetParameters() error
- func (api *API) MaxGas() uint64
- func (api *API) MultisigTransactionsByID(txID string) (MultisigTransaction, error)
- func (api *API) MultisigTransactionsByWallet(address string) ([]MultisigTransaction, error)
- func (api *API) MultisigWalletByAddress(address string) (MultisigWallet, error)
- func (api *API) MultisigWalletsByOwner(owner string) ([]MultisigWallet, error)
- func (api *API) NFT(denom string, id string) (NFT, error)
- func (api *API) NFTCollection(denom string) (NFTCollection, error)
- func (api *API) NFTCollections() ([]string, error)
- func (api *API) NFTSubTokens(denom string, tokenID string, ids []uint64) ([]SubToken, error)
- func (api *API) Transaction(hash string) (*TxResult, error)
- func (api *API) TransactionsByBlock(height uint64) ([]string, error)
- type AddressResult
- type Coin
- type ConnectionOptions
- type Error
- type Logger
- type MultisigTransaction
- type MultisigWallet
- type NFT
- type NFTCollection
- type RPCError
- type ResponseError
- type SubToken
- type TxAttribute
- type TxEvent
- type TxLog
- type TxResult
- type TxSyncResponse
Constants ¶
This section is empty.
Variables ¶
var ErrIsRPCError = errors.New("rpc error")
Error indicating for universal decoding
var ErrMissingLogic = errors.New("universal JSON decode missing logic")
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API struct accumulates all queries to blockchain node and makes broadcast of prepared transaction
func NewAPI ¶
func NewAPI(opts ConnectionOptions) (*API, error)
func (*API) AccountNumberAndSequence ¶
AccountNumberAndSequence requests account number and current sequence (nonce) of specified address.
func (*API) Address ¶
func (api *API) Address(address string) (*AddressResult, error)
Address requests full information about specified address
func (*API) BaseCoin ¶
BaseCoin() returns base coin symbol from genesis. Need for correct transaction building
func (*API) BroadcastTxCommit ¶
func (api *API) BroadcastTxCommit(data []byte) (*TxSyncResponse, error)
Send transaction data in commit mode. NOTE: marked by tendermint as deprecated
func (*API) BroadcastTxSync ¶
func (api *API) BroadcastTxSync(data []byte) (*TxSyncResponse, error)
Send transaction data in sync mode. NOTE: marked by tendermint as deprecated
func (*API) GetParameters ¶
GetParameters() get blockchain parameters
func (*API) MultisigTransactionsByID ¶
func (api *API) MultisigTransactionsByID(txID string) (MultisigTransaction, error)
func (*API) MultisigTransactionsByWallet ¶
func (api *API) MultisigTransactionsByWallet(address string) ([]MultisigTransaction, error)
func (*API) MultisigWalletByAddress ¶
func (api *API) MultisigWalletByAddress(address string) (MultisigWallet, error)
func (*API) MultisigWalletsByOwner ¶
func (api *API) MultisigWalletsByOwner(owner string) ([]MultisigWallet, error)
func (*API) NFTCollection ¶
func (api *API) NFTCollection(denom string) (NFTCollection, error)
Returns NFT IDs from collection
func (*API) NFTCollections ¶
Returns all NFT collections (denoms)
func (*API) NFTSubTokens ¶
type AddressResult ¶
AddressResult contains API response fields.
type ConnectionOptions ¶
type ConnectionOptions struct { EndpointHost string // hostname or IP without any protocol description like "http://" TendermintPort int // tendermint RPC port, default 26657 GRPCPort int // gRPC port, default 9090 Timeout uint // timeout in seconds Debug bool //turn on debugging via stdlib log UseGRPC bool }
type Error ¶
type Error struct { StatusCode int `json:"statusCode"` Message string `json:"message"` Err string `json:"error"` }
Error contains Decimal API error response fields.
type MultisigTransaction ¶
type MultisigTransaction = multisigTypes.Transaction
type MultisigWallet ¶
type MultisigWallet = multisigTypes.Wallet
type NFTCollection ¶
type NFTCollection = nftTypes.Collection
type RPCError ¶
type RPCError struct { Code int `json:"code"` Message string `json:"message"` Data string `json:"data"` }
direct error
type ResponseError ¶
ResponseError wraps Resty response error and allows to generate error info.
func NewResponseError ¶
func NewResponseError(response *resty.Response) *ResponseError
NewResponseError creates new ResponseError object.
func (ResponseError) Error ¶
func (res ResponseError) Error() string
Error returns error info as JSON string.
type TxAttribute ¶
TxAttribute contains API response fields.
type TxEvent ¶
type TxEvent struct { Type string `json:"type"` Attributes []TxAttribute `json:"attributes"` }
TxEvent contains API response fields.
type TxLog ¶
type TxLog struct {
Events []TxEvent `json:"events"`
}
TxLog contains API response fields.