@zkp2p/sdk 0.14.7 → 0.14.8

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/index.mjs CHANGED
@@ -2,12 +2,12 @@ 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, ContractError, 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-ANDZNB7X.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-ANDZNB7X.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-Q33OEQMR.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-Q33OEQMR.mjs';
7
7
  import { Currency, currencyKeccak256 } from './chunk-WDEEWFEU.mjs';
8
8
  export { Currency, currencyInfo, getCurrencyCodeFromHash, getCurrencyInfoFromCountryCode, getCurrencyInfoFromHash, isSupportedCurrencyHash, mapConversionRatesToOnchainMinRate } from './chunk-WDEEWFEU.mjs';
9
- import { define_ZKP2P_SDK_BUILD_METADATA_default } from './chunk-SWQCAVQR.mjs';
10
- import { keccak256, concatHex, encodeFunctionData, encodeAbiParameters, createPublicClient, http, parseEventLogs, isAddressEqual, isAddress, zeroAddress, formatUnits } from 'viem';
9
+ import { define_ZKP2P_SDK_BUILD_METADATA_default } from './chunk-HG27KAGT.mjs';
10
+ import { keccak256, parseUnits, concatHex, encodeFunctionData, encodeAbiParameters, createPublicClient, http, parseEventLogs, isAddressEqual, isAddress, zeroAddress, formatUnits } from 'viem';
11
11
  import { hardhat, base } from 'viem/chains';
12
12
  import { hashUtf8, createNitroAttestationClient, verifySellerCredentialBundle, NitroAttestationError, createEncryptedBuyerTeeSessionMaterial as createEncryptedBuyerTeeSessionMaterial$1, createEncryptedSellerCredentialUpload } from '@zkp2p/zkp2p-attestation';
13
13
  export { createNitroAttestationClient, verifyDisputeAttestation } from '@zkp2p/zkp2p-attestation';
@@ -605,6 +605,55 @@ var zelleCitiVerifyConfig = {
605
605
  return `Transfer of $${Number(metadata.amount)} to ${metadata.recipient}`;
606
606
  }
607
607
  };
