@zkp2p/sdk 0.14.0 → 0.14.1
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/build-metadata.json +3 -3
- package/dist/{chunk-FLST2SE3.mjs → chunk-4KACMRKF.mjs} +102 -90
- package/dist/chunk-4KACMRKF.mjs.map +1 -0
- package/dist/chunk-5MBWIMIB.mjs +12 -0
- package/dist/chunk-5MBWIMIB.mjs.map +1 -0
- package/dist/{currency-HMJXK46S.mjs → currency-KDDCBZU2.mjs} +3 -3
- package/dist/{currency-HMJXK46S.mjs.map → currency-KDDCBZU2.mjs.map} +1 -1
- package/dist/index.cjs +205 -181
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +29 -17
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-S6VTWVVJ.mjs +5 -0
- package/dist/{protocolViewerParsers-CDX3MKBZ.mjs.map → protocolViewerParsers-S6VTWVVJ.mjs.map} +1 -1
- package/dist/react.mjs +1 -1
- package/dist/{timeout-L2TGXQRR.mjs → timeout-7H5K6BBB.mjs} +3 -3
- package/dist/{timeout-L2TGXQRR.mjs.map → timeout-7H5K6BBB.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/chunk-FLST2SE3.mjs.map +0 -1
- package/dist/chunk-GUGMFD2K.mjs +0 -12
- package/dist/chunk-GUGMFD2K.mjs.map +0 -1
- package/dist/protocolViewerParsers-CDX3MKBZ.mjs +0 -5
package/dist/index.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import { IntentGuardianOperations } from './chunk-YA67SM3A.mjs';
|
|
|
2
2
|
export { ZERO_RATE_MANAGER_ID, classifyDelegationState, classifyIntentGuardianError, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-YA67SM3A.mjs';
|
|
3
3
|
import { NetworkError, ValidationError, APIError } from './chunk-3J4FPMPW.mjs';
|
|
4
4
|
export { APIError, ContractError, ErrorCode, NetworkError, ValidationError, ZKP2PError } from './chunk-3J4FPMPW.mjs';
|
|
5
|
-
import { OrchestratorRegistry_default, DISPUTE_PROTECTION_POLICY_ABI, DisputeProtectionPolicy_default, METHOD_NAME_TO_HASH, matchesQuotePaymentMethod, matchesPaymentMethodNameAndHash, MultiAttestationVerifier_default, getContracts, getRateManagerContracts, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, getGatingServiceAddress, parseBigIntLike, SUPPORTED_PAYMENT_METHOD_HASHES, resolveFiatCurrencyBytes32, resolvePaymentMethodNameFromHash, OrchestratorV3_default, DisputeNullifierRegistry_default, DisputeVerifier_default, WhitelistPolicy_default, StakeVault_default, IntentLifecycleHookV1_default } from './chunk-
|
|
6
|
-
export { DISPUTE_PROTECTION_POLICY_ABI2 as DISPUTE_PROTECTION_POLICY_ABI, ORCHESTRATOR_V3_ABI, PAYMENT_PLATFORMS, STAKE_VAULT_ABI, asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getDisputeProtectionPolicyContract, getGatingServiceAddress, getIntentGuardianContract, getOrchestratorV3Contract, getPaymentMethodsCatalog, getRateManagerContracts, getStakeVaultContract, hasIntentGuardian, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash } from './chunk-
|
|
5
|
+
import { OrchestratorRegistry_default, DISPUTE_PROTECTION_POLICY_ABI, DisputeProtectionPolicy_default, METHOD_NAME_TO_HASH, matchesQuotePaymentMethod, matchesPaymentMethodNameAndHash, MultiAttestationVerifier_default, getContracts, getRateManagerContracts, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, getGatingServiceAddress, parseBigIntLike, SUPPORTED_PAYMENT_METHOD_HASHES, resolveFiatCurrencyBytes32, resolvePaymentMethodNameFromHash, OrchestratorV3_default, DisputeNullifierRegistry_default, DisputeVerifier_default, WhitelistPolicy_default, StakeVault_default, IntentLifecycleHookV1_default } from './chunk-4KACMRKF.mjs';
|
|
6
|
+
export { DISPUTE_PROTECTION_POLICY_ABI2 as DISPUTE_PROTECTION_POLICY_ABI, ORCHESTRATOR_V3_ABI, PAYMENT_PLATFORMS, STAKE_VAULT_ABI, asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getDisputeProtectionPolicyContract, getGatingServiceAddress, getIntentGuardianContract, getOrchestratorV3Contract, getPaymentMethodsCatalog, getRateManagerContracts, getStakeVaultContract, hasIntentGuardian, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash } from './chunk-4KACMRKF.mjs';
|
|
7
7
|
import { Currency, currencyKeccak256 } from './chunk-ZB22BZLZ.mjs';
|
|
8
8
|
export { Currency, currencyInfo, getCurrencyCodeFromHash, getCurrencyInfoFromCountryCode, getCurrencyInfoFromHash, isSupportedCurrencyHash, mapConversionRatesToOnchainMinRate } from './chunk-ZB22BZLZ.mjs';
|
|
9
|
-
import { define_ZKP2P_SDK_BUILD_METADATA_default } from './chunk-
|
|
9
|
+
import { define_ZKP2P_SDK_BUILD_METADATA_default } from './chunk-5MBWIMIB.mjs';
|
|
10
10
|
import { keccak256, concatHex, encodeFunctionData, encodeAbiParameters, createPublicClient, http, isAddress, zeroAddress, formatUnits } from 'viem';
|
|
11
11
|
import { hardhat, base } from 'viem/chains';
|
|
12
12
|
import { createEncryptedBuyerTeeSessionMaterial as createEncryptedBuyerTeeSessionMaterial$1, createEncryptedSellerCredentialUpload } from '@zkp2p/zkp2p-attestation';
|
|
@@ -357,7 +357,7 @@ async function withRetry(fn, maxRetries = 3, delayMs = 1e3, timeoutMs, shouldRet
|
|
|
357
357
|
for (let i = 0; i < maxRetries; i++) {
|
|
358
358
|
try {
|
|
359
359
|
if (timeoutMs) {
|
|
360
|
-
const { withTimeout } = await import('./timeout-
|
|
360
|
+
const { withTimeout } = await import('./timeout-7H5K6BBB.mjs');
|
|
361
361
|
return await withTimeout(fn(), timeoutMs, `Operation timed out after ${timeoutMs}ms`);
|
|
362
362
|
}
|
|
363
363
|
return await fn();
|
|
@@ -863,7 +863,7 @@ async function sendTransactionWithAttribution(walletClient, request, referrer, o
|
|
|
863
863
|
// src/utils/constants.ts
|
|
864
864
|
var DEFAULT_BASE_API_URL = "https://api.zkp2p.xyz";
|
|
865
865
|
|
|
866
|
-
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.
|
|
866
|
+
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.1_ethers@6.16.0_bufferutil@4.1.0_utf-8-validate@5.0.10__typescript@5.9.3_zod@4.5.4/node_modules/@zkp2p/contracts-v2/oracleFeeds/chainlink.json
|
|
867
867
|
var chainlink_default = {
|
|
868
868
|
feeds: [
|
|
869
869
|
{
|
|
@@ -1909,7 +1909,7 @@ var ProtocolViewerReader = class {
|
|
|
1909
1909
|
if (inputCount === null) {
|
|
1910
1910
|
throw new Error("Configured ProtocolViewer ABI does not expose getDeposit");
|
|
1911
1911
|
}
|
|
1912
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
1912
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-S6VTWVVJ.mjs');
|
|
1913
1913
|
if (inputCount >= 3) {
|
|
1914
1914
|
return tryContexts(
|
|
1915
1915
|
protocolViewerContexts,
|
|
@@ -1995,7 +1995,7 @@ var ProtocolViewerReader = class {
|
|
|
1995
1995
|
return Promise.all(ids.map((id) => this.config.host.getPvDepositById(id)));
|
|
1996
1996
|
}
|
|
1997
1997
|
const bn = ids.map((id) => typeof id === "bigint" ? id : parseRawDepositId(id));
|
|
1998
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
1998
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-S6VTWVVJ.mjs');
|
|
1999
1999
|
if (inputCount >= 2) {
|
|
2000
2000
|
const requests = ids.map((id, index) => ({
|
|
2001
2001
|
index,
|
|
@@ -2100,7 +2100,7 @@ var ProtocolViewerReader = class {
|
|
|
2100
2100
|
if (!protocolViewerAddress || !protocolViewerAbi || inputCount === null) {
|
|
2101
2101
|
return this.config.host.getPvAccountDepositsFromIndexer(owner);
|
|
2102
2102
|
}
|
|
2103
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
2103
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-S6VTWVVJ.mjs');
|
|
2104
2104
|
const { address, abi } = this.config.host.requireProtocolViewer();
|
|
2105
2105
|
if (inputCount >= 2) {
|
|
2106
2106
|
const readAndFilter = async (raw2) => {
|
|
@@ -2171,7 +2171,7 @@ var ProtocolViewerReader = class {
|
|
|
2171
2171
|
if (protocolViewerEntries.length === 0) {
|
|
2172
2172
|
throw new Error("ProtocolViewer not available for this network");
|
|
2173
2173
|
}
|
|
2174
|
-
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-
|
|
2174
|
+
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-S6VTWVVJ.mjs');
|
|
2175
2175
|
const intentsByHash = /* @__PURE__ */ new Map();
|
|
2176
2176
|
let attemptedRead = false;
|
|
2177
2177
|
let hadSuccessfulRead = false;
|
|
@@ -2279,7 +2279,7 @@ var ProtocolViewerReader = class {
|
|
|
2279
2279
|
if (protocolViewerEntries.length === 0) {
|
|
2280
2280
|
throw new Error("ProtocolViewer not available for this network");
|
|
2281
2281
|
}
|
|
2282
|
-
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-
|
|
2282
|
+
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-S6VTWVVJ.mjs');
|
|
2283
2283
|
let lastError;
|
|
2284
2284
|
for (const pvEntry of protocolViewerEntries) {
|
|
2285
2285
|
const inputCount = this.pvEntryFunctionInputCount(pvEntry, "getIntent");
|
|
@@ -4723,6 +4723,10 @@ var zelleBankOfAmericaSendConfig = {
|
|
|
4723
4723
|
}
|
|
4724
4724
|
],
|
|
4725
4725
|
sendPaymentDonts: () => [
|
|
4726
|
+
{
|
|
4727
|
+
text: "Do not send unless you can sign in to Bank of America's website. Signing in is required to verify your payment and complete this order.",
|
|
4728
|
+
emphasize: ["Do not send", "sign in", "Bank of America's website"]
|
|
4729
|
+
},
|
|
4726
4730
|
{ text: "Do not use any other bank", emphasize: ["Do not"] }
|
|
4727
4731
|
]
|
|
4728
4732
|
};
|
|
@@ -4795,6 +4799,10 @@ var zelleChaseSendConfig = {
|
|
|
4795
4799
|
}
|
|
4796
4800
|
],
|
|
4797
4801
|
sendPaymentDonts: () => [
|
|
4802
|
+
{
|
|
4803
|
+
text: "Do not send unless you can sign in to Chase's website. Signing in is required to verify your payment and complete this order.",
|
|
4804
|
+
emphasize: ["Do not send", "sign in", "Chase's website"]
|
|
4805
|
+
},
|
|
4798
4806
|
{ text: "Do not send using any other bank", emphasize: ["Do not"] }
|
|
4799
4807
|
]
|
|
4800
4808
|
};
|
|
@@ -4870,6 +4878,10 @@ var zelleCitiSendConfig = {
|
|
|
4870
4878
|
}
|
|
4871
4879
|
],
|
|
4872
4880
|
sendPaymentDonts: () => [
|
|
4881
|
+
{
|
|
4882
|
+
text: "Do not send unless you can sign in to Citi's website. Signing in is required to verify your payment and complete this order.",
|
|
4883
|
+
emphasize: ["Do not send", "sign in", "Citi's website"]
|
|
4884
|
+
},
|
|
4873
4885
|
{ text: "Do not send using any other bank", emphasize: ["Do not"] }
|
|
4874
4886
|
]
|
|
4875
4887
|
};
|
|
@@ -7654,10 +7666,10 @@ var IndexerStakingService = class {
|
|
|
7654
7666
|
}
|
|
7655
7667
|
};
|
|
7656
7668
|
|
|
7657
|
-
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.
|
|
7658
|
-
var version = "0.4.1
|
|
7669
|
+
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.1_ethers@6.16.0_bufferutil@4.1.0_utf-8-validate@5.0.10__typescript@5.9.3_zod@4.5.4/node_modules/@zkp2p/contracts-v2/_esm/index.js
|
|
7670
|
+
var version = "0.4.1";
|
|
7659
7671
|
|
|
7660
|
-
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.
|
|
7672
|
+
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.1_ethers@6.16.0_bufferutil@4.1.0_utf-8-validate@5.0.10__typescript@5.9.3_zod@4.5.4/node_modules/@zkp2p/contracts-v2/_esm/disputeStack/base.js
|
|
7661
7673
|
var data = {
|
|
7662
7674
|
"schemaVersion": 2,
|
|
7663
7675
|
"network": "base",
|
|
@@ -7796,7 +7808,7 @@ var data = {
|
|
|
7796
7808
|
]
|
|
7797
7809
|
},
|
|
7798
7810
|
"riskWindowSecondsByPaymentMethod": {
|
|
7799
|
-
"0x10940ee67cfb3c6c064569ec92c0ee934cd7afa18dd2ca2d6a2254fcb009c17d": "
|
|
7811
|
+
"0x10940ee67cfb3c6c064569ec92c0ee934cd7afa18dd2ca2d6a2254fcb009c17d": "0",
|
|
7800
7812
|
"0x3ccc3d4d5e769b1f82dc4988485551dc0cd3c7a3926d7d8a4dde91507199490f": "1209600",
|
|
7801
7813
|
"0x554a007c2217df766b977723b276671aee5ebb4adaea0edb6433c88b3e61dac5": "0",
|
|
7802
7814
|
"0x5908bb0c9b87763ac6171d4104847667e7f02b4c47b574fe890c1f439ed128bb": "0",
|
|
@@ -7827,7 +7839,7 @@ var data = {
|
|
|
7827
7839
|
};
|
|
7828
7840
|
var base_default = data;
|
|
7829
7841
|
|
|
7830
|
-
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.
|
|
7842
|
+
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.1_ethers@6.16.0_bufferutil@4.1.0_utf-8-validate@5.0.10__typescript@5.9.3_zod@4.5.4/node_modules/@zkp2p/contracts-v2/_esm/disputeStack/baseStaging.js
|
|
7831
7843
|
var data2 = {
|
|
7832
7844
|
"schemaVersion": 2,
|
|
7833
7845
|
"network": "base_staging",
|
|
@@ -7966,7 +7978,7 @@ var data2 = {
|
|
|
7966
7978
|
]
|
|
7967
7979
|
},
|
|
7968
7980
|
"riskWindowSecondsByPaymentMethod": {
|
|
7969
|
-
"0x10940ee67cfb3c6c064569ec92c0ee934cd7afa18dd2ca2d6a2254fcb009c17d": "
|
|
7981
|
+
"0x10940ee67cfb3c6c064569ec92c0ee934cd7afa18dd2ca2d6a2254fcb009c17d": "0",
|
|
7970
7982
|
"0x1d966dbd6aeb8674d7c05174bd0ded7b56a798672bfb862ef20bbe8c2bbfce18": "0",
|
|
7971
7983
|
"0x3ccc3d4d5e769b1f82dc4988485551dc0cd3c7a3926d7d8a4dde91507199490f": "1209600",
|
|
7972
7984
|
"0x554a007c2217df766b977723b276671aee5ebb4adaea0edb6433c88b3e61dac5": "0",
|
|
@@ -11469,7 +11481,7 @@ var Zkp2pClient = class {
|
|
|
11469
11481
|
}
|
|
11470
11482
|
}
|
|
11471
11483
|
});
|
|
11472
|
-
const { mapConversionRatesToOnchainMinRate: mapConversionRatesToOnchainMinRate2 } = await import('./currency-
|
|
11484
|
+
const { mapConversionRatesToOnchainMinRate: mapConversionRatesToOnchainMinRate2 } = await import('./currency-KDDCBZU2.mjs');
|
|
11473
11485
|
currencies = mapConversionRatesToOnchainMinRate2(
|
|
11474
11486
|
params.conversionRates,
|
|
11475
11487
|
paymentMethods.length
|