types

package
v0.0.0-...-4fc266b Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockInfo

type BlockInfo struct {
	BlockID      string          `json:"blockID"`
	Number       int             `json:"number"`
	ParentHash   string          `json:"parentHash"`
	Timestamp    int64           `json:"timestamp"`
	Transactions []*TransferInfo `json:"transactions"`
}

type ChainClientBalances

type ChainClientBalances interface {
	BalanceOf(address string) (balance *big.Int, err error)
	TokensBalanceOf(address string, token string) (balance *big.Int, err error)
}

type ChainClientBlocks

type ChainClientBlocks interface {
	BlockNum() (blockNum int64, err error)
	BlockByNum(blockNum int64, fullInfo bool) (block *BlockInfo, err error)
	BlockByHash(blockHash string, fullInfo bool) (block *BlockInfo, err error)
}

type ChainClientCoinTransfer

type ChainClientCoinTransfer interface {
	TransferByPrivateKey(fromPrivateKey []byte, from, to string, amount *big.Int) (txHash string, err error)
	TransferGetEstimatedFee(from, to string, amount *big.Int) (fee *big.Int, err error)
	TransferAllByPrivateKey(fromPrivateKey []byte, from, to string) (txHash string, err error)
}

type ChainClientInfo

type ChainClientInfo interface {
	GetChainId() (chainId string)
	GetChainName() (chainName string)
	GetChainSymbol() (chainSymbol string)
	GetAddressCodec() address.AddressCodec
	Decimals() (decimals int)
	TokensList() (tokensList []*TokenInfo)
	MinConfirmations() (confirmations int)
	TokenProtocols() []string
}

type ChainClientMemPool

type ChainClientMemPool interface {
	MemPoolContent() (txs []*TransferInfo, err error)
}

type ChainClientTokenTransfer

type ChainClientTokenTransfer interface {
	TransferTokenByPrivateKey(fromPrivateKey []byte, from, to string, amount *big.Int, token string) (txHash string, err error)
	TransferAllTokenByPrivateKey(fromPrivateKey []byte, from, to string, token string) (txHash string, err error)
	TransferTokenGetEstimatedFee(from, to string, amount *big.Int, token string) (fee *big.Int, err error)
}

type ChainClientTransactions

type ChainClientTransactions interface {
	TransferInfoByHash(txHash string) (tx *TransferInfo, err error)
	TransferInfoByNum(blockNum int64, txIndex int) (tx *TransferInfo, err error)
}

type Config

type Config interface {
	Flag(flagName string) bool
	String(flagName, defaultValue string) string
	Int(flagName string, defaultValue int) int
}

type DataDecoder

type DataDecoder func([]byte) error

type TokenInfo

type TokenInfo struct {
	ContractAddress string `json:"contractAddress,omitempty"`
	Name            string `json:"name"`
	Symbol          string `json:"symbol"`
	Decimals        int    `json:"decimals"`
	Protocol        string `json:"protocol,omitempty"`
}

type TransferInfo

type TransferInfo struct {
	TxID              string   `json:"txId"`
	Timestamp         int64    `json:"timestamp"`
	BlockNum          int      `json:"blockNum"`
	Success           bool     `json:"success"`
	Transfer          bool     `json:"transfer"`
	NativeCoin        bool     `json:"nativeCoin,omitempty"`
	Symbol            string   `json:"symbol,omitempty"`
	SmartContract     bool     `json:"smartContract,omitempty"`
	From              string   `json:"from"`
	To                string   `json:"to"`
	Amount            *big.Int `json:"amount"`
	Token             string   `json:"token,omitempty"`
	TokenSymbol       string   `json:"tokenSymbol,omitempty"`
	Fee               *big.Int `json:"fee"`
	InPool            bool     `json:"inPool"`
	Confirmed         bool     `json:"confirmed"`
	Confirmations     int      `json:"confirmations"`
	Decimals          int      `json:"decimals"`
	ChainSpecificData []byte   `json:"chainSpecificData,omitempty"`
}

func (*TransferInfo) DecodeChainSpecificData

func (t *TransferInfo) DecodeChainSpecificData(decoder DataDecoder) error

type TxCache

type TxCache interface {
	GetTransferInfo(txHash string) (tx *TransferInfo, err error)
	GetTransfersByAddress(address string) (txs []*TransferInfo, err error)
}

Jump to

Keyboard shortcuts

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