Skip to content

Commit

Permalink
feat: update rpc methods with bitcoin core v27.0 (#100)
Browse files Browse the repository at this point in the history
Co-authored-by: dolcalmi <[email protected]>
  • Loading branch information
github-actions[bot] and dolcalmi authored Apr 17, 2024
1 parent 257cb54 commit 025e004
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bitcoin-cli-ts",
"version": "26.1.0",
"version": "27.0.0",
"description": "Auto-generated Bitcoin client library for bitcoind JSON-RPC API",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/blockchain/dump-tx-outset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type DumpTxOutsetParams = {
/**
* dumptxoutset "path"
*
* Write the serialized UTXO set to disk.
* Write the serialized UTXO set to a file.
*
*/
export function dumpTxOutset(params: DumpTxOutsetParams) {
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/blockchain/load-tx-outset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type LoadTxOutsetParams = {
/**
* loadtxoutset "path"
*
* Load the serialized UTXO set from disk.
* Load the serialized UTXO set from a file.
* Once this snapshot is loaded, its contents will be deserialized into a second chainstate data structure, which is then used to sync to the network's tip. Meanwhile, the original chainstate will complete the initial block download process in the background, eventually validating up to the block that the snapshot is based upon.
* The result is a usable bitcoind instance that is current with the network tip in a matter of minutes rather than hours. UTXO snapshot are typically obtained from third-party sources (HTTP, torrent, etc.) which is reasonable since their contents are always checked by hash.
* You can find more information on this process in the `assumeutxo` design document (<https://github.com/bitcoin/bitcoin/blob/master/doc/design/assumeutxo.md>).
Expand Down
12 changes: 5 additions & 7 deletions src/rpc/blockchain/scan-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ type ScanBlocksParams = {
"status" for progress report (in %) of the current scan */
action: string
/* [
"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])
"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])
},
...
] */
Expand All @@ -25,9 +25,7 @@ type ScanBlocksParams = {
stop_height?: number
/* The type name of the filter */
filtertype?: string
/* {
"filter_false_positives": bool, (boolean, optional, default=false) Filter false positives (slower and may fail on pruned nodes). Otherwise they may occur at a rate of 1/M
} */
/* Options object that can be used to pass named arguments, listed below. */
options?: Json
}

Expand Down
4 changes: 3 additions & 1 deletion src/rpc/hidden/add-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ type AddConnectionParams = {
address: string
/* Type of connection to open ("outbound-full-relay", "block-relay-only", "addr-fetch" or "feeler"). */
connection_type: string
/* Attempt to connect using BIP324 v2 transport protocol */
v2transport: boolean
}

/**
* addconnection "address" "connection_type"
* addconnection "address" "connection_type" v2transport
*
* Open an outbound connection to a specified node. This RPC is for testing only.
*
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/mining/get-network-hash-ps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import request from '../../rpc-request'

type GetNetworkHashPsParams = {
bitcoind: Bitcoind
/* The number of blocks, or -1 for blocks since last difficulty change. */
/* The number of previous blocks to calculate estimate from, or -1 for blocks since last difficulty change. */
nblocks?: number
/* To estimate at the time of the given height. */
height?: number
Expand Down
1 change: 1 addition & 0 deletions src/rpc/rawtransactions/send-raw-transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type SendRawTransactionParams = {
/* The hex string of the raw transaction */
hexstring: string
/* Reject transactions whose fee rate is higher than the specified value, expressed in BTC/kvB.
Fee rates larger than 1BTC/kvB are rejected.
Set to 0 to accept any fee rate. */
maxfeerate?: number | string
/* Reject transactions with provably unspendable outputs (e.g. 'datacarrier' outputs that use the OP_RETURN opcode) greater than the specified value, expressed in BTC.
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/rawtransactions/submit-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type SubmitPackageParams = {
*
* Submit a package of raw transactions (serialized, hex-encoded) to local node.
* The package must consist of a child with its parents, and none of the parents may depend on one another.
* The package will be validated according to consensus and mempool policy rules. If all transactions pass, they will be accepted to mempool.
* The package will be validated according to consensus and mempool policy rules. If any transaction passes, it will be accepted to mempool.
* This RPC is experimental and the interface may be unstable. Refer to doc/policy/packages.md for documentation on package policies.
* Warning: successful submission does not mean the transactions will propagate throughout the network.
*
Expand Down
4 changes: 3 additions & 1 deletion src/rpc/rawtransactions/test-mempool-accept.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ type TestMempoolAcceptParams = {
...
] */
rawtxs: Array<unknown>
/* Reject transactions whose fee rate is higher than the specified value, expressed in BTC/kvB */
/* Reject transactions whose fee rate is higher than the specified value, expressed in BTC/kvB.
Fee rates larger than 1BTC/kvB are rejected.
Set to 0 to accept any fee rate. */
maxfeerate?: number | string
}

Expand Down
4 changes: 4 additions & 0 deletions src/rpc/wallet/encrypt-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ type EncryptWalletParams = {
* 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.
* ** IMPORTANT **
* For security reasons, the encryption process will generate a new HD seed, resulting
* in the creation of a fresh set of active descriptors. Therefore, it is crucial to
* securely back up the newly generated wallet file using the backupwallet RPC.
*
*/
export function encryptWallet(params: EncryptWalletParams) {
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/wallet/migrate-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ type MigrateWalletParams = {
/**
* migratewallet ( "wallet_name" "passphrase" )
*
* EXPERIMENTAL warning: This call may not work as expected and may be changed in future releases
* Migrate the wallet to a descriptor wallet.
* A new wallet backup will need to be made.
* The migration process will create a backup of the wallet before migrating. This backup
* file will be named <wallet name>-<timestamp>.legacy.bak and can be found in the directory
* for this wallet. In the event of an incorrect migration, the backup can be restored using restorewallet.
* Encrypted wallets must have the passphrase provided as an argument to this call.
* This RPC may take a long time to complete. Increasing the RPC client timeout is recommended.
*
*/
export function migrateWallet(params: MigrateWalletParams) {
Expand Down

0 comments on commit 025e004

Please sign in to comment.