Documentation
¶
Index ¶
- type Account
- type AccountResource
- type Address
- type AddressWithoutPrivKey
- type Asset
- type Client
- func (c *Client) BroadcastHex(txHex string) (*Transaction, error)
- func (c *Client) BroadcastTx(tx *Transaction) (*Transaction, error)
- func (c *Client) CreateAccount(ownerAddr, accountAddr string, visible bool, permissionID int) (*Transaction, error)
- func (c *Client) CreateAddress(password string) (*AddressWithoutPrivKey, error)
- func (c *Client) CreateTx(toAddr, ownerAddr string, amount int) (*Transaction, error)
- func (c *Client) EasyTransfer(password, toAddress string, amount int) (*Transaction, error)
- func (c *Client) EasyTransferByPrivate(privateKey, toAddress string, amount int) (*Transaction, error)
- func (c *Client) GenerateAddress() (*Address, error)
- func (c *Client) GetAccount(address string, visible bool) (*Account, error)
- func (c *Client) GetTxSign(tx *Transaction, privKey string) (*Transaction, error)
- func (c *Client) ValidateAddress(address string) (bool, error)
- type Frozen
- type Key
- type Permission
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Address string `json:"address"` Balance int `json:"balance"` Frozen []Frozen `json:"frozen"` CreateTime int `json:"create_time"` LatestOperationTime int `json:"latest_opration_time"` FreeNetUsage int `json:"free_net_usage"` LatestConsumeFreeTime int `json:"latest_consume_free_time"` AccountResource AccountResource `json:"account_resource"` OwnerPermission Permission `json:"owner_permission"` ActivePermission []Permission `json:"active_permission"` AssetV2 []Asset `json:"assetV2"` FreeAssetNetUsageV2 []Asset `json:"free_asset_net_usageV2"` }
type AccountResource ¶
type AddressWithoutPrivKey ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BroadcastHex ¶
func (c *Client) BroadcastHex(txHex string) (*Transaction, error)
BroadcastHex Broadcast the protobuf encoded transaction hex string after sign
func (*Client) BroadcastTx ¶
func (c *Client) BroadcastTx(tx *Transaction) (*Transaction, error)
BroadcastTx Broadcast the signed transaction
func (*Client) CreateAccount ¶
func (c *Client) CreateAccount(ownerAddr, accountAddr string, visible bool, permissionID int) (*Transaction, error)
CreateAccount Create an account. Uses an already activated account to create a new account Note: The expiration time of the http api creation transaction is 1 minute,
so to complete the on-chain, you need to complete gettransactionsign and broadcasttransaction within 1 minute after the creation.
func (*Client) CreateAddress ¶
func (c *Client) CreateAddress(password string) (*AddressWithoutPrivKey, error)
CreateAddress Create address from a specified password string (NOT PRIVATE KEY)
func (*Client) CreateTx ¶
func (c *Client) CreateTx(toAddr, ownerAddr string, amount int) (*Transaction, error)
CreateTx Create a TRX transfer transaction. If toAddr does not exist, then create the account on the blockchain.
func (*Client) EasyTransfer ¶
func (c *Client) EasyTransfer(password, toAddress string, amount int) (*Transaction, error)
EasyTransfer Easily transfer from an address using the password string. Only works with accounts created from createAddress,integrated getransactionsign and broadcasttransaction.
func (*Client) EasyTransferByPrivate ¶
func (c *Client) EasyTransferByPrivate(privateKey, toAddress string, amount int) (*Transaction, error)
EasyTransferByPrivate Easily transfer from an address using the private key.
func (*Client) GenerateAddress ¶
GenerateAddress Generates a random private key and address pair. Returns a private key, the corresponding address in hex, and base58.
func (*Client) GetAccount ¶
GetAccount Query information about an account,Including balances, freezes, votes and time, etc
func (*Client) GetTxSign ¶
func (c *Client) GetTxSign(tx *Transaction, privKey string) (*Transaction, error)
GetTxSign Sign the transaction, the api has the risk of leaking the private key, please make sure to call the api in a secure environment