@did-btcr2/method 0.13.1
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/LICENSE +373 -0
- package/README.md +7 -0
- package/dist/browser.js +2364 -0
- package/dist/browser.js.map +7 -0
- package/dist/browser.mjs +2364 -0
- package/dist/browser.mjs.map +7 -0
- package/dist/cjs/bitcoin/constants.js +20 -0
- package/dist/cjs/bitcoin/constants.js.map +1 -0
- package/dist/cjs/bitcoin/errors.js +11 -0
- package/dist/cjs/bitcoin/errors.js.map +1 -0
- package/dist/cjs/bitcoin/index.js +95 -0
- package/dist/cjs/bitcoin/index.js.map +1 -0
- package/dist/cjs/bitcoin/interface.js +2 -0
- package/dist/cjs/bitcoin/interface.js.map +1 -0
- package/dist/cjs/bitcoin/network.js +17 -0
- package/dist/cjs/bitcoin/network.js.map +1 -0
- package/dist/cjs/bitcoin/rest-client.js +289 -0
- package/dist/cjs/bitcoin/rest-client.js.map +1 -0
- package/dist/cjs/bitcoin/rpc-client.js +722 -0
- package/dist/cjs/bitcoin/rpc-client.js.map +1 -0
- package/dist/cjs/bitcoin/taproot.js +219 -0
- package/dist/cjs/bitcoin/taproot.js.map +1 -0
- package/dist/cjs/btcr2/beacon/aggregation/coordinator.js +120 -0
- package/dist/cjs/btcr2/beacon/aggregation/coordinator.js.map +1 -0
- package/dist/cjs/btcr2/beacon/aggregation/messages/advert.js +24 -0
- package/dist/cjs/btcr2/beacon/aggregation/messages/advert.js.map +1 -0
- package/dist/cjs/btcr2/beacon/aggregation/messages/base.js +37 -0
- package/dist/cjs/btcr2/beacon/aggregation/messages/base.js.map +1 -0
- package/dist/cjs/btcr2/beacon/aggregation/messages/cohort-set.js +25 -0
- package/dist/cjs/btcr2/beacon/aggregation/messages/cohort-set.js.map +1 -0
- package/dist/cjs/btcr2/beacon/aggregation/messages/keygen.js +8 -0
- package/dist/cjs/btcr2/beacon/aggregation/messages/keygen.js.map +1 -0
- package/dist/cjs/btcr2/beacon/aggregation/messages/opt-in.js +23 -0
- package/dist/cjs/btcr2/beacon/aggregation/messages/opt-in.js.map +1 -0
- package/dist/cjs/btcr2/beacon/aggregation/messages/sign.js +7 -0
- package/dist/cjs/btcr2/beacon/aggregation/messages/sign.js.map +1 -0
- package/dist/cjs/btcr2/beacon/aggregation/models/cohort/index.js +92 -0
- package/dist/cjs/btcr2/beacon/aggregation/models/cohort/index.js.map +1 -0
- package/dist/cjs/btcr2/beacon/aggregation/models/cohort/status.js +8 -0
- package/dist/cjs/btcr2/beacon/aggregation/models/cohort/status.js.map +1 -0
- package/dist/cjs/btcr2/beacon/aggregation/participant.js +2 -0
- package/dist/cjs/btcr2/beacon/aggregation/participant.js.map +1 -0
- package/dist/cjs/btcr2/beacon/aggregation/protocol/nostr.js +57 -0
- package/dist/cjs/btcr2/beacon/aggregation/protocol/nostr.js.map +1 -0
- package/dist/cjs/btcr2/beacon/aggregation/protocol/service.js +2 -0
- package/dist/cjs/btcr2/beacon/aggregation/protocol/service.js.map +1 -0
- package/dist/cjs/btcr2/beacon/cid-aggregate.js +116 -0
- package/dist/cjs/btcr2/beacon/cid-aggregate.js.map +1 -0
- package/dist/cjs/btcr2/beacon/factory.js +30 -0
- package/dist/cjs/btcr2/beacon/factory.js.map +1 -0
- package/dist/cjs/btcr2/beacon/singleton.js +220 -0
- package/dist/cjs/btcr2/beacon/singleton.js.map +1 -0
- package/dist/cjs/btcr2/beacon/smt-aggregate.js +126 -0
- package/dist/cjs/btcr2/beacon/smt-aggregate.js.map +1 -0
- package/dist/cjs/btcr2/crud/create.js +102 -0
- package/dist/cjs/btcr2/crud/create.js.map +1 -0
- package/dist/cjs/btcr2/crud/deactivate.js +14 -0
- package/dist/cjs/btcr2/crud/deactivate.js.map +1 -0
- package/dist/cjs/btcr2/crud/read.js +686 -0
- package/dist/cjs/btcr2/crud/read.js.map +1 -0
- package/dist/cjs/btcr2/crud/update.js +195 -0
- package/dist/cjs/btcr2/crud/update.js.map +1 -0
- package/dist/cjs/btcr2/key-manager/index.js +290 -0
- package/dist/cjs/btcr2/key-manager/index.js.map +1 -0
- package/dist/cjs/btcr2/key-manager/interface.js +2 -0
- package/dist/cjs/btcr2/key-manager/interface.js.map +1 -0
- package/dist/cjs/did-btcr2.js +222 -0
- package/dist/cjs/did-btcr2.js.map +1 -0
- package/dist/cjs/index.js +27 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/interfaces/beacon.js +41 -0
- package/dist/cjs/interfaces/beacon.js.map +1 -0
- package/dist/cjs/interfaces/crud.js +2 -0
- package/dist/cjs/interfaces/crud.js.map +1 -0
- package/dist/cjs/interfaces/ibeacon.js +2 -0
- package/dist/cjs/interfaces/ibeacon.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/types/bitcoin.js +62 -0
- package/dist/cjs/types/bitcoin.js.map +1 -0
- package/dist/cjs/types/crud.js +2 -0
- package/dist/cjs/types/crud.js.map +1 -0
- package/dist/cjs/utils/appendix.js +221 -0
- package/dist/cjs/utils/appendix.js.map +1 -0
- package/dist/cjs/utils/beacons.js +206 -0
- package/dist/cjs/utils/beacons.js.map +1 -0
- package/dist/cjs/utils/did-document-builder.js +61 -0
- package/dist/cjs/utils/did-document-builder.js.map +1 -0
- package/dist/cjs/utils/did-document.js +380 -0
- package/dist/cjs/utils/did-document.js.map +1 -0
- package/dist/cjs/utils/general.js +195 -0
- package/dist/cjs/utils/general.js.map +1 -0
- package/dist/cjs/utils/identifier.js +238 -0
- package/dist/cjs/utils/identifier.js.map +1 -0
- package/dist/esm/bitcoin/constants.js +20 -0
- package/dist/esm/bitcoin/constants.js.map +1 -0
- package/dist/esm/bitcoin/errors.js +11 -0
- package/dist/esm/bitcoin/errors.js.map +1 -0
- package/dist/esm/bitcoin/index.js +95 -0
- package/dist/esm/bitcoin/index.js.map +1 -0
- package/dist/esm/bitcoin/interface.js +2 -0
- package/dist/esm/bitcoin/interface.js.map +1 -0
- package/dist/esm/bitcoin/network.js +17 -0
- package/dist/esm/bitcoin/network.js.map +1 -0
- package/dist/esm/bitcoin/rest-client.js +289 -0
- package/dist/esm/bitcoin/rest-client.js.map +1 -0
- package/dist/esm/bitcoin/rpc-client.js +722 -0
- package/dist/esm/bitcoin/rpc-client.js.map +1 -0
- package/dist/esm/bitcoin/taproot.js +219 -0
- package/dist/esm/bitcoin/taproot.js.map +1 -0
- package/dist/esm/btcr2/beacon/aggregation/coordinator.js +120 -0
- package/dist/esm/btcr2/beacon/aggregation/coordinator.js.map +1 -0
- package/dist/esm/btcr2/beacon/aggregation/messages/advert.js +24 -0
- package/dist/esm/btcr2/beacon/aggregation/messages/advert.js.map +1 -0
- package/dist/esm/btcr2/beacon/aggregation/messages/base.js +37 -0
- package/dist/esm/btcr2/beacon/aggregation/messages/base.js.map +1 -0
- package/dist/esm/btcr2/beacon/aggregation/messages/cohort-set.js +25 -0
- package/dist/esm/btcr2/beacon/aggregation/messages/cohort-set.js.map +1 -0
- package/dist/esm/btcr2/beacon/aggregation/messages/keygen.js +8 -0
- package/dist/esm/btcr2/beacon/aggregation/messages/keygen.js.map +1 -0
- package/dist/esm/btcr2/beacon/aggregation/messages/opt-in.js +23 -0
- package/dist/esm/btcr2/beacon/aggregation/messages/opt-in.js.map +1 -0
- package/dist/esm/btcr2/beacon/aggregation/messages/sign.js +7 -0
- package/dist/esm/btcr2/beacon/aggregation/messages/sign.js.map +1 -0
- package/dist/esm/btcr2/beacon/aggregation/models/cohort/index.js +92 -0
- package/dist/esm/btcr2/beacon/aggregation/models/cohort/index.js.map +1 -0
- package/dist/esm/btcr2/beacon/aggregation/models/cohort/status.js +8 -0
- package/dist/esm/btcr2/beacon/aggregation/models/cohort/status.js.map +1 -0
- package/dist/esm/btcr2/beacon/aggregation/participant.js +2 -0
- package/dist/esm/btcr2/beacon/aggregation/participant.js.map +1 -0
- package/dist/esm/btcr2/beacon/aggregation/protocol/nostr.js +57 -0
- package/dist/esm/btcr2/beacon/aggregation/protocol/nostr.js.map +1 -0
- package/dist/esm/btcr2/beacon/aggregation/protocol/service.js +2 -0
- package/dist/esm/btcr2/beacon/aggregation/protocol/service.js.map +1 -0
- package/dist/esm/btcr2/beacon/cid-aggregate.js +116 -0
- package/dist/esm/btcr2/beacon/cid-aggregate.js.map +1 -0
- package/dist/esm/btcr2/beacon/factory.js +30 -0
- package/dist/esm/btcr2/beacon/factory.js.map +1 -0
- package/dist/esm/btcr2/beacon/singleton.js +220 -0
- package/dist/esm/btcr2/beacon/singleton.js.map +1 -0
- package/dist/esm/btcr2/beacon/smt-aggregate.js +126 -0
- package/dist/esm/btcr2/beacon/smt-aggregate.js.map +1 -0
- package/dist/esm/btcr2/crud/create.js +102 -0
- package/dist/esm/btcr2/crud/create.js.map +1 -0
- package/dist/esm/btcr2/crud/deactivate.js +14 -0
- package/dist/esm/btcr2/crud/deactivate.js.map +1 -0
- package/dist/esm/btcr2/crud/read.js +686 -0
- package/dist/esm/btcr2/crud/read.js.map +1 -0
- package/dist/esm/btcr2/crud/update.js +195 -0
- package/dist/esm/btcr2/crud/update.js.map +1 -0
- package/dist/esm/btcr2/key-manager/index.js +290 -0
- package/dist/esm/btcr2/key-manager/index.js.map +1 -0
- package/dist/esm/btcr2/key-manager/interface.js +2 -0
- package/dist/esm/btcr2/key-manager/interface.js.map +1 -0
- package/dist/esm/did-btcr2.js +222 -0
- package/dist/esm/did-btcr2.js.map +1 -0
- package/dist/esm/index.js +27 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/interfaces/beacon.js +41 -0
- package/dist/esm/interfaces/beacon.js.map +1 -0
- package/dist/esm/interfaces/crud.js +2 -0
- package/dist/esm/interfaces/crud.js.map +1 -0
- package/dist/esm/interfaces/ibeacon.js +2 -0
- package/dist/esm/interfaces/ibeacon.js.map +1 -0
- package/dist/esm/types/bitcoin.js +62 -0
- package/dist/esm/types/bitcoin.js.map +1 -0
- package/dist/esm/types/crud.js +2 -0
- package/dist/esm/types/crud.js.map +1 -0
- package/dist/esm/utils/appendix.js +221 -0
- package/dist/esm/utils/appendix.js.map +1 -0
- package/dist/esm/utils/beacons.js +206 -0
- package/dist/esm/utils/beacons.js.map +1 -0
- package/dist/esm/utils/did-document-builder.js +61 -0
- package/dist/esm/utils/did-document-builder.js.map +1 -0
- package/dist/esm/utils/did-document.js +380 -0
- package/dist/esm/utils/did-document.js.map +1 -0
- package/dist/esm/utils/general.js +195 -0
- package/dist/esm/utils/general.js.map +1 -0
- package/dist/esm/utils/identifier.js +238 -0
- package/dist/esm/utils/identifier.js.map +1 -0
- package/dist/types/bitcoin/constants.d.ts +19 -0
- package/dist/types/bitcoin/constants.d.ts.map +1 -0
- package/dist/types/bitcoin/errors.d.ts +5 -0
- package/dist/types/bitcoin/errors.d.ts.map +1 -0
- package/dist/types/bitcoin/index.d.ts +75 -0
- package/dist/types/bitcoin/index.d.ts.map +1 -0
- package/dist/types/bitcoin/interface.d.ts +86 -0
- package/dist/types/bitcoin/interface.d.ts.map +1 -0
- package/dist/types/bitcoin/network.d.ts +2 -0
- package/dist/types/bitcoin/network.d.ts.map +1 -0
- package/dist/types/bitcoin/rest-client.d.ts +268 -0
- package/dist/types/bitcoin/rest-client.d.ts.map +1 -0
- package/dist/types/bitcoin/rpc-client.d.ts +506 -0
- package/dist/types/bitcoin/rpc-client.d.ts.map +1 -0
- package/dist/types/bitcoin/taproot.d.ts +34 -0
- package/dist/types/bitcoin/taproot.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/aggregation/coordinator.d.ts +74 -0
- package/dist/types/btcr2/beacon/aggregation/coordinator.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/aggregation/messages/advert.d.ts +22 -0
- package/dist/types/btcr2/beacon/aggregation/messages/advert.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/aggregation/messages/base.d.ts +36 -0
- package/dist/types/btcr2/beacon/aggregation/messages/base.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/aggregation/messages/cohort-set.d.ts +23 -0
- package/dist/types/btcr2/beacon/aggregation/messages/cohort-set.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/aggregation/messages/keygen.d.ts +6 -0
- package/dist/types/btcr2/beacon/aggregation/messages/keygen.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/aggregation/messages/opt-in.d.ts +22 -0
- package/dist/types/btcr2/beacon/aggregation/messages/opt-in.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/aggregation/messages/sign.d.ts +5 -0
- package/dist/types/btcr2/beacon/aggregation/messages/sign.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/aggregation/models/cohort/index.d.ts +77 -0
- package/dist/types/btcr2/beacon/aggregation/models/cohort/index.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/aggregation/models/cohort/status.d.ts +7 -0
- package/dist/types/btcr2/beacon/aggregation/models/cohort/status.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/aggregation/participant.d.ts +1 -0
- package/dist/types/btcr2/beacon/aggregation/participant.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/aggregation/protocol/nostr.d.ts +36 -0
- package/dist/types/btcr2/beacon/aggregation/protocol/nostr.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/aggregation/protocol/service.d.ts +6 -0
- package/dist/types/btcr2/beacon/aggregation/protocol/service.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/cid-aggregate.d.ts +103 -0
- package/dist/types/btcr2/beacon/cid-aggregate.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/factory.d.ts +17 -0
- package/dist/types/btcr2/beacon/factory.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/singleton.d.ts +93 -0
- package/dist/types/btcr2/beacon/singleton.d.ts.map +1 -0
- package/dist/types/btcr2/beacon/smt-aggregate.d.ts +112 -0
- package/dist/types/btcr2/beacon/smt-aggregate.d.ts.map +1 -0
- package/dist/types/btcr2/crud/create.d.ts +92 -0
- package/dist/types/btcr2/crud/create.d.ts.map +1 -0
- package/dist/types/btcr2/crud/deactivate.d.ts +13 -0
- package/dist/types/btcr2/crud/deactivate.d.ts.map +1 -0
- package/dist/types/btcr2/crud/read.d.ts +341 -0
- package/dist/types/btcr2/crud/read.d.ts.map +1 -0
- package/dist/types/btcr2/crud/update.d.ts +83 -0
- package/dist/types/btcr2/crud/update.d.ts.map +1 -0
- package/dist/types/btcr2/key-manager/index.d.ts +145 -0
- package/dist/types/btcr2/key-manager/index.d.ts.map +1 -0
- package/dist/types/btcr2/key-manager/interface.d.ts +113 -0
- package/dist/types/btcr2/key-manager/interface.d.ts.map +1 -0
- package/dist/types/did-btcr2.d.ts +117 -0
- package/dist/types/did-btcr2.d.ts.map +1 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/interfaces/beacon.d.ts +57 -0
- package/dist/types/interfaces/beacon.d.ts.map +1 -0
- package/dist/types/interfaces/crud.d.ts +35 -0
- package/dist/types/interfaces/crud.d.ts.map +1 -0
- package/dist/types/interfaces/ibeacon.d.ts +66 -0
- package/dist/types/interfaces/ibeacon.d.ts.map +1 -0
- package/dist/types/types/bitcoin.d.ts +827 -0
- package/dist/types/types/bitcoin.d.ts.map +1 -0
- package/dist/types/types/crud.d.ts +38 -0
- package/dist/types/types/crud.d.ts.map +1 -0
- package/dist/types/utils/appendix.d.ts +118 -0
- package/dist/types/utils/appendix.d.ts.map +1 -0
- package/dist/types/utils/beacons.d.ts +156 -0
- package/dist/types/utils/beacons.d.ts.map +1 -0
- package/dist/types/utils/did-document-builder.d.ts +13 -0
- package/dist/types/utils/did-document-builder.d.ts.map +1 -0
- package/dist/types/utils/did-document.d.ts +211 -0
- package/dist/types/utils/did-document.d.ts.map +1 -0
- package/dist/types/utils/general.d.ts +85 -0
- package/dist/types/utils/general.d.ts.map +1 -0
- package/dist/types/utils/identifier.d.ts +59 -0
- package/dist/types/utils/identifier.d.ts.map +1 -0
- package/package.json +137 -0
- package/src/bitcoin/constants.ts +19 -0
- package/src/bitcoin/errors.ts +10 -0
- package/src/bitcoin/index.ts +154 -0
- package/src/bitcoin/interface.ts +160 -0
- package/src/bitcoin/network.ts +17 -0
- package/src/bitcoin/rest-client.ts +415 -0
- package/src/bitcoin/rpc-client.ts +888 -0
- package/src/bitcoin/taproot.ts +237 -0
- package/src/btcr2/beacon/aggregation/coordinator.ts +135 -0
- package/src/btcr2/beacon/aggregation/messages/advert.ts +36 -0
- package/src/btcr2/beacon/aggregation/messages/base.ts +59 -0
- package/src/btcr2/beacon/aggregation/messages/cohort-set.ts +37 -0
- package/src/btcr2/beacon/aggregation/messages/keygen.ts +8 -0
- package/src/btcr2/beacon/aggregation/messages/opt-in.ts +35 -0
- package/src/btcr2/beacon/aggregation/messages/sign.ts +7 -0
- package/src/btcr2/beacon/aggregation/models/cohort/index.ts +112 -0
- package/src/btcr2/beacon/aggregation/models/cohort/status.ts +7 -0
- package/src/btcr2/beacon/aggregation/participant.ts +0 -0
- package/src/btcr2/beacon/aggregation/protocol/nostr.ts +81 -0
- package/src/btcr2/beacon/aggregation/protocol/service.ts +6 -0
- package/src/btcr2/beacon/cid-aggregate.ts +154 -0
- package/src/btcr2/beacon/factory.ts +36 -0
- package/src/btcr2/beacon/singleton.ts +257 -0
- package/src/btcr2/beacon/smt-aggregate.ts +136 -0
- package/src/btcr2/crud/create.ts +160 -0
- package/src/btcr2/crud/deactivate.ts +13 -0
- package/src/btcr2/crud/read.ts +946 -0
- package/src/btcr2/crud/update.ts +277 -0
- package/src/btcr2/key-manager/index.ts +364 -0
- package/src/btcr2/key-manager/interface.ts +129 -0
- package/src/canonicalize.d.ts +6 -0
- package/src/did-btcr2.ts +288 -0
- package/src/index.ts +34 -0
- package/src/interfaces/beacon.ts +68 -0
- package/src/interfaces/crud.ts +36 -0
- package/src/interfaces/ibeacon.ts +76 -0
- package/src/types/bitcoin.ts +1028 -0
- package/src/types/crud.ts +41 -0
- package/src/utils/appendix.ts +257 -0
- package/src/utils/beacons.ts +276 -0
- package/src/utils/did-document-builder.ts +73 -0
- package/src/utils/did-document.ts +474 -0
- package/src/utils/general.ts +204 -0
- package/src/utils/identifier.ts +276 -0
|
@@ -0,0 +1,827 @@
|
|
|
1
|
+
import { Hex, UnixTimestamp } from '@did-btcr2/common';
|
|
2
|
+
import BitcoinRpc from '../bitcoin/rpc-client.js';
|
|
3
|
+
export interface ReturnFormatOptions {
|
|
4
|
+
extension?: 'json' | 'bin' | 'hex';
|
|
5
|
+
}
|
|
6
|
+
export type TxId = string;
|
|
7
|
+
export interface BlockHashOptions extends ReturnFormatOptions {
|
|
8
|
+
summary?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface IClientConfig {
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
host?: string;
|
|
13
|
+
logger?: any;
|
|
14
|
+
password?: string;
|
|
15
|
+
timeout?: number;
|
|
16
|
+
username?: string;
|
|
17
|
+
version?: string;
|
|
18
|
+
wallet?: string;
|
|
19
|
+
allowDefaultWallet?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare class RpcClientConfig implements IClientConfig {
|
|
22
|
+
network?: string;
|
|
23
|
+
headers?: Record<string, string>;
|
|
24
|
+
host?: string;
|
|
25
|
+
logger?: any;
|
|
26
|
+
password?: string;
|
|
27
|
+
timeout?: number;
|
|
28
|
+
username?: string;
|
|
29
|
+
version?: string;
|
|
30
|
+
wallet?: string;
|
|
31
|
+
allowDefaultWallet?: boolean;
|
|
32
|
+
constructor(options?: IClientConfig);
|
|
33
|
+
static initialize(options?: IClientConfig): RpcClientConfig;
|
|
34
|
+
}
|
|
35
|
+
export interface ClientConstructorOption {
|
|
36
|
+
agentOptions?: any;
|
|
37
|
+
headers?: boolean;
|
|
38
|
+
host?: string;
|
|
39
|
+
logger?: Function;
|
|
40
|
+
network?: 'mainnet' | 'regtest' | 'testnet';
|
|
41
|
+
password?: string;
|
|
42
|
+
port?: string | number;
|
|
43
|
+
ssl?: any;
|
|
44
|
+
timeout?: number;
|
|
45
|
+
username?: string;
|
|
46
|
+
version?: string;
|
|
47
|
+
}
|
|
48
|
+
export type ScriptDecoded = {
|
|
49
|
+
asm: string;
|
|
50
|
+
hex: string;
|
|
51
|
+
type: string;
|
|
52
|
+
reqSigs: number;
|
|
53
|
+
addresses: string[];
|
|
54
|
+
ps2h?: string;
|
|
55
|
+
};
|
|
56
|
+
export type FundRawTxOptions = {
|
|
57
|
+
changeAddress?: string;
|
|
58
|
+
chnagePosition?: number;
|
|
59
|
+
includeWatching?: boolean;
|
|
60
|
+
lockUnspents?: boolean;
|
|
61
|
+
feeRate?: number;
|
|
62
|
+
subtractFeeFromOutputs?: number[];
|
|
63
|
+
replaceable?: boolean;
|
|
64
|
+
conf_target?: number;
|
|
65
|
+
estimate_mode: FeeEstimateMode;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* unset
|
|
69
|
+
* - no mode set
|
|
70
|
+
* economical
|
|
71
|
+
* - used if the transaction is replaceable
|
|
72
|
+
* - uses shorter time horizon to estimate
|
|
73
|
+
* - more responsive to short-term drops in the prevailing fee market
|
|
74
|
+
* - potentially returns a lower fee rate estimate
|
|
75
|
+
* conservative
|
|
76
|
+
* - used is the transaction is not replaceable
|
|
77
|
+
* - use a longer time horizon to estimate
|
|
78
|
+
* - less responsive to short-term drops in the prevailing fee market
|
|
79
|
+
* - potentially returns a higher fee rate estimate
|
|
80
|
+
*/
|
|
81
|
+
export type FeeEstimateMode = 'UNSET' | 'ECONOMICAL' | 'CONSERVATIVE';
|
|
82
|
+
export type TxStats = {
|
|
83
|
+
time: number;
|
|
84
|
+
txcount: number;
|
|
85
|
+
window_final_block_hash?: string;
|
|
86
|
+
window_block_count?: number;
|
|
87
|
+
window_tx_count?: number;
|
|
88
|
+
window_interval?: number;
|
|
89
|
+
txrate: number;
|
|
90
|
+
};
|
|
91
|
+
export type AddedNodeInfo = {
|
|
92
|
+
addednode: string;
|
|
93
|
+
connected: boolean;
|
|
94
|
+
addresses: {
|
|
95
|
+
address: string;
|
|
96
|
+
connected: 'inbound' | 'outbound';
|
|
97
|
+
}[];
|
|
98
|
+
};
|
|
99
|
+
export type MemoryStats = {
|
|
100
|
+
locked: {
|
|
101
|
+
used: number;
|
|
102
|
+
free: number;
|
|
103
|
+
total: number;
|
|
104
|
+
locked: number;
|
|
105
|
+
chunks_used: number;
|
|
106
|
+
chunks_free: number;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
export type NetworkInfo = {
|
|
110
|
+
version: number;
|
|
111
|
+
subversion: string;
|
|
112
|
+
protocolversion: number;
|
|
113
|
+
localservices: string;
|
|
114
|
+
localrelay: boolean;
|
|
115
|
+
timeoffset: number;
|
|
116
|
+
connections: number;
|
|
117
|
+
networkactive: boolean;
|
|
118
|
+
networks: {
|
|
119
|
+
name: string;
|
|
120
|
+
limited: boolean;
|
|
121
|
+
reachable: boolean;
|
|
122
|
+
proxy: string;
|
|
123
|
+
proxy_randomize_credentials: boolean;
|
|
124
|
+
}[];
|
|
125
|
+
relayfee: number;
|
|
126
|
+
incrementalfee: number;
|
|
127
|
+
localaddresses: {
|
|
128
|
+
address: string;
|
|
129
|
+
port: number;
|
|
130
|
+
score: number;
|
|
131
|
+
}[];
|
|
132
|
+
warnings?: string;
|
|
133
|
+
};
|
|
134
|
+
export type PeerInfo = {
|
|
135
|
+
id: number;
|
|
136
|
+
addr: string;
|
|
137
|
+
addrbind: string;
|
|
138
|
+
addrlocal: string;
|
|
139
|
+
services: string;
|
|
140
|
+
relaytxs: boolean;
|
|
141
|
+
lastsend: number;
|
|
142
|
+
lastrecv: number;
|
|
143
|
+
bytessent: number;
|
|
144
|
+
bytesrecv: number;
|
|
145
|
+
conntime: number;
|
|
146
|
+
timeoffset: number;
|
|
147
|
+
pingtime: number;
|
|
148
|
+
minping: number;
|
|
149
|
+
version: number;
|
|
150
|
+
subver: string;
|
|
151
|
+
inbound: boolean;
|
|
152
|
+
addnode: boolean;
|
|
153
|
+
startinheight: number;
|
|
154
|
+
banscore: number;
|
|
155
|
+
synced_headers: number;
|
|
156
|
+
synced_blocks: number;
|
|
157
|
+
inflight: number[];
|
|
158
|
+
whitelisted: boolean;
|
|
159
|
+
bytessent_per_msg: {
|
|
160
|
+
[key: string]: number;
|
|
161
|
+
};
|
|
162
|
+
byterecv_per_msg: {
|
|
163
|
+
[key: string]: number;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
export type NetTotals = {
|
|
167
|
+
totalbytesrecv: number;
|
|
168
|
+
totalbytessent: number;
|
|
169
|
+
timemlillis: number;
|
|
170
|
+
uploadtarget: {
|
|
171
|
+
timeframe: number;
|
|
172
|
+
target: number;
|
|
173
|
+
target_reached: boolean;
|
|
174
|
+
save_historical_blocks: boolean;
|
|
175
|
+
bytes_left_in_cycle: number;
|
|
176
|
+
time_lef_in_cycle: number;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
export type ChainInfo = {
|
|
180
|
+
chain: string;
|
|
181
|
+
blocks: number;
|
|
182
|
+
headers: number;
|
|
183
|
+
bestblockhash: string;
|
|
184
|
+
difficulty: number;
|
|
185
|
+
mediantime: number;
|
|
186
|
+
verificationprogress: number;
|
|
187
|
+
initialblockdownload: boolean;
|
|
188
|
+
chainwork: string;
|
|
189
|
+
size_on_disk: number;
|
|
190
|
+
pruned: boolean;
|
|
191
|
+
pruneheight: number;
|
|
192
|
+
automatic_pruning: boolean;
|
|
193
|
+
prune_target_size: number;
|
|
194
|
+
softforks: {
|
|
195
|
+
id: string;
|
|
196
|
+
version: number;
|
|
197
|
+
reject: {
|
|
198
|
+
status: boolean;
|
|
199
|
+
};
|
|
200
|
+
}[];
|
|
201
|
+
bip9_softforks: {
|
|
202
|
+
[key: string]: {
|
|
203
|
+
status: 'defined' | 'started' | 'locked_in' | 'active' | 'failed';
|
|
204
|
+
};
|
|
205
|
+
}[];
|
|
206
|
+
warnings?: string;
|
|
207
|
+
};
|
|
208
|
+
export type ChainTip = {
|
|
209
|
+
height: number;
|
|
210
|
+
hash: string;
|
|
211
|
+
branchlen: number;
|
|
212
|
+
status: 'active' | 'valid-fork' | 'valid-headers' | 'headers-only' | 'invalid';
|
|
213
|
+
};
|
|
214
|
+
export type Outpoint = {
|
|
215
|
+
id: string;
|
|
216
|
+
index: number;
|
|
217
|
+
};
|
|
218
|
+
export type UTXO = {
|
|
219
|
+
height: number;
|
|
220
|
+
value: number;
|
|
221
|
+
scriptPubkey: {
|
|
222
|
+
asm: string;
|
|
223
|
+
hex: string;
|
|
224
|
+
reqSigs: number;
|
|
225
|
+
type: string;
|
|
226
|
+
addresses: string[];
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
export type UnspentTxInfo = {
|
|
230
|
+
txid: string;
|
|
231
|
+
vout: number;
|
|
232
|
+
address: string;
|
|
233
|
+
acount: string;
|
|
234
|
+
scriptPubKey: string;
|
|
235
|
+
amount: number;
|
|
236
|
+
confirmations: number;
|
|
237
|
+
redeemScript: string;
|
|
238
|
+
spendable: boolean;
|
|
239
|
+
solvable: boolean;
|
|
240
|
+
safe: boolean;
|
|
241
|
+
};
|
|
242
|
+
export type PrevOut = {
|
|
243
|
+
txid: string;
|
|
244
|
+
vout: number;
|
|
245
|
+
scriptPubKey: string;
|
|
246
|
+
redeemScript?: string;
|
|
247
|
+
amount: number;
|
|
248
|
+
};
|
|
249
|
+
export type UTXOStats = {
|
|
250
|
+
height: number;
|
|
251
|
+
bestblock: string;
|
|
252
|
+
transactions: number;
|
|
253
|
+
txouts: number;
|
|
254
|
+
bogosize: number;
|
|
255
|
+
hash_serialized_2: string;
|
|
256
|
+
disk_size: number;
|
|
257
|
+
total_amount: number;
|
|
258
|
+
};
|
|
259
|
+
export type MempoolContent = {
|
|
260
|
+
[key: string]: {
|
|
261
|
+
size: number;
|
|
262
|
+
fee: number;
|
|
263
|
+
modifiedfee: number;
|
|
264
|
+
time: number;
|
|
265
|
+
height: number;
|
|
266
|
+
descendantcount: number;
|
|
267
|
+
descendantsize: number;
|
|
268
|
+
descendantfees: number;
|
|
269
|
+
ancestorcount: number;
|
|
270
|
+
ancestorsize: number;
|
|
271
|
+
ancestorfees: number;
|
|
272
|
+
wtxid: string;
|
|
273
|
+
depends: string[];
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
export type DecodedRawTransaction = {
|
|
277
|
+
txid: string;
|
|
278
|
+
hash: string;
|
|
279
|
+
size: number;
|
|
280
|
+
vsize: number;
|
|
281
|
+
version: number;
|
|
282
|
+
locktime: number;
|
|
283
|
+
vin: TxIn[];
|
|
284
|
+
vout: TxOut[];
|
|
285
|
+
};
|
|
286
|
+
export interface FetchedRawTransaction extends DecodedRawTransaction {
|
|
287
|
+
hex: string;
|
|
288
|
+
blockhash: string;
|
|
289
|
+
confirmations: number;
|
|
290
|
+
time: number;
|
|
291
|
+
blocktime: number;
|
|
292
|
+
}
|
|
293
|
+
export type MiningInfo = {
|
|
294
|
+
blocks: number;
|
|
295
|
+
currentblockweight: number;
|
|
296
|
+
currentblocktx: number;
|
|
297
|
+
difficulty: number;
|
|
298
|
+
networkhashps: number;
|
|
299
|
+
pooledtx: number;
|
|
300
|
+
chain: 'main' | 'test' | 'regtest';
|
|
301
|
+
warnings?: string;
|
|
302
|
+
};
|
|
303
|
+
export type MempoolInfo = {
|
|
304
|
+
size: number;
|
|
305
|
+
bytes: number;
|
|
306
|
+
usage: number;
|
|
307
|
+
maxmempol: number;
|
|
308
|
+
mempoolminfee: number;
|
|
309
|
+
minrelaytxfee: number;
|
|
310
|
+
};
|
|
311
|
+
export type BlockHeader = {
|
|
312
|
+
hash: string;
|
|
313
|
+
confirmations: number;
|
|
314
|
+
height: number;
|
|
315
|
+
version: number;
|
|
316
|
+
versionHex: string;
|
|
317
|
+
merkleroot: string;
|
|
318
|
+
time: number;
|
|
319
|
+
mediantime: number;
|
|
320
|
+
nonce: number;
|
|
321
|
+
bits: string;
|
|
322
|
+
difficulty: number;
|
|
323
|
+
chainwork: string;
|
|
324
|
+
previoutsblockchash: string;
|
|
325
|
+
};
|
|
326
|
+
/** Block and GetBlock */
|
|
327
|
+
export type Block = {
|
|
328
|
+
hash: string;
|
|
329
|
+
confirmations: number;
|
|
330
|
+
height: number;
|
|
331
|
+
version: number;
|
|
332
|
+
versionHex: string;
|
|
333
|
+
merkleroot: string;
|
|
334
|
+
time: number;
|
|
335
|
+
mediantime: number;
|
|
336
|
+
nonce: number;
|
|
337
|
+
bits: string;
|
|
338
|
+
difficulty: number;
|
|
339
|
+
chainwork: string;
|
|
340
|
+
nTx: number;
|
|
341
|
+
previousblockhash: string;
|
|
342
|
+
nextblockhash?: string;
|
|
343
|
+
strippedsize: number;
|
|
344
|
+
size: number;
|
|
345
|
+
weight: number;
|
|
346
|
+
};
|
|
347
|
+
export type BlockV0 = string;
|
|
348
|
+
export interface BlockV1 extends Block {
|
|
349
|
+
tx: Array<string>;
|
|
350
|
+
}
|
|
351
|
+
export interface BlockV2 extends Block {
|
|
352
|
+
tx: Array<RawTransactionV1>;
|
|
353
|
+
}
|
|
354
|
+
export interface BlockV3 extends Block {
|
|
355
|
+
tx: Array<RawTransactionV2>;
|
|
356
|
+
}
|
|
357
|
+
export type BlockResponse = BlockV0 | BlockV1 | BlockV2 | BlockV3;
|
|
358
|
+
/** Transaction and RawTransaction */
|
|
359
|
+
export type Transaction = {
|
|
360
|
+
hex: string;
|
|
361
|
+
txid: string;
|
|
362
|
+
hash: string;
|
|
363
|
+
size: number;
|
|
364
|
+
vsize: number;
|
|
365
|
+
weight: number;
|
|
366
|
+
version: number;
|
|
367
|
+
locktime: number;
|
|
368
|
+
};
|
|
369
|
+
export type TxIn = {
|
|
370
|
+
coinbase?: string;
|
|
371
|
+
txid?: string;
|
|
372
|
+
vout?: number;
|
|
373
|
+
scriptSig?: {
|
|
374
|
+
asm: string;
|
|
375
|
+
hex: string;
|
|
376
|
+
};
|
|
377
|
+
txinwitness?: string[];
|
|
378
|
+
sequence: number;
|
|
379
|
+
};
|
|
380
|
+
export type TxInPrevout = {
|
|
381
|
+
generated: boolean;
|
|
382
|
+
height: number;
|
|
383
|
+
value: number;
|
|
384
|
+
scriptPubKey?: {
|
|
385
|
+
asm: string;
|
|
386
|
+
desc: string;
|
|
387
|
+
hex: string;
|
|
388
|
+
address?: string;
|
|
389
|
+
type: string;
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
export interface TxInExt extends TxIn {
|
|
393
|
+
prevout: TxInPrevout;
|
|
394
|
+
}
|
|
395
|
+
export type TxOut = {
|
|
396
|
+
value: number;
|
|
397
|
+
n: number;
|
|
398
|
+
scriptPubKey: {
|
|
399
|
+
asm: string;
|
|
400
|
+
hex: string;
|
|
401
|
+
reqSigs: number;
|
|
402
|
+
type: scriptPubkeyType;
|
|
403
|
+
address?: string;
|
|
404
|
+
desc: string;
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
export type RawTransactionV0 = string;
|
|
408
|
+
export interface RawTransactionV1 extends Transaction {
|
|
409
|
+
vin: TxIn[];
|
|
410
|
+
vout: TxOut[];
|
|
411
|
+
}
|
|
412
|
+
export interface RawTransactionV2 extends Transaction {
|
|
413
|
+
fee?: number;
|
|
414
|
+
vin: TxInExt[];
|
|
415
|
+
vout: TxOut[];
|
|
416
|
+
}
|
|
417
|
+
export type RawTransactionResponse = RawTransactionV0 | RawTransactionV1 | RawTransactionV2;
|
|
418
|
+
export type CreateRawTxInputs = {
|
|
419
|
+
txid: string;
|
|
420
|
+
vout: number;
|
|
421
|
+
sequence?: number;
|
|
422
|
+
};
|
|
423
|
+
export type TxOutForCreateRaw = {
|
|
424
|
+
address: string;
|
|
425
|
+
data: string;
|
|
426
|
+
};
|
|
427
|
+
export type TxOutInBlock = {
|
|
428
|
+
bestblock: string;
|
|
429
|
+
confirmations: number;
|
|
430
|
+
value: number;
|
|
431
|
+
scriptPubKey: {
|
|
432
|
+
asm: string;
|
|
433
|
+
hex: string;
|
|
434
|
+
reqSigs: number;
|
|
435
|
+
type: scriptPubkeyType;
|
|
436
|
+
addresses: string[];
|
|
437
|
+
};
|
|
438
|
+
coinbase: boolean;
|
|
439
|
+
};
|
|
440
|
+
export type DecodedScript = {
|
|
441
|
+
asm: string;
|
|
442
|
+
hex: string;
|
|
443
|
+
type: string;
|
|
444
|
+
reqSigs: number;
|
|
445
|
+
addresses: string[];
|
|
446
|
+
p2sh: string;
|
|
447
|
+
};
|
|
448
|
+
export type WalletTransaction = {
|
|
449
|
+
amount: number;
|
|
450
|
+
fee: number;
|
|
451
|
+
confirmations: number;
|
|
452
|
+
blockhash: string;
|
|
453
|
+
blockindex: number;
|
|
454
|
+
blocktime: number;
|
|
455
|
+
txid: string;
|
|
456
|
+
time: number;
|
|
457
|
+
timereceived: number;
|
|
458
|
+
'bip125-replaceable': 'yes' | 'no' | 'unknown';
|
|
459
|
+
details: {
|
|
460
|
+
account: string;
|
|
461
|
+
address: string;
|
|
462
|
+
category: 'send' | 'receive';
|
|
463
|
+
amount: number;
|
|
464
|
+
label?: string;
|
|
465
|
+
vout: number;
|
|
466
|
+
fee: number;
|
|
467
|
+
abandoned: number;
|
|
468
|
+
}[];
|
|
469
|
+
hex: string;
|
|
470
|
+
};
|
|
471
|
+
export type WalletInfo = {
|
|
472
|
+
walletname: string;
|
|
473
|
+
walletversion: number;
|
|
474
|
+
balance: number;
|
|
475
|
+
unconfirmed_balance: number;
|
|
476
|
+
immature_balance: number;
|
|
477
|
+
txcount: number;
|
|
478
|
+
keypoololdest: number;
|
|
479
|
+
keypoolsize: number;
|
|
480
|
+
paytxfee: number;
|
|
481
|
+
hdmasterkeyid: string;
|
|
482
|
+
};
|
|
483
|
+
export type scriptPubkeyType = string;
|
|
484
|
+
export type SigHashType = 'ALL' | 'NONE' | 'SINGLE' | 'ALL|ANYONECANPAY' | 'NONE|ANYONECANPAY' | 'SINGLE|ANYONECANPAY';
|
|
485
|
+
export type SignedRawTx = {
|
|
486
|
+
hex: string;
|
|
487
|
+
complete: boolean;
|
|
488
|
+
errors?: {
|
|
489
|
+
txid: string;
|
|
490
|
+
vout: number;
|
|
491
|
+
scriptSig: string;
|
|
492
|
+
sequence: number;
|
|
493
|
+
error: string;
|
|
494
|
+
}[];
|
|
495
|
+
};
|
|
496
|
+
export type ValidateAddressResult = {
|
|
497
|
+
isvalid: boolean;
|
|
498
|
+
address?: string;
|
|
499
|
+
scriptPubKey?: string;
|
|
500
|
+
ismine?: boolean;
|
|
501
|
+
iswatchonly?: boolean;
|
|
502
|
+
isscript?: boolean;
|
|
503
|
+
script?: string;
|
|
504
|
+
hex?: string;
|
|
505
|
+
addresses?: string[];
|
|
506
|
+
sigsrequired?: number;
|
|
507
|
+
pubkey?: string;
|
|
508
|
+
iscompressed?: boolean;
|
|
509
|
+
account?: string;
|
|
510
|
+
timestamp?: number;
|
|
511
|
+
hdkeypath?: string;
|
|
512
|
+
hdmasterkeyid?: string;
|
|
513
|
+
};
|
|
514
|
+
export type ImportMultiRequest = {
|
|
515
|
+
scriptPubKey: string | {
|
|
516
|
+
address: string;
|
|
517
|
+
};
|
|
518
|
+
timestamp: number | 'now';
|
|
519
|
+
redeemScript?: string;
|
|
520
|
+
pubkeys?: string[];
|
|
521
|
+
keys?: string[];
|
|
522
|
+
internal?: boolean;
|
|
523
|
+
watchonly?: boolean;
|
|
524
|
+
label?: string;
|
|
525
|
+
};
|
|
526
|
+
export type ImportMultiResult = {
|
|
527
|
+
success: boolean;
|
|
528
|
+
error?: {
|
|
529
|
+
code: string;
|
|
530
|
+
message: string;
|
|
531
|
+
};
|
|
532
|
+
};
|
|
533
|
+
export type ImportMultiOptions = {
|
|
534
|
+
rescan?: boolean;
|
|
535
|
+
};
|
|
536
|
+
export type ImportDescriptorRequest = {
|
|
537
|
+
/** (string, required) Descriptor to import. */
|
|
538
|
+
desc: string;
|
|
539
|
+
/**
|
|
540
|
+
* (integer / string, required) Time from which to start rescanning the blockchain for this descriptor, in UNIX epoch time
|
|
541
|
+
* Use the string "now" to substitute the current synced blockchain time.
|
|
542
|
+
* "now" can be specified to bypass scanning, for outputs which are known to never have been used, and
|
|
543
|
+
* 0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest timestamp
|
|
544
|
+
* of all descriptors being imported will be scanned as well as the mempool.
|
|
545
|
+
*/
|
|
546
|
+
timestamp: number | string;
|
|
547
|
+
/** (boolean, optional, default=false) Make descriptor "active" for corresponding output type/externality */
|
|
548
|
+
active?: boolean;
|
|
549
|
+
/** (numeric or array, optional) If a ranged descriptor is used, this specifies the end or the range (in the form [begin,end]) to import */
|
|
550
|
+
range?: number | Array<number>;
|
|
551
|
+
/** (numeric, optional) If a ranged descriptor is set to active, this specifies the next index to generate addresses from */
|
|
552
|
+
next_index?: number;
|
|
553
|
+
/** (boolean, optional, default=false) Whether matching outputs should be treated as not incoming payments (e.g. change) */
|
|
554
|
+
internal?: boolean;
|
|
555
|
+
/** (string, optional, default="") Label to assign to the address, only allowed with internal=false. Disabled for ranged descriptors */
|
|
556
|
+
label?: string;
|
|
557
|
+
};
|
|
558
|
+
export type JsonRPCError = {
|
|
559
|
+
code: number;
|
|
560
|
+
message: string;
|
|
561
|
+
};
|
|
562
|
+
export type ImportDescriptorResult = {
|
|
563
|
+
success: boolean;
|
|
564
|
+
warnings?: string;
|
|
565
|
+
error: JsonRPCError;
|
|
566
|
+
};
|
|
567
|
+
export type Received = {
|
|
568
|
+
involvesWatchonly?: boolean;
|
|
569
|
+
account: string;
|
|
570
|
+
amount: number;
|
|
571
|
+
confirmations: number;
|
|
572
|
+
label: string;
|
|
573
|
+
};
|
|
574
|
+
export type ListUnspentOptions = {
|
|
575
|
+
minimumAmount: number | string;
|
|
576
|
+
maximumAmount: number | string;
|
|
577
|
+
maximumCount: number | string;
|
|
578
|
+
minimumSumAmount: number | string;
|
|
579
|
+
};
|
|
580
|
+
export type ReceivedByAccount = Received;
|
|
581
|
+
export type ReceivedByAddress = {
|
|
582
|
+
address: string;
|
|
583
|
+
txids: string[];
|
|
584
|
+
} & Received;
|
|
585
|
+
export type RestExtension = 'json' | 'bin' | 'hex';
|
|
586
|
+
export type MethodNameInLowerCase = 'getbestblockhash' | 'getblock' | 'getblockchaininfo' | 'getblockcount' | 'getblockhash' | 'getblockheader' | 'getchaintips' | 'getchaintxstats' | 'getdifficulty' | 'getmempoolancestors' | 'getmempooldescendants' | 'getmempoolentry' | 'getmempoolinfo' | 'getrawmempool' | 'gettxout' | 'gettxoutproof' | 'gettxoutsetinfo' | 'preciousblock' | 'pruneblockchain' | 'verifychain' | 'verifytxoutproof' | 'getinfo' | 'getmemoryinfo' | 'help' | 'stop' | 'uptime' | 'generate' | 'generatetoaddress' | 'getblocktemplate' | 'getmininginfo' | 'getnetworkhashps' | 'prioritisetransaction' | 'submitblock' | 'addnode' | 'clearbanned' | 'disconnectnode' | 'getaddednodeinfo' | 'getconnectioncount' | 'getnettotals' | 'getnetworkinfo' | 'getpeerinfo' | 'istbanned' | 'ping' | 'setban' | 'setnetworkactive' | 'combinerawtransaction' | 'createrawtransaction' | 'createwallet' | 'decoderawtransaction' | 'decodescript' | 'fundrawtransaction' | 'getrawtransaction' | 'sendrawtransaction' | 'signrawtransaction' | 'createmultisig' | 'estimatefee' | 'estimatesmartfee' | 'signmessagewithprivkey' | 'validateaddress' | 'verifymessage' | 'abandontransaction' | 'abortrescan' | 'addmultisigaddress' | 'addwitnessaddress' | 'backupwallet' | 'bumpfee' | 'dumpprivkey' | 'dumpwallet' | 'encryptwallet' | 'getaccount' | 'getaccountaddress' | 'getaddressesbyaccount' | 'getbalance' | 'getnewaddress' | 'getrawchangeaddress' | 'getreceivedbyaccount' | 'getreceivedbyaddress' | 'gettransaction' | 'getunconfirmedbalance' | 'getwalletinfo' | 'importaddress' | 'importmulti' | 'importprivkey' | 'importprunedfunds' | 'importpubkey' | 'importwallet' | 'keypoolrefill' | 'listaccounts' | 'listaddressgroupings' | 'listlockunspent' | 'listreceivedbyaccount' | 'listreceivedbyaddress' | 'listsinceblock' | 'listtransactions' | 'listunspent' | 'listwallets' | 'lockunspent' | 'move' | 'removeprunedfunds' | 'sendfrom' | 'sendmany' | 'sendtoaddress' | 'setaccount' | 'settxfee' | 'signmessage' | 'scanblocks' | 'getdescriptorinfo' | 'deriveaddresses' | 'importdescriptors' | 'createwalletdescriptor' | 'signrawtransactionwithwallet' | 'send' | 'sendmany' | 'sendall';
|
|
587
|
+
export type BatchOption = {
|
|
588
|
+
method: MethodNameInLowerCase;
|
|
589
|
+
parameters?: Array<any>;
|
|
590
|
+
};
|
|
591
|
+
export type ReturnType<T> = T extends (...args: any[]) => infer R ? R : any;
|
|
592
|
+
export type BumpFeeOption = {
|
|
593
|
+
confTarget?: number;
|
|
594
|
+
totalFee?: number;
|
|
595
|
+
replaceable?: boolean;
|
|
596
|
+
estimate_mode?: FeeEstimateMode;
|
|
597
|
+
};
|
|
598
|
+
export type WalletTxBase = {
|
|
599
|
+
account: string;
|
|
600
|
+
address: string;
|
|
601
|
+
category: 'send' | 'receive';
|
|
602
|
+
amount: number;
|
|
603
|
+
vout: number;
|
|
604
|
+
fee: number;
|
|
605
|
+
confirmations: number;
|
|
606
|
+
blockhash: string;
|
|
607
|
+
blockindex: number;
|
|
608
|
+
blocktime: number;
|
|
609
|
+
txid: string;
|
|
610
|
+
time: number;
|
|
611
|
+
timereceived: number;
|
|
612
|
+
walletconflicts: string[];
|
|
613
|
+
'bip125-replaceable': 'yes' | 'no' | 'unknown';
|
|
614
|
+
abandoned?: boolean;
|
|
615
|
+
comment?: string;
|
|
616
|
+
label: string;
|
|
617
|
+
to?: string;
|
|
618
|
+
};
|
|
619
|
+
export type TransactionInListSinceBlock = WalletTxBase;
|
|
620
|
+
export type ListSinceBlockResult = {
|
|
621
|
+
transactions: TransactionInListSinceBlock[];
|
|
622
|
+
removed?: TransactionInListSinceBlock[];
|
|
623
|
+
lastblock: string;
|
|
624
|
+
};
|
|
625
|
+
export type ListTransactionsResult = {
|
|
626
|
+
trusted: boolean;
|
|
627
|
+
otheraccount?: string;
|
|
628
|
+
abandoned?: boolean;
|
|
629
|
+
} & WalletTxBase;
|
|
630
|
+
export type AddressGrouping = [string, number] | [string, number, string];
|
|
631
|
+
export type RawOutputAddr = {
|
|
632
|
+
[address: string]: number;
|
|
633
|
+
};
|
|
634
|
+
export type RawOutputData = {
|
|
635
|
+
data: string;
|
|
636
|
+
};
|
|
637
|
+
export type CreateRawTxOutputs = RawOutputAddr | RawOutputData;
|
|
638
|
+
export type GetUTXOsResult = {
|
|
639
|
+
chainHeight: number;
|
|
640
|
+
chaintipHash: string;
|
|
641
|
+
bipmap: string;
|
|
642
|
+
utxos: UTXO[];
|
|
643
|
+
};
|
|
644
|
+
export type BumpFeeOptions = {
|
|
645
|
+
confTarget?: number;
|
|
646
|
+
totalFee?: number;
|
|
647
|
+
replaceable?: boolean;
|
|
648
|
+
estimate_mode?: FeeEstimateMode;
|
|
649
|
+
};
|
|
650
|
+
export type BumpFeeResult = {
|
|
651
|
+
txid: string;
|
|
652
|
+
origfee: number;
|
|
653
|
+
fee: number;
|
|
654
|
+
error?: string[];
|
|
655
|
+
};
|
|
656
|
+
export type AddMultiSigAddressParams = {
|
|
657
|
+
nrequired: number;
|
|
658
|
+
keys: string[];
|
|
659
|
+
account?: string;
|
|
660
|
+
};
|
|
661
|
+
export type SignRawTxParams = {
|
|
662
|
+
hexstring: string;
|
|
663
|
+
prevtxs?: PrevOut[];
|
|
664
|
+
privkeys?: string[];
|
|
665
|
+
sighashtype?: SigHashType;
|
|
666
|
+
};
|
|
667
|
+
export type BitcoinSignature = {
|
|
668
|
+
signature: string;
|
|
669
|
+
};
|
|
670
|
+
export type CreateMultiSigResult = {
|
|
671
|
+
address: string;
|
|
672
|
+
redeemScript: string;
|
|
673
|
+
};
|
|
674
|
+
export type CreateRawTxParams = {
|
|
675
|
+
inputs: CreateRawTxInputs[];
|
|
676
|
+
outputs: CreateRawTxOutputs[];
|
|
677
|
+
locktime?: number;
|
|
678
|
+
replacable?: boolean;
|
|
679
|
+
};
|
|
680
|
+
export type CreateWalletParams = {
|
|
681
|
+
wallet_name: string;
|
|
682
|
+
disable_private_keys?: boolean;
|
|
683
|
+
blank?: boolean;
|
|
684
|
+
passphrase?: string;
|
|
685
|
+
avoid_reuse?: boolean;
|
|
686
|
+
descriptors?: boolean;
|
|
687
|
+
load_on_startup?: boolean;
|
|
688
|
+
};
|
|
689
|
+
export type CreateWalletResult = {
|
|
690
|
+
name: string;
|
|
691
|
+
warning: string;
|
|
692
|
+
};
|
|
693
|
+
export type ScanBlocksParams = {
|
|
694
|
+
action: 'start' | 'abort' | 'status';
|
|
695
|
+
start_height?: number;
|
|
696
|
+
stop_height?: number;
|
|
697
|
+
filtertype?: string;
|
|
698
|
+
options?: {
|
|
699
|
+
filter_false_positives: boolean;
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
export type ListTransactionsParams = {
|
|
703
|
+
account?: string;
|
|
704
|
+
count?: number;
|
|
705
|
+
skip?: number;
|
|
706
|
+
include_watchonly?: boolean;
|
|
707
|
+
};
|
|
708
|
+
export type FundRawTxResult = {
|
|
709
|
+
hex: string;
|
|
710
|
+
fee: number;
|
|
711
|
+
changepos: number;
|
|
712
|
+
};
|
|
713
|
+
export type BitcoinAddress = string;
|
|
714
|
+
export type DerivedAddresses = Array<BitcoinAddress>;
|
|
715
|
+
export type CreateWalletDescriptorOptions = {
|
|
716
|
+
internal: boolean;
|
|
717
|
+
hdkey: string;
|
|
718
|
+
};
|
|
719
|
+
export type WalletDescriptor = string;
|
|
720
|
+
export type CreateWalletDescriptorsResult = {
|
|
721
|
+
descs: Array<WalletDescriptor>;
|
|
722
|
+
};
|
|
723
|
+
export type SendManyParams = {
|
|
724
|
+
fromaccount: string;
|
|
725
|
+
amounts: {
|
|
726
|
+
address: string;
|
|
727
|
+
};
|
|
728
|
+
minconf?: number;
|
|
729
|
+
comment?: string;
|
|
730
|
+
subtractfeefrom?: string[];
|
|
731
|
+
replaeable?: boolean;
|
|
732
|
+
conf_target?: number;
|
|
733
|
+
estimate_mode?: FeeEstimateMode;
|
|
734
|
+
};
|
|
735
|
+
export type ListUnspentParams = {
|
|
736
|
+
minconf?: number;
|
|
737
|
+
maxconf?: number;
|
|
738
|
+
address?: string[];
|
|
739
|
+
include_unsafe?: boolean;
|
|
740
|
+
query_options?: ListUnspentOptions;
|
|
741
|
+
};
|
|
742
|
+
export type BitcoinRecipient = string | Record<string, number | string>;
|
|
743
|
+
export type Input = {
|
|
744
|
+
txid: string;
|
|
745
|
+
vout: number;
|
|
746
|
+
sequence?: number;
|
|
747
|
+
};
|
|
748
|
+
export type SolvingData = {
|
|
749
|
+
pubkeys: string[];
|
|
750
|
+
scripts: string[];
|
|
751
|
+
descriptors: string[];
|
|
752
|
+
};
|
|
753
|
+
export type Recipients = Array<BitcoinRecipient>;
|
|
754
|
+
export type SendAllOptions = {
|
|
755
|
+
add_to_wallet?: boolean;
|
|
756
|
+
fee_rate?: number | string;
|
|
757
|
+
include_watching?: boolean;
|
|
758
|
+
inputs?: Input[];
|
|
759
|
+
locktime?: number;
|
|
760
|
+
lock_unspents?: boolean;
|
|
761
|
+
psbt?: boolean;
|
|
762
|
+
send_max?: boolean;
|
|
763
|
+
minconf?: number;
|
|
764
|
+
maxconf?: number;
|
|
765
|
+
conf_target?: number;
|
|
766
|
+
estimate_mode?: FeeEstimateMode;
|
|
767
|
+
replaceable?: boolean;
|
|
768
|
+
solving_data?: SolvingData;
|
|
769
|
+
};
|
|
770
|
+
export type SendAllParams = {
|
|
771
|
+
recipients: Recipients;
|
|
772
|
+
options?: SendAllOptions;
|
|
773
|
+
};
|
|
774
|
+
export type SendAllResult = {
|
|
775
|
+
txid: Hex;
|
|
776
|
+
hex: Hex;
|
|
777
|
+
psbt: string;
|
|
778
|
+
complete: boolean;
|
|
779
|
+
};
|
|
780
|
+
export type SendToAddressResult = {
|
|
781
|
+
txid: string;
|
|
782
|
+
fee_reason?: string;
|
|
783
|
+
};
|
|
784
|
+
export type CreateMultisigParams = {
|
|
785
|
+
nrequired: number;
|
|
786
|
+
keys: string[];
|
|
787
|
+
address_type?: string;
|
|
788
|
+
};
|
|
789
|
+
export type CreateMultisigResult = {
|
|
790
|
+
address: string;
|
|
791
|
+
redeemScript: Hex;
|
|
792
|
+
descriptor: string;
|
|
793
|
+
warnings?: string[];
|
|
794
|
+
};
|
|
795
|
+
/**
|
|
796
|
+
* Defines verbosity levels for block and transaction outputs.
|
|
797
|
+
* Used to specify the format of returned block or transaction data.
|
|
798
|
+
* @enum {number} VerbosityLevel for block and transaction outputs.
|
|
799
|
+
*/
|
|
800
|
+
export declare enum VerbosityLevel {
|
|
801
|
+
/** Return block or transaction data in raw hex-encoded format */
|
|
802
|
+
hex = 0,
|
|
803
|
+
/** Return block or transaction data in JSON object format */
|
|
804
|
+
json = 1,
|
|
805
|
+
/**
|
|
806
|
+
* Return block or transaction data in JSON object format with additional information.
|
|
807
|
+
* Returns block data with information about each transaction.
|
|
808
|
+
* Returns transaction data with information about the transaction including fee and prevout information.
|
|
809
|
+
*/
|
|
810
|
+
jsonext = 2,
|
|
811
|
+
/**
|
|
812
|
+
* Return block data in JSON object format with additional information.
|
|
813
|
+
* Returns block data with information about each transaction, including prevout information for inputs.
|
|
814
|
+
*/
|
|
815
|
+
jsonextprev = 3
|
|
816
|
+
}
|
|
817
|
+
export interface TargetBlockHeight {
|
|
818
|
+
block: BlockV2;
|
|
819
|
+
rpc: BitcoinRpc;
|
|
820
|
+
targetTime?: UnixTimestamp;
|
|
821
|
+
}
|
|
822
|
+
export type BlockHeight = number;
|
|
823
|
+
export interface GetBlockParams {
|
|
824
|
+
blockhash?: string;
|
|
825
|
+
height?: number;
|
|
826
|
+
verbosity?: VerbosityLevel;
|
|
827
|
+
}
|