@zkp2p/sdk 0.5.2 → 0.5.5

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 CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Stable TypeScript SDK for trustless fiat-to-crypto on Base. ZKP2P combines escrowed on-chain settlement, TLS attestations for payment verification, and API/indexer helpers so makers, takers, wallets, and embedded ramps can ship production-grade fiat liquidity flows without building their own contract or indexing stack.
8
8
 
9
- Current version: `0.5.0`
9
+ Current version: `0.5.2`
10
10
 
11
11
  ## Why This SDK
12
12
 
@@ -73,13 +73,13 @@ const client = new Zkp2pClient({
73
73
  - Supported runtime environments: `'production'`, `'preproduction'`, `'staging'`
74
74
  - `runtimeEnv` default: `'production'`
75
75
  - `rpcUrl`: optional RPC URL override (defaults to wallet's chain RPC)
76
- - `apiKey`: optional curator-issued API key used when the SDK auto-fetches `signalIntent()` gating signatures and enables richer authenticated `getQuote()` responses with resolved maker payee details (`offchainId`, `telegramUsername`, `metadata`)
77
- - `authorizationToken` / `getAuthorizationToken`: optional bearer auth for hybrid client and indexer flows
76
+ - `apiKey`: optional internal curator API key for internal seller verification only
77
+ - `authorizationToken` / `getAuthorizationToken`: optional bearer auth for indexer flows
78
78
  - `indexerApiKey`: optional `x-api-key` for indexer proxy auth
79
79
  - `indexerUrl` and `baseApiUrl`: override defaults when you are targeting custom deployments
80
80
  - `timeouts`: `{ api?: number }` — API timeout in milliseconds (default 15000)
81
81
 
82
- **No API key is required to get started.** `createDeposit`, `registerPayeeDetails`, `getQuote`, `getTakerTier`, and the rest of the SDK work without `apiKey` or `authorizationToken`. The main tradeoff is that `signalIntent()` only auto-fetches a gating service signature from curator `/v3/intent/sign` when `apiKey` or `authorizationToken` is available; otherwise provide both `gatingServiceSignature` and `signatureExpiration` manually if your integration needs one. Authenticated quotes also include resolved maker payee details (`offchainId`, `telegramUsername`, `metadata`).
82
+ **No external API key is required.** `createDeposit`, `registerPayeeDetails`, `getQuote`, `getTakerTier`, `signalIntent`, and the rest of the public SDK flows work without `apiKey` or `authorizationToken`. When `baseApiUrl` is configured, `signalIntent()` can auto-fetch a gating service signature from curator `/v3/intent/sign` without auth. Quote responses include resolved maker payee details (`offchainId`, `telegramUsername`, `metadata`) when curator has them.
83
83
 
84
84
  Indexer defaults by environment:
85
85
 
@@ -40673,10 +40673,42 @@ var lookups_default = {
40673
40673
  alipay: "0xcac9daea62d7b89d75ac73af4ee14dcf25721012ae82b568c2ea5c808eaa04ff",
40674
40674
  chime: "0x5908bb0c9b87763ac6171d4104847667e7f02b4c47b574fe890c1f439ed128bb",
40675
40675
  luxon: "0xaea63ef983458674f54ee50cdaa7b09d80a5c6c03ed505f51c90b0f2b54abb01"
40676
- }};
40676
+ },
40677
+ hashToName: {
40678
+ "0x90262a3db0edd0be2369c6b28f9e8511ec0bac7136cefbada0880602f87e7268": "venmo",
40679
+ "0x617f88ab82b5c1b014c539f7e75121427f0bb50a4c58b187a238531e7d58605d": "revolut",
40680
+ "0x10940ee67cfb3c6c064569ec92c0ee934cd7afa18dd2ca2d6a2254fcb009c17d": "cashapp",
40681
+ "0x554a007c2217df766b977723b276671aee5ebb4adaea0edb6433c88b3e61dac5": "wise",
40682
+ "0xa5418819c024239299ea32e09defae8ec412c03e58f5c75f1b2fe84c857f5483": "mercadopago",
40683
+ "0x817260692b75e93c7fbc51c71637d4075a975e221e1ebc1abeddfabd731fd90d": "zelle-citi",
40684
+ "0x6aa1d1401e79ad0549dced8b1b96fb72c41cd02b32a7d9ea1fed54ba9e17152e": "zelle-chase",
40685
+ "0x4bc42b322a3ad413b91b2fde30549ca70d6ee900eded1681de91aaf32ffd7ab5": "zelle-bofa",
40686
+ "0x3ccc3d4d5e769b1f82dc4988485551dc0cd3c7a3926d7d8a4dde91507199490f": "paypal",
40687
+ "0x62c7ed738ad3e7618111348af32691b5767777fbaf46a2d8943237625552645c": "monzo",
40688
+ "0xd9ff4fd6b39a3e3dd43c41d05662a5547de4a878bc97a65bcb352ade493cdc6b": "n26",
40689
+ "0xcac9daea62d7b89d75ac73af4ee14dcf25721012ae82b568c2ea5c808eaa04ff": "alipay",
40690
+ "0x5908bb0c9b87763ac6171d4104847667e7f02b4c47b574fe890c1f439ed128bb": "chime",
40691
+ "0xaea63ef983458674f54ee50cdaa7b09d80a5c6c03ed505f51c90b0f2b54abb01": "luxon"
40692
+ },
40693
+ zelleUnspecifiedHash: "0x7a656c6c65000000000000000000000000000000000000000000000000000000"
40694
+ };
40677
40695
 
