Documentation ¶
Index ¶
- Constants
- Variables
- func ByteToPublicKey(pub []byte) (*ecdsa.PublicKey, error)
- func BytesToPrivateKey(priv []byte) (*ecdsa.PrivateKey, error)
- func HashMessage(m proto.Message) ([]byte, error)
- func ParseContractTxResult(tx *core.Transaction, runErr error) (fee int64, err error)
- type HTTPError
- type HttpClient
- type Receipt
- type TronClient
- func (c *TronClient) CallContract(cctx context.Context, from, contract address.Address, data []byte) (*api.TransactionExtention, error)
- func (c *TronClient) ChainId() *big.Int
- func (c *TronClient) Close() (err error)
- func (c *TronClient) FilterLogs(cctx context.Context, from, to int64, addr []byte, topicss ...[][]byte) ([]types.Log, error)
- func (c *TronClient) GetAccount(cctx context.Context, addr []byte) (*core.Account, error)
- func (c *TronClient) GetBlock(cctx context.Context, num int64) (*api.BlockExtention, error)
- func (c *TronClient) GetBlockHeader(cctx context.Context, num int64) (*api.BlockExtention, error)
- func (c *TronClient) GetBlocks(cctx context.Context, start, end int64) ([]*api.BlockExtention, error)
- func (c *TronClient) GetContract(cctx context.Context, addr []byte) (*core.SmartContract, error)
- func (c *TronClient) GetMaintenanceTimeInterval(cctx context.Context) (time.Duration, error)
- func (c *TronClient) GetNextMaintenanceTime(cctx context.Context) (time.Time, error)
- func (c *TronClient) GetNowBlock(cctx context.Context) (*api.BlockExtention, error)
- func (c *TronClient) GetTransactionById(cctx context.Context, txHash []byte) (*core.Transaction, error)
- func (c *TronClient) GetTransactionInfoById(cctx context.Context, txHash []byte) (*core.TransactionInfo, error)
- func (c *TronClient) ListCommittees(ctx context.Context) ([]*WitnessPerm, error)
- func (c *TronClient) ParseReturn(ret *api.Return) error
- func (c *TronClient) String() string
- func (c *TronClient) TriggerContract(cctx context.Context, feeLimit int64, fromPriv []byte, ...) (*api.TransactionExtention, error)
- func (c *TronClient) TriggerContractResult(cctx context.Context, txId []byte) (*core.Transaction, error)
- func (c *TronClient) TryTxByHash(cctx context.Context, txId []byte) (*core.Transaction, error)
- func (c *TronClient) WitnessPermissions(ctx context.Context, addr address.Address) (*WitnessPerm, error)
- type Tx
- type TxEx
- type TxInfo
- type TxReturn
- type WitnessPerm
Constants ¶
View Source
const ( DefaultTimeoutSeconds = 30 DefaultGetTxIntervalSeconds = 5 )
View Source
const ( MaxCommitteeSize = 27 ConfirmedSize = 19 MaintenanceTimeIntervalKey = "getMaintenanceTimeInterval" )
View Source
const (
JsonContentType = "application/json"
)
Variables ¶
Functions ¶
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv []byte) (*ecdsa.PrivateKey, error)
func ParseContractTxResult ¶ added in v0.2.0
func ParseContractTxResult(tx *core.Transaction, runErr error) (fee int64, err error)
Types ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(basePath string, timeoutSeconds int64) *HttpClient
func (*HttpClient) Close ¶
func (c *HttpClient) Close()
func (*HttpClient) GetNextMaintenanceTime ¶
type Receipt ¶ added in v0.2.0
type Receipt struct { BlockNum int64 Timestamp int64 TxId []byte From []byte To []byte Input []byte Output []byte EnergyUsage int64 EnergyPenaltyTotal int64 EnergyTotal int64 EnergyFee int64 OriginEnergyUsage int64 NetUsage int64 NetFee int64 Logs []*core.TransactionInfo_Log Succeed bool Err error }
type TronClient ¶
func NewTronClient ¶
func (*TronClient) CallContract ¶ added in v0.2.0
func (c *TronClient) CallContract(cctx context.Context, from, contract address.Address, data []byte) (*api.TransactionExtention, error)
func (*TronClient) ChainId ¶ added in v0.2.0
func (c *TronClient) ChainId() *big.Int
func (*TronClient) Close ¶
func (c *TronClient) Close() (err error)
func (*TronClient) FilterLogs ¶
func (c *TronClient) FilterLogs(cctx context.Context, from, to int64, addr []byte, topicss ...[][]byte) ([]types.Log, error)
[from, to]
func (*TronClient) GetAccount ¶ added in v0.2.0
func (*TronClient) GetBlock ¶ added in v0.2.0
func (c *TronClient) GetBlock(cctx context.Context, num int64) (*api.BlockExtention, error)
func (*TronClient) GetBlockHeader ¶
func (c *TronClient) GetBlockHeader(cctx context.Context, num int64) (*api.BlockExtention, error)
func (*TronClient) GetBlocks ¶
func (c *TronClient) GetBlocks(cctx context.Context, start, end int64) ([]*api.BlockExtention, error)
[start, end)
func (*TronClient) GetContract ¶ added in v0.2.0
func (c *TronClient) GetContract(cctx context.Context, addr []byte) (*core.SmartContract, error)
func (*TronClient) GetMaintenanceTimeInterval ¶
func (*TronClient) GetNextMaintenanceTime ¶
func (*TronClient) GetNowBlock ¶
func (c *TronClient) GetNowBlock(cctx context.Context) (*api.BlockExtention, error)
func (*TronClient) GetTransactionById ¶
func (c *TronClient) GetTransactionById(cctx context.Context, txHash []byte) (*core.Transaction, error)
func (*TronClient) GetTransactionInfoById ¶ added in v0.2.0
func (c *TronClient) GetTransactionInfoById(cctx context.Context, txHash []byte) (*core.TransactionInfo, error)
func (*TronClient) ListCommittees ¶
func (c *TronClient) ListCommittees(ctx context.Context) ([]*WitnessPerm, error)
func (*TronClient) ParseReturn ¶ added in v0.2.0
func (c *TronClient) ParseReturn(ret *api.Return) error
func (*TronClient) String ¶
func (c *TronClient) String() string
func (*TronClient) TriggerContract ¶
func (*TronClient) TriggerContractResult ¶
func (c *TronClient) TriggerContractResult(cctx context.Context, txId []byte) (*core.Transaction, error)
func (*TronClient) TryTxByHash ¶
func (c *TronClient) TryTxByHash(cctx context.Context, txId []byte) (*core.Transaction, error)
func (*TronClient) WitnessPermissions ¶
func (c *TronClient) WitnessPermissions(ctx context.Context, addr address.Address) (*WitnessPerm, error)
type Tx ¶ added in v0.2.0
type Tx core.Transaction
func (*Tx) IsTriggerSmartContract ¶ added in v0.2.0
func (t *Tx) IsTriggerSmartContract() (*core.TriggerSmartContract, error)
func (*Tx) MerkleHash ¶ added in v0.2.0
type TxEx ¶ added in v0.2.0
type TxEx api.TransactionExtention
type TxInfo ¶ added in v0.2.0
type TxInfo core.TransactionInfo
type WitnessPerm ¶
func (*WitnessPerm) WitnessPermAddr ¶
func (p *WitnessPerm) WitnessPermAddr() address.Address
Click to show internal directories.
Click to hide internal directories.