Documentation ¶
Index ¶
- Constants
- Variables
- func AddressFromPublicKey(publicKey *ecdsa.PublicKey) string
- type Client
- func (c *Client) Account(address string) (*core.Account, error)
- func (c *Client) Close() error
- func (c *Client) TRC20Balance(address, contractAddress string) (*big.Int, error)
- func (c *Client) TRC20Call(from, contractAddress string, data []byte, constant bool, feeLimit uint64) (*api.TransactionExtention, error)
- func (c *Client) Target() string
- func (c *Client) WalletClient() api.WalletClient
Constants ¶
View Source
const ( TronBytePrefix = 0x41 AddressLength = 20 )
Variables ¶
View Source
var (
ErrInvalidAddress = errors.New("invalid address")
)
Functions ¶
func AddressFromPublicKey ¶
AddressFromPublicKey convert public key to Tron address
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client client for the TRON RPC
func NewClient ¶
func NewClient(target string, opts ...grpc.DialOption) (*Client, error)
NewClient creates a new client
func (*Client) TRC20Balance ¶
TRC20Balance gets the balance of a TRC20 token
func (*Client) TRC20Call ¶
func (c *Client) TRC20Call(from, contractAddress string, data []byte, constant bool, feeLimit uint64) (*api.TransactionExtention, error)
TRC20Call calls a TRC20 contract
func (*Client) WalletClient ¶
func (c *Client) WalletClient() api.WalletClient
WalletClient returns the wallet client If you need to call other RPCs, you can use this to get the client
Click to show internal directories.
Click to hide internal directories.