Documentation
¶
Index ¶
- type Asset
- type Assets
- type Block
- type BlockInfo
- type Client
- func (c *Client) BalanceOfErc20Usdt(from string) (map[string]interface{}, error)
- func (c *Client) CheckBlockNumber() (blocknumber int64)
- func (c *Client) CheckHash(hash string) (status int, blocknumber int)
- func (cli *Client) GetAccountById(add string) (info *Assets, err error)
- func (cli *Client) GetAssetissueByAccount(add string) (info *Assets, err error)
- func (cli *Client) GetBalance(add string) (info *Assets, err error)
- func (c *Client) GetBalanceByContract(address, contractid string) (balance float64)
- func (c *Client) GetBalanceX(address string) ([]Asset, error)
- func (cli *Client) GetBlockByHeight(num int64) (info *Block, err error)
- func (cli *Client) GetBlockInfo() (info *BlockInfo, err error)
- func (cli *Client) GetContract(value string) (res string, err error)
- func (c *Client) GetHeight() int64
- func (cli *Client) GetLastBlock() (lastblock LastBlock, err error)
- func (cli *Client) GetTransactionByHash(hash string) (info *Transactions, err error)
- func (c *Client) GetTransactionByIDEx(hash string) (map[string]interface{}, error)
- func (cli *Client) GetTransactionInfoByHash(hash string) (info *TransactionInfo, err error)
- func (cli *Client) PushTransaction(sign string) (tx *TxResult, err error)
- func (c *Client) SendErc20Usdt(signerAddress tronAddress, to string, amount string) (map[string]interface{}, error)
- func (c *Client) Start() (err error)
- func (c *Client) Stop()
- type LastBlock
- type Transaction
- type TransactionInfo
- type Transactions
- type TriggerConstantContractReq
- type TriggerConstantContractResp
- type TxResult
- type TxRet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assets ¶
type Assets struct {
Address string `json:"address"`
Balance int64 `json:"balance"`
Asset []struct {
Key string `json:"key"`
Value int `json:"value"`
} `json:"asset"`
CreateTime int64 `json:"create_time"`
LatestOprationTime int64 `json:"latest_opration_time"`
FreeNetUsage int `json:"free_net_usage"`
LatestConsumeFreeTime int64 `json:"latest_consume_free_time"`
AccountResource struct {
EnergyUsage int `json:"energy_usage"`
LatestConsumeTimeForEnergy int64 `json:"latest_consume_time_for_energy"`
AcquiredDelegatedFrozenBalanceForEnergy int `json:"acquired_delegated_frozen_balance_for_energy"`
} `json:"account_resource"`
AcquiredDelegatedFrozenBalanceForBandwidth int `json:"acquired_delegated_frozen_balance_for_bandwidth"`
AssetV2 []struct {
Key string `json:"key"`
Value int `json:"value"`
} `json:"assetV2"`
FreeAssetNetUsageV2 []struct {
Key string `json:"key"`
Value int `json:"value"`
} `json:"free_asset_net_usageV2"`
}
type Block ¶
type Block struct {
BlockID string `json:"blockID"`
BlockHeader struct {
RawData struct {
Number int `json:"number"`
TxTrieRoot string `json:"txTrieRoot"`
WitnessAddress string `json:"witness_address"`
ParentHash string `json:"parentHash"`
Version int `json:"version"`
Timestamp int64 `json:"timestamp"`
} `json:"raw_data"`
WitnessSignature string `json:"witness_signature"`
} `json:"block_header"`
Transactions []Transactions `json:"transactions"`
}
type BlockInfo ¶
type BlockInfo struct {
BlockID string `json:"blockID"`
BlockHeader struct {
RawData struct {
Number int `json:"number"`
TxTrieRoot string `json:"txTrieRoot"`
WitnessAddress string `json:"witness_address"`
ParentHash string `json:"parentHash"`
Version int `json:"version"`
Timestamp int64 `json:"timestamp"`
} `json:"raw_data"`
WitnessSignature string `json:"witness_signature"`
} `json:"block_header"`
Transactions []struct {
Ret []struct {
ContractRet string `json:"contractRet"`
} `json:"ret"`
Signature []string `json:"signature"`
TxID string `json:"txID"`
RawData struct {
Contract []struct {
Parameter struct {
Value struct {
Data string `json:"data"`
Amount int `json:"amount"`
AssetName string `json:"asset_name"`
OwnerAddress string `json:"owner_address"`
ToAddress string `json:"to_address"`
} `json:"value"`
TypeURL string `json:"type_url"`
} `json:"parameter"`
Type string `json:"type"`
} `json:"contract"`
RefBlockBytes string `json:"ref_block_bytes"`
RefBlockHash string `json:"ref_block_hash"`
Expiration int64 `json:"expiration"`
Timestamp int64 `json:"timestamp"`
} `json:"raw_data,omitempty"`
} `json:"transactions"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BalanceOfErc20Usdt ¶
func (*Client) CheckBlockNumber ¶
func (*Client) GetAccountById ¶
func (*Client) GetAssetissueByAccount ¶
func (*Client) GetBalanceByContract ¶
func (*Client) GetBalanceX ¶
GetBalance 查询地址余额
func (*Client) GetBlockByHeight ¶
func (*Client) GetBlockInfo ¶
func (*Client) GetLastBlock ¶
func (*Client) GetTransactionByHash ¶
func (cli *Client) GetTransactionByHash(hash string) (info *Transactions, err error)
func (*Client) GetTransactionByIDEx ¶
GetTransactionByIDEx 根据hash获取交易信息
func (*Client) GetTransactionInfoByHash ¶
func (cli *Client) GetTransactionInfoByHash(hash string) (info *TransactionInfo, err error)
func (*Client) PushTransaction ¶
type LastBlock ¶
type LastBlock struct {
Number int `json:"number"`
Hash string `json:"hash"`
Size int `json:"size"`
Timestamp int64 `json:"timestamp"`
TxTrieRoot string `json:"txTrieRoot"`
ParentHash string `json:"parentHash"`
WitnessID int `json:"witnessId"`
WitnessAddress string `json:"witnessAddress"`
NrOfTrx int `json:"nrOfTrx"`
Confirmed bool `json:"confirmed"`
}
type Transaction ¶
type Transaction struct {
Block int `json:"block"`
Hash string `json:"hash"`
Timestamp int64 `json:"timestamp"`
OwnerAddress string `json:"ownerAddress"`
ToAddress string `json:"toAddress"`
ContractType int `json:"contractType"`
Confirmed bool `json:"confirmed"`
ContractRet string `json:"contractRet"`
ContractData struct {
Data string `json:"data"`
OwnerAddress string `json:"owner_address"`
ContractAddress string `json:"contract_address"`
CallValue int `json:"call_value"`
} `json:"contractData"`
Data string `json:"data"`
Cost struct {
NetUsage int `json:"net_usage"`
NetFee int `json:"net_fee"`
EnergyUsage int `json:"energy_usage"`
EnergyFee int `json:"energy_fee"`
OriginEnergyUsage int `json:"origin_energy_usage"`
EnergyUsageTotal int `json:"energy_usage_total"`
} `json:"cost"`
TriggerInfo struct {
Method string `json:"method"`
Parameter struct {
Number string `json:"_number"`
Direction string `json:"_direction"`
} `json:"parameter"`
CallValue int `json:"call_value"`
} `json:"trigger_info"`
InternalTransactions struct {
Num1 []struct {
TransactionID string `json:"transaction_id"`
CallerAddress string `json:"caller_address"`
Note string `json:"note"`
Rejected bool `json:"rejected"`
ValueInfoList string `json:"value_info_list"`
DateCreated int64 `json:"date_created"`
Block int `json:"block"`
Hash string `json:"hash"`
TransferToAddress string `json:"transfer_to_address"`
} `json:"1"`
} `json:"internal_transactions"`
}
type TransactionInfo ¶
type TransactionInfo struct {
BlockNumber int64 `json:"blockNumber"`
BlockTimeStamp int64 `json:"blockTimeStamp"`
ContractResult []string `json:"contractResult"`
ContractAddress string `json:"contract_address"`
Fee int64 `json:"fee"`
ID string `json:"id"`
Log []struct {
Address string `json:"address"`
Data string `json:"data"`
Topics []string `json:"topics"`
} `json:"log"`
Receipt struct {
EnergyFee int64 `json:"energy_fee"`
EnergyUsageTotal int64 `json:"energy_usage_total"`
NetUsage int64 `json:"net_usage"`
Result string `json:"result"`
} `json:"receipt"`
}
type Transactions ¶
type Transactions struct {
RawData struct {
Contract []struct {
Parameter struct {
TypeURL string `json:"type_url"`
Value struct {
AccountAddress string `json:"account_address"`
Amount int64 `json:"amount"`
CallValue int64 `json:"call_value"`
ContractAddress string `json:"contract_address"`
Data string `json:"data"`
OwnerAddress string `json:"owner_address"`
ToAddress string `json:"to_address"`
} `json:"value"`
} `json:"parameter"`
Type string `json:"type"`
} `json:"contract"`
Data string `json:"data"`
Expiration int64 `json:"expiration"`
FeeLimit int64 `json:"fee_limit"`
RefBlockBytes string `json:"ref_block_bytes"`
RefBlockHash string `json:"ref_block_hash"`
Timestamp int64 `json:"timestamp"`
} `json:"raw_data"`
RawDataHex string `json:"raw_data_hex"`
Ret []struct {
ContractRet string `json:"contractRet"`
} `json:"ret"`
Signature []string `json:"signature"`
TxID string `json:"txID"`
}
type TriggerConstantContractReq ¶
type TriggerConstantContractReq struct {
ContractAddress string `json:"contract_address"`
FunctionSelector string `json:"function_selector"`
Parameter string `json:"parameter"`
FeeLimit int `json:"fee_limit"`
CallValue int `json:"call_value"`
OwnerAddress string `json:"owner_address"`
Visible bool `json:"visible"`
}
Click to show internal directories.
Click to hide internal directories.