Documentation ¶
Index ¶
- func GetMessageBytes(m []byte) *api.BytesMessage
- func GetPaginatedMessage(offset int64, limit int64) *api.PaginatedMessage
- type GrpcClient
- func (g *GrpcClient) AssetIssue(from, name, description, abbr, urlStr string, precision int32, ...) (*api.TransactionExtention, error)
- func (g *GrpcClient) Broadcast(tx *core.Transaction) (*api.Return, error)
- func (g *GrpcClient) Close()
- func (g *GrpcClient) CreateAccount(from, addr string) (*api.TransactionExtention, error)
- func (g *GrpcClient) CreateWitness(from, urlStr string) (*api.TransactionExtention, error)
- func (g *GrpcClient) ExchangeByID(id int64) (*core.Exchange, error)
- func (g *GrpcClient) ExchangeCreate(from string, tokenID1 string, amountToken1 int64, tokenID2 string, ...) (*api.TransactionExtention, error)
- func (g *GrpcClient) ExchangeInject(from string, exchangeID int64, tokenID string, amountToken int64) (*api.TransactionExtention, error)
- func (g *GrpcClient) ExchangeList(page int64, limit ...int) (*api.ExchangeList, error)
- func (g *GrpcClient) ExchangeTrade(from string, exchangeID int64, tokenID string, amountToken int64, ...) (*api.TransactionExtention, error)
- func (g *GrpcClient) ExchangeWithdraw(from string, exchangeID int64, tokenID string, amountToken int64) (*api.TransactionExtention, error)
- func (g *GrpcClient) FreezeBalance(from, delegateTo string, resource core.ResourceCode, frozenBalance int64) (*api.TransactionExtention, error)
- func (g *GrpcClient) GetAccount(addr string) (*core.Account, error)
- func (g *GrpcClient) GetAccountDetailed(addr string) (*account.Account, error)
- func (g *GrpcClient) GetAccountNet(addr string) (*api.AccountNetMessage, error)
- func (g *GrpcClient) GetAccountResource(addr string) (*api.AccountResourceMessage, error)
- func (g *GrpcClient) GetAccountReward(addr string) (int64, error)
- func (g *GrpcClient) GetAssetIssueByAccount(address string) (*api.AssetIssueList, error)
- func (g *GrpcClient) GetAssetIssueByID(tokenID string) (*core.AssetIssueContract, error)
- func (g *GrpcClient) GetAssetIssueByName(name string) (*core.AssetIssueContract, error)
- func (g *GrpcClient) GetAssetIssueList(page int64, limit ...int) (*api.AssetIssueList, error)
- func (g *GrpcClient) GetBlockByID(id string) (*core.Block, error)
- func (g *GrpcClient) GetBlockByLatestNum(num int64) (*api.BlockListExtention, error)
- func (g *GrpcClient) GetBlockByLimitNext(start, end int64) (*api.BlockListExtention, error)
- func (g *GrpcClient) GetBlockByNum(num int64) (*api.BlockExtention, error)
- func (g *GrpcClient) GetBlockInfoByNum(num int64) (*api.TransactionInfoList, error)
- func (g *GrpcClient) GetContext() (context.Context, context.CancelFunc)
- func (g *GrpcClient) GetContractABI(contractAddress string) (*core.SmartContract_ABI, error)
- func (g *GrpcClient) GetDelegatedResources(address string) ([]*api.DelegatedResourceList, error)
- func (g *GrpcClient) GetNextMaintenanceTime() (*api.NumberMessage, error)
- func (g *GrpcClient) GetNowBlock() (*api.BlockExtention, error)
- func (g *GrpcClient) GetTransactionByID(txHash string) (*core.Transaction, error)
- func (g *GrpcClient) GetTransactionInfoByID(txHash string) (*core.TransactionInfo, error)
- func (g *GrpcClient) GetWitnessBrokerage(witness string) (float64, error)
- func (g *GrpcClient) ListNodes() (*api.NodeList, error)
- func (g *GrpcClient) ListWitnesses() (*api.WitnessList, error)
- func (g *GrpcClient) ParticipateAssetIssue(from, issuerAddress, tokenID string, amount int64) (*api.TransactionExtention, error)
- func (g *GrpcClient) ProposalApprove(from string, id int64, confirm bool) (*api.TransactionExtention, error)
- func (g *GrpcClient) ProposalCreate(from string, parameters map[int64]int64) (*api.TransactionExtention, error)
- func (g *GrpcClient) ProposalWithdraw(from string, id int64) (*api.TransactionExtention, error)
- func (g *GrpcClient) ProposalsList() (*api.ProposalList, error)
- func (g *GrpcClient) SetAPIKey(apiKey string) error
- func (g *GrpcClient) TotalTransaction() (*api.NumberMessage, error)
- func (g *GrpcClient) Transfer(from, toAddress string, amount int64) (*api.TransactionExtention, error)
- func (g *GrpcClient) TransferAsset(from, toAddress, assetName string, amount int64) (*api.TransactionExtention, error)
- func (g *GrpcClient) TriggerConstantContract(contractAddress, from, method string, param []byte) (*transaction.Transaction, error)
- func (g *GrpcClient) TriggerContract(ks *keystore.Keystore, contractAddress, method string, paramData []byte, ...) (*transaction.Transaction, error)
- func (g *GrpcClient) UnfreezeAsset(from string) (*api.TransactionExtention, error)
- func (g *GrpcClient) UnfreezeBalance(from, delegateTo string, resource core.ResourceCode) (*api.TransactionExtention, error)
- func (g *GrpcClient) UpdateAccount(from, accountName string) (*api.TransactionExtention, error)
- func (g *GrpcClient) UpdateAccountPermission(from string, owner, witness map[string]interface{}, ...) (*api.TransactionExtention, error)
- func (g *GrpcClient) UpdateAssetIssue(from, description, urlStr string, newLimit, newPublicLimit int64) (*api.TransactionExtention, error)
- func (g *GrpcClient) UpdateBrokerage(from string, comission int32) (*api.TransactionExtention, error)
- func (g *GrpcClient) UpdateWitness(from, urlStr string) (*api.TransactionExtention, error)
- func (g *GrpcClient) VoteWitnessAccount(from string, witnessMap map[string]int64) (*api.TransactionExtention, error)
- func (g *GrpcClient) WithdrawBalance(from string) (*api.TransactionExtention, error)
- type TokenAmount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMessageBytes ¶
func GetMessageBytes(m []byte) *api.BytesMessage
GetMessageBytes return grpc message from bytes
func GetPaginatedMessage ¶
func GetPaginatedMessage(offset int64, limit int64) *api.PaginatedMessage
GetPaginatedMessage return grpc message number
Types ¶
type GrpcClient ¶
type GrpcClient struct { GrpcURL string Conn *grpc.ClientConn Client api.WalletClient // contains filtered or unexported fields }
func NewGrpcClient ¶
func NewGrpcClient(grpcURL string, opts ...grpc.DialOption) (*GrpcClient, error)
func (*GrpcClient) AssetIssue ¶
func (g *GrpcClient) AssetIssue( from, name, description, abbr, urlStr string, precision int32, totalSupply, startTime, endTime, FreeAssetNetLimit, PublicFreeAssetNetLimit int64, trxNum, icoNum, voteScore int32, frozenSupply map[string]string, ) (*api.TransactionExtention, error)
AssetIssue create a new asset TRC10
func (*GrpcClient) Broadcast ¶
func (g *GrpcClient) Broadcast(tx *core.Transaction) (*api.Return, error)
Broadcast broadcast TX
func (*GrpcClient) Close ¶
func (g *GrpcClient) Close()
func (*GrpcClient) CreateAccount ¶
func (g *GrpcClient) CreateAccount(from, addr string) (*api.TransactionExtention, error)
CreateAccount activate tron account
func (*GrpcClient) CreateWitness ¶
func (g *GrpcClient) CreateWitness(from, urlStr string) (*api.TransactionExtention, error)
CreateWitness upgrade account to network witness
func (*GrpcClient) ExchangeByID ¶
func (g *GrpcClient) ExchangeByID(id int64) (*core.Exchange, error)
ExchangeByID returns exchangeDetails
func (*GrpcClient) ExchangeCreate ¶
func (g *GrpcClient) ExchangeCreate( from string, tokenID1 string, amountToken1 int64, tokenID2 string, amountToken2 int64, ) (*api.TransactionExtention, error)
ExchangeCreate from two tokens (TRC10/TRX) only
func (*GrpcClient) ExchangeInject ¶
func (g *GrpcClient) ExchangeInject( from string, exchangeID int64, tokenID string, amountToken int64, ) (*api.TransactionExtention, error)
ExchangeInject both tokens into banco pair (the second token is taken info transaction process)
func (*GrpcClient) ExchangeList ¶
func (g *GrpcClient) ExchangeList(page int64, limit ...int) (*api.ExchangeList, error)
ExchangeList of bancor TRC10, use page -1 to list all
func (*GrpcClient) ExchangeTrade ¶
func (g *GrpcClient) ExchangeTrade( from string, exchangeID int64, tokenID string, amountToken int64, amountExpected int64, ) (*api.TransactionExtention, error)
ExchangeTrade on bancor TRC10
func (*GrpcClient) ExchangeWithdraw ¶
func (g *GrpcClient) ExchangeWithdraw( from string, exchangeID int64, tokenID string, amountToken int64, ) (*api.TransactionExtention, error)
ExchangeWithdraw both tokens into banco pair (the second token is taken info transaction process)
func (*GrpcClient) FreezeBalance ¶
func (g *GrpcClient) FreezeBalance(from, delegateTo string, resource core.ResourceCode, frozenBalance int64) (*api.TransactionExtention, error)
FreezeBalance from base58 address
func (*GrpcClient) GetAccount ¶
func (g *GrpcClient) GetAccount(addr string) (*core.Account, error)
GetAccount from BASE58 address
func (*GrpcClient) GetAccountDetailed ¶
func (g *GrpcClient) GetAccountDetailed(addr string) (*account.Account, error)
GetAccountDetailed from BASE58 address
func (*GrpcClient) GetAccountNet ¶
func (g *GrpcClient) GetAccountNet(addr string) (*api.AccountNetMessage, error)
GetAccountNet return account resources from BASE58 address
func (*GrpcClient) GetAccountResource ¶
func (g *GrpcClient) GetAccountResource(addr string) (*api.AccountResourceMessage, error)
GetAccountResource from BASE58 address
func (*GrpcClient) GetAccountReward ¶
func (g *GrpcClient) GetAccountReward(addr string) (int64, error)
GetAccountReward from BASE58 address
func (*GrpcClient) GetAssetIssueByAccount ¶
func (g *GrpcClient) GetAssetIssueByAccount(address string) (*api.AssetIssueList, error)
GetAssetIssueByAccount list asset issued by account
func (*GrpcClient) GetAssetIssueByID ¶
func (g *GrpcClient) GetAssetIssueByID(tokenID string) (*core.AssetIssueContract, error)
GetAssetIssueByID list asset issued by ID
func (*GrpcClient) GetAssetIssueByName ¶
func (g *GrpcClient) GetAssetIssueByName(name string) (*core.AssetIssueContract, error)
GetAssetIssueByName list asset issued by name
func (*GrpcClient) GetAssetIssueList ¶
func (g *GrpcClient) GetAssetIssueList(page int64, limit ...int) (*api.AssetIssueList, error)
GetAssetIssueList list all TRC10
func (*GrpcClient) GetBlockByID ¶
func (g *GrpcClient) GetBlockByID(id string) (*core.Block, error)
GetBlockByID block from hash
func (*GrpcClient) GetBlockByLatestNum ¶
func (g *GrpcClient) GetBlockByLatestNum(num int64) (*api.BlockListExtention, error)
GetBlockByLatestNum return block list till num
func (*GrpcClient) GetBlockByLimitNext ¶
func (g *GrpcClient) GetBlockByLimitNext(start, end int64) (*api.BlockListExtention, error)
GetBlockByLimitNext return list of block start/end
func (*GrpcClient) GetBlockByNum ¶
func (g *GrpcClient) GetBlockByNum(num int64) (*api.BlockExtention, error)
GetBlockByNum block from number
func (*GrpcClient) GetBlockInfoByNum ¶
func (g *GrpcClient) GetBlockInfoByNum(num int64) (*api.TransactionInfoList, error)
GetBlockInfoByNum block from number
func (*GrpcClient) GetContext ¶
func (g *GrpcClient) GetContext() (context.Context, context.CancelFunc)
func (*GrpcClient) GetContractABI ¶
func (g *GrpcClient) GetContractABI(contractAddress string) (*core.SmartContract_ABI, error)
GetContractABI return smartContract
func (*GrpcClient) GetDelegatedResources ¶
func (g *GrpcClient) GetDelegatedResources(address string) ([]*api.DelegatedResourceList, error)
GetDelegatedResources from BASE58 address
func (*GrpcClient) GetNextMaintenanceTime ¶
func (g *GrpcClient) GetNextMaintenanceTime() (*api.NumberMessage, error)
GetNextMaintenanceTime get next epoch timestamp
func (*GrpcClient) GetNowBlock ¶
func (g *GrpcClient) GetNowBlock() (*api.BlockExtention, error)
GetNowBlock return TIP block
func (*GrpcClient) GetTransactionByID ¶
func (g *GrpcClient) GetTransactionByID(txHash string) (*core.Transaction, error)
GetTransactionByID returns transaction details by ID
func (*GrpcClient) GetTransactionInfoByID ¶
func (g *GrpcClient) GetTransactionInfoByID(txHash string) (*core.TransactionInfo, error)
GetTransactionInfoByID returns transaction receipt by ID
func (*GrpcClient) GetWitnessBrokerage ¶
func (g *GrpcClient) GetWitnessBrokerage(witness string) (float64, error)
GetWitnessBrokerage from witness address
func (*GrpcClient) ListNodes ¶
func (g *GrpcClient) ListNodes() (*api.NodeList, error)
ListNodes provides list of network nodes
func (*GrpcClient) ListWitnesses ¶
func (g *GrpcClient) ListWitnesses() (*api.WitnessList, error)
ListWitnesses return all witnesses
func (*GrpcClient) ParticipateAssetIssue ¶
func (g *GrpcClient) ParticipateAssetIssue(from, issuerAddress, tokenID string, amount int64) (*api.TransactionExtention, error)
ParticipateAssetIssue TRC10 ICO
func (*GrpcClient) ProposalApprove ¶
func (g *GrpcClient) ProposalApprove(from string, id int64, confirm bool) (*api.TransactionExtention, error)
ProposalApprove change URL info
func (*GrpcClient) ProposalCreate ¶
func (g *GrpcClient) ProposalCreate(from string, parameters map[int64]int64) (*api.TransactionExtention, error)
ProposalCreate create proposal based on parameter list
func (*GrpcClient) ProposalWithdraw ¶
func (g *GrpcClient) ProposalWithdraw(from string, id int64) (*api.TransactionExtention, error)
func (*GrpcClient) ProposalsList ¶
func (g *GrpcClient) ProposalsList() (*api.ProposalList, error)
ProposalsList return all network proposals
func (*GrpcClient) SetAPIKey ¶
func (g *GrpcClient) SetAPIKey(apiKey string) error
func (*GrpcClient) TotalTransaction ¶
func (g *GrpcClient) TotalTransaction() (*api.NumberMessage, error)
TotalTransaction return total transciton in network
func (*GrpcClient) Transfer ¶
func (g *GrpcClient) Transfer(from, toAddress string, amount int64) (*api.TransactionExtention, error)
Transfer from to base58 address
func (*GrpcClient) TransferAsset ¶
func (g *GrpcClient) TransferAsset(from, toAddress, assetName string, amount int64) (*api.TransactionExtention, error)
TransferAsset from to base58 address
func (*GrpcClient) TriggerConstantContract ¶
func (g *GrpcClient) TriggerConstantContract(contractAddress, from, method string, param []byte) (*transaction.Transaction, error)
func (*GrpcClient) TriggerContract ¶
func (g *GrpcClient) TriggerContract(ks *keystore.Keystore, contractAddress, method string, paramData []byte, feeLimit, amount int64, tokenAmount *TokenAmount) (*transaction.Transaction, error)
func (*GrpcClient) UnfreezeAsset ¶
func (g *GrpcClient) UnfreezeAsset(from string) (*api.TransactionExtention, error)
UnfreezeAsset from owner
func (*GrpcClient) UnfreezeBalance ¶
func (g *GrpcClient) UnfreezeBalance(from, delegateTo string, resource core.ResourceCode) (*api.TransactionExtention, error)
UnfreezeBalance from base58 address
func (*GrpcClient) UpdateAccount ¶
func (g *GrpcClient) UpdateAccount(from, accountName string) (*api.TransactionExtention, error)
UpdateAccount change account name
func (*GrpcClient) UpdateAccountPermission ¶
func (g *GrpcClient) UpdateAccountPermission(from string, owner, witness map[string]interface{}, actives []map[string]interface{}) (*api.TransactionExtention, error)
UpdateAccountPermission change account permission
func (*GrpcClient) UpdateAssetIssue ¶
func (g *GrpcClient) UpdateAssetIssue(from, description, urlStr string, newLimit, newPublicLimit int64) (*api.TransactionExtention, error)
UpdateAssetIssue information
func (*GrpcClient) UpdateBrokerage ¶
func (g *GrpcClient) UpdateBrokerage(from string, comission int32) (*api.TransactionExtention, error)
UpdateBrokerage change SR comission fees
func (*GrpcClient) UpdateWitness ¶
func (g *GrpcClient) UpdateWitness(from, urlStr string) (*api.TransactionExtention, error)
UpdateWitness change URL info
func (*GrpcClient) VoteWitnessAccount ¶
func (g *GrpcClient) VoteWitnessAccount(from string, witnessMap map[string]int64) (*api.TransactionExtention, error)
VoteWitnessAccount change account vote
func (*GrpcClient) WithdrawBalance ¶
func (g *GrpcClient) WithdrawBalance(from string) (*api.TransactionExtention, error)
WithdrawBalance rewards from account