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