@zkp2p/sdk 0.10.0-rc.5 → 0.10.0-rc.7
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 +48 -1
- package/dist/{chunk-2KGAHUBH.mjs → chunk-JRLUSPR3.mjs} +4356 -1566
- package/dist/chunk-JRLUSPR3.mjs.map +1 -0
- package/dist/chunk-WXEP544Y.mjs +281 -0
- package/dist/chunk-WXEP544Y.mjs.map +1 -0
- package/dist/index.cjs +5628 -2177
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +461 -10
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-QMHI74AA.mjs +5 -0
- package/dist/{protocolViewerParsers-V2RTIEDG.mjs.map → protocolViewerParsers-QMHI74AA.mjs.map} +1 -1
- package/dist/react.cjs +143 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.mts +35 -3
- package/dist/react.d.ts +35 -3
- package/dist/react.mjs +126 -3
- package/dist/react.mjs.map +1 -1
- package/dist/{vaultUtils-D-DVzOoX.d.mts → vaultUtils-DeUFIx3l.d.mts} +391 -2
- package/dist/{vaultUtils-D-DVzOoX.d.ts → vaultUtils-DeUFIx3l.d.ts} +391 -2
- package/package.json +3 -3
- package/dist/chunk-2KGAHUBH.mjs.map +0 -1
- package/dist/chunk-EIOXBVXP.mjs +0 -111
- package/dist/chunk-EIOXBVXP.mjs.map +0 -1
- package/dist/protocolViewerParsers-V2RTIEDG.mjs +0 -5
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ Indexer defaults by environment:
|
|
|
94
94
|
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
95
95
|
| Deposits | `createDeposit`, `addFunds`, `removeFunds`, `withdrawDeposit`, `ensureAllowance`, `setAcceptingIntents`, `setIntentRange`, `setCurrencyMinRate`, `setRetainOnEmpty` |
|
|
96
96
|
| Payment methods and currencies | `addPaymentMethods`, `removePaymentMethod`, `setPaymentMethodActive`, `addCurrencies`, `removeCurrency`, `deactivateCurrency`, `pruneExpiredIntents` |
|
|
97
|
-
| Intents | `signalIntent`, `fulfillIntent`, `cancelIntent`, `releaseFundsToPayer`, `getFulfillIntentInputs`
|
|
97
|
+
| Intents | `signalIntent`, `fulfillIntent`, `cancelIntent`, `releaseFundsToPayer`, `getFulfillIntentInputs`, `getIntentGuardianPolicy`, `quoteIntentExtension`, `getIntentGuardianPayerFunding`, `extendIntentLifetime` |
|
|
98
98
|
| 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 |
|
|
99
99
|
| Payee and quote APIs | `registerPayeeDetails`, `resolvePayeeHash`, `getQuote`, `getQuotesBestByPlatform`, `getTakerTier` |
|
|
100
100
|
| Seller automated release | `uploadSellerCredential`, `getSellerCredentialStatus`, `verifySellerPayment` |
|
|
@@ -284,6 +284,53 @@ await client.releaseFundsToPayer({
|
|
|
284
284
|
|
|
285
285
|
Use `referralFees[]` for multi-recipient fee distribution on OrchestratorV2.
|
|
286
286
|
|
|
287
|
+
## Extend an Intent Lifetime
|
|
288
|
+
|
|
289
|
+
The standalone `IntentGuardian` lets any payer buy more time for a live intent.
|
|
290
|
+
The fee is owner-governed, so read a fresh quote immediately before signing and
|
|
291
|
+
use `maxCost` as the payer's hard ceiling.
|
|
292
|
+
|
|
293
|
+
```ts
|
|
294
|
+
const policy = await client.getIntentGuardianPolicy();
|
|
295
|
+
if (!policy.extensionsEnabled) {
|
|
296
|
+
throw new Error('Intent extensions are disabled');
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const quote = await client.quoteIntentExtension({
|
|
300
|
+
intentAmount: 250_000n,
|
|
301
|
+
additionalTime: 60n * 60n,
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
const depositToken = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
|
|
305
|
+
const payer = walletClient.account.address;
|
|
306
|
+
const funding = await client.getIntentGuardianPayerFunding({
|
|
307
|
+
payer,
|
|
308
|
+
token: depositToken,
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
if (funding.balance < quote.cost) {
|
|
312
|
+
throw new Error('Insufficient token balance');
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
await client.ensureAllowance({
|
|
316
|
+
token: depositToken,
|
|
317
|
+
spender: policy.guardian,
|
|
318
|
+
amount: quote.cost,
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
await client.extendIntentLifetime({
|
|
322
|
+
escrow: '0xEscrow',
|
|
323
|
+
depositId: 42n,
|
|
324
|
+
intentHash,
|
|
325
|
+
additionalTime: 60n * 60n,
|
|
326
|
+
maxCost: quote.cost,
|
|
327
|
+
});
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
The guardian charges the target deposit's token and pays the deposit owner.
|
|
331
|
+
Extension payments are prepaid and non-refundable. `extendIntentLifetime.prepare()`
|
|
332
|
+
returns calldata without sending it.
|
|
333
|
+
|
|
287
334
|
## Referral Account API
|
|
288
335
|
|
|
289
336
|
Apps can read referral data publicly by wallet address and can write with either
|