Documentation ¶
Index ¶
- Constants
- func Address2Hex(address string) string
- func Hex2Address(hexStr string) (string, error)
- type Account
- type AccountAsset
- type Block
- type BlockHeader
- type BlockRawData
- type Client
- type CreateTransactionResponse
- type Fee
- type Parameter
- type ParameterValue
- type RawData
- type RawDataContractInfo
- type RetInfo
- type Transaction
- type TransactionReceipt
Constants ¶
View Source
const (
//TrxPrefix .
TrxPrefix = "TRX"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct { AccountName string `json:"account_name"` Address string `json:"address"` Balance uint64 `json:"balance"` Asset []AccountAsset `json:"assetV2"` }
Account .
type AccountAsset ¶
AccountAsset .
type Block ¶
type Block struct { BlockID string `json:"blockID"` BlockHeader BlockHeader `json:"block_header"` Transactions []TransactionReceipt `json:"transactions"` }
Block .
type BlockHeader ¶
type BlockHeader struct { RawData BlockRawData `json:"raw_data"` WitnessSignature string `json:"witness_signature"` }
BlockHeader .
type BlockRawData ¶
type BlockRawData struct { Number int64 `json:"number"` TxTrieRoot string `json:"txTrieRoot"` WitnessAddress string `json:"witness_address"` ParentHash string `json:"parentHash"` Version uint `json:"version"` Timestamp uint64 `json:"timestamp"` }
BlockRawData .
type Client ¶
type Client interface { GetAccount(address string) (*Account, error) GetBalance(addr string, asset string) (uint64, error) CreateTransaction(from, to, asset string, amount uint32) (*CreateTransactionResponse, error) // Transfer(keyManager KeyManager, transfers []Transfer) (*TxCommitResult, error) // GetTokens() ([]Token, error) GetTransactionReceipt(txid string) (*TransactionReceipt, error) GetTransactionFee(txid string) (*Fee, error) GetBlockByNumber(height uint32) (*Block, error) BestBlockNumber() (uint32, error) SendRawTransaction(tx []byte) (string, error) }
Client .
type CreateTransactionResponse ¶
type CreateTransactionResponse struct { Visible bool `json:"visible"` TxID string `json:"txID"` RawData RawData `json:"raw_data"` RawDataHex string `json:"raw_data_hex"` Signature []string `json:"signature"` }
CreateTransactionResponse .
type Fee ¶
type Fee struct { TxID string `json:"id"` Fee uint64 `json:"fee"` BlockNumber uint64 `json:"blockNumber"` BlockTimeStamp uint64 `json:"blockTimeStamp"` }
Fee .
type Parameter ¶
type Parameter struct { Value ParameterValue `json:"value"` TypeURL string `json:"type_url"` }
Parameter .
type ParameterValue ¶
type ParameterValue struct { OwnerAddress string `json:"owner_address"` Amount uint64 `json:"amount"` //transaction receipt interface 含有 AssetName string `json:"asset_name"` //transaction receipt interface 含有 ToAddress string `json:"to_address"` //transaction receipt interface 含有 Data string `json:"data"` //block interface 含有 ContractAddress string `json:"contract_address"` //block interface 含有 }
ParameterValue .
type RawData ¶
type RawData struct { Contract []RawDataContractInfo `json:"contract"` RefBlockBytes string `json:"ref_block_bytes"` RefBlockHash string `json:"ref_block_hash"` Expiration uint64 `json:"expiration"` Timestamp uint64 `json:"timestamp"` }
RawData .
type RawDataContractInfo ¶
type RawDataContractInfo struct { Parameter Parameter `json:"parameter"` Type string `json:"type"` }
RawDataContractInfo .
type Transaction ¶
type Transaction struct { ParameterValue TxID string `json:"tx_id"` State string `json:"state"` TxType string `json:"tx_type"` }
Transaction .
Click to show internal directories.
Click to hide internal directories.