types

package
v0.0.0-...-23cc077 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBlackList = errors.New("black list")

ErrBlackList is the error when the response contains critical issue

View Source
var ErrBlackListDueToMalformedResponse = errors.Wrapf(ErrBlackList, "malformed response")
View Source
var ErrBlackListDueToMisMatchChainId = errors.Wrap(ErrBlackList, "mis-match chain-id")
View Source
var ErrResponseValidationFailed = errors.New("response validation failed")

ErrResponseValidationFailed is the error when the response does not pass the validation

Functions

func IsErrBlackList

func IsErrBlackList(err error) bool

IsErrBlackList returns true if the error indicate the response contains critical issue, the URL should be ignored

func IsErrResponseValidationFailed

func IsErrResponseValidationFailed(err error) bool

IsErrResponseValidationFailed returns true if the error indicate the response does not pass the validation

func NewErrResponseValidationFailedFrom

func NewErrResponseValidationFailedFrom(err error) error

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 ContractInvolversInTransactionInBlockInResponseBeTransactionsInBlockRange

type ContractInvolversInTransactionInBlockInResponseBeTransactionsInBlockRange struct {
	Erc20 map[string][]string `json:"erc20,omitempty"`
	NFT   map[string][]string `json:"nft,omitempty"`
}

type InfoInTransactionInBlockInResponseBeTransactionsInBlockRange

type InfoInTransactionInBlockInResponseBeTransactionsInBlockRange struct {
	Action          string `json:"action,omitempty"`
	MethodSignature string `json:"sig,omitempty"`
}

func (*InfoInTransactionInBlockInResponseBeTransactionsInBlockRange) 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

type RetryOption struct {
	MinRetryCount        int
	MaximumRetryDuration time.Duration
}

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

Jump to

Keyboard shortcuts

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