@zkp2p/sdk 0.5.4 → 0.5.6

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.cjs CHANGED
@@ -41180,11 +41180,15 @@ var init_lookups = __esm({
41180
41180
  });
41181
41181
 
41182
41182
  // src/utils/paymentMethodHashes.ts
41183
- var METHOD_NAME_TO_HASH, HASH_TO_METHOD_NAME;
41183
+ var GENERIC_ZELLE_PAYMENT_METHOD_HASH, METHOD_NAME_TO_HASH, HASH_TO_METHOD_NAME;
41184
41184
  var init_paymentMethodHashes = __esm({
41185
41185
  "src/utils/paymentMethodHashes.ts"() {
41186
41186
  init_lookups();
41187
- METHOD_NAME_TO_HASH = lookups_default.nameToHash;
41187
+ GENERIC_ZELLE_PAYMENT_METHOD_HASH = lookups_default.nameToHash.zelle ?? "0xf752c7d19698ecb0bb8988abf9b9a53a4c3657f3bc8850a6fb59fdf3e3ce8cd3";
41188
+ METHOD_NAME_TO_HASH = {
41189
+ ...lookups_default.nameToHash,
41190
+ zelle: GENERIC_ZELLE_PAYMENT_METHOD_HASH
41191
+ };
41188
41192
  HASH_TO_METHOD_NAME = Object.entries(
41189
41193
  lookups_default.hashToName
41190
41194
  ).reduce(
@@ -41192,7 +41196,10 @@ var init_paymentMethodHashes = __esm({
41192
41196
  acc[hash.toLowerCase()] = name;
41193
41197
  return acc;
41194
41198
  },
41195
- {}
41199
+ {
41200
+ [GENERIC_ZELLE_PAYMENT_METHOD_HASH.toLowerCase()]: "zelle",
41201
+ [lookups_default.zelleUnspecifiedHash.toLowerCase()]: "zelle"
41202
+ }
41196
41203
  );
41197
41204
  }
41198
41205
  });
@@ -42948,10 +42955,7 @@ var PLATFORM_ATTESTATION_CONFIG = {
42948
42955
  chime: { actionType: "transfer_chime", actionPlatform: "chime" },
42949
42956
  luxon: { actionType: "transfer_luxon", actionPlatform: "luxon" },
42950
42957
  n26: { actionType: "transfer_n26", actionPlatform: "n26" },
42951
- alipay: { actionType: "transfer_alipay", actionPlatform: "alipay" },
42952
- "zelle-chase": { actionType: "transfer_zelle", actionPlatform: "chase" },
42953
- "zelle-bofa": { actionType: "transfer_zelle", actionPlatform: "bankofamerica" },
42954
- "zelle-citi": { actionType: "transfer_zelle", actionPlatform: "citi" }
42958
+ alipay: { actionType: "transfer_alipay", actionPlatform: "alipay" }
42955
42959
  };
42956
42960
  function resolvePlatformAttestationConfig(platformName) {
42957
42961
  const normalized = platformName.toLowerCase();
@@ -42982,22 +42986,32 @@ var GENERIC_ZELLE_ATTESTATION_ACTION_TYPES = /* @__PURE__ */ new Set([
42982
42986
  "transfer_zelle_chase",
42983
42987
  "transfer_zelle_citi"
42984
42988
  ]);
42989
+ function hasBuyerTeeRouteOverrides(buyerTeeProof) {
42990
+ return Boolean(buyerTeeProof.actionPlatform && buyerTeeProof.actionType);
42991
+ }
42985
42992
  function resolveBuyerTeeAttestationRoute(platformName, buyerTeeProof) {
42986
- if (platformName.toLowerCase() !== "zelle") {
42987
- const platformConfig = resolvePlatformAttestationConfig(platformName);
42993
+ const normalizedPlatformName = platformName.toLowerCase();
42994
+ if (normalizedPlatformName === "zelle") {
42995
+ if (buyerTeeProof.actionPlatform !== "zelle" || !buyerTeeProof.actionType || !GENERIC_ZELLE_ATTESTATION_ACTION_TYPES.has(buyerTeeProof.actionType)) {
42996
+ throw new Error(
42997
+ 'Generic Zelle buyer TEE fulfillment requires actionPlatform "zelle" and a bank-specific transfer_zelle_* actionType.'
42998
+ );
42999
+ }
42988
43000
  return {
42989
- actionPlatform: buyerTeeProof.actionPlatform ?? platformConfig.actionPlatform,
42990
- actionType: buyerTeeProof.actionType ?? platformConfig.actionType
43001
+ actionPlatform: buyerTeeProof.actionPlatform,
43002
+ actionType: buyerTeeProof.actionType
42991
43003
  };
42992
43004
  }
42993
- if (buyerTeeProof.actionPlatform !== "zelle" || !buyerTeeProof.actionType || !GENERIC_ZELLE_ATTESTATION_ACTION_TYPES.has(buyerTeeProof.actionType)) {
42994
- throw new Error(
42995
- 'Generic Zelle buyer TEE fulfillment requires actionPlatform "zelle" and a bank-specific transfer_zelle_* actionType.'
42996
- );
43005
+ if (hasBuyerTeeRouteOverrides(buyerTeeProof)) {
43006
+ return {
43007
+ actionPlatform: buyerTeeProof.actionPlatform,
43008
+ actionType: buyerTeeProof.actionType
43009
+ };
42997
43010
  }
43011
+ const platformConfig = resolvePlatformAttestationConfig(platformName);
42998
43012
  return {
42999
- actionPlatform: buyerTeeProof.actionPlatform,
43000
- actionType: buyerTeeProof.actionType
43013
+ actionPlatform: platformConfig.actionPlatform,
43014
+ actionType: platformConfig.actionType
43001
43015
  };
43002
43016
  }
43003
43017
  var IntentOperations = class {