@0xbow/privacy-pools-core-sdk 0.1.5 → 0.1.7
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/dist/esm/{ccip-nJye9Itm.js → ccip-DWmr1kpw.js} +2 -2
- package/dist/esm/ccip-DWmr1kpw.js.map +1 -0
- package/dist/esm/fetchArtifacts.esm-D8eXsZHJ.js +15 -0
- package/dist/esm/fetchArtifacts.esm-D8eXsZHJ.js.map +1 -0
- package/dist/esm/fetchArtifacts.node-D-X3YcGh.js +28 -0
- package/dist/esm/fetchArtifacts.node-D-X3YcGh.js.map +1 -0
- package/dist/esm/{index-DAWUECi8.js → index-56B54n2B.js} +28 -22
- package/dist/esm/index-56B54n2B.js.map +1 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/index.d.mts +11 -0
- package/dist/node/artifacts/commitment.vkey +11 -16
- package/dist/node/artifacts/commitment.wasm +0 -0
- package/dist/node/artifacts/commitment.zkey +0 -0
- package/dist/node/artifacts/merkleTree.vkey +78 -78
- package/dist/node/artifacts/merkleTree.wasm +0 -0
- package/dist/node/artifacts/merkleTree.zkey +0 -0
- package/dist/node/artifacts/withdraw.vkey +22 -22
- package/dist/node/artifacts/withdraw.wasm +0 -0
- package/dist/node/artifacts/withdraw.zkey +0 -0
- package/dist/node/{ccip-lPhPeJab.js → ccip-QMBDNQSK.js} +2 -2
- package/dist/node/ccip-QMBDNQSK.js.map +1 -0
- package/dist/node/fetchArtifacts.esm-Dl5aRdl8.js +32 -0
- package/dist/node/fetchArtifacts.esm-Dl5aRdl8.js.map +1 -0
- package/dist/node/fetchArtifacts.node-C1a5Bwcp.js +45 -0
- package/dist/node/fetchArtifacts.node-C1a5Bwcp.js.map +1 -0
- package/dist/node/{index-BiU5Ef8Z.js → index-9_ZAeqKY.js} +1466 -979
- package/dist/node/index-9_ZAeqKY.js.map +1 -0
- package/dist/node/index.mjs +1 -1
- package/dist/types/{ccip-BZzz1Y5w.js → ccip-Bkys_NzI.js} +1 -1
- package/dist/types/circuits/circuits.impl.d.ts +12 -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/fetchArtifacts.esm-C5H2T7ih.js +31 -0
- package/dist/types/fetchArtifacts.node-DKy7oozj.js +44 -0
- package/dist/types/{index-D-_1h8-n.js → index-2jWB6sMJ.js} +1465 -978
- package/dist/types/index.js +1 -1
- package/package.json +1 -1
- package/src/circuits/circuits.impl.ts +26 -17
- package/src/circuits/fetchArtifacts.esm.ts +12 -0
- package/src/circuits/fetchArtifacts.node.ts +23 -0
- package/src/circuits/fetchArtifacts.ts +7 -0
- package/dist/esm/ccip-nJye9Itm.js.map +0 -1
- package/dist/esm/index-DAWUECi8.js.map +0 -1
- package/dist/node/ccip-lPhPeJab.js.map +0 -1
- package/dist/node/index-BiU5Ef8Z.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseError, g as getUrl, s as stringify, d as decodeErrorResult, i as isAddressEqual, c as call, a as concat, e as encodeAbiParameters, H as HttpRequestError, b as isHex } from './index-
|
|
1
|
+
import { B as BaseError, g as getUrl, s as stringify, d as decodeErrorResult, i as isAddressEqual, c as call, a as concat, e as encodeAbiParameters, H as HttpRequestError, b as isHex } from './index-56B54n2B.js';
|
|
2
2
|
import 'buffer';
|
|
3
3
|
import 'assert';
|
|
4
4
|
|
|
@@ -163,4 +163,4 @@ async function ccipRequest({ data, sender, urls, }) {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
export { ccipRequest, offchainLookup, offchainLookupAbiItem, offchainLookupSignature };
|
|
166
|
-
//# sourceMappingURL=ccip-
|
|
166
|
+
//# sourceMappingURL=ccip-DWmr1kpw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ccip-DWmr1kpw.js","sources":["../../../../node_modules/viem/_esm/errors/ccip.js","../../../../node_modules/viem/_esm/utils/ccip.js"],"sourcesContent":["import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class OffchainLookupError extends BaseError {\n constructor({ callbackSelector, cause, data, extraData, sender, urls, }) {\n super(cause.shortMessage ||\n 'An error occurred while fetching for an offchain result.', {\n cause,\n metaMessages: [\n ...(cause.metaMessages || []),\n cause.metaMessages?.length ? '' : [],\n 'Offchain Gateway Call:',\n urls && [\n ' Gateway URL(s):',\n ...urls.map((url) => ` ${getUrl(url)}`),\n ],\n ` Sender: ${sender}`,\n ` Data: ${data}`,\n ` Callback selector: ${callbackSelector}`,\n ` Extra data: ${extraData}`,\n ].flat(),\n name: 'OffchainLookupError',\n });\n }\n}\nexport class OffchainLookupResponseMalformedError extends BaseError {\n constructor({ result, url }) {\n super('Offchain gateway response is malformed. Response data must be a hex value.', {\n metaMessages: [\n `Gateway URL: ${getUrl(url)}`,\n `Response: ${stringify(result)}`,\n ],\n name: 'OffchainLookupResponseMalformedError',\n });\n }\n}\nexport class OffchainLookupSenderMismatchError extends BaseError {\n constructor({ sender, to }) {\n super('Reverted sender address does not match target contract address (`to`).', {\n metaMessages: [\n `Contract address: ${to}`,\n `OffchainLookup sender address: ${sender}`,\n ],\n name: 'OffchainLookupSenderMismatchError',\n });\n }\n}\n//# sourceMappingURL=ccip.js.map","import { call } from '../actions/public/call.js';\nimport { OffchainLookupError, OffchainLookupResponseMalformedError, OffchainLookupSenderMismatchError, } from '../errors/ccip.js';\nimport { HttpRequestError, } from '../errors/request.js';\nimport { decodeErrorResult } from './abi/decodeErrorResult.js';\nimport { encodeAbiParameters } from './abi/encodeAbiParameters.js';\nimport { isAddressEqual } from './address/isAddressEqual.js';\nimport { concat } from './data/concat.js';\nimport { isHex } from './data/isHex.js';\nimport { stringify } from './stringify.js';\nexport const offchainLookupSignature = '0x556f1830';\nexport const offchainLookupAbiItem = {\n name: 'OffchainLookup',\n type: 'error',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'urls',\n type: 'string[]',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n {\n name: 'callbackFunction',\n type: 'bytes4',\n },\n {\n name: 'extraData',\n type: 'bytes',\n },\n ],\n};\nexport async function offchainLookup(client, { blockNumber, blockTag, data, to, }) {\n const { args } = decodeErrorResult({\n data,\n abi: [offchainLookupAbiItem],\n });\n const [sender, urls, callData, callbackSelector, extraData] = args;\n const { ccipRead } = client;\n const ccipRequest_ = ccipRead && typeof ccipRead?.request === 'function'\n ? ccipRead.request\n : ccipRequest;\n try {\n if (!isAddressEqual(to, sender))\n throw new OffchainLookupSenderMismatchError({ sender, to });\n const result = await ccipRequest_({ data: callData, sender, urls });\n const { data: data_ } = await call(client, {\n blockNumber,\n blockTag,\n data: concat([\n callbackSelector,\n encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [result, extraData]),\n ]),\n to,\n });\n return data_;\n }\n catch (err) {\n throw new OffchainLookupError({\n callbackSelector,\n cause: err,\n data,\n extraData,\n sender,\n urls,\n });\n }\n}\nexport async function ccipRequest({ data, sender, urls, }) {\n let error = new Error('An unknown error occurred.');\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n const method = url.includes('{data}') ? 'GET' : 'POST';\n const body = method === 'POST' ? { data, sender } : undefined;\n const headers = method === 'POST' ? { 'Content-Type': 'application/json' } : {};\n try {\n const response = await fetch(url.replace('{sender}', sender).replace('{data}', data), {\n body: JSON.stringify(body),\n headers,\n method,\n });\n let result;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n result = (await response.json()).data;\n }\n else {\n result = (await response.text());\n }\n if (!response.ok) {\n error = new HttpRequestError({\n body,\n details: result?.error\n ? stringify(result.error)\n : response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n continue;\n }\n if (!isHex(result)) {\n error = new OffchainLookupResponseMalformedError({\n result,\n url,\n });\n continue;\n }\n return result;\n }\n catch (err) {\n error = new Http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AAK,GAAG,IAAI,gBAAgB,CAAC;AAC7C,oBAAoB,IAAI;AACxB,oBAAoB,OAAO,EAAE,MAAM,EAAE;AACrC,0BAA0B,SAAS,CAAC,MAAM,CAAC,KAAK;AAChD,0BAA0B,QAAQ,CAAC,UAAU;AAC7C,oBAAoB,OAAO,EAAE,QAAQ,CAAC,OAAO;AAC7C,oBAAoB,MAAM,EAAE,QAAQ,CAAC,MAAM;AAC3C,oBAAoB,GAAG;AACvB,iBAAiB,CAAC;AAClB,gBAAgB;AAChB;AACA,YAAY,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;AAChC,gBAAgB,KAAK,GAAG,IAAI,oCAAoC,CAAC;AACjE,oBAAoB,MAAM;AAC1B,oBAAoB,GAAG;AACvB,iBAAiB,CAAC;AAClB,gBAAgB;AAChB;AACA,YAAY,OAAO,MAAM;AACzB;AACA,QAAQ,OAAO,GAAG,EAAE;AACpB,YAAY,KAAK,GAAG,IAAI,gBAAgB,CAAC;AACzC,gBAAgB,IAAI;AACpB,gBAAgB,OAAO,EAAE,GAAG,CAAC,OAAO;AACpC,gBAAgB,GAAG;AACnB,aAAa,CAAC;AACd;AACA;AACA,IAAI,MAAM,KAAK;AACf;;;;","x_google_ignoreList":[0,1]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { F as FetchArtifact } from './index-56B54n2B.js';
|
|
2
|
+
import 'buffer';
|
|
3
|
+
import 'assert';
|
|
4
|
+
|
|
5
|
+
async function fetchVersionedArtifact(artifactUrl) {
|
|
6
|
+
const res = await fetch(artifactUrl);
|
|
7
|
+
if (res.status !== 200) {
|
|
8
|
+
throw new FetchArtifact(artifactUrl);
|
|
9
|
+
}
|
|
10
|
+
const aBuf = await res.arrayBuffer();
|
|
11
|
+
return new Uint8Array(aBuf);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { fetchVersionedArtifact };
|
|
15
|
+
//# sourceMappingURL=fetchArtifacts.esm-D8eXsZHJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchArtifacts.esm-D8eXsZHJ.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,28 @@
|
|
|
1
|
+
import { F as FetchArtifact } from './index-56B54n2B.js';
|
|
2
|
+
import 'buffer';
|
|
3
|
+
import 'assert';
|
|
4
|
+
|
|
5
|
+
async function fetchVersionedArtifact(artifactUrl) {
|
|
6
|
+
try {
|
|
7
|
+
const fs = (await import('fs')).default;
|
|
8
|
+
const readPromise = new Promise((resolve, reject) => {
|
|
9
|
+
fs.readFile(artifactUrl.pathname, (err, data) => {
|
|
10
|
+
if (err) {
|
|
11
|
+
reject(err);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
resolve(data);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
const buf = await readPromise;
|
|
19
|
+
return new Uint8Array(buf);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
console.error(error);
|
|
23
|
+
throw new FetchArtifact(artifactUrl);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { fetchVersionedArtifact };
|
|
28
|
+
//# sourceMappingURL=fetchArtifacts.node-D-X3YcGh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchArtifacts.node-D-X3YcGh.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;;;;"}
|
|
@@ -55702,7 +55702,7 @@ async function call(client, args) {
|
|
|
55702
55702
|
catch (err) {
|
|
55703
55703
|
const data = getRevertErrorData(err);
|
|
55704
55704
|
// Check for CCIP-Read offchain lookup signature.
|
|
55705
|
-
const { offchainLookup, offchainLookupSignature } = await import('./ccip-
|
|
55705
|
+
const { offchainLookup, offchainLookupSignature } = await import('./ccip-DWmr1kpw.js');
|
|
55706
55706
|
if (client.ccipRead !== false &&
|
|
55707
55707
|
data?.slice(0, 10) === offchainLookupSignature &&
|
|
55708
55708
|
to)
|
|
@@ -61268,6 +61268,15 @@ const circuitToAsset = {
|
|
|
61268
61268
|
},
|
|
61269
61269
|
};
|
|
61270
61270
|
|
|
61271
|
+
async function importFetchVersionedArtifact(isBrowser) {
|
|
61272
|
+
if (isBrowser) {
|
|
61273
|
+
return import('./fetchArtifacts.esm-D8eXsZHJ.js');
|
|
61274
|
+
}
|
|
61275
|
+
else {
|
|
61276
|
+
return import('./fetchArtifacts.node-D-X3YcGh.js');
|
|
61277
|
+
}
|
|
61278
|
+
}
|
|
61279
|
+
|
|
61271
61280
|
/**
|
|
61272
61281
|
* Class representing circuit management and artifact handling.
|
|
61273
61282
|
* Implements the CircuitsInterface.
|
|
@@ -61297,6 +61306,20 @@ class Circuits {
|
|
|
61297
61306
|
* @protected
|
|
61298
61307
|
*/
|
|
61299
61308
|
baseUrl = import.meta.url;
|
|
61309
|
+
browser = true;
|
|
61310
|
+
/**
|
|
61311
|
+
* Constructor to initialize the Circuits class with an optional custom base URL.
|
|
61312
|
+
* @param {string} [options.baseUrl] - The base URL for fetching circuit artifacts (optional).
|
|
61313
|
+
* @param {boolean} [options.browser] - Controls how the circuits will be loaded, using either `fetch` if true or `fs` otherwise. Defaults to true.
|
|
61314
|
+
*/
|
|
61315
|
+
constructor(options) {
|
|
61316
|
+
if (options?.baseUrl) {
|
|
61317
|
+
this.baseUrl = options.baseUrl;
|
|
61318
|
+
}
|
|
61319
|
+
if (options?.browser !== undefined) {
|
|
61320
|
+
this.browser = options.browser;
|
|
61321
|
+
}
|
|
61322
|
+
}
|
|
61300
61323
|
/**
|
|
61301
61324
|
* Determines whether the environment is a browser.
|
|
61302
61325
|
* @returns {boolean} True if running in a browser environment, false otherwise.
|
|
@@ -61350,25 +61373,8 @@ class Circuits {
|
|
|
61350
61373
|
*/
|
|
61351
61374
|
async _fetchVersionedArtifact(artifactPath) {
|
|
61352
61375
|
const artifactUrl = new URL(artifactPath, this.baseUrl);
|
|
61353
|
-
|
|
61354
|
-
|
|
61355
|
-
if (res.status !== 200) {
|
|
61356
|
-
throw new FetchArtifact(artifactUrl);
|
|
61357
|
-
}
|
|
61358
|
-
const aBuf = await res.arrayBuffer();
|
|
61359
|
-
return new Uint8Array(aBuf);
|
|
61360
|
-
}
|
|
61361
|
-
else {
|
|
61362
|
-
try {
|
|
61363
|
-
const fs = (await import('node:fs/promises')).default;
|
|
61364
|
-
const buf = await fs.readFile(artifactUrl);
|
|
61365
|
-
return new Uint8Array(buf);
|
|
61366
|
-
}
|
|
61367
|
-
catch (error) {
|
|
61368
|
-
console.error(error);
|
|
61369
|
-
throw new FetchArtifact(artifactUrl);
|
|
61370
|
-
}
|
|
61371
|
-
}
|
|
61376
|
+
const { fetchVersionedArtifact } = await importFetchVersionedArtifact(this.browser);
|
|
61377
|
+
return fetchVersionedArtifact(artifactUrl);
|
|
61372
61378
|
}
|
|
61373
61379
|
/**
|
|
61374
61380
|
* Downloads and returns the circuit artifacts for a specific circuit.
|
|
@@ -84039,5 +84045,5 @@ class PrivacyPoolSDK {
|
|
|
84039
84045
|
}
|
|
84040
84046
|
}
|
|
84041
84047
|
|
|
84042
|
-
export { BaseError$2 as B, CommitmentService as C, ErrorCode as E, HttpRequestError as H, InvalidRpcUrl as I, PrivacyPoolSDK as P, SDKError as S, WithdrawalService as W, concat as a, isHex as b, call as c, decodeErrorResult as d, encodeAbiParameters as e, generateSecrets as f, getUrl as g, hashPrecommitment as h, isAddressEqual as i, getCommitment as j, generateMerkleProof as k, bigintToHash as l, bigintToHex as m, calculateContext as n, BlockchainProvider as o, Circuits as p, ContractInteractionsService as q, ProofError as r, stringify as s, ContractError as t, CircuitName as u };
|
|
84043
|
-
//# sourceMappingURL=index-
|
|
84048
|
+
export { BaseError$2 as B, CommitmentService as C, ErrorCode as E, FetchArtifact as F, HttpRequestError as H, InvalidRpcUrl as I, PrivacyPoolSDK as P, SDKError as S, WithdrawalService as W, concat as a, isHex as b, call as c, decodeErrorResult as d, encodeAbiParameters as e, generateSecrets as f, getUrl as g, hashPrecommitment as h, isAddressEqual as i, getCommitment as j, generateMerkleProof as k, bigintToHash as l, bigintToHex as m, calculateContext as n, BlockchainProvider as o, Circuits as p, ContractInteractionsService as q, ProofError as r, stringify as s, ContractError as t, CircuitName as u };
|
|
84049
|
+
//# sourceMappingURL=index-56B54n2B.js.map
|