@mr-zwets/bchn-api-wrapper 1.0.1 → 1.0.2
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/.claude/settings.local.json +8 -0
- package/.github/workflows/ci.yaml +36 -0
- package/CLAUDE.md +70 -0
- package/README.md +121 -129
- package/dist/interfaces/interfaces.d.ts +13 -0
- package/dist/interfaces/restInterfaces/interfaces.d.ts +124 -18
- package/dist/interfaces/rpcInterfaces/blockchain.d.ts +293 -102
- package/dist/interfaces/rpcInterfaces/control.d.ts +6 -0
- package/dist/interfaces/rpcInterfaces/generating.d.ts +2 -0
- package/dist/interfaces/rpcInterfaces/mining.d.ts +9 -0
- package/dist/interfaces/rpcInterfaces/network.d.ts +18 -0
- package/dist/interfaces/rpcInterfaces/rawtransactions.d.ts +21 -0
- package/dist/interfaces/rpcInterfaces/util.d.ts +5 -0
- package/dist/interfaces/rpcInterfaces/wallet.d.ts +54 -0
- package/dist/interfaces/rpcInterfaces/zmq.d.ts +1 -0
- package/dist/restClient.d.ts +13 -1
- package/dist/restClient.js +19 -6
- package/dist/rpcClient.d.ts +7 -0
- package/dist/rpcClient.js +7 -0
- package/package.json +7 -8
- package/pnpm-lock.yaml +1279 -0
- package/src/index.ts +3 -3
- package/src/interfaces/interfaces.ts +96 -86
- package/src/interfaces/restInterfaces/interfaces.ts +235 -116
- package/src/interfaces/rpcInterfaces/blockchain.ts +932 -758
- package/src/interfaces/rpcInterfaces/control.ts +68 -62
- package/src/interfaces/rpcInterfaces/generating.ts +23 -21
- package/src/interfaces/rpcInterfaces/index.ts +13 -13
- package/src/interfaces/rpcInterfaces/mining.ts +151 -143
- package/src/interfaces/rpcInterfaces/network.ts +213 -195
- package/src/interfaces/rpcInterfaces/rawtransactions.ts +332 -314
- package/src/interfaces/rpcInterfaces/util.ts +56 -52
- package/src/interfaces/rpcInterfaces/wallet.ts +728 -674
- package/src/interfaces/rpcInterfaces/zmq.ts +12 -11
- package/src/restClient.ts +134 -119
- package/src/rpcClient.ts +100 -93
- package/src/utils/errors.ts +6 -6
- package/src/utils/utils.ts +55 -55
- package/test/restClient.test.ts +33 -31
- package/test/rpcClient.test.ts +119 -115
- package/test/setupTests.ts +56 -54
- package/test/tsconfig.json +4 -4
- package/tsconfig.json +13 -13
- package/vitest.config.ts +8 -8
- package/CHANGELOG.md +0 -7
|
@@ -1,52 +1,56 @@
|
|
|
1
|
-
/* --- Util Commands --- */
|
|
2
|
-
// progress 5/5
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
/* --- Util Commands --- */
|
|
2
|
+
// progress 5/5
|
|
3
|
+
|
|
4
|
+
/** Creates a multisig address (without adding to wallet). */
|
|
5
|
+
export interface CreateMultisig {
|
|
6
|
+
method: 'createmultisig';
|
|
7
|
+
params: [
|
|
8
|
+
nrequired: number,
|
|
9
|
+
keys: string[]
|
|
10
|
+
];
|
|
11
|
+
response: {
|
|
12
|
+
address: string;
|
|
13
|
+
redeemScript: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Returns estimated fee rate in BCH/kB. */
|
|
18
|
+
export interface EstimateFee {
|
|
19
|
+
method: 'estimatefee';
|
|
20
|
+
params: [];
|
|
21
|
+
response: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Signs a message with a private key (returns base64 signature). */
|
|
25
|
+
export interface SignMessageWithPrivKey {
|
|
26
|
+
method: 'signmessagewithprivkey';
|
|
27
|
+
params: [
|
|
28
|
+
privkey: string,
|
|
29
|
+
message: string
|
|
30
|
+
];
|
|
31
|
+
response: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Validates a Bitcoin Cash address. */
|
|
35
|
+
export interface ValidateAddress {
|
|
36
|
+
method: 'validateaddress';
|
|
37
|
+
params: [string];
|
|
38
|
+
response: {
|
|
39
|
+
isvalid: boolean;
|
|
40
|
+
address: string;
|
|
41
|
+
scriptPubKey?: string;
|
|
42
|
+
isscript: boolean;
|
|
43
|
+
istokenaware: boolean;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Verifies a signed message. */
|
|
48
|
+
export interface VerifyMessage {
|
|
49
|
+
method: 'verifymessage';
|
|
50
|
+
params: [
|
|
51
|
+
address:string,
|
|
52
|
+
signature: string,
|
|
53
|
+
message:string
|
|
54
|
+
];
|
|
55
|
+
response: boolean;
|
|
56
|
+
}
|