40678
40696
  // src/utils/paymentMethodHashes.ts
40679
- var METHOD_NAME_TO_HASH = lookups_default.nameToHash;
40697
+ var METHOD_NAME_TO_HASH = {
40698
+ ...lookups_default.nameToHash,
40699
+ zelle: lookups_default.zelleUnspecifiedHash
40700
+ };
40701
+ var HASH_TO_METHOD_NAME = Object.entries(
40702
+ lookups_default.hashToName
40703
+ ).reduce(
40704
+ (acc, [hash, name]) => {
40705
+ acc[hash.toLowerCase()] = name;
40706
+ return acc;
40707
+ },
40708
+ {
40709
+ [lookups_default.zelleUnspecifiedHash.toLowerCase()]: "zelle"
40710
+ }
40711
+ );
40680
40712
 
40681
40713
  // ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.2.2_ethers@6.16.0_bufferutil@4.1.0_utf-8-validate@5.0.10__typescript@5.9.3_zod@4.2.1/node_modules/@zkp2p/contracts-v2/_esm/paymentMethods/baseStaging.js
40682
40714
  var data51 = {
@@ -40904,7 +40936,7 @@ function resolvePaymentMethodNameFromHash(hash, catalog) {
40904
40936
  for (const [name, entry] of Object.entries(catalog || {})) {
40905
40937
  if (entry?.paymentMethodHash?.toLowerCase() === target.toLowerCase()) return name;
40906
40938
  }
40907
- return void 0;
40939
+ return HASH_TO_METHOD_NAME[target.toLowerCase()];
40908
40940
  }
40909
40941
 
40910
40942
  // src/utils/protocolViewerParsers.ts
@@ -41017,5 +41049,5 @@ function enrichPvIntentView(view, chainId, env = "production") {
41017
41049
  }
41018
41050
 
41019
41051
  export { asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getGatingServiceAddress, getPaymentMethodsCatalog, getRateManagerContracts, parseBigIntLike, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash };
41020
- //# sourceMappingURL=chunk-L526MKG3.mjs.map
41021
- //# sourceMappingURL=chunk-L526MKG3.mjs.map
41052
+ //# sourceMappingURL=chunk-NKTSEXJB.mjs.map
41053
+ //# sourceMappingURL=chunk-NKTSEXJB.mjs.map