@zkp2p/sdk 0.3.2 → 0.4.0-rc.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/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.3.1`
9
+ Current version: `0.3.3`
10
10
 
11
11
  ## Why This SDK
12
12
 
@@ -96,6 +96,7 @@ Indexer defaults by environment:
96
96
  | Intents | `signalIntent`, `fulfillIntent`, `cancelIntent`, `releaseFundsToPayer`, `getFulfillIntentInputs` |
97
97
  | Prepared transactions | `client.prepareCreateDeposit(...)`, `client.signalIntent.prepare(...)`, `client.fulfillIntent.prepare(...)`, `client.setVaultFee.prepare(...)`, and equivalent prepare flows across the rest of the prepareable write surface |
98
98
  | Payee and quote APIs | `registerPayeeDetails`, `resolvePayeeHash`, `getQuote`, `getQuotesBestByPlatform`, `getTakerTier` |
99
+ | Seller automated release | `uploadSellerCredential`, `getSellerCredentialStatus`, `verifySellerPayment` |
99
100
  | Delegation and hooks | `setDelegate`, `removeDelegate`, `setRateManager`, `clearRateManager`, `setDepositRateManager`, `clearDepositRateManager`, `setDepositPreIntentHook`, `setDepositWhitelistHook` |
100
101
  | Vault / DRM | `createRateManager`, `setVaultMinRate`, `setVaultMinRatesBatch`, `setVaultFee`, `setVaultConfig`, `getDepositRateManager`, `getManagerFee`, `getEffectiveRate` |
101
102
  | Oracle config | `setOracleRateConfig`, `setOracleRateConfigBatch`, `removeOracleRateConfig`, `updateCurrencyConfigBatch`, `deactivateCurrenciesBatch`, `supportsInlineOracleRateConfig`, `validateOracleFeedsOnChain` |
@@ -104,6 +105,51 @@ Indexer defaults by environment:
104
105
  | React hooks | `@zkp2p/sdk/react` exports hooks for deposits, intents, delegation, vaults, payment methods, and taker tier |
105
106
  | Attribution | ERC-8021 helpers like `sendTransactionWithAttribution`, `encodeWithAttribution`, and `txOverrides.referrer` support |
106
107
 
108
+ ## Extension Onramp Deeplinks
109
+
110
+ Use `createPeerExtensionSdk()` when a third-party page has signaled an intent and should hand payment authentication and proof generation into the Peer extension.
111
+
112
+ ```ts
113
+ import { createPeerExtensionSdk } from '@zkp2p/sdk';
114
+
115
+ const peer = createPeerExtensionSdk();
116
+ const intentHash = await client.signalIntent({
117
+ // quote-selected intent params
118
+ });
119
+
120
+ const submitPreparedTransaction = async ({ transaction }) => {
121
+ await walletClient.sendTransaction({
122
+ to: transaction.to,
123
+ data: transaction.data,
124
+ value: BigInt(transaction.value),
125
+ });
126
+ };
127
+
128
+ const existing = await peer.getOnrampTransaction(intentHash);
129
+ if (existing) {
130
+ await submitPreparedTransaction(existing);
131
+ } else {
132
+ peer.onramp(
133
+ {
134
+ intentHash,
135
+ referrer: 'Liquidity Page',
136
+ inputCurrency: 'USD',
137
+ inputAmount: '500',
138
+ paymentPlatform: 'venmo',
139
+ depositId: '12345678901234567890',
140
+ amountUsdc: '488280000',
141
+ toToken: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
142
+ recipientAddress: '0xRecipient',
143
+ },
144
+ submitPreparedTransaction,
145
+ );
146
+ }
147
+ ```
148
+
149
+ For exact-deposit handoffs, pass `depositId` as a string or bigint unless it is known to be a JavaScript-safe integer. The extension derives payment method hashes from `paymentPlatform`; do not pass escrow addresses, payment method hashes, or hashed on-chain ids through the onramp URL. `getOnrampTransaction(intentHash)` is the pull recovery path for prepared calldata when the callback message was missed.
150
+
151
+ See [Extension Onramp Deeplinks](../../docs/extension-onramp-deeplinks.md) for the full parameter contract, exact-deposit semantics, and prepared calldata recovery behavior.
152
+
107
153
  ## Create a Deposit
108
154
 
109
155
  ```ts
@@ -158,6 +204,17 @@ const payeeHash = await client.resolvePayeeHash(
158
204
 
159
205
  `getQuote()` returns available liquidity plus payee details when authenticated. Use `getQuotesBestByPlatform()` to fetch the best quote per supported payment platform in a single call (handy for cross-platform comparison UIs). `getTakerTier()` returns limits and cooldown data for taker UX.
160
206
 
207
+ ## Seller Credential Status
208
+
209
+ ```ts
210
+ const status = await client.getSellerCredentialStatus({
211
+ processorName: 'venmo',
212
+ payeeDetails: '0xPAYEE_DETAILS_HASH',
213
+ });
214
+ ```
215
+
216
+ `payeeDetails` is the hashed payee details bytes32 used by maker registration, quotes, and on-chain intents. The public status endpoint returns `{ platform, payeeIdHash, status, credentialType }`; maker row ids are intentionally not returned by status or upload responses.
217
+
161
218
  ## Signal, Fulfill, and Release Intents
162
219
 
163
220
  ```ts