Skip to content

Commit

Permalink
btcjson: add support for listbdkutxos
Browse files Browse the repository at this point in the history
  • Loading branch information
kcalvinalvin committed Feb 1, 2024
1 parent ba14596 commit 23ec5ad
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions btcjson/chainsvrcmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,15 @@ func NewListBDKTransactionsCmd() *ListBDKTransactionsCmd {
return &ListBDKTransactionsCmd{}
}

// ListBDKUTXOsCmd defines the listbdkutxos JSON-RPC command.
type ListBDKUTXOsCmd struct{}

// NewListBDKUTXOsCmd returns a new instance which can be used to issue a
// listbdkutxos JSON-RPC command.
func NewListBDKUTXOsCmd() *ListBDKUTXOsCmd {
return &ListBDKUTXOsCmd{}
}

// InvalidateBlockCmd defines the invalidateblock JSON-RPC command.
type InvalidateBlockCmd struct {
BlockHash string
Expand Down Expand Up @@ -1304,6 +1313,7 @@ func init() {
MustRegisterCmd("getwatchonlybalance", (*GetWatchOnlyBalanceCmd)(nil), flags)
MustRegisterCmd("help", (*HelpCmd)(nil), flags)
MustRegisterCmd("listbdktransactions", (*ListBDKTransactionsCmd)(nil), flags)
MustRegisterCmd("listbdkutxos", (*ListBDKUTXOsCmd)(nil), flags)
MustRegisterCmd("invalidateblock", (*InvalidateBlockCmd)(nil), flags)
MustRegisterCmd("peekaddress", (*PeekAddressCmd)(nil), flags)
MustRegisterCmd("ping", (*PingCmd)(nil), flags)
Expand Down
11 changes: 11 additions & 0 deletions btcjson/chainsvrresults.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ type ListBDKTransactionsResult struct {
Confirmations uint `json:"confirmations"` // number of confirmations for this tx
}

// ListBDKUTXOsResult models the data from the listbdkutxos command.
type ListBDKUTXOsResult struct {
Txid string `json:"txid"`
Vout uint `json:"vout"`
Amount int64 `json:"amount"`
ScriptPubKey string `json:"scriptpubkey"`
IsChange bool `json:"ischange"`
DerivationIndex uint `json:"derivationindex"`
Confirmations uint `json:"confirmations"`
}

// GetBlockHeaderVerboseResult models the data from the getblockheader command when
// the verbose flag is set. When the verbose flag is not set, getblockheader
// returns a hex-encoded string.
Expand Down

0 comments on commit 23ec5ad

Please sign in to comment.