@did-btcr2/bitcoin 0.3.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client/http.js +9 -0
- package/dist/cjs/client/http.js.map +1 -0
- package/dist/cjs/client/rest/address.js +20 -28
- package/dist/cjs/client/rest/address.js.map +1 -1
- package/dist/cjs/client/rest/block.js +23 -22
- package/dist/cjs/client/rest/block.js.map +1 -1
- package/dist/cjs/client/rest/index.js +31 -84
- package/dist/cjs/client/rest/index.js.map +1 -1
- package/dist/cjs/client/rest/protocol.js +129 -0
- package/dist/cjs/client/rest/protocol.js.map +1 -0
- package/dist/cjs/client/rest/transaction.js +19 -21
- package/dist/cjs/client/rest/transaction.js.map +1 -1
- package/dist/cjs/client/rpc/index.js +79 -337
- package/dist/cjs/client/rpc/index.js.map +1 -1
- package/dist/cjs/client/rpc/interface.js +1 -6
- package/dist/cjs/client/rpc/interface.js.map +1 -1
- package/dist/cjs/client/rpc/json-rpc.js +40 -63
- package/dist/cjs/client/rpc/json-rpc.js.map +1 -1
- package/dist/cjs/client/rpc/protocol.js +134 -0
- package/dist/cjs/client/rpc/protocol.js.map +1 -0
- package/dist/cjs/connection.js +104 -0
- package/dist/cjs/connection.js.map +1 -0
- package/dist/cjs/constants.js +16 -5
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/errors.js.map +1 -1
- package/dist/cjs/index.js +21 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types.js +5 -55
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/client/http.js +9 -0
- package/dist/esm/client/http.js.map +1 -0
- package/dist/esm/client/rest/address.js +20 -28
- package/dist/esm/client/rest/address.js.map +1 -1
- package/dist/esm/client/rest/block.js +23 -22
- package/dist/esm/client/rest/block.js.map +1 -1
- package/dist/esm/client/rest/index.js +31 -84
- package/dist/esm/client/rest/index.js.map +1 -1
- package/dist/esm/client/rest/protocol.js +129 -0
- package/dist/esm/client/rest/protocol.js.map +1 -0
- package/dist/esm/client/rest/transaction.js +19 -21
- package/dist/esm/client/rest/transaction.js.map +1 -1
- package/dist/esm/client/rpc/index.js +79 -337
- package/dist/esm/client/rpc/index.js.map +1 -1
- package/dist/esm/client/rpc/interface.js +1 -6
- package/dist/esm/client/rpc/interface.js.map +1 -1
- package/dist/esm/client/rpc/json-rpc.js +40 -63
- package/dist/esm/client/rpc/json-rpc.js.map +1 -1
- package/dist/esm/client/rpc/protocol.js +134 -0
- package/dist/esm/client/rpc/protocol.js.map +1 -0
- package/dist/esm/connection.js +104 -0
- package/dist/esm/connection.js.map +1 -0
- package/dist/esm/constants.js +16 -5
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/index.js +21 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types.js +5 -55
- package/dist/esm/types.js.map +1 -1
- package/dist/types/client/http.d.ts +22 -0
- package/dist/types/client/http.d.ts.map +1 -0
- package/dist/types/client/rest/address.d.ts +17 -19
- package/dist/types/client/rest/address.d.ts.map +1 -1
- package/dist/types/client/rest/block.d.ts +25 -16
- package/dist/types/client/rest/block.d.ts.map +1 -1
- package/dist/types/client/rest/index.d.ts +21 -51
- package/dist/types/client/rest/index.d.ts.map +1 -1
- package/dist/types/client/rest/protocol.d.ts +59 -0
- package/dist/types/client/rest/protocol.d.ts.map +1 -0
- package/dist/types/client/rest/transaction.d.ts +17 -17
- package/dist/types/client/rest/transaction.d.ts.map +1 -1
- package/dist/types/client/rpc/index.d.ts +112 -253
- package/dist/types/client/rpc/index.d.ts.map +1 -1
- package/dist/types/client/rpc/interface.d.ts +42 -6
- package/dist/types/client/rpc/interface.d.ts.map +1 -1
- package/dist/types/client/rpc/json-rpc.d.ts +21 -18
- package/dist/types/client/rpc/json-rpc.d.ts.map +1 -1
- package/dist/types/client/rpc/protocol.d.ts +83 -0
- package/dist/types/client/rpc/protocol.d.ts.map +1 -0
- package/dist/types/client/utils.d.ts +1 -0
- package/dist/types/connection.d.ts +82 -0
- package/dist/types/connection.d.ts.map +1 -0
- package/dist/types/constants.d.ts +17 -5
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/errors.d.ts +5 -3
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/index.d.ts +21 -13
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/network.d.ts +1 -0
- package/dist/types/types.d.ts +99 -696
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/client/http.ts +28 -0
- package/src/client/rest/address.ts +24 -30
- package/src/client/rest/block.ts +29 -26
- package/src/client/rest/index.ts +38 -94
- package/src/client/rest/protocol.ts +153 -0
- package/src/client/rest/transaction.ts +23 -23
- package/src/client/rpc/index.ts +146 -379
- package/src/client/rpc/interface.ts +88 -53
- package/src/client/rpc/json-rpc.ts +53 -60
- package/src/client/rpc/protocol.ts +160 -0
- package/src/connection.ts +136 -0
- package/src/constants.ts +17 -5
- package/src/errors.ts +10 -3
- package/src/index.ts +81 -13
- package/src/types.ts +332 -972
- package/dist/cjs/bitcoin.js +0 -105
- package/dist/cjs/bitcoin.js.map +0 -1
- package/dist/esm/bitcoin.js +0 -105
- package/dist/esm/bitcoin.js.map +0 -1
- package/dist/types/bitcoin.d.ts +0 -60
- package/dist/types/bitcoin.d.ts.map +0 -1
- package/src/bitcoin.ts +0 -149
|
@@ -1,433 +1,175 @@
|
|
|
1
1
|
import { JSONUtils } from '@did-btcr2/common';
|
|
2
|
-
import { DEFAULT_BITCOIN_NETWORK_CONFIG } from '../../constants.js';
|
|
3
2
|
import { BitcoinRpcError } from '../../errors.js';
|
|
4
|
-
import { BitcoinRpcClientConfig } from '../../types.js';
|
|
5
3
|
import { JsonRpcTransport } from './json-rpc.js';
|
|
4
|
+
// ── Client ──────────────────────────────────────────────────────────
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @class BitcoinCoreRpcClient
|
|
9
|
-
* @type {BitcoinCoreRpcClient}
|
|
6
|
+
* Bitcoin Core RPC client.
|
|
10
7
|
* @implements {BitcoinRpcClient}
|
|
11
8
|
*/
|
|
12
9
|
export class BitcoinCoreRpcClient {
|
|
13
|
-
/**
|
|
14
|
-
* The singleton instance of the BitcoinCoreRpcClient.
|
|
15
|
-
* @type {BitcoinCoreRpcClient}
|
|
16
|
-
* @private
|
|
17
|
-
*/
|
|
18
|
-
static #instance;
|
|
19
|
-
/**
|
|
20
|
-
* The JSON-RPC transport layer.
|
|
21
|
-
* @type {JsonRpcTransport}
|
|
22
|
-
* @private
|
|
23
|
-
*/
|
|
24
10
|
#transport;
|
|
25
|
-
/**
|
|
26
|
-
* The configuration for the RPC client.
|
|
27
|
-
* @type {RpcClientConfig}
|
|
28
|
-
* @private
|
|
29
|
-
*/
|
|
30
11
|
#config;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* @example
|
|
35
|
-
* ```
|
|
36
|
-
* import BitcoinRpcClient from '@did-btcr2/method';
|
|
37
|
-
* const bob = BitcoinRpcClient.connect(); // To use default polar config, pass no args. Polar must run locally.
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
constructor(config) {
|
|
41
|
-
this.#config = new BitcoinRpcClientConfig(config);
|
|
42
|
-
this.#transport = new JsonRpcTransport(this.#config);
|
|
12
|
+
constructor(config, executor) {
|
|
13
|
+
this.#config = config;
|
|
14
|
+
this.#transport = new JsonRpcTransport(config, executor);
|
|
43
15
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Get the config for the current BitcoinRpcClient object.
|
|
46
|
-
* @returns {BitcoinRpcClient} The encapsulated {@link BitcoinRpcClient} object.
|
|
47
|
-
* @example
|
|
48
|
-
* ```
|
|
49
|
-
* import BitcoinRpcClient from '@did-btcr2/method';
|
|
50
|
-
* const alice = BitcoinRpcClient.connect();
|
|
51
|
-
* const config = alice.config;
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
16
|
get config() {
|
|
55
|
-
|
|
56
|
-
return config;
|
|
17
|
+
return this.#config;
|
|
57
18
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Get the client for the current BitcoinRpcClient object.
|
|
60
|
-
* @returns {RpcClient} The encapsulated {@link RpcClient} object.
|
|
61
|
-
* @example
|
|
62
|
-
* ```
|
|
63
|
-
* const alice = BitcoinRpcClient.connect();
|
|
64
|
-
* const config = alice.client;
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
19
|
get client() {
|
|
68
|
-
|
|
69
|
-
return client;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Static method initializes a static instance of BitcoinCoreRpcClient with the given configuration.
|
|
73
|
-
* The RpcClient returned by this method does not have any named methods.
|
|
74
|
-
* Use this method to create and pass a new RpcClient instance to a BitcoinCoreRpcClient constructor.
|
|
75
|
-
*
|
|
76
|
-
* @param {RpcClientConfig} config The configuration object for the client (optional).
|
|
77
|
-
* @returns {BitcoinCoreRpcClient} A new RpcClient instance.
|
|
78
|
-
* @example
|
|
79
|
-
* ```
|
|
80
|
-
* const options: RpcClientConfig = {
|
|
81
|
-
* host: 'http://localhost:18443',
|
|
82
|
-
* username: 'alice',
|
|
83
|
-
* password: 'alicepass',
|
|
84
|
-
* version: '28.1.0',
|
|
85
|
-
* }
|
|
86
|
-
* const alice = BitcoinCoreRpcClient.initialize(options); // Client config required
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
static initialize(config) {
|
|
90
|
-
const cfg = new BitcoinRpcClientConfig(config);
|
|
91
|
-
BitcoinCoreRpcClient.#instance = new BitcoinCoreRpcClient(cfg);
|
|
92
|
-
return BitcoinCoreRpcClient.#instance;
|
|
20
|
+
return this.#transport;
|
|
93
21
|
}
|
|
94
22
|
/**
|
|
95
|
-
*
|
|
96
|
-
* To use default polar config, do not pass a config. See {@link DEFAULT_BITCOIN_NETWORK_CONFIG} for default config.
|
|
97
|
-
* @required A locally running {@link https://github.com/jamaljsr/polar | Polar Lightning} regtest node.
|
|
98
|
-
*
|
|
99
|
-
* @param {?RpcClientConfig} config The configuration object for the client (optional).
|
|
100
|
-
* @returns A new {@link BitcoinRpcClient} instance.
|
|
101
|
-
* @example
|
|
102
|
-
* ```
|
|
103
|
-
* const alice = BitcoinRpcClient.connect();
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
static connect(config) {
|
|
107
|
-
return new BitcoinCoreRpcClient(config ?? DEFAULT_BITCOIN_NETWORK_CONFIG.regtest.rpc);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Check if the given error is a JSON-RPC error.
|
|
111
|
-
* @param {unknown} e The error to check.
|
|
112
|
-
* @returns {boolean} True if the error is a JSON-RPC error, false otherwise.
|
|
113
|
-
*/
|
|
114
|
-
isJsonRpcError(e) {
|
|
115
|
-
return (e instanceof Error &&
|
|
116
|
-
e.name === 'RpcError' &&
|
|
117
|
-
typeof e.code === 'number');
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Executes a JSON-RPC command on the bitcoind node.
|
|
121
|
-
* @param {MethodNameInLowerCase} method The name of the method to call.
|
|
122
|
-
* @param {Array<any>} parameters The parameters to pass to the method.
|
|
123
|
-
* @returns {Promise<T>} A promise resolving to the result of the command.
|
|
23
|
+
* Executes a typed JSON-RPC command on the bitcoind node.
|
|
124
24
|
*/
|
|
125
25
|
async executeRpc(method, parameters = []) {
|
|
126
26
|
try {
|
|
127
|
-
const raw = await this.
|
|
27
|
+
const raw = await this.#transport.call(method, parameters);
|
|
128
28
|
const normalized = JSONUtils.isUnprototyped(raw) ? JSONUtils.normalize(raw) : raw;
|
|
129
|
-
|
|
130
|
-
? normalized[normalized.length - 1]
|
|
131
|
-
: normalized;
|
|
132
|
-
return result;
|
|
29
|
+
return normalized;
|
|
133
30
|
}
|
|
134
31
|
catch (err) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
*
|
|
140
|
-
* Map JSON-RPC error codes to HTTP status codes.
|
|
141
|
-
* @param {number | undefined} code The JSON-RPC error code.
|
|
142
|
-
* @returns {number} The corresponding HTTP status code.
|
|
143
|
-
*
|
|
144
|
-
* | Error type | HTTP code |
|
|
145
|
-
* | -------------------------------| --------------------|
|
|
146
|
-
* | Valid JSON-RPC failure | **400 / 404 / 422** |
|
|
147
|
-
* | JSON-RPC authentication issues | **401 / 403** |
|
|
148
|
-
* | Upstream bitcoind unreachable | **502** |
|
|
149
|
-
* | Upstream timeout | **504** |
|
|
150
|
-
* | Network transient errors | **503** |
|
|
151
|
-
* | Unknown unexpected errors | **500** |
|
|
152
|
-
*/
|
|
153
|
-
mapRpcCodeToHttp(code) {
|
|
154
|
-
switch (code) {
|
|
155
|
-
case -32700:
|
|
156
|
-
case -32600:
|
|
157
|
-
case -32602:
|
|
158
|
-
return 400;
|
|
159
|
-
case -32601:
|
|
160
|
-
return 404;
|
|
161
|
-
default:
|
|
162
|
-
return 422;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Handle errors that occur while executing commands.
|
|
167
|
-
* @param methods An array of {@link BatchOption} objects.
|
|
168
|
-
* @param error The error that was thrown.
|
|
169
|
-
* @throws Throws a {@link BitcoinRpcError} with the error message.
|
|
170
|
-
*/
|
|
171
|
-
handleError(err, method, params) {
|
|
172
|
-
if (this.isJsonRpcError(err)) {
|
|
173
|
-
throw new BitcoinRpcError(err.name.toUpperCase(), this.mapRpcCodeToHttp(err.code), `RPC ${method} failed: ${err.message}`, { method, params });
|
|
32
|
+
if (err instanceof BitcoinRpcError)
|
|
33
|
+
throw err;
|
|
34
|
+
const cause = err instanceof Error ? err.message : String(err);
|
|
35
|
+
throw new BitcoinRpcError('UNKNOWN_ERROR', 500, `Unknown failure in ${method}: ${cause}`, { method });
|
|
174
36
|
}
|
|
175
|
-
throw new BitcoinRpcError('UNKNOWN_ERROR', 500, `Unknown failure in ${method}`, { method, params, err });
|
|
176
37
|
}
|
|
177
38
|
/**
|
|
178
39
|
* Returns the block data associated with a `blockhash` of a valid block.
|
|
179
|
-
* @param {GetBlockParams} params See {@link GetBlockParams} for details.
|
|
180
|
-
* @param {?string} params.blockhash The blockhash of the block to query.
|
|
181
|
-
* @param {?number} params.height The block height of the block to query.
|
|
182
|
-
* @param {?VerbosityLevel} params.verbosity The verbosity level. See {@link VerbosityLevel}.
|
|
183
|
-
* @returns {BlockResponse} A promise resolving to a {@link BlockResponse} formatted depending on `verbosity` level.
|
|
184
|
-
* @throws {BitcoinRpcError} If neither `blockhash` nor `height` is provided.
|
|
185
40
|
*/
|
|
186
41
|
async getBlock({ blockhash, height, verbosity }) {
|
|
187
|
-
// Check if blockhash or height is provided, if neither throw an error
|
|
188
42
|
if (!blockhash && height === undefined) {
|
|
189
43
|
throw new BitcoinRpcError('INVALID_PARAMS_GET_BLOCK', 400, 'blockhash or height required', { blockhash, height });
|
|
190
44
|
}
|
|
191
|
-
// If height is provided, get the blockhash
|
|
192
45
|
blockhash ??= await this.getBlockHash(height);
|
|
193
46
|
if (!blockhash || typeof blockhash !== 'string') {
|
|
194
47
|
return undefined;
|
|
195
48
|
}
|
|
196
|
-
// Get the block data
|
|
197
49
|
const block = await this.executeRpc('getblock', [blockhash, verbosity ?? 3]);
|
|
198
|
-
// Return the block data depending on verbosity level
|
|
199
50
|
switch (verbosity) {
|
|
200
|
-
case 0:
|
|
201
|
-
|
|
202
|
-
case
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
return block;
|
|
206
|
-
case 3:
|
|
207
|
-
return block;
|
|
208
|
-
default:
|
|
209
|
-
return block;
|
|
51
|
+
case 0: return block;
|
|
52
|
+
case 1: return block;
|
|
53
|
+
case 2: return block;
|
|
54
|
+
case 3: return block;
|
|
55
|
+
default: return block;
|
|
210
56
|
}
|
|
211
57
|
}
|
|
212
|
-
/**
|
|
213
|
-
* Returns the blockheight of the most-work fully-validated chain. The genesis block has height 0.
|
|
214
|
-
* @returns {Blockheight} The number of the blockheight with the most-work of the fully-validated chain.
|
|
215
|
-
*/
|
|
58
|
+
/** Returns the blockheight of the most-work fully-validated chain. */
|
|
216
59
|
async getBlockCount() {
|
|
217
60
|
return await this.executeRpc('getblockcount');
|
|
218
61
|
}
|
|
219
|
-
/**
|
|
220
|
-
* Returns the blockhash of the block at the given height in the active chain.
|
|
221
|
-
*/
|
|
62
|
+
/** Returns the blockhash of the block at the given height. */
|
|
222
63
|
async getBlockHash(height) {
|
|
223
64
|
return await this.executeRpc('getblockhash', [height]);
|
|
224
65
|
}
|
|
225
|
-
/**
|
|
226
|
-
* Returns an object containing various blockchain state info.
|
|
227
|
-
*/
|
|
66
|
+
/** Returns various blockchain state info. */
|
|
228
67
|
async getBlockchainInfo() {
|
|
229
|
-
return this.executeRpc('getblockchaininfo');
|
|
68
|
+
return await this.executeRpc('getblockchaininfo');
|
|
230
69
|
}
|
|
231
|
-
/**
|
|
232
|
-
* Sign inputs for raw transaction (serialized, hex-encoded).
|
|
233
|
-
* The second optional argument (may be null) is an array of previous transaction outputs that
|
|
234
|
-
* this transaction depends on but may not yet be in the block chain.
|
|
235
|
-
* Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
|
|
236
|
-
* @param {string} hexstring The hex-encoded transaction to send.
|
|
237
|
-
*/
|
|
70
|
+
/** Sign inputs for raw transaction (serialized, hex-encoded). */
|
|
238
71
|
async signRawTransaction(hexstring) {
|
|
239
72
|
return await this.executeRpc('signrawtransactionwithwallet', [hexstring]);
|
|
240
73
|
}
|
|
241
|
-
/**
|
|
242
|
-
* Submit a raw transaction (serialized, hex-encoded) to local node and network.
|
|
243
|
-
*
|
|
244
|
-
* The transaction will be sent unconditionally to all peers, so using sendrawtransaction
|
|
245
|
-
* for manual rebroadcast may degrade privacy by leaking the transaction's origin, as
|
|
246
|
-
* nodes will normally not rebroadcast non-wallet transactions already in their mempool.
|
|
247
|
-
*
|
|
248
|
-
* @param {string} hexstring The hex-encoded transaction to send.
|
|
249
|
-
* @param {numbner} [maxfeerate] If not passed, default is 0.10.
|
|
250
|
-
* @returns {Promise<string>} A promise resolving to the transaction hash in hex.
|
|
251
|
-
*/
|
|
74
|
+
/** Submit a raw transaction (serialized, hex-encoded) to local node and network. */
|
|
252
75
|
async sendRawTransaction(hexstring, maxfeerate, maxBurnAmount) {
|
|
253
76
|
return await this.executeRpc('sendrawtransaction', [hexstring, maxfeerate ?? 0.10, maxBurnAmount ?? 0.00]);
|
|
254
77
|
}
|
|
255
|
-
/**
|
|
256
|
-
* Combines calls to `signRawTransaction` and `sendRawTransaction`.
|
|
257
|
-
* @param {string} params.hexstring The hex-encoded transaction to send.
|
|
258
|
-
* @returns {Promise<string>} A promise resolving to the transaction hash in hex.
|
|
259
|
-
*/
|
|
78
|
+
/** Signs and sends a raw transaction. */
|
|
260
79
|
async signAndSendRawTransaction(hexstring) {
|
|
261
80
|
const signedRawTx = await this.signRawTransaction(hexstring);
|
|
81
|
+
if (!signedRawTx.complete) {
|
|
82
|
+
throw new BitcoinRpcError('SIGNING_INCOMPLETE', 400, 'Transaction signing incomplete', signedRawTx.errors);
|
|
83
|
+
}
|
|
262
84
|
return await this.sendRawTransaction(signedRawTx.hex);
|
|
263
85
|
}
|
|
264
|
-
/**
|
|
265
|
-
* Combines calls to `createRawTransaction`, `signRawTransaction` and `sendRawTransaction`.
|
|
266
|
-
* @param {CreateRawTxInputs[]} inputs The inputs to the transaction (required).
|
|
267
|
-
* @param {CreateRawTxOutputs[]} outputs The outputs of the transaction (required).
|
|
268
|
-
* @returns {Promise<string>} A promise resolving to the transaction hash in hex.
|
|
269
|
-
*/
|
|
86
|
+
/** Creates, signs, and sends a raw transaction. */
|
|
270
87
|
async createSignSendRawTransaction(inputs, outputs) {
|
|
271
88
|
const rawTx = await this.createRawTransaction(inputs, outputs);
|
|
272
89
|
const signedRawTx = await this.signRawTransaction(rawTx);
|
|
273
|
-
|
|
274
|
-
|
|
90
|
+
if (!signedRawTx.complete) {
|
|
91
|
+
throw new BitcoinRpcError('SIGNING_INCOMPLETE', 400, 'Transaction signing incomplete', signedRawTx.errors);
|
|
92
|
+
}
|
|
93
|
+
return await this.sendRawTransaction(signedRawTx.hex);
|
|
275
94
|
}
|
|
276
|
-
/**
|
|
277
|
-
* Returns up to 'count' most recent transactions skipping the first 'from' transactions for account 'label'.
|
|
278
|
-
* @param {ListTransactionsParams} params The parameters for the listTransactions command.
|
|
279
|
-
* @returns {Promise<ListTransactionsResult>} A promise resolving to a {@link ListTransactionsResult} object.
|
|
280
|
-
*/
|
|
95
|
+
/** Returns up to 'count' most recent transactions. */
|
|
281
96
|
async listTransactions(params) {
|
|
282
|
-
return await this.executeRpc('listtransactions', [
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
* @param {TxInForCreateRaw[]} inputs The inputs to the transaction (required).
|
|
291
|
-
* @param {CreateRawTxOutputs[]} outputs The outputs of the transaction (required).
|
|
292
|
-
* @param {number} [locktime] The locktime of the transaction (optional).
|
|
293
|
-
* @param {boolean} [replacable] Whether the transaction is replaceable (optional).
|
|
294
|
-
* @returns {string} The hex-encoded raw transaction.
|
|
295
|
-
*/
|
|
97
|
+
return await this.executeRpc('listtransactions', [
|
|
98
|
+
params.account ?? '*',
|
|
99
|
+
params.count ?? 10,
|
|
100
|
+
params.skip ?? 0,
|
|
101
|
+
params.include_watchonly ?? false,
|
|
102
|
+
]);
|
|
103
|
+
}
|
|
104
|
+
/** Create a transaction spending the given inputs and creating new outputs. */
|
|
296
105
|
async createRawTransaction(inputs, outputs, locktime, replacable) {
|
|
297
106
|
return await this.executeRpc('createrawtransaction', [inputs, outputs, locktime, replacable]);
|
|
298
107
|
}
|
|
299
|
-
/**
|
|
300
|
-
* Derives one or more addresses corresponding to an output descriptor.
|
|
301
|
-
* Examples of output descriptors are:
|
|
302
|
-
* pkh(<pubkey>) P2PKH outputs for the given pubkey
|
|
303
|
-
* wpkh(<pubkey>) Native segwit P2PKH outputs for the given pubkey
|
|
304
|
-
* sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys
|
|
305
|
-
* raw(<hex script>) Outputs whose output script equals the specified hex-encoded bytes
|
|
306
|
-
* tr(<pubkey>,multi_a(<n>,<pubkey>,<pubkey>,...)) P2TR-multisig outputs for the given threshold and pubkeys
|
|
307
|
-
*
|
|
308
|
-
* In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one
|
|
309
|
-
* or more path elements separated by "/", where "h" represents a hardened child key.
|
|
310
|
-
*
|
|
311
|
-
* See {@link https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md | github.com/bitcoin/bitcoin/descriptors.md}
|
|
312
|
-
* for more information.
|
|
313
|
-
* @param {string} descriptor The descriptor.
|
|
314
|
-
* @param {Array<number>} range If descriptor is ranged, must specify end or [begin,end] to derive.
|
|
315
|
-
* @returns {Array<DerivedAddresses>} a list of derived addresses
|
|
316
|
-
* @example First three native segwit receive addresses
|
|
317
|
-
* ```
|
|
318
|
-
* const bitcoind = BitcoinRpcClient.connect()
|
|
319
|
-
* const addresses = bitcoind.deriveAddresses("wpkh([d34db33f/84h/0h/0h]xpub6DJ2dN.../0/*)#cjjspncu", [0,2])
|
|
320
|
-
* ```
|
|
321
|
-
*/
|
|
108
|
+
/** Derives one or more addresses corresponding to an output descriptor. */
|
|
322
109
|
async deriveAddresses(descriptor, range) {
|
|
323
110
|
return await this.executeRpc('deriveaddresses', [descriptor, range]);
|
|
324
111
|
}
|
|
325
|
-
/**
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
*/
|
|
112
|
+
/** Mines blocks to a given address (regtest/signet only). Returns array of block hashes. */
|
|
113
|
+
async generateToAddress(nblocks, address) {
|
|
114
|
+
return await this.executeRpc('generatetoaddress', [nblocks, address]);
|
|
115
|
+
}
|
|
116
|
+
/** Returns the total available balance. */
|
|
331
117
|
async getBalance() {
|
|
332
118
|
return await this.executeRpc('getbalance');
|
|
333
119
|
}
|
|
334
|
-
/**
|
|
335
|
-
* Returns a new Bitcoin address for receiving payments. If 'label' is specified,
|
|
336
|
-
* it is added to the address book so payments received with the address will be associated with 'label'.
|
|
337
|
-
* The 'address_type' can be one of "legacy", "p2sh-segwit", "bech32", or "bech32m".
|
|
338
|
-
* @param {string} addressType The address type to use (required, options=["legacy", "p2sh-segwit", "bech32", "bech32m"], default="bech32").
|
|
339
|
-
* @param {string} [label] The label to associate with the new address (optional).
|
|
340
|
-
* @returns {Promise<string>} A promise resolving to the new address.
|
|
341
|
-
*/
|
|
120
|
+
/** Returns a new Bitcoin address for receiving payments. */
|
|
342
121
|
async getNewAddress(addressType, label) {
|
|
343
122
|
return await this.executeRpc('getnewaddress', [label ?? '', addressType]);
|
|
344
123
|
}
|
|
345
|
-
/**
|
|
346
|
-
* Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations.
|
|
347
|
-
* Optionally filter to only include txouts paid to specified addresses.
|
|
348
|
-
* @param {Object} params The parameters for the listUnspent command.
|
|
349
|
-
* @param {number} [params.minconf=0] The minimum number of confirmations an output must have to be included.
|
|
350
|
-
* @param {number} [params.maxconf=9999999] The maximum number of confirmations an output can have to be included.
|
|
351
|
-
* @param {string[]} [params.address] Only include outputs paid to these addresses.
|
|
352
|
-
* @param {boolean} [params.include_unsafe=true] Whether to include outputs that are not safe to spend.
|
|
353
|
-
* @returns {Promise<UnspentTxInfo[]>} A promise resolving to an array of {@link UnspentTxInfo} objects.
|
|
354
|
-
*/
|
|
124
|
+
/** Returns array of unspent transaction outputs. */
|
|
355
125
|
async listUnspent(params) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
*/
|
|
126
|
+
return await this.executeRpc('listunspent', [
|
|
127
|
+
params.minconf ?? 0,
|
|
128
|
+
params.maxconf ?? 9999999,
|
|
129
|
+
params.address ?? [],
|
|
130
|
+
params.include_unsafe ?? true,
|
|
131
|
+
]);
|
|
132
|
+
}
|
|
133
|
+
/** Send an amount to a given address. */
|
|
365
134
|
async sendToAddress(address, amount) {
|
|
366
135
|
const txid = await this.executeRpc('sendtoaddress', [address, amount]);
|
|
367
136
|
return await this.getRawTransaction(txid);
|
|
368
137
|
}
|
|
369
|
-
/**
|
|
370
|
-
* Sign a message with the private key of an address.
|
|
371
|
-
* @param {string} address The address to sign the message with.
|
|
372
|
-
* @param {string} message The message to sign.
|
|
373
|
-
* @returns {Promise<string>} A promise resolving to the signature in base64.
|
|
374
|
-
*/
|
|
138
|
+
/** Sign a message with the private key of an address. */
|
|
375
139
|
async signMessage(address, message) {
|
|
376
140
|
return await this.executeRpc('signmessage', [address, message]);
|
|
377
141
|
}
|
|
378
|
-
/**
|
|
379
|
-
* Verify a signed message.
|
|
380
|
-
* @param {string} address The address to verify the message with.
|
|
381
|
-
* @param {string} signature The signature to verify in base64.
|
|
382
|
-
* @param {string} message The message to verify.
|
|
383
|
-
* @returns {Promise<boolean>} A promise resolving to true if the signature is valid, false otherwise.
|
|
384
|
-
*/
|
|
142
|
+
/** Verify a signed message. */
|
|
385
143
|
async verifyMessage(address, signature, message) {
|
|
386
144
|
return await this.executeRpc('verifymessage', [address, signature, message]);
|
|
387
145
|
}
|
|
388
|
-
/**
|
|
389
|
-
* Get detailed information about in-wallet transaction <txid>.
|
|
390
|
-
* @param txid: The transaction id. (string, required)
|
|
391
|
-
* @param {boolean} include_watchonly Whether to include watch-only addresses in balance calculation and details.
|
|
392
|
-
* @returns {WalletTransaction} A promise resolving to a {@link WalletTransaction} object.
|
|
393
|
-
*/
|
|
146
|
+
/** Get detailed information about in-wallet transaction. */
|
|
394
147
|
async getTransaction(txid, include_watchonly) {
|
|
395
148
|
return await this.executeRpc('gettransaction', [txid, include_watchonly]);
|
|
396
149
|
}
|
|
397
|
-
/**
|
|
398
|
-
* Get detailed information about a transaction.
|
|
399
|
-
* By default, this call only returns a transaction if it is in the mempool. If -txindex is enabled
|
|
400
|
-
* and no blockhash argument is passed, it will return the transaction if it is in the mempool or any block.
|
|
401
|
-
* If a blockhash argument is passed, it will return the transaction if the specified block is available and
|
|
402
|
-
* the transaction is in that block.
|
|
403
|
-
* @param {string} txid The transaction id (required).
|
|
404
|
-
* @param {?VerbosityLevel} verbosity Response format: 0 (hex), 1 (json) or 2 (jsonext).
|
|
405
|
-
* @param {?string} blockhash The block in which to look for the transaction (optional).
|
|
406
|
-
* @returns {GetRawTransaction} A promise resolving to data about a transaction in the form specified by verbosity.
|
|
407
|
-
*/
|
|
150
|
+
/** Get detailed information about a transaction. */
|
|
408
151
|
async getRawTransaction(txid, verbosity, blockhash) {
|
|
409
|
-
// Get the raw transaction
|
|
410
152
|
const rawTransaction = await this.executeRpc('getrawtransaction', [txid, verbosity ?? 2, blockhash]);
|
|
411
|
-
// Return the raw transaction based on verbosity
|
|
412
153
|
switch (verbosity) {
|
|
413
|
-
case 0:
|
|
414
|
-
|
|
415
|
-
case
|
|
416
|
-
|
|
417
|
-
case 2:
|
|
418
|
-
return rawTransaction;
|
|
419
|
-
default:
|
|
420
|
-
return rawTransaction;
|
|
154
|
+
case 0: return rawTransaction;
|
|
155
|
+
case 1: return rawTransaction;
|
|
156
|
+
case 2: return rawTransaction;
|
|
157
|
+
default: return rawTransaction;
|
|
421
158
|
}
|
|
422
159
|
}
|
|
423
|
-
/**
|
|
424
|
-
* Get detailed information about multiple transactions. An extension of {@link getRawTransaction}.
|
|
425
|
-
* @param {Array<string>} txids An array of transaction ids.
|
|
426
|
-
* @param {?VerbosityLevel} verbosity Response format: 0 (hex), 1 (json) or 2 (jsonext).
|
|
427
|
-
* @returns {Promise<Array<RawTransactionResponse>>}
|
|
428
|
-
*/
|
|
160
|
+
/** Get detailed information about multiple transactions using JSON-RPC batching. */
|
|
429
161
|
async getRawTransactions(txids, verbosity) {
|
|
430
|
-
|
|
162
|
+
const v = verbosity ?? 2;
|
|
163
|
+
const results = await this.#transport.batch(txids.map(txid => ({ method: 'getrawtransaction', params: [txid, v] })));
|
|
164
|
+
return results.map(raw => {
|
|
165
|
+
const normalized = JSONUtils.isUnprototyped(raw) ? JSONUtils.normalize(raw) : raw;
|
|
166
|
+
switch (v) {
|
|
167
|
+
case 0: return normalized;
|
|
168
|
+
case 1: return normalized;
|
|
169
|
+
case 2: return normalized;
|
|
170
|
+
default: return normalized;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
431
173
|
}
|
|
432
174
|
}
|
|
433
175
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client/rpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client/rpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA0BlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAiCjD,uEAAuE;AAEvE;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IACtB,UAAU,CAAmB;IAC7B,OAAO,CAAY;IAE5B,YAAY,MAAiB,EAAE,QAAuB;QACpD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,UAAU,CACtB,MAAS,EACT,aAAwC,EAA0C;QAElF,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,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EAAE;YACvB,MAAM,UAAU,GAAG,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;YAClF,QAAQ,CAAC,EAAE,CAAC;gBACV,KAAK,CAAC,CAAC,CAAE,OAAO,UAA8B,CAAC;gBAC/C,KAAK,CAAC,CAAC,CAAE,OAAO,UAA8B,CAAC;gBAC/C,KAAK,CAAC,CAAC,CAAE,OAAO,UAA8B,CAAC;gBAC/C,OAAO,CAAC,CAAC,OAAO,UAA8B,CAAC;YACjD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/client/rpc/interface.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/client/rpc/interface.ts"],"names":[],"mappings":""}
|