Documentation ¶
Overview ¶
Package types commands中结构体定义
Index ¶
- func CheckExpireOpt(expire string) (string, error)
- func CreateRawTx(paraName string, to string, amount float64, note string, isWithdraw bool, ...) (string, error)
- func CreateTxWithCert(signType string, privateKey crypto.PrivKey, hexTx string, certByte []byte) (string, error)
- func GetChainConfig(rpcAddr string) (*rpctypes.ChainConfigInfo, error)
- func GetExecAddr(exec string, addressID int32) (string, error)
- func LoadPrivKeyFromLocal(signType string, filePath string) (crypto.PrivKey, error)
- func ReadFile(file string) ([]byte, error)
- func SendCreateTxRPC(cmd *cobra.Command, exec, actionName string, req types.Message)
- func SendToAddress(rpcAddr string, from string, to string, amount int64, note string, ...)
- type AccountResult
- type AccountsResult
- type AddrOverviewResult
- type AllExecBalance
- type BlockDetailResult
- type BlockDetailsResult
- type BlockResult
- type ExecAccount
- type ExecBalance
- type GetExecBalanceResult
- type GetTotalCoinsResult
- type ReceiptAccountTransfer
- type ReceiptExecAccountTransfer
- type TokenAccountResult
- type TxDetailResult
- type TxDetailsResult
- type TxListResult
- type TxResult
- type WalletResult
- type WalletTxDetailResult
- type WalletTxDetailsResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckExpireOpt ¶
CheckExpireOpt parse expire option in command
func CreateRawTx ¶
func CreateRawTx(paraName string, to string, amount float64, note string, isWithdraw bool, tokenSymbol, execName string, cfg *rpctypes.ChainConfigInfo) (string, error)
CreateRawTx create rawtransaction func
func CreateTxWithCert ¶ added in v1.65.3
func CreateTxWithCert(signType string, privateKey crypto.PrivKey, hexTx string, certByte []byte) (string, error)
CreateTxWithCert 构造携带证书的交易
func GetChainConfig ¶ added in v1.65.3
func GetChainConfig(rpcAddr string) (*rpctypes.ChainConfigInfo, error)
GetChainConfig get system config parameters
func GetExecAddr ¶
GetExecAddr get exec address func addressID should based on server side(node)
func LoadPrivKeyFromLocal ¶ added in v1.65.3
LoadPrivKeyFromLocal 加载账户
func SendCreateTxRPC ¶ added in v1.67.2
SendCreateTxRPC create transaction json rpc
Types ¶
type AccountResult ¶
type AccountResult struct { Currency int32 `json:"currency,omitempty"` Balance string `json:"balance,omitempty"` Frozen string `json:"frozen,omitempty"` Addr string `json:"addr,omitempty"` }
AccountResult defines account result command
func DecodeAccount ¶
func DecodeAccount(acc *types.Account, precision int64) *AccountResult
DecodeAccount decode account func
type AccountsResult ¶
type AccountsResult struct {
Wallets []*WalletResult `json:"wallets"`
}
AccountsResult defines accountsresult command
type AddrOverviewResult ¶
type AddrOverviewResult struct { Receiver string `json:"receiver"` Balance string `json:"balance"` TxCount int64 `json:"txCount"` }
AddrOverviewResult defines address overview result rpc command
type AllExecBalance ¶
type AllExecBalance struct { Addr string `json:"addr"` ExecAccount []*ExecAccount `json:"execAccount"` }
AllExecBalance defines all balance of exec command
type BlockDetailResult ¶
type BlockDetailResult struct { Block *BlockResult `json:"block"` Receipts []*rpctypes.ReceiptDataResult `json:"receipts"` }
BlockDetailResult defines blockdetailresult rpc command
type BlockDetailsResult ¶
type BlockDetailsResult struct {
Items []*BlockDetailResult `json:"items"`
}
BlockDetailsResult defines blockdetails result rpc command
type BlockResult ¶
type BlockResult struct { Version int64 `json:"version"` ParentHash string `json:"parenthash"` TxHash string `json:"txhash"` StateHash string `json:"statehash"` Height int64 `json:"height"` BlockTime int64 `json:"blocktime"` Txs []*TxResult `json:"txs"` }
BlockResult defines blockresult rpc command
type ExecAccount ¶
type ExecAccount struct { Execer string `json:"execer"` Account *AccountResult `json:"account"` }
ExecAccount defines account of exec command
type ExecBalance ¶
type ExecBalance struct { ExecAddr string `json:"execAddr,omitempty"` Frozen string `json:"frozen"` Active string `json:"active"` }
ExecBalance defines exec balance rpc command
type GetExecBalanceResult ¶
type GetExecBalanceResult struct { Amount string `json:"totalAmount"` AmountFrozen string `json:"frozenAmount"` AmountActive string `json:"activeAmount"` ExecBalances []*ExecBalance `json:"execBalances,omitempty"` }
GetExecBalanceResult defines balance of exec result rpc command
type GetTotalCoinsResult ¶
type GetTotalCoinsResult struct { TxCount int64 `json:"txCount"` AccountCount int64 `json:"accountCount"` TotalAmount string `json:"totalAmount"` ActualAmount string `json:"actualAmount,omitempty"` DifferenceAmount string `json:"differenceAmount,omitempty"` }
GetTotalCoinsResult defines totalcoinsresult rpc command
type ReceiptAccountTransfer ¶
type ReceiptAccountTransfer struct { Prev *AccountResult `protobuf:"bytes,1,opt,name=prev" json:"prev,omitempty"` Current *AccountResult `protobuf:"bytes,2,opt,name=current" json:"current,omitempty"` }
ReceiptAccountTransfer defines receipt account transfer
type ReceiptExecAccountTransfer ¶
type ReceiptExecAccountTransfer struct { ExecAddr string `protobuf:"bytes,1,opt,name=execAddr" json:"execAddr,omitempty"` Prev *AccountResult `protobuf:"bytes,2,opt,name=prev" json:"prev,omitempty"` Current *AccountResult `protobuf:"bytes,3,opt,name=current" json:"current,omitempty"` }
ReceiptExecAccountTransfer defines account transfer of exec command
type TokenAccountResult ¶
type TokenAccountResult struct { Token string `json:"Token,omitempty"` Currency int32 `json:"currency,omitempty"` Balance string `json:"balance,omitempty"` Frozen string `json:"frozen,omitempty"` Addr string `json:"addr,omitempty"` }
TokenAccountResult defines accounts result of token command
type TxDetailResult ¶
type TxDetailResult struct { Tx *TxResult `json:"tx"` Receipt *rpctypes.ReceiptDataResult `json:"receipt"` Proofs []string `json:"proofs,omitempty"` Height int64 `json:"height"` Index int64 `json:"index"` Blocktime int64 `json:"blocktime"` Amount string `json:"amount"` Fromaddr string `json:"fromaddr"` ActionName string `json:"actionname"` Assets []*rpctypes.Asset `json:"assets"` TxProofs []*rpctypes.TxProof `json:"txProofs"` FullHash string `json:"fullHash"` }
TxDetailResult defines txdetail result command
type TxDetailsResult ¶
type TxDetailsResult struct {
Txs []*TxDetailResult `json:"txs"`
}
TxDetailsResult defines txdetails result command
type TxListResult ¶
type TxListResult struct {
Txs []*TxResult `json:"txs"`
}
TxListResult defines txlist result command
type TxResult ¶
type TxResult struct { Execer string `json:"execer"` Payload interface{} `json:"payload"` RawPayload string `json:"rawpayload"` Signature *rpctypes.Signature `json:"signature"` Fee string `json:"fee"` Expire int64 `json:"expire"` Nonce int64 `json:"nonce"` To string `json:"to"` Amount string `json:"amount,omitempty"` From string `json:"from,omitempty"` GroupCount int32 `json:"groupCount,omitempty"` Header string `json:"header,omitempty"` Next string `json:"next,omitempty"` Hash string `json:"hash,omitempty"` ChainID int32 `json:"chainID,"` }
TxResult defines txresult command
func DecodeTransaction ¶
func DecodeTransaction(tx *rpctypes.Transaction) *TxResult
DecodeTransaction decode transaction function
type WalletResult ¶
type WalletResult struct { Acc *AccountResult `json:"acc,omitempty"` Label string `json:"label,omitempty"` }
WalletResult defines walletresult command
type WalletTxDetailResult ¶
type WalletTxDetailResult struct { Tx *TxResult `json:"tx"` Receipt *rpctypes.ReceiptDataResult `json:"receipt"` Height int64 `json:"height"` Index int64 `json:"index"` Blocktime int64 `json:"blocktime"` Amount string `json:"amount"` Fromaddr string `json:"fromaddr"` Txhash string `json:"txhash"` ActionName string `json:"actionname"` }
WalletTxDetailResult defines wallettxdetail result rpc command
type WalletTxDetailsResult ¶
type WalletTxDetailsResult struct {
TxDetails []*WalletTxDetailResult `json:"txDetails"`
}
WalletTxDetailsResult defines walletexdetails result rpc command