123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- package dcrcash
- // rpc error struct
- type RpcError struct {
- Code int `json:"code"`
- Message string `json:"message"`
- }
- //get wallet info result struct
- type WalletInfo struct {
- DaemonConnected bool `json:"daemonconnected"`
- Unlocked bool `json:"unlocked"`
- TxFee float64 `json:"txfee"`
- TicketFee float64 `json:"ticketfee"`
- TicketPurchasing bool `json:"ticketpurchasing"`
- VoteBits uint16 `json:"votebits"`
- VoteBitsExtended string `json:"votebitsextended"`
- VoteVersion uint32 `json:"voteversion"`
- Voting bool `json:"voting"`
- }
- // rpc common result struct
- type RpcResult struct {
- Result string `json:"result"`
- Error RpcError `json:"error"`
- Id int `json:"id"`
- }
- //set fee
- type Setfeeresult struct {
- Result bool `json:"result"`
- Error RpcError `json:"error"`
- Id int
- }
- type WalletinfoResult struct {
- Result WalletInfo `json:"result"`
- Error RpcError `json:"error"`
- Id int `json:"id"`
- }
- //get block count
- type Blockcountresult struct {
- Result uint64 `json:"result"`
- Error RpcError `json:"error"`
- Id int
- }
- type account struct {
- AccountName string `json:"accountname"`
- ImmatureCoinbaseRewards float64 `json:"immaturecoinbaserewards"`
- ImmatureStakeGeneration float64 `json:"immaturestakegeneration"`
- LockedByTickets float64 `json:"lockedbytickets"`
- Spendable float64 `json:"spendable"`
- Total float64 `json:"total"`
- Unconfirmed float64 `json:"unconfirmed"`
- VotingAuthority float64 `json:"votingauthority"`
- }
- type Accounts struct {
- Balances []account `json:"balances"`
- Blockhash string `json:"blockhash"`
- }
- //get Balance result struct
- type AcountResult struct {
- Result Accounts `json:"result"`
- Error RpcError `json:"error"`
- Id int `json:"id"`
- }
- type Listtransactionsresult struct {
- Result listtransactions `json:"result"`
- Error RpcError `json:"error"`
- Id int `json:"id"`
- }
- // list transactions since blockhash result struct
- type Listtransactions struct {
- Account string `json:"account"`
- Address string `json:"address"`
- Amount float64 `json:"amount"`
- Blockhash string `json:"blockhash"`
- Blockindex uint64 `json:"blockindex"`
- Blocktime uint64 `json:"blocktime"`
- Category string `json:"category"`
- Confirmations uint64 `json:"confirmations"`
- Fee float64 `json:"fee"`
- Generated bool `json:generated`
- Involveswatchonly bool `json:"involveswatchonly"`
- Time uint64 `json:"time"`
- Timereceived uint64 `json:"timereceived"`
- Txid string `json:"txid"`
- Txtype string `json:"txtype"`
- Vout uint64 `json:"vout"`
- WalletConflicts []string `json:"walletconflicts"`
- Comment string `json:"comment"`
- Otheraccount string `json:"otheraccount"`
- }
- type listtransactions struct {
- Transactions []Listtransactions `json: "transactions"`
- Lastblock string `json: "lastblock"`
- }
- type scriptsig struct {
- Asm string
- Hex string
- }
- type scriptpubkey struct {
- Asm string
- Hex string
- ReqSigs uint64
- Type string
- Addresses []string
- Commitamt float64
- }
- type vin struct {
- Coinbase string
- Stakebase string
- Txid string
- vout uint64
- Tree uint64
- Sequese uint64
- Amountin float64
- Blockheighe uint64
- Blockindex uint64
- ScriptSig scriptsig
- }
- type vout struct {
- Value float64
- N uint64
- Version uint64
- ScriptPubkey scriptpubkey
- }
- type rawtx struct {
- Hex string
- Txid string
- Version uint64
- Locktime uint64
- Expiry uint64
- Vin []vin
- Vout []vout
- blockhash string
- blockheight uint64
- blockindex uint64
- tonfirmations uint64
- time uint64
- blocktime uint64
- }
- // get block info result struct
- type BlockInfo struct {
- Hash string
- Confirmations uint64
- Size uint64
- Height uint64
- Version uint64
- Merkleroot string
- Stakerroot string
- Tx []string
- Rawtx []rawtx
- Stx []string
- Rawstx []rawtx
- Time uint64
- Nonce uint64
- Votebits uint64
- Finalstate string
- Voters uint64
- Freshstake uint64
- Revocations uint64
- Poolsize uint64
- Bits string
- Sbits float64
- Difficulty float64
- Extradata string
- Stakeversion uint64
- Previousblockhash string
- Nextblockhash string
- }
- type BlockResult struct {
- Result BlockInfo `json:"result"`
- Error RpcError `json:"error"`
- Id int `json:"id"`
- }
- //list unspent info result struct
- type UnspentInfo struct {
- Txid string `json:"txid"`
- Vout uint64 `json:"vout"`
- Tree uint64 `json:"tree"`
- Txtype uint64 `json:"txtype"`
- Address string `json:"address"`
- Account string `json:"account"`
- ScriptPubKey string `json:"scriptpubkey"`
- RedeemScript string `json:"redeemscript"`
- Amount float64 `json:"amount"`
- Confirmations uint64 `json:"confirmations"`
- Spendable bool `json:"spendable"`
- }
- // RpcUnspentResult struct
- type RpcUnspentResult struct {
- Result []UnspentInfo `json:"result"`
- Error RpcError `json:"error"`
- Id int `json:"id"`
- }
- /*type AccountsOfvalue struct {
- Account string `json:"account"`
- Balance float64 `json:"balance"`
- }*/
- type AccountsOfvaluesResult struct {
- Result map[string]float64 `json:"result"`
- Error RpcError `json:"error"`
- Id int `json:"id"`
- }
- type OneaddressOfaccount struct {
- Result string `json:"result"`
- Error RpcError `json:"error"`
- Id int `json:"id"`
- }
|