Documentation ¶
Index ¶
- Variables
- func IsErrBlackList(err error) bool
- func IsErrResponseValidationFailed(err error) bool
- func NewErrResponseValidationFailedFrom(err error) error
- type BeJsonRpcResponse
- type BlockInResponseBeTransactionsInBlockRange
- type ContractInvolversInTransactionInBlockInResponseBeTransactionsInBlockRange
- type InfoInTransactionInBlockInResponseBeTransactionsInBlockRange
- type InvolversInTransactionInBlockInResponseBeTransactionsInBlockRange
- type ResponseBeGetChainInfo
- type ResponseBeGetLatestBlockNumber
- type ResponseBeTransactionsInBlockRange
- type RetryOption
- type TransactionInBlockInResponseBeTransactionsInBlockRange
- type TransformedResponseBeTransactionsInBlockRange
Constants ¶
This section is empty.
Variables ¶
var ErrBlackList = errors.New("black list")
ErrBlackList is the error when the response contains critical issue
var ErrBlackListDueToMalformedResponse = errors.Wrapf(ErrBlackList, "malformed response")
var ErrBlackListDueToMisMatchChainId = errors.Wrap(ErrBlackList, "mis-match chain-id")
var ErrResponseValidationFailed = errors.New("response validation failed")
ErrResponseValidationFailed is the error when the response does not pass the validation
Functions ¶
func IsErrBlackList ¶
IsErrBlackList returns true if the error indicate the response contains critical issue, the URL should be ignored
func IsErrResponseValidationFailed ¶
IsErrResponseValidationFailed returns true if the error indicate the response does not pass the validation
Types ¶
type BeJsonRpcResponse ¶
type BeJsonRpcResponse interface { // ValidateBasic ensure response might be valid by performing some basic validation ValidateBasic() error }
type BlockInResponseBeTransactionsInBlockRange ¶
type BlockInResponseBeTransactionsInBlockRange struct { Height int64 `json:"-"` // extracted from key TimeEpochUTC int64 `json:"timeEpochUTC"` Transactions []TransactionInBlockInResponseBeTransactionsInBlockRange `json:"txs"` }
type InfoInTransactionInBlockInResponseBeTransactionsInBlockRange ¶
type InfoInTransactionInBlockInResponseBeTransactionsInBlockRange struct { Action string `json:"action,omitempty"` MethodSignature string `json:"sig,omitempty"` }
func (*InfoInTransactionInBlockInResponseBeTransactionsInBlockRange) String ¶
func (m *InfoInTransactionInBlockInResponseBeTransactionsInBlockRange) String() string
type InvolversInTransactionInBlockInResponseBeTransactionsInBlockRange ¶
type InvolversInTransactionInBlockInResponseBeTransactionsInBlockRange struct { Signers []string `json:"s,omitempty"` Others []string `json:"0,omitempty"` Erc20 []string `json:"erc20,omitempty"` NFT []string `json:"nft,omitempty"` TokenContracts ContractInvolversInTransactionInBlockInResponseBeTransactionsInBlockRange `json:"contracts,omitempty"` }
type ResponseBeGetChainInfo ¶
type ResponseBeGetChainInfo struct { Bech32 map[string]string `json:"bech32"` ChainId string `json:"chainId"` ChainType string `json:"chainType"` Denom map[string]string `json:"denoms"` LatestBlock int64 `json:"latestBlock"` LatestBlockTimeEpochUTC int64 `json:"latestBlockTimeEpochUTC"` }
ResponseBeGetChainInfo is the response for `be_getChainInfo`
func (ResponseBeGetChainInfo) ValidateBasic ¶
func (r ResponseBeGetChainInfo) ValidateBasic() error
type ResponseBeGetLatestBlockNumber ¶
type ResponseBeGetLatestBlockNumber struct { LatestBlock int64 `json:"latestBlock"` LatestBlockTimeEpochUTC int64 `json:"latestBlockTimeEpochUTC"` }
ResponseBeGetLatestBlockNumber is the response for `be_getLatestBlockNumber`
func (ResponseBeGetLatestBlockNumber) ValidateBasic ¶
func (r ResponseBeGetLatestBlockNumber) ValidateBasic() error
type ResponseBeTransactionsInBlockRange ¶
type ResponseBeTransactionsInBlockRange struct { ChainId string `json:"chainId"` Blocks map[string]BlockInResponseBeTransactionsInBlockRange `json:"blocks"` MissingBlocks []int64 `json:"missingBlocks"` ErrorBlocks []int64 `json:"errorBlocks"` }
ResponseBeTransactionsInBlockRange is the response for `be_getTransactionsInBlockRange`
func (ResponseBeTransactionsInBlockRange) ValidateBasic ¶
func (r ResponseBeTransactionsInBlockRange) ValidateBasic() error
type RetryOption ¶
func DefaultRetryOption ¶
func DefaultRetryOption() RetryOption
func (RetryOption) MaxDuration ¶
func (m RetryOption) MaxDuration(maximumRetryDuration time.Duration) RetryOption
func (RetryOption) MinCount ¶
func (m RetryOption) MinCount(minRetryCount int) RetryOption
type TransactionInBlockInResponseBeTransactionsInBlockRange ¶
type TransactionInBlockInResponseBeTransactionsInBlockRange struct { TransactionHash string `json:"hash"` Involvers InvolversInTransactionInBlockInResponseBeTransactionsInBlockRange `json:"involvers"` MessagesType []string `json:"messagesType"` TransactionType string `json:"type"` EvmTxInfo *InfoInTransactionInBlockInResponseBeTransactionsInBlockRange `json:"evmTx,omitempty"` WasmTxInfo *InfoInTransactionInBlockInResponseBeTransactionsInBlockRange `json:"wasmTx,omitempty"` Value string `json:"value,omitempty"` }
type TransformedResponseBeTransactionsInBlockRange ¶
type TransformedResponseBeTransactionsInBlockRange struct { Blocks []BlockInResponseBeTransactionsInBlockRange `json:"blocks"` MissingBlocks []int64 `json:"missingBlocks"` ErrorBlocks []int64 `json:"errorBlocks"` }
TransformedResponseBeTransactionsInBlockRange is ResponseBeTransactionsInBlockRange after transformed