@zkp2p/sdk 0.10.0-rc.2 → 0.10.0-rc.4
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 +23 -9
- package/dist/{chunk-NKEAAPPR.mjs → chunk-7Z77SXI3.mjs} +2 -2
- package/dist/{chunk-NKEAAPPR.mjs.map → chunk-7Z77SXI3.mjs.map} +1 -1
- package/dist/index.cjs +88 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +9 -11
- package/dist/index.d.ts +9 -11
- package/dist/index.mjs +95 -28
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-IJKEPSWS.mjs +5 -0
- package/dist/{protocolViewerParsers-WNN3TJD3.mjs.map → protocolViewerParsers-IJKEPSWS.mjs.map} +1 -1
- package/dist/react.cjs +33 -19
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.mjs +33 -19
- package/dist/react.mjs.map +1 -1
- package/dist/{vaultUtils-CqcqEPMO.d.mts → vaultUtils-C7yGNmLy.d.mts} +51 -23
- package/dist/{vaultUtils-CqcqEPMO.d.ts → vaultUtils-C7yGNmLy.d.ts} +51 -23
- package/package.json +1 -1
- package/dist/protocolViewerParsers-WNN3TJD3.mjs +0 -5
package/README.md
CHANGED
|
@@ -241,8 +241,9 @@ const stake = await client.getTakerStake({ owner: takerAddress, chainId: 8453 })
|
|
|
241
241
|
// reservedUsdc (locked), freeUsdc — each { raw, formatted } in 6-decimal base units.
|
|
242
242
|
|
|
243
243
|
const capacity = await client.getTakerCapacity({ owner: takerAddress, chainId: 8453 });
|
|
244
|
-
// capacity.responseObject.platforms[]: bondedTakingCapacity,
|
|
245
|
-
// chargeback curve terms, warnings;
|
|
244
|
+
// capacity.responseObject.platforms[]: bondedTakingCapacity, baseUnbonded,
|
|
245
|
+
// totalTakingCapacity, griefing and chargeback curve terms, warnings;
|
|
246
|
+
// operationalGates carries pause state.
|
|
246
247
|
|
|
247
248
|
const onchain = await client.getStakeVaultState({
|
|
248
249
|
staker: stakeOwnerAddress,
|
|
@@ -276,13 +277,24 @@ Keeper writes are direct and prepareable:
|
|
|
276
277
|
```ts
|
|
277
278
|
const sweep = await client.releaseMaturedPositions.prepare({
|
|
278
279
|
intentHashes: [intentHash],
|
|
280
|
+
riskManagerAddress: snapshottedRiskManagerAddress,
|
|
281
|
+
});
|
|
282
|
+
const settlement = await client.reconcileSettlement.prepare({
|
|
283
|
+
intentHash,
|
|
284
|
+
riskManagerAddress: snapshottedRiskManagerAddress,
|
|
279
285
|
});
|
|
280
|
-
const settlement = await client.reconcileSettlement.prepare({ intentHash });
|
|
281
286
|
const cancellations = await client.reconcileCancellations.prepare({
|
|
282
287
|
intentHashes: [intentHash],
|
|
288
|
+
riskManagerAddress: snapshottedRiskManagerAddress,
|
|
283
289
|
});
|
|
284
290
|
```
|
|
285
291
|
|
|
292
|
+
Like `orchestratorAddress`, an explicit `riskManagerAddress` is caller-pinned
|
|
293
|
+
and may be outside the client's configured deployment context. All five keeper
|
|
294
|
+
methods honor it for direct and `.prepare()` calls, allowing sweepers to group
|
|
295
|
+
positions by their snapshotted RiskManager deployment without a later SDK
|
|
296
|
+
configuration change rerouting them.
|
|
297
|
+
|
|
286
298
|
For receipt classification, import `RISK_POSITION_SETTLED_EVENT_ABI` and
|
|
287
299
|
`DEFERRED_PAYOUT_RECORDED_EVENT_ABI` and pass them to viem's
|
|
288
300
|
`decodeEventLog()`.
|
|
@@ -291,10 +303,12 @@ For receipt classification, import `RISK_POSITION_SETTLED_EVENT_ABI` and
|
|
|
291
303
|
`GET /v2/taker/stake` and `GET /v2/taker/capacity`, the hard replacement for
|
|
292
304
|
the removed `/v2/taker/tier` endpoint. Platform capacities are alternative
|
|
293
305
|
views of one shared stake-owner portfolio — never sum them, and never filter
|
|
294
|
-
quotes by capacity.
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
306
|
+
quotes by capacity. The base unbonded tranche (`baseUnbonded`) is reusable on
|
|
307
|
+
every intent and combines with bonded capacity into `totalTakingCapacity`;
|
|
308
|
+
legacy free-take payloads from older curator deployments are normalized onto
|
|
309
|
+
this model by the SDK. Capacity can change whenever any authorized relayer
|
|
310
|
+
uses the shared stake, so refetch immediately before signaling; the contract
|
|
311
|
+
stays authoritative.
|
|
298
312
|
|
|
299
313
|
For table-style liquidity UIs, the low-level `apiGetOrderbookTable()` adapter exposes curator's paginated public/private orderbook rows and row-level privacy metadata.
|
|
300
314
|
|
|
@@ -781,7 +795,7 @@ The package already includes TypeDoc configuration. Generate the full API refere
|
|
|
781
795
|
pnpm --filter @zkp2p/sdk docs
|
|
782
796
|
```
|
|
783
797
|
|
|
784
|
-
This writes documentation to
|
|
798
|
+
This writes generated documentation to `packages/sdk/docs` and includes the React entry point as well as the main SDK and extension surfaces.
|
|
785
799
|
|
|
786
800
|
## Debug Logging
|
|
787
801
|
|
|
@@ -811,4 +825,4 @@ pnpm docs
|
|
|
811
825
|
- NPM: https://www.npmjs.com/package/@zkp2p/sdk
|
|
812
826
|
- Docs: https://docs.peer.xyz
|
|
813
827
|
- Monorepo: https://github.com/zkp2p/zkp2p-clients
|
|
814
|
-
- TypeDoc output:
|
|
828
|
+
- TypeDoc output: `packages/sdk/docs` (generated locally by `pnpm --filter @zkp2p/sdk docs`)
|
|
@@ -74362,5 +74362,5 @@ function enrichPvIntentView(view, chainId, env = "production") {
|
|
|
74362
74362
|
}
|
|
74363
74363
|
|
|
74364
74364
|
export { DEFERRED_PAYOUT_RECORDED_EVENT_ABI, METHOD_NAME_TO_HASH, ORCHESTRATOR_V3_ABI2 as ORCHESTRATOR_V3_ABI, PAYMENT_PLATFORMS, RISK_MANAGER_ABI2 as RISK_MANAGER_ABI, RISK_POSITION_SETTLED_EVENT_ABI, STAKE_VAULT_ABI2 as STAKE_VAULT_ABI, SUPPORTED_PAYMENT_METHOD_HASHES, asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getGatingServiceAddress, getOrchestratorV3Contract, getPaymentMethodsCatalog, getRateManagerContracts, getRiskManagerContract, getStakeVaultContract, matchesPaymentMethodNameAndHash, matchesQuotePaymentMethod, parseBigIntLike, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash };
|
|
74365
|
-
//# sourceMappingURL=chunk-
|
|
74366
|
-
//# sourceMappingURL=chunk-
|
|
74365
|
+
//# sourceMappingURL=chunk-7Z77SXI3.mjs.map
|
|
74366
|
+
//# sourceMappingURL=chunk-7Z77SXI3.mjs.map
|