@0xbow/privacy-pools-core-sdk 0.0.0-b21c14ba

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 (115) hide show
  1. package/README.md +73 -0
  2. package/dist/esm/fetchArtifacts.esm-TV4yMbDL.js +18 -0
  3. package/dist/esm/fetchArtifacts.esm-TV4yMbDL.js.map +1 -0
  4. package/dist/esm/fetchArtifacts.node-DC_rCgt3.js +31 -0
  5. package/dist/esm/fetchArtifacts.node-DC_rCgt3.js.map +1 -0
  6. package/dist/esm/index-Bw-RoJy9.js +70373 -0
  7. package/dist/esm/index-Bw-RoJy9.js.map +1 -0
  8. package/dist/esm/index.mjs +7 -0
  9. package/dist/esm/index.mjs.map +1 -0
  10. package/dist/index.d.mts +1222 -0
  11. package/dist/node/fetchArtifacts.esm-i9-c1RlE.js +35 -0
  12. package/dist/node/fetchArtifacts.esm-i9-c1RlE.js.map +1 -0
  13. package/dist/node/fetchArtifacts.node-C5OS73zV.js +48 -0
  14. package/dist/node/fetchArtifacts.node-C5OS73zV.js.map +1 -0
  15. package/dist/node/index-BogHNKL8.js +77423 -0
  16. package/dist/node/index-BogHNKL8.js.map +1 -0
  17. package/dist/node/index.mjs +24 -0
  18. package/dist/node/index.mjs.map +1 -0
  19. package/dist/types/abi/ERC20.d.ts +38 -0
  20. package/dist/types/abi/IEntrypoint.d.ts +823 -0
  21. package/dist/types/abi/IPrivacyPool.d.ts +51 -0
  22. package/dist/types/circuits/circuits.impl.d.ts +120 -0
  23. package/dist/types/circuits/circuits.interface.d.ts +129 -0
  24. package/dist/types/circuits/fetchArtifacts.d.ts +1 -0
  25. package/dist/types/circuits/fetchArtifacts.esm.d.ts +1 -0
  26. package/dist/types/circuits/fetchArtifacts.node.d.ts +1 -0
  27. package/dist/types/circuits/index.d.ts +2 -0
  28. package/dist/types/constants.d.ts +2 -0
  29. package/dist/types/core/account.service.d.ts +345 -0
  30. package/dist/types/core/bruteForce.service.d.ts +61 -0
  31. package/dist/types/core/commitment.service.d.ts +30 -0
  32. package/dist/types/core/contracts.service.d.ts +114 -0
  33. package/dist/types/core/data.service.d.ts +52 -0
  34. package/dist/types/core/sdk.d.ts +45 -0
  35. package/dist/types/core/withdrawal.service.d.ts +32 -0
  36. package/dist/types/crypto.d.ts +67 -0
  37. package/dist/types/dirname.helper.d.ts +2 -0
  38. package/dist/types/errors/account.error.d.ts +10 -0
  39. package/dist/types/errors/base.error.d.ts +53 -0
  40. package/dist/types/errors/data.error.d.ts +7 -0
  41. package/dist/types/errors/events.error.d.ts +9 -0
  42. package/dist/types/exceptions/circuitInitialization.exception.d.ts +3 -0
  43. package/dist/types/exceptions/fetchArtifacts.exception.d.ts +3 -0
  44. package/dist/types/exceptions/index.d.ts +4 -0
  45. package/dist/types/exceptions/invalidRpcUrl.exception.d.ts +3 -0
  46. package/dist/types/exceptions/privacyPool.exception.d.ts +13 -0
  47. package/dist/types/external.d.ts +7 -0
  48. package/dist/types/fetchArtifacts.esm-CwvN5XjW.js +34 -0
  49. package/dist/types/fetchArtifacts.node-VEzDC3k8.js +47 -0
  50. package/dist/types/filename.helper.d.ts +2 -0
  51. package/dist/types/index-CPuQ9H-0.js +77436 -0
  52. package/dist/types/index.d.ts +13 -0
  53. package/dist/types/index.js +23 -0
  54. package/dist/types/interfaces/blockchainProvider.interface.d.ts +12 -0
  55. package/dist/types/interfaces/circuits.interface.d.ts +30 -0
  56. package/dist/types/interfaces/contracts.interface.d.ts +35 -0
  57. package/dist/types/interfaces/index.d.ts +1 -0
  58. package/dist/types/internal.d.ts +6 -0
  59. package/dist/types/keys.d.ts +18 -0
  60. package/dist/types/providers/blockchainProvider.d.ts +8 -0
  61. package/dist/types/providers/index.d.ts +1 -0
  62. package/dist/types/types/account.d.ts +31 -0
  63. package/dist/types/types/commitment.d.ts +48 -0
  64. package/dist/types/types/events.d.ts +72 -0
  65. package/dist/types/types/index.d.ts +3 -0
  66. package/dist/types/types/keys.d.ts +5 -0
  67. package/dist/types/types/withdrawal.d.ts +30 -0
  68. package/dist/types/utils/logger.d.ts +22 -0
  69. package/package.json +81 -0
  70. package/src/abi/ERC20.ts +222 -0
  71. package/src/abi/IEntrypoint.ts +1059 -0
  72. package/src/abi/IPrivacyPool.ts +576 -0
  73. package/src/circuits/circuits.impl.ts +232 -0
  74. package/src/circuits/circuits.interface.ts +166 -0
  75. package/src/circuits/fetchArtifacts.esm.ts +12 -0
  76. package/src/circuits/fetchArtifacts.node.ts +23 -0
  77. package/src/circuits/fetchArtifacts.ts +7 -0
  78. package/src/circuits/index.ts +2 -0
  79. package/src/constants.ts +3 -0
  80. package/src/core/account.service.ts +1093 -0
  81. package/src/core/bruteForce.service.ts +120 -0
  82. package/src/core/commitment.service.ts +84 -0
  83. package/src/core/contracts.service.ts +450 -0
  84. package/src/core/data.service.ts +276 -0
  85. package/src/core/sdk.ts +92 -0
  86. package/src/core/withdrawal.service.ts +126 -0
  87. package/src/crypto.ts +226 -0
  88. package/src/dirname.helper.ts +4 -0
  89. package/src/errors/account.error.ts +49 -0
  90. package/src/errors/base.error.ts +125 -0
  91. package/src/errors/data.error.ts +34 -0
  92. package/src/errors/events.error.ts +38 -0
  93. package/src/exceptions/circuitInitialization.exception.ts +6 -0
  94. package/src/exceptions/fetchArtifacts.exception.ts +7 -0
  95. package/src/exceptions/index.ts +4 -0
  96. package/src/exceptions/invalidRpcUrl.exception.ts +6 -0
  97. package/src/exceptions/privacyPool.exception.ts +19 -0
  98. package/src/external.ts +13 -0
  99. package/src/filename.helper.ts +4 -0
  100. package/src/index.ts +21 -0
  101. package/src/interfaces/blockchainProvider.interface.ts +13 -0
  102. package/src/interfaces/circuits.interface.ts +34 -0
  103. package/src/interfaces/contracts.interface.ts +66 -0
  104. package/src/interfaces/index.ts +1 -0
  105. package/src/internal.ts +6 -0
  106. package/src/keys.ts +42 -0
  107. package/src/providers/blockchainProvider.ts +30 -0
  108. package/src/providers/index.ts +1 -0
  109. package/src/types/account.ts +35 -0
  110. package/src/types/commitment.ts +50 -0
  111. package/src/types/events.ts +82 -0
  112. package/src/types/index.ts +3 -0
  113. package/src/types/keys.ts +6 -0
  114. package/src/types/withdrawal.ts +33 -0
  115. package/src/utils/logger.ts +56 -0
@@ -0,0 +1,35 @@
1
+ import { F as FetchArtifact } from './index-BogHNKL8.js';
2
+ import 'viem/accounts';
3
+ import 'buffer';
4
+ import 'http';
5
+ import 'https';
6
+ import 'zlib';
7
+ import 'crypto';
8
+ import 'node:crypto';
9
+ import 'events';
10
+ import 'net';
11
+ import 'tls';
12
+ import 'stream';
13
+ import 'url';
14
+ import 'assert';
15
+ import 'viem';
16
+ import 'viem/chains';
17
+ import 'os';
18
+ import 'vm';
19
+ import 'worker_threads';
20
+ import 'fs';
21
+ import 'constants';
22
+ import 'readline';
23
+ import 'path';
24
+
25
+ async function fetchVersionedArtifact(artifactUrl) {
26
+ const res = await fetch(artifactUrl);
27
+ if (res.status !== 200) {
28
+ throw new FetchArtifact(artifactUrl);
29
+ }
30
+ const aBuf = await res.arrayBuffer();
31
+ return new Uint8Array(aBuf);
32
+ }
33
+
34
+ export { fetchVersionedArtifact };
35
+ //# sourceMappingURL=fetchArtifacts.esm-i9-c1RlE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchArtifacts.esm-i9-c1RlE.js","sources":["../../src/circuits/fetchArtifacts.esm.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEO,eAAe,sBAAsB,CAC1C,WAAgB,EAAA;AAEhB,IAAA,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC;AACpC,IAAA,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE;AACtB,QAAA,MAAM,IAAI,aAAa,CAAC,WAAW,CAAC;;AAEtC,IAAA,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,WAAW,EAAE;AACpC,IAAA,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC;AAC7B;;;;"}
@@ -0,0 +1,48 @@
1
+ import { F as FetchArtifact } from './index-BogHNKL8.js';
2
+ import 'viem/accounts';
3
+ import 'buffer';
4
+ import 'http';
5
+ import 'https';
6
+ import 'zlib';
7
+ import 'crypto';
8
+ import 'node:crypto';
9
+ import 'events';
10
+ import 'net';
11
+ import 'tls';
12
+ import 'stream';
13
+ import 'url';
14
+ import 'assert';
15
+ import 'viem';
16
+ import 'viem/chains';
17
+ import 'os';
18
+ import 'vm';
19
+ import 'worker_threads';
20
+ import 'fs';
21
+ import 'constants';
22
+ import 'readline';
23
+ import 'path';
24
+
25
+ async function fetchVersionedArtifact(artifactUrl) {
26
+ try {
27
+ const fs = (await import('fs')).default;
28
+ const readPromise = new Promise((resolve, reject) => {
29
+ fs.readFile(artifactUrl.pathname, (err, data) => {
30
+ if (err) {
31
+ reject(err);
32
+ }
33
+ else {
34
+ resolve(data);
35
+ }
36
+ });
37
+ });
38
+ const buf = await readPromise;
39
+ return new Uint8Array(buf);
40
+ }
41
+ catch (error) {
42
+ console.error(error);
43
+ throw new FetchArtifact(artifactUrl);
44
+ }
45
+ }
46
+
47
+ export { fetchVersionedArtifact };
48
+ //# sourceMappingURL=fetchArtifacts.node-C5OS73zV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchArtifacts.node-C5OS73zV.js","sources":["../../src/circuits/fetchArtifacts.node.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEO,eAAe,sBAAsB,CAC1C,WAAgB,EAAA;AAEhB,IAAA,IAAI;QACF,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,IAAI,CAAC,EAAE,OAAO;QACvC,MAAM,WAAW,GAAoB,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACnE,YAAA,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,IAAI,KAAI;gBAC9C,IAAI,GAAG,EAAE;oBACP,MAAM,CAAC,GAAG,CAAC;;qBACN;oBACL,OAAO,CAAC,IAAI,CAAC;;AAEjB,aAAC,CAAC;AACJ,SAAC,CAAC;AACF,QAAA,MAAM,GAAG,GAAG,MAAM,WAAW;AAC7B,QAAA,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC;;IAC1B,OAAO,KAAK,EAAE;AACd,QAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AACpB,QAAA,MAAM,IAAI,aAAa,CAAC,WAAW,CAAC;;AAExC;;;;"}