github.com/BlockABC/godash@v0.0.0-20191112120524-f4aa3a32c566/btcjson/walletsvrresults.go (about)

     1  // Copyright (c) 2014 The btcsuite developers
     2  // Copyright (c) 2016 The Dash developers
     3  // Use of this source code is governed by an ISC
     4  // license that can be found in the LICENSE file.
     5  
     6  package btcjson
     7  
     8  // GetTransactionDetailsResult models the details data from the gettransaction command.
     9  //
    10  // This models the "short" version of the ListTransactionsResult type, which
    11  // excludes fields common to the transaction.  These common fields are instead
    12  // part of the GetTransactionResult.
    13  type GetTransactionDetailsResult struct {
    14  	Account           string   `json:"account"`
    15  	Address           string   `json:"address,omitempty"`
    16  	Amount            float64  `json:"amount"`
    17  	Category          string   `json:"category"`
    18  	InvolvesWatchOnly bool     `json:"involveswatchonly,omitempty"`
    19  	Fee               *float64 `json:"fee,omitempty"`
    20  	Vout              uint32   `json:"vout"`
    21  }
    22  
    23  // GetTransactionResult models the data from the gettransaction command.
    24  type GetTransactionResult struct {
    25  	Amount          float64                       `json:"amount"`
    26  	Fee             float64                       `json:"fee,omitempty"`
    27  	Confirmations   int64                         `json:"confirmations"`
    28  	BlockHash       string                        `json:"blockhash"`
    29  	BlockIndex      int64                         `json:"blockindex"`
    30  	BlockTime       int64                         `json:"blocktime"`
    31  	TxID            string                        `json:"txid"`
    32  	WalletConflicts []string                      `json:"walletconflicts"`
    33  	Time            int64                         `json:"time"`
    34  	TimeReceived    int64                         `json:"timereceived"`
    35  	Details         []GetTransactionDetailsResult `json:"details"`
    36  	Hex             string                        `json:"hex"`
    37  }
    38  
    39  // InfoWalletResult models the data returned by the wallet server getinfo
    40  // command.
    41  type InfoWalletResult struct {
    42  	Version         int32   `json:"version"`
    43  	ProtocolVersion int32   `json:"protocolversion"`
    44  	WalletVersion   int32   `json:"walletversion"`
    45  	Balance         float64 `json:"balance"`
    46  	Blocks          int32   `json:"blocks"`
    47  	TimeOffset      int64   `json:"timeoffset"`
    48  	Connections     int32   `json:"connections"`
    49  	Proxy           string  `json:"proxy"`
    50  	Difficulty      float64 `json:"difficulty"`
    51  	TestNet         bool    `json:"testnet"`
    52  	KeypoolOldest   int64   `json:"keypoololdest"`
    53  	KeypoolSize     int32   `json:"keypoolsize"`
    54  	UnlockedUntil   int64   `json:"unlocked_until"`
    55  	PaytxFee        float64 `json:"paytxfee"`
    56  	RelayFee        float64 `json:"relayfee"`
    57  	Errors          string  `json:"errors"`
    58  }
    59  
    60  // ListTransactionsResult models the data from the listtransactions command.
    61  type ListTransactionsResult struct {
    62  	Account           string   `json:"account"`
    63  	Address           string   `json:"address,omitempty"`
    64  	Amount            float64  `json:"amount"`
    65  	BlockHash         string   `json:"blockhash,omitempty"`
    66  	BlockIndex        *int64   `json:"blockindex,omitempty"`
    67  	BlockTime         int64    `json:"blocktime,omitempty"`
    68  	Category          string   `json:"category"`
    69  	Confirmations     int64    `json:"confirmations"`
    70  	Fee               *float64 `json:"fee,omitempty"`
    71  	Generated         bool     `json:"generated,omitempty"`
    72  	InvolvesWatchOnly bool     `json:"involveswatchonly,omitempty"`
    73  	Time              int64    `json:"time"`
    74  	TimeReceived      int64    `json:"timereceived"`
    75  	TxID              string   `json:"txid"`
    76  	Vout              uint32   `json:"vout"`
    77  	WalletConflicts   []string `json:"walletconflicts"`
    78  	Comment           string   `json:"comment,omitempty"`
    79  	OtherAccount      string   `json:"otheraccount,omitempty"`
    80  }
    81  
    82  // ListReceivedByAccountResult models the data from the listreceivedbyaccount
    83  // command.
    84  type ListReceivedByAccountResult struct {
    85  	Account       string  `json:"account"`
    86  	Amount        float64 `json:"amount"`
    87  	Confirmations uint64  `json:"confirmations"`
    88  }
    89  
    90  // ListReceivedByAddressResult models the data from the listreceivedbyaddress
    91  // command.
    92  type ListReceivedByAddressResult struct {
    93  	Account           string   `json:"account"`
    94  	Address           string   `json:"address"`
    95  	Amount            float64  `json:"amount"`
    96  	Confirmations     uint64   `json:"confirmations"`
    97  	TxIDs             []string `json:"txids,omitempty"`
    98  	InvolvesWatchonly bool     `json:"involvesWatchonly,omitempty"`
    99  }
   100  
   101  // ListSinceBlockResult models the data from the listsinceblock command.
   102  type ListSinceBlockResult struct {
   103  	Transactions []ListTransactionsResult `json:"transactions"`
   104  	LastBlock    string                   `json:"lastblock"`
   105  }
   106  
   107  // ListUnspentResult models a successful response from the listunspent request.
   108  type ListUnspentResult struct {
   109  	TxID          string  `json:"txid"`
   110  	Vout          uint32  `json:"vout"`
   111  	Address       string  `json:"address"`
   112  	Account       string  `json:"account"`
   113  	ScriptPubKey  string  `json:"scriptPubKey"`
   114  	RedeemScript  string  `json:"redeemScript,omitempty"`
   115  	Amount        float64 `json:"amount"`
   116  	Confirmations int64   `json:"confirmations"`
   117  	Spendable     bool    `json:"spendable"`
   118  }
   119  
   120  // SignRawTransactionError models the data that contains script verification
   121  // errors from the signrawtransaction request.
   122  type SignRawTransactionError struct {
   123  	TxID      string `json:"txid"`
   124  	Vout      uint32 `json:"vout"`
   125  	ScriptSig string `json:"scriptSig"`
   126  	Sequence  uint32 `json:"sequence"`
   127  	Error     string `json:"error"`
   128  }
   129  
   130  // SignRawTransactionResult models the data from the signrawtransaction
   131  // command.
   132  type SignRawTransactionResult struct {
   133  	Hex      string                    `json:"hex"`
   134  	Complete bool                      `json:"complete"`
   135  	Errors   []SignRawTransactionError `json:"errors,omitempty"`
   136  }
   137  
   138  // ValidateAddressWalletResult models the data returned by the wallet server
   139  // validateaddress command.
   140  type ValidateAddressWalletResult struct {
   141  	IsValid      bool     `json:"isvalid"`
   142  	Address      string   `json:"address,omitempty"`
   143  	IsMine       bool     `json:"ismine,omitempty"`
   144  	IsWatchOnly  bool     `json:"iswatchonly,omitempty"`
   145  	IsScript     bool     `json:"isscript,omitempty"`
   146  	PubKey       string   `json:"pubkey,omitempty"`
   147  	IsCompressed bool     `json:"iscompressed,omitempty"`
   148  	Account      string   `json:"account,omitempty"`
   149  	Addresses    []string `json:"addresses,omitempty"`
   150  	Hex          string   `json:"hex,omitempty"`
   151  	Script       string   `json:"script,omitempty"`
   152  	SigsRequired int32    `json:"sigsrequired,omitempty"`
   153  }
   154  
   155  // GetBestBlockResult models the data from the getbestblock command.
   156  type GetBestBlockResult struct {
   157  	Hash   string `json:"hash"`
   158  	Height int32  `json:"height"`
   159  }