api

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// COIN defines the type for stakes in coin.
	StakeType_Coin StakeType = validatortypes.StakeType_Coin
	// NFT defines the type for stakes in NFT.
	StakeType_NFT StakeType = validatortypes.StakeType_NFT

	// UNSPECIFIED defines an invalid validator status.
	BondStatus_Unspecified BondStatus = validatortypes.BondStatus_Unspecified
	// UNBONDED defines a validator that is not bonded.
	BondStatus_Unbonded BondStatus = validatortypes.BondStatus_Unbonded
	// UNBONDING defines a validator that is unbonding.
	BondStatus_Unbonding BondStatus = validatortypes.BondStatus_Unbonding
	// BONDED defines a validator that is bonded.
	BondStatus_Bonded BondStatus = validatortypes.BondStatus_Bonded
)
View Source
const QuotePair = "usd"

Variables

This section is empty.

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

func (api *API) AccountNumberAndSequence(address string) (uint64, uint64, error)

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) AddressBalance

func (api *API) AddressBalance(address string) (sdk.Coins, error)

func (*API) AllAccounts added in v0.0.8

func (api *API) AllAccounts() ([]string, error)

AllAccounts returns full list of accounts in blockchain

func (*API) BaseCoin

func (api *API) BaseCoin() string

BaseCoin() returns base coin symbol from genesis. Need for correct transaction building

func (*API) BroadcastTxCommit

func (api *API) BroadcastTxCommit(data []byte) (*TxSyncResponse, error)

func (*API) BroadcastTxSync

func (api *API) BroadcastTxSync(data []byte) (*TxSyncResponse, error)

func (*API) ChainID

func (api *API) ChainID() string

ChainID() returns blockchain network chain id

func (*API) Close

func (api *API) Close() error

func (*API) Coin added in v0.1.0

func (api *API) Coin(denom string) (Coin, error)

func (*API) Coins

func (api *API) Coins() ([]Coin, error)

func (*API) GetFeeCalculationOptions added in v0.0.8

func (api *API) GetFeeCalculationOptions() *tx.FeeCalculationOptions

func (*API) GetFeeParams added in v0.0.8

func (api *API) GetFeeParams(baseDenom, quoteDenom string) (sdk.Dec, feetypes.Params, error)

GetFeeParams returns all for ccorrect transaction fee calculation

func (*API) GetLastHeight added in v0.0.8

func (api *API) GetLastHeight() int64

GetParameters() get blockchain parameters

func (*API) GetParameters

func (api *API) GetParameters() error

GetParameters() get blockchain parameters

func (*API) GetSupply added in v0.1.0

func (api *API) GetSupply(denom string) (sdk.Int, error)

func (*API) MultisigTransactionsByID

func (api *API) MultisigTransactionsByID(txID string) (MultisigTransactionInfo, 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(creator, denom string) (NFTCollection, error)

Returns NFT IDs from collection

func (*API) NFTCollections

func (api *API) NFTCollections() ([]NFTCollection, error)

Returns all NFT collections (denoms)

func (*API) NFTSubToken added in v0.0.8

func (api *API) NFTSubToken(tokenID string, subTokenID string) (SubToken, error)

func (*API) NFTToken added in v0.0.8

func (api *API) NFTToken(id string) (NFTToken, error)

func (*API) SimulateTx added in v0.0.8

func (api *API) SimulateTx(data []byte) (*TxSimulateResponse, error)

func (*API) Transaction

func (api *API) Transaction(hash string) (*TxResult, error)

func (*API) TransactionsByBlock

func (api *API) TransactionsByBlock(height uint64) ([]string, error)

TODO

func (*API) ValidatorDelegations added in v0.0.8

func (api *API) ValidatorDelegations(validator string) ([]Delegation, error)

func (*API) ValidatorRedelegations added in v0.0.8

func (api *API) ValidatorRedelegations(validator string) ([]Redelegation, error)

func (*API) ValidatorUndelegations added in v0.0.8

func (api *API) ValidatorUndelegations(validator string) ([]Undelegation, error)

func (*API) Validators added in v0.0.8

func (api *API) Validators() ([]Validator, error)

type AddressResult

type AddressResult struct {
	ID      uint64
	Address string
	Nonce   uint64
}

AddressResult contains API response fields.

type BondStatus added in v0.1.0

type BondStatus = validatortypes.BondStatus

type Coin

type Coin = cointypes.Coin

type ConnectionOptions

type ConnectionOptions struct {
	EndpointHost string // hostname or IP without any protocol description like "http://"
	GRPCPort     int    // gRPC port, default 9090
	Timeout      uint   // timeout in seconds
}

type Delegation added in v0.0.8

type Delegation = validatortypes.Delegation

type MultisigTransaction

type MultisigTransaction = multisigtypes.Transaction

type MultisigTransactionInfo added in v0.0.8

type MultisigTransactionInfo struct {
	Transaction MultisigTransaction
	Signers     []string
	Completed   bool
}

type MultisigWallet

type MultisigWallet = multisigtypes.Wallet

type NFTCollection

type NFTCollection = nfttypes.Collection

type NFTToken added in v0.0.8

type NFTToken = nfttypes.Token

type Redelegation added in v0.0.8

type Redelegation = validatortypes.Redelegation

type Stake added in v0.0.8

type Stake = validatortypes.Stake

type StakeType added in v0.0.8

type StakeType = validatortypes.StakeType

type SubToken

type SubToken = nfttypes.SubToken

type TxAttribute

type TxAttribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

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.

type TxResult

type TxResult struct {
	Height    int64
	Code      uint32
	GasWanted int64
	GasUsed   int64
	Codespace string
	RawLog    string
	Log       []TxLog
	Events    []tmtypes.Event
}

type TxSimulateResponse added in v0.0.8

type TxSimulateResponse struct {
	Log    string
	Events []tmtypes.Event
}

type TxSyncResponse

type TxSyncResponse struct {
	// transaction hash
	Hash string
	// error info. Code = 0 mean no error
	Code      uint32
	Log       string
	Codespace string
	Events    []tmtypes.Event
}

Response of broadcast_tx_sync

type Undelegation added in v0.0.8

type Undelegation = validatortypes.Undelegation

type Validator added in v0.0.8

type Validator = validatortypes.Validator

Jump to

Keyboard shortcuts

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