Documentation
¶
Overview ¶
Package types rpc相关的一些结构体定义以及转化函数
Index ¶
- func ConvertWalletTxDetailToJSON(in *types.WalletTxDetails, out *WalletTxDetails) error
- type Account
- type AllExecBalance
- type Asset
- type Block
- type BlockDetail
- type BlockDetails
- type BlockOverview
- type BlockParam
- type ChainExecutor
- type ChannelClient
- type CreateTx
- type CreateTxIn
- type ExecAccount
- type ExecNameParm
- type Header
- type Headers
- type NodeNetinfo
- type Peer
- type PeerList
- type Query4Jrpc
- type QueryParm
- type RPCServer
- type RawParm
- type ReWriteRawTx
- type ReceiptData
- type ReceiptDataResult
- type ReceiptLog
- type ReceiptLogResult
- type Reply
- type ReplyAddCallback
- type ReplyBlkSeq
- type ReplyBlkSeqs
- type ReplyCacheTxList
- type ReplyHash
- type ReplyHashes
- type ReplyProperFee
- type ReplyTxInfo
- type ReplyTxInfos
- type ReplyTxList
- type ReqAddr
- type ReqHashes
- type ReqWalletTransactionList
- type Sequence
- type Signature
- type SignedTx
- type TimeStatus
- type TransParm
- type Transaction
- type TransactionDetail
- type TransactionDetails
- type TxProof
- type WalletAccount
- type WalletAccounts
- type WalletStatus
- type WalletTxDetail
- type WalletTxDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertWalletTxDetailToJSON ¶
func ConvertWalletTxDetailToJSON(in *types.WalletTxDetails, out *WalletTxDetails) error
ConvertWalletTxDetailToJSON conver the wallet tx detail to json
Types ¶
type Account ¶
type Account struct {
Currency int32 `json:"currency"`
Balance int64 `json:"balance"`
Frozen int64 `json:"frozen"`
Addr string `json:"addr"`
}
Account account information
type AllExecBalance ¶
type AllExecBalance struct {
Addr string `json:"addr"`
ExecAccount []*ExecAccount `json:"execAccount"`
}
AllExecBalance all exec balance
type Asset ¶
type Asset struct {
Exec string `json:"exec"`
Symbol string `json:"symbol"`
Amount int64 `json:"amount"`
}
Asset asset
type Block ¶
type Block 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 []*Transaction `json:"txs"`
}
Block block information
type BlockDetail ¶
type BlockDetail struct {
Block *Block `json:"block"`
Receipts []*ReceiptDataResult `json:"recipts"`
}
BlockDetail block detail
type BlockDetails ¶
type BlockDetails struct {
Items []*BlockDetail `json:"items"`
}
BlockDetails block details
type BlockOverview ¶
type BlockOverview struct {
Head *Header `json:"head"`
TxCount int64 `json:"txCount"`
TxHashes []string `json:"txHashes"`
}
BlockOverview block overview
type BlockParam ¶
type BlockParam struct {
Start int64 `json:"start"`
End int64 `json:"end"`
Isdetail bool `json:"isDetail"`
}
BlockParam block parameter
type ChainExecutor ¶
type ChainExecutor struct {
Driver string `json:"execer"`
FuncName string `json:"funcName"`
StateHash string `json:"stateHash"`
Payload json.RawMessage `json:"payload"`
}
ChainExecutor chain executor
type ChannelClient ¶
type ChannelClient struct {
client.QueueProtocolAPI
// contains filtered or unexported fields
}
ChannelClient interface
func (*ChannelClient) GetCoinsAccountDB ¶
func (c *ChannelClient) GetCoinsAccountDB() *account.DB
GetCoinsAccountDB return accountdb
func (*ChannelClient) Init ¶
func (c *ChannelClient) Init(name string, s RPCServer, jrpc, grpc interface{})
Init init function
type CreateTx ¶
type CreateTx struct {
To string `json:"to,omitempty"`
Amount int64 `json:"amount,omitempty"`
Fee int64 `json:"fee,omitempty"`
Note string `json:"note,omitempty"`
IsWithdraw bool `json:"isWithdraw,omitempty"`
IsToken bool `json:"isToken,omitempty"`
TokenSymbol string `json:"tokenSymbol,omitempty"`
ExecName string `json:"execName,omitempty"` //TransferToExec and Withdraw 的执行器
Execer string `json:"execer,omitempty"` //执行器名称
}
CreateTx 为了简化Note 的创建过程,在json rpc 中,note 采用string 格式
type CreateTxIn ¶
type CreateTxIn struct {
Execer string `json:"execer"`
ActionName string `json:"actionName"`
Payload json.RawMessage `json:"payload"`
}
CreateTxIn create tx input
type ExecAccount ¶
ExecAccount exec account
type ExecNameParm ¶
type ExecNameParm struct {
ExecName string `json:"execname"`
}
ExecNameParm exec name parameter
type Header ¶
type Header 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"`
TxCount int64 `json:"txCount"`
Hash string `json:"hash"`
Difficulty uint32 `json:"difficulty"`
Signature *Signature `json:"signature,omitempty"`
}
Header header parameter
type Headers ¶
type Headers struct {
Items []*Header `json:"items"`
}
Headers defines headers rpc command
type NodeNetinfo ¶
type NodeNetinfo struct {
Externaladdr string `json:"externalAddr"`
Localaddr string `json:"localAddr"`
Service bool `json:"service"`
Outbounds int32 `json:"outbounds"`
Inbounds int32 `json:"inbounds"`
}
NodeNetinfo node net info
type Peer ¶
type Peer struct {
Addr string `json:"addr"`
Port int32 `json:"port"`
Name string `json:"name"`
MempoolSize int32 `json:"mempoolSize"`
Self bool `json:"self"`
Header *Header `json:"header"`
}
Peer information
type Query4Jrpc ¶
type Query4Jrpc struct {
Execer string `json:"execer"`
FuncName string `json:"funcName"`
Payload json.RawMessage `json:"payload"`
}
Query4Jrpc query jrpc
type ReWriteRawTx ¶
type ReWriteRawTx struct {
Tx string `json:"tx"`
To string `json:"to"`
Fee int64 `json:"fee"`
Expire string `json:"expire"`
Index int32 `json:"index"`
}
ReWriteRawTx parameter
type ReceiptData ¶
type ReceiptData struct {
Ty int32 `json:"ty"`
Logs []*ReceiptLog `json:"logs"`
}
ReceiptData defines receipt data rpc command
type ReceiptDataResult ¶
type ReceiptDataResult struct {
Ty int32 `json:"ty"`
TyName string `json:"tyName"`
Logs []*ReceiptLogResult `json:"logs"`
}
ReceiptDataResult receipt data result
func DecodeLog ¶
func DecodeLog(execer []byte, rlog *ReceiptData) (*ReceiptDataResult, error)
DecodeLog decode log
type ReceiptLog ¶
ReceiptLog defines receipt log command
type ReceiptLogResult ¶
type ReceiptLogResult struct {
Ty int32 `json:"ty"`
TyName string `json:"tyName"`
Log json.RawMessage `json:"log"`
RawLog string `json:"rawLog"`
}
ReceiptLogResult receipt log result
type ReplyAddCallback ¶
ReplyAddCallback Reply AddCallback
type ReplyBlkSeq ¶
ReplyBlkSeq reply block sequece
type ReplyBlkSeqs ¶
type ReplyBlkSeqs struct {
BlkSeqInfos []*ReplyBlkSeq `json:"blkseqInfos"`
}
ReplyBlkSeqs reply block sequences
type ReplyCacheTxList ¶
type ReplyCacheTxList struct {
Txs []*Transaction `json:"txs,omitempty"`
}
ReplyCacheTxList reply cache tx list
type ReplyHash ¶
type ReplyHash struct {
Hash string `json:"hash"`
}
ReplyHash reply hash string json
type ReplyHashes ¶
type ReplyHashes struct {
Hashes []string `json:"hashes"`
}
ReplyHashes reply hashes
type ReplyProperFee ¶
type ReplyProperFee struct {
ProperFee int64 `json:"properFee"`
}
ReplyProperFee reply proper fee
type ReplyTxInfo ¶
type ReplyTxInfo struct {
Hash string `json:"hash"`
Height int64 `json:"height"`
Index int64 `json:"index"`
Assets []*Asset `json:"assets"`
}
ReplyTxInfo reply tx information
type ReplyTxInfos ¶
type ReplyTxInfos struct {
TxInfos []*ReplyTxInfo `json:"txInfos"`
}
ReplyTxInfos reply tx infos
type ReplyTxList ¶
type ReplyTxList struct {
Txs []*Transaction `json:"txs"`
}
ReplyTxList reply tx list
type ReqWalletTransactionList ¶
type ReqWalletTransactionList struct {
FromTx string `json:"fromTx"`
Count int32 `json:"count"`
Direction int32 `json:"direction"`
}
ReqWalletTransactionList require wallet transaction list
type Sequence ¶
type Sequence struct {
Hash string `json:"Hash"`
Type int64 `json:"Type"`
Sequence int64 `json:"sequence"`
Height int64 `json:"height"`
}
Sequence for callback
type Signature ¶
type Signature struct {
Ty int32 `json:"ty"`
Pubkey string `json:"pubkey"`
Signature string `json:"signature"`
}
Signature parameter
type SignedTx ¶
type SignedTx struct {
Unsign string `json:"unsignTx"`
Sign string `json:"sign"`
Pubkey string `json:"pubkey"`
Ty int32 `json:"ty"`
}
SignedTx signature tx
type TimeStatus ¶
type TimeStatus struct {
NtpTime string `json:"ntpTime"`
LocalTime string `json:"localTime"`
Diff int64 `json:"diff"`
}
TimeStatus time status
type TransParm ¶
type TransParm struct {
Execer string `json:"execer"`
Payload string `json:"payload"`
Signature *Signature `json:"signature"`
Fee int64 `json:"fee"`
}
TransParm transport parameter
type Transaction ¶
type Transaction struct {
Execer string `json:"execer"`
Payload json.RawMessage `json:"payload"`
RawPayload string `json:"rawPayload"`
Signature *Signature `json:"signature"`
Fee int64 `json:"fee"`
FeeFmt string `json:"feefmt"`
Expire int64 `json:"expire"`
Nonce int64 `json:"nonce"`
From string `json:"from,omitempty"`
To string `json:"to"`
Amount int64 `json:"amount,omitempty"`
AmountFmt string `json:"amountfmt,omitempty"`
GroupCount int32 `json:"groupCount,omitempty"`
Header string `json:"header,omitempty"`
Next string `json:"next,omitempty"`
Hash string `json:"hash,omitempty"`
}
Transaction parameter
func DecodeTx ¶
func DecodeTx(tx *types.Transaction) (*Transaction, error)
DecodeTx docode transaction
type TransactionDetail ¶
type TransactionDetail struct {
Tx *Transaction `json:"tx"`
Receipt *ReceiptDataResult `json:"receipt"`
Proofs []string `json:"proofs"`
Height int64 `json:"height"`
Index int64 `json:"index"`
Blocktime int64 `json:"blockTime"`
Amount int64 `json:"amount"`
Fromaddr string `json:"fromAddr"`
ActionName string `json:"actionName"`
Assets []*Asset `json:"assets"`
TxProofs []*TxProof `json:"txProofs"`
FullHash string `json:"fullHash"`
}
TransactionDetail transaction detail
type TransactionDetails ¶
type TransactionDetails struct {
//Txs []*Transaction `json:"txs"`
Txs []*TransactionDetail `json:"txs"`
}
TransactionDetails transaction details
type TxProof ¶
type TxProof struct {
Proofs []string `json:"proofs"`
Index uint32 `json:"index"`
RootHash string `json:"rootHash"`
}
TxProof :
type WalletAccount ¶
WalletAccount wallet account
type WalletAccounts ¶
type WalletAccounts struct {
Wallets []*WalletAccount `json:"wallets"`
}
WalletAccounts Wallet Module
type WalletStatus ¶
type WalletStatus struct {
IsWalletLock bool `json:"isWalletLock"`
IsAutoMining bool `json:"isAutoMining"`
IsHasSeed bool `json:"isHasSeed"`
IsTicketLock bool `json:"isTicketLock"`
}
WalletStatus wallet status
type WalletTxDetail ¶
type WalletTxDetail struct {
Tx *Transaction `json:"tx"`
Receipt *ReceiptDataResult `json:"receipt"`
Height int64 `json:"height"`
Index int64 `json:"index"`
BlockTime int64 `json:"blockTime"`
Amount int64 `json:"amount"`
FromAddr string `json:"fromAddr"`
TxHash string `json:"txHash"`
ActionName string `json:"actionName"`
}
WalletTxDetail wallet tx detail
type WalletTxDetails ¶
type WalletTxDetails struct {
TxDetails []*WalletTxDetail `json:"txDetails"`
}
WalletTxDetails wallet tx details