kaspad/btcjson/walletsvrresults.go
stasatdaglabs 8a234bf4a3 [DEV-242] Parameter names should be also camelCase in JSON-RPC (#118)
* [DEV-242] Modified some help functionality to convert to lowercase camel case instead of just lowercase.

* [DEV-242] Corrected help functionality for struct field names.

* [DEV-242] Corrected help functionality for struct names.

* [DEV-242] Cleaned up toLowercaseCamelCase.

* [DEV-242] Renamed toLowercaseCamelCase to toCamelCase.

* [DEV-242] Converted the rest of the stuff in rpcserverhelp.go to camelCase. Fixed a bug in the camelCase converter.

* [DEV-242] camelCase-ified the last few RPC parameter names.

* [DEV-242] Fixed an off-by-one bug in toCamelCase.

* [DEV-242] Changed back from "jsonRpc" to "jsonrpc".

* [DEV-242] Moved toCamelCase into utils, wrote unit tests for it, and fixed an off-by-one bug.

* [DEV-242] Re-exported DefaultHomeDir because it's required in windows_service.go.

* [DEV-242] Added a comment above DefaultHomeDir to satisfy golint.

* [DEV-242] Formatted config/config.go.
2018-11-05 18:50:55 +02:00

162 lines
6.6 KiB
Go

// Copyright (c) 2014 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package btcjson
// GetTransactionDetailsResult models the details data from the gettransaction command.
//
// This models the "short" version of the ListTransactionsResult type, which
// excludes fields common to the transaction. These common fields are instead
// part of the GetTransactionResult.
type GetTransactionDetailsResult struct {
Account string `json:"account"`
Address string `json:"address,omitempty"`
Amount float64 `json:"amount"`
Category string `json:"category"`
InvolvesWatchOnly bool `json:"involvesWatchOnly,omitempty"`
Fee *float64 `json:"fee,omitempty"`
Vout uint32 `json:"vout"`
}
// GetTransactionResult models the data from the gettransaction command.
type GetTransactionResult struct {
Amount float64 `json:"amount"`
Fee float64 `json:"fee,omitempty"`
Confirmations int64 `json:"confirmations"`
BlockHash string `json:"blockHash"`
BlockIndex int64 `json:"blockIndex"`
BlockTime uint64 `json:"blockTime"`
TxID string `json:"txId"`
WalletConflicts []string `json:"walletConflicts"`
Time int64 `json:"time"`
TimeReceived int64 `json:"timeReceived"`
Details []GetTransactionDetailsResult `json:"details"`
Hex string `json:"hex"`
}
// InfoWalletResult models the data returned by the wallet server getinfo
// command.
type InfoWalletResult struct {
Version int32 `json:"version"`
ProtocolVersion int32 `json:"protocolVersion"`
WalletVersion int32 `json:"walletVersion"`
Balance float64 `json:"balance"`
Blocks int32 `json:"blocks"`
TimeOffset int64 `json:"timeOffset"`
Connections int32 `json:"connections"`
Proxy string `json:"proxy"`
Difficulty float64 `json:"difficulty"`
TestNet bool `json:"testNet"`
KeypoolOldest int64 `json:"keypoolOldest"`
KeypoolSize int32 `json:"keypoolSize"`
UnlockedUntil int64 `json:"unlockedUntil"`
PayTxFee float64 `json:"payTxFee"`
RelayFee float64 `json:"relayFee"`
Errors string `json:"errors"`
}
// ListTransactionsResult models the data from the listtransactions command.
type ListTransactionsResult struct {
Abandoned bool `json:"abandoned"`
Account string `json:"account"`
Address string `json:"address,omitempty"`
Amount float64 `json:"amount"`
BIP125Replaceable string `json:"bip125Replaceable,omitempty"`
BlockHash string `json:"blockGash,omitempty"`
BlockIndex *int64 `json:"blockIndex,omitempty"`
BlockTime uint64 `json:"blockTime,omitempty"`
Category string `json:"category"`
Confirmations int64 `json:"confirmations"`
Fee *float64 `json:"fee,omitempty"`
Generated bool `json:"generated,omitempty"`
InvolvesWatchOnly bool `json:"involvesWatchOnly,omitempty"`
Time int64 `json:"time"`
TimeReceived int64 `json:"timeReceived"`
Trusted bool `json:"trusted"`
TxID string `json:"txId"`
Vout uint32 `json:"vout"`
WalletConflicts []string `json:"walletConflicts"`
Comment string `json:"comment,omitempty"`
OtherAccount string `json:"otherAccount,omitempty"`
}
// ListReceivedByAccountResult models the data from the listreceivedbyaccount
// command.
type ListReceivedByAccountResult struct {
Account string `json:"account"`
Amount float64 `json:"amount"`
Confirmations uint64 `json:"confirmations"`
}
// ListReceivedByAddressResult models the data from the listreceivedbyaddress
// command.
type ListReceivedByAddressResult struct {
Account string `json:"account"`
Address string `json:"address"`
Amount float64 `json:"amount"`
Confirmations uint64 `json:"confirmations"`
TxIDs []string `json:"txIds,omitempty"`
InvolvesWatchOnly bool `json:"involvesWatchOnly,omitempty"`
}
// ListSinceBlockResult models the data from the listsinceblock command.
type ListSinceBlockResult struct {
Transactions []ListTransactionsResult `json:"transactions"`
LastBlock string `json:"lastBlock"`
}
// ListUnspentResult models a successful response from the listunspent request.
type ListUnspentResult struct {
TxID string `json:"txId"`
Vout uint32 `json:"vout"`
Address string `json:"address"`
Account string `json:"account"`
ScriptPubKey string `json:"scriptPubKey"`
RedeemScript string `json:"redeemScript,omitempty"`
Amount float64 `json:"amount"`
Confirmations int64 `json:"confirmations"`
Spendable bool `json:"spendable"`
}
// SignRawTransactionError models the data that contains script verification
// errors from the signrawtransaction request.
type SignRawTransactionError struct {
TxID string `json:"txId"`
Vout uint32 `json:"vout"`
ScriptSig string `json:"scriptSig"`
Sequence uint64 `json:"sequence"`
Error string `json:"error"`
}
// SignRawTransactionResult models the data from the signrawtransaction
// command.
type SignRawTransactionResult struct {
Hex string `json:"hex"`
Complete bool `json:"complete"`
Errors []SignRawTransactionError `json:"errors,omitempty"`
}
// ValidateAddressWalletResult models the data returned by the wallet server
// validateaddress command.
type ValidateAddressWalletResult struct {
IsValid bool `json:"isValid"`
Address string `json:"address,omitempty"`
IsMine bool `json:"isMine,omitempty"`
IsWatchOnly bool `json:"isWatchOnly,omitempty"`
IsScript bool `json:"isScript,omitempty"`
PubKey string `json:"pubKey,omitempty"`
IsCompressed bool `json:"isCompressed,omitempty"`
Account string `json:"account,omitempty"`
Addresses []string `json:"addresses,omitempty"`
Hex string `json:"hex,omitempty"`
Script string `json:"script,omitempty"`
SigsRequired int32 `json:"sigsRequired,omitempty"`
}
// GetBestBlockResult models the data from the getbestblock command.
type GetBestBlockResult struct {
Hash string `json:"hash"`
Height int32 `json:"height"`
}