608
+ var CAPITAL_ONE_ZELLE_APP_LINK = "https://links.capitalone.com/bank/zelle/getting-started/";
609
+ var zelleCapitalOneSendConfig = {
610
+ paymentMethodName: "Capital One",
611
+ defaultPaymentMode: "QR_CODE",
612
+ useCustomQRCode: true,
613
+ getFormattedSendLink: () => CAPITAL_ONE_ZELLE_APP_LINK,
614
+ troubleScanningQRCodeLink: () => CAPITAL_ONE_ZELLE_APP_LINK,
615
+ deepLinkEmbedsRecipient: false,
616
+ supportsSendingPaymentOnWeb: true,
617
+ showTroubleScanningQRCodeLink: true,
618
+ sendPaymentWarning: (currency, amount) => `Send exactly ${amount} ${currencyInfo2[currency].currencyCode} in a single payment through Capital One's Zelle.`,
619
+ sendPaymentInfo: () => "Only use Capital One. Keep the \u201CYou sent money with Zelle\u201D email to verify this payment.",
620
+ sendPaymentDos: (currency, amount) => [
621
+ { text: "Use Capital One for this payment", emphasize: ["Capital One"] },
622
+ {
623
+ text: `Send exactly ${amount} ${currencyInfo2[currency].currencyCode} in a single payment`,
624
+ emphasize: [
625
+ "exactly",
626
+ amount,
627
+ currencyInfo2[currency].currencyCode,
628
+ "single"
629
+ ]
630
+ }
631
+ ],
632
+ sendPaymentDonts: () => [
633
+ {
634
+ text: "Do not send unless you can open the Capital One payment email. The email is required to verify your payment and complete this order.",
635
+ emphasize: ["Do not send", "payment email"]
636
+ },
637
+ { text: "Do not send using any other bank", emphasize: ["Do not"] }
638
+ ]
639
+ };
640
+ var zelleCapitalOneVerifyConfig = {
641
+ authLink: "https://myaccounts.capitalone.com/",
642
+ actionType: "transfer_zelle_capitalone",
643
+ actionPlatform: PaymentPlatform.ZELLE,
644
+ numPaymentsFetched: 20,
645
+ minExtensionVersion: "0.0.0",
646
+ supportsAppclip: false,
647
+ totalProofs: 1,
648
+ verifiesByEmail: true,
649
+ // PeerAuth never captures payment metadata for an email-verified bank.
650
+ parseMetadata: () => {
651
+ throw new Error("Capital One payments have no PeerAuth metadata");
652
+ },
653
+ getSubjectText: () => {
654
+ throw new Error("Capital One payments have no PeerAuth metadata");
655
+ }
656
+ };
608
657
  var genericZelleBankRoutes = [
609
658
  {
610
659
  bankId: "chase",
@@ -620,12 +669,23 @@ var genericZelleBankRoutes = [
620
669
  bankId: "citi",
621
670
  sendConfig: zelleCitiSendConfig,
622
671
  verifyConfig: zelleCitiVerifyConfig
672
+ },
673
+ {
674
+ bankId: "capitalone",
675
+ sendConfig: zelleCapitalOneSendConfig,
676
+ verifyConfig: zelleCapitalOneVerifyConfig
623
677
  }
624
678
  ];
625
679
  genericZelleBankRoutes.map(({ sendConfig, verifyConfig }) => ({
626
680
  sendConfig,
627
681
  verifyConfig
628
682
  }));
683
+ var usdcUnits = (amount) => {
684
+ return parseUnits(amount.toString(), 6);
685
+ };
686
+ ({
687
+ singleOrderDeposit: {
688
+ minDeposit: usdcUnits(10)}});
629
689
  var DISPUTE_PROTECTION_STAKE_PLATFORMS = [
630
690
  PaymentPlatform.VENMO,
631
691
  PaymentPlatform.PAYPAL
@@ -978,7 +1038,7 @@ async function withRetry(fn, maxRetries = 3, delayMs = 1e3, timeoutMs, shouldRet
978
1038
  for (let i = 0; i < maxRetries; i++) {
979
1039
  try {
980
1040
  if (timeoutMs) {
981
- const { withTimeout } = await import('./timeout-7GUR6QN3.mjs');
1041
+ const { withTimeout } = await import('./timeout-GGK4EEKQ.mjs');
982
1042
  return await withTimeout(fn(), timeoutMs, `Operation timed out after ${timeoutMs}ms`);
983
1043
  }
984
1044
  return await fn();
@@ -1853,6 +1913,7 @@ function resolvePlatformAttestationConfig(platformName) {
1853
1913
  // src/client/IntentOperations.ts
1854
1914
  var GENERIC_ZELLE_ATTESTATION_ACTION_TYPES = /* @__PURE__ */ new Set([
1855
1915
  "transfer_zelle_bofa",
1916
+ "transfer_zelle_capitalone",
1856
1917
  "transfer_zelle_chase",
1857
1918
  "transfer_zelle_citi"
1858
1919
  ]);
@@ -2597,7 +2658,7 @@ var ProtocolViewerReader = class {
2597
2658
  if (inputCount === null) {
2598
2659
  throw new Error("Configured ProtocolViewer ABI does not expose getDeposit");
2599
2660
  }
2600
- const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-N5RU4PRR.mjs');
2661
+ const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-6IAP5ZIJ.mjs');
2601
2662
  if (inputCount >= 3) {
2602
2663
  return tryContexts(
2603
2664
  protocolViewerContexts,
@@ -2683,7 +2744,7 @@ var ProtocolViewerReader = class {
2683
2744
  return Promise.all(ids.map((id) => this.config.host.getPvDepositById(id)));
2684
2745
  }
2685
2746
  const bn = ids.map((id) => typeof id === "bigint" ? id : parseRawDepositId(id));
2686
- const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-N5RU4PRR.mjs');
2747
+ const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-6IAP5ZIJ.mjs');
2687
2748
  if (inputCount >= 2) {
2688
2749
  const requests = ids.map((id, index) => ({
2689
2750
  index,
@@ -2788,7 +2849,7 @@ var ProtocolViewerReader = class {
2788
2849
  if (!protocolViewerAddress || !protocolViewerAbi || inputCount === null) {
2789
2850
  return this.config.host.getPvAccountDepositsFromIndexer(owner);
2790
2851
  }
2791
- const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-N5RU4PRR.mjs');
2852
+ const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-6IAP5ZIJ.mjs');
2792
2853
  const { address, abi } = this.config.host.requireProtocolViewer();
2793
2854
  if (inputCount >= 2) {
2794
2855
  const readAndFilter = async (raw2) => {
@@ -2859,7 +2920,7 @@ var ProtocolViewerReader = class {
2859
2920
  if (protocolViewerEntries.length === 0) {
2860
2921
  throw new Error("ProtocolViewer not available for this network");
2861
2922
  }
2862
- const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-N5RU4PRR.mjs');
2923
+ const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-6IAP5ZIJ.mjs');
2863
2924
  const intentsByHash = /* @__PURE__ */ new Map();
2864
2925
  let attemptedRead = false;
2865
2926
  let hadSuccessfulRead = false;
@@ -2967,7 +3028,7 @@ var ProtocolViewerReader = class {
2967
3028
  if (protocolViewerEntries.length === 0) {
2968
3029
  throw new Error("ProtocolViewer not available for this network");
2969
3030
  }
2970
- const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-N5RU4PRR.mjs');
3031
+ const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-6IAP5ZIJ.mjs');
2971
3032
  let lastError;
2972
3033
  for (const pvEntry of protocolViewerEntries) {
2973
3034
  const inputCount = this.pvEntryFunctionInputCount(pvEntry, "getIntent");
@@ -12024,7 +12085,7 @@ var Zkp2pClient = class {
12024
12085
  }
12025
12086
  }
12026
12087
  });
12027
- const { mapConversionRatesToOnchainMinRate: mapConversionRatesToOnchainMinRate2 } = await import('./currency-7YDW5OGY.mjs');
12088
+ const { mapConversionRatesToOnchainMinRate: mapConversionRatesToOnchainMinRate2 } = await import('./currency-ELLII4P5.mjs');
12028
12089
  currencies = mapConversionRatesToOnchainMinRate2(
12029
12090
  params.conversionRates,
12030
12091
  paymentMethods.length