bitcoindclient

package module
v22.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 14 Imported by: 0

README

Go Reference

go-bitcoindclient

A client for connecting to bitcoind from Go code. Safe for concurrent use. All RPC methods are code-generated from the bitcoind help output.

Import

	bitcoindclient "github.com/joakimofv/go-bitcoindclient/v22"

Dependencies

libzmq

libzmq must be installed in order to compile, because it is needed by this import that handles ZMQ. See the instructions for your OS on the ZMQ website.

bitcoind

The major version of this package tracks the major version of bitcoind (starting with v22). Running the client against another version might or might not work, depending on specific changes to the RPC methods. There is no explicit version check by default.

You don't need to have bitcoind installed in order to compile. To run the tests or re-generate the code you would need it.

Basic Usage

New
bc, err := bitcoindclient.New(bitcoindclient.Config{
	RpcAddress:    "localhost:8332",
	RpcUser:       "name",
	RpcPassword:   "password",
	ZmqPubAddress: "tcp://localhost:12345",
})
if err != nil {
	// Handle err
}

See Config for options.

Ready: Check Connection
for {
	if err := bc.Ready(); err != nil {
		// Inspect error, maybe give up
	} else {
		// Success!
		break
	}
}

There are also options that can be given to Ready to tell it to check the version or ZMQ messages received, see ReadyOption.

Call RPC Methods
resp, err := bc.GetBlock(ctx, GetBlockReq{
	Blockhash: "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
})
if err != nil {
	// Handle err
}
fmt.Println(resp.Hex)

See pkg.go.dev for the full list of methods. Or see BitcoinCore RPC Docs, the methods are the same (in camelcase). Input is always incapsulated in a struct called <Method>Req (or empty) and output is always in a struct called <Method>Resp (or empty).

Close
if err := bc.Close(); err != nil {
	// Handle err
}

ZMQ Messages

Subscribe
ch, cancel, err := bc.SubscribeHashBlock()
if err != nil {
	// Handle err
}

There are SubscribeHashTx, SubscribeHashBlock, SubscribeRawTx, SubscribeRawBlock, and SubscribeSequence.

Receive
select {
case msg, open := <-ch:
	if !open {
		// return
	}
	fmt.Println(hex.EncodeToString(msg.Hash[:]))
}

The message types are HashMsg, RawMsg or SequenceMsg.

Cancel
cancel()

This closes the channel and releases resources. Closing the client will do that too.

Error Handling

The RPC methods may return errors that are of the type *BitcoindError, that means the connection was successful but bitcoind had something to complain about related to the user input.

var bErr *bitcoindclient.BitcoindError
if errors.As(err, &bErr) {
	fmt.Println(bErr.Code)
	fmt.Println(bErr.Message)
}

Other expected errors are *url.Error if the connection failed, or context.Canceled/context.DeadlineExceeded if the context was cancelled/expired.

If running against a different version of bitcoind you might get an error of type *UnmarshalError because the response format was not as expected. If you get this when running against the matching version then please report an issue.

Call Options

Connection Retries
ctx = bitcoindclient.UseConnectionRetries(ctx, 2)

Enable retry on connection error by modifying the context with UseConnectionRetries.

URI Path
ctx = bitcoindclient.UseUriPath(ctx, "/wallet/mywallet")

Change the URI path for a call by modifying the context with UseUriPath.

Documentation

Index

Constants

View Source
const (
	MAJOR_VERSION               = 22
	DefaultSubChannelBufferSize = 2
	DefaultRpcUriPath           = "/"
)

Variables

View Source
var (
	ErrRpcDisabled       = errors.New("RPC disabled (RpcAddress was not set).")
	ErrSubscribeDisabled = errors.New("Subscribe disabled (ZmqPubAddress was not set).")
	ErrSubscribeExited   = errors.New("Subscription backend has exited.")
)

Functions

func UseConnectionRetries added in v22.1.0

func UseConnectionRetries(ctx context.Context, retries int) context.Context

UseConnectionRetries enables retries on connection failure, as many as the given number. Negative number for infinite retries, 0 for no retries (default).

If the context is canceled or expired the latest connection error will be returned instead of context.Canceled/context.DeadlineExceeded.

func UseUriPath

func UseUriPath(ctx context.Context, newPath string) context.Context

UseUriPath changes the RpcUriPath for a single request, when applied to that requests context.

Types

type AbandonTransactionReq

type AbandonTransactionReq struct {
	// The transaction id
	TxID string `json:"txid"`
}

AbandonTransactionReq holds the arguments for the AbandonTransaction call.

  1. txid (string, required) The transaction id

type AbortRescanResp

type AbortRescanResp struct {
	// Whether the abort was successful
	TrueOrFalse bool
}

AbortRescanResp holds the response to the AbortRescan call.

true|false    (boolean) Whether the abort was successful

func (AbortRescanResp) MarshalJSON

func (alts AbortRescanResp) MarshalJSON() ([]byte, error)

func (*AbortRescanResp) UnmarshalJSON

func (alts *AbortRescanResp) UnmarshalJSON(b []byte) error

type AddMultisigAddressReq

type AddMultisigAddressReq struct {
	// The number of required signatures out of the n keys or addresses.
	NRequired float64 `json:"nrequired"`

	// The bitcoin addresses or hex-encoded public keys
	// Element: Key    bitcoin address or hex-encoded public key
	Keys []string `json:"keys"`

	// A label to assign the addresses to.
	Label string `json:"label,omitempty"`

	// The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".
	// Default: set by -addresstype
	AddressType string `json:"address_type,omitempty"`
}

AddMultisigAddressReq holds the arguments for the AddMultisigAddress call.

  1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.
  2. keys (json array, required) The bitcoin addresses or hex-encoded public keys [ "key", (string) bitcoin address or hex-encoded public key ... ]
  3. label (string, optional) A label to assign the addresses to.
  4. address_type (string, optional, default=set by -addresstype) The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".

type AddMultisigAddressResp

type AddMultisigAddressResp struct {
	// The value of the new multisig address
	Address string `json:"address"`

	// The string value of the hex-encoded redemption script
	RedeemScript string `json:"redeemScript"`

	// The descriptor for this multisig
	Descriptor string `json:"descriptor"`
}

AddMultisigAddressResp holds the response to the AddMultisigAddress call.

{                            (json object)
  "address" : "str",         (string) The value of the new multisig address
  "redeemScript" : "hex",    (string) The string value of the hex-encoded redemption script
  "descriptor" : "str"       (string) The descriptor for this multisig
}

type AddNodeReq

type AddNodeReq struct {
	// The node (see getpeerinfo for nodes)
	Node string `json:"node"`

	// 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once
	Command string `json:"command"`
}

AddNodeReq holds the arguments for the AddNode call.

  1. node (string, required) The node (see getpeerinfo for nodes)
  2. command (string, required) 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once

type AnalyzePsbtReq

type AnalyzePsbtReq struct {
	// A base64 string of a PSBT
	Psbt string `json:"psbt"`
}

AnalyzePsbtReq holds the arguments for the AnalyzePsbt call.

  1. psbt (string, required) A base64 string of a PSBT

type AnalyzePsbtResp

type AnalyzePsbtResp struct {
	Inputs []AnalyzePsbtRespInputs `json:"inputs"`

	// Estimated vsize of the final signed transaction
	EstimatedVSize *float64 `json:"estimated_vsize,omitempty"`

	// Estimated feerate of the final signed transaction in BTC/kvB. Shown only if all UTXO slots in the PSBT have been filled
	EstimatedFeeRate *float64 `json:"estimated_feerate,omitempty"`

	// The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled
	Fee *float64 `json:"fee,omitempty"`

	// Role of the next person that this psbt needs to go to
	Next string `json:"next"`

	// Error message (if there is one)
	Error string `json:"error,omitempty"`
}

AnalyzePsbtResp holds the response to the AnalyzePsbt call.

{                                   (json object)
  "inputs" : [                      (json array)
    {                               (json object)
      "has_utxo" : true|false,      (boolean) Whether a UTXO is provided
      "is_final" : true|false,      (boolean) Whether the input is finalized
      "missing" : {                 (json object, optional) Things that are missing that are required to complete this input
        "pubkeys" : [               (json array, optional)
          "hex",                    (string) Public key ID, hash160 of the public key, of a public key whose BIP 32 derivation path is missing
          ...
        ],
        "signatures" : [            (json array, optional)
          "hex",                    (string) Public key ID, hash160 of the public key, of a public key whose signature is missing
          ...
        ],
        "redeemscript" : "hex",     (string, optional) Hash160 of the redeemScript that is missing
        "witnessscript" : "hex"     (string, optional) SHA256 of the witnessScript that is missing
      },
      "next" : "str"                (string, optional) Role of the next person that this input needs to go to
    },
    ...
  ],
  "estimated_vsize" : n,            (numeric, optional) Estimated vsize of the final signed transaction
  "estimated_feerate" : n,          (numeric, optional) Estimated feerate of the final signed transaction in BTC/kvB. Shown only if all UTXO slots in the PSBT have been filled
  "fee" : n,                        (numeric, optional) The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled
  "next" : "str",                   (string) Role of the next person that this psbt needs to go to
  "error" : "str"                   (string, optional) Error message (if there is one)
}

type AnalyzePsbtRespInputs

type AnalyzePsbtRespInputs struct {
	// Whether a UTXO is provided
	HasUtxo bool `json:"has_utxo"`

	// Whether the input is finalized
	IsFinal bool `json:"is_final"`

	// Things that are missing that are required to complete this input
	Missing *AnalyzePsbtRespInputsMissing `json:"missing,omitempty"`

	// Role of the next person that this input needs to go to
	Next string `json:"next,omitempty"`
}

type AnalyzePsbtRespInputsMissing

type AnalyzePsbtRespInputsMissing struct {
	// Element: Hex    Public key ID, hash160 of the public key, of a public key whose BIP 32 derivation path is missing
	Pubkeys []string `json:"pubkeys,omitempty"`

	// Element: Hex    Public key ID, hash160 of the public key, of a public key whose signature is missing
	Signatures []string `json:"signatures,omitempty"`

	// Hash160 of the redeemScript that is missing
	RedeemScript string `json:"redeemscript,omitempty"`

	// SHA256 of the witnessScript that is missing
	WitnessScript string `json:"witnessscript,omitempty"`
}

type BackupWalletReq

type BackupWalletReq struct {
	// The destination directory or file
	Destination string `json:"destination"`
}

BackupWalletReq holds the arguments for the BackupWallet call.

  1. destination (string, required) The destination directory or file

type BitcoindClient

type BitcoindClient struct {
	Cfg Config
	// contains filtered or unexported fields
}

BitcoindClient is a client that provides methods for interacting with bitcoind. Must be created with New and destroyed with Close.

Clients are safe for concurrent use by multiple goroutines.

func New

func New(cfg Config) (*BitcoindClient, error)

New returns an initiated client, or an error. Missing RpcAddress in Config will disable the RPC methods, and missing ZmqPubAddress will disable the Subscribe methods. New does not try using the RPC connection and can't detect if the ZMQ connection works, you need to call Ready in order to check connection health.

func (*BitcoindClient) AbandonTransaction

func (bc *BitcoindClient) AbandonTransaction(ctx context.Context, args AbandonTransactionReq) (err error)

AbandonTransaction RPC method. Mark in-wallet transaction <txid> as abandoned This will mark this transaction and all its in-wallet descendants as abandoned which will allow for their inputs to be respent. It can be used to replace "stuck" or evicted transactions. It only works on transactions which are not included in a block and are not currently in the mempool. It has no effect on transactions which are already abandoned.

func (*BitcoindClient) AbortRescan

func (bc *BitcoindClient) AbortRescan(ctx context.Context) (result AbortRescanResp, err error)

AbortRescan RPC method. Stops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call. Note: Use "getwalletinfo" to query the scanning progress.

func (*BitcoindClient) AddMultisigAddress

func (bc *BitcoindClient) AddMultisigAddress(ctx context.Context, args AddMultisigAddressReq) (result AddMultisigAddressResp, err error)

AddMultisigAddress RPC method. Add an nrequired-to-sign multisignature address to the wallet. Requires a new wallet backup. Each key is a Bitcoin address or hex-encoded public key. This functionality is only intended for use with non-watchonly addresses. See `importaddress` for watchonly p2sh address support. If 'label' is specified, assign address to that label.

func (*BitcoindClient) AddNode

func (bc *BitcoindClient) AddNode(ctx context.Context, args AddNodeReq) (err error)

AddNode RPC method. Attempts to add or remove a node from the addnode list. Or try a connection to a node once. Nodes added using addnode (or -connect) are protected from DoS disconnection and are not required to be full nodes/support SegWit as other outbound peers are (though such peers will not be synced from). Addnode connections are limited to 8 at a time and are counted separately from the -maxconnections limit.

func (*BitcoindClient) AnalyzePsbt

func (bc *BitcoindClient) AnalyzePsbt(ctx context.Context, args AnalyzePsbtReq) (result AnalyzePsbtResp, err error)

AnalyzePsbt RPC method. Analyzes and provides information about the current status of a PSBT and its inputs

func (*BitcoindClient) BackupWallet

func (bc *BitcoindClient) BackupWallet(ctx context.Context, args BackupWalletReq) (err error)

BackupWallet RPC method. Safely copies current wallet file to destination, which can be a directory or a path with filename.

func (*BitcoindClient) BumpFee

func (bc *BitcoindClient) BumpFee(ctx context.Context, args BumpFeeReq) (result BumpFeeResp, err error)

BumpFee RPC method. Bumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B. An opt-in RBF transaction with the given txid must be in the wallet. The command will pay the additional fee by reducing change outputs or adding inputs when necessary. It may add a new change output if one does not already exist. All inputs in the original transaction will be included in the replacement transaction. The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs. By default, the new fee will be calculated automatically using the estimatesmartfee RPC. The user can specify a confirmation target for estimatesmartfee. Alternatively, the user can specify a fee rate in sat/vB for the new transaction. At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee returned by getnetworkinfo) to enter the node's mempool. * WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. *

func (*BitcoindClient) ClearBanned

func (bc *BitcoindClient) ClearBanned(ctx context.Context) (err error)

ClearBanned RPC method. Clear all banned IPs.

func (*BitcoindClient) Close

func (bc *BitcoindClient) Close() (err error)

Close terminates the client and releases resources.

func (*BitcoindClient) CombinePsbt

func (bc *BitcoindClient) CombinePsbt(ctx context.Context, args CombinePsbtReq) (result CombinePsbtResp, err error)

CombinePsbt RPC method. Combine multiple partially signed Bitcoin transactions into one transaction. Implements the Combiner role.

func (*BitcoindClient) CombineRawTransaction

func (bc *BitcoindClient) CombineRawTransaction(ctx context.Context, args CombineRawTransactionReq) (result CombineRawTransactionResp, err error)

CombineRawTransaction RPC method. Combine multiple partially signed transactions into one transaction. The combined transaction may be another partially signed transaction or a fully signed transaction.

func (*BitcoindClient) ConvertToPsbt

func (bc *BitcoindClient) ConvertToPsbt(ctx context.Context, args ConvertToPsbtReq) (result ConvertToPsbtResp, err error)

ConvertToPsbt RPC method. Converts a network serialized transaction to a PSBT. This should be used only with createrawtransaction and fundrawtransaction createpsbt and walletcreatefundedpsbt should be used for new applications.

func (*BitcoindClient) CreateMultisig

func (bc *BitcoindClient) CreateMultisig(ctx context.Context, args CreateMultisigReq) (result CreateMultisigResp, err error)

CreateMultisig RPC method. Creates a multi-signature address with n signature of m keys required. It returns a json object with the address and redeemScript.

func (*BitcoindClient) CreatePsbt

func (bc *BitcoindClient) CreatePsbt(ctx context.Context, args CreatePsbtReq) (result CreatePsbtResp, err error)

CreatePsbt RPC method. Creates a transaction in the Partially Signed Transaction format. Implements the Creator role.

func (*BitcoindClient) CreateRawTransaction

func (bc *BitcoindClient) CreateRawTransaction(ctx context.Context, args CreateRawTransactionReq) (result CreateRawTransactionResp, err error)

CreateRawTransaction RPC method. Create a transaction spending the given inputs and creating new outputs. Outputs can be addresses or data. Returns hex-encoded raw transaction. Note that the transaction's inputs are not signed, and it is not stored in the wallet or transmitted to the network.

func (*BitcoindClient) CreateWallet

func (bc *BitcoindClient) CreateWallet(ctx context.Context, args CreateWalletReq) (result CreateWalletResp, err error)

CreateWallet RPC method. Creates and loads a new wallet.

func (*BitcoindClient) DecodePsbt

func (bc *BitcoindClient) DecodePsbt(ctx context.Context, args DecodePsbtReq) (result DecodePsbtResp, err error)

DecodePsbt RPC method. Return a JSON object representing the serialized, base64-encoded partially signed Bitcoin transaction.

func (*BitcoindClient) DecodeRawTransaction

func (bc *BitcoindClient) DecodeRawTransaction(ctx context.Context, args DecodeRawTransactionReq) (result DecodeRawTransactionResp, err error)

DecodeRawTransaction RPC method. Return a JSON object representing the serialized, hex-encoded transaction.

func (*BitcoindClient) DecodeScript

func (bc *BitcoindClient) DecodeScript(ctx context.Context, args DecodeScriptReq) (result DecodeScriptResp, err error)

DecodeScript RPC method. Decode a hex-encoded script.

func (*BitcoindClient) DeriveAddresses

func (bc *BitcoindClient) DeriveAddresses(ctx context.Context, args DeriveAddressesReq) (result DeriveAddressesResp, err error)

DeriveAddresses RPC method. Derives one or more addresses corresponding to an output descriptor. Examples of output descriptors are:

pkh(<pubkey>)                        P2PKH outputs for the given pubkey
wpkh(<pubkey>)                       Native segwit P2PKH outputs for the given pubkey
sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys
raw(<hex script>)                    Outputs whose scriptPubKey equals the specified hex scripts

In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one or more path elements separated by "/", where "h" represents a hardened child key. For more information on output descriptors, see the documentation in the doc/descriptors.md file.

func (*BitcoindClient) DisconnectNode

func (bc *BitcoindClient) DisconnectNode(ctx context.Context, args DisconnectNodeReq) (err error)

DisconnectNode RPC method. Immediately disconnects from the specified peer node. Strictly one out of 'address' and 'nodeid' can be provided to identify the node. To disconnect by nodeid, either set 'address' to the empty string, or call using the named 'nodeid' argument only.

func (*BitcoindClient) DumpPrivkey

func (bc *BitcoindClient) DumpPrivkey(ctx context.Context, args DumpPrivkeyReq) (result DumpPrivkeyResp, err error)

DumpPrivkey RPC method. Reveals the private key corresponding to 'address'. Then the importprivkey can be used with this output

func (*BitcoindClient) DumpWallet

func (bc *BitcoindClient) DumpWallet(ctx context.Context, args DumpWalletReq) (result DumpWalletResp, err error)

DumpWallet RPC method. Dumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files. Imported scripts are included in the dumpfile, but corresponding BIP173 addresses, etc. may not be added automatically by importwallet. Note that if your wallet contains keys which are not derived from your HD seed (e.g. imported keys), these are not covered by only backing up the seed itself, and must be backed up too (e.g. ensure you back up the whole dumpfile).

func (*BitcoindClient) EncryptWallet

func (bc *BitcoindClient) EncryptWallet(ctx context.Context, args EncryptWalletReq) (result EncryptWalletResp, err error)

EncryptWallet RPC method. Encrypts the wallet with 'passphrase'. This is for first time encryption. After this, any calls that interact with private keys such as sending or signing will require the passphrase to be set prior the making these calls. Use the walletpassphrase call for this, and then walletlock call. If the wallet is already encrypted, use the walletpassphrasechange call.

func (*BitcoindClient) EnumerateSigners

func (bc *BitcoindClient) EnumerateSigners(ctx context.Context) (result EnumerateSignersResp, err error)

EnumerateSigners RPC method. Returns a list of external signers from -signer.

func (*BitcoindClient) EstimateSmartFee

func (bc *BitcoindClient) EstimateSmartFee(ctx context.Context, args EstimateSmartFeeReq) (result EstimateSmartFeeResp, err error)

EstimateSmartFee RPC method. Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within conf_target blocks if possible and return the number of blocks for which the estimate is valid. Uses virtual transaction size as defined in BIP 141 (witness data is discounted).

func (*BitcoindClient) FinalizePsbt

func (bc *BitcoindClient) FinalizePsbt(ctx context.Context, args FinalizePsbtReq) (result FinalizePsbtResp, err error)

FinalizePsbt RPC method. Finalize the inputs of a PSBT. If the transaction is fully signed, it will produce a network serialized transaction which can be broadcast with sendrawtransaction. Otherwise a PSBT will be created which has the final_scriptSig and final_scriptWitness fields filled for inputs that are complete. Implements the Finalizer and Extractor roles.

func (*BitcoindClient) FundRawTransaction

func (bc *BitcoindClient) FundRawTransaction(ctx context.Context, args FundRawTransactionReq) (result FundRawTransactionResp, err error)

FundRawTransaction RPC method. If the transaction has no inputs, they will be automatically selected to meet its out value. It will add at most one change output to the outputs. No existing outputs will be modified unless "subtractFeeFromOutputs" is specified. Note that inputs which were signed may need to be resigned after completion since in/outputs have been added. The inputs added will not be signed, use signrawtransactionwithkey

or signrawtransactionwithwallet for that.

Note that all existing inputs must have their previous output transaction be in the wallet. Note that all inputs selected must be of standard form and P2SH scripts must be in the wallet using importaddress or addmultisigaddress (to calculate fees). You can see whether this is the case by checking the "solvable" field in the listunspent output. Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only

func (*BitcoindClient) GenerateBlock

func (bc *BitcoindClient) GenerateBlock(ctx context.Context, args GenerateBlockReq) (result GenerateBlockResp, err error)

GenerateBlock RPC method. Mine a block with a set of ordered transactions immediately to a specified address or descriptor (before the RPC call returns)

func (*BitcoindClient) GenerateToAddress

func (bc *BitcoindClient) GenerateToAddress(ctx context.Context, args GenerateToAddressReq) (result GenerateToAddressResp, err error)

GenerateToAddress RPC method. Mine blocks immediately to a specified address (before the RPC call returns)

func (*BitcoindClient) GenerateToDescriptor

func (bc *BitcoindClient) GenerateToDescriptor(ctx context.Context, args GenerateToDescriptorReq) (result GenerateToDescriptorResp, err error)

GenerateToDescriptor RPC method. Mine blocks immediately to a specified descriptor (before the RPC call returns)

func (*BitcoindClient) GetAddedNodeInfo

func (bc *BitcoindClient) GetAddedNodeInfo(ctx context.Context, args GetAddedNodeInfoReq) (result GetAddedNodeInfoResp, err error)

GetAddedNodeInfo RPC method. Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here)

func (*BitcoindClient) GetAddressInfo

func (bc *BitcoindClient) GetAddressInfo(ctx context.Context, args GetAddressInfoReq) (result GetAddressInfoResp, err error)

GetAddressInfo RPC method. Return information about the given bitcoin address. Some of the information will only be present if the address is in the active wallet.

func (*BitcoindClient) GetAddressesByLabel

func (bc *BitcoindClient) GetAddressesByLabel(ctx context.Context, args GetAddressesByLabelReq) (err error)

GetAddressesByLabel RPC method. Returns the list of addresses assigned the specified label.

func (*BitcoindClient) GetBalance

func (bc *BitcoindClient) GetBalance(ctx context.Context, args GetBalanceReq) (result GetBalanceResp, err error)

GetBalance RPC method. Returns the total available balance. The available balance is what the wallet considers currently spendable, and is thus affected by options which limit spendability such as -spendzeroconfchange.

func (*BitcoindClient) GetBalances

func (bc *BitcoindClient) GetBalances(ctx context.Context) (result GetBalancesResp, err error)

GetBalances RPC method. Returns an object with all balances in BTC.

func (*BitcoindClient) GetBestBlockhash

func (bc *BitcoindClient) GetBestBlockhash(ctx context.Context) (result GetBestBlockhashResp, err error)

GetBestBlockhash RPC method. Returns the hash of the best (tip) block in the most-work fully-validated chain.

func (*BitcoindClient) GetBlock

func (bc *BitcoindClient) GetBlock(ctx context.Context, args GetBlockReq) (result GetBlockResp, err error)

GetBlock RPC method. If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'. If verbosity is 1, returns an Object with information about block <hash>. If verbosity is 2, returns an Object with information about block <hash> and information about each transaction.

func (*BitcoindClient) GetBlockCount

func (bc *BitcoindClient) GetBlockCount(ctx context.Context) (result GetBlockCountResp, err error)

GetBlockCount RPC method. Returns the height of the most-work fully-validated chain. The genesis block has height 0.

func (*BitcoindClient) GetBlockFilter

func (bc *BitcoindClient) GetBlockFilter(ctx context.Context, args GetBlockFilterReq) (result GetBlockFilterResp, err error)

GetBlockFilter RPC method. Retrieve a BIP 157 content filter for a particular block.

func (*BitcoindClient) GetBlockHeader

func (bc *BitcoindClient) GetBlockHeader(ctx context.Context, args GetBlockHeaderReq) (result GetBlockHeaderResp, err error)

GetBlockHeader RPC method. If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'. If verbose is true, returns an Object with information about blockheader <hash>.

func (*BitcoindClient) GetBlockStats

func (bc *BitcoindClient) GetBlockStats(ctx context.Context, args GetBlockStatsReq) (result GetBlockStatsResp, err error)

GetBlockStats RPC method. Compute per block statistics for a given window. All amounts are in satoshis. It won't work for some heights with pruning.

func (*BitcoindClient) GetBlockTemplate

func (bc *BitcoindClient) GetBlockTemplate(ctx context.Context, args GetBlockTemplateReq) (result GetBlockTemplateResp, err error)

GetBlockTemplate RPC method. If the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'. It returns data needed to construct a block to work on. For full specification, see BIPs 22, 23, 9, and 145:

https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki
https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki
https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes
https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki

func (*BitcoindClient) GetBlockchainInfo

func (bc *BitcoindClient) GetBlockchainInfo(ctx context.Context) (result GetBlockchainInfoResp, err error)

GetBlockchainInfo RPC method. Returns an object containing various state info regarding blockchain processing.

func (*BitcoindClient) GetBlockhash

func (bc *BitcoindClient) GetBlockhash(ctx context.Context, args GetBlockhashReq) (result GetBlockhashResp, err error)

GetBlockhash RPC method. Returns hash of block in best-block-chain at height provided.

func (*BitcoindClient) GetChainTips

func (bc *BitcoindClient) GetChainTips(ctx context.Context) (result GetChainTipsResp, err error)

GetChainTips RPC method. Return information about all known tips in the block tree, including the main chain as well as orphaned branches.

func (*BitcoindClient) GetChainTxStats

func (bc *BitcoindClient) GetChainTxStats(ctx context.Context, args GetChainTxStatsReq) (result GetChainTxStatsResp, err error)

GetChainTxStats RPC method. Compute statistics about the total number and rate of transactions in the chain.

func (*BitcoindClient) GetConnectionCount

func (bc *BitcoindClient) GetConnectionCount(ctx context.Context) (result GetConnectionCountResp, err error)

GetConnectionCount RPC method. Returns the number of connections to other nodes.

func (*BitcoindClient) GetDescriptorInfo

func (bc *BitcoindClient) GetDescriptorInfo(ctx context.Context, args GetDescriptorInfoReq) (result GetDescriptorInfoResp, err error)

GetDescriptorInfo RPC method. Analyses a descriptor.

func (*BitcoindClient) GetDifficulty

func (bc *BitcoindClient) GetDifficulty(ctx context.Context) (result GetDifficultyResp, err error)

GetDifficulty RPC method. Returns the proof-of-work difficulty as a multiple of the minimum difficulty.

func (*BitcoindClient) GetIndexInfo

func (bc *BitcoindClient) GetIndexInfo(ctx context.Context, args GetIndexInfoReq) (result GetIndexInfoResp, err error)

GetIndexInfo RPC method. Returns the status of one or all available indices currently running in the node.

func (*BitcoindClient) GetMemoryInfo

func (bc *BitcoindClient) GetMemoryInfo(ctx context.Context, args GetMemoryInfoReq) (result GetMemoryInfoResp, err error)

GetMemoryInfo RPC method. Returns an object containing information about memory usage.

func (*BitcoindClient) GetMempoolAncestors

func (bc *BitcoindClient) GetMempoolAncestors(ctx context.Context, args GetMempoolAncestorsReq) (result GetMempoolAncestorsResp, err error)

GetMempoolAncestors RPC method. If txid is in the mempool, returns all in-mempool ancestors.

func (*BitcoindClient) GetMempoolDescendants

func (bc *BitcoindClient) GetMempoolDescendants(ctx context.Context, args GetMempoolDescendantsReq) (result GetMempoolDescendantsResp, err error)

GetMempoolDescendants RPC method. If txid is in the mempool, returns all in-mempool descendants.

func (*BitcoindClient) GetMempoolEntry

func (bc *BitcoindClient) GetMempoolEntry(ctx context.Context, args GetMempoolEntryReq) (result GetMempoolEntryResp, err error)

GetMempoolEntry RPC method. Returns mempool data for given transaction

func (*BitcoindClient) GetMempoolInfo

func (bc *BitcoindClient) GetMempoolInfo(ctx context.Context) (result GetMempoolInfoResp, err error)

GetMempoolInfo RPC method. Returns details on the active state of the TX memory pool.

func (*BitcoindClient) GetMiningInfo

func (bc *BitcoindClient) GetMiningInfo(ctx context.Context) (result GetMiningInfoResp, err error)

GetMiningInfo RPC method. Returns a json object containing mining-related information.

func (*BitcoindClient) GetNetTotals

func (bc *BitcoindClient) GetNetTotals(ctx context.Context) (result GetNetTotalsResp, err error)

GetNetTotals RPC method. Returns information about network traffic, including bytes in, bytes out, and current time.

func (*BitcoindClient) GetNetworkHashPs

func (bc *BitcoindClient) GetNetworkHashPs(ctx context.Context, args GetNetworkHashPsReq) (result GetNetworkHashPsResp, err error)

GetNetworkHashPs RPC method. Returns the estimated network hashes per second based on the last n blocks. Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change. Pass in [height] to estimate the network speed at the time when a certain block was found.

func (*BitcoindClient) GetNetworkInfo

func (bc *BitcoindClient) GetNetworkInfo(ctx context.Context) (result GetNetworkInfoResp, err error)

GetNetworkInfo RPC method. Returns an object containing various state info regarding P2P networking.

func (*BitcoindClient) GetNewAddress

func (bc *BitcoindClient) GetNewAddress(ctx context.Context, args GetNewAddressReq) (result GetNewAddressResp, err error)

GetNewAddress RPC method. Returns a new Bitcoin address for receiving payments. If 'label' is specified, it is added to the address book so payments received with the address will be associated with 'label'.

func (*BitcoindClient) GetNodeAddresses

func (bc *BitcoindClient) GetNodeAddresses(ctx context.Context, args GetNodeAddressesReq) (result GetNodeAddressesResp, err error)

GetNodeAddresses RPC method. Return known addresses, which can potentially be used to find new nodes in the network.

func (*BitcoindClient) GetPeerInfo

func (bc *BitcoindClient) GetPeerInfo(ctx context.Context) (result GetPeerInfoResp, err error)

GetPeerInfo RPC method. Returns data about each connected network node as a json array of objects.

func (*BitcoindClient) GetRawChangeaddress

func (bc *BitcoindClient) GetRawChangeaddress(ctx context.Context, args GetRawChangeaddressReq) (result GetRawChangeaddressResp, err error)

GetRawChangeaddress RPC method. Returns a new Bitcoin address, for receiving change. This is for use with raw transactions, NOT normal use.

func (*BitcoindClient) GetRawMempool

func (bc *BitcoindClient) GetRawMempool(ctx context.Context, args GetRawMempoolReq) (result GetRawMempoolResp, err error)

GetRawMempool RPC method. Returns all transaction ids in memory pool as a json array of string transaction ids. Hint: use getmempoolentry to fetch a specific transaction from the mempool.

func (*BitcoindClient) GetRawTransaction

func (bc *BitcoindClient) GetRawTransaction(ctx context.Context, args GetRawTransactionReq) (result GetRawTransactionResp, err error)

GetRawTransaction RPC method. Return the raw transaction data. By default this function only works for mempool transactions. When called with a blockhash argument, getrawtransaction will return the transaction if the specified block is available and the transaction is found in that block. When called without a blockhash argument, getrawtransaction will return the transaction if it is in the mempool, or if -txindex is enabled and the transaction is in a block in the blockchain. Hint: Use gettransaction for wallet transactions. If verbose is 'true', returns an Object with information about 'txid'. If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.

func (*BitcoindClient) GetReceivedByAddress

func (bc *BitcoindClient) GetReceivedByAddress(ctx context.Context, args GetReceivedByAddressReq) (result GetReceivedByAddressResp, err error)

GetReceivedByAddress RPC method. Returns the total amount received by the given address in transactions with at least minconf confirmations.

func (*BitcoindClient) GetReceivedByLabel

func (bc *BitcoindClient) GetReceivedByLabel(ctx context.Context, args GetReceivedByLabelReq) (result GetReceivedByLabelResp, err error)

GetReceivedByLabel RPC method. Returns the total amount received by addresses with <label> in transactions with at least [minconf] confirmations.

func (*BitcoindClient) GetRpcInfo

func (bc *BitcoindClient) GetRpcInfo(ctx context.Context) (result GetRpcInfoResp, err error)

GetRpcInfo RPC method. Returns details of the RPC server.

func (*BitcoindClient) GetTransaction

func (bc *BitcoindClient) GetTransaction(ctx context.Context, args GetTransactionReq) (result GetTransactionResp, err error)

GetTransaction RPC method. Get detailed information about in-wallet transaction <txid>

func (*BitcoindClient) GetTxOut

func (bc *BitcoindClient) GetTxOut(ctx context.Context, args GetTxOutReq) (result GetTxOutResp, err error)

GetTxOut RPC method. Returns details about an unspent transaction output.

func (*BitcoindClient) GetTxOutProof

func (bc *BitcoindClient) GetTxOutProof(ctx context.Context, args GetTxOutProofReq) (result GetTxOutProofResp, err error)

GetTxOutProof RPC method. Returns a hex-encoded proof that "txid" was included in a block. NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option or specify the block in which the transaction is included manually (by blockhash).

func (*BitcoindClient) GetTxOutSetInfo

func (bc *BitcoindClient) GetTxOutSetInfo(ctx context.Context, args GetTxOutSetInfoReq) (result GetTxOutSetInfoResp, err error)

GetTxOutSetInfo RPC method. Returns statistics about the unspent transaction output set. Note this call may take some time if you are not using coinstatsindex.

func (*BitcoindClient) GetUnconfirmedBalance

func (bc *BitcoindClient) GetUnconfirmedBalance(ctx context.Context) (result GetUnconfirmedBalanceResp, err error)

GetUnconfirmedBalance RPC method. DEPRECATED Identical to getbalances().mine.untrusted_pending

func (*BitcoindClient) GetWalletInfo

func (bc *BitcoindClient) GetWalletInfo(ctx context.Context) (result GetWalletInfoResp, err error)

GetWalletInfo RPC method. Returns an object containing various wallet state info.

func (*BitcoindClient) GetZmqNotifications

func (bc *BitcoindClient) GetZmqNotifications(ctx context.Context) (result GetZmqNotificationsResp, err error)

GetZmqNotifications RPC method. Returns information about the active ZeroMQ notifications.

func (*BitcoindClient) Help

func (bc *BitcoindClient) Help(ctx context.Context, args HelpReq) (result HelpResp, err error)

Help RPC method. List all commands, or get help for a specified command.

func (*BitcoindClient) ImportAddress

func (bc *BitcoindClient) ImportAddress(ctx context.Context, args ImportAddressReq) (err error)

ImportAddress RPC method. Adds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup. Note: This call can take over an hour to complete if rescan is true, during that time, other rpc calls may report that the imported address exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes. If you have the full public key, you should call importpubkey instead of this. Hint: use importmulti to import more than one address. Note: If you import a non-standard raw script in hex form, outputs sending to it will be treated as change, and not show up in many RPCs. Note: Use "getwalletinfo" to query the scanning progress.

func (*BitcoindClient) ImportDescriptors

func (bc *BitcoindClient) ImportDescriptors(ctx context.Context, args ImportDescriptorsReq) (result ImportDescriptorsResp, err error)

ImportDescriptors RPC method. Import descriptors. This will trigger a rescan of the blockchain based on the earliest timestamp of all descriptors being imported. Requires a new wallet backup. Note: This call can take over an hour to complete if using an early timestamp; during that time, other rpc calls may report that the imported keys, addresses or scripts exist but related transactions are still missing.

func (*BitcoindClient) ImportMulti

func (bc *BitcoindClient) ImportMulti(ctx context.Context, args ImportMultiReq) (result ImportMultiResp, err error)

ImportMulti RPC method. Import addresses/scripts (with private or public keys, redeem script (P2SH)), optionally rescanning the blockchain from the earliest creation time of the imported scripts. Requires a new wallet backup. If an address/script is imported without all of the private keys required to spend from that address, it will be watchonly. The 'watchonly' option must be set to true in this case or a warning will be returned. Conversely, if all the private keys are provided and the address/script is spendable, the watchonly option must be set to false, or a warning will be returned. Note: This call can take over an hour to complete if rescan is true, during that time, other rpc calls may report that the imported keys, addresses or scripts exist but related transactions are still missing. Note: Use "getwalletinfo" to query the scanning progress.

func (*BitcoindClient) ImportPrivkey

func (bc *BitcoindClient) ImportPrivkey(ctx context.Context, args ImportPrivkeyReq) (err error)

ImportPrivkey RPC method. Adds a private key (as returned by dumpprivkey) to your wallet. Requires a new wallet backup. Hint: use importmulti to import more than one private key. Note: This call can take over an hour to complete if rescan is true, during that time, other rpc calls may report that the imported key exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes. Note: Use "getwalletinfo" to query the scanning progress.

func (*BitcoindClient) ImportPrunedFunds

func (bc *BitcoindClient) ImportPrunedFunds(ctx context.Context, args ImportPrunedFundsReq) (err error)

ImportPrunedFunds RPC method. Imports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.

func (*BitcoindClient) ImportPubkey

func (bc *BitcoindClient) ImportPubkey(ctx context.Context, args ImportPubkeyReq) (err error)

ImportPubkey RPC method. Adds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup. Hint: use importmulti to import more than one public key. Note: This call can take over an hour to complete if rescan is true, during that time, other rpc calls may report that the imported pubkey exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes. Note: Use "getwalletinfo" to query the scanning progress.

func (*BitcoindClient) ImportWallet

func (bc *BitcoindClient) ImportWallet(ctx context.Context, args ImportWalletReq) (err error)

ImportWallet RPC method. Imports keys from a wallet dump file (see dumpwallet). Requires a new wallet backup to include imported keys. Note: Use "getwalletinfo" to query the scanning progress.

func (*BitcoindClient) JoinPsbts

func (bc *BitcoindClient) JoinPsbts(ctx context.Context, args JoinPsbtsReq) (result JoinPsbtsResp, err error)

JoinPsbts RPC method. Joins multiple distinct PSBTs with different inputs and outputs into one PSBT with inputs and outputs from all of the PSBTs No input in any of the PSBTs can be in more than one of the PSBTs.

func (*BitcoindClient) KeypoolRefill

func (bc *BitcoindClient) KeypoolRefill(ctx context.Context, args KeypoolRefillReq) (err error)

KeypoolRefill RPC method. Fills the keypool. Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.

func (*BitcoindClient) ListAddressGroupings

func (bc *BitcoindClient) ListAddressGroupings(ctx context.Context) (result ListAddressGroupingsResp, err error)

ListAddressGroupings RPC method. Lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions

func (*BitcoindClient) ListBanned

func (bc *BitcoindClient) ListBanned(ctx context.Context) (result ListBannedResp, err error)

ListBanned RPC method. List all manually banned IPs/Subnets.

func (*BitcoindClient) ListDescriptors

func (bc *BitcoindClient) ListDescriptors(ctx context.Context) (result ListDescriptorsResp, err error)

ListDescriptors RPC method. List descriptors imported into a descriptor-enabled wallet.

func (*BitcoindClient) ListLabels

func (bc *BitcoindClient) ListLabels(ctx context.Context, args ListLabelsReq) (result ListLabelsResp, err error)

ListLabels RPC method. Returns the list of all labels, or labels that are assigned to addresses with a specific purpose.

func (*BitcoindClient) ListLockUnspent

func (bc *BitcoindClient) ListLockUnspent(ctx context.Context) (result ListLockUnspentResp, err error)

ListLockUnspent RPC method. Returns list of temporarily unspendable outputs. See the lockunspent call to lock and unlock transactions for spending.

func (*BitcoindClient) ListReceivedByAddress

func (bc *BitcoindClient) ListReceivedByAddress(ctx context.Context, args ListReceivedByAddressReq) (result ListReceivedByAddressResp, err error)

ListReceivedByAddress RPC method. List balances by receiving address.

func (*BitcoindClient) ListReceivedByLabel

func (bc *BitcoindClient) ListReceivedByLabel(ctx context.Context, args ListReceivedByLabelReq) (result ListReceivedByLabelResp, err error)

ListReceivedByLabel RPC method. List received transactions by label.

func (*BitcoindClient) ListSinceBlock

func (bc *BitcoindClient) ListSinceBlock(ctx context.Context, args ListSinceBlockReq) (result ListSinceBlockResp, err error)

ListSinceBlock RPC method. Get all transactions in blocks since block [blockhash], or all transactions if omitted. If "blockhash" is no longer a part of the main chain, transactions from the fork point onward are included. Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the "removed" array.

func (*BitcoindClient) ListTransactions

func (bc *BitcoindClient) ListTransactions(ctx context.Context, args ListTransactionsReq) (result ListTransactionsResp, err error)

ListTransactions RPC method. If a label name is provided, this will return only incoming transactions paying to addresses with the specified label. Returns up to 'count' most recent transactions skipping the first 'from' transactions.

func (*BitcoindClient) ListUnspent

func (bc *BitcoindClient) ListUnspent(ctx context.Context, args ListUnspentReq) (result ListUnspentResp, err error)

ListUnspent RPC method. Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations. Optionally filter to only include txouts paid to specified addresses.

func (*BitcoindClient) ListWalletDir

func (bc *BitcoindClient) ListWalletDir(ctx context.Context) (result ListWalletDirResp, err error)

ListWalletDir RPC method. Returns a list of wallets in the wallet directory.

func (*BitcoindClient) ListWallets

func (bc *BitcoindClient) ListWallets(ctx context.Context) (result ListWalletsResp, err error)

ListWallets RPC method. Returns a list of currently loaded wallets. For full information on the wallet, use "getwalletinfo"

func (*BitcoindClient) LoadWallet

func (bc *BitcoindClient) LoadWallet(ctx context.Context, args LoadWalletReq) (result LoadWalletResp, err error)

LoadWallet RPC method. Loads a wallet from a wallet file or directory. Note that all wallet command-line options used when starting bitcoind will be applied to the new wallet (eg -rescan, etc).

func (*BitcoindClient) LockUnspent

func (bc *BitcoindClient) LockUnspent(ctx context.Context, args LockUnspentReq) (result LockUnspentResp, err error)

LockUnspent RPC method. Updates list of temporarily unspendable outputs. Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs. If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked. A locked transaction output will not be chosen by automatic coin selection, when spending bitcoins. Manually selected coins are automatically unlocked. Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list is always cleared (by virtue of process exit) when a node stops or fails. Also see the listunspent call

func (*BitcoindClient) Logging

func (bc *BitcoindClient) Logging(ctx context.Context, args LoggingReq) (err error)

Logging RPC method. Gets and sets the logging configuration. When called without an argument, returns the list of categories with status that are currently being debug logged or not. When called with arguments, adds or removes categories from debug logging and return the lists above. The arguments are evaluated in order "include", "exclude". If an item is both included and excluded, it will thus end up being excluded. The valid logging categories are: net, tor, mempool, http, bench, zmq, walletdb, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, libevent, coindb, qt, leveldb, validation, i2p, ipc In addition, the following are available as category names with special meanings:

  • "all", "1" : represent all logging categories.
  • "none", "0" : even if other logging categories are specified, ignore all of them.

func (*BitcoindClient) Ping

func (bc *BitcoindClient) Ping(ctx context.Context) (err error)

Ping RPC method. Requests that a ping be sent to all other nodes, to measure ping time. Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds. Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.

func (*BitcoindClient) PreciousBlock

func (bc *BitcoindClient) PreciousBlock(ctx context.Context, args PreciousBlockReq) (err error)

PreciousBlock RPC method. Treats a block as if it were received before others with the same work. A later preciousblock call can override the effect of an earlier one. The effects of preciousblock are not retained across restarts.

func (*BitcoindClient) PrioritiseTransaction

func (bc *BitcoindClient) PrioritiseTransaction(ctx context.Context, args PrioritiseTransactionReq) (result PrioritiseTransactionResp, err error)

PrioritiseTransaction RPC method. Accepts the transaction into mined blocks at a higher (or lower) priority

func (*BitcoindClient) PruneBlockchain

func (bc *BitcoindClient) PruneBlockchain(ctx context.Context, args PruneBlockchainReq) (result PruneBlockchainResp, err error)

PruneBlockchain RPC method.

func (*BitcoindClient) PsbtBumpFee

func (bc *BitcoindClient) PsbtBumpFee(ctx context.Context, args PsbtBumpFeeReq) (result PsbtBumpFeeResp, err error)

PsbtBumpFee RPC method. Bumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B. Returns a PSBT instead of creating and signing a new transaction. An opt-in RBF transaction with the given txid must be in the wallet. The command will pay the additional fee by reducing change outputs or adding inputs when necessary. It may add a new change output if one does not already exist. All inputs in the original transaction will be included in the replacement transaction. The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs. By default, the new fee will be calculated automatically using the estimatesmartfee RPC. The user can specify a confirmation target for estimatesmartfee. Alternatively, the user can specify a fee rate in sat/vB for the new transaction. At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee returned by getnetworkinfo) to enter the node's mempool. * WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. *

func (*BitcoindClient) Ready

func (bc *BitcoindClient) Ready(opts ...ReadyOption) (err error)

Ready checks the connection health. By default it does a RPC call ("getnetworkinfo") and returns a nil error if there was a sane response.

Does not retry on connection failure, in contrast to the RPC methods that retry until their context is cancelled.

What is checked on can be changed by giving ReadyOption(s) as parameters.

func (*BitcoindClient) RemovePrunedFunds

func (bc *BitcoindClient) RemovePrunedFunds(ctx context.Context, args RemovePrunedFundsReq) (err error)

RemovePrunedFunds RPC method. Deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances.

func (*BitcoindClient) RescanBlockchain

func (bc *BitcoindClient) RescanBlockchain(ctx context.Context, args RescanBlockchainReq) (result RescanBlockchainResp, err error)

RescanBlockchain RPC method. Rescan the local blockchain for wallet related transactions. Note: Use "getwalletinfo" to query the scanning progress.

func (*BitcoindClient) SaveMempool

func (bc *BitcoindClient) SaveMempool(ctx context.Context) (err error)

SaveMempool RPC method. Dumps the mempool to disk. It will fail until the previous dump is fully loaded.

func (*BitcoindClient) ScanTxOutSet

func (bc *BitcoindClient) ScanTxOutSet(ctx context.Context, args ScanTxOutSetReq) (result ScanTxOutSetResp, err error)

ScanTxOutSet RPC method. Scans the unspent transaction output set for entries that match certain output descriptors. Examples of output descriptors are:

addr(<address>)                      Outputs whose scriptPubKey corresponds to the specified address (does not include P2PK)
raw(<hex script>)                    Outputs whose scriptPubKey equals the specified hex scripts
combo(<pubkey>)                      P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey
pkh(<pubkey>)                        P2PKH outputs for the given pubkey
sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys

In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one or more path elements separated by "/", and optionally ending in "/*" (unhardened), or "/*'" or "/*h" (hardened) to specify all unhardened or hardened child keys. In the latter case, a range needs to be specified by below if different from 1000. For more information on output descriptors, see the documentation in the doc/descriptors.md file.

func (*BitcoindClient) Send

func (bc *BitcoindClient) Send(ctx context.Context, args SendReq) (result SendResp, err error)

Send RPC method. EXPERIMENTAL warning: this call may be changed in future releases. Send a transaction.

func (*BitcoindClient) SendMany

func (bc *BitcoindClient) SendMany(ctx context.Context, args SendManyReq) (result SendManyResp, err error)

SendMany RPC method. Send multiple times. Amounts are double-precision floating point numbers. Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.

func (*BitcoindClient) SendRawTransaction

func (bc *BitcoindClient) SendRawTransaction(ctx context.Context, args SendRawTransactionReq) (result SendRawTransactionResp, err error)

SendRawTransaction RPC method. Submit a raw transaction (serialized, hex-encoded) to local node and network. The transaction will be sent unconditionally to all peers, so using sendrawtransaction for manual rebroadcast may degrade privacy by leaking the transaction's origin, as nodes will normally not rebroadcast non-wallet transactions already in their mempool. A specific exception, RPC_TRANSACTION_ALREADY_IN_CHAIN, may throw if the transaction cannot be added to the mempool. Related RPCs: createrawtransaction, signrawtransactionwithkey

func (*BitcoindClient) SendToAddress

func (bc *BitcoindClient) SendToAddress(ctx context.Context, args SendToAddressReq) (result SendToAddressResp, err error)

SendToAddress RPC method. Send an amount to a given address. Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.

func (*BitcoindClient) SetBan

func (bc *BitcoindClient) SetBan(ctx context.Context, args SetBanReq) (err error)

SetBan RPC method. Attempts to add or remove an IP/Subnet from the banned list.

func (*BitcoindClient) SetHDSeed

func (bc *BitcoindClient) SetHDSeed(ctx context.Context, args SetHDSeedReq) (err error)

SetHDSeed RPC method. Set or generate a new HD wallet seed. Non-HD wallets will not be upgraded to being a HD wallet. Wallets that are already HD will have a new HD seed set so that new keys added to the keypool will be derived from this new seed. Note that you will need to MAKE A NEW BACKUP of your wallet after setting the HD wallet seed. Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.

func (*BitcoindClient) SetLabel

func (bc *BitcoindClient) SetLabel(ctx context.Context, args SetLabelReq) (err error)

SetLabel RPC method. Sets the label associated with the given address.

func (*BitcoindClient) SetNetworkActive

func (bc *BitcoindClient) SetNetworkActive(ctx context.Context, args SetNetworkActiveReq) (result SetNetworkActiveResp, err error)

SetNetworkActive RPC method. Disable/enable all p2p network activity.

func (*BitcoindClient) SetTxFee

func (bc *BitcoindClient) SetTxFee(ctx context.Context, args SetTxFeeReq) (result SetTxFeeResp, err error)

SetTxFee RPC method. Set the transaction fee rate in BTC/kvB for this wallet. Overrides the global -paytxfee command line parameter. Can be deactivated by passing 0 as the fee. In that case automatic fee selection will be used by default.

func (*BitcoindClient) SetWalletFlag

func (bc *BitcoindClient) SetWalletFlag(ctx context.Context, args SetWalletFlagReq) (result SetWalletFlagResp, err error)

SetWalletFlag RPC method. Change the state of the given wallet flag for a wallet.

func (*BitcoindClient) SignMessage

func (bc *BitcoindClient) SignMessage(ctx context.Context, args SignMessageReq) (result SignMessageResp, err error)

SignMessage RPC method. Sign a message with the private key of an address Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.

func (*BitcoindClient) SignMessageWithPrivkey

func (bc *BitcoindClient) SignMessageWithPrivkey(ctx context.Context, args SignMessageWithPrivkeyReq) (result SignMessageWithPrivkeyResp, err error)

SignMessageWithPrivkey RPC method. Sign a message with the private key of an address

func (*BitcoindClient) SignRawTransactionWithKey

func (bc *BitcoindClient) SignRawTransactionWithKey(ctx context.Context, args SignRawTransactionWithKeyReq) (result SignRawTransactionWithKeyResp, err error)

SignRawTransactionWithKey RPC method. Sign inputs for raw transaction (serialized, hex-encoded). The second argument is an array of base58-encoded private keys that will be the only keys used to sign the transaction. The third optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain.

func (*BitcoindClient) SignRawTransactionWithWallet

func (bc *BitcoindClient) SignRawTransactionWithWallet(ctx context.Context, args SignRawTransactionWithWalletReq) (result SignRawTransactionWithWalletResp, err error)

SignRawTransactionWithWallet RPC method. Sign inputs for raw transaction (serialized, hex-encoded). The second optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain. Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.

func (*BitcoindClient) Stop

func (bc *BitcoindClient) Stop(ctx context.Context) (result StopResp, err error)

Stop RPC method. Request a graceful shutdown of Bitcoin Core.

func (*BitcoindClient) SubmitBlock

func (bc *BitcoindClient) SubmitBlock(ctx context.Context, args SubmitBlockReq) (result SubmitBlockResp, err error)

SubmitBlock RPC method. Attempts to submit new block to network. See https://en.bitcoin.it/wiki/BIP_0022 for full specification.

func (*BitcoindClient) SubmitHeader

func (bc *BitcoindClient) SubmitHeader(ctx context.Context, args SubmitHeaderReq) (err error)

SubmitHeader RPC method. Decode the given hexdata as a header and submit it as a candidate chain tip if valid. Throws when the header is invalid.

func (*BitcoindClient) SubscribeHashBlock

func (bc *BitcoindClient) SubscribeHashBlock() (subCh chan HashMsg, cancel func(), err error)

SubscribeHashBlock subscribes to the ZMQ "hashblock" messages as HashMsg items pushed onto the channel.

Call cancel to cancel the subscription and let the client release the resources. The channel is closed when the subscription is canceled or when the client is closed.

func (*BitcoindClient) SubscribeHashTx

func (bc *BitcoindClient) SubscribeHashTx() (subCh chan HashMsg, cancel func(), err error)

SubscribeHashTx subscribes to the ZMQ "hashtx" messages as HashMsg items pushed onto the channel.

Call cancel to cancel the subscription and let the client release the resources. The channel is closed when the subscription is canceled or when the client is closed.

func (*BitcoindClient) SubscribeRawBlock

func (bc *BitcoindClient) SubscribeRawBlock() (subCh chan RawMsg, cancel func(), err error)

SubscribeRawBlock subscribes to the ZMQ "rawblock" messages as RawMsg items pushed onto the channel.

Call cancel to cancel the subscription and let the client release the resources. The channel is closed when the subscription is canceled or when the client is closed.

func (*BitcoindClient) SubscribeRawTx

func (bc *BitcoindClient) SubscribeRawTx() (subCh chan RawMsg, cancel func(), err error)

SubscribeRawTx subscribes to the ZMQ "rawtx" messages as RawMsg items pushed onto the channel.

Call cancel to cancel the subscription and let the client release the resources. The channel is closed when the subscription is canceled or when the client is closed.

func (*BitcoindClient) SubscribeSequence

func (bc *BitcoindClient) SubscribeSequence() (subCh chan SequenceMsg, cancel func(), err error)

SubscribeSequence subscribes to the ZMQ "sequence" messages as SequenceMsg items pushed onto the channel.

Call cancel to cancel the subscription and let the client release the resources. The channel is closed when the subscription is canceled or when the client is closed.

func (*BitcoindClient) TestMempoolAccept

func (bc *BitcoindClient) TestMempoolAccept(ctx context.Context, args TestMempoolAcceptReq) (result TestMempoolAcceptResp, err error)

TestMempoolAccept RPC method. Returns result of mempool acceptance tests indicating if raw transaction(s) (serialized, hex-encoded) would be accepted by mempool. If multiple transactions are passed in, parents must come before children and package policies apply: the transactions cannot conflict with any mempool transactions or each other. If one transaction fails, other transactions may not be fully validated (the 'allowed' key will be blank). The maximum number of transactions allowed is 25. This checks if transactions violate the consensus or policy rules. See sendrawtransaction call.

func (*BitcoindClient) UnloadWallet

func (bc *BitcoindClient) UnloadWallet(ctx context.Context, args UnloadWalletReq) (result UnloadWalletResp, err error)

UnloadWallet RPC method. Unloads the wallet referenced by the request endpoint otherwise unloads the wallet specified in the argument. Specifying the wallet name on a wallet endpoint is invalid.

func (*BitcoindClient) UpgradeWallet

func (bc *BitcoindClient) UpgradeWallet(ctx context.Context, args UpgradeWalletReq) (result UpgradeWalletResp, err error)

UpgradeWallet RPC method. Upgrade the wallet. Upgrades to the latest version if no version number is specified. New keys may be generated and a new wallet backup will need to be made.

func (*BitcoindClient) Uptime

func (bc *BitcoindClient) Uptime(ctx context.Context) (result UptimeResp, err error)

Uptime RPC method. Returns the total uptime of the server.

func (*BitcoindClient) UtxoUpdatePsbt

func (bc *BitcoindClient) UtxoUpdatePsbt(ctx context.Context, args UtxoUpdatePsbtReq) (result UtxoUpdatePsbtResp, err error)

UtxoUpdatePsbt RPC method. Updates all segwit inputs and outputs in a PSBT with data from output descriptors, the UTXO set or the mempool.

func (*BitcoindClient) ValidateAddress

func (bc *BitcoindClient) ValidateAddress(ctx context.Context, args ValidateAddressReq) (result ValidateAddressResp, err error)

ValidateAddress RPC method. Return information about the given bitcoin address.

func (*BitcoindClient) VerifyChain

func (bc *BitcoindClient) VerifyChain(ctx context.Context, args VerifyChainReq) (result VerifyChainResp, err error)

VerifyChain RPC method. Verifies blockchain database.

func (*BitcoindClient) VerifyMessage

func (bc *BitcoindClient) VerifyMessage(ctx context.Context, args VerifyMessageReq) (result VerifyMessageResp, err error)

VerifyMessage RPC method. Verify a signed message

func (*BitcoindClient) VerifyTxOutProof

func (bc *BitcoindClient) VerifyTxOutProof(ctx context.Context, args VerifyTxOutProofReq) (result VerifyTxOutProofResp, err error)

VerifyTxOutProof RPC method. Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain

func (*BitcoindClient) WalletCreateFundedPsbt

func (bc *BitcoindClient) WalletCreateFundedPsbt(ctx context.Context, args WalletCreateFundedPsbtReq) (result WalletCreateFundedPsbtResp, err error)

WalletCreateFundedPsbt RPC method. Creates and funds a transaction in the Partially Signed Transaction format. Implements the Creator and Updater roles.

func (*BitcoindClient) WalletDisplayAddress

func (bc *BitcoindClient) WalletDisplayAddress(ctx context.Context, args WalletDisplayAddressReq) (result WalletDisplayAddressResp, err error)

WalletDisplayAddress RPC method. Display address on an external signer for verification.

func (*BitcoindClient) WalletLock

func (bc *BitcoindClient) WalletLock(ctx context.Context) (err error)

WalletLock RPC method. Removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call walletpassphrase again before being able to call any methods which require the wallet to be unlocked.

func (*BitcoindClient) WalletPassphrase

func (bc *BitcoindClient) WalletPassphrase(ctx context.Context, args WalletPassphraseReq) (err error)

WalletPassphrase RPC method. Stores the wallet decryption key in memory for 'timeout' seconds. This is needed prior to performing transactions related to private keys such as sending bitcoins Note: Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock time that overrides the old one.

func (*BitcoindClient) WalletPassphraseChange

func (bc *BitcoindClient) WalletPassphraseChange(ctx context.Context, args WalletPassphraseChangeReq) (err error)

WalletPassphraseChange RPC method. Changes the wallet passphrase from 'oldpassphrase' to 'newpassphrase'.

func (*BitcoindClient) WalletProcessPsbt

func (bc *BitcoindClient) WalletProcessPsbt(ctx context.Context, args WalletProcessPsbtReq) (result WalletProcessPsbtResp, err error)

WalletProcessPsbt RPC method. Update a PSBT with input information from our wallet and then sign inputs that we can sign for. Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.

type BitcoindError

type BitcoindError struct {
	JsonRPCError
}

BitcoindError represents an error that originates from bitcoind.

type BumpFeeReq

type BumpFeeReq struct {
	// The txid to be bumped
	TxID string `json:"txid"`

	Options *BumpFeeReqOptions `json:"options,omitempty"`
}

BumpFeeReq holds the arguments for the BumpFee call.

  1. txid (string, required) The txid to be bumped
  2. options (json object, optional) { "conf_target": n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks

type BumpFeeReqOptions

type BumpFeeReqOptions struct {
	// Confirmation target in blocks
	// Default: wallet -txconfirmtarget
	ConfTarget *float64 `json:"conf_target,omitempty"`
}

type BumpFeeResp

type BumpFeeResp struct {
	// The id of the new transaction.
	TxID string `json:"txid"`

	// The fee of the replaced transaction.
	OrigFee float64 `json:"origfee"`

	// The fee of the new transaction.
	Fee float64 `json:"fee"`

	// Errors encountered during processing (may be empty).
	// Element: Str
	Errors []string `json:"errors"`
}

BumpFeeResp holds the response to the BumpFee call.

{                    (json object)
  "txid" : "hex",    (string) The id of the new transaction.
  "origfee" : n,     (numeric) The fee of the replaced transaction.
  "fee" : n,         (numeric) The fee of the new transaction.
  "errors" : [       (json array) Errors encountered during processing (may be empty).
    "str",           (string)
    ...
  ]
}

type CombinePsbtReq

type CombinePsbtReq struct {
	// The base64 strings of partially signed transactions
	// Element: Psbt    A base64 string of a PSBT
	Txs []string `json:"txs"`
}

CombinePsbtReq holds the arguments for the CombinePsbt call.

  1. txs (json array, required) The base64 strings of partially signed transactions [ "psbt", (string) A base64 string of a PSBT ... ]

type CombinePsbtResp

type CombinePsbtResp struct {
	// The base64-encoded partially signed transaction
	Str string
}

CombinePsbtResp holds the response to the CombinePsbt call.

"str"    (string) The base64-encoded partially signed transaction

func (CombinePsbtResp) MarshalJSON

func (alts CombinePsbtResp) MarshalJSON() ([]byte, error)

func (*CombinePsbtResp) UnmarshalJSON

func (alts *CombinePsbtResp) UnmarshalJSON(b []byte) error

type CombineRawTransactionReq

type CombineRawTransactionReq struct {
	// The hex strings of partially signed transactions
	// Element: HexString    A hex-encoded raw transaction
	Txs []string `json:"txs"`
}

CombineRawTransactionReq holds the arguments for the CombineRawTransaction call.

  1. txs (json array, required) The hex strings of partially signed transactions [ "hexstring", (string) A hex-encoded raw transaction ... ]

type CombineRawTransactionResp

type CombineRawTransactionResp struct {
	// The hex-encoded raw transaction with signature(s)
	Str string
}

CombineRawTransactionResp holds the response to the CombineRawTransaction call.

"str"    (string) The hex-encoded raw transaction with signature(s)

func (CombineRawTransactionResp) MarshalJSON

func (alts CombineRawTransactionResp) MarshalJSON() ([]byte, error)

func (*CombineRawTransactionResp) UnmarshalJSON

func (alts *CombineRawTransactionResp) UnmarshalJSON(b []byte) error

type Config

type Config struct {
	// RpcAddress is the address, formatted as "host:port", of the JSON-RPC interface of bitcoind.
	//
	// Example: ":8332" (localhost, mainnet)
	//          ":18332" (localhost, testnet/regtest)
	//          "2.2.2.2:8332" (remote, mainnet)
	RpcAddress string

	// RpcUser is the 'rpcuser' option that bitcoind was configured with, or the equivalent in 'rpcauth'.
	RpcUser string

	// RpcUser is the 'rpcpassword' option that bitcoind was configured with, or the equivalent in 'rpcauth'.
	RpcPassword string

	// RpcUriPath is the URI path of requests. Can be modified on a per request basis by using ctx = UseUriPath(ctx, newPath).
	// Default "/".
	//
	// Example: "/wallet/<WalletName>" (specify which wallet to use for a wallet command)
	RpcUriPath string

	// ZmqPubAddress is the public address that the bitcoind instance uses for zmqpub,
	// corresponding to what is set when starting bitcoind through one or multiple of:
	// {-zmqpubhashtx=address -zmqpubhashblock=address -zmqpubrawblock=address -zmqpubrawtx=address -zmqpubsequence=address}.
	// Only a single address is supported in this client. Either use the same address for
	// all desired topics when starting bitcoind, or create a seperate client for each address.
	//
	// Example: "tcp://8.8.8.8:1234"
	// More examples at: https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md (the host part in those examples
	// are local IPs and should be replaced with public IPs here on the client side)
	//
	// If ZmqPubAddress is not set then the Subscribe functions will return ErrSubscribeDisabled when called.
	ZmqPubAddress string

	// SubChannelBufferSize sets the number of entries that a subscription channel can hold
	// before dropping entries, if it is not drained fast enough.
	// If not set (or set to zero) then defaults to DefaultSubChannelBufferSize.
	SubChannelBufferSize int
}

type ConvertToPsbtReq

type ConvertToPsbtReq struct {
	// The hex string of a raw transaction
	HexString string `json:"hexstring"`

	// If true, any signatures in the input will be discarded and conversion
	// will continue. If false, RPC will fail if any signatures are present.
	// Default: false
	PermitSigData bool `json:"permitsigdata,omitempty"`

	// Whether the transaction hex is a serialized witness transaction.
	// If iswitness is not present, heuristic tests will be used in decoding.
	// If true, only witness deserialization will be tried.
	// If false, only non-witness deserialization will be tried.
	// This boolean should reflect whether the transaction has inputs
	// (e.g. fully valid, or on-chain transactions), if known by the caller.
	// Default: depends on heuristic tests
	IsWitness *bool `json:"iswitness,omitempty"`
}

ConvertToPsbtReq holds the arguments for the ConvertToPsbt call.

  1. hexstring (string, required) The hex string of a raw transaction
  2. permitsigdata (boolean, optional, default=false) If true, any signatures in the input will be discarded and conversion will continue. If false, RPC will fail if any signatures are present.
  3. iswitness (boolean, optional, default=depends on heuristic tests) Whether the transaction hex is a serialized witness transaction. If iswitness is not present, heuristic tests will be used in decoding. If true, only witness deserialization will be tried. If false, only non-witness deserialization will be tried. This boolean should reflect whether the transaction has inputs (e.g. fully valid, or on-chain transactions), if known by the caller.

type ConvertToPsbtResp

type ConvertToPsbtResp struct {
	// The resulting raw transaction (base64-encoded string)
	Str string
}

ConvertToPsbtResp holds the response to the ConvertToPsbt call.

"str"    (string) The resulting raw transaction (base64-encoded string)

func (ConvertToPsbtResp) MarshalJSON

func (alts ConvertToPsbtResp) MarshalJSON() ([]byte, error)

func (*ConvertToPsbtResp) UnmarshalJSON

func (alts *ConvertToPsbtResp) UnmarshalJSON(b []byte) error

type CreateMultisigReq

type CreateMultisigReq struct {
	// The number of required signatures out of the n keys.
	NRequired float64 `json:"nrequired"`

	// The hex-encoded public keys.
	// Element: Key    The hex-encoded public key
	Keys []string `json:"keys"`

	// The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".
	// Default: "legacy"
	AddressType string `json:"address_type,omitempty"`
}

CreateMultisigReq holds the arguments for the CreateMultisig call.

  1. nrequired (numeric, required) The number of required signatures out of the n keys.
  2. keys (json array, required) The hex-encoded public keys. [ "key", (string) The hex-encoded public key ... ]
  3. address_type (string, optional, default="legacy") The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".

type CreateMultisigResp

type CreateMultisigResp struct {
	// The value of the new multisig address.
	Address string `json:"address"`

	// The string value of the hex-encoded redemption script.
	RedeemScript string `json:"redeemScript"`

	// The descriptor for this multisig
	Descriptor string `json:"descriptor"`
}

CreateMultisigResp holds the response to the CreateMultisig call.

{                            (json object)
  "address" : "str",         (string) The value of the new multisig address.
  "redeemScript" : "hex",    (string) The string value of the hex-encoded redemption script.
  "descriptor" : "str"       (string) The descriptor for this multisig
}

type CreatePsbtReq

type CreatePsbtReq struct {
	// The json objects
	Inputs []CreatePsbtReqInputs `json:"inputs"`

	// The outputs (key-value pairs), where none of the keys are duplicated.
	// That is, each address can only appear once and there can only be one 'data' object.
	// For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also
	// accepted as second parameter.
	Outputs []CreatePsbtReqOutputs `json:"outputs"`

	// Raw locktime. Non-0 value also locktime-activates inputs
	// Default: 0
	LockTime float64 `json:"locktime,omitempty"`

	// Marks this transaction as BIP125 replaceable.
	// Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.
	// Default: false
	Replaceable bool `json:"replaceable,omitempty"`
}

CreatePsbtReq holds the arguments for the CreatePsbt call.

  1. inputs (json array, required) The json objects [ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "sequence": n, (numeric, optional, default=depends on the value of the 'replaceable' and 'locktime' arguments) The sequence number }, ... ]
  2. outputs (json array, required) The outputs (key-value pairs), where none of the keys are duplicated. That is, each address can only appear once and there can only be one 'data' object. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also accepted as second parameter. [ { (json object) "address": amount, (numeric or string, required) A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in BTC ... }, { (json object) "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data }, ... ]
  3. locktime (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs
  4. replaceable (boolean, optional, default=false) Marks this transaction as BIP125 replaceable. Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.

type CreatePsbtReqInputs

type CreatePsbtReqInputs struct {
	// The transaction id
	TxID string `json:"txid"`

	// The output number
	Vout float64 `json:"vout"`

	// The sequence number
	// Default: depends on the value of the 'replaceable' and 'locktime' arguments
	Sequence *float64 `json:"sequence,omitempty"`
}

type CreatePsbtReqOutputs

type CreatePsbtReqOutputs struct {
	// A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in BTC
	A map[string]float64

	B struct {
		// A key-value pair. The key must be "data", the value is hex-encoded data
		Data string `json:"data"`
	}
}

Holder of alternative parameter formats, only one will be used, the first that is non-zero.

func (CreatePsbtReqOutputs) MarshalJSON

func (alts CreatePsbtReqOutputs) MarshalJSON() ([]byte, error)

func (*CreatePsbtReqOutputs) UnmarshalJSON

func (alts *CreatePsbtReqOutputs) UnmarshalJSON(b []byte) error

type CreatePsbtResp

type CreatePsbtResp struct {
	// The resulting raw transaction (base64-encoded string)
	Str string
}

CreatePsbtResp holds the response to the CreatePsbt call.

"str"    (string) The resulting raw transaction (base64-encoded string)

func (CreatePsbtResp) MarshalJSON

func (alts CreatePsbtResp) MarshalJSON() ([]byte, error)

func (*CreatePsbtResp) UnmarshalJSON

func (alts *CreatePsbtResp) UnmarshalJSON(b []byte) error

type CreateRawTransactionReq

type CreateRawTransactionReq struct {
	// The inputs
	Inputs []CreateRawTransactionReqInputs `json:"inputs"`

	// The outputs (key-value pairs), where none of the keys are duplicated.
	// That is, each address can only appear once and there can only be one 'data' object.
	// For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also
	// accepted as second parameter.
	Outputs []CreateRawTransactionReqOutputs `json:"outputs"`

	// Raw locktime. Non-0 value also locktime-activates inputs
	// Default: 0
	LockTime float64 `json:"locktime,omitempty"`

	// Marks this transaction as BIP125-replaceable.
	// Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.
	// Default: false
	Replaceable bool `json:"replaceable,omitempty"`
}

CreateRawTransactionReq holds the arguments for the CreateRawTransaction call.

  1. inputs (json array, required) The inputs [ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "sequence": n, (numeric, optional, default=depends on the value of the 'replaceable' and 'locktime' arguments) The sequence number }, ... ]
  2. outputs (json array, required) The outputs (key-value pairs), where none of the keys are duplicated. That is, each address can only appear once and there can only be one 'data' object. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also accepted as second parameter. [ { (json object) "address": amount, (numeric or string, required) A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in BTC ... }, { (json object) "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data }, ... ]
  3. locktime (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs
  4. replaceable (boolean, optional, default=false) Marks this transaction as BIP125-replaceable. Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.

type CreateRawTransactionReqInputs

type CreateRawTransactionReqInputs struct {
	// The transaction id
	TxID string `json:"txid"`

	// The output number
	Vout float64 `json:"vout"`

	// The sequence number
	// Default: depends on the value of the 'replaceable' and 'locktime' arguments
	Sequence *float64 `json:"sequence,omitempty"`
}

type CreateRawTransactionReqOutputs

type CreateRawTransactionReqOutputs struct {
	// A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in BTC
	A map[string]float64

	B struct {
		// A key-value pair. The key must be "data", the value is hex-encoded data
		Data string `json:"data"`
	}
}

Holder of alternative parameter formats, only one will be used, the first that is non-zero.

func (CreateRawTransactionReqOutputs) MarshalJSON

func (alts CreateRawTransactionReqOutputs) MarshalJSON() ([]byte, error)

func (*CreateRawTransactionReqOutputs) UnmarshalJSON

func (alts *CreateRawTransactionReqOutputs) UnmarshalJSON(b []byte) error

type CreateRawTransactionResp

type CreateRawTransactionResp struct {
	// hex string of the transaction
	Hex string
}

CreateRawTransactionResp holds the response to the CreateRawTransaction call.

"hex"    (string) hex string of the transaction

func (CreateRawTransactionResp) MarshalJSON

func (alts CreateRawTransactionResp) MarshalJSON() ([]byte, error)

func (*CreateRawTransactionResp) UnmarshalJSON

func (alts *CreateRawTransactionResp) UnmarshalJSON(b []byte) error

type CreateWalletReq

type CreateWalletReq struct {
	// The name for the new wallet. If this is a path, the wallet will be created at the path location.
	WalletName string `json:"wallet_name"`

	// Disable the possibility of private keys (only watchonlys are possible in this mode).
	// Default: false
	DisablePrivateKeys bool `json:"disable_private_keys,omitempty"`

	// Create a blank wallet. A blank wallet has no keys or HD seed. One can be set using sethdseed.
	// Default: false
	Blank bool `json:"blank,omitempty"`

	// Encrypt the wallet with this passphrase.
	Passphrase string `json:"passphrase,omitempty"`

	// Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind.
	// Default: false
	AvoidReuse bool `json:"avoid_reuse,omitempty"`

	// Create a native descriptor wallet. The wallet will use descriptors internally to handle address creation
	// Default: false
	Descriptors bool `json:"descriptors,omitempty"`

	// Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
	LoadOnStartup *bool `json:"load_on_startup,omitempty"`

	// Use an external signer such as a hardware wallet. Requires -signer to be configured. Wallet creation will fail if keys cannot be fetched. Requires disable_private_keys and descriptors set to true.
	// Default: false
	ExternalSigner bool `json:"external_signer,omitempty"`
}

CreateWalletReq holds the arguments for the CreateWallet call.

  1. wallet_name (string, required) The name for the new wallet. If this is a path, the wallet will be created at the path location.
  2. disable_private_keys (boolean, optional, default=false) Disable the possibility of private keys (only watchonlys are possible in this mode).
  3. blank (boolean, optional, default=false) Create a blank wallet. A blank wallet has no keys or HD seed. One can be set using sethdseed.
  4. passphrase (string, optional) Encrypt the wallet with this passphrase.
  5. avoid_reuse (boolean, optional, default=false) Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind.
  6. descriptors (boolean, optional, default=false) Create a native descriptor wallet. The wallet will use descriptors internally to handle address creation
  7. load_on_startup (boolean, optional) Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
  8. external_signer (boolean, optional, default=false) Use an external signer such as a hardware wallet. Requires -signer to be configured. Wallet creation will fail if keys cannot be fetched. Requires disable_private_keys and descriptors set to true.

type CreateWalletResp

type CreateWalletResp struct {
	// The wallet name if created successfully. If the wallet was created using a full path, the wallet_name will be the full path.
	Name string `json:"name"`

	// Warning message if wallet was not loaded cleanly.
	Warning string `json:"warning"`
}

CreateWalletResp holds the response to the CreateWallet call.

{                       (json object)
  "name" : "str",       (string) The wallet name if created successfully. If the wallet was created using a full path, the wallet_name will be the full path.
  "warning" : "str"     (string) Warning message if wallet was not loaded cleanly.
}

type DecodePsbtReq

type DecodePsbtReq struct {
	// The PSBT base64 string
	Psbt string `json:"psbt"`
}

DecodePsbtReq holds the arguments for the DecodePsbt call.

  1. psbt (string, required) The PSBT base64 string

type DecodePsbtResp

type DecodePsbtResp struct {
	// The decoded network-serialized unsigned transaction.
	// The layout is the same as the output of decoderawtransaction.
	Tx DecodeRawTransactionResp `json:"tx"`

	// The unknown global fields
	Unknown map[string]string `json:"unknown"`

	Inputs []DecodePsbtRespInputs `json:"inputs"`

	Outputs []DecodePsbtRespOutputs `json:"outputs"`

	// The transaction fee paid if all UTXOs slots in the PSBT have been filled.
	Fee *float64 `json:"fee,omitempty"`
}

DecodePsbtResp holds the response to the DecodePsbt call.

{                                          (json object)
  "tx" : {                                 (json object) The decoded network-serialized unsigned transaction.
    ...                                    The layout is the same as the output of decoderawtransaction.
  },
  "unknown" : {                            (json object) The unknown global fields
    "key" : "hex",                         (string) (key-value pair) An unknown key-value pair
    ...
  },
  "inputs" : [                             (json array)
    {                                      (json object)
      "non_witness_utxo" : {               (json object, optional) Decoded network transaction for non-witness UTXOs
        ...
      },
      "witness_utxo" : {                   (json object, optional) Transaction output for witness UTXOs
        "amount" : n,                      (numeric) The value in BTC
        "scriptPubKey" : {                 (json object)
          "asm" : "str",                   (string) The asm
          "hex" : "hex",                   (string) The hex
          "type" : "str",                  (string) The type, eg 'pubkeyhash'
          "address" : "str"                (string)  Bitcoin address if there is one
        }
      },
      "partial_signatures" : {             (json object, optional)
        "pubkey" : "str",                  (string) The public key and signature that corresponds to it.
        ...
      },
      "sighash" : "str",                   (string, optional) The sighash type to be used
      "redeem_script" : {                  (json object, optional)
        "asm" : "str",                     (string) The asm
        "hex" : "hex",                     (string) The hex
        "type" : "str"                     (string) The type, eg 'pubkeyhash'
      },
      "witness_script" : {                 (json object, optional)
        "asm" : "str",                     (string) The asm
        "hex" : "hex",                     (string) The hex
        "type" : "str"                     (string) The type, eg 'pubkeyhash'
      },
      "bip32_derivs" : [                   (json array, optional)
        {                                  (json object, optional) The public key with the derivation path as the value.
          "master_fingerprint" : "str",    (string) The fingerprint of the master key
          "path" : "str"                   (string) The path
        },
        ...
      ],
      "final_scriptsig" : {                (json object, optional)
        "asm" : "str",                     (string) The asm
        "hex" : "str"                      (string) The hex
      },
      "final_scriptwitness" : [            (json array)
        "hex",                             (string) hex-encoded witness data (if any)
        ...
      ],
      "unknown" : {                        (json object) The unknown global fields
        "key" : "hex",                     (string) (key-value pair) An unknown key-value pair
        ...
      }
    },
    ...
  ],
  "outputs" : [                            (json array)
    {                                      (json object)
      "redeem_script" : {                  (json object, optional)
        "asm" : "str",                     (string) The asm
        "hex" : "hex",                     (string) The hex
        "type" : "str"                     (string) The type, eg 'pubkeyhash'
      },
      "witness_script" : {                 (json object, optional)
        "asm" : "str",                     (string) The asm
        "hex" : "hex",                     (string) The hex
        "type" : "str"                     (string) The type, eg 'pubkeyhash'
      },
      "bip32_derivs" : [                   (json array, optional)
        {                                  (json object)
          "pubkey" : "str",                (string) The public key this path corresponds to
          "master_fingerprint" : "str",    (string) The fingerprint of the master key
          "path" : "str"                   (string) The path
        },
        ...
      ],
      "unknown" : {                        (json object) The unknown global fields
        "key" : "hex",                     (string) (key-value pair) An unknown key-value pair
        ...
      }
    },
    ...
  ],
  "fee" : n                                (numeric, optional) The transaction fee paid if all UTXOs slots in the PSBT have been filled.
}

type DecodePsbtRespInputs

type DecodePsbtRespInputs struct {
	// Decoded network transaction for non-witness UTXOs
	NonWitnessUtxo *DecodePsbtRespInputsWitnessUtxo `json:"non_witness_utxo,omitempty"`

	// Transaction output for witness UTXOs
	WitnessUtxo *DecodePsbtRespInputsWitnessUtxo `json:"witness_utxo,omitempty"`

	PartialSignatures map[string]string `json:"partial_signatures,omitempty"`

	// The sighash type to be used
	SigHash string `json:"sighash,omitempty"`

	RedeemScript *DecodePsbtRespInputsRedeemScript `json:"redeem_script,omitempty"`

	WitnessScript *DecodePsbtRespInputsWitnessScript `json:"witness_script,omitempty"`

	BIP32Derivs []DecodePsbtRespInputsBIP32Derivs `json:"bip32_derivs,omitempty"`

	FinalScriptSig *DecodePsbtRespInputsFinalScriptSig `json:"final_scriptsig,omitempty"`

	// Element: Hex    hex-encoded witness data (if any)
	FinalScriptWitness []string `json:"final_scriptwitness"`

	// The unknown global fields
	Unknown map[string]string `json:"unknown"`
}

type DecodePsbtRespInputsBIP32Derivs

type DecodePsbtRespInputsBIP32Derivs struct {
	// The fingerprint of the master key
	MasterFingerprint string `json:"master_fingerprint"`

	// The path
	Path string `json:"path"`
}

The public key with the derivation path as the value.

type DecodePsbtRespInputsFinalScriptSig

type DecodePsbtRespInputsFinalScriptSig struct {
	// The asm
	Asm string `json:"asm"`

	// The hex
	Hex string `json:"hex"`
}

type DecodePsbtRespInputsRedeemScript

type DecodePsbtRespInputsRedeemScript struct {
	// The asm
	Asm string `json:"asm"`

	// The hex
	Hex string `json:"hex"`

	// The type, eg 'pubkeyhash'
	Type string `json:"type"`
}

type DecodePsbtRespInputsWitnessScript

type DecodePsbtRespInputsWitnessScript struct {
	// The asm
	Asm string `json:"asm"`

	// The hex
	Hex string `json:"hex"`

	// The type, eg 'pubkeyhash'
	Type string `json:"type"`
}

type DecodePsbtRespInputsWitnessUtxo

type DecodePsbtRespInputsWitnessUtxo struct {
	// The value in BTC
	Amount float64 `json:"amount"`

	ScriptPubkey struct {
		// The asm
		Asm string `json:"asm"`

		// The hex
		Hex string `json:"hex"`

		// The type, eg 'pubkeyhash'
		Type string `json:"type"`

		// Bitcoin address if there is one
		Address string `json:"address"`
	} `json:"scriptPubKey"`
}

type DecodePsbtRespOutputs

type DecodePsbtRespOutputs struct {
	RedeemScript *DecodePsbtRespOutputsRedeemScript `json:"redeem_script,omitempty"`

	WitnessScript *DecodePsbtRespOutputsWitnessScript `json:"witness_script,omitempty"`

	BIP32Derivs []DecodePsbtRespOutputsBIP32Derivs `json:"bip32_derivs,omitempty"`

	// The unknown global fields
	Unknown map[string]string `json:"unknown"`
}

type DecodePsbtRespOutputsBIP32Derivs

type DecodePsbtRespOutputsBIP32Derivs struct {
	// The public key this path corresponds to
	Pubkey string `json:"pubkey"`

	// The fingerprint of the master key
	MasterFingerprint string `json:"master_fingerprint"`

	// The path
	Path string `json:"path"`
}

type DecodePsbtRespOutputsRedeemScript

type DecodePsbtRespOutputsRedeemScript struct {
	// The asm
	Asm string `json:"asm"`

	// The hex
	Hex string `json:"hex"`

	// The type, eg 'pubkeyhash'
	Type string `json:"type"`
}

type DecodePsbtRespOutputsWitnessScript

type DecodePsbtRespOutputsWitnessScript struct {
	// The asm
	Asm string `json:"asm"`

	// The hex
	Hex string `json:"hex"`

	// The type, eg 'pubkeyhash'
	Type string `json:"type"`
}

type DecodeRawTransactionReq

type DecodeRawTransactionReq struct {
	// The transaction hex string
	HexString string `json:"hexstring"`

	// Whether the transaction hex is a serialized witness transaction.
	// If iswitness is not present, heuristic tests will be used in decoding.
	// If true, only witness deserialization will be tried.
	// If false, only non-witness deserialization will be tried.
	// This boolean should reflect whether the transaction has inputs
	// (e.g. fully valid, or on-chain transactions), if known by the caller.
	// Default: depends on heuristic tests
	IsWitness *bool `json:"iswitness,omitempty"`
}

DecodeRawTransactionReq holds the arguments for the DecodeRawTransaction call.

  1. hexstring (string, required) The transaction hex string
  2. iswitness (boolean, optional, default=depends on heuristic tests) Whether the transaction hex is a serialized witness transaction. If iswitness is not present, heuristic tests will be used in decoding. If true, only witness deserialization will be tried. If false, only non-witness deserialization will be tried. This boolean should reflect whether the transaction has inputs (e.g. fully valid, or on-chain transactions), if known by the caller.

type DecodeRawTransactionResp

type DecodeRawTransactionResp struct {
	// The transaction id
	TxID string `json:"txid"`

	// The transaction hash (differs from txid for witness transactions)
	Hash string `json:"hash"`

	// The transaction size
	Size float64 `json:"size"`

	// The virtual transaction size (differs from size for witness transactions)
	VSize float64 `json:"vsize"`

	// The transaction's weight (between vsize*4 - 3 and vsize*4)
	Weight float64 `json:"weight"`

	// The version
	Version float64 `json:"version"`

	// The lock time
	LockTime float64 `json:"locktime"`

	Vin []DecodeRawTransactionRespVin `json:"vin"`

	Vout []DecodeRawTransactionRespVout `json:"vout"`
}

DecodeRawTransactionResp holds the response to the DecodeRawTransaction call.

{                             (json object)
  "txid" : "hex",             (string) The transaction id
  "hash" : "hex",             (string) The transaction hash (differs from txid for witness transactions)
  "size" : n,                 (numeric) The transaction size
  "vsize" : n,                (numeric) The virtual transaction size (differs from size for witness transactions)
  "weight" : n,               (numeric) The transaction's weight (between vsize*4 - 3 and vsize*4)
  "version" : n,              (numeric) The version
  "locktime" : xxx,           (numeric) The lock time
  "vin" : [                   (json array)
    {                         (json object)
      "txid" : "hex",         (string) The transaction id
      "vout" : n,             (numeric) The output number
      "scriptSig" : {         (json object) The script
        "asm" : "str",        (string) asm
        "hex" : "hex"         (string) hex
      },
      "txinwitness" : [       (json array)
        "hex",                (string) hex-encoded witness data (if any)
        ...
      ],
      "sequence" : n          (numeric) The script sequence number
    },
    ...
  ],
  "vout" : [                  (json array)
    {                         (json object)
      "value" : n,            (numeric) The value in BTC
      "n" : n,                (numeric) index
      "scriptPubKey" : {      (json object)
        "asm" : "str",        (string) the asm
        "hex" : "hex",        (string) the hex
        "reqSigs" : n,        (numeric, optional) (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Number of required signatures
        "type" : "str",       (string) The type, eg 'pubkeyhash'
        "address" : "str",    (string, optional) bitcoin address (only if a well-defined address exists)
        "addresses" : [       (json array, optional) (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Array of bitcoin addresses
          "str",              (string) bitcoin address
          ...
        ]
      }
    },
    ...
  ]
}

type DecodeRawTransactionRespVin

type DecodeRawTransactionRespVin struct {
	// The transaction id
	TxID string `json:"txid"`

	// The output number
	Vout float64 `json:"vout"`

	// The script
	ScriptSig struct {
		// asm
		Asm string `json:"asm"`

		// hex
		Hex string `json:"hex"`
	} `json:"scriptSig"`

	// Element: Hex    hex-encoded witness data (if any)
	TxInWitness []string `json:"txinwitness"`

	// The script sequence number
	Sequence float64 `json:"sequence"`
}

type DecodeRawTransactionRespVout

type DecodeRawTransactionRespVout struct {
	// The value in BTC
	Value float64 `json:"value"`

	// index
	N float64 `json:"n"`

	ScriptPubkey struct {
		// the asm
		Asm string `json:"asm"`

		// the hex
		Hex string `json:"hex"`

		// (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Number of required signatures
		ReqSigs *float64 `json:"reqSigs,omitempty"`

		// The type, eg 'pubkeyhash'
		Type string `json:"type"`

		// bitcoin address (only if a well-defined address exists)
		Address string `json:"address,omitempty"`

		// (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Array of bitcoin addresses
		// Element: Str    bitcoin address
		Addresses []string `json:"addresses,omitempty"`
	} `json:"scriptPubKey"`
}

type DecodeScriptReq

type DecodeScriptReq struct {
	// the hex-encoded script
	HexString string `json:"hexstring"`
}

DecodeScriptReq holds the arguments for the DecodeScript call.

  1. hexstring (string, required) the hex-encoded script

type DecodeScriptResp

type DecodeScriptResp struct {
	// Script public key
	Asm string `json:"asm"`

	// The output type (e.g. nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot, witness_unknown)
	Type string `json:"type"`

	// bitcoin address (only if a well-defined address exists)
	Address string `json:"address,omitempty"`

	// (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Number of required signatures
	ReqSigs *float64 `json:"reqSigs,omitempty"`

	// (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Array of bitcoin addresses
	// Element: Str    bitcoin address
	Addresses []string `json:"addresses,omitempty"`

	// address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH)
	P2SH string `json:"p2sh"`

	// Result of a witness script public key wrapping this redeem script (not returned if the script is a P2SH or witness)
	Segwit struct {
		// String representation of the script public key
		Asm string `json:"asm"`

		// Hex string of the script public key
		Hex string `json:"hex"`

		// The type of the script public key (e.g. witness_v0_keyhash or witness_v0_scripthash)
		Type string `json:"type"`

		// bitcoin address (only if a well-defined address exists)
		Address string `json:"address,omitempty"`

		// (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Number of required signatures
		ReqSigs *float64 `json:"reqSigs,omitempty"`

		// (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Array of bitcoin addresses
		// Element: Str    segwit address
		Addresses []string `json:"addresses,omitempty"`

		// address of the P2SH script wrapping this witness redeem script
		P2SHSegwit string `json:"p2sh-segwit"`
	} `json:"segwit"`
}

DecodeScriptResp holds the response to the DecodeScript call.

{                             (json object)
  "asm" : "str",              (string) Script public key
  "type" : "str",             (string) The output type (e.g. nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot, witness_unknown)
  "address" : "str",          (string, optional) bitcoin address (only if a well-defined address exists)
  "reqSigs" : n,              (numeric, optional) (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Number of required signatures
  "addresses" : [             (json array, optional) (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Array of bitcoin addresses
    "str",                    (string) bitcoin address
    ...
  ],
  "p2sh" : "str",             (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH)
  "segwit" : {                (json object) Result of a witness script public key wrapping this redeem script (not returned if the script is a P2SH or witness)
    "asm" : "str",            (string) String representation of the script public key
    "hex" : "hex",            (string) Hex string of the script public key
    "type" : "str",           (string) The type of the script public key (e.g. witness_v0_keyhash or witness_v0_scripthash)
    "address" : "str",        (string, optional) bitcoin address (only if a well-defined address exists)
    "reqSigs" : n,            (numeric, optional) (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Number of required signatures
    "addresses" : [           (json array, optional) (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Array of bitcoin addresses
      "str",                  (string) segwit address
      ...
    ],
    "p2sh-segwit" : "str"     (string) address of the P2SH script wrapping this witness redeem script
  }
}

type DeriveAddressesReq

type DeriveAddressesReq struct {
	// The descriptor.
	Descriptor string `json:"descriptor"`

	// If a ranged descriptor is used, this specifies the end or the range (in [begin,end] notation) to derive.
	Range *[2]int64 `json:"range,omitempty"`
}

DeriveAddressesReq holds the arguments for the DeriveAddresses call.

  1. descriptor (string, required) The descriptor.
  2. range (numeric or array, optional) If a ranged descriptor is used, this specifies the end or the range (in [begin,end] notation) to derive.

type DeriveAddressesResp

type DeriveAddressesResp struct {
	// Element: Str    the derived addresses
	Str []string
}

DeriveAddressesResp holds the response to the DeriveAddresses call.

[           (json array)
  "str",    (string) the derived addresses
  ...
]

func (DeriveAddressesResp) MarshalJSON

func (alts DeriveAddressesResp) MarshalJSON() ([]byte, error)

func (*DeriveAddressesResp) UnmarshalJSON

func (alts *DeriveAddressesResp) UnmarshalJSON(b []byte) error

type DisconnectNodeReq

type DisconnectNodeReq struct {
	// The IP address/port of the node
	// Default: fallback to nodeid
	Address string `json:"address,omitempty"`

	// The node ID (see getpeerinfo for node IDs)
	// Default: fallback to address
	NodeID *float64 `json:"nodeid,omitempty"`
}

DisconnectNodeReq holds the arguments for the DisconnectNode call.

  1. address (string, optional, default=fallback to nodeid) The IP address/port of the node
  2. nodeid (numeric, optional, default=fallback to address) The node ID (see getpeerinfo for node IDs)

type DumpPrivkeyReq

type DumpPrivkeyReq struct {
	// The bitcoin address for the private key
	Address string `json:"address"`
}

DumpPrivkeyReq holds the arguments for the DumpPrivkey call.

  1. address (string, required) The bitcoin address for the private key

type DumpPrivkeyResp

type DumpPrivkeyResp struct {
	// The private key
	Str string
}

DumpPrivkeyResp holds the response to the DumpPrivkey call.

"str"    (string) The private key

func (DumpPrivkeyResp) MarshalJSON

func (alts DumpPrivkeyResp) MarshalJSON() ([]byte, error)

func (*DumpPrivkeyResp) UnmarshalJSON

func (alts *DumpPrivkeyResp) UnmarshalJSON(b []byte) error

type DumpWalletReq

type DumpWalletReq struct {
	// The filename with path (absolute path recommended)
	FileName string `json:"filename"`
}

DumpWalletReq holds the arguments for the DumpWallet call.

  1. filename (string, required) The filename with path (absolute path recommended)

type DumpWalletResp

type DumpWalletResp struct {
	// The filename with full absolute path
	FileName string `json:"filename"`
}

DumpWalletResp holds the response to the DumpWallet call.

{                        (json object)
  "filename" : "str"     (string) The filename with full absolute path
}

type EncryptWalletReq

type EncryptWalletReq struct {
	// The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.
	Passphrase string `json:"passphrase"`
}

EncryptWalletReq holds the arguments for the EncryptWallet call.

  1. passphrase (string, required) The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.

type EncryptWalletResp

type EncryptWalletResp struct {
	// A string with further instructions
	Str string
}

EncryptWalletResp holds the response to the EncryptWallet call.

"str"    (string) A string with further instructions

func (EncryptWalletResp) MarshalJSON

func (alts EncryptWalletResp) MarshalJSON() ([]byte, error)

func (*EncryptWalletResp) UnmarshalJSON

func (alts *EncryptWalletResp) UnmarshalJSON(b []byte) error

type EnumerateSignersResp

type EnumerateSignersResp struct {
	// Element: hex    Master key fingerprint
	// Element: str    Device name
	Signers []string `json:"signers"`
}

EnumerateSignersResp holds the response to the EnumerateSigners call.

{                  (json object)
  "signers" : [    (json array)
    "hex",         (string) Master key fingerprint
    "str",         (string) Device name
    ...
  ]
}

type EstimateSmartFeeReq

type EstimateSmartFeeReq struct {
	// Confirmation target in blocks (1 - 1008)
	ConfTarget float64 `json:"conf_target"`

	// The fee estimate mode.
	// Whether to return a more conservative estimate which also satisfies
	// a longer history. A conservative estimate potentially returns a
	// higher feerate and is more likely to be sufficient for the desired
	// target, but is not as responsive to short term drops in the
	// prevailing fee market. Must be one of (case insensitive):
	// "unset"
	// "economical"
	// "conservative"
	// Default: "conservative"
	EstimateMode string `json:"estimate_mode,omitempty"`
}

EstimateSmartFeeReq holds the arguments for the EstimateSmartFee call.

  1. conf_target (numeric, required) Confirmation target in blocks (1 - 1008)
  2. estimate_mode (string, optional, default="conservative") The fee estimate mode. Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market. Must be one of (case insensitive): "unset" "economical" "conservative"

type EstimateSmartFeeResp

type EstimateSmartFeeResp struct {
	// estimate fee rate in BTC/kvB (only present if no errors were encountered)
	FeeRate *float64 `json:"feerate,omitempty"`

	// Errors encountered during processing (if there are any)
	// Element: Str    error
	Errors []string `json:"errors,omitempty"`

	// block number where estimate was found
	// The request target will be clamped between 2 and the highest target
	// fee estimation is able to return based on how long it has been running.
	// An error is returned if not enough transactions and blocks
	// have been observed to make an estimate for any number of blocks.
	Blocks float64 `json:"blocks"`
}

EstimateSmartFeeResp holds the response to the EstimateSmartFee call.

{                   (json object)
  "feerate" : n,    (numeric, optional) estimate fee rate in BTC/kvB (only present if no errors were encountered)
  "errors" : [      (json array, optional) Errors encountered during processing (if there are any)
    "str",          (string) error
    ...
  ],
  "blocks" : n      (numeric) block number where estimate was found
                    The request target will be clamped between 2 and the highest target
                    fee estimation is able to return based on how long it has been running.
                    An error is returned if not enough transactions and blocks
                    have been observed to make an estimate for any number of blocks.
}

type FinalizePsbtReq

type FinalizePsbtReq struct {
	// A base64 string of a PSBT
	Psbt string `json:"psbt"`

	// If true and the transaction is complete,
	// extract and return the complete transaction in normal network serialization instead of the PSBT.
	// Default: true
	Extract *bool `json:"extract,omitempty"`
}

FinalizePsbtReq holds the arguments for the FinalizePsbt call.

  1. psbt (string, required) A base64 string of a PSBT
  2. extract (boolean, optional, default=true) If true and the transaction is complete, extract and return the complete transaction in normal network serialization instead of the PSBT.

type FinalizePsbtResp

type FinalizePsbtResp struct {
	// The base64-encoded partially signed transaction if not extracted
	Psbt string `json:"psbt"`

	// The hex-encoded network transaction if extracted
	Hex string `json:"hex"`

	// If the transaction has a complete set of signatures
	Complete bool `json:"complete"`
}

FinalizePsbtResp holds the response to the FinalizePsbt call.

{                             (json object)
  "psbt" : "str",             (string) The base64-encoded partially signed transaction if not extracted
  "hex" : "hex",              (string) The hex-encoded network transaction if extracted
  "complete" : true|false     (boolean) If the transaction has a complete set of signatures
}

type FundRawTransactionReq

type FundRawTransactionReq struct {
	// The hex string of the raw transaction
	HexString string `json:"hexstring"`

	// for backward compatibility: passing in a true instead of an object will result in {"includeWatching":true}
	Options *FundRawTransactionReqOptions `json:"options,omitempty"`

	// Whether the transaction hex is a serialized witness transaction.
	// If iswitness is not present, heuristic tests will be used in decoding.
	// If true, only witness deserialization will be tried.
	// If false, only non-witness deserialization will be tried.
	// This boolean should reflect whether the transaction has inputs
	// (e.g. fully valid, or on-chain transactions), if known by the caller.
	// Default: depends on heuristic tests
	IsWitness *bool `json:"iswitness,omitempty"`
}

FundRawTransactionReq holds the arguments for the FundRawTransaction call.

  1. hexstring (string, required) The hex string of the raw transaction
  2. options (json object, optional) for backward compatibility: passing in a true instead of an object will result in {"includeWatching":true} { "add_inputs": bool, (boolean, optional, default=true) For a transaction with existing inputs, automatically include more if they are not enough. "include_unsafe": bool, (boolean, optional, default=false) Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions). Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears. If that happens, you will need to fund the transaction with different inputs and republish it. "changeAddress": "str", (string, optional, default=pool address) The bitcoin address to receive the change "changePosition": n, (numeric, optional, default=random) The index of the change output "change_type": "str", (string, optional, default=set by -changetype) The output type to use. Only valid if changeAddress is not specified. Options are "legacy", "p2sh-segwit", and "bech32". "includeWatching": bool, (boolean, optional, default=true for watch-only wallets, otherwise false) Also select inputs which are watch only. Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported, e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field. "lockUnspents": bool, (boolean, optional, default=false) Lock selected unspent outputs "fee_rate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB. "feeRate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in BTC/kvB. "subtractFeeFromOutputs": [ (json array, optional, default=[]) The integers. The fee will be equally deducted from the amount of each specified output. Those recipients will receive less bitcoins than you enter in their corresponding amount field. If no outputs are specified here, the sender pays the fee. vout_index, (numeric) The zero-based output index, before a change output is added. ... ], "replaceable": bool, (boolean, optional, default=wallet default) Marks this transaction as BIP125 replaceable. Allows this transaction to be replaced by a transaction with higher fees "conf_target": n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks "estimate_mode": "str", (string, optional, default="unset") The fee estimate mode, must be one of (case insensitive): "unset" "economical" "conservative" }
  3. iswitness (boolean, optional, default=depends on heuristic tests) Whether the transaction hex is a serialized witness transaction. If iswitness is not present, heuristic tests will be used in decoding. If true, only witness deserialization will be tried. If false, only non-witness deserialization will be tried. This boolean should reflect whether the transaction has inputs (e.g. fully valid, or on-chain transactions), if known by the caller.

type FundRawTransactionReqOptions

type FundRawTransactionReqOptions struct {
	// For a transaction with existing inputs, automatically include more if they are not enough.
	// Default: true
	AddInputs *bool `json:"add_inputs,omitempty"`

	// Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).
	// Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.
	// If that happens, you will need to fund the transaction with different inputs and republish it.
	// Default: false
	IncludeUnsafe bool `json:"include_unsafe,omitempty"`

	// The bitcoin address to receive the change
	// Default: pool address
	Changeaddress string `json:"changeAddress,omitempty"`

	// The index of the change output
	// Default: random
	ChangePosition *float64 `json:"changePosition,omitempty"`

	// The output type to use. Only valid if changeAddress is not specified. Options are "legacy", "p2sh-segwit", and "bech32".
	// Default: set by -changetype
	ChangeType string `json:"change_type,omitempty"`

	// Also select inputs which are watch only.
	// Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported,
	// e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field.
	// Default: true for watch-only wallets, otherwise false
	IncludeWatching *bool `json:"includeWatching,omitempty"`

	// Lock selected unspent outputs
	// Default: false
	LockUnspents bool `json:"lockUnspents,omitempty"`

	// Specify a fee rate in sat/vB.
	// Default: not set, fall back to wallet fee estimation
	FeeRate *float64 `json:"fee_rate,omitempty"`

	// Specify a fee rate in BTC/kvB.
	// Default: not set, fall back to wallet fee estimation
	FeeRate2 *float64 `json:"feeRate,omitempty"`

	// The integers.
	// The fee will be equally deducted from the amount of each specified output.
	// Those recipients will receive less bitcoins than you enter in their corresponding amount field.
	// If no outputs are specified here, the sender pays the fee.
	// Element: VoutIndex    The zero-based output index, before a change output is added.
	SubtractFeeFromOutputs []float64 `json:"subtractFeeFromOutputs,omitempty"`

	// Marks this transaction as BIP125 replaceable.
	// Allows this transaction to be replaced by a transaction with higher fees
	// Default: wallet default
	Replaceable *bool `json:"replaceable,omitempty"`

	// Confirmation target in blocks
	// Default: wallet -txconfirmtarget
	ConfTarget *float64 `json:"conf_target,omitempty"`

	// The fee estimate mode, must be one of (case insensitive):
	// "unset"
	// "economical"
	// "conservative"
	// Default: "unset"
	EstimateMode string `json:"estimate_mode,omitempty"`
}

type FundRawTransactionResp

type FundRawTransactionResp struct {
	// The resulting raw transaction (hex-encoded string)
	Hex string `json:"hex"`

	// Fee in BTC the resulting transaction pays
	Fee float64 `json:"fee"`

	// The position of the added change output, or -1
	ChangePos float64 `json:"changepos"`
}

FundRawTransactionResp holds the response to the FundRawTransaction call.

{                     (json object)
  "hex" : "hex",      (string) The resulting raw transaction (hex-encoded string)
  "fee" : n,          (numeric) Fee in BTC the resulting transaction pays
  "changepos" : n     (numeric) The position of the added change output, or -1
}

type GenerateBlockReq

type GenerateBlockReq struct {
	// The address or descriptor to send the newly generated bitcoin to.
	Output string `json:"output"`

	// An array of hex strings which are either txids or raw transactions.
	// Txids must reference transactions currently in the mempool.
	// All transactions must be valid and in valid order, otherwise the block will be rejected.
	// Element: RawTxOrTxID
	Transactions []string `json:"transactions"`
}

GenerateBlockReq holds the arguments for the GenerateBlock call.

  1. output (string, required) The address or descriptor to send the newly generated bitcoin to.
  2. transactions (json array, required) An array of hex strings which are either txids or raw transactions. Txids must reference transactions currently in the mempool. All transactions must be valid and in valid order, otherwise the block will be rejected. [ "rawtx/txid", (string) ... ]

type GenerateBlockResp

type GenerateBlockResp struct {
	// hash of generated block
	Hash string `json:"hash"`
}

GenerateBlockResp holds the response to the GenerateBlock call.

{                    (json object)
  "hash" : "hex"     (string) hash of generated block
}

type GenerateToAddressReq

type GenerateToAddressReq struct {
	// How many blocks are generated immediately.
	NBlocks float64 `json:"nblocks"`

	// The address to send the newly generated bitcoin to.
	Address string `json:"address"`

	// How many iterations to try.
	// Default: 1000000
	MaxTries *float64 `json:"maxtries,omitempty"`
}

GenerateToAddressReq holds the arguments for the GenerateToAddress call.

  1. nblocks (numeric, required) How many blocks are generated immediately.
  2. address (string, required) The address to send the newly generated bitcoin to.
  3. maxtries (numeric, optional, default=1000000) How many iterations to try.

type GenerateToAddressResp

type GenerateToAddressResp struct {
	// hashes of blocks generated
	// Element: Hex    blockhash
	Hex []string
}

GenerateToAddressResp holds the response to the GenerateToAddress call.

[           (json array) hashes of blocks generated
  "hex",    (string) blockhash
  ...
]

func (GenerateToAddressResp) MarshalJSON

func (alts GenerateToAddressResp) MarshalJSON() ([]byte, error)

func (*GenerateToAddressResp) UnmarshalJSON

func (alts *GenerateToAddressResp) UnmarshalJSON(b []byte) error

type GenerateToDescriptorReq

type GenerateToDescriptorReq struct {
	// How many blocks are generated immediately.
	NumBlocks float64 `json:"num_blocks"`

	// The descriptor to send the newly generated bitcoin to.
	Descriptor string `json:"descriptor"`

	// How many iterations to try.
	// Default: 1000000
	MaxTries *float64 `json:"maxtries,omitempty"`
}

GenerateToDescriptorReq holds the arguments for the GenerateToDescriptor call.

  1. num_blocks (numeric, required) How many blocks are generated immediately.
  2. descriptor (string, required) The descriptor to send the newly generated bitcoin to.
  3. maxtries (numeric, optional, default=1000000) How many iterations to try.

type GenerateToDescriptorResp

type GenerateToDescriptorResp struct {
	// hashes of blocks generated
	// Element: Hex    blockhash
	Hex []string
}

GenerateToDescriptorResp holds the response to the GenerateToDescriptor call.

[           (json array) hashes of blocks generated
  "hex",    (string) blockhash
  ...
]

func (GenerateToDescriptorResp) MarshalJSON

func (alts GenerateToDescriptorResp) MarshalJSON() ([]byte, error)

func (*GenerateToDescriptorResp) UnmarshalJSON

func (alts *GenerateToDescriptorResp) UnmarshalJSON(b []byte) error

type GetAddedNodeInfoReq

type GetAddedNodeInfoReq struct {
	// If provided, return information about this specific node, otherwise all nodes are returned.
	// Default: all nodes
	Node string `json:"node,omitempty"`
}

GetAddedNodeInfoReq holds the arguments for the GetAddedNodeInfo call.

  1. node (string, optional, default=all nodes) If provided, return information about this specific node, otherwise all nodes are returned.

type GetAddedNodeInfoResp

type GetAddedNodeInfoResp struct {
	Array []GetAddedNodeInfoRespElement
}

GetAddedNodeInfoResp holds the response to the GetAddedNodeInfo call.

[                                (json array)
  {                              (json object)
    "addednode" : "str",         (string) The node IP address or name (as provided to addnode)
    "connected" : true|false,    (boolean) If connected
    "addresses" : [              (json array) Only when connected = true
      {                          (json object)
        "address" : "str",       (string) The bitcoin server IP and port we're connected to
        "connected" : "str"      (string) connection, inbound or outbound
      },
      ...
    ]
  },
  ...
]

func (GetAddedNodeInfoResp) MarshalJSON

func (alts GetAddedNodeInfoResp) MarshalJSON() ([]byte, error)

func (*GetAddedNodeInfoResp) UnmarshalJSON

func (alts *GetAddedNodeInfoResp) UnmarshalJSON(b []byte) error

type GetAddedNodeInfoRespElement

type GetAddedNodeInfoRespElement struct {
	// The node IP address or name (as provided to addnode)
	AddedNode string `json:"addednode"`

	// If connected
	Connected bool `json:"connected"`

	// Only when connected = true
	Addresses []GetAddedNodeInfoRespElementAddresses `json:"addresses"`
}

type GetAddedNodeInfoRespElementAddresses

type GetAddedNodeInfoRespElementAddresses struct {
	// The bitcoin server IP and port we're connected to
	Address string `json:"address"`

	// connection, inbound or outbound
	Connected string `json:"connected"`
}

type GetAddressInfoReq

type GetAddressInfoReq struct {
	// The bitcoin address for which to get information.
	Address string `json:"address"`
}

GetAddressInfoReq holds the arguments for the GetAddressInfo call.

  1. address (string, required) The bitcoin address for which to get information.

type GetAddressInfoResp

type GetAddressInfoResp struct {
	// The bitcoin address validated.
	Address string `json:"address"`

	// The hex-encoded scriptPubKey generated by the address.
	ScriptPubkey string `json:"scriptPubKey"`

	// If the address is yours.
	IsMine bool `json:"ismine"`

	// If the address is watchonly.
	IsWatchOnly bool `json:"iswatchonly"`

	// If we know how to spend coins sent to this address, ignoring the possible lack of private keys.
	Solvable bool `json:"solvable"`

	// A descriptor for spending coins sent to this address (only when solvable).
	Desc string `json:"desc,omitempty"`

	// The descriptor used to derive this address if this is a descriptor wallet
	ParentDesc string `json:"parent_desc,omitempty"`

	// If the key is a script.
	IsScript bool `json:"isscript"`

	// If the address was used for change output.
	IsChange bool `json:"ischange"`

	// If the address is a witness address.
	IsWitness bool `json:"iswitness"`

	// The version number of the witness program.
	WitnessVersion *float64 `json:"witness_version,omitempty"`

	// The hex value of the witness program.
	WitnessProgram string `json:"witness_program,omitempty"`

	// The output script type. Only if isscript is true and the redeemscript is known. Possible
	// types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash,
	// witness_v0_scripthash, witness_unknown.
	Script string `json:"script,omitempty"`

	// The redeemscript for the p2sh address.
	Hex string `json:"hex,omitempty"`

	// Array of pubkeys associated with the known redeemscript (only if script is multisig).
	// Element: Str
	Pubkeys []string `json:"pubkeys,omitempty"`

	// The number of signatures required to spend multisig output (only if script is multisig).
	SigsRequired *float64 `json:"sigsrequired,omitempty"`

	// The hex value of the raw public key for single-key addresses (possibly embedded in P2SH or P2WSH).
	Pubkey string `json:"pubkey,omitempty"`

	// Information about the address embedded in P2SH or P2WSH, if relevant and known.
	// Includes all getaddressinfo output fields for the embedded address, excluding metadata (timestamp, hdkeypath, hdseedid)
	// and relation to the wallet (ismine, iswatchonly).
	Embedded *GetAddressInfoResp `json:"embedded,omitempty"`

	// If the pubkey is compressed.
	IsCompressed *bool `json:"iscompressed,omitempty"`

	// The creation time of the key, if available, expressed in UNIX epoch time.
	Timestamp *float64 `json:"timestamp,omitempty"`

	// The HD keypath, if the key is HD and available.
	HDKeyPath string `json:"hdkeypath,omitempty"`

	// The Hash160 of the HD seed.
	HDSeedID string `json:"hdseedid,omitempty"`

	// The fingerprint of the master key.
	HDMasterFingerprint string `json:"hdmasterfingerprint,omitempty"`

	// Array of labels associated with the address. Currently limited to one label but returned
	// as an array to keep the API stable if multiple labels are enabled in the future.
	// Element: Str    Label name (defaults to "").
	Labels []string `json:"labels"`
}

GetAddressInfoResp holds the response to the GetAddressInfo call.

{                                   (json object)
  "address" : "str",                (string) The bitcoin address validated.
  "scriptPubKey" : "hex",           (string) The hex-encoded scriptPubKey generated by the address.
  "ismine" : true|false,            (boolean) If the address is yours.
  "iswatchonly" : true|false,       (boolean) If the address is watchonly.
  "solvable" : true|false,          (boolean) If we know how to spend coins sent to this address, ignoring the possible lack of private keys.
  "desc" : "str",                   (string, optional) A descriptor for spending coins sent to this address (only when solvable).
  "parent_desc" : "str",            (string, optional) The descriptor used to derive this address if this is a descriptor wallet
  "isscript" : true|false,          (boolean) If the key is a script.
  "ischange" : true|false,          (boolean) If the address was used for change output.
  "iswitness" : true|false,         (boolean) If the address is a witness address.
  "witness_version" : n,            (numeric, optional) The version number of the witness program.
  "witness_program" : "hex",        (string, optional) The hex value of the witness program.
  "script" : "str",                 (string, optional) The output script type. Only if isscript is true and the redeemscript is known. Possible
                                    types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash,
                                    witness_v0_scripthash, witness_unknown.
  "hex" : "hex",                    (string, optional) The redeemscript for the p2sh address.
  "pubkeys" : [                     (json array, optional) Array of pubkeys associated with the known redeemscript (only if script is multisig).
    "str",                          (string)
    ...
  ],
  "sigsrequired" : n,               (numeric, optional) The number of signatures required to spend multisig output (only if script is multisig).
  "pubkey" : "hex",                 (string, optional) The hex value of the raw public key for single-key addresses (possibly embedded in P2SH or P2WSH).
  "embedded" : {                    (json object, optional) Information about the address embedded in P2SH or P2WSH, if relevant and known.
    ...                             Includes all getaddressinfo output fields for the embedded address, excluding metadata (timestamp, hdkeypath, hdseedid)
                                    and relation to the wallet (ismine, iswatchonly).
  },
  "iscompressed" : true|false,      (boolean, optional) If the pubkey is compressed.
  "timestamp" : xxx,                (numeric, optional) The creation time of the key, if available, expressed in UNIX epoch time.
  "hdkeypath" : "str",              (string, optional) The HD keypath, if the key is HD and available.
  "hdseedid" : "hex",               (string, optional) The Hash160 of the HD seed.
  "hdmasterfingerprint" : "hex",    (string, optional) The fingerprint of the master key.
  "labels" : [                      (json array) Array of labels associated with the address. Currently limited to one label but returned
                                    as an array to keep the API stable if multiple labels are enabled in the future.
    "str",                          (string) Label name (defaults to "").
    ...
  ]
}

type GetAddressesByLabelReq

type GetAddressesByLabelReq struct {
	// The label.
	Label string `json:"label"`
}

GetAddressesByLabelReq holds the arguments for the GetAddressesByLabel call.

  1. label (string, required) The label.

type GetBalanceReq

type GetBalanceReq struct {
	// Only include transactions confirmed at least this many times.
	// Default: 0
	MinConf float64 `json:"minconf,omitempty"`

	// Also include balance in watch-only addresses (see 'importaddress')
	// Default: true for watch-only wallets, otherwise false
	IncludeWatchOnly *bool `json:"include_watchonly,omitempty"`

	// (only available if avoid_reuse wallet flag is set) Do not include balance in dirty outputs; addresses are considered dirty if they have previously been used in a transaction.
	// Default: true
	AvoidReuse *bool `json:"avoid_reuse,omitempty"`
}

GetBalanceReq holds the arguments for the GetBalance call.

  1. dummy (string, optional) Remains for backward compatibility. Must be excluded or set to "*".
  2. minconf (numeric, optional, default=0) Only include transactions confirmed at least this many times.
  3. include_watchonly (boolean, optional, default=true for watch-only wallets, otherwise false) Also include balance in watch-only addresses (see 'importaddress')
  4. avoid_reuse (boolean, optional, default=true) (only available if avoid_reuse wallet flag is set) Do not include balance in dirty outputs; addresses are considered dirty if they have previously been used in a transaction.

type GetBalanceResp

type GetBalanceResp struct {
	// The total amount in BTC received for this wallet.
	N float64
}

GetBalanceResp holds the response to the GetBalance call.

n    (numeric) The total amount in BTC received for this wallet.

func (GetBalanceResp) MarshalJSON

func (alts GetBalanceResp) MarshalJSON() ([]byte, error)

func (*GetBalanceResp) UnmarshalJSON

func (alts *GetBalanceResp) UnmarshalJSON(b []byte) error

type GetBalancesResp

type GetBalancesResp struct {
	// balances from outputs that the wallet can sign
	Mine struct {
		// trusted balance (outputs created by the wallet or confirmed outputs)
		Trusted float64 `json:"trusted"`

		// untrusted pending balance (outputs created by others that are in the mempool)
		UntrustedPending float64 `json:"untrusted_pending"`

		// balance from immature coinbase outputs
		Immature float64 `json:"immature"`

		// (only present if avoid_reuse is set) balance from coins sent to addresses that were previously spent from (potentially privacy violating)
		Used float64 `json:"used"`
	} `json:"mine"`

	// watchonly balances (not present if wallet does not watch anything)
	WatchOnly struct {
		// trusted balance (outputs created by the wallet or confirmed outputs)
		Trusted float64 `json:"trusted"`

		// untrusted pending balance (outputs created by others that are in the mempool)
		UntrustedPending float64 `json:"untrusted_pending"`

		// balance from immature coinbase outputs
		Immature float64 `json:"immature"`
	} `json:"watchonly"`
}

GetBalancesResp holds the response to the GetBalances call.

{                               (json object)
  "mine" : {                    (json object) balances from outputs that the wallet can sign
    "trusted" : n,              (numeric) trusted balance (outputs created by the wallet or confirmed outputs)
    "untrusted_pending" : n,    (numeric) untrusted pending balance (outputs created by others that are in the mempool)
    "immature" : n,             (numeric) balance from immature coinbase outputs
    "used" : n                  (numeric) (only present if avoid_reuse is set) balance from coins sent to addresses that were previously spent from (potentially privacy violating)
  },
  "watchonly" : {               (json object) watchonly balances (not present if wallet does not watch anything)
    "trusted" : n,              (numeric) trusted balance (outputs created by the wallet or confirmed outputs)
    "untrusted_pending" : n,    (numeric) untrusted pending balance (outputs created by others that are in the mempool)
    "immature" : n              (numeric) balance from immature coinbase outputs
  }
}

type GetBestBlockhashResp

type GetBestBlockhashResp struct {
	// the block hash, hex-encoded
	Hex string
}

GetBestBlockhashResp holds the response to the GetBestBlockhash call.

"hex"    (string) the block hash, hex-encoded

func (GetBestBlockhashResp) MarshalJSON

func (alts GetBestBlockhashResp) MarshalJSON() ([]byte, error)

func (*GetBestBlockhashResp) UnmarshalJSON

func (alts *GetBestBlockhashResp) UnmarshalJSON(b []byte) error

type GetBlockCountResp

type GetBlockCountResp struct {
	// The current block count
	N float64
}

GetBlockCountResp holds the response to the GetBlockCount call.

n    (numeric) The current block count

func (GetBlockCountResp) MarshalJSON

func (alts GetBlockCountResp) MarshalJSON() ([]byte, error)

func (*GetBlockCountResp) UnmarshalJSON

func (alts *GetBlockCountResp) UnmarshalJSON(b []byte) error

type GetBlockFilterReq

type GetBlockFilterReq struct {
	// The hash of the block
	Blockhash string `json:"blockhash"`

	// The type name of the filter
	// Default: "basic"
	FilterType string `json:"filtertype,omitempty"`
}

GetBlockFilterReq holds the arguments for the GetBlockFilter call.

  1. blockhash (string, required) The hash of the block
  2. filtertype (string, optional, default="basic") The type name of the filter

type GetBlockFilterResp

type GetBlockFilterResp struct {
	// the hex-encoded filter data
	Filter string `json:"filter"`

	// the hex-encoded filter header
	Header string `json:"header"`
}

GetBlockFilterResp holds the response to the GetBlockFilter call.

{                      (json object)
  "filter" : "hex",    (string) the hex-encoded filter data
  "header" : "hex"     (string) the hex-encoded filter header
}

type GetBlockHeaderReq

type GetBlockHeaderReq struct {
	// The block hash
	Blockhash string `json:"blockhash"`

	// true for a json object, false for the hex-encoded data
	// Default: true
	Verbose *bool `json:"verbose,omitempty"`
}

GetBlockHeaderReq holds the arguments for the GetBlockHeader call.

  1. blockhash (string, required) The block hash
  2. verbose (boolean, optional, default=true) true for a json object, false for the hex-encoded data

type GetBlockHeaderResp

type GetBlockHeaderResp struct {
	ForVerboseEqualsTrue GetBlockHeaderRespForVerboseEqualsTrue

	// A string that is serialized, hex-encoded data for block 'hash'
	Hex string
}

GetBlockHeaderResp holds the response to the GetBlockHeader call.

ALTERNATIVE (for verbose = true)

{                                 (json object)
  "hash" : "hex",                 (string) the block hash (same as provided)
  "confirmations" : n,            (numeric) The number of confirmations, or -1 if the block is not on the main chain
  "height" : n,                   (numeric) The block height or index
  "version" : n,                  (numeric) The block version
  "versionHex" : "hex",           (string) The block version formatted in hexadecimal
  "merkleroot" : "hex",           (string) The merkle root
  "time" : xxx,                   (numeric) The block time expressed in UNIX epoch time
  "mediantime" : xxx,             (numeric) The median block time expressed in UNIX epoch time
  "nonce" : n,                    (numeric) The nonce
  "bits" : "hex",                 (string) The bits
  "difficulty" : n,               (numeric) The difficulty
  "chainwork" : "hex",            (string) Expected number of hashes required to produce the current chain
  "nTx" : n,                      (numeric) The number of transactions in the block
  "previousblockhash" : "hex",    (string, optional) The hash of the previous block (if available)
  "nextblockhash" : "hex"         (string, optional) The hash of the next block (if available)
}

ALTERNATIVE (for verbose=false)

"hex"    (string) A string that is serialized, hex-encoded data for block 'hash'

func (GetBlockHeaderResp) MarshalJSON

func (alts GetBlockHeaderResp) MarshalJSON() ([]byte, error)

func (*GetBlockHeaderResp) UnmarshalJSON

func (alts *GetBlockHeaderResp) UnmarshalJSON(b []byte) error

type GetBlockHeaderRespForVerboseEqualsTrue

type GetBlockHeaderRespForVerboseEqualsTrue struct {
	// the block hash (same as provided)
	Hash string `json:"hash"`

	// The number of confirmations, or -1 if the block is not on the main chain
	Confirmations float64 `json:"confirmations"`

	// The block height or index
	Height float64 `json:"height"`

	// The block version
	Version float64 `json:"version"`

	// The block version formatted in hexadecimal
	VersionHex string `json:"versionHex"`

	// The merkle root
	MerkleRoot string `json:"merkleroot"`

	// The block time expressed in UNIX epoch time
	Time float64 `json:"time"`

	// The median block time expressed in UNIX epoch time
	MedianTime float64 `json:"mediantime"`

	// The nonce
	Nonce float64 `json:"nonce"`

	// The bits
	Bits string `json:"bits"`

	// The difficulty
	Difficulty float64 `json:"difficulty"`

	// Expected number of hashes required to produce the current chain
	ChainWork string `json:"chainwork"`

	// The number of transactions in the block
	NTx float64 `json:"nTx"`

	// The hash of the previous block (if available)
	PreviousBlockhash string `json:"previousblockhash,omitempty"`

	// The hash of the next block (if available)
	NextBlockhash string `json:"nextblockhash,omitempty"`
}

type GetBlockReq

type GetBlockReq struct {
	// The block hash
	Blockhash string `json:"blockhash"`

	// 0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data
	// Default: 1
	Verbosity *float64 `json:"verbosity,omitempty"`
}

GetBlockReq holds the arguments for the GetBlock call.

  1. blockhash (string, required) The block hash
  2. verbosity (numeric, optional, default=1) 0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data

type GetBlockResp

type GetBlockResp struct {
	// A string that is serialized, hex-encoded data for block 'hash'
	Hex string

	ForVerbosityEquals1 GetBlockRespForVerbosityEquals1

	ForVerbosityEquals2 GetBlockRespForVerbosityEquals2
}

GetBlockResp holds the response to the GetBlock call.

ALTERNATIVE (for verbosity = 0)

"hex"    (string) A string that is serialized, hex-encoded data for block 'hash'

ALTERNATIVE (for verbosity = 1)

{                                 (json object)
  "hash" : "hex",                 (string) the block hash (same as provided)
  "confirmations" : n,            (numeric) The number of confirmations, or -1 if the block is not on the main chain
  "size" : n,                     (numeric) The block size
  "strippedsize" : n,             (numeric) The block size excluding witness data
  "weight" : n,                   (numeric) The block weight as defined in BIP 141
  "height" : n,                   (numeric) The block height or index
  "version" : n,                  (numeric) The block version
  "versionHex" : "hex",           (string) The block version formatted in hexadecimal
  "merkleroot" : "hex",           (string) The merkle root
  "tx" : [                        (json array) The transaction ids
    "hex",                        (string) The transaction id
    ...
  ],
  "time" : xxx,                   (numeric) The block time expressed in UNIX epoch time
  "mediantime" : xxx,             (numeric) The median block time expressed in UNIX epoch time
  "nonce" : n,                    (numeric) The nonce
  "bits" : "hex",                 (string) The bits
  "difficulty" : n,               (numeric) The difficulty
  "chainwork" : "hex",            (string) Expected number of hashes required to produce the chain up to this block (in hex)
  "nTx" : n,                      (numeric) The number of transactions in the block
  "previousblockhash" : "hex",    (string, optional) The hash of the previous block (if available)
  "nextblockhash" : "hex"         (string, optional) The hash of the next block (if available)
}

ALTERNATIVE (for verbosity = 2)

{                   (json object)
  ...,              Same output as verbosity = 1
  "tx" : [          (json array)
    {               (json object)
      ...,          The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" result
      "fee" : n     (numeric) The transaction fee in BTC, omitted if block undo data is not available
    },
    ...
  ]
}

func (GetBlockResp) MarshalJSON

func (alts GetBlockResp) MarshalJSON() ([]byte, error)

func (*GetBlockResp) UnmarshalJSON

func (alts *GetBlockResp) UnmarshalJSON(b []byte) error

type GetBlockRespForVerbosityEquals1

type GetBlockRespForVerbosityEquals1 struct {
	// the block hash (same as provided)
	Hash string `json:"hash"`

	// The number of confirmations, or -1 if the block is not on the main chain
	Confirmations float64 `json:"confirmations"`

	// The block size
	Size float64 `json:"size"`

	// The block size excluding witness data
	StrippedSize float64 `json:"strippedsize"`

	// The block weight as defined in BIP 141
	Weight float64 `json:"weight"`

	// The block height or index
	Height float64 `json:"height"`

	// The block version
	Version float64 `json:"version"`

	// The block version formatted in hexadecimal
	VersionHex string `json:"versionHex"`

	// The merkle root
	MerkleRoot string `json:"merkleroot"`

	// The transaction ids
	// Element: Hex    The transaction id
	Tx []string `json:"tx"`

	// The block time expressed in UNIX epoch time
	Time float64 `json:"time"`

	// The median block time expressed in UNIX epoch time
	MedianTime float64 `json:"mediantime"`

	// The nonce
	Nonce float64 `json:"nonce"`

	// The bits
	Bits string `json:"bits"`

	// The difficulty
	Difficulty float64 `json:"difficulty"`

	// Expected number of hashes required to produce the chain up to this block (in hex)
	ChainWork string `json:"chainwork"`

	// The number of transactions in the block
	NTx float64 `json:"nTx"`

	// The hash of the previous block (if available)
	PreviousBlockhash string `json:"previousblockhash,omitempty"`

	// The hash of the next block (if available)
	NextBlockhash string `json:"nextblockhash,omitempty"`
}

type GetBlockRespForVerbosityEquals2

type GetBlockRespForVerbosityEquals2 struct {
	// Same output as verbosity = 1
	GetBlockRespForVerbosityEquals1

	Tx []GetBlockRespForVerbosityEquals2Tx `json:"tx"`
}

type GetBlockRespForVerbosityEquals2Tx

type GetBlockRespForVerbosityEquals2Tx struct {
	// The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" result
	GetRawTransactionRespIfVerboseIsSetToTrue

	// The transaction fee in BTC, omitted if block undo data is not available
	Fee float64 `json:"fee"`
}

type GetBlockStatsReq

type GetBlockStatsReq struct {
	// The block hash or height of the target block
	HashOrHeight string `json:"hash_or_height"`

	// Values to plot (see result below)
	// Default: all values
	// Element: height    Selected statistic
	// Element: time      Selected statistic
	Stats []string `json:"stats,omitempty"`
}

GetBlockStatsReq holds the arguments for the GetBlockStats call.

  1. hash_or_height (string or numeric, required) The block hash or height of the target block
  2. stats (json array, optional, default=all values) Values to plot (see result below) [ "height", (string) Selected statistic "time", (string) Selected statistic ... ]

type GetBlockStatsResp

type GetBlockStatsResp struct {
	// Average fee in the block
	AvgFee float64 `json:"avgfee"`

	// Average feerate (in satoshis per virtual byte)
	AvgFeeRate float64 `json:"avgfeerate"`

	// Average transaction size
	AvgTxSize float64 `json:"avgtxsize"`

	// The block hash (to check for potential reorgs)
	Blockhash string `json:"blockhash"`

	// Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte)
	// Element: n    The 10th percentile feerate
	// Element: n    The 25th percentile feerate
	// Element: n    The 50th percentile feerate
	// Element: n    The 75th percentile feerate
	// n                          (numeric) The 90th percentile feerate
	FeeRatePercentiles []float64 `json:"feerate_percentiles"`

	// The height of the block
	Height float64 `json:"height"`

	// The number of inputs (excluding coinbase)
	Ins float64 `json:"ins"`

	// Maximum fee in the block
	MaxFee float64 `json:"maxfee"`

	// Maximum feerate (in satoshis per virtual byte)
	MaxFeeRate float64 `json:"maxfeerate"`

	// Maximum transaction size
	MaxTxSize float64 `json:"maxtxsize"`

	// Truncated median fee in the block
	MedianFee float64 `json:"medianfee"`

	// The block median time past
	MedianTime float64 `json:"mediantime"`

	// Truncated median transaction size
	MedianTxSize float64 `json:"mediantxsize"`

	// Minimum fee in the block
	MinFee float64 `json:"minfee"`

	// Minimum feerate (in satoshis per virtual byte)
	MinFeeRate float64 `json:"minfeerate"`

	// Minimum transaction size
	MinTxSize float64 `json:"mintxsize"`

	// The number of outputs
	Outs float64 `json:"outs"`

	// The block subsidy
	Subsidy float64 `json:"subsidy"`

	// Total size of all segwit transactions
	SwTotalSize float64 `json:"swtotal_size"`

	// Total weight of all segwit transactions
	SwTotalWeight float64 `json:"swtotal_weight"`

	// The number of segwit transactions
	SwTxs float64 `json:"swtxs"`

	// The block time
	Time float64 `json:"time"`

	// Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee])
	TotalOut float64 `json:"total_out"`

	// Total size of all non-coinbase transactions
	TotalSize float64 `json:"total_size"`

	// Total weight of all non-coinbase transactions
	TotalWeight float64 `json:"total_weight"`

	// The fee total
	TotalFee float64 `json:"totalfee"`

	// The number of transactions (including coinbase)
	Txs float64 `json:"txs"`

	// The increase/decrease in the number of unspent outputs
	UtxoIncrease float64 `json:"utxo_increase"`

	// The increase/decrease in size for the utxo index (not discounting op_return and similar)
	UtxoSizeInc float64 `json:"utxo_size_inc"`
}

GetBlockStatsResp holds the response to the GetBlockStats call.

{                              (json object)
  "avgfee" : n,                (numeric) Average fee in the block
  "avgfeerate" : n,            (numeric) Average feerate (in satoshis per virtual byte)
  "avgtxsize" : n,             (numeric) Average transaction size
  "blockhash" : "hex",         (string) The block hash (to check for potential reorgs)
  "feerate_percentiles" : [    (json array) Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte)
    n,                         (numeric) The 10th percentile feerate
    n,                         (numeric) The 25th percentile feerate
    n,                         (numeric) The 50th percentile feerate
    n,                         (numeric) The 75th percentile feerate
    n                          (numeric) The 90th percentile feerate
  ],
  "height" : n,                (numeric) The height of the block
  "ins" : n,                   (numeric) The number of inputs (excluding coinbase)
  "maxfee" : n,                (numeric) Maximum fee in the block
  "maxfeerate" : n,            (numeric) Maximum feerate (in satoshis per virtual byte)
  "maxtxsize" : n,             (numeric) Maximum transaction size
  "medianfee" : n,             (numeric) Truncated median fee in the block
  "mediantime" : n,            (numeric) The block median time past
  "mediantxsize" : n,          (numeric) Truncated median transaction size
  "minfee" : n,                (numeric) Minimum fee in the block
  "minfeerate" : n,            (numeric) Minimum feerate (in satoshis per virtual byte)
  "mintxsize" : n,             (numeric) Minimum transaction size
  "outs" : n,                  (numeric) The number of outputs
  "subsidy" : n,               (numeric) The block subsidy
  "swtotal_size" : n,          (numeric) Total size of all segwit transactions
  "swtotal_weight" : n,        (numeric) Total weight of all segwit transactions
  "swtxs" : n,                 (numeric) The number of segwit transactions
  "time" : n,                  (numeric) The block time
  "total_out" : n,             (numeric) Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee])
  "total_size" : n,            (numeric) Total size of all non-coinbase transactions
  "total_weight" : n,          (numeric) Total weight of all non-coinbase transactions
  "totalfee" : n,              (numeric) The fee total
  "txs" : n,                   (numeric) The number of transactions (including coinbase)
  "utxo_increase" : n,         (numeric) The increase/decrease in the number of unspent outputs
  "utxo_size_inc" : n          (numeric) The increase/decrease in size for the utxo index (not discounting op_return and similar)
}

type GetBlockTemplateReq

type GetBlockTemplateReq struct {
	// Format of the template
	// Default: {}
	TemplateRequest *GetBlockTemplateReqTemplateRequest `json:"template_request,omitempty"`
}

GetBlockTemplateReq holds the arguments for the GetBlockTemplate call.

  1. template_request (json object, optional, default={}) Format of the template { "mode": "str", (string, optional) This must be set to "template", "proposal" (see BIP 23), or omitted "capabilities": [ (json array, optional) A list of strings "str", (string) client side supported feature, 'longpoll', 'coinbasevalue', 'proposal', 'serverlist', 'workid' ... ], "rules": [ (json array, required) A list of strings "segwit", (string, required) (literal) indicates client side segwit support "str", (string) other client side supported softfork deployment ... ], }

type GetBlockTemplateReqTemplateRequest

type GetBlockTemplateReqTemplateRequest struct {
	// This must be set to "template", "proposal" (see BIP 23), or omitted
	Mode string `json:"mode,omitempty"`

	// A list of strings
	// Element: Str    client side supported feature, 'longpoll', 'coinbasevalue', 'proposal', 'serverlist', 'workid'
	Capabilities []string `json:"capabilities,omitempty"`

	// A list of strings
	// Element: segwit    (literal) indicates client side segwit support
	// Element: str       other client side supported softfork deployment
	Rules []string `json:"rules"`
}

type GetBlockTemplateResp

type GetBlockTemplateResp struct {
	// According to BIP22
	Str string

	Otherwise GetBlockTemplateRespOtherwise
}

GetBlockTemplateResp holds the response to the GetBlockTemplate call.

ALTERNATIVE (If the proposal was accepted with mode=='proposal')

null    (json null)

ALTERNATIVE (If the proposal was not accepted with mode=='proposal')

"str"    (string) According to BIP22

ALTERNATIVE (Otherwise)

{                                          (json object)
  "version" : n,                           (numeric) The preferred block version
  "rules" : [                              (json array) specific block rules that are to be enforced
    "str",                                 (string) name of a rule the client must understand to some extent; see BIP 9 for format
    ...
  ],
  "vbavailable" : {                        (json object) set of pending, supported versionbit (BIP 9) softfork deployments
    "rulename" : n,                        (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule
    ...
  },
  "vbrequired" : n,                        (numeric) bit mask of versionbits the server requires set in submissions
  "previousblockhash" : "str",             (string) The hash of current highest block
  "transactions" : [                       (json array) contents of non-coinbase transactions that should be included in the next block
    {                                      (json object)
      "data" : "hex",                      (string) transaction data encoded in hexadecimal (byte-for-byte)
      "txid" : "hex",                      (string) transaction id encoded in little-endian hexadecimal
      "hash" : "hex",                      (string) hash encoded in little-endian hexadecimal (including witness data)
      "depends" : [                        (json array) array of numbers
        n,                                 (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is
        ...
      ],
      "fee" : n,                           (numeric) difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one
      "sigops" : n,                        (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero
      "weight" : n                         (numeric) total transaction weight, as counted for purposes of block limits
    },
    ...
  ],
  "coinbaseaux" : {                        (json object) data that should be included in the coinbase's scriptSig content
    "key" : "hex",                         (string) values must be in the coinbase (keys may be ignored)
    ...
  },
  "coinbasevalue" : n,                     (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)
  "longpollid" : "str",                    (string) an id to include with a request to longpoll on an update to this template
  "target" : "str",                        (string) The hash target
  "mintime" : xxx,                         (numeric) The minimum timestamp appropriate for the next block time, expressed in UNIX epoch time
  "mutable" : [                            (json array) list of ways the block template may be changed
    "str",                                 (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'
    ...
  ],
  "noncerange" : "hex",                    (string) A range of valid nonces
  "sigoplimit" : n,                        (numeric) limit of sigops in blocks
  "sizelimit" : n,                         (numeric) limit of block size
  "weightlimit" : n,                       (numeric) limit of block weight
  "curtime" : xxx,                         (numeric) current timestamp in UNIX epoch time
  "bits" : "str",                          (string) compressed target of next block
  "height" : n,                            (numeric) The height of the next block
  "default_witness_commitment" : "str"     (string, optional) a valid witness commitment for the unmodified block template
}

func (GetBlockTemplateResp) MarshalJSON

func (alts GetBlockTemplateResp) MarshalJSON() ([]byte, error)

func (*GetBlockTemplateResp) UnmarshalJSON

func (alts *GetBlockTemplateResp) UnmarshalJSON(b []byte) error

type GetBlockTemplateRespOtherwise

type GetBlockTemplateRespOtherwise struct {
	// The preferred block version
	Version float64 `json:"version"`

	// specific block rules that are to be enforced
	// Element: Str    name of a rule the client must understand to some extent; see BIP 9 for format
	Rules []string `json:"rules"`

	// set of pending, supported versionbit (BIP 9) softfork deployments
	VbAvailable map[string]float64 `json:"vbavailable"`

	// bit mask of versionbits the server requires set in submissions
	VbRequired float64 `json:"vbrequired"`

	// The hash of current highest block
	PreviousBlockhash string `json:"previousblockhash"`

	// contents of non-coinbase transactions that should be included in the next block
	Transactions []GetBlockTemplateRespOtherwiseTransactions `json:"transactions"`

	// data that should be included in the coinbase's scriptSig content
	CoinbaseAux map[string]string `json:"coinbaseaux"`

	// maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)
	CoinbaseValue float64 `json:"coinbasevalue"`

	// an id to include with a request to longpoll on an update to this template
	LongPollID string `json:"longpollid"`

	// The hash target
	Target string `json:"target"`

	// The minimum timestamp appropriate for the next block time, expressed in UNIX epoch time
	MinTime float64 `json:"mintime"`

	// list of ways the block template may be changed
	// Element: Str    A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'
	MuTable []string `json:"mutable"`

	// A range of valid nonces
	NonceRange string `json:"noncerange"`

	// limit of sigops in blocks
	SigOpLimit float64 `json:"sigoplimit"`

	// limit of block size
	SizeLimit float64 `json:"sizelimit"`

	// limit of block weight
	WeightLimit float64 `json:"weightlimit"`

	// current timestamp in UNIX epoch time
	CurTime float64 `json:"curtime"`

	// compressed target of next block
	Bits string `json:"bits"`

	// The height of the next block
	Height float64 `json:"height"`

	// a valid witness commitment for the unmodified block template
	DefaultWitnessCommitment string `json:"default_witness_commitment,omitempty"`
}

type GetBlockTemplateRespOtherwiseTransactions

type GetBlockTemplateRespOtherwiseTransactions struct {
	// transaction data encoded in hexadecimal (byte-for-byte)
	Data string `json:"data"`

	// transaction id encoded in little-endian hexadecimal
	TxID string `json:"txid"`

	// hash encoded in little-endian hexadecimal (including witness data)
	Hash string `json:"hash"`

	// array of numbers
	// Element: N    transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is
	Depends []float64 `json:"depends"`

	// difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one
	Fee float64 `json:"fee"`

	// total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero
	SigOps float64 `json:"sigops"`

	// total transaction weight, as counted for purposes of block limits
	Weight float64 `json:"weight"`
}

type GetBlockchainInfoResp

type GetBlockchainInfoResp struct {
	// current network name (main, test, signet, regtest)
	Chain string `json:"chain"`

	// the height of the most-work fully-validated chain. The genesis block has height 0
	Blocks float64 `json:"blocks"`

	// the current number of headers we have validated
	Headers float64 `json:"headers"`

	// the hash of the currently best block
	BestBlockhash string `json:"bestblockhash"`

	// the current difficulty
	Difficulty float64 `json:"difficulty"`

	// median time for the current best block
	MedianTime float64 `json:"mediantime"`

	// estimate of verification progress [0..1]
	VerificationProgress float64 `json:"verificationprogress"`

	// (debug information) estimate of whether this node is in Initial Block Download mode
	InitialBlockDownload bool `json:"initialblockdownload"`

	// total amount of work in active chain, in hexadecimal
	ChainWork string `json:"chainwork"`

	// the estimated size of the block and undo files on disk
	SizeOnDisk float64 `json:"size_on_disk"`

	// if the blocks are subject to pruning
	Pruned bool `json:"pruned"`

	// lowest-height complete block stored (only present if pruning is enabled)
	PruneHeight float64 `json:"pruneheight"`

	// whether automatic pruning is enabled (only present if pruning is enabled)
	AutomaticPruning bool `json:"automatic_pruning"`

	// the target size used by pruning (only present if automatic pruning is enabled)
	PruneTargetSize float64 `json:"prune_target_size"`

	// status of softforks
	SoftForks map[string]GetBlockchainInfoRespSoftForksXXXX `json:"softforks"`

	// any network and blockchain warnings
	Warnings string `json:"warnings"`
}

GetBlockchainInfoResp holds the response to the GetBlockchainInfo call.

{                                         (json object)
  "chain" : "str",                        (string) current network name (main, test, signet, regtest)
  "blocks" : n,                           (numeric) the height of the most-work fully-validated chain. The genesis block has height 0
  "headers" : n,                          (numeric) the current number of headers we have validated
  "bestblockhash" : "str",                (string) the hash of the currently best block
  "difficulty" : n,                       (numeric) the current difficulty
  "mediantime" : n,                       (numeric) median time for the current best block
  "verificationprogress" : n,             (numeric) estimate of verification progress [0..1]
  "initialblockdownload" : true|false,    (boolean) (debug information) estimate of whether this node is in Initial Block Download mode
  "chainwork" : "hex",                    (string) total amount of work in active chain, in hexadecimal
  "size_on_disk" : n,                     (numeric) the estimated size of the block and undo files on disk
  "pruned" : true|false,                  (boolean) if the blocks are subject to pruning
  "pruneheight" : n,                      (numeric) lowest-height complete block stored (only present if pruning is enabled)
  "automatic_pruning" : true|false,       (boolean) whether automatic pruning is enabled (only present if pruning is enabled)
  "prune_target_size" : n,                (numeric) the target size used by pruning (only present if automatic pruning is enabled)
  "softforks" : {                         (json object) status of softforks
    "xxxx" : {                            (json object) name of the softfork
      "type" : "str",                     (string) one of "buried", "bip9"
      "bip9" : {                          (json object) status of bip9 softforks (only for "bip9" type)
        "status" : "str",                 (string) one of "defined", "started", "locked_in", "active", "failed"
        "bit" : n,                        (numeric) the bit (0-28) in the block version field used to signal this softfork (only for "started" status)
        "start_time" : xxx,               (numeric) the minimum median time past of a block at which the bit gains its meaning
        "timeout" : xxx,                  (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
        "since" : n,                      (numeric) height of the first block to which the status applies
        "min_activation_height" : n,      (numeric) minimum height of blocks for which the rules may be enforced
        "statistics" : {                  (json object) numeric statistics about BIP9 signalling for a softfork (only for "started" status)
          "period" : n,                   (numeric) the length in blocks of the BIP9 signalling period
          "threshold" : n,                (numeric) the number of blocks with the version bit set required to activate the feature
          "elapsed" : n,                  (numeric) the number of blocks elapsed since the beginning of the current period
          "count" : n,                    (numeric) the number of blocks with the version bit set in the current period
          "possible" : true|false         (boolean) returns false if there are not enough blocks left in this period to pass activation threshold
        }
      },
      "height" : n,                       (numeric) height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status)
      "active" : true|false               (boolean) true if the rules are enforced for the mempool and the next block
    },
    ...
  },
  "warnings" : "str"                      (string) any network and blockchain warnings
}

type GetBlockchainInfoRespSoftForksXXXX

type GetBlockchainInfoRespSoftForksXXXX struct {
	// one of "buried", "bip9"
	Type string `json:"type"`

	// status of bip9 softforks (only for "bip9" type)
	BIP9 struct {
		// one of "defined", "started", "locked_in", "active", "failed"
		Status string `json:"status"`

		// the bit (0-28) in the block version field used to signal this softfork (only for "started" status)
		Bit float64 `json:"bit"`

		// the minimum median time past of a block at which the bit gains its meaning
		StartTime float64 `json:"start_time"`

		// the median time past of a block at which the deployment is considered failed if not yet locked in
		TimeOut float64 `json:"timeout"`

		// height of the first block to which the status applies
		Since float64 `json:"since"`

		// minimum height of blocks for which the rules may be enforced
		MinActivationHeight float64 `json:"min_activation_height"`

		// numeric statistics about BIP9 signalling for a softfork (only for "started" status)
		Statistics struct {
			// the length in blocks of the BIP9 signalling period
			Period float64 `json:"period"`

			// the number of blocks with the version bit set required to activate the feature
			Threshold float64 `json:"threshold"`

			// the number of blocks elapsed since the beginning of the current period
			Elapsed float64 `json:"elapsed"`

			// the number of blocks with the version bit set in the current period
			Count float64 `json:"count"`

			// returns false if there are not enough blocks left in this period to pass activation threshold
			Possible bool `json:"possible"`
		} `json:"statistics"`
	} `json:"bip9"`

	// height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status)
	Height float64 `json:"height"`

	// true if the rules are enforced for the mempool and the next block
	Active bool `json:"active"`
}

type GetBlockhashReq

type GetBlockhashReq struct {
	// The height index
	Height float64 `json:"height"`
}

GetBlockhashReq holds the arguments for the GetBlockhash call.

  1. height (numeric, required) The height index

type GetBlockhashResp

type GetBlockhashResp struct {
	// The block hash
	Hex string
}

GetBlockhashResp holds the response to the GetBlockhash call.

"hex"    (string) The block hash

func (GetBlockhashResp) MarshalJSON

func (alts GetBlockhashResp) MarshalJSON() ([]byte, error)

func (*GetBlockhashResp) UnmarshalJSON

func (alts *GetBlockhashResp) UnmarshalJSON(b []byte) error

type GetChainTipsResp

type GetChainTipsResp struct {
	Array []GetChainTipsRespElement
}

GetChainTipsResp holds the response to the GetChainTips call.

[                        (json array)
  {                      (json object)
    "height" : n,        (numeric) height of the chain tip
    "hash" : "hex",      (string) block hash of the tip
    "branchlen" : n,     (numeric) zero for main chain, otherwise length of branch connecting the tip to the main chain
    "status" : "str"     (string) status of the chain, "active" for the main chain
                         Possible values for status:
                         1.  "invalid"               This branch contains at least one invalid block
                         2.  "headers-only"          Not all blocks for this branch are available, but the headers are valid
                         3.  "valid-headers"         All blocks are available for this branch, but they were never fully validated
                         4.  "valid-fork"            This branch is not part of the active chain, but is fully validated
                         5.  "active"                This is the tip of the active main chain, which is certainly valid
  },
  ...
]

func (GetChainTipsResp) MarshalJSON

func (alts GetChainTipsResp) MarshalJSON() ([]byte, error)

func (*GetChainTipsResp) UnmarshalJSON

func (alts *GetChainTipsResp) UnmarshalJSON(b []byte) error

type GetChainTipsRespElement

type GetChainTipsRespElement struct {
	// height of the chain tip
	Height float64 `json:"height"`

	// block hash of the tip
	Hash string `json:"hash"`

	// zero for main chain, otherwise length of branch connecting the tip to the main chain
	BranchLen float64 `json:"branchlen"`

	// status of the chain, "active" for the main chain
	// Possible values for status:
	// 1.  "invalid"               This branch contains at least one invalid block
	// 2.  "headers-only"          Not all blocks for this branch are available, but the headers are valid
	// 3.  "valid-headers"         All blocks are available for this branch, but they were never fully validated
	// 4.  "valid-fork"            This branch is not part of the active chain, but is fully validated
	// 5.  "active"                This is the tip of the active main chain, which is certainly valid
	Status string `json:"status"`
}

type GetChainTxStatsReq

type GetChainTxStatsReq struct {
	// Size of the window in number of blocks
	// Default: one month
	NBlocks *float64 `json:"nblocks,omitempty"`

	// The hash of the block that ends the window.
	// Default: chain tip
	Blockhash string `json:"blockhash,omitempty"`
}

GetChainTxStatsReq holds the arguments for the GetChainTxStats call.

  1. nblocks (numeric, optional, default=one month) Size of the window in number of blocks
  2. blockhash (string, optional, default=chain tip) The hash of the block that ends the window.

type GetChainTxStatsResp

type GetChainTxStatsResp struct {
	// The timestamp for the final block in the window, expressed in UNIX epoch time
	Time float64 `json:"time"`

	// The total number of transactions in the chain up to that point
	TxCount float64 `json:"txcount"`

	// The hash of the final block in the window
	WindowFinalBlockhash string `json:"window_final_block_hash"`

	// The height of the final block in the window.
	WindowFinalBlockHeight float64 `json:"window_final_block_height"`

	// Size of the window in number of blocks
	WindowBlockCount float64 `json:"window_block_count"`

	// The number of transactions in the window. Only returned if "window_block_count" is > 0
	WindowTxCount *float64 `json:"window_tx_count,omitempty"`

	// The elapsed time in the window in seconds. Only returned if "window_block_count" is > 0
	WindowInterval *float64 `json:"window_interval,omitempty"`

	// The average rate of transactions per second in the window. Only returned if "window_interval" is > 0
	TxRate *float64 `json:"txrate,omitempty"`
}

GetChainTxStatsResp holds the response to the GetChainTxStats call.

{                                       (json object)
  "time" : xxx,                         (numeric) The timestamp for the final block in the window, expressed in UNIX epoch time
  "txcount" : n,                        (numeric) The total number of transactions in the chain up to that point
  "window_final_block_hash" : "hex",    (string) The hash of the final block in the window
  "window_final_block_height" : n,      (numeric) The height of the final block in the window.
  "window_block_count" : n,             (numeric) Size of the window in number of blocks
  "window_tx_count" : n,                (numeric, optional) The number of transactions in the window. Only returned if "window_block_count" is > 0
  "window_interval" : n,                (numeric, optional) The elapsed time in the window in seconds. Only returned if "window_block_count" is > 0
  "txrate" : n                          (numeric, optional) The average rate of transactions per second in the window. Only returned if "window_interval" is > 0
}

type GetConnectionCountResp

type GetConnectionCountResp struct {
	// The connection count
	N float64
}

GetConnectionCountResp holds the response to the GetConnectionCount call.

n    (numeric) The connection count

func (GetConnectionCountResp) MarshalJSON

func (alts GetConnectionCountResp) MarshalJSON() ([]byte, error)

func (*GetConnectionCountResp) UnmarshalJSON

func (alts *GetConnectionCountResp) UnmarshalJSON(b []byte) error

type GetDescriptorInfoReq

type GetDescriptorInfoReq struct {
	// The descriptor.
	Descriptor string `json:"descriptor"`
}

GetDescriptorInfoReq holds the arguments for the GetDescriptorInfo call.

  1. descriptor (string, required) The descriptor.

type GetDescriptorInfoResp

type GetDescriptorInfoResp struct {
	// The descriptor in canonical form, without private keys
	Descriptor string `json:"descriptor"`

	// The checksum for the input descriptor
	CheckSum string `json:"checksum"`

	// Whether the descriptor is ranged
	IsRange bool `json:"isrange"`

	// Whether the descriptor is solvable
	IsSolvable bool `json:"issolvable"`

	// Whether the input descriptor contained at least one private key
	HasPrivateKeys bool `json:"hasprivatekeys"`
}

GetDescriptorInfoResp holds the response to the GetDescriptorInfo call.

{                                   (json object)
  "descriptor" : "str",             (string) The descriptor in canonical form, without private keys
  "checksum" : "str",               (string) The checksum for the input descriptor
  "isrange" : true|false,           (boolean) Whether the descriptor is ranged
  "issolvable" : true|false,        (boolean) Whether the descriptor is solvable
  "hasprivatekeys" : true|false     (boolean) Whether the input descriptor contained at least one private key
}

type GetDifficultyResp

type GetDifficultyResp struct {
	// the proof-of-work difficulty as a multiple of the minimum difficulty.
	N float64
}

GetDifficultyResp holds the response to the GetDifficulty call.

n    (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty.

func (GetDifficultyResp) MarshalJSON

func (alts GetDifficultyResp) MarshalJSON() ([]byte, error)

func (*GetDifficultyResp) UnmarshalJSON

func (alts *GetDifficultyResp) UnmarshalJSON(b []byte) error

type GetIndexInfoReq

type GetIndexInfoReq struct {
	// Filter results for an index with a specific name.
	IndexName string `json:"index_name,omitempty"`
}

GetIndexInfoReq holds the arguments for the GetIndexInfo call.

  1. index_name (string, optional) Filter results for an index with a specific name.

type GetIndexInfoResp

type GetIndexInfoResp struct {
	// The name of the index
	Name struct {
		// Whether the index is synced or not
		Synced bool `json:"synced"`

		// The block height to which the index is synced
		BestBlockHeight float64 `json:"best_block_height"`
	} `json:"name"`
}

GetIndexInfoResp holds the response to the GetIndexInfo call.

{                               (json object)
  "name" : {                    (json object) The name of the index
    "synced" : true|false,      (boolean) Whether the index is synced or not
    "best_block_height" : n     (numeric) The block height to which the index is synced
  }
}

type GetMemoryInfoReq

type GetMemoryInfoReq struct {
	// determines what kind of information is returned.
	// - "stats" returns general statistics about memory usage in the daemon.
	// - "mallocinfo" returns an XML string describing low-level heap state (only available if compiled with glibc 2.10+).
	// Default: "stats"
	Mode string `json:"mode,omitempty"`
}

GetMemoryInfoReq holds the arguments for the GetMemoryInfo call.

  1. mode (string, optional, default="stats") determines what kind of information is returned. - "stats" returns general statistics about memory usage in the daemon. - "mallocinfo" returns an XML string describing low-level heap state (only available if compiled with glibc 2.10+).

type GetMemoryInfoResp

type GetMemoryInfoResp struct {
	ModeStats GetMemoryInfoRespModeStats

	// "<malloc version="1">..."
	Str string
}

GetMemoryInfoResp holds the response to the GetMemoryInfo call.

ALTERNATIVE (mode "stats")

{                         (json object)
  "locked" : {            (json object) Information about locked memory manager
    "used" : n,           (numeric) Number of bytes used
    "free" : n,           (numeric) Number of bytes available in current arenas
    "total" : n,          (numeric) Total number of bytes managed
    "locked" : n,         (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk.
    "chunks_used" : n,    (numeric) Number allocated chunks
    "chunks_free" : n     (numeric) Number unused chunks
  }
}

ALTERNATIVE (mode "mallocinfo")

"str"    (string) "<malloc version="1">..."

func (GetMemoryInfoResp) MarshalJSON

func (alts GetMemoryInfoResp) MarshalJSON() ([]byte, error)

func (*GetMemoryInfoResp) UnmarshalJSON

func (alts *GetMemoryInfoResp) UnmarshalJSON(b []byte) error

type GetMemoryInfoRespModeStats

type GetMemoryInfoRespModeStats struct {
	// Information about locked memory manager
	Locked struct {
		// Number of bytes used
		Used float64 `json:"used"`

		// Number of bytes available in current arenas
		Free float64 `json:"free"`

		// Total number of bytes managed
		Total float64 `json:"total"`

		// Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk.
		Locked float64 `json:"locked"`

		// Number allocated chunks
		ChunksUsed float64 `json:"chunks_used"`

		// Number unused chunks
		ChunksFree float64 `json:"chunks_free"`
	} `json:"locked"`
}

type GetMempoolAncestorsReq

type GetMempoolAncestorsReq struct {
	// The transaction id (must be in mempool)
	TxID string `json:"txid"`

	// True for a json object, false for array of transaction ids
	// Default: false
	Verbose bool `json:"verbose,omitempty"`
}

GetMempoolAncestorsReq holds the arguments for the GetMempoolAncestors call.

  1. txid (string, required) The transaction id (must be in mempool)
  2. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids

type GetMempoolAncestorsResp

type GetMempoolAncestorsResp struct {
	// Element: Hex    The transaction id of an in-mempool ancestor transaction
	Hex []string

	ForVerboseEqualsTrue map[string]GetMempoolAncestorsRespForVerboseEqualsTrueTransactionID
}

GetMempoolAncestorsResp holds the response to the GetMempoolAncestors call.

ALTERNATIVE (for verbose = false)

[           (json array)
  "hex",    (string) The transaction id of an in-mempool ancestor transaction
  ...
]

ALTERNATIVE (for verbose = true)

{                                         (json object)
  "transactionid" : {                     (json object)
    "vsize" : n,                          (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
    "weight" : n,                         (numeric) transaction weight as defined in BIP 141.
    "fee" : n,                            (numeric) transaction fee in BTC (DEPRECATED)
    "modifiedfee" : n,                    (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)
    "time" : xxx,                         (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
    "height" : n,                         (numeric) block height when transaction entered pool
    "descendantcount" : n,                (numeric) number of in-mempool descendant transactions (including this one)
    "descendantsize" : n,                 (numeric) virtual transaction size of in-mempool descendants (including this one)
    "descendantfees" : n,                 (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
    "ancestorcount" : n,                  (numeric) number of in-mempool ancestor transactions (including this one)
    "ancestorsize" : n,                   (numeric) virtual transaction size of in-mempool ancestors (including this one)
    "ancestorfees" : n,                   (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
    "wtxid" : "hex",                      (string) hash of serialized transaction, including witness data
    "fees" : {                            (json object)
      "base" : n,                         (numeric) transaction fee in BTC
      "modified" : n,                     (numeric) transaction fee with fee deltas used for mining priority in BTC
      "ancestor" : n,                     (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC
      "descendant" : n                    (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC
    },
    "depends" : [                         (json array) unconfirmed transactions used as inputs for this transaction
      "hex",                              (string) parent transaction id
      ...
    ],
    "spentby" : [                         (json array) unconfirmed transactions spending outputs from this transaction
      "hex",                              (string) child transaction id
      ...
    ],
    "bip125-replaceable" : true|false,    (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee)
    "unbroadcast" : true|false            (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)
  },
  ...
}

func (GetMempoolAncestorsResp) MarshalJSON

func (alts GetMempoolAncestorsResp) MarshalJSON() ([]byte, error)

func (*GetMempoolAncestorsResp) UnmarshalJSON

func (alts *GetMempoolAncestorsResp) UnmarshalJSON(b []byte) error

type GetMempoolAncestorsRespForVerboseEqualsTrueTransactionID

type GetMempoolAncestorsRespForVerboseEqualsTrueTransactionID struct {
	// virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
	VSize float64 `json:"vsize"`

	// transaction weight as defined in BIP 141.
	Weight float64 `json:"weight"`

	// transaction fee in BTC (DEPRECATED)
	Fee float64 `json:"fee"`

	// transaction fee with fee deltas used for mining priority (DEPRECATED)
	ModifiedFee float64 `json:"modifiedfee"`

	// local time transaction entered pool in seconds since 1 Jan 1970 GMT
	Time float64 `json:"time"`

	// block height when transaction entered pool
	Height float64 `json:"height"`

	// number of in-mempool descendant transactions (including this one)
	DescendantCount float64 `json:"descendantcount"`

	// virtual transaction size of in-mempool descendants (including this one)
	DescendantSize float64 `json:"descendantsize"`

	// modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
	DescendantFees float64 `json:"descendantfees"`

	// number of in-mempool ancestor transactions (including this one)
	AncestorCount float64 `json:"ancestorcount"`

	// virtual transaction size of in-mempool ancestors (including this one)
	AncestorSize float64 `json:"ancestorsize"`

	// modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
	AncestorFees float64 `json:"ancestorfees"`

	// hash of serialized transaction, including witness data
	WTxID string `json:"wtxid"`

	Fees struct {
		// transaction fee in BTC
		Base float64 `json:"base"`

		// transaction fee with fee deltas used for mining priority in BTC
		Modified float64 `json:"modified"`

		// modified fees (see above) of in-mempool ancestors (including this one) in BTC
		Ancestor float64 `json:"ancestor"`

		// modified fees (see above) of in-mempool descendants (including this one) in BTC
		Descendant float64 `json:"descendant"`
	} `json:"fees"`

	// unconfirmed transactions used as inputs for this transaction
	// Element: Hex    parent transaction id
	Depends []string `json:"depends"`

	// unconfirmed transactions spending outputs from this transaction
	// Element: Hex    child transaction id
	SpentBy []string `json:"spentby"`

	// Whether this transaction could be replaced due to BIP125 (replace-by-fee)
	BIP125Replaceable bool `json:"bip125-replaceable"`

	// Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)
	Unbroadcast bool `json:"unbroadcast"`
}

type GetMempoolDescendantsReq

type GetMempoolDescendantsReq struct {
	// The transaction id (must be in mempool)
	TxID string `json:"txid"`

	// True for a json object, false for array of transaction ids
	// Default: false
	Verbose bool `json:"verbose,omitempty"`
}

GetMempoolDescendantsReq holds the arguments for the GetMempoolDescendants call.

  1. txid (string, required) The transaction id (must be in mempool)
  2. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids

type GetMempoolDescendantsResp

type GetMempoolDescendantsResp struct {
	// Element: Hex    The transaction id of an in-mempool descendant transaction
	Hex []string

	ForVerboseEqualsTrue map[string]GetMempoolDescendantsRespForVerboseEqualsTrueTransactionID
}

GetMempoolDescendantsResp holds the response to the GetMempoolDescendants call.

ALTERNATIVE (for verbose = false)

[           (json array)
  "hex",    (string) The transaction id of an in-mempool descendant transaction
  ...
]

ALTERNATIVE (for verbose = true)

{                                         (json object)
  "transactionid" : {                     (json object)
    "vsize" : n,                          (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
    "weight" : n,                         (numeric) transaction weight as defined in BIP 141.
    "fee" : n,                            (numeric) transaction fee in BTC (DEPRECATED)
    "modifiedfee" : n,                    (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)
    "time" : xxx,                         (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
    "height" : n,                         (numeric) block height when transaction entered pool
    "descendantcount" : n,                (numeric) number of in-mempool descendant transactions (including this one)
    "descendantsize" : n,                 (numeric) virtual transaction size of in-mempool descendants (including this one)
    "descendantfees" : n,                 (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
    "ancestorcount" : n,                  (numeric) number of in-mempool ancestor transactions (including this one)
    "ancestorsize" : n,                   (numeric) virtual transaction size of in-mempool ancestors (including this one)
    "ancestorfees" : n,                   (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
    "wtxid" : "hex",                      (string) hash of serialized transaction, including witness data
    "fees" : {                            (json object)
      "base" : n,                         (numeric) transaction fee in BTC
      "modified" : n,                     (numeric) transaction fee with fee deltas used for mining priority in BTC
      "ancestor" : n,                     (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC
      "descendant" : n                    (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC
    },
    "depends" : [                         (json array) unconfirmed transactions used as inputs for this transaction
      "hex",                              (string) parent transaction id
      ...
    ],
    "spentby" : [                         (json array) unconfirmed transactions spending outputs from this transaction
      "hex",                              (string) child transaction id
      ...
    ],
    "bip125-replaceable" : true|false,    (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee)
    "unbroadcast" : true|false            (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)
  },
  ...
}

func (GetMempoolDescendantsResp) MarshalJSON

func (alts GetMempoolDescendantsResp) MarshalJSON() ([]byte, error)

func (*GetMempoolDescendantsResp) UnmarshalJSON

func (alts *GetMempoolDescendantsResp) UnmarshalJSON(b []byte) error

type GetMempoolDescendantsRespForVerboseEqualsTrueTransactionID

type GetMempoolDescendantsRespForVerboseEqualsTrueTransactionID struct {
	// virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
	VSize float64 `json:"vsize"`

	// transaction weight as defined in BIP 141.
	Weight float64 `json:"weight"`

	// transaction fee in BTC (DEPRECATED)
	Fee float64 `json:"fee"`

	// transaction fee with fee deltas used for mining priority (DEPRECATED)
	ModifiedFee float64 `json:"modifiedfee"`

	// local time transaction entered pool in seconds since 1 Jan 1970 GMT
	Time float64 `json:"time"`

	// block height when transaction entered pool
	Height float64 `json:"height"`

	// number of in-mempool descendant transactions (including this one)
	DescendantCount float64 `json:"descendantcount"`

	// virtual transaction size of in-mempool descendants (including this one)
	DescendantSize float64 `json:"descendantsize"`

	// modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
	DescendantFees float64 `json:"descendantfees"`

	// number of in-mempool ancestor transactions (including this one)
	AncestorCount float64 `json:"ancestorcount"`

	// virtual transaction size of in-mempool ancestors (including this one)
	AncestorSize float64 `json:"ancestorsize"`

	// modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
	AncestorFees float64 `json:"ancestorfees"`

	// hash of serialized transaction, including witness data
	WTxID string `json:"wtxid"`

	Fees struct {
		// transaction fee in BTC
		Base float64 `json:"base"`

		// transaction fee with fee deltas used for mining priority in BTC
		Modified float64 `json:"modified"`

		// modified fees (see above) of in-mempool ancestors (including this one) in BTC
		Ancestor float64 `json:"ancestor"`

		// modified fees (see above) of in-mempool descendants (including this one) in BTC
		Descendant float64 `json:"descendant"`
	} `json:"fees"`

	// unconfirmed transactions used as inputs for this transaction
	// Element: Hex    parent transaction id
	Depends []string `json:"depends"`

	// unconfirmed transactions spending outputs from this transaction
	// Element: Hex    child transaction id
	SpentBy []string `json:"spentby"`

	// Whether this transaction could be replaced due to BIP125 (replace-by-fee)
	BIP125Replaceable bool `json:"bip125-replaceable"`

	// Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)
	Unbroadcast bool `json:"unbroadcast"`
}

type GetMempoolEntryReq

type GetMempoolEntryReq struct {
	// The transaction id (must be in mempool)
	TxID string `json:"txid"`
}

GetMempoolEntryReq holds the arguments for the GetMempoolEntry call.

  1. txid (string, required) The transaction id (must be in mempool)

type GetMempoolEntryResp

type GetMempoolEntryResp struct {
	// virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
	VSize float64 `json:"vsize"`

	// transaction weight as defined in BIP 141.
	Weight float64 `json:"weight"`

	// transaction fee in BTC (DEPRECATED)
	Fee float64 `json:"fee"`

	// transaction fee with fee deltas used for mining priority (DEPRECATED)
	ModifiedFee float64 `json:"modifiedfee"`

	// local time transaction entered pool in seconds since 1 Jan 1970 GMT
	Time float64 `json:"time"`

	// block height when transaction entered pool
	Height float64 `json:"height"`

	// number of in-mempool descendant transactions (including this one)
	DescendantCount float64 `json:"descendantcount"`

	// virtual transaction size of in-mempool descendants (including this one)
	DescendantSize float64 `json:"descendantsize"`

	// modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
	DescendantFees float64 `json:"descendantfees"`

	// number of in-mempool ancestor transactions (including this one)
	AncestorCount float64 `json:"ancestorcount"`

	// virtual transaction size of in-mempool ancestors (including this one)
	AncestorSize float64 `json:"ancestorsize"`

	// modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
	AncestorFees float64 `json:"ancestorfees"`

	// hash of serialized transaction, including witness data
	WTxID string `json:"wtxid"`

	Fees struct {
		// transaction fee in BTC
		Base float64 `json:"base"`

		// transaction fee with fee deltas used for mining priority in BTC
		Modified float64 `json:"modified"`

		// modified fees (see above) of in-mempool ancestors (including this one) in BTC
		Ancestor float64 `json:"ancestor"`

		// modified fees (see above) of in-mempool descendants (including this one) in BTC
		Descendant float64 `json:"descendant"`
	} `json:"fees"`

	// unconfirmed transactions used as inputs for this transaction
	// Element: Hex    parent transaction id
	Depends []string `json:"depends"`

	// unconfirmed transactions spending outputs from this transaction
	// Element: Hex    child transaction id
	SpentBy []string `json:"spentby"`

	// Whether this transaction could be replaced due to BIP125 (replace-by-fee)
	BIP125Replaceable bool `json:"bip125-replaceable"`

	// Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)
	Unbroadcast bool `json:"unbroadcast"`
}

GetMempoolEntryResp holds the response to the GetMempoolEntry call.

{                                       (json object)
  "vsize" : n,                          (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
  "weight" : n,                         (numeric) transaction weight as defined in BIP 141.
  "fee" : n,                            (numeric) transaction fee in BTC (DEPRECATED)
  "modifiedfee" : n,                    (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)
  "time" : xxx,                         (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
  "height" : n,                         (numeric) block height when transaction entered pool
  "descendantcount" : n,                (numeric) number of in-mempool descendant transactions (including this one)
  "descendantsize" : n,                 (numeric) virtual transaction size of in-mempool descendants (including this one)
  "descendantfees" : n,                 (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
  "ancestorcount" : n,                  (numeric) number of in-mempool ancestor transactions (including this one)
  "ancestorsize" : n,                   (numeric) virtual transaction size of in-mempool ancestors (including this one)
  "ancestorfees" : n,                   (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
  "wtxid" : "hex",                      (string) hash of serialized transaction, including witness data
  "fees" : {                            (json object)
    "base" : n,                         (numeric) transaction fee in BTC
    "modified" : n,                     (numeric) transaction fee with fee deltas used for mining priority in BTC
    "ancestor" : n,                     (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC
    "descendant" : n                    (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC
  },
  "depends" : [                         (json array) unconfirmed transactions used as inputs for this transaction
    "hex",                              (string) parent transaction id
    ...
  ],
  "spentby" : [                         (json array) unconfirmed transactions spending outputs from this transaction
    "hex",                              (string) child transaction id
    ...
  ],
  "bip125-replaceable" : true|false,    (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee)
  "unbroadcast" : true|false            (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)
}

type GetMempoolInfoResp

type GetMempoolInfoResp struct {
	// True if the mempool is fully loaded
	Loaded bool `json:"loaded"`

	// Current tx count
	Size float64 `json:"size"`

	// Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted
	Bytes float64 `json:"bytes"`

	// Total memory usage for the mempool
	Usage float64 `json:"usage"`

	// Total fees for the mempool in BTC, ignoring modified fees through prioritizetransaction
	TotalFee float64 `json:"total_fee"`

	// Maximum memory usage for the mempool
	MaxMempool float64 `json:"maxmempool"`

	// Minimum fee rate in BTC/kvB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee
	MempoolMinFee float64 `json:"mempoolminfee"`

	// Current minimum relay fee for transactions
	MinRelayTxFee float64 `json:"minrelaytxfee"`

	// Current number of transactions that haven't passed initial broadcast yet
	UnbroadcastCount float64 `json:"unbroadcastcount"`
}

GetMempoolInfoResp holds the response to the GetMempoolInfo call.

{                            (json object)
  "loaded" : true|false,     (boolean) True if the mempool is fully loaded
  "size" : n,                (numeric) Current tx count
  "bytes" : n,               (numeric) Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted
  "usage" : n,               (numeric) Total memory usage for the mempool
  "total_fee" : n,           (numeric) Total fees for the mempool in BTC, ignoring modified fees through prioritizetransaction
  "maxmempool" : n,          (numeric) Maximum memory usage for the mempool
  "mempoolminfee" : n,       (numeric) Minimum fee rate in BTC/kvB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee
  "minrelaytxfee" : n,       (numeric) Current minimum relay fee for transactions
  "unbroadcastcount" : n     (numeric) Current number of transactions that haven't passed initial broadcast yet
}

type GetMiningInfoResp

type GetMiningInfoResp struct {
	// The current block
	Blocks float64 `json:"blocks"`

	// The block weight of the last assembled block (only present if a block was ever assembled)
	CurrentBlockWeight *float64 `json:"currentblockweight,omitempty"`

	// The number of block transactions of the last assembled block (only present if a block was ever assembled)
	CurrentBlockTx *float64 `json:"currentblocktx,omitempty"`

	// The current difficulty
	Difficulty float64 `json:"difficulty"`

	// The network hashes per second
	NetworkHashPs float64 `json:"networkhashps"`

	// The size of the mempool
	PooledTx float64 `json:"pooledtx"`

	// current network name (main, test, signet, regtest)
	Chain string `json:"chain"`

	// any network and blockchain warnings
	Warnings string `json:"warnings"`
}

GetMiningInfoResp holds the response to the GetMiningInfo call.

{                              (json object)
  "blocks" : n,                (numeric) The current block
  "currentblockweight" : n,    (numeric, optional) The block weight of the last assembled block (only present if a block was ever assembled)
  "currentblocktx" : n,        (numeric, optional) The number of block transactions of the last assembled block (only present if a block was ever assembled)
  "difficulty" : n,            (numeric) The current difficulty
  "networkhashps" : n,         (numeric) The network hashes per second
  "pooledtx" : n,              (numeric) The size of the mempool
  "chain" : "str",             (string) current network name (main, test, signet, regtest)
  "warnings" : "str"           (string) any network and blockchain warnings
}

type GetNetTotalsResp

type GetNetTotalsResp struct {
	// Total bytes received
	TotalBytesRecv float64 `json:"totalbytesrecv"`

	// Total bytes sent
	TotalBytesSent float64 `json:"totalbytessent"`

	// Current UNIX epoch time in milliseconds
	TimeMillis float64 `json:"timemillis"`

	UploadTarget struct {
		// Length of the measuring timeframe in seconds
		TimeFrame float64 `json:"timeframe"`

		// Target in bytes
		Target float64 `json:"target"`

		// True if target is reached
		TargetReached bool `json:"target_reached"`

		// True if serving historical blocks
		ServeHistoricalBlocks bool `json:"serve_historical_blocks"`

		// Bytes left in current time cycle
		BytesLeftInCycle float64 `json:"bytes_left_in_cycle"`

		// Seconds left in current time cycle
		TimeLeftInCycle float64 `json:"time_left_in_cycle"`
	} `json:"uploadtarget"`
}

GetNetTotalsResp holds the response to the GetNetTotals call.

{                                              (json object)
  "totalbytesrecv" : n,                        (numeric) Total bytes received
  "totalbytessent" : n,                        (numeric) Total bytes sent
  "timemillis" : xxx,                          (numeric) Current UNIX epoch time in milliseconds
  "uploadtarget" : {                           (json object)
    "timeframe" : n,                           (numeric) Length of the measuring timeframe in seconds
    "target" : n,                              (numeric) Target in bytes
    "target_reached" : true|false,             (boolean) True if target is reached
    "serve_historical_blocks" : true|false,    (boolean) True if serving historical blocks
    "bytes_left_in_cycle" : n,                 (numeric) Bytes left in current time cycle
    "time_left_in_cycle" : n                   (numeric) Seconds left in current time cycle
  }
}

type GetNetworkHashPsReq

type GetNetworkHashPsReq struct {
	// The number of blocks, or -1 for blocks since last difficulty change.
	// Default: 120
	NBlocks *float64 `json:"nblocks,omitempty"`

	// To estimate at the time of the given height.
	// Default: -1
	Height *float64 `json:"height,omitempty"`
}

GetNetworkHashPsReq holds the arguments for the GetNetworkHashPs call.

  1. nblocks (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change.
  2. height (numeric, optional, default=-1) To estimate at the time of the given height.

type GetNetworkHashPsResp

type GetNetworkHashPsResp struct {
	// Hashes per second estimated
	N float64
}

GetNetworkHashPsResp holds the response to the GetNetworkHashPs call.

n    (numeric) Hashes per second estimated

func (GetNetworkHashPsResp) MarshalJSON

func (alts GetNetworkHashPsResp) MarshalJSON() ([]byte, error)

func (*GetNetworkHashPsResp) UnmarshalJSON

func (alts *GetNetworkHashPsResp) UnmarshalJSON(b []byte) error

type GetNetworkInfoResp

type GetNetworkInfoResp struct {
	// the server version
	Version float64 `json:"version"`

	// the server subversion string
	SubVersion string `json:"subversion"`

	// the protocol version
	ProtocolVersion float64 `json:"protocolversion"`

	// the services we offer to the network
	LocalServices string `json:"localservices"`

	// the services we offer to the network, in human-readable form
	// Element: Str    the service name
	LocalServicesNames []string `json:"localservicesnames"`

	// true if transaction relay is requested from peers
	LocalRelay bool `json:"localrelay"`

	// the time offset
	TimeOffset float64 `json:"timeoffset"`

	// the total number of connections
	Connections float64 `json:"connections"`

	// the number of inbound connections
	ConnectionsIn float64 `json:"connections_in"`

	// the number of outbound connections
	ConnectionsOut float64 `json:"connections_out"`

	// whether p2p networking is enabled
	NetworkActive bool `json:"networkactive"`

	// information per network
	Networks []GetNetworkInfoRespNetworks `json:"networks"`

	// minimum relay fee rate for transactions in BTC/kvB
	RelayFee float64 `json:"relayfee"`

	// minimum fee rate increment for mempool limiting or BIP 125 replacement in BTC/kvB
	IncrementalFee float64 `json:"incrementalfee"`

	// list of local addresses
	LocalAddresses []GetNetworkInfoRespLocalAddresses `json:"localaddresses"`

	// any network and blockchain warnings
	Warnings string `json:"warnings"`
}

GetNetworkInfoResp holds the response to the GetNetworkInfo call.

{                                                    (json object)
  "version" : n,                                     (numeric) the server version
  "subversion" : "str",                              (string) the server subversion string
  "protocolversion" : n,                             (numeric) the protocol version
  "localservices" : "hex",                           (string) the services we offer to the network
  "localservicesnames" : [                           (json array) the services we offer to the network, in human-readable form
    "str",                                           (string) the service name
    ...
  ],
  "localrelay" : true|false,                         (boolean) true if transaction relay is requested from peers
  "timeoffset" : n,                                  (numeric) the time offset
  "connections" : n,                                 (numeric) the total number of connections
  "connections_in" : n,                              (numeric) the number of inbound connections
  "connections_out" : n,                             (numeric) the number of outbound connections
  "networkactive" : true|false,                      (boolean) whether p2p networking is enabled
  "networks" : [                                     (json array) information per network
    {                                                (json object)
      "name" : "str",                                (string) network (ipv4, ipv6, onion, i2p)
      "limited" : true|false,                        (boolean) is the network limited using -onlynet?
      "reachable" : true|false,                      (boolean) is the network reachable?
      "proxy" : "str",                               (string) ("host:port") the proxy that is used for this network, or empty if none
      "proxy_randomize_credentials" : true|false     (boolean) Whether randomized credentials are used
    },
    ...
  ],
  "relayfee" : n,                                    (numeric) minimum relay fee rate for transactions in BTC/kvB
  "incrementalfee" : n,                              (numeric) minimum fee rate increment for mempool limiting or BIP 125 replacement in BTC/kvB
  "localaddresses" : [                               (json array) list of local addresses
    {                                                (json object)
      "address" : "str",                             (string) network address
      "port" : n,                                    (numeric) network port
      "score" : n                                    (numeric) relative score
    },
    ...
  ],
  "warnings" : "str"                                 (string) any network and blockchain warnings
}

type GetNetworkInfoRespLocalAddresses

type GetNetworkInfoRespLocalAddresses struct {
	// network address
	Address string `json:"address"`

	// network port
	Port float64 `json:"port"`

	// relative score
	Score float64 `json:"score"`
}

type GetNetworkInfoRespNetworks

type GetNetworkInfoRespNetworks struct {
	// network (ipv4, ipv6, onion, i2p)
	Name string `json:"name"`

	// is the network limited using -onlynet?
	Limited bool `json:"limited"`

	// is the network reachable?
	Reachable bool `json:"reachable"`

	// ("host:port") the proxy that is used for this network, or empty if none
	Proxy string `json:"proxy"`

	// Whether randomized credentials are used
	ProxyRandomizeCredentials bool `json:"proxy_randomize_credentials"`
}

type GetNewAddressReq

type GetNewAddressReq struct {
	// The label name for the address to be linked to. It can also be set to the empty string "" to represent the default label. The label does not need to exist, it will be created if there is no label by the given name.
	// Default: ""
	Label string `json:"label,omitempty"`

	// The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".
	// Default: set by -addresstype
	AddressType string `json:"address_type,omitempty"`
}

GetNewAddressReq holds the arguments for the GetNewAddress call.

  1. label (string, optional, default="") The label name for the address to be linked to. It can also be set to the empty string "" to represent the default label. The label does not need to exist, it will be created if there is no label by the given name.
  2. address_type (string, optional, default=set by -addresstype) The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".

type GetNewAddressResp

type GetNewAddressResp struct {
	// The new bitcoin address
	Str string
}

GetNewAddressResp holds the response to the GetNewAddress call.

"str"    (string) The new bitcoin address

func (GetNewAddressResp) MarshalJSON

func (alts GetNewAddressResp) MarshalJSON() ([]byte, error)

func (*GetNewAddressResp) UnmarshalJSON

func (alts *GetNewAddressResp) UnmarshalJSON(b []byte) error

type GetNodeAddressesReq

type GetNodeAddressesReq struct {
	// The maximum number of addresses to return. Specify 0 to return all known addresses.
	// Default: 1
	Count *float64 `json:"count,omitempty"`

	// Return only addresses of the specified network. Can be one of: ipv4, ipv6, onion, i2p.
	// Default: all networks
	Network string `json:"network,omitempty"`
}

GetNodeAddressesReq holds the arguments for the GetNodeAddresses call.

  1. count (numeric, optional, default=1) The maximum number of addresses to return. Specify 0 to return all known addresses.
  2. network (string, optional, default=all networks) Return only addresses of the specified network. Can be one of: ipv4, ipv6, onion, i2p.

type GetNodeAddressesResp

type GetNodeAddressesResp struct {
	Array []GetNodeAddressesRespElement
}

GetNodeAddressesResp holds the response to the GetNodeAddresses call.

[                         (json array)
  {                       (json object)
    "time" : xxx,         (numeric) The UNIX epoch time when the node was last seen
    "services" : n,       (numeric) The services offered by the node
    "address" : "str",    (string) The address of the node
    "port" : n,           (numeric) The port number of the node
    "network" : "str"     (string) The network (ipv4, ipv6, onion, i2p) the node connected through
  },
  ...
]

func (GetNodeAddressesResp) MarshalJSON

func (alts GetNodeAddressesResp) MarshalJSON() ([]byte, error)

func (*GetNodeAddressesResp) UnmarshalJSON

func (alts *GetNodeAddressesResp) UnmarshalJSON(b []byte) error

type GetNodeAddressesRespElement

type GetNodeAddressesRespElement struct {
	// The UNIX epoch time when the node was last seen
	Time float64 `json:"time"`

	// The services offered by the node
	Services float64 `json:"services"`

	// The address of the node
	Address string `json:"address"`

	// The port number of the node
	Port float64 `json:"port"`

	// The network (ipv4, ipv6, onion, i2p) the node connected through
	Network string `json:"network"`
}

type GetPeerInfoResp

type GetPeerInfoResp struct {
	Array []GetPeerInfoRespElement
}

GetPeerInfoResp holds the response to the GetPeerInfo call.

[                                     (json array)
  {                                   (json object)
    "id" : n,                         (numeric) Peer index
    "addr" : "str",                   (string) (host:port) The IP address and port of the peer
    "addrbind" : "str",               (string) (ip:port) Bind address of the connection to the peer
    "addrlocal" : "str",              (string) (ip:port) Local address as reported by the peer
    "network" : "str",                (string) Network (ipv4, ipv6, onion, i2p, not_publicly_routable)
    "mapped_as" : n,                  (numeric) The AS in the BGP route to the peer used for diversifying
                                      peer selection (only available if the asmap config flag is set)
    "services" : "hex",               (string) The services offered
    "servicesnames" : [               (json array) the services offered, in human-readable form
      "str",                          (string) the service name if it is recognised
      ...
    ],
    "relaytxes" : true|false,         (boolean) Whether peer has asked us to relay transactions to it
    "lastsend" : xxx,                 (numeric) The UNIX epoch time of the last send
    "lastrecv" : xxx,                 (numeric) The UNIX epoch time of the last receive
    "last_transaction" : xxx,         (numeric) The UNIX epoch time of the last valid transaction received from this peer
    "last_block" : xxx,               (numeric) The UNIX epoch time of the last block received from this peer
    "bytessent" : n,                  (numeric) The total bytes sent
    "bytesrecv" : n,                  (numeric) The total bytes received
    "conntime" : xxx,                 (numeric) The UNIX epoch time of the connection
    "timeoffset" : n,                 (numeric) The time offset in seconds
    "pingtime" : n,                   (numeric) ping time (if available)
    "minping" : n,                    (numeric) minimum observed ping time (if any at all)
    "pingwait" : n,                   (numeric) ping wait (if non-zero)
    "version" : n,                    (numeric) The peer version, such as 70001
    "subver" : "str",                 (string) The string version
    "inbound" : true|false,           (boolean) Inbound (true) or Outbound (false)
    "bip152_hb_to" : true|false,      (boolean) Whether we selected peer as (compact blocks) high-bandwidth peer
    "bip152_hb_from" : true|false,    (boolean) Whether peer selected us as (compact blocks) high-bandwidth peer
    "startingheight" : n,             (numeric) The starting height (block) of the peer
    "synced_headers" : n,             (numeric) The last header we have in common with this peer
    "synced_blocks" : n,              (numeric) The last block we have in common with this peer
    "inflight" : [                    (json array)
      n,                              (numeric) The heights of blocks we're currently asking from this peer
      ...
    ],
    "permissions" : [                 (json array) Any special permissions that have been granted to this peer
      "str",                          (string) bloomfilter (allow requesting BIP37 filtered blocks and transactions),
                                      noban (do not ban for misbehavior; implies download),
                                      forcerelay (relay transactions that are already in the mempool; implies relay),
                                      relay (relay even in -blocksonly mode, and unlimited transaction announcements),
                                      mempool (allow requesting BIP35 mempool contents),
                                      download (allow getheaders during IBD, no disconnect after maxuploadtarget limit),
                                      addr (responses to GETADDR avoid hitting the cache and contain random records with the most up-to-date info).

func (GetPeerInfoResp) MarshalJSON

func (alts GetPeerInfoResp) MarshalJSON() ([]byte, error)

func (*GetPeerInfoResp) UnmarshalJSON

func (alts *GetPeerInfoResp) UnmarshalJSON(b []byte) error

type GetPeerInfoRespElement

type GetPeerInfoRespElement struct {
	// Peer index
	ID float64 `json:"id"`

	// (host:port) The IP address and port of the peer
	Addr string `json:"addr"`

	// (ip:port) Bind address of the connection to the peer
	AddrBind string `json:"addrbind"`

	// (ip:port) Local address as reported by the peer
	AddrLocal string `json:"addrlocal"`

	// Network (ipv4, ipv6, onion, i2p, not_publicly_routable)
	Network string `json:"network"`

	// The AS in the BGP route to the peer used for diversifying
	// peer selection (only available if the asmap config flag is set)
	MappedAs float64 `json:"mapped_as"`

	// The services offered
	Services string `json:"services"`

	// the services offered, in human-readable form
	// Element: Str    the service name if it is recognised
	ServicesNames []string `json:"servicesnames"`

	// Whether peer has asked us to relay transactions to it
	RelayTxes bool `json:"relaytxes"`

	// The UNIX epoch time of the last send
	LastSend float64 `json:"lastsend"`

	// The UNIX epoch time of the last receive
	LastRecv float64 `json:"lastrecv"`

	// The UNIX epoch time of the last valid transaction received from this peer
	LastTransaction float64 `json:"last_transaction"`

	// The UNIX epoch time of the last block received from this peer
	LastBlock float64 `json:"last_block"`

	// The total bytes sent
	BytesSent float64 `json:"bytessent"`

	// The total bytes received
	BytesRecv float64 `json:"bytesrecv"`

	// The UNIX epoch time of the connection
	ConnTime float64 `json:"conntime"`

	// The time offset in seconds
	TimeOffset float64 `json:"timeoffset"`

	// ping time (if available)
	PingTime float64 `json:"pingtime"`

	// minimum observed ping time (if any at all)
	MinPing float64 `json:"minping"`

	// ping wait (if non-zero)
	PingWait float64 `json:"pingwait"`

	// The peer version, such as 70001
	Version float64 `json:"version"`

	// The string version
	SubVer string `json:"subver"`

	// Inbound (true) or Outbound (false)
	Inbound bool `json:"inbound"`

	// Whether we selected peer as (compact blocks) high-bandwidth peer
	BIP152HbTo bool `json:"bip152_hb_to"`

	// Whether peer selected us as (compact blocks) high-bandwidth peer
	BIP152HbFrom bool `json:"bip152_hb_from"`

	// The starting height (block) of the peer
	StartingHeight float64 `json:"startingheight"`

	// The last header we have in common with this peer
	SyncedHeaders float64 `json:"synced_headers"`

	// The last block we have in common with this peer
	SyncedBlocks float64 `json:"synced_blocks"`

	// Element: N    The heights of blocks we're currently asking from this peer
	InFlight []float64 `json:"inflight"`

	// Any special permissions that have been granted to this peer
	// Element: Str    bloomfilter (allow requesting BIP37 filtered blocks and transactions),
	// noban (do not ban for misbehavior; implies download),
	// forcerelay (relay transactions that are already in the mempool; implies relay),
	// relay (relay even in -blocksonly mode, and unlimited transaction announcements),
	// mempool (allow requesting BIP35 mempool contents),
	// download (allow getheaders during IBD, no disconnect after maxuploadtarget limit),
	// addr (responses to GETADDR avoid hitting the cache and contain random records with the most up-to-date info).
	Permissions []string `json:"permissions"`
}

type GetRawChangeaddressReq

type GetRawChangeaddressReq struct {
	// The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".
	// Default: set by -changetype
	AddressType string `json:"address_type,omitempty"`
}

GetRawChangeaddressReq holds the arguments for the GetRawChangeaddress call.

  1. address_type (string, optional, default=set by -changetype) The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".

type GetRawChangeaddressResp

type GetRawChangeaddressResp struct {
	// The address
	Str string
}

GetRawChangeaddressResp holds the response to the GetRawChangeaddress call.

"str"    (string) The address

func (GetRawChangeaddressResp) MarshalJSON

func (alts GetRawChangeaddressResp) MarshalJSON() ([]byte, error)

func (*GetRawChangeaddressResp) UnmarshalJSON

func (alts *GetRawChangeaddressResp) UnmarshalJSON(b []byte) error

type GetRawMempoolReq

type GetRawMempoolReq struct {
	// True for a json object, false for array of transaction ids
	// Default: false
	Verbose bool `json:"verbose,omitempty"`

	// If verbose=false, returns a json object with transaction list and mempool sequence number attached.
	// Default: false
	MempoolSequence bool `json:"mempool_sequence,omitempty"`
}

GetRawMempoolReq holds the arguments for the GetRawMempool call.

  1. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids
  2. mempool_sequence (boolean, optional, default=false) If verbose=false, returns a json object with transaction list and mempool sequence number attached.

type GetRawMempoolResp

type GetRawMempoolResp struct {
	// Element: Hex    The transaction id
	Hex []string

	ForVerboseEqualsTrue map[string]GetRawMempoolRespForVerboseEqualsTrueTransactionID

	ForVerboseEqualsFalseAndMempoolSequenceEqualsTrue GetRawMempoolRespForVerboseEqualsFalseAndMempoolSequenceEqualsTrue
}

GetRawMempoolResp holds the response to the GetRawMempool call.

ALTERNATIVE (for verbose = false)

[           (json array)
  "hex",    (string) The transaction id
  ...
]

ALTERNATIVE (for verbose = true)

{                                         (json object)
  "transactionid" : {                     (json object)
    "vsize" : n,                          (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
    "weight" : n,                         (numeric) transaction weight as defined in BIP 141.
    "fee" : n,                            (numeric) transaction fee in BTC (DEPRECATED)
    "modifiedfee" : n,                    (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)
    "time" : xxx,                         (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
    "height" : n,                         (numeric) block height when transaction entered pool
    "descendantcount" : n,                (numeric) number of in-mempool descendant transactions (including this one)
    "descendantsize" : n,                 (numeric) virtual transaction size of in-mempool descendants (including this one)
    "descendantfees" : n,                 (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
    "ancestorcount" : n,                  (numeric) number of in-mempool ancestor transactions (including this one)
    "ancestorsize" : n,                   (numeric) virtual transaction size of in-mempool ancestors (including this one)
    "ancestorfees" : n,                   (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
    "wtxid" : "hex",                      (string) hash of serialized transaction, including witness data
    "fees" : {                            (json object)
      "base" : n,                         (numeric) transaction fee in BTC
      "modified" : n,                     (numeric) transaction fee with fee deltas used for mining priority in BTC
      "ancestor" : n,                     (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC
      "descendant" : n                    (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC
    },
    "depends" : [                         (json array) unconfirmed transactions used as inputs for this transaction
      "hex",                              (string) parent transaction id
      ...
    ],
    "spentby" : [                         (json array) unconfirmed transactions spending outputs from this transaction
      "hex",                              (string) child transaction id
      ...
    ],
    "bip125-replaceable" : true|false,    (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee)
    "unbroadcast" : true|false            (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)
  },
  ...
}

ALTERNATIVE (for verbose = false and mempool_sequence = true)

{                            (json object)
  "txids" : [                (json array)
    "hex",                   (string) The transaction id
    ...
  ],
  "mempool_sequence" : n     (numeric) The mempool sequence value.
}

func (GetRawMempoolResp) MarshalJSON

func (alts GetRawMempoolResp) MarshalJSON() ([]byte, error)

func (*GetRawMempoolResp) UnmarshalJSON

func (alts *GetRawMempoolResp) UnmarshalJSON(b []byte) error

type GetRawMempoolRespForVerboseEqualsFalseAndMempoolSequenceEqualsTrue

type GetRawMempoolRespForVerboseEqualsFalseAndMempoolSequenceEqualsTrue struct {
	// Element: Hex    The transaction id
	TxIDs []string `json:"txids"`

	// The mempool sequence value.
	MempoolSequence float64 `json:"mempool_sequence"`
}

type GetRawMempoolRespForVerboseEqualsTrueTransactionID

type GetRawMempoolRespForVerboseEqualsTrueTransactionID struct {
	// virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
	VSize float64 `json:"vsize"`

	// transaction weight as defined in BIP 141.
	Weight float64 `json:"weight"`

	// transaction fee in BTC (DEPRECATED)
	Fee float64 `json:"fee"`

	// transaction fee with fee deltas used for mining priority (DEPRECATED)
	ModifiedFee float64 `json:"modifiedfee"`

	// local time transaction entered pool in seconds since 1 Jan 1970 GMT
	Time float64 `json:"time"`

	// block height when transaction entered pool
	Height float64 `json:"height"`

	// number of in-mempool descendant transactions (including this one)
	DescendantCount float64 `json:"descendantcount"`

	// virtual transaction size of in-mempool descendants (including this one)
	DescendantSize float64 `json:"descendantsize"`

	// modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)
	DescendantFees float64 `json:"descendantfees"`

	// number of in-mempool ancestor transactions (including this one)
	AncestorCount float64 `json:"ancestorcount"`

	// virtual transaction size of in-mempool ancestors (including this one)
	AncestorSize float64 `json:"ancestorsize"`

	// modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)
	AncestorFees float64 `json:"ancestorfees"`

	// hash of serialized transaction, including witness data
	WTxID string `json:"wtxid"`

	Fees struct {
		// transaction fee in BTC
		Base float64 `json:"base"`

		// transaction fee with fee deltas used for mining priority in BTC
		Modified float64 `json:"modified"`

		// modified fees (see above) of in-mempool ancestors (including this one) in BTC
		Ancestor float64 `json:"ancestor"`

		// modified fees (see above) of in-mempool descendants (including this one) in BTC
		Descendant float64 `json:"descendant"`
	} `json:"fees"`

	// unconfirmed transactions used as inputs for this transaction
	// Element: Hex    parent transaction id
	Depends []string `json:"depends"`

	// unconfirmed transactions spending outputs from this transaction
	// Element: Hex    child transaction id
	SpentBy []string `json:"spentby"`

	// Whether this transaction could be replaced due to BIP125 (replace-by-fee)
	BIP125Replaceable bool `json:"bip125-replaceable"`

	// Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)
	Unbroadcast bool `json:"unbroadcast"`
}

type GetRawTransactionReq

type GetRawTransactionReq struct {
	// The transaction id
	TxID string `json:"txid"`

	// If false, return a string, otherwise return a json object
	// Default: false
	Verbose bool `json:"verbose,omitempty"`

	// The block in which to look for the transaction
	Blockhash string `json:"blockhash,omitempty"`
}

GetRawTransactionReq holds the arguments for the GetRawTransaction call.

  1. txid (string, required) The transaction id
  2. verbose (boolean, optional, default=false) If false, return a string, otherwise return a json object
  3. blockhash (string, optional) The block in which to look for the transaction

type GetRawTransactionResp

type GetRawTransactionResp struct {
	// The serialized, hex-encoded data for 'txid'
	Str string

	IfVerboseIsSetToTrue GetRawTransactionRespIfVerboseIsSetToTrue
}

GetRawTransactionResp holds the response to the GetRawTransaction call.

ALTERNATIVE (if verbose is not set or set to false)

"str"    (string) The serialized, hex-encoded data for 'txid'

ALTERNATIVE (if verbose is set to true)

{                                    (json object)
  "in_active_chain" : true|false,    (boolean) Whether specified block is in the active chain or not (only present with explicit "blockhash" argument)
  "hex" : "hex",                     (string) The serialized, hex-encoded data for 'txid'
  "txid" : "hex",                    (string) The transaction id (same as provided)
  "hash" : "hex",                    (string) The transaction hash (differs from txid for witness transactions)
  "size" : n,                        (numeric) The serialized transaction size
  "vsize" : n,                       (numeric) The virtual transaction size (differs from size for witness transactions)
  "weight" : n,                      (numeric) The transaction's weight (between vsize*4-3 and vsize*4)
  "version" : n,                     (numeric) The version
  "locktime" : xxx,                  (numeric) The lock time
  "vin" : [                          (json array)
    {                                (json object)
      "txid" : "hex",                (string) The transaction id
      "vout" : n,                    (numeric) The output number
      "scriptSig" : {                (json object) The script
        "asm" : "str",               (string) asm
        "hex" : "hex"                (string) hex
      },
      "sequence" : n,                (numeric) The script sequence number
      "txinwitness" : [              (json array)
        "hex",                       (string) hex-encoded witness data (if any)
        ...
      ]
    },
    ...
  ],
  "vout" : [                         (json array)
    {                                (json object)
      "value" : n,                   (numeric) The value in BTC
      "n" : n,                       (numeric) index
      "scriptPubKey" : {             (json object)
        "asm" : "str",               (string) the asm
        "hex" : "str",               (string) the hex
        "reqSigs" : n,               (numeric, optional) (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Number of required signatures
        "type" : "str",              (string) The type, eg 'pubkeyhash'
        "address" : "str",           (string, optional) bitcoin address (only if a well-defined address exists)
        "addresses" : [              (json array, optional) (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Array of bitcoin addresses
          "str",                     (string) bitcoin address
          ...
        ]
      }
    },
    ...
  ],
  "blockhash" : "hex",               (string) the block hash
  "confirmations" : n,               (numeric) The confirmations
  "blocktime" : xxx,                 (numeric) The block time expressed in UNIX epoch time
  "time" : n                         (numeric) Same as "blocktime"
}

func (GetRawTransactionResp) MarshalJSON

func (alts GetRawTransactionResp) MarshalJSON() ([]byte, error)

func (*GetRawTransactionResp) UnmarshalJSON

func (alts *GetRawTransactionResp) UnmarshalJSON(b []byte) error

type GetRawTransactionRespIfVerboseIsSetToTrue

type GetRawTransactionRespIfVerboseIsSetToTrue struct {
	// Whether specified block is in the active chain or not (only present with explicit "blockhash" argument)
	InActiveChain bool `json:"in_active_chain"`

	// The serialized, hex-encoded data for 'txid'
	Hex string `json:"hex"`

	// The transaction id (same as provided)
	TxID string `json:"txid"`

	// The transaction hash (differs from txid for witness transactions)
	Hash string `json:"hash"`

	// The serialized transaction size
	Size float64 `json:"size"`

	// The virtual transaction size (differs from size for witness transactions)
	VSize float64 `json:"vsize"`

	// The transaction's weight (between vsize*4-3 and vsize*4)
	Weight float64 `json:"weight"`

	// The version
	Version float64 `json:"version"`

	// The lock time
	LockTime float64 `json:"locktime"`

	Vin []GetRawTransactionRespIfVerboseIsSetToTrueVin `json:"vin"`

	Vout []GetRawTransactionRespIfVerboseIsSetToTrueVout `json:"vout"`

	// the block hash
	Blockhash string `json:"blockhash"`

	// The confirmations
	Confirmations float64 `json:"confirmations"`

	// The block time expressed in UNIX epoch time
	BlockTime float64 `json:"blocktime"`

	// Same as "blocktime"
	Time float64 `json:"time"`
}

type GetRawTransactionRespIfVerboseIsSetToTrueVin

type GetRawTransactionRespIfVerboseIsSetToTrueVin struct {
	// The transaction id
	TxID string `json:"txid"`

	// The output number
	Vout float64 `json:"vout"`

	// The script
	ScriptSig struct {
		// asm
		Asm string `json:"asm"`

		// hex
		Hex string `json:"hex"`
	} `json:"scriptSig"`

	// The script sequence number
	Sequence float64 `json:"sequence"`

	// Element: Hex    hex-encoded witness data (if any)
	TxInWitness []string `json:"txinwitness"`
}

type GetRawTransactionRespIfVerboseIsSetToTrueVout

type GetRawTransactionRespIfVerboseIsSetToTrueVout struct {
	// The value in BTC
	Value float64 `json:"value"`

	// index
	N float64 `json:"n"`

	ScriptPubkey struct {
		// the asm
		Asm string `json:"asm"`

		// the hex
		Hex string `json:"hex"`

		// (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Number of required signatures
		ReqSigs *float64 `json:"reqSigs,omitempty"`

		// The type, eg 'pubkeyhash'
		Type string `json:"type"`

		// bitcoin address (only if a well-defined address exists)
		Address string `json:"address,omitempty"`

		// (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Array of bitcoin addresses
		// Element: Str    bitcoin address
		Addresses []string `json:"addresses,omitempty"`
	} `json:"scriptPubKey"`
}

type GetReceivedByAddressReq

type GetReceivedByAddressReq struct {
	// The bitcoin address for transactions.
	Address string `json:"address"`

	// Only include transactions confirmed at least this many times.
	// Default: 1
	MinConf *float64 `json:"minconf,omitempty"`
}

GetReceivedByAddressReq holds the arguments for the GetReceivedByAddress call.

  1. address (string, required) The bitcoin address for transactions.
  2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.

type GetReceivedByAddressResp

type GetReceivedByAddressResp struct {
	// The total amount in BTC received at this address.
	N float64
}

GetReceivedByAddressResp holds the response to the GetReceivedByAddress call.

n    (numeric) The total amount in BTC received at this address.

func (GetReceivedByAddressResp) MarshalJSON

func (alts GetReceivedByAddressResp) MarshalJSON() ([]byte, error)

func (*GetReceivedByAddressResp) UnmarshalJSON

func (alts *GetReceivedByAddressResp) UnmarshalJSON(b []byte) error

type GetReceivedByLabelReq

type GetReceivedByLabelReq struct {
	// The selected label, may be the default label using "".
	Label string `json:"label"`

	// Only include transactions confirmed at least this many times.
	// Default: 1
	MinConf *float64 `json:"minconf,omitempty"`
}

GetReceivedByLabelReq holds the arguments for the GetReceivedByLabel call.

  1. label (string, required) The selected label, may be the default label using "".
  2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.

type GetReceivedByLabelResp

type GetReceivedByLabelResp struct {
	// The total amount in BTC received for this label.
	N float64
}

GetReceivedByLabelResp holds the response to the GetReceivedByLabel call.

n    (numeric) The total amount in BTC received for this label.

func (GetReceivedByLabelResp) MarshalJSON

func (alts GetReceivedByLabelResp) MarshalJSON() ([]byte, error)

func (*GetReceivedByLabelResp) UnmarshalJSON

func (alts *GetReceivedByLabelResp) UnmarshalJSON(b []byte) error

type GetRpcInfoResp

type GetRpcInfoResp struct {
	// All active commands
	ActiveCommands []GetRpcInfoRespActiveCommands `json:"active_commands"`

	// The complete file path to the debug log
	LogPath string `json:"logpath"`
}

GetRpcInfoResp holds the response to the GetRpcInfo call.

{                          (json object)
  "active_commands" : [    (json array) All active commands
    {                      (json object) Information about an active command
      "method" : "str",    (string) The name of the RPC command
      "duration" : n       (numeric) The running time in microseconds
    },
    ...
  ],
  "logpath" : "str"        (string) The complete file path to the debug log
}

type GetRpcInfoRespActiveCommands

type GetRpcInfoRespActiveCommands struct {
	// The name of the RPC command
	Method string `json:"method"`

	// The running time in microseconds
	Duration float64 `json:"duration"`
}

Information about an active command

type GetTransactionReq

type GetTransactionReq struct {
	// The transaction id
	TxID string `json:"txid"`

	// Whether to include watch-only addresses in balance calculation and details[]
	// Default: true for watch-only wallets, otherwise false
	IncludeWatchOnly *bool `json:"include_watchonly,omitempty"`

	// Whether to include a `decoded` field containing the decoded transaction (equivalent to RPC decoderawtransaction)
	// Default: false
	Verbose bool `json:"verbose,omitempty"`
}

GetTransactionReq holds the arguments for the GetTransaction call.

  1. txid (string, required) The transaction id
  2. include_watchonly (boolean, optional, default=true for watch-only wallets, otherwise false) Whether to include watch-only addresses in balance calculation and details[]
  3. verbose (boolean, optional, default=false) Whether to include a `decoded` field containing the decoded transaction (equivalent to RPC decoderawtransaction)

type GetTransactionResp

type GetTransactionResp struct {
	// The amount in BTC
	Amount float64 `json:"amount"`

	// The amount of the fee in BTC. This is negative and only available for the
	// 'send' category of transactions.
	Fee float64 `json:"fee"`

	// The number of confirmations for the transaction. Negative confirmations means the
	// transaction conflicted that many blocks ago.
	Confirmations float64 `json:"confirmations"`

	// Only present if transaction only input is a coinbase one.
	Generated bool `json:"generated"`

	// Only present if we consider transaction to be trusted and so safe to spend from.
	Trusted bool `json:"trusted"`

	// The block hash containing the transaction.
	Blockhash string `json:"blockhash"`

	// The block height containing the transaction.
	BlockHeight float64 `json:"blockheight"`

	// The index of the transaction in the block that includes it.
	BlockIndex float64 `json:"blockindex"`

	// The block time expressed in UNIX epoch time.
	BlockTime float64 `json:"blocktime"`

	// The transaction id.
	TxID string `json:"txid"`

	// Conflicting transaction ids.
	// Element: Hex    The transaction id.
	WalletConflicts []string `json:"walletconflicts"`

	// The transaction time expressed in UNIX epoch time.
	Time float64 `json:"time"`

	// The time received expressed in UNIX epoch time.
	TimeReceived float64 `json:"timereceived"`

	// If a comment is associated with the transaction, only present if not empty.
	Comment string `json:"comment"`

	// ("yes|no|unknown") Whether this transaction could be replaced due to BIP125 (replace-by-fee);
	// may be unknown for unconfirmed transactions not in the mempool
	BIP125Replaceable string `json:"bip125-replaceable"`

	Details []GetTransactionRespDetails `json:"details"`

	// Raw data for transaction
	Hex string `json:"hex"`

	// Optional, the decoded transaction (only present when `verbose` is passed)
	// Equivalent to the RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed.
	Decoded DecodeRawTransactionResp `json:"decoded"`
}

GetTransactionResp holds the response to the GetTransaction call.

{                                          (json object)
  "amount" : n,                            (numeric) The amount in BTC
  "fee" : n,                               (numeric) The amount of the fee in BTC. This is negative and only available for the
                                           'send' category of transactions.
  "confirmations" : n,                     (numeric) The number of confirmations for the transaction. Negative confirmations means the
                                           transaction conflicted that many blocks ago.
  "generated" : true|false,                (boolean) Only present if transaction only input is a coinbase one.
  "trusted" : true|false,                  (boolean) Only present if we consider transaction to be trusted and so safe to spend from.
  "blockhash" : "hex",                     (string) The block hash containing the transaction.
  "blockheight" : n,                       (numeric) The block height containing the transaction.
  "blockindex" : n,                        (numeric) The index of the transaction in the block that includes it.
  "blocktime" : xxx,                       (numeric) The block time expressed in UNIX epoch time.
  "txid" : "hex",                          (string) The transaction id.
  "walletconflicts" : [                    (json array) Conflicting transaction ids.
    "hex",                                 (string) The transaction id.
    ...
  ],
  "time" : xxx,                            (numeric) The transaction time expressed in UNIX epoch time.
  "timereceived" : xxx,                    (numeric) The time received expressed in UNIX epoch time.
  "comment" : "str",                       (string) If a comment is associated with the transaction, only present if not empty.
  "bip125-replaceable" : "str",            (string) ("yes|no|unknown") Whether this transaction could be replaced due to BIP125 (replace-by-fee);
                                           may be unknown for unconfirmed transactions not in the mempool
  "details" : [                            (json array)
    {                                      (json object)
      "involvesWatchonly" : true|false,    (boolean) Only returns true if imported addresses were involved in transaction.
      "address" : "str",                   (string) The bitcoin address involved in the transaction.
      "category" : "str",                  (string) The transaction category.
                                           "send"                  Transactions sent.
                                           "receive"               Non-coinbase transactions received.
                                           "generate"              Coinbase transactions received with more than 100 confirmations.
                                           "immature"              Coinbase transactions received with 100 or fewer confirmations.
                                           "orphan"                Orphaned coinbase transactions received.
      "amount" : n,                        (numeric) The amount in BTC
      "label" : "str",                     (string) A comment for the address/transaction, if any
      "vout" : n,                          (numeric) the vout value
      "fee" : n,                           (numeric) The amount of the fee in BTC. This is negative and only available for the
                                           'send' category of transactions.
      "abandoned" : true|false             (boolean) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the
                                           'send' category of transactions.
    },
    ...
  ],
  "hex" : "hex",                           (string) Raw data for transaction
  "decoded" : {                            (json object) Optional, the decoded transaction (only present when `verbose` is passed)
    ...                                    Equivalent to the RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed.
  }
}

type GetTransactionRespDetails

type GetTransactionRespDetails struct {
	// Only returns true if imported addresses were involved in transaction.
	InvolvesWatchOnly bool `json:"involvesWatchonly"`

	// The bitcoin address involved in the transaction.
	Address string `json:"address"`

	// The transaction category.
	// "send"                  Transactions sent.
	// "receive"               Non-coinbase transactions received.
	// "generate"              Coinbase transactions received with more than 100 confirmations.
	// "immature"              Coinbase transactions received with 100 or fewer confirmations.
	// "orphan"                Orphaned coinbase transactions received.
	Category string `json:"category"`

	// The amount in BTC
	Amount float64 `json:"amount"`

	// A comment for the address/transaction, if any
	Label string `json:"label"`

	// the vout value
	Vout float64 `json:"vout"`

	// The amount of the fee in BTC. This is negative and only available for the
	// 'send' category of transactions.
	Fee float64 `json:"fee"`

	// 'true' if the transaction has been abandoned (inputs are respendable). Only available for the
	// 'send' category of transactions.
	Abandoned bool `json:"abandoned"`
}

type GetTxOutProofReq

type GetTxOutProofReq struct {
	// The txids to filter
	// Element: TxID    A transaction hash
	TxIDs []string `json:"txids"`

	// If specified, looks for txid in the block with this hash
	Blockhash string `json:"blockhash,omitempty"`
}

GetTxOutProofReq holds the arguments for the GetTxOutProof call.

  1. txids (json array, required) The txids to filter [ "txid", (string) A transaction hash ... ]
  2. blockhash (string, optional) If specified, looks for txid in the block with this hash

type GetTxOutProofResp

type GetTxOutProofResp struct {
	// A string that is a serialized, hex-encoded data for the proof.
	Str string
}

GetTxOutProofResp holds the response to the GetTxOutProof call.

"str"    (string) A string that is a serialized, hex-encoded data for the proof.

func (GetTxOutProofResp) MarshalJSON

func (alts GetTxOutProofResp) MarshalJSON() ([]byte, error)

func (*GetTxOutProofResp) UnmarshalJSON

func (alts *GetTxOutProofResp) UnmarshalJSON(b []byte) error

type GetTxOutReq

type GetTxOutReq struct {
	// The transaction id
	TxID string `json:"txid"`

	// vout number
	N float64 `json:"n"`

	// Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear.
	// Default: true
	IncludeMempool *bool `json:"include_mempool,omitempty"`
}

GetTxOutReq holds the arguments for the GetTxOut call.

  1. txid (string, required) The transaction id
  2. n (numeric, required) vout number
  3. include_mempool (boolean, optional, default=true) Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear.

type GetTxOutResp added in v22.1.2

type GetTxOutResp struct {
	// The hash of the block at the tip of the chain
	BestBlock string `json:"bestblock"`

	// The number of confirmations
	Confirmations float64 `json:"confirmations"`

	// The transaction value in BTC
	Value float64 `json:"value"`

	ScriptPubkey struct {
		Asm string `json:"asm"`

		Hex string `json:"hex"`

		// (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Number of required signatures
		ReqSigs *float64 `json:"reqSigs,omitempty"`

		// The type, eg pubkeyhash
		Type string `json:"type"`

		// bitcoin address (only if a well-defined address exists)
		Address string `json:"address,omitempty"`

		// (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Array of bitcoin addresses
		// Element: Str    bitcoin address
		Addresses []string `json:"addresses,omitempty"`
	} `json:"scriptPubKey"`

	// Coinbase or not
	Coinbase bool `json:"coinbase"`
}

GetTxOutResp holds the response to the GetTxOut call.

ALTERNATIVE (If the UTXO was not found)

null    (json null)

ALTERNATIVE (Otherwise)

{                             (json object)
  "bestblock" : "hex",        (string) The hash of the block at the tip of the chain
  "confirmations" : n,        (numeric) The number of confirmations
  "value" : n,                (numeric) The transaction value in BTC
  "scriptPubKey" : {          (json object)
    "asm" : "str",            (string)
    "hex" : "hex",            (string)
    "reqSigs" : n,            (numeric, optional) (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Number of required signatures
    "type" : "str",           (string) The type, eg pubkeyhash
    "address" : "str",        (string, optional) bitcoin address (only if a well-defined address exists)
    "addresses" : [           (json array, optional) (DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Array of bitcoin addresses
      "str",                  (string) bitcoin address
      ...
    ]
  },
  "coinbase" : true|false     (boolean) Coinbase or not
}

type GetTxOutSetInfoReq

type GetTxOutSetInfoReq struct {
	// Which UTXO set hash should be calculated. Options: 'hash_serialized_2' (the legacy algorithm), 'muhash', 'none'.
	// Default: "hash_serialized_2"
	HashType string `json:"hash_type,omitempty"`

	// The block hash or height of the target height (only available with coinstatsindex).
	HashOrHeight string `json:"hash_or_height,omitempty"`

	// Use coinstatsindex, if available.
	// Default: true
	UseIndex *bool `json:"use_index,omitempty"`
}

GetTxOutSetInfoReq holds the arguments for the GetTxOutSetInfo call.

  1. hash_type (string, optional, default="hash_serialized_2") Which UTXO set hash should be calculated. Options: 'hash_serialized_2' (the legacy algorithm), 'muhash', 'none'.
  2. hash_or_height (string or numeric, optional) The block hash or height of the target height (only available with coinstatsindex).
  3. use_index (boolean, optional, default=true) Use coinstatsindex, if available.

type GetTxOutSetInfoResp

type GetTxOutSetInfoResp struct {
	// The block height (index) of the returned statistics
	Height float64 `json:"height"`

	// The hash of the block at which these statistics are calculated
	BestBlock string `json:"bestblock"`

	// The number of unspent transaction outputs
	TxOuts float64 `json:"txouts"`

	// Database-independent, meaningless metric indicating the UTXO set size
	BogoSize float64 `json:"bogosize"`

	// The serialized hash (only present if 'hash_serialized_2' hash_type is chosen)
	HashSerialized2 string `json:"hash_serialized_2,omitempty"`

	// The serialized hash (only present if 'muhash' hash_type is chosen)
	MuHash string `json:"muhash,omitempty"`

	// The number of transactions with unspent outputs (not available when coinstatsindex is used)
	Transactions float64 `json:"transactions"`

	// The estimated size of the chainstate on disk (not available when coinstatsindex is used)
	DiskSize float64 `json:"disk_size"`

	// The total amount of coins in the UTXO set
	TotalAmount float64 `json:"total_amount"`

	// The total amount of coins permanently excluded from the UTXO set (only available if coinstatsindex is used)
	TotalUnspendableAmount float64 `json:"total_unspendable_amount"`

	// Info on amounts in the block at this block height (only available if coinstatsindex is used)
	BlockInfo struct {
		PrevOutSpent float64 `json:"prevout_spent"`

		Coinbase float64 `json:"coinbase"`

		NewOutputsExCoinbase float64 `json:"new_outputs_ex_coinbase"`

		Unspendable float64 `json:"unspendable"`

		// Detailed view of the unspendable categories
		Unspendables struct {
			GenesisBlock float64 `json:"genesis_block"`

			// Transactions overridden by duplicates (no longer possible with BIP30)
			BIP30 float64 `json:"bip30"`

			// Amounts sent to scripts that are unspendable (for example OP_RETURN outputs)
			Scripts float64 `json:"scripts"`

			// Fee rewards that miners did not claim in their coinbase transaction
			UnclaimedRewards float64 `json:"unclaimed_rewards"`
		} `json:"unspendables"`
	} `json:"block_info"`
}

GetTxOutSetInfoResp holds the response to the GetTxOutSetInfo call.

{                                     (json object)
  "height" : n,                       (numeric) The block height (index) of the returned statistics
  "bestblock" : "hex",                (string) The hash of the block at which these statistics are calculated
  "txouts" : n,                       (numeric) The number of unspent transaction outputs
  "bogosize" : n,                     (numeric) Database-independent, meaningless metric indicating the UTXO set size
  "hash_serialized_2" : "hex",        (string, optional) The serialized hash (only present if 'hash_serialized_2' hash_type is chosen)
  "muhash" : "hex",                   (string, optional) The serialized hash (only present if 'muhash' hash_type is chosen)
  "transactions" : n,                 (numeric) The number of transactions with unspent outputs (not available when coinstatsindex is used)
  "disk_size" : n,                    (numeric) The estimated size of the chainstate on disk (not available when coinstatsindex is used)
  "total_amount" : n,                 (numeric) The total amount of coins in the UTXO set
  "total_unspendable_amount" : n,     (numeric) The total amount of coins permanently excluded from the UTXO set (only available if coinstatsindex is used)
  "block_info" : {                    (json object) Info on amounts in the block at this block height (only available if coinstatsindex is used)
    "prevout_spent" : n,              (numeric)
    "coinbase" : n,                   (numeric)
    "new_outputs_ex_coinbase" : n,    (numeric)
    "unspendable" : n,                (numeric)
    "unspendables" : {                (json object) Detailed view of the unspendable categories
      "genesis_block" : n,            (numeric)
      "bip30" : n,                    (numeric) Transactions overridden by duplicates (no longer possible with BIP30)
      "scripts" : n,                  (numeric) Amounts sent to scripts that are unspendable (for example OP_RETURN outputs)
      "unclaimed_rewards" : n         (numeric) Fee rewards that miners did not claim in their coinbase transaction
    }
  }
}

type GetUnconfirmedBalanceResp

type GetUnconfirmedBalanceResp struct {
	// The balance
	N float64
}

GetUnconfirmedBalanceResp holds the response to the GetUnconfirmedBalance call.

n    (numeric) The balance

func (GetUnconfirmedBalanceResp) MarshalJSON

func (alts GetUnconfirmedBalanceResp) MarshalJSON() ([]byte, error)

func (*GetUnconfirmedBalanceResp) UnmarshalJSON

func (alts *GetUnconfirmedBalanceResp) UnmarshalJSON(b []byte) error

type GetWalletInfoResp

type GetWalletInfoResp struct {
	// the wallet name
	WalletName string `json:"walletname"`

	// the wallet version
	WalletVersion float64 `json:"walletversion"`

	// the database format (bdb or sqlite)
	Format string `json:"format"`

	// DEPRECATED. Identical to getbalances().mine.trusted
	Balance float64 `json:"balance"`

	// DEPRECATED. Identical to getbalances().mine.untrusted_pending
	UnconfirmedBalance float64 `json:"unconfirmed_balance"`

	// DEPRECATED. Identical to getbalances().mine.immature
	ImmatureBalance float64 `json:"immature_balance"`

	// the total number of transactions in the wallet
	TxCount float64 `json:"txcount"`

	// the UNIX epoch time of the oldest pre-generated key in the key pool. Legacy wallets only.
	KeypoolOldest float64 `json:"keypoololdest"`

	// how many new keys are pre-generated (only counts external keys)
	KeypoolSize float64 `json:"keypoolsize"`

	// how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used)
	KeypoolSizeHDInternal float64 `json:"keypoolsize_hd_internal"`

	// the UNIX epoch time until which the wallet is unlocked for transfers, or 0 if the wallet is locked (only present for passphrase-encrypted wallets)
	UnlockedUntil *float64 `json:"unlocked_until,omitempty"`

	// the transaction fee configuration, set in BTC/kvB
	PayTxFee float64 `json:"paytxfee"`

	// the Hash160 of the HD seed (only present when HD is enabled)
	HDSeedID string `json:"hdseedid,omitempty"`

	// false if privatekeys are disabled for this wallet (enforced watch-only wallet)
	PrivateKeysEnabled bool `json:"private_keys_enabled"`

	// whether this wallet tracks clean/dirty coins in terms of reuse
	AvoidReuse bool `json:"avoid_reuse"`

	// current scanning details, or false if no scan is in progress
	Scanning *GetWalletInfoRespScanning `json:"scanning,omitempty"`

	// whether this wallet uses descriptors for scriptPubKey management
	Descriptors bool `json:"descriptors"`
}

GetWalletInfoResp holds the response to the GetWalletInfo call.

{                                         (json object)
  "walletname" : "str",                   (string) the wallet name
  "walletversion" : n,                    (numeric) the wallet version
  "format" : "str",                       (string) the database format (bdb or sqlite)
  "balance" : n,                          (numeric) DEPRECATED. Identical to getbalances().mine.trusted
  "unconfirmed_balance" : n,              (numeric) DEPRECATED. Identical to getbalances().mine.untrusted_pending
  "immature_balance" : n,                 (numeric) DEPRECATED. Identical to getbalances().mine.immature
  "txcount" : n,                          (numeric) the total number of transactions in the wallet
  "keypoololdest" : xxx,                  (numeric) the UNIX epoch time of the oldest pre-generated key in the key pool. Legacy wallets only.
  "keypoolsize" : n,                      (numeric) how many new keys are pre-generated (only counts external keys)
  "keypoolsize_hd_internal" : n,          (numeric) how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used)
  "unlocked_until" : xxx,                 (numeric, optional) the UNIX epoch time until which the wallet is unlocked for transfers, or 0 if the wallet is locked (only present for passphrase-encrypted wallets)
  "paytxfee" : n,                         (numeric) the transaction fee configuration, set in BTC/kvB
  "hdseedid" : "hex",                     (string, optional) the Hash160 of the HD seed (only present when HD is enabled)
  "private_keys_enabled" : true|false,    (boolean) false if privatekeys are disabled for this wallet (enforced watch-only wallet)
  "avoid_reuse" : true|false,             (boolean) whether this wallet tracks clean/dirty coins in terms of reuse
  "scanning" : {                          (json object) current scanning details, or false if no scan is in progress
    "duration" : n,                       (numeric) elapsed seconds since scan start
    "progress" : n                        (numeric) scanning progress percentage [0.0, 1.0]
  },
  "descriptors" : true|false              (boolean) whether this wallet uses descriptors for scriptPubKey management
}

type GetWalletInfoRespScanning

type GetWalletInfoRespScanning struct {
	GetWalletInfoRespScanningContents
}

func (*GetWalletInfoRespScanning) UnmarshalJSON

func (mayBeFalse *GetWalletInfoRespScanning) UnmarshalJSON(b []byte) error

type GetWalletInfoRespScanningContents

type GetWalletInfoRespScanningContents struct {
	// elapsed seconds since scan start
	Duration float64 `json:"duration"`

	// scanning progress percentage [0.0, 1.0]
	Progress float64 `json:"progress"`
}

type GetZmqNotificationsResp

type GetZmqNotificationsResp struct {
	Array []GetZmqNotificationsRespElement
}

GetZmqNotificationsResp holds the response to the GetZmqNotifications call.

[                         (json array)
  {                       (json object)
    "type" : "str",       (string) Type of notification
    "address" : "str",    (string) Address of the publisher
    "hwm" : n             (numeric) Outbound message high water mark
  },
  ...
]

func (GetZmqNotificationsResp) MarshalJSON

func (alts GetZmqNotificationsResp) MarshalJSON() ([]byte, error)

func (*GetZmqNotificationsResp) UnmarshalJSON

func (alts *GetZmqNotificationsResp) UnmarshalJSON(b []byte) error

type GetZmqNotificationsRespElement

type GetZmqNotificationsRespElement struct {
	// Type of notification
	Type string `json:"type"`

	// Address of the publisher
	Address string `json:"address"`

	// Outbound message high water mark
	Hwm float64 `json:"hwm"`
}

type HashMsg

type HashMsg struct {
	Hash [32]byte // use encoding/hex.EncodeToString() to get it into the RPC method string format.
	Seq  uint32
}

HashMsg is a subscription event coming from a "hash"-type ZMQ message.

type HelpReq

type HelpReq struct {
	// The command to get help on
	// Default: all commands
	Command string `json:"command,omitempty"`
}

HelpReq holds the arguments for the Help call.

  1. command (string, optional, default=all commands) The command to get help on

type HelpResp

type HelpResp struct {
	// The help text
	Str string
}

HelpResp holds the response to the Help call.

"str"    (string) The help text

func (HelpResp) MarshalJSON

func (alts HelpResp) MarshalJSON() ([]byte, error)

func (*HelpResp) UnmarshalJSON

func (alts *HelpResp) UnmarshalJSON(b []byte) error

type ImportAddressReq

type ImportAddressReq struct {
	// The Bitcoin address (or hex-encoded script)
	Address string `json:"address"`

	// An optional label
	// Default: ""
	Label string `json:"label,omitempty"`

	// Rescan the wallet for transactions
	// Default: true
	Rescan *bool `json:"rescan,omitempty"`

	// Add the P2SH version of the script as well
	// Default: false
	P2SH bool `json:"p2sh,omitempty"`
}

ImportAddressReq holds the arguments for the ImportAddress call.

  1. address (string, required) The Bitcoin address (or hex-encoded script)
  2. label (string, optional, default="") An optional label
  3. rescan (boolean, optional, default=true) Rescan the wallet for transactions
  4. p2sh (boolean, optional, default=false) Add the P2SH version of the script as well

type ImportDescriptorsReq

type ImportDescriptorsReq struct {
	// Data to be imported
	Requests []ImportDescriptorsReqRequests `json:"requests"`
}

ImportDescriptorsReq holds the arguments for the ImportDescriptors call.

  1. requests (json array, required) Data to be imported [ { (json object) "desc": "str", (string, required) Descriptor to import. "active": bool, (boolean, optional, default=false) Set this descriptor to be the active descriptor for the corresponding output type/externality "range": n or [n,n], (numeric or array) If a ranged descriptor is used, this specifies the end or the range (in the form [begin,end]) to import "next_index": n, (numeric) If a ranged descriptor is set to active, this specifies the next index to generate addresses from "timestamp": timestamp | "now", (integer / string, required) Time from which to start rescanning the blockchain for this descriptor, in UNIX epoch time Use the string "now" to substitute the current synced blockchain time. "now" can be specified to bypass scanning, for outputs which are known to never have been used, and 0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest timestamp of all descriptors being imported will be scanned. "internal": bool, (boolean, optional, default=false) Whether matching outputs should be treated as not incoming payments (e.g. change) "label": "str", (string, optional, default="") Label to assign to the address, only allowed with internal=false }, ... ]

type ImportDescriptorsReqRequests

type ImportDescriptorsReqRequests struct {
	// Descriptor to import.
	Desc string `json:"desc"`

	// Set this descriptor to be the active descriptor for the corresponding output type/externality
	// Default: false
	Active bool `json:"active,omitempty"`

	// If a ranged descriptor is used, this specifies the end or the range (in the form [begin,end]) to import
	Range [2]int64 `json:"range"`

	// If a ranged descriptor is set to active, this specifies the next index to generate addresses from
	NextIndex float64 `json:"next_index"`

	// Time from which to start rescanning the blockchain for this descriptor, in UNIX epoch time
	// Use the string "now" to substitute the current synced blockchain time.
	// "now" can be specified to bypass scanning, for outputs which are known to never have been used, and
	// 0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest timestamp
	// of all descriptors being imported will be scanned.
	Timestamp int64 `json:"timestamp"`

	// Whether matching outputs should be treated as not incoming payments (e.g. change)
	// Default: false
	Internal bool `json:"internal,omitempty"`

	// Label to assign to the address, only allowed with internal=false
	// Default: ""
	Label string `json:"label,omitempty"`
}

type ImportDescriptorsResp

type ImportDescriptorsResp struct {
	// Response is an array with the same size as the input that has the execution result
	Array []ImportDescriptorsRespElement
}

ImportDescriptorsResp holds the response to the ImportDescriptors call.

[                              (json array) Response is an array with the same size as the input that has the execution result
  {                            (json object)
    "success" : true|false,    (boolean)
    "warnings" : [             (json array, optional)
      "str",                   (string)
      ...
    ],
    "error" : {                (json object, optional)
      ...                      JSONRPC error
    }
  },
  ...
]

func (ImportDescriptorsResp) MarshalJSON

func (alts ImportDescriptorsResp) MarshalJSON() ([]byte, error)

func (*ImportDescriptorsResp) UnmarshalJSON

func (alts *ImportDescriptorsResp) UnmarshalJSON(b []byte) error

type ImportDescriptorsRespElement

type ImportDescriptorsRespElement struct {
	Success bool `json:"success"`

	// Element: Str
	Warnings []string `json:"warnings,omitempty"`

	Error *JsonRPCError `json:"error,omitempty"`
}

Response is an array with the same size as the input that has the execution result

type ImportMultiReq

type ImportMultiReq struct {
	// Data to be imported
	Requests []ImportMultiReqRequests `json:"requests"`

	Options *ImportMultiReqOptions `json:"options,omitempty"`
}

ImportMultiReq holds the arguments for the ImportMulti call.

  1. requests (json array, required) Data to be imported [ { (json object) "desc": "str", (string) Descriptor to import. If using descriptor, do not also provide address/scriptPubKey, scripts, or pubkeys "scriptPubKey": "<script>" | { "address":"<address>" }, (string / json, required) Type of scriptPubKey (string for script, json for address). Should not be provided if using a descriptor "timestamp": timestamp | "now", (integer / string, required) Creation time of the key expressed in UNIX epoch time, or the string "now" to substitute the current synced blockchain time. The timestamp of the oldest key will determine how far back blockchain rescans need to begin for missing wallet transactions. "now" can be specified to bypass scanning, for keys which are known to never have been used, and 0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest key creation time of all keys being imported by the importmulti call will be scanned. "redeemscript": "str", (string) Allowed only if the scriptPubKey is a P2SH or P2SH-P2WSH address/scriptPubKey "witnessscript": "str", (string) Allowed only if the scriptPubKey is a P2SH-P2WSH or P2WSH address/scriptPubKey "pubkeys": [ (json array, optional, default=[]) Array of strings giving pubkeys to import. They must occur in P2PKH or P2WPKH scripts. They are not required when the private key is also provided (see the "keys" argument). "pubKey", (string) ... ], "keys": [ (json array, optional, default=[]) Array of strings giving private keys to import. The corresponding public keys must occur in the output or redeemscript. "key", (string) ... ], "range": n or [n,n], (numeric or array) If a ranged descriptor is used, this specifies the end or the range (in the form [begin,end]) to import "internal": bool, (boolean, optional, default=false) Stating whether matching outputs should be treated as not incoming payments (also known as change) "watchonly": bool, (boolean, optional, default=false) Stating whether matching outputs should be considered watchonly. "label": "str", (string, optional, default="") Label to assign to the address, only allowed with internal=false "keypool": bool, (boolean, optional, default=false) Stating whether imported public keys should be added to the keypool for when users request new addresses. Only allowed when wallet private keys are disabled }, ... ]
  2. options (json object, optional) { "rescan": bool, (boolean, optional, default=true) Stating if should rescan the blockchain after all imports }

type ImportMultiReqOptions

type ImportMultiReqOptions struct {
	// Stating if should rescan the blockchain after all imports
	// Default: true
	Rescan *bool `json:"rescan,omitempty"`
}

type ImportMultiReqRequests

type ImportMultiReqRequests struct {
	// Descriptor to import. If using descriptor, do not also provide address/scriptPubKey, scripts, or pubkeys
	Desc string `json:"desc"`

	// Type of scriptPubKey (string for script, json for address). Should not be provided if using a descriptor
	ScriptPubkey string `json:"scriptPubKey"`

	// Creation time of the key expressed in UNIX epoch time,
	// or the string "now" to substitute the current synced blockchain time. The timestamp of the oldest
	// key will determine how far back blockchain rescans need to begin for missing wallet transactions.
	// "now" can be specified to bypass scanning, for keys which are known to never have been used, and
	// 0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest key
	// creation time of all keys being imported by the importmulti call will be scanned.
	Timestamp int64 `json:"timestamp"`

	// Allowed only if the scriptPubKey is a P2SH or P2SH-P2WSH address/scriptPubKey
	RedeemScript string `json:"redeemscript"`

	// Allowed only if the scriptPubKey is a P2SH-P2WSH or P2WSH address/scriptPubKey
	WitnessScript string `json:"witnessscript"`

	// Array of strings giving pubkeys to import. They must occur in P2PKH or P2WPKH scripts. They are not required when the private key is also provided (see the "keys" argument).
	// Element: Pubkey
	Pubkeys []string `json:"pubkeys,omitempty"`

	// Array of strings giving private keys to import. The corresponding public keys must occur in the output or redeemscript.
	// Element: Key
	Keys []string `json:"keys,omitempty"`

	// If a ranged descriptor is used, this specifies the end or the range (in the form [begin,end]) to import
	Range [2]int64 `json:"range"`

	// Stating whether matching outputs should be treated as not incoming payments (also known as change)
	// Default: false
	Internal bool `json:"internal,omitempty"`

	// Stating whether matching outputs should be considered watchonly.
	// Default: false
	WatchOnly bool `json:"watchonly,omitempty"`

	// Label to assign to the address, only allowed with internal=false
	// Default: ""
	Label string `json:"label,omitempty"`

	// Stating whether imported public keys should be added to the keypool for when users request new addresses. Only allowed when wallet private keys are disabled
	// Default: false
	Keypool bool `json:"keypool,omitempty"`
}

type ImportMultiResp

type ImportMultiResp struct {
	// Response is an array with the same size as the input that has the execution result
	Array []ImportMultiRespElement
}

ImportMultiResp holds the response to the ImportMulti call.

[                              (json array) Response is an array with the same size as the input that has the execution result
  {                            (json object)
    "success" : true|false,    (boolean)
    "warnings" : [             (json array, optional)
      "str",                   (string)
      ...
    ],
    "error" : {                (json object, optional)
      ...                      JSONRPC error
    }
  },
  ...
]

func (ImportMultiResp) MarshalJSON

func (alts ImportMultiResp) MarshalJSON() ([]byte, error)

func (*ImportMultiResp) UnmarshalJSON

func (alts *ImportMultiResp) UnmarshalJSON(b []byte) error

type ImportMultiRespElement

type ImportMultiRespElement struct {
	Success bool `json:"success"`

	// Element: Str
	Warnings []string `json:"warnings,omitempty"`

	Error *JsonRPCError `json:"error,omitempty"`
}

Response is an array with the same size as the input that has the execution result

type ImportPrivkeyReq

type ImportPrivkeyReq struct {
	// The private key (see dumpprivkey)
	Privkey string `json:"privkey"`

	// An optional label
	// Default: current label if address exists, otherwise ""
	Label string `json:"label,omitempty"`

	// Rescan the wallet for transactions
	// Default: true
	Rescan *bool `json:"rescan,omitempty"`
}

ImportPrivkeyReq holds the arguments for the ImportPrivkey call.

  1. privkey (string, required) The private key (see dumpprivkey)
  2. label (string, optional, default=current label if address exists, otherwise "") An optional label
  3. rescan (boolean, optional, default=true) Rescan the wallet for transactions

type ImportPrunedFundsReq

type ImportPrunedFundsReq struct {
	// A raw transaction in hex funding an already-existing address in wallet
	RawTransaction string `json:"rawtransaction"`

	// The hex output from gettxoutproof that contains the transaction
	TxOutProof string `json:"txoutproof"`
}

ImportPrunedFundsReq holds the arguments for the ImportPrunedFunds call.

  1. rawtransaction (string, required) A raw transaction in hex funding an already-existing address in wallet
  2. txoutproof (string, required) The hex output from gettxoutproof that contains the transaction

type ImportPubkeyReq

type ImportPubkeyReq struct {
	// The hex-encoded public key
	Pubkey string `json:"pubkey"`

	// An optional label
	// Default: ""
	Label string `json:"label,omitempty"`

	// Rescan the wallet for transactions
	// Default: true
	Rescan *bool `json:"rescan,omitempty"`
}

ImportPubkeyReq holds the arguments for the ImportPubkey call.

  1. pubkey (string, required) The hex-encoded public key
  2. label (string, optional, default="") An optional label
  3. rescan (boolean, optional, default=true) Rescan the wallet for transactions

type ImportWalletReq

type ImportWalletReq struct {
	// The wallet file
	FileName string `json:"filename"`
}

ImportWalletReq holds the arguments for the ImportWallet call.

  1. filename (string, required) The wallet file

type JoinPsbtsReq

type JoinPsbtsReq struct {
	// The base64 strings of partially signed transactions
	// Element: Psbt    A base64 string of a PSBT
	Txs []string `json:"txs"`
}

JoinPsbtsReq holds the arguments for the JoinPsbts call.

  1. txs (json array, required) The base64 strings of partially signed transactions [ "psbt", (string, required) A base64 string of a PSBT ... ]

type JoinPsbtsResp

type JoinPsbtsResp struct {
	// The base64-encoded partially signed transaction
	Str string
}

JoinPsbtsResp holds the response to the JoinPsbts call.

"str"    (string) The base64-encoded partially signed transaction

func (JoinPsbtsResp) MarshalJSON

func (alts JoinPsbtsResp) MarshalJSON() ([]byte, error)

func (*JoinPsbtsResp) UnmarshalJSON

func (alts *JoinPsbtsResp) UnmarshalJSON(b []byte) error

type JsonRPCError

type JsonRPCError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

JsonRPCError is an error on the format of the JSON-RPC 2.0 standard.

func (*JsonRPCError) Error

func (err *JsonRPCError) Error() string

type KeypoolRefillReq

type KeypoolRefillReq struct {
	// The new keypool size
	// Default: 100
	NewSize *float64 `json:"newsize,omitempty"`
}

KeypoolRefillReq holds the arguments for the KeypoolRefill call.

  1. newsize (numeric, optional, default=100) The new keypool size

type ListAddressGroupingsResp

type ListAddressGroupingsResp struct {
	// Holder of alternative parameter formats, only one will be used, the first that is non-zero.
	Array [][][]ListAddressGroupingsRespElement
}

ListAddressGroupingsResp holds the response to the ListAddressGroupings call.

[               (json array)
  [             (json array)
    [           (json array)
      "str",    (string) The bitcoin address
      n,        (numeric) The amount in BTC
      "str"     (string, optional) The label
    ],
    ...
  ],
  ...
]

func (ListAddressGroupingsResp) MarshalJSON

func (alts ListAddressGroupingsResp) MarshalJSON() ([]byte, error)

func (*ListAddressGroupingsResp) UnmarshalJSON

func (alts *ListAddressGroupingsResp) UnmarshalJSON(b []byte) error

type ListAddressGroupingsRespElement

type ListAddressGroupingsRespElement struct {
	// The bitcoin address
	Str string

	// The amount in BTC
	// "str"     (string, optional) The label
	N float64
}

Holder of alternative parameter formats, only one will be used, the first that is non-zero.

func (ListAddressGroupingsRespElement) MarshalJSON

func (alts ListAddressGroupingsRespElement) MarshalJSON() ([]byte, error)

func (*ListAddressGroupingsRespElement) UnmarshalJSON

func (alts *ListAddressGroupingsRespElement) UnmarshalJSON(b []byte) error

type ListBannedResp

type ListBannedResp struct {
	Array []ListBannedRespElement
}

ListBannedResp holds the response to the ListBanned call.

[                              (json array)
  {                            (json object)
    "address" : "str",         (string) The IP/Subnet of the banned node
    "ban_created" : xxx,       (numeric) The UNIX epoch time the ban was created
    "banned_until" : xxx,      (numeric) The UNIX epoch time the ban expires
    "ban_duration" : xxx,      (numeric) The ban duration, in seconds
    "time_remaining" : xxx     (numeric) The time remaining until the ban expires, in seconds
  },
  ...
]

func (ListBannedResp) MarshalJSON

func (alts ListBannedResp) MarshalJSON() ([]byte, error)

func (*ListBannedResp) UnmarshalJSON

func (alts *ListBannedResp) UnmarshalJSON(b []byte) error

type ListBannedRespElement

type ListBannedRespElement struct {
	// The IP/Subnet of the banned node
	Address string `json:"address"`

	// The UNIX epoch time the ban was created
	BanCreated float64 `json:"ban_created"`

	// The UNIX epoch time the ban expires
	BannedUntil float64 `json:"banned_until"`

	// The ban duration, in seconds
	BanDuration float64 `json:"ban_duration"`

	// The time remaining until the ban expires, in seconds
	TimeRemaining float64 `json:"time_remaining"`
}

type ListDescriptorsResp

type ListDescriptorsResp struct {
	// Name of wallet this operation was performed on
	WalletName string `json:"wallet_name"`

	// Array of descriptor objects
	Descriptors []ListDescriptorsRespDescriptors `json:"descriptors"`
}

ListDescriptorsResp holds the response to the ListDescriptors call.

{                                 (json object)
  "wallet_name" : "str",          (string) Name of wallet this operation was performed on
  "descriptors" : [               (json array) Array of descriptor objects
    {                             (json object)
      "desc" : "str",             (string) Descriptor string representation
      "timestamp" : n,            (numeric) The creation time of the descriptor
      "active" : true|false,      (boolean) Activeness flag
      "internal" : true|false,    (boolean, optional) Whether this is an internal or external descriptor; defined only for active descriptors
      "range" : [                 (json array, optional) Defined only for ranged descriptors
        n,                        (numeric) Range start inclusive
        n                         (numeric) Range end inclusive
      ],
      "next" : n                  (numeric, optional) The next index to generate addresses from; defined only for ranged descriptors
    },
    ...
  ]
}

type ListDescriptorsRespDescriptors

type ListDescriptorsRespDescriptors struct {
	// Descriptor string representation
	Desc string `json:"desc"`

	// The creation time of the descriptor
	Timestamp float64 `json:"timestamp"`

	// Activeness flag
	Active bool `json:"active"`

	// Whether this is an internal or external descriptor; defined only for active descriptors
	Internal *bool `json:"internal,omitempty"`

	// Defined only for ranged descriptors
	// Element: N    Range start inclusive
	// n                         (numeric) Range end inclusive
	Range []float64 `json:"range,omitempty"`

	// The next index to generate addresses from; defined only for ranged descriptors
	Next *float64 `json:"next,omitempty"`
}

type ListLabelsReq

type ListLabelsReq struct {
	// Address purpose to list labels for ('send','receive'). An empty string is the same as not providing this argument.
	Purpose string `json:"purpose,omitempty"`
}

ListLabelsReq holds the arguments for the ListLabels call.

  1. purpose (string, optional) Address purpose to list labels for ('send','receive'). An empty string is the same as not providing this argument.

type ListLabelsResp

type ListLabelsResp struct {
	// Element: Str    Label name
	Str []string
}

ListLabelsResp holds the response to the ListLabels call.

[           (json array)
  "str",    (string) Label name
  ...
]

func (ListLabelsResp) MarshalJSON

func (alts ListLabelsResp) MarshalJSON() ([]byte, error)

func (*ListLabelsResp) UnmarshalJSON

func (alts *ListLabelsResp) UnmarshalJSON(b []byte) error

type ListLockUnspentResp

type ListLockUnspentResp struct {
	Array []ListLockUnspentRespElement
}

ListLockUnspentResp holds the response to the ListLockUnspent call.

[                      (json array)
  {                    (json object)
    "txid" : "hex",    (string) The transaction id locked
    "vout" : n         (numeric) The vout value
  },
  ...
]

func (ListLockUnspentResp) MarshalJSON

func (alts ListLockUnspentResp) MarshalJSON() ([]byte, error)

func (*ListLockUnspentResp) UnmarshalJSON

func (alts *ListLockUnspentResp) UnmarshalJSON(b []byte) error

type ListLockUnspentRespElement

type ListLockUnspentRespElement struct {
	// The transaction id locked
	TxID string `json:"txid"`

	// The vout value
	Vout float64 `json:"vout"`
}

type ListReceivedByAddressReq

type ListReceivedByAddressReq struct {
	// The minimum number of confirmations before payments are included.
	// Default: 1
	MinConf *float64 `json:"minconf,omitempty"`

	// Whether to include addresses that haven't received any payments.
	// Default: false
	IncludeEmpty bool `json:"include_empty,omitempty"`

	// Whether to include watch-only addresses (see 'importaddress')
	// Default: true for watch-only wallets, otherwise false
	IncludeWatchOnly *bool `json:"include_watchonly,omitempty"`

	// If present, only return information on this address.
	AddressFilter string `json:"address_filter,omitempty"`
}

ListReceivedByAddressReq holds the arguments for the ListReceivedByAddress call.

  1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.
  2. include_empty (boolean, optional, default=false) Whether to include addresses that haven't received any payments.
  3. include_watchonly (boolean, optional, default=true for watch-only wallets, otherwise false) Whether to include watch-only addresses (see 'importaddress')
  4. address_filter (string, optional) If present, only return information on this address.

type ListReceivedByAddressResp

type ListReceivedByAddressResp struct {
	Array []ListReceivedByAddressRespElement
}

ListReceivedByAddressResp holds the response to the ListReceivedByAddress call.

[                                        (json array)
  {                                      (json object)
    "involvesWatchonly" : true|false,    (boolean) Only returns true if imported addresses were involved in transaction
    "address" : "str",                   (string) The receiving address
    "amount" : n,                        (numeric) The total amount in BTC received by the address
    "confirmations" : n,                 (numeric) The number of confirmations of the most recent transaction included
    "label" : "str",                     (string) The label of the receiving address. The default label is ""
    "txids" : [                          (json array)
      "hex",                             (string) The ids of transactions received with the address
      ...
    ]
  },
  ...
]

func (ListReceivedByAddressResp) MarshalJSON

func (alts ListReceivedByAddressResp) MarshalJSON() ([]byte, error)

func (*ListReceivedByAddressResp) UnmarshalJSON

func (alts *ListReceivedByAddressResp) UnmarshalJSON(b []byte) error

type ListReceivedByAddressRespElement

type ListReceivedByAddressRespElement struct {
	// Only returns true if imported addresses were involved in transaction
	InvolvesWatchOnly bool `json:"involvesWatchonly"`

	// The receiving address
	Address string `json:"address"`

	// The total amount in BTC received by the address
	Amount float64 `json:"amount"`

	// The number of confirmations of the most recent transaction included
	Confirmations float64 `json:"confirmations"`

	// The label of the receiving address. The default label is ""
	Label string `json:"label"`

	// Element: Hex    The ids of transactions received with the address
	TxIDs []string `json:"txids"`
}

type ListReceivedByLabelReq

type ListReceivedByLabelReq struct {
	// The minimum number of confirmations before payments are included.
	// Default: 1
	MinConf *float64 `json:"minconf,omitempty"`

	// Whether to include labels that haven't received any payments.
	// Default: false
	IncludeEmpty bool `json:"include_empty,omitempty"`

	// Whether to include watch-only addresses (see 'importaddress')
	// Default: true for watch-only wallets, otherwise false
	IncludeWatchOnly *bool `json:"include_watchonly,omitempty"`
}

ListReceivedByLabelReq holds the arguments for the ListReceivedByLabel call.

  1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.
  2. include_empty (boolean, optional, default=false) Whether to include labels that haven't received any payments.
  3. include_watchonly (boolean, optional, default=true for watch-only wallets, otherwise false) Whether to include watch-only addresses (see 'importaddress')

type ListReceivedByLabelResp

type ListReceivedByLabelResp struct {
	Array []ListReceivedByLabelRespElement
}

ListReceivedByLabelResp holds the response to the ListReceivedByLabel call.

[                                        (json array)
  {                                      (json object)
    "involvesWatchonly" : true|false,    (boolean) Only returns true if imported addresses were involved in transaction
    "amount" : n,                        (numeric) The total amount received by addresses with this label
    "confirmations" : n,                 (numeric) The number of confirmations of the most recent transaction included
    "label" : "str"                      (string) The label of the receiving address. The default label is ""
  },
  ...
]

func (ListReceivedByLabelResp) MarshalJSON

func (alts ListReceivedByLabelResp) MarshalJSON() ([]byte, error)

func (*ListReceivedByLabelResp) UnmarshalJSON

func (alts *ListReceivedByLabelResp) UnmarshalJSON(b []byte) error

type ListReceivedByLabelRespElement

type ListReceivedByLabelRespElement struct {
	// Only returns true if imported addresses were involved in transaction
	InvolvesWatchOnly bool `json:"involvesWatchonly"`

	// The total amount received by addresses with this label
	Amount float64 `json:"amount"`

	// The number of confirmations of the most recent transaction included
	Confirmations float64 `json:"confirmations"`

	// The label of the receiving address. The default label is ""
	Label string `json:"label"`
}

type ListSinceBlockReq

type ListSinceBlockReq struct {
	// If set, the block hash to list transactions since, otherwise list all transactions.
	Blockhash string `json:"blockhash,omitempty"`

	// Return the nth block hash from the main chain. e.g. 1 would mean the best block hash. Note: this is not used as a filter, but only affects [lastblock] in the return value
	// Default: 1
	TargetConfirmations *float64 `json:"target_confirmations,omitempty"`

	// Include transactions to watch-only addresses (see 'importaddress')
	// Default: true for watch-only wallets, otherwise false
	IncludeWatchOnly *bool `json:"include_watchonly,omitempty"`

	// Show transactions that were removed due to a reorg in the "removed" array
	// (not guaranteed to work on pruned nodes)
	// Default: true
	IncludeRemoved *bool `json:"include_removed,omitempty"`
}

ListSinceBlockReq holds the arguments for the ListSinceBlock call.

  1. blockhash (string, optional) If set, the block hash to list transactions since, otherwise list all transactions.
  2. target_confirmations (numeric, optional, default=1) Return the nth block hash from the main chain. e.g. 1 would mean the best block hash. Note: this is not used as a filter, but only affects [lastblock] in the return value
  3. include_watchonly (boolean, optional, default=true for watch-only wallets, otherwise false) Include transactions to watch-only addresses (see 'importaddress')
  4. include_removed (boolean, optional, default=true) Show transactions that were removed due to a reorg in the "removed" array (not guaranteed to work on pruned nodes)

type ListSinceBlockResp

type ListSinceBlockResp struct {
	Transactions []ListSinceBlockRespTransactions `json:"transactions"`

	// <structure is the same as "transactions" above, only present if include_removed=true>
	// Note: transactions that were re-added in the active chain will appear as-is in this array, and may thus have a positive confirmation count.
	Removed []ListSinceBlockRespTransactions `json:"removed"`

	// The hash of the block (target_confirmations-1) from the best block on the main chain, or the genesis hash if the referenced block does not exist yet. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones
	LastBlock string `json:"lastblock"`
}

ListSinceBlockResp holds the response to the ListSinceBlock call.

{                                          (json object)
  "transactions" : [                       (json array)
    {                                      (json object)
      "involvesWatchonly" : true|false,    (boolean) Only returns true if imported addresses were involved in transaction.
      "address" : "str",                   (string) The bitcoin address of the transaction.
      "category" : "str",                  (string) The transaction category.
                                           "send"                  Transactions sent.
                                           "receive"               Non-coinbase transactions received.
                                           "generate"              Coinbase transactions received with more than 100 confirmations.
                                           "immature"              Coinbase transactions received with 100 or fewer confirmations.
                                           "orphan"                Orphaned coinbase transactions received.
      "amount" : n,                        (numeric) The amount in BTC. This is negative for the 'send' category, and is positive
                                           for all other categories
      "vout" : n,                          (numeric) the vout value
      "fee" : n,                           (numeric) The amount of the fee in BTC. This is negative and only available for the
                                           'send' category of transactions.
      "confirmations" : n,                 (numeric) The number of confirmations for the transaction. Negative confirmations means the
                                           transaction conflicted that many blocks ago.
      "generated" : true|false,            (boolean) Only present if transaction only input is a coinbase one.
      "trusted" : true|false,              (boolean) Only present if we consider transaction to be trusted and so safe to spend from.
      "blockhash" : "hex",                 (string) The block hash containing the transaction.
      "blockheight" : n,                   (numeric) The block height containing the transaction.
      "blockindex" : n,                    (numeric) The index of the transaction in the block that includes it.
      "blocktime" : xxx,                   (numeric) The block time expressed in UNIX epoch time.
      "txid" : "hex",                      (string) The transaction id.
      "walletconflicts" : [                (json array) Conflicting transaction ids.
        "hex",                             (string) The transaction id.
        ...
      ],
      "time" : xxx,                        (numeric) The transaction time expressed in UNIX epoch time.
      "timereceived" : xxx,                (numeric) The time received expressed in UNIX epoch time.
      "comment" : "str",                   (string) If a comment is associated with the transaction, only present if not empty.
      "bip125-replaceable" : "str",        (string) ("yes|no|unknown") Whether this transaction could be replaced due to BIP125 (replace-by-fee);
                                           may be unknown for unconfirmed transactions not in the mempool
      "abandoned" : true|false,            (boolean) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the
                                           'send' category of transactions.
      "label" : "str",                     (string) A comment for the address/transaction, if any
      "to" : "str"                         (string) If a comment to is associated with the transaction.
    },
    ...
  ],
  "removed" : [                            (json array) <structure is the same as "transactions" above, only present if include_removed=true>
                                           Note: transactions that were re-added in the active chain will appear as-is in this array, and may thus have a positive confirmation count.
    ...
  ],
  "lastblock" : "hex"                      (string) The hash of the block (target_confirmations-1) from the best block on the main chain, or the genesis hash if the referenced block does not exist yet. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones
}

type ListSinceBlockRespTransactions

type ListSinceBlockRespTransactions struct {
	// Only returns true if imported addresses were involved in transaction.
	InvolvesWatchOnly bool `json:"involvesWatchonly"`

	// The bitcoin address of the transaction.
	Address string `json:"address"`

	// The transaction category.
	// "send"                  Transactions sent.
	// "receive"               Non-coinbase transactions received.
	// "generate"              Coinbase transactions received with more than 100 confirmations.
	// "immature"              Coinbase transactions received with 100 or fewer confirmations.
	// "orphan"                Orphaned coinbase transactions received.
	Category string `json:"category"`

	// The amount in BTC. This is negative for the 'send' category, and is positive
	// for all other categories
	Amount float64 `json:"amount"`

	// the vout value
	Vout float64 `json:"vout"`

	// The amount of the fee in BTC. This is negative and only available for the
	// 'send' category of transactions.
	Fee float64 `json:"fee"`

	// The number of confirmations for the transaction. Negative confirmations means the
	// transaction conflicted that many blocks ago.
	Confirmations float64 `json:"confirmations"`

	// Only present if transaction only input is a coinbase one.
	Generated bool `json:"generated"`

	// Only present if we consider transaction to be trusted and so safe to spend from.
	Trusted bool `json:"trusted"`

	// The block hash containing the transaction.
	Blockhash string `json:"blockhash"`

	// The block height containing the transaction.
	BlockHeight float64 `json:"blockheight"`

	// The index of the transaction in the block that includes it.
	BlockIndex float64 `json:"blockindex"`

	// The block time expressed in UNIX epoch time.
	BlockTime float64 `json:"blocktime"`

	// The transaction id.
	TxID string `json:"txid"`

	// Conflicting transaction ids.
	// Element: Hex    The transaction id.
	WalletConflicts []string `json:"walletconflicts"`

	// The transaction time expressed in UNIX epoch time.
	Time float64 `json:"time"`

	// The time received expressed in UNIX epoch time.
	TimeReceived float64 `json:"timereceived"`

	// If a comment is associated with the transaction, only present if not empty.
	Comment string `json:"comment"`

	// ("yes|no|unknown") Whether this transaction could be replaced due to BIP125 (replace-by-fee);
	// may be unknown for unconfirmed transactions not in the mempool
	BIP125Replaceable string `json:"bip125-replaceable"`

	// 'true' if the transaction has been abandoned (inputs are respendable). Only available for the
	// 'send' category of transactions.
	Abandoned bool `json:"abandoned"`

	// A comment for the address/transaction, if any
	Label string `json:"label"`

	// If a comment to is associated with the transaction.
	To string `json:"to"`
}

type ListTransactionsReq

type ListTransactionsReq struct {
	// If set, should be a valid label name to return only incoming transactions
	// with the specified label, or "*" to disable filtering and return all transactions.
	Label string `json:"label,omitempty"`

	// The number of transactions to return
	// Default: 10
	Count *float64 `json:"count,omitempty"`

	// The number of transactions to skip
	// Default: 0
	Skip float64 `json:"skip,omitempty"`

	// Include transactions to watch-only addresses (see 'importaddress')
	// Default: true for watch-only wallets, otherwise false
	IncludeWatchOnly *bool `json:"include_watchonly,omitempty"`
}

ListTransactionsReq holds the arguments for the ListTransactions call.

  1. label (string, optional) If set, should be a valid label name to return only incoming transactions with the specified label, or "*" to disable filtering and return all transactions.
  2. count (numeric, optional, default=10) The number of transactions to return
  3. skip (numeric, optional, default=0) The number of transactions to skip
  4. include_watchonly (boolean, optional, default=true for watch-only wallets, otherwise false) Include transactions to watch-only addresses (see 'importaddress')

type ListTransactionsResp

type ListTransactionsResp struct {
	Array []ListTransactionsRespElement
}

ListTransactionsResp holds the response to the ListTransactions call.

[                                        (json array)
  {                                      (json object)
    "involvesWatchonly" : true|false,    (boolean) Only returns true if imported addresses were involved in transaction.
    "address" : "str",                   (string) The bitcoin address of the transaction.
    "category" : "str",                  (string) The transaction category.
                                         "send"                  Transactions sent.
                                         "receive"               Non-coinbase transactions received.
                                         "generate"              Coinbase transactions received with more than 100 confirmations.
                                         "immature"              Coinbase transactions received with 100 or fewer confirmations.
                                         "orphan"                Orphaned coinbase transactions received.
    "amount" : n,                        (numeric) The amount in BTC. This is negative for the 'send' category, and is positive
                                         for all other categories
    "label" : "str",                     (string) A comment for the address/transaction, if any
    "vout" : n,                          (numeric) the vout value
    "fee" : n,                           (numeric) The amount of the fee in BTC. This is negative and only available for the
                                         'send' category of transactions.
    "confirmations" : n,                 (numeric) The number of confirmations for the transaction. Negative confirmations means the
                                         transaction conflicted that many blocks ago.
    "generated" : true|false,            (boolean) Only present if transaction only input is a coinbase one.
    "trusted" : true|false,              (boolean) Only present if we consider transaction to be trusted and so safe to spend from.
    "blockhash" : "hex",                 (string) The block hash containing the transaction.
    "blockheight" : n,                   (numeric) The block height containing the transaction.
    "blockindex" : n,                    (numeric) The index of the transaction in the block that includes it.
    "blocktime" : xxx,                   (numeric) The block time expressed in UNIX epoch time.
    "txid" : "hex",                      (string) The transaction id.
    "walletconflicts" : [                (json array) Conflicting transaction ids.
      "hex",                             (string) The transaction id.
      ...
    ],
    "time" : xxx,                        (numeric) The transaction time expressed in UNIX epoch time.
    "timereceived" : xxx,                (numeric) The time received expressed in UNIX epoch time.
    "comment" : "str",                   (string) If a comment is associated with the transaction, only present if not empty.
    "bip125-replaceable" : "str",        (string) ("yes|no|unknown") Whether this transaction could be replaced due to BIP125 (replace-by-fee);
                                         may be unknown for unconfirmed transactions not in the mempool
    "abandoned" : true|false             (boolean) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the
                                         'send' category of transactions.
  },
  ...
]

func (ListTransactionsResp) MarshalJSON

func (alts ListTransactionsResp) MarshalJSON() ([]byte, error)

func (*ListTransactionsResp) UnmarshalJSON

func (alts *ListTransactionsResp) UnmarshalJSON(b []byte) error

type ListTransactionsRespElement

type ListTransactionsRespElement struct {
	// Only returns true if imported addresses were involved in transaction.
	InvolvesWatchOnly bool `json:"involvesWatchonly"`

	// The bitcoin address of the transaction.
	Address string `json:"address"`

	// The transaction category.
	// "send"                  Transactions sent.
	// "receive"               Non-coinbase transactions received.
	// "generate"              Coinbase transactions received with more than 100 confirmations.
	// "immature"              Coinbase transactions received with 100 or fewer confirmations.
	// "orphan"                Orphaned coinbase transactions received.
	Category string `json:"category"`

	// The amount in BTC. This is negative for the 'send' category, and is positive
	// for all other categories
	Amount float64 `json:"amount"`

	// A comment for the address/transaction, if any
	Label string `json:"label"`

	// the vout value
	Vout float64 `json:"vout"`

	// The amount of the fee in BTC. This is negative and only available for the
	// 'send' category of transactions.
	Fee float64 `json:"fee"`

	// The number of confirmations for the transaction. Negative confirmations means the
	// transaction conflicted that many blocks ago.
	Confirmations float64 `json:"confirmations"`

	// Only present if transaction only input is a coinbase one.
	Generated bool `json:"generated"`

	// Only present if we consider transaction to be trusted and so safe to spend from.
	Trusted bool `json:"trusted"`

	// The block hash containing the transaction.
	Blockhash string `json:"blockhash"`

	// The block height containing the transaction.
	BlockHeight float64 `json:"blockheight"`

	// The index of the transaction in the block that includes it.
	BlockIndex float64 `json:"blockindex"`

	// The block time expressed in UNIX epoch time.
	BlockTime float64 `json:"blocktime"`

	// The transaction id.
	TxID string `json:"txid"`

	// Conflicting transaction ids.
	// Element: Hex    The transaction id.
	WalletConflicts []string `json:"walletconflicts"`

	// The transaction time expressed in UNIX epoch time.
	Time float64 `json:"time"`

	// The time received expressed in UNIX epoch time.
	TimeReceived float64 `json:"timereceived"`

	// If a comment is associated with the transaction, only present if not empty.
	Comment string `json:"comment"`

	// ("yes|no|unknown") Whether this transaction could be replaced due to BIP125 (replace-by-fee);
	// may be unknown for unconfirmed transactions not in the mempool
	BIP125Replaceable string `json:"bip125-replaceable"`

	// 'true' if the transaction has been abandoned (inputs are respendable). Only available for the
	// 'send' category of transactions.
	Abandoned bool `json:"abandoned"`
}

type ListUnspentReq

type ListUnspentReq struct {
	// The minimum confirmations to filter
	// Default: 1
	MinConf *float64 `json:"minconf,omitempty"`

	// The maximum confirmations to filter
	// Default: 9999999
	MaxConf *float64 `json:"maxconf,omitempty"`

	// The bitcoin addresses to filter
	// Default: []
	// Element: Address    bitcoin address
	Addresses []string `json:"addresses,omitempty"`

	// Include outputs that are not safe to spend
	// See description of "safe" attribute below.
	// Default: true
	IncludeUnsafe *bool `json:"include_unsafe,omitempty"`

	// JSON with query options
	QueryOptions *ListUnspentReqQueryOptions `json:"query_options,omitempty"`
}

ListUnspentReq holds the arguments for the ListUnspent call.

  1. minconf (numeric, optional, default=1) The minimum confirmations to filter
  2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter
  3. addresses (json array, optional, default=[]) The bitcoin addresses to filter [ "address", (string) bitcoin address ... ]
  4. include_unsafe (boolean, optional, default=true) Include outputs that are not safe to spend See description of "safe" attribute below.
  5. query_options (json object, optional) JSON with query options { "minimumAmount": amount, (numeric or string, optional, default="0.00") Minimum value of each UTXO in BTC "maximumAmount": amount, (numeric or string, optional, default=unlimited) Maximum value of each UTXO in BTC "maximumCount": n, (numeric, optional, default=unlimited) Maximum number of UTXOs "minimumSumAmount": amount, (numeric or string, optional, default=unlimited) Minimum sum value of all UTXOs in BTC }

type ListUnspentReqQueryOptions

type ListUnspentReqQueryOptions struct {
	// Minimum value of each UTXO in BTC
	// Default: "0.00"
	MinimumAmount *float64 `json:"minimumAmount,omitempty"`

	// Maximum value of each UTXO in BTC
	// Default: unlimited
	MaximumAmount *float64 `json:"maximumAmount,omitempty"`

	// Maximum number of UTXOs
	// Default: unlimited
	MaximumCount *float64 `json:"maximumCount,omitempty"`

	// Minimum sum value of all UTXOs in BTC
	// Default: unlimited
	MinimumSumAmount *float64 `json:"minimumSumAmount,omitempty"`
}

type ListUnspentResp

type ListUnspentResp struct {
	Array []ListUnspentRespElement
}

ListUnspentResp holds the response to the ListUnspent call.

[                                (json array)
  {                              (json object)
    "txid" : "hex",              (string) the transaction id
    "vout" : n,                  (numeric) the vout value
    "address" : "str",           (string) the bitcoin address
    "label" : "str",             (string) The associated label, or "" for the default label
    "scriptPubKey" : "str",      (string) the script key
    "amount" : n,                (numeric) the transaction output amount in BTC
    "confirmations" : n,         (numeric) The number of confirmations
    "redeemScript" : "hex",      (string) The redeemScript if scriptPubKey is P2SH
    "witnessScript" : "str",     (string) witnessScript if the scriptPubKey is P2WSH or P2SH-P2WSH
    "spendable" : true|false,    (boolean) Whether we have the private keys to spend this output
    "solvable" : true|false,     (boolean) Whether we know how to spend this output, ignoring the lack of keys
    "reused" : true|false,       (boolean) (only present if avoid_reuse is set) Whether this output is reused/dirty (sent to an address that was previously spent from)
    "desc" : "str",              (string) (only when solvable) A descriptor for spending this output
    "safe" : true|false          (boolean) Whether this output is considered safe to spend. Unconfirmed transactions
                                 from outside keys and unconfirmed replacement transactions are considered unsafe
                                 and are not eligible for spending by fundrawtransaction and sendtoaddress.
  },
  ...
]

func (ListUnspentResp) MarshalJSON

func (alts ListUnspentResp) MarshalJSON() ([]byte, error)

func (*ListUnspentResp) UnmarshalJSON

func (alts *ListUnspentResp) UnmarshalJSON(b []byte) error

type ListUnspentRespElement

type ListUnspentRespElement struct {
	// the transaction id
	TxID string `json:"txid"`

	// the vout value
	Vout float64 `json:"vout"`

	// the bitcoin address
	Address string `json:"address"`

	// The associated label, or "" for the default label
	Label string `json:"label"`

	// the script key
	ScriptPubkey string `json:"scriptPubKey"`

	// the transaction output amount in BTC
	Amount float64 `json:"amount"`

	// The number of confirmations
	Confirmations float64 `json:"confirmations"`

	// The redeemScript if scriptPubKey is P2SH
	RedeemScript string `json:"redeemScript"`

	// witnessScript if the scriptPubKey is P2WSH or P2SH-P2WSH
	WitnessScript string `json:"witnessScript"`

	// Whether we have the private keys to spend this output
	Spendable bool `json:"spendable"`

	// Whether we know how to spend this output, ignoring the lack of keys
	Solvable bool `json:"solvable"`

	// (only present if avoid_reuse is set) Whether this output is reused/dirty (sent to an address that was previously spent from)
	Reused bool `json:"reused"`

	// (only when solvable) A descriptor for spending this output
	Desc string `json:"desc"`

	// Whether this output is considered safe to spend. Unconfirmed transactions
	// from outside keys and unconfirmed replacement transactions are considered unsafe
	// and are not eligible for spending by fundrawtransaction and sendtoaddress.
	Safe bool `json:"safe"`
}

type ListWalletDirResp

type ListWalletDirResp struct {
	Wallets []ListWalletDirRespWallets `json:"wallets"`
}

ListWalletDirResp holds the response to the ListWalletDir call.

{                        (json object)
  "wallets" : [          (json array)
    {                    (json object)
      "name" : "str"     (string) The wallet name
    },
    ...
  ]
}

type ListWalletDirRespWallets

type ListWalletDirRespWallets struct {
	// The wallet name
	Name string `json:"name"`
}

type ListWalletsResp

type ListWalletsResp struct {
	// Element: Str    the wallet name
	Str []string
}

ListWalletsResp holds the response to the ListWallets call.

[           (json array)
  "str",    (string) the wallet name
  ...
]

func (ListWalletsResp) MarshalJSON

func (alts ListWalletsResp) MarshalJSON() ([]byte, error)

func (*ListWalletsResp) UnmarshalJSON

func (alts *ListWalletsResp) UnmarshalJSON(b []byte) error

type LoadWalletReq

type LoadWalletReq struct {
	// The wallet directory or .dat file.
	FileName string `json:"filename"`

	// Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
	LoadOnStartup *bool `json:"load_on_startup,omitempty"`
}

LoadWalletReq holds the arguments for the LoadWallet call.

  1. filename (string, required) The wallet directory or .dat file.
  2. load_on_startup (boolean, optional) Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.

type LoadWalletResp

type LoadWalletResp struct {
	// The wallet name if loaded successfully.
	Name string `json:"name"`

	// Warning message if wallet was not loaded cleanly.
	Warning string `json:"warning"`
}

LoadWalletResp holds the response to the LoadWallet call.

{                       (json object)
  "name" : "str",       (string) The wallet name if loaded successfully.
  "warning" : "str"     (string) Warning message if wallet was not loaded cleanly.
}

type LockUnspentReq

type LockUnspentReq struct {
	// Whether to unlock (true) or lock (false) the specified transactions
	Unlock bool `json:"unlock"`

	// The transaction outputs and within each, the txid (string) vout (numeric).
	// Default: []
	Transactions []LockUnspentReqTransactions `json:"transactions,omitempty"`
}

LockUnspentReq holds the arguments for the LockUnspent call.

  1. unlock (boolean, required) Whether to unlock (true) or lock (false) the specified transactions
  2. transactions (json array, optional, default=[]) The transaction outputs and within each, the txid (string) vout (numeric). [ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number }, ... ]

type LockUnspentReqTransactions

type LockUnspentReqTransactions struct {
	// The transaction id
	TxID string `json:"txid"`

	// The output number
	Vout float64 `json:"vout"`
}

type LockUnspentResp

type LockUnspentResp struct {
	// Whether the command was successful or not
	TrueOrFalse bool
}

LockUnspentResp holds the response to the LockUnspent call.

true|false    (boolean) Whether the command was successful or not

func (LockUnspentResp) MarshalJSON

func (alts LockUnspentResp) MarshalJSON() ([]byte, error)

func (*LockUnspentResp) UnmarshalJSON

func (alts *LockUnspentResp) UnmarshalJSON(b []byte) error

type LoggingReq

type LoggingReq struct {
	// The categories to add to debug logging
	// Element: IncludeCategory    the valid logging category
	Include []string `json:"include,omitempty"`

	// The categories to remove from debug logging
	// Element: ExcludeCategory    the valid logging category
	Exclude []string `json:"exclude,omitempty"`
}

LoggingReq holds the arguments for the Logging call.

  1. include (json array, optional) The categories to add to debug logging [ "include_category", (string) the valid logging category ... ]
  2. exclude (json array, optional) The categories to remove from debug logging [ "exclude_category", (string) the valid logging category ... ]

type PreciousBlockReq

type PreciousBlockReq struct {
	// the hash of the block to mark as precious
	Blockhash string `json:"blockhash"`
}

PreciousBlockReq holds the arguments for the PreciousBlock call.

  1. blockhash (string, required) the hash of the block to mark as precious

type PrioritiseTransactionReq

type PrioritiseTransactionReq struct {
	// The transaction id.
	TxID string `json:"txid"`

	// The fee value (in satoshis) to add (or subtract, if negative).
	// Note, that this value is not a fee rate. It is a value to modify absolute fee of the TX.
	// The fee is not actually paid, only the algorithm for selecting transactions into a block
	// considers the transaction as it would have paid a higher (or lower) fee.
	FeeDelta float64 `json:"fee_delta"`
}

PrioritiseTransactionReq holds the arguments for the PrioritiseTransaction call.

  1. txid (string, required) The transaction id.
  2. dummy (numeric, optional) API-Compatibility for previous API. Must be zero or null. DEPRECATED. For forward compatibility use named arguments and omit this parameter.
  3. fee_delta (numeric, required) The fee value (in satoshis) to add (or subtract, if negative). Note, that this value is not a fee rate. It is a value to modify absolute fee of the TX. The fee is not actually paid, only the algorithm for selecting transactions into a block considers the transaction as it would have paid a higher (or lower) fee.

type PrioritiseTransactionResp

type PrioritiseTransactionResp struct {
	// Returns true
	TrueOrFalse bool
}

PrioritiseTransactionResp holds the response to the PrioritiseTransaction call.

true|false    (boolean) Returns true

func (PrioritiseTransactionResp) MarshalJSON

func (alts PrioritiseTransactionResp) MarshalJSON() ([]byte, error)

func (*PrioritiseTransactionResp) UnmarshalJSON

func (alts *PrioritiseTransactionResp) UnmarshalJSON(b []byte) error

type PruneBlockchainReq

type PruneBlockchainReq struct {
	// The block height to prune up to. May be set to a discrete height, or to a UNIX epoch time
	// to prune blocks whose block time is at least 2 hours older than the provided timestamp.
	Height float64 `json:"height"`
}

PruneBlockchainReq holds the arguments for the PruneBlockchain call.

  1. height (numeric, required) The block height to prune up to. May be set to a discrete height, or to a UNIX epoch time to prune blocks whose block time is at least 2 hours older than the provided timestamp.

type PruneBlockchainResp

type PruneBlockchainResp struct {
	// Height of the last block pruned
	N float64
}

PruneBlockchainResp holds the response to the PruneBlockchain call.

n    (numeric) Height of the last block pruned

func (PruneBlockchainResp) MarshalJSON

func (alts PruneBlockchainResp) MarshalJSON() ([]byte, error)

func (*PruneBlockchainResp) UnmarshalJSON

func (alts *PruneBlockchainResp) UnmarshalJSON(b []byte) error

type PsbtBumpFeeReq

type PsbtBumpFeeReq struct {
	// The txid to be bumped
	TxID string `json:"txid"`

	Options *PsbtBumpFeeReqOptions `json:"options,omitempty"`
}

PsbtBumpFeeReq holds the arguments for the PsbtBumpFee call.

  1. txid (string, required) The txid to be bumped
  2. options (json object, optional) { "conf_target": n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks

type PsbtBumpFeeReqOptions

type PsbtBumpFeeReqOptions struct {
	// Confirmation target in blocks
	// Default: wallet -txconfirmtarget
	ConfTarget *float64 `json:"conf_target,omitempty"`
}

type PsbtBumpFeeResp

type PsbtBumpFeeResp struct {
	// The base64-encoded unsigned PSBT of the new transaction.
	Psbt string `json:"psbt"`

	// The fee of the replaced transaction.
	OrigFee float64 `json:"origfee"`

	// The fee of the new transaction.
	Fee float64 `json:"fee"`

	// Errors encountered during processing (may be empty).
	// Element: Str
	Errors []string `json:"errors"`
}

PsbtBumpFeeResp holds the response to the PsbtBumpFee call.

{                    (json object)
  "psbt" : "str",    (string) The base64-encoded unsigned PSBT of the new transaction.
  "origfee" : n,     (numeric) The fee of the replaced transaction.
  "fee" : n,         (numeric) The fee of the new transaction.
  "errors" : [       (json array) Errors encountered during processing (may be empty).
    "str",           (string)
    ...
  ]
}

type RawMsg

type RawMsg struct {
	Serialized []byte // use encoding/hex.EncodeToString() to get it into the RPC method string format.
	Seq        uint32
}

RawMsg is a subscription event coming from a "raw"-type ZMQ message.

type ReadyOption

type ReadyOption func(*readyContext)

ReadyOption is a modifier of the Ready function.

func WithVersionCheck

func WithVersionCheck() ReadyOption

WithVersionCheck makes Ready check that the bitcoind major version (from "getnetworkinfo") matches that of this package.

func WithVersionCheckFn

func WithVersionCheckFn(checkFn func(bitcoindVersion int) bool) ReadyOption

WithVersionCheckFn makes Ready check that the bitcoind version (from "getnetworkinfo") passes the supplied checkFn. bitcoindVersion is a number with the format MMmmpp (M=Major, m=minor, p=patch). E.g. 220000 for v22.0.0.

func WithZmqMessageWithin

func WithZmqMessageWithin(period time.Duration) ReadyOption

WithZmqMessageWithin makes Ready check if there has arrived any subscribe event (ZMQ message) in the preceeding period of time.

ZMQ messages will only arrive if there are active subscriptions. To confirm that the connection is healthy you can for example do SubscribeSequence, then do Ready(WithZmqMessageWithin(time.Hour)) once per second until successful.

There is no way to detect a ZMQ connection error (other than the absence of success), this is an inherent drawback of the ZMQ protocol.

func WithoutRpc

func WithoutRpc() ReadyOption

WithoutRpc makes Ready not do an RPC call. Can be used in conjunction with WithZmqMessageWithin to only check the ZMQ connection.

type RemovePrunedFundsReq

type RemovePrunedFundsReq struct {
	// The hex-encoded id of the transaction you are deleting
	TxID string `json:"txid"`
}

RemovePrunedFundsReq holds the arguments for the RemovePrunedFunds call.

  1. txid (string, required) The hex-encoded id of the transaction you are deleting

type RescanBlockchainReq

type RescanBlockchainReq struct {
	// block height where the rescan should start
	// Default: 0
	StartHeight float64 `json:"start_height,omitempty"`

	// the last block height that should be scanned. If none is provided it will rescan up to the tip at return time of this call.
	StopHeight *float64 `json:"stop_height,omitempty"`
}

RescanBlockchainReq holds the arguments for the RescanBlockchain call.

  1. start_height (numeric, optional, default=0) block height where the rescan should start
  2. stop_height (numeric, optional) the last block height that should be scanned. If none is provided it will rescan up to the tip at return time of this call.

type RescanBlockchainResp

type RescanBlockchainResp struct {
	// The block height where the rescan started (the requested height or 0)
	StartHeight float64 `json:"start_height"`

	// The height of the last rescanned block. May be null in rare cases if there was a reorg and the call didn't scan any blocks because they were already scanned in the background.
	StopHeight float64 `json:"stop_height"`
}

RescanBlockchainResp holds the response to the RescanBlockchain call.

{                        (json object)
  "start_height" : n,    (numeric) The block height where the rescan started (the requested height or 0)
  "stop_height" : n      (numeric) The height of the last rescanned block. May be null in rare cases if there was a reorg and the call didn't scan any blocks because they were already scanned in the background.
}

type ScanTxOutSetReq

type ScanTxOutSetReq struct {
	// The action to execute
	// "start" for starting a scan
	// "abort" for aborting the current scan (returns true when abort was successful)
	// "status" for progress report (in %) of the current scan
	Action string `json:"action"`

	// Array of scan objects. Required for "start" action
	// Every scan object is either a string descriptor or an object:
	ScanObjects []ScanTxOutSetReqScanObjects `json:"scanobjects"`
}

ScanTxOutSetReq holds the arguments for the ScanTxOutSet call.

  1. action (string, required) The action to execute "start" for starting a scan "abort" for aborting the current scan (returns true when abort was successful) "status" for progress report (in %) of the current scan
  2. scanobjects (json array) Array of scan objects. Required for "start" action Every scan object is either a string descriptor or an object: [ "descriptor", (string) An output descriptor { (json object) An object with output descriptor and metadata "desc": "str", (string, required) An output descriptor "range": n or [n,n], (numeric or array, optional, default=1000) The range of HD chain indexes to explore (either end or [begin,end]) }, ... ]

type ScanTxOutSetReqScanObjects

type ScanTxOutSetReqScanObjects struct {
	// An output descriptor
	Descriptor string

	// An object with output descriptor and metadata
	A struct {
		// An output descriptor
		Desc string `json:"desc"`

		// The range of HD chain indexes to explore (either end or [begin,end])
		// Default: 1000
		Range *[2]int64 `json:"range,omitempty"`
	}
}

Holder of alternative parameter formats, only one will be used, the first that is non-zero.

func (ScanTxOutSetReqScanObjects) MarshalJSON

func (alts ScanTxOutSetReqScanObjects) MarshalJSON() ([]byte, error)

func (*ScanTxOutSetReqScanObjects) UnmarshalJSON

func (alts *ScanTxOutSetReqScanObjects) UnmarshalJSON(b []byte) error

type ScanTxOutSetResp

type ScanTxOutSetResp struct {
	TrueOrFalse bool

	WhenActionEqualsStatusAndScanIsInProgress ScanTxOutSetRespWhenActionEqualsStatusAndScanIsInProgress

	WhenActionEqualsStart ScanTxOutSetRespWhenActionEqualsStart
}

ScanTxOutSetResp holds the response to the ScanTxOutSet call.

ALTERNATIVE (When action=='abort')

true|false    (boolean)

ALTERNATIVE (When action=='status' and no scan is in progress)

null    (json null)

ALTERNATIVE (When action=='status' and scan is in progress)

{                    (json object)
  "progress" : n     (numeric) The scan progress
}

ALTERNATIVE (When action=='start')

{                                (json object)
  "success" : true|false,        (boolean) Whether the scan was completed
  "txouts" : n,                  (numeric) The number of unspent transaction outputs scanned
  "height" : n,                  (numeric) The current block height (index)
  "bestblock" : "hex",           (string) The hash of the block at the tip of the chain
  "unspents" : [                 (json array)
    {                            (json object)
      "txid" : "hex",            (string) The transaction id
      "vout" : n,                (numeric) The vout value
      "scriptPubKey" : "hex",    (string) The script key
      "desc" : "str",            (string) A specialized descriptor for the matched scriptPubKey
      "amount" : n,              (numeric) The total amount in BTC of the unspent output
      "height" : n               (numeric) Height of the unspent transaction output
    },
    ...
  ],
  "total_amount" : n             (numeric) The total amount of all found unspent outputs in BTC
}

func (ScanTxOutSetResp) MarshalJSON

func (alts ScanTxOutSetResp) MarshalJSON() ([]byte, error)

func (*ScanTxOutSetResp) UnmarshalJSON

func (alts *ScanTxOutSetResp) UnmarshalJSON(b []byte) error

type ScanTxOutSetRespWhenActionEqualsStart

type ScanTxOutSetRespWhenActionEqualsStart struct {
	// Whether the scan was completed
	Success bool `json:"success"`

	// The number of unspent transaction outputs scanned
	TxOuts float64 `json:"txouts"`

	// The current block height (index)
	Height float64 `json:"height"`

	// The hash of the block at the tip of the chain
	BestBlock string `json:"bestblock"`

	Unspents []ScanTxOutSetRespWhenActionEqualsStartUnspents `json:"unspents"`

	// The total amount of all found unspent outputs in BTC
	TotalAmount float64 `json:"total_amount"`
}

type ScanTxOutSetRespWhenActionEqualsStartUnspents

type ScanTxOutSetRespWhenActionEqualsStartUnspents struct {
	// The transaction id
	TxID string `json:"txid"`

	// The vout value
	Vout float64 `json:"vout"`

	// The script key
	ScriptPubkey string `json:"scriptPubKey"`

	// A specialized descriptor for the matched scriptPubKey
	Desc string `json:"desc"`

	// The total amount in BTC of the unspent output
	Amount float64 `json:"amount"`

	// Height of the unspent transaction output
	Height float64 `json:"height"`
}

type ScanTxOutSetRespWhenActionEqualsStatusAndScanIsInProgress

type ScanTxOutSetRespWhenActionEqualsStatusAndScanIsInProgress struct {
	// The scan progress
	Progress float64 `json:"progress"`
}

type SendManyReq

type SendManyReq struct {
	// Must be set to "" for backwards compatibility.
	Dummy string `json:"dummy"`

	// The addresses and amounts
	Amounts map[string]float64 `json:"amounts"`

	// A comment
	Comment string `json:"comment,omitempty"`

	// The addresses.
	// The fee will be equally deducted from the amount of each selected address.
	// Those recipients will receive less bitcoins than you enter in their corresponding amount field.
	// If no addresses are specified here, the sender pays the fee.
	// Element: Address    Subtract fee from this address
	SubtractFeeFrom []string `json:"subtractfeefrom,omitempty"`

	// Allow this transaction to be replaced by a transaction with higher fees via BIP 125
	// Default: wallet default
	Replaceable *bool `json:"replaceable,omitempty"`

	// Confirmation target in blocks
	// Default: wallet -txconfirmtarget
	ConfTarget *float64 `json:"conf_target,omitempty"`

	// The fee estimate mode, must be one of (case insensitive):
	// "unset"
	// "economical"
	// "conservative"
	// Default: "unset"
	EstimateMode string `json:"estimate_mode,omitempty"`

	// Specify a fee rate in sat/vB.
	// Default: not set, fall back to wallet fee estimation
	FeeRate *float64 `json:"fee_rate,omitempty"`

	// If true, return extra infomration about the transaction.
	// Default: false
	Verbose bool `json:"verbose,omitempty"`
}

SendManyReq holds the arguments for the SendMany call.

  1. dummy (string, required) Must be set to "" for backwards compatibility.
  2. amounts (json object, required) The addresses and amounts { "address": amount, (numeric or string, required) The bitcoin address is the key, the numeric amount (can be string) in BTC is the value ... }
  3. minconf (numeric, optional) Ignored dummy value
  4. comment (string, optional) A comment
  5. subtractfeefrom (json array, optional) The addresses. The fee will be equally deducted from the amount of each selected address. Those recipients will receive less bitcoins than you enter in their corresponding amount field. If no addresses are specified here, the sender pays the fee. [ "address", (string) Subtract fee from this address ... ]
  6. replaceable (boolean, optional, default=wallet default) Allow this transaction to be replaced by a transaction with higher fees via BIP 125
  7. conf_target (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks
  8. estimate_mode (string, optional, default="unset") The fee estimate mode, must be one of (case insensitive): "unset" "economical" "conservative"
  9. fee_rate (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB.
  10. verbose (boolean, optional, default=false) If true, return extra infomration about the transaction.

type SendManyResp

type SendManyResp struct {
	// The transaction id for the send. Only 1 transaction is created regardless of
	// the number of addresses.
	Hex string

	IfVerboseIsSetToTrue SendManyRespIfVerboseIsSetToTrue
}

SendManyResp holds the response to the SendMany call.

ALTERNATIVE (if verbose is not set or set to false)

"hex"    (string) The transaction id for the send. Only 1 transaction is created regardless of
         the number of addresses.

ALTERNATIVE (if verbose is set to true)

{                          (json object)
  "txid" : "hex",          (string) The transaction id for the send. Only 1 transaction is created regardless of
                           the number of addresses.
  "fee reason" : "str"     (string) The transaction fee reason.
}

func (SendManyResp) MarshalJSON

func (alts SendManyResp) MarshalJSON() ([]byte, error)

func (*SendManyResp) UnmarshalJSON

func (alts *SendManyResp) UnmarshalJSON(b []byte) error

type SendManyRespIfVerboseIsSetToTrue

type SendManyRespIfVerboseIsSetToTrue struct {
	// The transaction id for the send. Only 1 transaction is created regardless of
	// the number of addresses.
	TxID string `json:"txid"`

	// The transaction fee reason.
	FeeReason string `json:"fee reason"`
}

type SendRawTransactionReq

type SendRawTransactionReq struct {
	// The hex string of the raw transaction
	HexString string `json:"hexstring"`

	// Reject transactions whose fee rate is higher than the specified value, expressed in BTC/kvB.
	// Set to 0 to accept any fee rate.
	// Default: "0.10"
	MaxFeeRate *float64 `json:"maxfeerate,omitempty"`
}

SendRawTransactionReq holds the arguments for the SendRawTransaction call.

  1. hexstring (string, required) The hex string of the raw transaction
  2. maxfeerate (numeric or string, optional, default="0.10") Reject transactions whose fee rate is higher than the specified value, expressed in BTC/kvB. Set to 0 to accept any fee rate.

type SendRawTransactionResp

type SendRawTransactionResp struct {
	// The transaction hash in hex
	Hex string
}

SendRawTransactionResp holds the response to the SendRawTransaction call.

"hex"    (string) The transaction hash in hex

func (SendRawTransactionResp) MarshalJSON

func (alts SendRawTransactionResp) MarshalJSON() ([]byte, error)

func (*SendRawTransactionResp) UnmarshalJSON

func (alts *SendRawTransactionResp) UnmarshalJSON(b []byte) error

type SendReq

type SendReq struct {
	// The outputs (key-value pairs), where none of the keys are duplicated.
	// That is, each address can only appear once and there can only be one 'data' object.
	// For convenience, a dictionary, which holds the key-value pairs directly, is also accepted.
	Outputs []SendReqOutputs `json:"outputs"`

	// Confirmation target in blocks
	// Default: wallet -txconfirmtarget
	ConfTarget *float64 `json:"conf_target,omitempty"`

	// The fee estimate mode, must be one of (case insensitive):
	// "unset"
	// "economical"
	// "conservative"
	// Default: "unset"
	EstimateMode string `json:"estimate_mode,omitempty"`

	// Specify a fee rate in sat/vB.
	// Default: not set, fall back to wallet fee estimation
	FeeRate *float64 `json:"fee_rate,omitempty"`

	Options *SendReqOptions `json:"options,omitempty"`
}

SendReq holds the arguments for the Send call.

  1. outputs (json array, required) The outputs (key-value pairs), where none of the keys are duplicated. That is, each address can only appear once and there can only be one 'data' object. For convenience, a dictionary, which holds the key-value pairs directly, is also accepted. [ { (json object) "address": amount, (numeric or string, required) A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in BTC ... }, { (json object) "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data }, ... ]
  2. conf_target (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks
  3. estimate_mode (string, optional, default="unset") The fee estimate mode, must be one of (case insensitive): "unset" "economical" "conservative"
  4. fee_rate (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB.
  5. options (json object, optional) { "add_inputs": bool, (boolean, optional, default=false) If inputs are specified, automatically include more if they are not enough. "include_unsafe": bool, (boolean, optional, default=false) Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions). Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears. If that happens, you will need to fund the transaction with different inputs and republish it. "add_to_wallet": bool, (boolean, optional, default=true) When false, returns a serialized transaction which will not be added to the wallet or broadcast "change_address": "hex", (string, optional, default=pool address) The bitcoin address to receive the change "change_position": n, (numeric, optional, default=random) The index of the change output "change_type": "str", (string, optional, default=set by -changetype) The output type to use. Only valid if change_address is not specified. Options are "legacy", "p2sh-segwit", and "bech32". "conf_target": n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks "estimate_mode": "str", (string, optional, default="unset") The fee estimate mode, must be one of (case insensitive): "unset" "economical" "conservative" "fee_rate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB. "include_watching": bool, (boolean, optional, default=true for watch-only wallets, otherwise false) Also select inputs which are watch only. Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported, e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field. "inputs": [ (json array, optional, default=[]) Specify inputs instead of adding them automatically. A JSON array of JSON objects "txid", (string, required) The transaction id vout, (numeric, required) The output number sequence, (numeric, required) The sequence number ... ], "locktime": n, (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs "lock_unspents": bool, (boolean, optional, default=false) Lock selected unspent outputs "psbt": bool, (boolean, optional, default=automatic) Always return a PSBT, implies add_to_wallet=false. "subtract_fee_from_outputs": [ (json array, optional, default=[]) Outputs to subtract the fee from, specified as integer indices. The fee will be equally deducted from the amount of each specified output. Those recipients will receive less bitcoins than you enter in their corresponding amount field. If no outputs are specified here, the sender pays the fee. vout_index, (numeric) The zero-based output index, before a change output is added. ... ], "replaceable": bool, (boolean, optional, default=wallet default) Marks this transaction as BIP125 replaceable. Allows this transaction to be replaced by a transaction with higher fees }

type SendReqOptions

type SendReqOptions struct {
	// If inputs are specified, automatically include more if they are not enough.
	// Default: false
	AddInputs bool `json:"add_inputs,omitempty"`

	// Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).
	// Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.
	// If that happens, you will need to fund the transaction with different inputs and republish it.
	// Default: false
	IncludeUnsafe bool `json:"include_unsafe,omitempty"`

	// When false, returns a serialized transaction which will not be added to the wallet or broadcast
	// Default: true
	AddToWallet *bool `json:"add_to_wallet,omitempty"`

	// The bitcoin address to receive the change
	// Default: pool address
	Changeaddress string `json:"change_address,omitempty"`

	// The index of the change output
	// Default: random
	ChangePosition *float64 `json:"change_position,omitempty"`

	// The output type to use. Only valid if change_address is not specified. Options are "legacy", "p2sh-segwit", and "bech32".
	// Default: set by -changetype
	ChangeType string `json:"change_type,omitempty"`

	// Confirmation target in blocks
	// Default: wallet -txconfirmtarget
	ConfTarget *float64 `json:"conf_target,omitempty"`

	// The fee estimate mode, must be one of (case insensitive):
	// "unset"
	// "economical"
	// "conservative"
	// Default: "unset"
	EstimateMode string `json:"estimate_mode,omitempty"`

	// Specify a fee rate in sat/vB.
	// Default: not set, fall back to wallet fee estimation
	FeeRate *float64 `json:"fee_rate,omitempty"`

	// Also select inputs which are watch only.
	// Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported,
	// e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field.
	// Default: true for watch-only wallets, otherwise false
	IncludeWatching *bool `json:"include_watching,omitempty"`

	// Specify inputs instead of adding them automatically. A JSON array of JSON objects
	Inputs []SendReqOptionsInputs `json:"inputs,omitempty"`

	// Raw locktime. Non-0 value also locktime-activates inputs
	// Default: 0
	LockTime float64 `json:"locktime,omitempty"`

	// Lock selected unspent outputs
	// Default: false
	LockUnspents bool `json:"lock_unspents,omitempty"`

	// Always return a PSBT, implies add_to_wallet=false.
	// Default: automatic
	Psbt *bool `json:"psbt,omitempty"`

	// Outputs to subtract the fee from, specified as integer indices.
	// The fee will be equally deducted from the amount of each specified output.
	// Those recipients will receive less bitcoins than you enter in their corresponding amount field.
	// If no outputs are specified here, the sender pays the fee.
	// Element: VoutIndex    The zero-based output index, before a change output is added.
	SubtractFeeFromOutputs []float64 `json:"subtract_fee_from_outputs,omitempty"`

	// Marks this transaction as BIP125 replaceable.
	// Allows this transaction to be replaced by a transaction with higher fees
	// Default: wallet default
	Replaceable *bool `json:"replaceable,omitempty"`
}

type SendReqOptionsInputs

type SendReqOptionsInputs struct {
	// The transaction id
	TxID string

	// The output number
	Vout float64

	// The sequence number
	Sequence float64
}

Holder of alternative parameter formats, only one will be used, the first that is non-zero.

func (SendReqOptionsInputs) MarshalJSON

func (alts SendReqOptionsInputs) MarshalJSON() ([]byte, error)

func (*SendReqOptionsInputs) UnmarshalJSON

func (alts *SendReqOptionsInputs) UnmarshalJSON(b []byte) error

type SendReqOutputs

type SendReqOutputs struct {
	// A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in BTC
	A map[string]float64

	B struct {
		// A key-value pair. The key must be "data", the value is hex-encoded data
		Data string `json:"data"`
	}
}

Holder of alternative parameter formats, only one will be used, the first that is non-zero.

func (SendReqOutputs) MarshalJSON

func (alts SendReqOutputs) MarshalJSON() ([]byte, error)

func (*SendReqOutputs) UnmarshalJSON

func (alts *SendReqOutputs) UnmarshalJSON(b []byte) error

type SendResp

type SendResp struct {
	// If the transaction has a complete set of signatures
	Complete bool `json:"complete"`

	// The transaction id for the send. Only 1 transaction is created regardless of the number of addresses.
	TxID string `json:"txid"`

	// If add_to_wallet is false, the hex-encoded raw transaction with signature(s)
	Hex string `json:"hex"`

	// If more signatures are needed, or if add_to_wallet is false, the base64-encoded (partially) signed transaction
	Psbt string `json:"psbt"`
}

SendResp holds the response to the Send call.

{                             (json object)
  "complete" : true|false,    (boolean) If the transaction has a complete set of signatures
  "txid" : "hex",             (string) The transaction id for the send. Only 1 transaction is created regardless of the number of addresses.
  "hex" : "hex",              (string) If add_to_wallet is false, the hex-encoded raw transaction with signature(s)
  "psbt" : "str"              (string) If more signatures are needed, or if add_to_wallet is false, the base64-encoded (partially) signed transaction
}

type SendToAddressReq

type SendToAddressReq struct {
	// The bitcoin address to send to.
	Address string `json:"address"`

	// The amount in BTC to send. eg 0.1
	Amount float64 `json:"amount"`

	// A comment used to store what the transaction is for.
	// This is not part of the transaction, just kept in your wallet.
	Comment string `json:"comment,omitempty"`

	// A comment to store the name of the person or organization
	// to which you're sending the transaction. This is not part of the
	// transaction, just kept in your wallet.
	CommentTo string `json:"comment_to,omitempty"`

	// The fee will be deducted from the amount being sent.
	// The recipient will receive less bitcoins than you enter in the amount field.
	// Default: false
	SubtractFeeFromAmount bool `json:"subtractfeefromamount,omitempty"`

	// Allow this transaction to be replaced by a transaction with higher fees via BIP 125
	// Default: wallet default
	Replaceable *bool `json:"replaceable,omitempty"`

	// Confirmation target in blocks
	// Default: wallet -txconfirmtarget
	ConfTarget *float64 `json:"conf_target,omitempty"`

	// The fee estimate mode, must be one of (case insensitive):
	// "unset"
	// "economical"
	// "conservative"
	// Default: "unset"
	EstimateMode string `json:"estimate_mode,omitempty"`

	// (only available if avoid_reuse wallet flag is set) Avoid spending from dirty addresses; addresses are considered
	// dirty if they have previously been used in a transaction. If true, this also activates avoidpartialspends, grouping outputs by their addresses.
	// Default: true
	AvoidReuse *bool `json:"avoid_reuse,omitempty"`

	// Specify a fee rate in sat/vB.
	// Default: not set, fall back to wallet fee estimation
	FeeRate *float64 `json:"fee_rate,omitempty"`

	// If true, return extra information about the transaction.
	// Default: false
	Verbose bool `json:"verbose,omitempty"`
}

SendToAddressReq holds the arguments for the SendToAddress call.

  1. address (string, required) The bitcoin address to send to.
  2. amount (numeric or string, required) The amount in BTC to send. eg 0.1
  3. comment (string, optional) A comment used to store what the transaction is for. This is not part of the transaction, just kept in your wallet.
  4. comment_to (string, optional) A comment to store the name of the person or organization to which you're sending the transaction. This is not part of the transaction, just kept in your wallet.
  5. subtractfeefromamount (boolean, optional, default=false) The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field.
  6. replaceable (boolean, optional, default=wallet default) Allow this transaction to be replaced by a transaction with higher fees via BIP 125
  7. conf_target (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks
  8. estimate_mode (string, optional, default="unset") The fee estimate mode, must be one of (case insensitive): "unset" "economical" "conservative"
  9. avoid_reuse (boolean, optional, default=true) (only available if avoid_reuse wallet flag is set) Avoid spending from dirty addresses; addresses are considered dirty if they have previously been used in a transaction. If true, this also activates avoidpartialspends, grouping outputs by their addresses.
  10. fee_rate (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB.
  11. verbose (boolean, optional, default=false) If true, return extra information about the transaction.

type SendToAddressResp

type SendToAddressResp struct {
	// The transaction id.
	Hex string

	IfVerboseIsSetToTrue SendToAddressRespIfVerboseIsSetToTrue
}

SendToAddressResp holds the response to the SendToAddress call.

ALTERNATIVE (if verbose is not set or set to false)

"hex"    (string) The transaction id.

ALTERNATIVE (if verbose is set to true)

{                          (json object)
  "txid" : "hex",          (string) The transaction id.
  "fee reason" : "str"     (string) The transaction fee reason.
}

func (SendToAddressResp) MarshalJSON

func (alts SendToAddressResp) MarshalJSON() ([]byte, error)

func (*SendToAddressResp) UnmarshalJSON

func (alts *SendToAddressResp) UnmarshalJSON(b []byte) error

type SendToAddressRespIfVerboseIsSetToTrue

type SendToAddressRespIfVerboseIsSetToTrue struct {
	// The transaction id.
	TxID string `json:"txid"`

	// The transaction fee reason.
	FeeReason string `json:"fee reason"`
}

type SequenceEvent

type SequenceEvent int

SequenceEvent is an enum describing what event triggered the sequence message.

const (
	Invalid            SequenceEvent = iota
	BlockConnected                   // Blockhash connected
	BlockDisconnected                // Blockhash disconnected
	TransactionRemoved               // Transactionhash removed from mempool for non-block inclusion reason
	TransactionAdded                 // Transactionhash added mempool
)

func (SequenceEvent) String

func (se SequenceEvent) String() string

type SequenceMsg

type SequenceMsg struct {
	Hash       [32]byte // use encoding/hex.EncodeToString() to get it into the RPC method string format.
	Event      SequenceEvent
	MempoolSeq uint64
}

SequenceMsg is a subscription event coming from a "sequence" ZMQ message.

type SetBanReq

type SetBanReq struct {
	// The IP/Subnet (see getpeerinfo for nodes IP) with an optional netmask (default is /32 = single IP)
	SubNet string `json:"subnet"`

	// 'add' to add an IP/Subnet to the list, 'remove' to remove an IP/Subnet from the list
	Command string `json:"command"`

	// time in seconds how long (or until when if [absolute] is set) the IP is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)
	// Default: 0
	BanTime float64 `json:"bantime,omitempty"`

	// If set, the bantime must be an absolute timestamp expressed in UNIX epoch time
	// Default: false
	Absolute bool `json:"absolute,omitempty"`
}

SetBanReq holds the arguments for the SetBan call.

  1. subnet (string, required) The IP/Subnet (see getpeerinfo for nodes IP) with an optional netmask (default is /32 = single IP)
  2. command (string, required) 'add' to add an IP/Subnet to the list, 'remove' to remove an IP/Subnet from the list
  3. bantime (numeric, optional, default=0) time in seconds how long (or until when if [absolute] is set) the IP is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)
  4. absolute (boolean, optional, default=false) If set, the bantime must be an absolute timestamp expressed in UNIX epoch time

type SetHDSeedReq

type SetHDSeedReq struct {
	// Whether to flush old unused addresses, including change addresses, from the keypool and regenerate it.
	// If true, the next address from getnewaddress and change address from getrawchangeaddress will be from this new seed.
	// If false, addresses (including change addresses if the wallet already had HD Chain Split enabled) from the existing
	// keypool will be used until it has been depleted.
	// Default: true
	NewKeypool *bool `json:"newkeypool,omitempty"`

	// The WIF private key to use as the new HD seed.
	// The seed value can be retrieved using the dumpwallet command. It is the private key marked hdseed=1
	// Default: random seed
	Seed string `json:"seed,omitempty"`
}

SetHDSeedReq holds the arguments for the SetHDSeed call.

  1. newkeypool (boolean, optional, default=true) Whether to flush old unused addresses, including change addresses, from the keypool and regenerate it. If true, the next address from getnewaddress and change address from getrawchangeaddress will be from this new seed. If false, addresses (including change addresses if the wallet already had HD Chain Split enabled) from the existing keypool will be used until it has been depleted.
  2. seed (string, optional, default=random seed) The WIF private key to use as the new HD seed. The seed value can be retrieved using the dumpwallet command. It is the private key marked hdseed=1

type SetLabelReq

type SetLabelReq struct {
	// The bitcoin address to be associated with a label.
	Address string `json:"address"`

	// The label to assign to the address.
	Label string `json:"label"`
}

SetLabelReq holds the arguments for the SetLabel call.

  1. address (string, required) The bitcoin address to be associated with a label.
  2. label (string, required) The label to assign to the address.

type SetNetworkActiveReq

type SetNetworkActiveReq struct {
	// true to enable networking, false to disable
	State bool `json:"state"`
}

SetNetworkActiveReq holds the arguments for the SetNetworkActive call.

  1. state (boolean, required) true to enable networking, false to disable

type SetNetworkActiveResp

type SetNetworkActiveResp struct {
	// The value that was passed in
	TrueOrFalse bool
}

SetNetworkActiveResp holds the response to the SetNetworkActive call.

true|false    (boolean) The value that was passed in

func (SetNetworkActiveResp) MarshalJSON

func (alts SetNetworkActiveResp) MarshalJSON() ([]byte, error)

func (*SetNetworkActiveResp) UnmarshalJSON

func (alts *SetNetworkActiveResp) UnmarshalJSON(b []byte) error

type SetTxFeeReq

type SetTxFeeReq struct {
	// The transaction fee rate in BTC/kvB
	Amount float64 `json:"amount"`
}

SetTxFeeReq holds the arguments for the SetTxFee call.

  1. amount (numeric or string, required) The transaction fee rate in BTC/kvB

type SetTxFeeResp

type SetTxFeeResp struct {
	// Returns true if successful
	TrueOrFalse bool
}

SetTxFeeResp holds the response to the SetTxFee call.

true|false    (boolean) Returns true if successful

func (SetTxFeeResp) MarshalJSON

func (alts SetTxFeeResp) MarshalJSON() ([]byte, error)

func (*SetTxFeeResp) UnmarshalJSON

func (alts *SetTxFeeResp) UnmarshalJSON(b []byte) error

type SetWalletFlagReq

type SetWalletFlagReq struct {
	// The name of the flag to change. Current available flags: avoid_reuse
	Flag string `json:"flag"`

	// The new state.
	// Default: true
	Value *bool `json:"value,omitempty"`
}

SetWalletFlagReq holds the arguments for the SetWalletFlag call.

  1. flag (string, required) The name of the flag to change. Current available flags: avoid_reuse
  2. value (boolean, optional, default=true) The new state.

type SetWalletFlagResp

type SetWalletFlagResp struct {
	// The name of the flag that was modified
	FlagName string `json:"flag_name"`

	// The new state of the flag
	FlagState bool `json:"flag_state"`

	// Any warnings associated with the change
	Warnings string `json:"warnings"`
}

SetWalletFlagResp holds the response to the SetWalletFlag call.

{                               (json object)
  "flag_name" : "str",          (string) The name of the flag that was modified
  "flag_state" : true|false,    (boolean) The new state of the flag
  "warnings" : "str"            (string) Any warnings associated with the change
}

type SignMessageReq

type SignMessageReq struct {
	// The bitcoin address to use for the private key.
	Address string `json:"address"`

	// The message to create a signature of.
	Message string `json:"message"`
}

SignMessageReq holds the arguments for the SignMessage call.

  1. address (string, required) The bitcoin address to use for the private key.
  2. message (string, required) The message to create a signature of.

type SignMessageResp

type SignMessageResp struct {
	// The signature of the message encoded in base 64
	Str string
}

SignMessageResp holds the response to the SignMessage call.

"str"    (string) The signature of the message encoded in base 64

func (SignMessageResp) MarshalJSON

func (alts SignMessageResp) MarshalJSON() ([]byte, error)

func (*SignMessageResp) UnmarshalJSON

func (alts *SignMessageResp) UnmarshalJSON(b []byte) error

type SignMessageWithPrivkeyReq

type SignMessageWithPrivkeyReq struct {
	// The private key to sign the message with.
	Privkey string `json:"privkey"`

	// The message to create a signature of.
	Message string `json:"message"`
}

SignMessageWithPrivkeyReq holds the arguments for the SignMessageWithPrivkey call.

  1. privkey (string, required) The private key to sign the message with.
  2. message (string, required) The message to create a signature of.

type SignMessageWithPrivkeyResp

type SignMessageWithPrivkeyResp struct {
	// The signature of the message encoded in base 64
	Str string
}

SignMessageWithPrivkeyResp holds the response to the SignMessageWithPrivkey call.

"str"    (string) The signature of the message encoded in base 64

func (SignMessageWithPrivkeyResp) MarshalJSON

func (alts SignMessageWithPrivkeyResp) MarshalJSON() ([]byte, error)

func (*SignMessageWithPrivkeyResp) UnmarshalJSON

func (alts *SignMessageWithPrivkeyResp) UnmarshalJSON(b []byte) error

type SignRawTransactionWithKeyReq

type SignRawTransactionWithKeyReq struct {
	// The transaction hex string
	HexString string `json:"hexstring"`

	// The base58-encoded private keys for signing
	// Element: PrivateKey    private key in base58-encoding
	Privkeys []string `json:"privkeys"`

	// The previous dependent transaction outputs
	PrevTxs []SignRawTransactionWithKeyReqPrevTxs `json:"prevtxs,omitempty"`

	// The signature hash type. Must be one of:
	// "DEFAULT"
	// "ALL"
	// "NONE"
	// "SINGLE"
	// "ALL|ANYONECANPAY"
	// "NONE|ANYONECANPAY"
	// "SINGLE|ANYONECANPAY"
	// Default: "DEFAULT"
	SigHashType string `json:"sighashtype,omitempty"`
}

SignRawTransactionWithKeyReq holds the arguments for the SignRawTransactionWithKey call.

  1. hexstring (string, required) The transaction hex string
  2. privkeys (json array, required) The base58-encoded private keys for signing [ "privatekey", (string) private key in base58-encoding ... ]
  3. prevtxs (json array, optional) The previous dependent transaction outputs [ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "scriptPubKey": "hex", (string, required) script key "redeemScript": "hex", (string) (required for P2SH) redeem script "witnessScript": "hex", (string) (required for P2WSH or P2SH-P2WSH) witness script "amount": amount, (numeric or string) (required for Segwit inputs) the amount spent }, ... ]
  4. sighashtype (string, optional, default="DEFAULT") The signature hash type. Must be one of: "DEFAULT" "ALL" "NONE" "SINGLE" "ALL|ANYONECANPAY" "NONE|ANYONECANPAY" "SINGLE|ANYONECANPAY"

type SignRawTransactionWithKeyReqPrevTxs

type SignRawTransactionWithKeyReqPrevTxs struct {
	// The transaction id
	TxID string `json:"txid"`

	// The output number
	Vout float64 `json:"vout"`

	// script key
	ScriptPubkey string `json:"scriptPubKey"`

	// (required for P2SH) redeem script
	RedeemScript string `json:"redeemScript"`

	// (required for P2WSH or P2SH-P2WSH) witness script
	WitnessScript string `json:"witnessScript"`

	// (required for Segwit inputs) the amount spent
	Amount float64 `json:"amount"`
}

type SignRawTransactionWithKeyResp

type SignRawTransactionWithKeyResp struct {
	// The hex-encoded raw transaction with signature(s)
	Hex string `json:"hex"`

	// If the transaction has a complete set of signatures
	Complete bool `json:"complete"`

	// Script verification errors (if there are any)
	Errors []SignRawTransactionWithKeyRespErrors `json:"errors,omitempty"`
}

SignRawTransactionWithKeyResp holds the response to the SignRawTransactionWithKey call.

{                             (json object)
  "hex" : "hex",              (string) The hex-encoded raw transaction with signature(s)
  "complete" : true|false,    (boolean) If the transaction has a complete set of signatures
  "errors" : [                (json array, optional) Script verification errors (if there are any)
    {                         (json object)
      "txid" : "hex",         (string) The hash of the referenced, previous transaction
      "vout" : n,             (numeric) The index of the output to spent and used as input
      "scriptSig" : "hex",    (string) The hex-encoded signature script
      "sequence" : n,         (numeric) Script sequence number
      "error" : "str"         (string) Verification or signing error related to the input
    },
    ...
  ]
}

type SignRawTransactionWithKeyRespErrors

type SignRawTransactionWithKeyRespErrors struct {
	// The hash of the referenced, previous transaction
	TxID string `json:"txid"`

	// The index of the output to spent and used as input
	Vout float64 `json:"vout"`

	// The hex-encoded signature script
	ScriptSig string `json:"scriptSig"`

	// Script sequence number
	Sequence float64 `json:"sequence"`

	// Verification or signing error related to the input
	Error string `json:"error"`
}

type SignRawTransactionWithWalletReq

type SignRawTransactionWithWalletReq struct {
	// The transaction hex string
	HexString string `json:"hexstring"`

	// The previous dependent transaction outputs
	PrevTxs []SignRawTransactionWithWalletReqPrevTxs `json:"prevtxs,omitempty"`

	// The signature hash type. Must be one of
	// "DEFAULT"
	// "ALL"
	// "NONE"
	// "SINGLE"
	// "ALL|ANYONECANPAY"
	// "NONE|ANYONECANPAY"
	// "SINGLE|ANYONECANPAY"
	// Default: "DEFAULT"
	SigHashType string `json:"sighashtype,omitempty"`
}

SignRawTransactionWithWalletReq holds the arguments for the SignRawTransactionWithWallet call.

  1. hexstring (string, required) The transaction hex string
  2. prevtxs (json array, optional) The previous dependent transaction outputs [ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "scriptPubKey": "hex", (string, required) script key "redeemScript": "hex", (string) (required for P2SH) redeem script "witnessScript": "hex", (string) (required for P2WSH or P2SH-P2WSH) witness script "amount": amount, (numeric or string) (required for Segwit inputs) the amount spent }, ... ]
  3. sighashtype (string, optional, default="DEFAULT") The signature hash type. Must be one of "DEFAULT" "ALL" "NONE" "SINGLE" "ALL|ANYONECANPAY" "NONE|ANYONECANPAY" "SINGLE|ANYONECANPAY"

type SignRawTransactionWithWalletReqPrevTxs

type SignRawTransactionWithWalletReqPrevTxs struct {
	// The transaction id
	TxID string `json:"txid"`

	// The output number
	Vout float64 `json:"vout"`

	// script key
	ScriptPubkey string `json:"scriptPubKey"`

	// (required for P2SH) redeem script
	RedeemScript string `json:"redeemScript"`

	// (required for P2WSH or P2SH-P2WSH) witness script
	WitnessScript string `json:"witnessScript"`

	// (required for Segwit inputs) the amount spent
	Amount float64 `json:"amount"`
}

type SignRawTransactionWithWalletResp

type SignRawTransactionWithWalletResp struct {
	// The hex-encoded raw transaction with signature(s)
	Hex string `json:"hex"`

	// If the transaction has a complete set of signatures
	Complete bool `json:"complete"`

	// Script verification errors (if there are any)
	Errors []SignRawTransactionWithWalletRespErrors `json:"errors,omitempty"`
}

SignRawTransactionWithWalletResp holds the response to the SignRawTransactionWithWallet call.

{                             (json object)
  "hex" : "hex",              (string) The hex-encoded raw transaction with signature(s)
  "complete" : true|false,    (boolean) If the transaction has a complete set of signatures
  "errors" : [                (json array, optional) Script verification errors (if there are any)
    {                         (json object)
      "txid" : "hex",         (string) The hash of the referenced, previous transaction
      "vout" : n,             (numeric) The index of the output to spent and used as input
      "scriptSig" : "hex",    (string) The hex-encoded signature script
      "sequence" : n,         (numeric) Script sequence number
      "error" : "str"         (string) Verification or signing error related to the input
    },
    ...
  ]
}

type SignRawTransactionWithWalletRespErrors

type SignRawTransactionWithWalletRespErrors struct {
	// The hash of the referenced, previous transaction
	TxID string `json:"txid"`

	// The index of the output to spent and used as input
	Vout float64 `json:"vout"`

	// The hex-encoded signature script
	ScriptSig string `json:"scriptSig"`

	// Script sequence number
	Sequence float64 `json:"sequence"`

	// Verification or signing error related to the input
	Error string `json:"error"`
}

type StopResp

type StopResp struct {
	// A string with the content 'Bitcoin Core stopping'
	Str string
}

StopResp holds the response to the Stop call.

"str"    (string) A string with the content 'Bitcoin Core stopping'

func (StopResp) MarshalJSON

func (alts StopResp) MarshalJSON() ([]byte, error)

func (*StopResp) UnmarshalJSON

func (alts *StopResp) UnmarshalJSON(b []byte) error

type SubmitBlockReq

type SubmitBlockReq struct {
	// the hex-encoded block data to submit
	HexData string `json:"hexdata"`
}

SubmitBlockReq holds the arguments for the SubmitBlock call.

  1. hexdata (string, required) the hex-encoded block data to submit
  2. dummy (string, optional, default=ignored) dummy value, for compatibility with BIP22. This value is ignored.

type SubmitBlockResp

type SubmitBlockResp struct {
	// According to BIP22
	Str string
}

SubmitBlockResp holds the response to the SubmitBlock call.

ALTERNATIVE (If the block was accepted)

null    (json null)

ALTERNATIVE (Otherwise)

"str"    (string) According to BIP22

func (SubmitBlockResp) MarshalJSON

func (alts SubmitBlockResp) MarshalJSON() ([]byte, error)

func (*SubmitBlockResp) UnmarshalJSON

func (alts *SubmitBlockResp) UnmarshalJSON(b []byte) error

type SubmitHeaderReq

type SubmitHeaderReq struct {
	// the hex-encoded block header data
	HexData string `json:"hexdata"`
}

SubmitHeaderReq holds the arguments for the SubmitHeader call.

  1. hexdata (string, required) the hex-encoded block header data

type TestMempoolAcceptReq

type TestMempoolAcceptReq struct {
	// An array of hex strings of raw transactions.
	// Element: RawTx
	RawTxs []string `json:"rawtxs"`

	// Reject transactions whose fee rate is higher than the specified value, expressed in BTC/kvB
	// Default: "0.10"
	MaxFeeRate *float64 `json:"maxfeerate,omitempty"`
}

TestMempoolAcceptReq holds the arguments for the TestMempoolAccept call.

  1. rawtxs (json array, required) An array of hex strings of raw transactions. [ "rawtx", (string) ... ]
  2. maxfeerate (numeric or string, optional, default="0.10") Reject transactions whose fee rate is higher than the specified value, expressed in BTC/kvB

type TestMempoolAcceptResp

type TestMempoolAcceptResp struct {
	// The result of the mempool acceptance test for each raw transaction in the input array.
	// Returns results for each transaction in the same order they were passed in.
	// It is possible for transactions to not be fully validated ('allowed' unset) if another transaction failed.
	Array []TestMempoolAcceptRespElement
}

TestMempoolAcceptResp holds the response to the TestMempoolAccept call.

[                               (json array) The result of the mempool acceptance test for each raw transaction in the input array.
                                Returns results for each transaction in the same order they were passed in.
                                It is possible for transactions to not be fully validated ('allowed' unset) if another transaction failed.
  {                             (json object)
    "txid" : "hex",             (string) The transaction hash in hex
    "wtxid" : "hex",            (string) The transaction witness hash in hex
    "package-error" : "str",    (string) Package validation error, if any (only possible if rawtxs had more than 1 transaction).
    "allowed" : true|false,     (boolean) Whether this tx would be accepted to the mempool and pass client-specified maxfeerate.If not present, the tx was not fully validated due to a failure in another tx in the list.
    "vsize" : n,                (numeric) Virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted (only present when 'allowed' is true)
    "fees" : {                  (json object) Transaction fees (only present if 'allowed' is true)
      "base" : n                (numeric) transaction fee in BTC
    },
    "reject-reason" : "str"     (string) Rejection string (only present when 'allowed' is false)
  },
  ...
]

func (TestMempoolAcceptResp) MarshalJSON

func (alts TestMempoolAcceptResp) MarshalJSON() ([]byte, error)

func (*TestMempoolAcceptResp) UnmarshalJSON

func (alts *TestMempoolAcceptResp) UnmarshalJSON(b []byte) error

type TestMempoolAcceptRespElement

type TestMempoolAcceptRespElement struct {
	// The transaction hash in hex
	TxID string `json:"txid"`

	// The transaction witness hash in hex
	WTxID string `json:"wtxid"`

	// Package validation error, if any (only possible if rawtxs had more than 1 transaction).
	PackageError string `json:"package-error"`

	// Whether this tx would be accepted to the mempool and pass client-specified maxfeerate.If not present, the tx was not fully validated due to a failure in another tx in the list.
	Allowed bool `json:"allowed"`

	// Virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted (only present when 'allowed' is true)
	VSize float64 `json:"vsize"`

	// Transaction fees (only present if 'allowed' is true)
	Fees struct {
		// transaction fee in BTC
		Base float64 `json:"base"`
	} `json:"fees"`

	// Rejection string (only present when 'allowed' is false)
	RejectReason string `json:"reject-reason"`
}

The result of the mempool acceptance test for each raw transaction in the input array. Returns results for each transaction in the same order they were passed in. It is possible for transactions to not be fully validated ('allowed' unset) if another transaction failed.

type UnloadWalletReq

type UnloadWalletReq struct {
	// The name of the wallet to unload. If provided both here and in the RPC endpoint, the two must be identical.
	// Default: the wallet name from the RPC endpoint
	WalletName string `json:"wallet_name,omitempty"`

	// Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
	LoadOnStartup *bool `json:"load_on_startup,omitempty"`
}

UnloadWalletReq holds the arguments for the UnloadWallet call.

  1. wallet_name (string, optional, default=the wallet name from the RPC endpoint) The name of the wallet to unload. If provided both here and in the RPC endpoint, the two must be identical.
  2. load_on_startup (boolean, optional) Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.

type UnloadWalletResp

type UnloadWalletResp struct {
	// Warning message if wallet was not unloaded cleanly.
	Warning string `json:"warning"`
}

UnloadWalletResp holds the response to the UnloadWallet call.

{                       (json object)
  "warning" : "str"     (string) Warning message if wallet was not unloaded cleanly.
}

type UnmarshalError

type UnmarshalError struct {
	B []byte
	// contains filtered or unexported fields
}

UnmarshalError indicates a problem with unmarshaling JSON data. The data is provided in the member B, can be used for debugging.

func (*UnmarshalError) Error

func (err *UnmarshalError) Error() string

type UpgradeWalletReq

type UpgradeWalletReq struct {
	// The version number to upgrade to. Default is the latest wallet version.
	// Default: 169900
	Version *float64 `json:"version,omitempty"`
}

UpgradeWalletReq holds the arguments for the UpgradeWallet call.

  1. version (numeric, optional, default=169900) The version number to upgrade to. Default is the latest wallet version.

type UpgradeWalletResp

type UpgradeWalletResp struct {
	// Name of wallet this operation was performed on
	WalletName string `json:"wallet_name"`

	// Version of wallet before this operation
	PreviousVersion float64 `json:"previous_version"`

	// Version of wallet after this operation
	CurrentVersion float64 `json:"current_version"`

	// Description of result, if no error
	Result string `json:"result,omitempty"`

	// Error message (if there is one)
	Error string `json:"error,omitempty"`
}

UpgradeWalletResp holds the response to the UpgradeWallet call.

{                            (json object)
  "wallet_name" : "str",     (string) Name of wallet this operation was performed on
  "previous_version" : n,    (numeric) Version of wallet before this operation
  "current_version" : n,     (numeric) Version of wallet after this operation
  "result" : "str",          (string, optional) Description of result, if no error
  "error" : "str"            (string, optional) Error message (if there is one)
}

type UptimeResp

type UptimeResp struct {
	// The number of seconds that the server has been running
	N float64
}

UptimeResp holds the response to the Uptime call.

n    (numeric) The number of seconds that the server has been running

func (UptimeResp) MarshalJSON

func (alts UptimeResp) MarshalJSON() ([]byte, error)

func (*UptimeResp) UnmarshalJSON

func (alts *UptimeResp) UnmarshalJSON(b []byte) error

type UtxoUpdatePsbtReq

type UtxoUpdatePsbtReq struct {
	// A base64 string of a PSBT
	Psbt string `json:"psbt"`

	// An array of either strings or objects
	Descriptors []UtxoUpdatePsbtReqDescriptors `json:"descriptors,omitempty"`
}

UtxoUpdatePsbtReq holds the arguments for the UtxoUpdatePsbt call.

  1. psbt (string, required) A base64 string of a PSBT
  2. descriptors (json array, optional) An array of either strings or objects [ "", (string) An output descriptor { (json object) An object with an output descriptor and extra information "desc": "str", (string, required) An output descriptor "range": n or [n,n], (numeric or array, optional, default=1000) Up to what index HD chains should be explored (either end or [begin,end]) }, ... ]

type UtxoUpdatePsbtReqDescriptors

type UtxoUpdatePsbtReqDescriptors struct {
	// An output descriptor
	A string

	// An object with an output descriptor and extra information
	B struct {
		// An output descriptor
		Desc string `json:"desc"`

		// Up to what index HD chains should be explored (either end or [begin,end])
		// Default: 1000
		Range *[2]int64 `json:"range,omitempty"`
	}
}

Holder of alternative parameter formats, only one will be used, the first that is non-zero.

func (UtxoUpdatePsbtReqDescriptors) MarshalJSON

func (alts UtxoUpdatePsbtReqDescriptors) MarshalJSON() ([]byte, error)

func (*UtxoUpdatePsbtReqDescriptors) UnmarshalJSON

func (alts *UtxoUpdatePsbtReqDescriptors) UnmarshalJSON(b []byte) error

type UtxoUpdatePsbtResp

type UtxoUpdatePsbtResp struct {
	// The base64-encoded partially signed transaction with inputs updated
	Str string
}

UtxoUpdatePsbtResp holds the response to the UtxoUpdatePsbt call.

"str"    (string) The base64-encoded partially signed transaction with inputs updated

func (UtxoUpdatePsbtResp) MarshalJSON

func (alts UtxoUpdatePsbtResp) MarshalJSON() ([]byte, error)

func (*UtxoUpdatePsbtResp) UnmarshalJSON

func (alts *UtxoUpdatePsbtResp) UnmarshalJSON(b []byte) error

type ValidateAddressReq

type ValidateAddressReq struct {
	// The bitcoin address to validate
	Address string `json:"address"`
}

ValidateAddressReq holds the arguments for the ValidateAddress call.

  1. address (string, required) The bitcoin address to validate

type ValidateAddressResp

type ValidateAddressResp struct {
	// If the address is valid or not
	IsValid bool `json:"isvalid"`

	// The bitcoin address validated
	Address string `json:"address"`

	// The hex-encoded scriptPubKey generated by the address
	ScriptPubkey string `json:"scriptPubKey"`

	// If the key is a script
	IsScript bool `json:"isscript"`

	// If the address is a witness address
	IsWitness bool `json:"iswitness"`

	// The version number of the witness program
	WitnessVersion *float64 `json:"witness_version,omitempty"`

	// The hex value of the witness program
	WitnessProgram string `json:"witness_program,omitempty"`

	// Error message, if any
	Error string `json:"error,omitempty"`
}

ValidateAddressResp holds the response to the ValidateAddress call.

{                               (json object)
  "isvalid" : true|false,       (boolean) If the address is valid or not
  "address" : "str",            (string) The bitcoin address validated
  "scriptPubKey" : "hex",       (string) The hex-encoded scriptPubKey generated by the address
  "isscript" : true|false,      (boolean) If the key is a script
  "iswitness" : true|false,     (boolean) If the address is a witness address
  "witness_version" : n,        (numeric, optional) The version number of the witness program
  "witness_program" : "hex",    (string, optional) The hex value of the witness program
  "error" : "str"               (string, optional) Error message, if any
}

type VerifyChainReq

type VerifyChainReq struct {
	// How thorough the block verification is:
	// - level 0 reads the blocks from disk
	// - level 1 verifies block validity
	// - level 2 verifies undo data
	// - level 3 checks disconnection of tip blocks
	// - level 4 tries to reconnect the blocks
	// - each level includes the checks of the previous levels
	// Default: 3, range=0-4
	CheckLevel *float64 `json:"checklevel,omitempty"`

	// The number of blocks to check.
	// Default: 6, 0=all
	NBlocks *float64 `json:"nblocks,omitempty"`
}

VerifyChainReq holds the arguments for the VerifyChain call.

  1. checklevel (numeric, optional, default=3, range=0-4) How thorough the block verification is: - level 0 reads the blocks from disk - level 1 verifies block validity - level 2 verifies undo data - level 3 checks disconnection of tip blocks - level 4 tries to reconnect the blocks - each level includes the checks of the previous levels
  2. nblocks (numeric, optional, default=6, 0=all) The number of blocks to check.

type VerifyChainResp

type VerifyChainResp struct {
	// Verified or not
	TrueOrFalse bool
}

VerifyChainResp holds the response to the VerifyChain call.

true|false    (boolean) Verified or not

func (VerifyChainResp) MarshalJSON

func (alts VerifyChainResp) MarshalJSON() ([]byte, error)

func (*VerifyChainResp) UnmarshalJSON

func (alts *VerifyChainResp) UnmarshalJSON(b []byte) error

type VerifyMessageReq

type VerifyMessageReq struct {
	// The bitcoin address to use for the signature.
	Address string `json:"address"`

	// The signature provided by the signer in base 64 encoding (see signmessage).
	Signature string `json:"signature"`

	// The message that was signed.
	Message string `json:"message"`
}

VerifyMessageReq holds the arguments for the VerifyMessage call.

  1. address (string, required) The bitcoin address to use for the signature.
  2. signature (string, required) The signature provided by the signer in base 64 encoding (see signmessage).
  3. message (string, required) The message that was signed.

type VerifyMessageResp

type VerifyMessageResp struct {
	// If the signature is verified or not.
	TrueOrFalse bool
}

VerifyMessageResp holds the response to the VerifyMessage call.

true|false    (boolean) If the signature is verified or not.

func (VerifyMessageResp) MarshalJSON

func (alts VerifyMessageResp) MarshalJSON() ([]byte, error)

func (*VerifyMessageResp) UnmarshalJSON

func (alts *VerifyMessageResp) UnmarshalJSON(b []byte) error

type VerifyTxOutProofReq

type VerifyTxOutProofReq struct {
	// The hex-encoded proof generated by gettxoutproof
	Proof string `json:"proof"`
}

VerifyTxOutProofReq holds the arguments for the VerifyTxOutProof call.

  1. proof (string, required) The hex-encoded proof generated by gettxoutproof

type VerifyTxOutProofResp

type VerifyTxOutProofResp struct {
	// Element: Hex    The txid(s) which the proof commits to, or empty array if the proof can not be validated.
	Hex []string
}

VerifyTxOutProofResp holds the response to the VerifyTxOutProof call.

[           (json array)
  "hex",    (string) The txid(s) which the proof commits to, or empty array if the proof can not be validated.
  ...
]

func (VerifyTxOutProofResp) MarshalJSON

func (alts VerifyTxOutProofResp) MarshalJSON() ([]byte, error)

func (*VerifyTxOutProofResp) UnmarshalJSON

func (alts *VerifyTxOutProofResp) UnmarshalJSON(b []byte) error

type WalletCreateFundedPsbtReq

type WalletCreateFundedPsbtReq struct {
	// Leave empty to add inputs automatically. See add_inputs option.
	Inputs []WalletCreateFundedPsbtReqInputs `json:"inputs,omitempty"`

	// The outputs (key-value pairs), where none of the keys are duplicated.
	// That is, each address can only appear once and there can only be one 'data' object.
	// For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also
	// accepted as second parameter.
	Outputs []WalletCreateFundedPsbtReqOutputs `json:"outputs"`

	// Raw locktime. Non-0 value also locktime-activates inputs
	// Default: 0
	LockTime float64 `json:"locktime,omitempty"`

	Options *WalletCreateFundedPsbtReqOptions `json:"options,omitempty"`

	// Include BIP 32 derivation paths for public keys if we know them
	// Default: true
	BIP32Derivs *bool `json:"bip32derivs,omitempty"`
}

WalletCreateFundedPsbtReq holds the arguments for the WalletCreateFundedPsbt call.

  1. inputs (json array, optional) Leave empty to add inputs automatically. See add_inputs option. [ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "sequence": n, (numeric, optional, default=depends on the value of the 'locktime' and 'options.replaceable' arguments) The sequence number }, ... ]
  2. outputs (json array, required) The outputs (key-value pairs), where none of the keys are duplicated. That is, each address can only appear once and there can only be one 'data' object. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also accepted as second parameter. [ { (json object) "address": amount, (numeric or string, required) A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in BTC ... }, { (json object) "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data }, ... ]
  3. locktime (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs
  4. options (json object, optional) { "add_inputs": bool, (boolean, optional, default=false) If inputs are specified, automatically include more if they are not enough. "include_unsafe": bool, (boolean, optional, default=false) Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions). Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears. If that happens, you will need to fund the transaction with different inputs and republish it. "changeAddress": "hex", (string, optional, default=pool address) The bitcoin address to receive the change "changePosition": n, (numeric, optional, default=random) The index of the change output "change_type": "str", (string, optional, default=set by -changetype) The output type to use. Only valid if changeAddress is not specified. Options are "legacy", "p2sh-segwit", and "bech32". "includeWatching": bool, (boolean, optional, default=true for watch-only wallets, otherwise false) Also select inputs which are watch only "lockUnspents": bool, (boolean, optional, default=false) Lock selected unspent outputs "fee_rate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB. "feeRate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in BTC/kvB. "subtractFeeFromOutputs": [ (json array, optional, default=[]) The outputs to subtract the fee from. The fee will be equally deducted from the amount of each specified output. Those recipients will receive less bitcoins than you enter in their corresponding amount field. If no outputs are specified here, the sender pays the fee. vout_index, (numeric) The zero-based output index, before a change output is added. ... ], "replaceable": bool, (boolean, optional, default=wallet default) Marks this transaction as BIP125 replaceable. Allows this transaction to be replaced by a transaction with higher fees "conf_target": n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks "estimate_mode": "str", (string, optional, default="unset") The fee estimate mode, must be one of (case insensitive): "unset" "economical" "conservative" }
  5. bip32derivs (boolean, optional, default=true) Include BIP 32 derivation paths for public keys if we know them

type WalletCreateFundedPsbtReqInputs

type WalletCreateFundedPsbtReqInputs struct {
	// The transaction id
	TxID string `json:"txid"`

	// The output number
	Vout float64 `json:"vout"`

	// The sequence number
	// Default: depends on the value of the 'locktime' and 'options.replaceable' arguments
	Sequence *float64 `json:"sequence,omitempty"`
}

type WalletCreateFundedPsbtReqOptions

type WalletCreateFundedPsbtReqOptions struct {
	// If inputs are specified, automatically include more if they are not enough.
	// Default: false
	AddInputs bool `json:"add_inputs,omitempty"`

	// Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).
	// Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.
	// If that happens, you will need to fund the transaction with different inputs and republish it.
	// Default: false
	IncludeUnsafe bool `json:"include_unsafe,omitempty"`

	// The bitcoin address to receive the change
	// Default: pool address
	Changeaddress string `json:"changeAddress,omitempty"`

	// The index of the change output
	// Default: random
	ChangePosition *float64 `json:"changePosition,omitempty"`

	// The output type to use. Only valid if changeAddress is not specified. Options are "legacy", "p2sh-segwit", and "bech32".
	// Default: set by -changetype
	ChangeType string `json:"change_type,omitempty"`

	// Also select inputs which are watch only
	// Default: true for watch-only wallets, otherwise false
	IncludeWatching *bool `json:"includeWatching,omitempty"`

	// Lock selected unspent outputs
	// Default: false
	LockUnspents bool `json:"lockUnspents,omitempty"`

	// Specify a fee rate in sat/vB.
	// Default: not set, fall back to wallet fee estimation
	FeeRate *float64 `json:"fee_rate,omitempty"`

	// Specify a fee rate in BTC/kvB.
	// Default: not set, fall back to wallet fee estimation
	FeeRate2 *float64 `json:"feeRate,omitempty"`

	// The outputs to subtract the fee from.
	// The fee will be equally deducted from the amount of each specified output.
	// Those recipients will receive less bitcoins than you enter in their corresponding amount field.
	// If no outputs are specified here, the sender pays the fee.
	// Element: VoutIndex    The zero-based output index, before a change output is added.
	SubtractFeeFromOutputs []float64 `json:"subtractFeeFromOutputs,omitempty"`

	// Marks this transaction as BIP125 replaceable.
	// Allows this transaction to be replaced by a transaction with higher fees
	// Default: wallet default
	Replaceable *bool `json:"replaceable,omitempty"`

	// Confirmation target in blocks
	// Default: wallet -txconfirmtarget
	ConfTarget *float64 `json:"conf_target,omitempty"`

	// The fee estimate mode, must be one of (case insensitive):
	// "unset"
	// "economical"
	// "conservative"
	// Default: "unset"
	EstimateMode string `json:"estimate_mode,omitempty"`
}

type WalletCreateFundedPsbtReqOutputs

type WalletCreateFundedPsbtReqOutputs struct {
	// A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in BTC
	A map[string]float64

	B struct {
		// A key-value pair. The key must be "data", the value is hex-encoded data
		Data string `json:"data"`
	}
}

Holder of alternative parameter formats, only one will be used, the first that is non-zero.

func (WalletCreateFundedPsbtReqOutputs) MarshalJSON

func (alts WalletCreateFundedPsbtReqOutputs) MarshalJSON() ([]byte, error)

func (*WalletCreateFundedPsbtReqOutputs) UnmarshalJSON

func (alts *WalletCreateFundedPsbtReqOutputs) UnmarshalJSON(b []byte) error

type WalletCreateFundedPsbtResp

type WalletCreateFundedPsbtResp struct {
	// The resulting raw transaction (base64-encoded string)
	Psbt string `json:"psbt"`

	// Fee in BTC the resulting transaction pays
	Fee float64 `json:"fee"`

	// The position of the added change output, or -1
	ChangePos float64 `json:"changepos"`
}

WalletCreateFundedPsbtResp holds the response to the WalletCreateFundedPsbt call.

{                     (json object)
  "psbt" : "str",     (string) The resulting raw transaction (base64-encoded string)
  "fee" : n,          (numeric) Fee in BTC the resulting transaction pays
  "changepos" : n     (numeric) The position of the added change output, or -1
}

type WalletDisplayAddressReq

type WalletDisplayAddressReq struct {
	Address string `json:"address"`
}

WalletDisplayAddressReq holds the arguments for the WalletDisplayAddress call.

  1. address (string, required)

type WalletDisplayAddressResp

type WalletDisplayAddressResp struct {
	// The address as confirmed by the signer
	Address string `json:"address"`
}

WalletDisplayAddressResp holds the response to the WalletDisplayAddress call.

{                       (json object)
  "address" : "str"     (string) The address as confirmed by the signer
}

type WalletPassphraseChangeReq

type WalletPassphraseChangeReq struct {
	// The current passphrase
	OldPassphrase string `json:"oldpassphrase"`

	// The new passphrase
	NewPassphrase string `json:"newpassphrase"`
}

WalletPassphraseChangeReq holds the arguments for the WalletPassphraseChange call.

  1. oldpassphrase (string, required) The current passphrase
  2. newpassphrase (string, required) The new passphrase

type WalletPassphraseReq

type WalletPassphraseReq struct {
	// The wallet passphrase
	Passphrase string `json:"passphrase"`

	// The time to keep the decryption key in seconds; capped at 100000000 (~3 years).
	TimeOut float64 `json:"timeout"`
}

WalletPassphraseReq holds the arguments for the WalletPassphrase call.

  1. passphrase (string, required) The wallet passphrase
  2. timeout (numeric, required) The time to keep the decryption key in seconds; capped at 100000000 (~3 years).

type WalletProcessPsbtReq

type WalletProcessPsbtReq struct {
	// The transaction base64 string
	Psbt string `json:"psbt"`

	// Also sign the transaction when updating
	// Default: true
	Sign *bool `json:"sign,omitempty"`

	// The signature hash type to sign with if not specified by the PSBT. Must be one of
	// "DEFAULT"
	// "ALL"
	// "NONE"
	// "SINGLE"
	// "ALL|ANYONECANPAY"
	// "NONE|ANYONECANPAY"
	// "SINGLE|ANYONECANPAY"
	// Default: "DEFAULT"
	SigHashType string `json:"sighashtype,omitempty"`

	// Include BIP 32 derivation paths for public keys if we know them
	// Default: true
	BIP32Derivs *bool `json:"bip32derivs,omitempty"`
}

WalletProcessPsbtReq holds the arguments for the WalletProcessPsbt call.

  1. psbt (string, required) The transaction base64 string
  2. sign (boolean, optional, default=true) Also sign the transaction when updating
  3. sighashtype (string, optional, default="DEFAULT") The signature hash type to sign with if not specified by the PSBT. Must be one of "DEFAULT" "ALL" "NONE" "SINGLE" "ALL|ANYONECANPAY" "NONE|ANYONECANPAY" "SINGLE|ANYONECANPAY"
  4. bip32derivs (boolean, optional, default=true) Include BIP 32 derivation paths for public keys if we know them

type WalletProcessPsbtResp

type WalletProcessPsbtResp struct {
	// The base64-encoded partially signed transaction
	Psbt string `json:"psbt"`

	// If the transaction has a complete set of signatures
	Complete bool `json:"complete"`
}

WalletProcessPsbtResp holds the response to the WalletProcessPsbt call.

{                             (json object)
  "psbt" : "str",             (string) The base64-encoded partially signed transaction
  "complete" : true|false     (boolean) If the transaction has a complete set of signatures
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL