@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.
- package/README.md +73 -0
- package/dist/esm/fetchArtifacts.esm-TV4yMbDL.js +18 -0
- package/dist/esm/fetchArtifacts.esm-TV4yMbDL.js.map +1 -0
- package/dist/esm/fetchArtifacts.node-DC_rCgt3.js +31 -0
- package/dist/esm/fetchArtifacts.node-DC_rCgt3.js.map +1 -0
- package/dist/esm/index-Bw-RoJy9.js +70373 -0
- package/dist/esm/index-Bw-RoJy9.js.map +1 -0
- package/dist/esm/index.mjs +7 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/index.d.mts +1222 -0
- package/dist/node/fetchArtifacts.esm-i9-c1RlE.js +35 -0
- package/dist/node/fetchArtifacts.esm-i9-c1RlE.js.map +1 -0
- package/dist/node/fetchArtifacts.node-C5OS73zV.js +48 -0
- package/dist/node/fetchArtifacts.node-C5OS73zV.js.map +1 -0
- package/dist/node/index-BogHNKL8.js +77423 -0
- package/dist/node/index-BogHNKL8.js.map +1 -0
- package/dist/node/index.mjs +24 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/types/abi/ERC20.d.ts +38 -0
- package/dist/types/abi/IEntrypoint.d.ts +823 -0
- package/dist/types/abi/IPrivacyPool.d.ts +51 -0
- package/dist/types/circuits/circuits.impl.d.ts +120 -0
- package/dist/types/circuits/circuits.interface.d.ts +129 -0
- package/dist/types/circuits/fetchArtifacts.d.ts +1 -0
- package/dist/types/circuits/fetchArtifacts.esm.d.ts +1 -0
- package/dist/types/circuits/fetchArtifacts.node.d.ts +1 -0
- package/dist/types/circuits/index.d.ts +2 -0
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/core/account.service.d.ts +345 -0
- package/dist/types/core/bruteForce.service.d.ts +61 -0
- package/dist/types/core/commitment.service.d.ts +30 -0
- package/dist/types/core/contracts.service.d.ts +114 -0
- package/dist/types/core/data.service.d.ts +52 -0
- package/dist/types/core/sdk.d.ts +45 -0
- package/dist/types/core/withdrawal.service.d.ts +32 -0
- package/dist/types/crypto.d.ts +67 -0
- package/dist/types/dirname.helper.d.ts +2 -0
- package/dist/types/errors/account.error.d.ts +10 -0
- package/dist/types/errors/base.error.d.ts +53 -0
- package/dist/types/errors/data.error.d.ts +7 -0
- package/dist/types/errors/events.error.d.ts +9 -0
- package/dist/types/exceptions/circuitInitialization.exception.d.ts +3 -0
- package/dist/types/exceptions/fetchArtifacts.exception.d.ts +3 -0
- package/dist/types/exceptions/index.d.ts +4 -0
- package/dist/types/exceptions/invalidRpcUrl.exception.d.ts +3 -0
- package/dist/types/exceptions/privacyPool.exception.d.ts +13 -0
- package/dist/types/external.d.ts +7 -0
- package/dist/types/fetchArtifacts.esm-CwvN5XjW.js +34 -0
- package/dist/types/fetchArtifacts.node-VEzDC3k8.js +47 -0
- package/dist/types/filename.helper.d.ts +2 -0
- package/dist/types/index-CPuQ9H-0.js +77436 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.js +23 -0
- package/dist/types/interfaces/blockchainProvider.interface.d.ts +12 -0
- package/dist/types/interfaces/circuits.interface.d.ts +30 -0
- package/dist/types/interfaces/contracts.interface.d.ts +35 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/dist/types/internal.d.ts +6 -0
- package/dist/types/keys.d.ts +18 -0
- package/dist/types/providers/blockchainProvider.d.ts +8 -0
- package/dist/types/providers/index.d.ts +1 -0
- package/dist/types/types/account.d.ts +31 -0
- package/dist/types/types/commitment.d.ts +48 -0
- package/dist/types/types/events.d.ts +72 -0
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/types/keys.d.ts +5 -0
- package/dist/types/types/withdrawal.d.ts +30 -0
- package/dist/types/utils/logger.d.ts +22 -0
- package/package.json +81 -0
- package/src/abi/ERC20.ts +222 -0
- package/src/abi/IEntrypoint.ts +1059 -0
- package/src/abi/IPrivacyPool.ts +576 -0
- package/src/circuits/circuits.impl.ts +232 -0
- package/src/circuits/circuits.interface.ts +166 -0
- package/src/circuits/fetchArtifacts.esm.ts +12 -0
- package/src/circuits/fetchArtifacts.node.ts +23 -0
- package/src/circuits/fetchArtifacts.ts +7 -0
- package/src/circuits/index.ts +2 -0
- package/src/constants.ts +3 -0
- package/src/core/account.service.ts +1093 -0
- package/src/core/bruteForce.service.ts +120 -0
- package/src/core/commitment.service.ts +84 -0
- package/src/core/contracts.service.ts +450 -0
- package/src/core/data.service.ts +276 -0
- package/src/core/sdk.ts +92 -0
- package/src/core/withdrawal.service.ts +126 -0
- package/src/crypto.ts +226 -0
- package/src/dirname.helper.ts +4 -0
- package/src/errors/account.error.ts +49 -0
- package/src/errors/base.error.ts +125 -0
- package/src/errors/data.error.ts +34 -0
- package/src/errors/events.error.ts +38 -0
- package/src/exceptions/circuitInitialization.exception.ts +6 -0
- package/src/exceptions/fetchArtifacts.exception.ts +7 -0
- package/src/exceptions/index.ts +4 -0
- package/src/exceptions/invalidRpcUrl.exception.ts +6 -0
- package/src/exceptions/privacyPool.exception.ts +19 -0
- package/src/external.ts +13 -0
- package/src/filename.helper.ts +4 -0
- package/src/index.ts +21 -0
- package/src/interfaces/blockchainProvider.interface.ts +13 -0
- package/src/interfaces/circuits.interface.ts +34 -0
- package/src/interfaces/contracts.interface.ts +66 -0
- package/src/interfaces/index.ts +1 -0
- package/src/internal.ts +6 -0
- package/src/keys.ts +42 -0
- package/src/providers/blockchainProvider.ts +30 -0
- package/src/providers/index.ts +1 -0
- package/src/types/account.ts +35 -0
- package/src/types/commitment.ts +50 -0
- package/src/types/events.ts +82 -0
- package/src/types/index.ts +3 -0
- package/src/types/keys.ts +6 -0
- package/src/types/withdrawal.ts +33 -0
- 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;;;;"}
|