Documentation
¶
Index ¶
- Variables
- type TronCli
- func (c TronCli) GetBalance(ctx context.Context, addr string) (*big.Int, error)
- func (c TronCli) GetTRC20TokenBalance(ctx context.Context, from, contractAddr string) (*big.Int, error)
- func (c *TronCli) ParseTRC20NumericProperty(data string) (*big.Int, error)
- func (g *TronCli) ParseTRC20StringProperty(data string) (string, error)
- func (c *TronCli) SetAPIKey(apiKey string) error
- func (c *TronCli) SetTimeout(timeout time.Duration)
- func (t *TronCli) Stop()
- func (c *TronCli) TRC20Call(from, contractAddress, data string, constant bool, feeLimit int64) (*api.TransactionExtention, error)
- func (c *TronCli) TRC20ContractBalance(addr, contractAddress string) (*big.Int, error)
- func (c *TronCli) TRC20GetDecimals(contractAddress string) (*big.Int, error)
- func (c *TronCli) TRC20GetName(contractAddress string) (string, error)
- func (c *TronCli) TRC20GetSymbol(contractAddress string) (string, error)
- func (c *TronCli) TRC20Send(from, to, contract string, amount *big.Int, feeLimit int64) (*api.TransactionExtention, error)
- func (c *TronCli) TriggerConstantContract(from, contractAddress, method, jsonString string) (*api.TransactionExtention, error)
- func (c *TronCli) TriggerContract(from, contractAddress, method, jsonString string, feeLimit, tAmount int64, ...) (*api.TransactionExtention, error)
- func (c *TronCli) UpdateHash(tx *api.TransactionExtention) error
- type TrxRepo
- type TrxUsecase
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewTrxUsecase, NewTronCli)
ProviderSet is service providers.
Functions ¶
This section is empty.
Types ¶
type TronCli ¶
type TronCli struct { Conn *grpc.ClientConn TronWalletCli trxapi.WalletClient ApiKey string GrpcTimeout time.Duration }
func NewTronCli ¶
func NewTronCli() *TronCli
func (TronCli) GetBalance ¶
func (TronCli) GetTRC20TokenBalance ¶
func (*TronCli) ParseTRC20NumericProperty ¶
ParseTRC20NumericProperty get number from data
func (*TronCli) ParseTRC20StringProperty ¶
ParseTRC20StringProperty get string from data
func (*TronCli) SetTimeout ¶
SetTimeout for Client connections
func (*TronCli) TRC20Call ¶
func (c *TronCli) TRC20Call(from, contractAddress, data string, constant bool, feeLimit int64) (*api.TransactionExtention, error)
TRC20Call make cosntant calll
func (*TronCli) TRC20ContractBalance ¶
TRC20ContractBalance get Address balance
func (*TronCli) TRC20GetDecimals ¶
TRC20GetDecimals get contract decimals
func (*TronCli) TRC20GetName ¶
TRC20GetName get token name
func (*TronCli) TRC20GetSymbol ¶
TRC20GetSymbol get contract symbol
func (*TronCli) TRC20Send ¶
func (c *TronCli) TRC20Send(from, to, contract string, amount *big.Int, feeLimit int64) (*api.TransactionExtention, error)
TRC20Send send toke to address
func (*TronCli) TriggerConstantContract ¶
func (c *TronCli) TriggerConstantContract(from, contractAddress, method, jsonString string) (*api.TransactionExtention, error)
TriggerConstantContract and return tx result
func (*TronCli) TriggerContract ¶
func (c *TronCli) TriggerContract(from, contractAddress, method, jsonString string, feeLimit, tAmount int64, tTokenID string, tTokenAmount int64) (*api.TransactionExtention, error)
TriggerContract and return tx result
func (*TronCli) UpdateHash ¶
func (c *TronCli) UpdateHash(tx *api.TransactionExtention) error
UpdateHash after local changes
type TrxRepo ¶
type TrxRepo interface {
ListTransactions(ctx context.Context, addr, token string, pageNum, pageSize, queryType int) ([]interface{}, int, error)
}
TrxRepo is a trx repo.
type TrxUsecase ¶
type TrxUsecase struct {
// contains filtered or unexported fields
}
func NewTrxUsecase ¶
func NewTrxUsecase(repo TrxRepo, logger *zap.Logger, cli *TronCli) *TrxUsecase
NewTrxUsecase new a Trx usecase.
func (*TrxUsecase) GetBalance ¶
func (*TrxUsecase) GetTRC20TokenBalance ¶
Click to show internal directories.
Click to hide internal directories.