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 ChainClient ¶
type ChainClient interface {
ChainClientInfo
ChainClientMemPool
ChainClientBlocks
ChainClientTransactions
ChainClientBalances
ChainClientCoinTransfer
ChainClientTokenTransfer
}
type ChainClientBalances ¶
type ChainClientBlocks ¶
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 DataDecoder ¶
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)
}
Click to show internal directories.
Click to hide internal directories.