@zkp2p/sdk 0.10.0-rc.2 → 0.10.0-rc.3

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
@@ -276,13 +276,24 @@ Keeper writes are direct and prepareable:
276
276
  ```ts
277
277
  const sweep = await client.releaseMaturedPositions.prepare({
278
278
  intentHashes: [intentHash],
279
+ riskManagerAddress: snapshottedRiskManagerAddress,
280
+ });
281
+ const settlement = await client.reconcileSettlement.prepare({
282
+ intentHash,
283
+ riskManagerAddress: snapshottedRiskManagerAddress,
279
284
  });
280
- const settlement = await client.reconcileSettlement.prepare({ intentHash });
281
285
  const cancellations = await client.reconcileCancellations.prepare({
282
286
  intentHashes: [intentHash],
287
+ riskManagerAddress: snapshottedRiskManagerAddress,
283
288
  });
284
289
  ```
285
290
 
291
+ Like `orchestratorAddress`, an explicit `riskManagerAddress` is caller-pinned
292
+ and may be outside the client's configured deployment context. All five keeper
293
+ methods honor it for direct and `.prepare()` calls, allowing sweepers to group
294
+ positions by their snapshotted RiskManager deployment without a later SDK
295
+ configuration change rerouting them.
296
+
286
297
  For receipt classification, import `RISK_POSITION_SETTLED_EVENT_ABI` and
287
298
  `DEFERRED_PAYOUT_RECORDED_EVENT_ABI` and pass them to viem's
288
299
  `decodeEventLog()`.
package/dist/index.cjs CHANGED
@@ -81832,15 +81832,30 @@ var Zkp2pClient = class {
81832
81832
  "clearStakeOwner",
81833
81833
  () => []
81834
81834
  );
81835
- /** Release one or more RiskManager positions whose chargeback window matured. */
81835
+ /**
81836
+ * Release one or more RiskManager positions whose chargeback window matured.
81837
+ * Pass `riskManagerAddress` to pin the transaction to a snapshotted deployment.
81838
+ */
81836
81839
  this.releaseMaturedPositions = this.buildRiskManagerMethod("releaseMaturedPositions", (params) => [params.intentHashes]);
81837
- /** Reconcile one failed OrchestratorV3 settlement callback. */
81840
+ /**
81841
+ * Reconcile one failed OrchestratorV3 settlement callback.
81842
+ * Pass `riskManagerAddress` to pin the transaction to a snapshotted deployment.
81843
+ */
81838
81844
  this.reconcileSettlement = this.buildRiskManagerMethod("reconcileSettlement", (params) => [params.intentHash]);
81839
- /** Reconcile multiple failed OrchestratorV3 settlement callbacks. */
81845
+ /**
81846
+ * Reconcile multiple failed OrchestratorV3 settlement callbacks.
81847
+ * Pass `riskManagerAddress` to pin the transaction to a snapshotted deployment.
81848
+ */
81840
81849
  this.reconcileSettlements = this.buildRiskManagerMethod("reconcileSettlements", (params) => [params.intentHashes]);
81841
- /** Reconcile one failed OrchestratorV3 cancellation callback. */
81850
+ /**
81851
+ * Reconcile one failed OrchestratorV3 cancellation callback.
81852
+ * Pass `riskManagerAddress` to pin the transaction to a snapshotted deployment.
81853
+ */
81842
81854
  this.reconcileCancellation = this.buildRiskManagerMethod("reconcileCancellation", (params) => [params.intentHash]);
81843
- /** Reconcile multiple failed OrchestratorV3 cancellation callbacks. */
81855
+ /**
81856
+ * Reconcile multiple failed OrchestratorV3 cancellation callbacks.
81857
+ * Pass `riskManagerAddress` to pin the transaction to a snapshotted deployment.
81858
+ */
81844
81859
  this.reconcileCancellations = this.buildRiskManagerMethod("reconcileCancellations", (params) => [params.intentHashes]);
81845
81860
  // ╔═══════════════════════════════════════════════════════════════════════════╗
81846
81861
  // ║ CORE: DEPOSIT MANAGEMENT ║
@@ -83257,7 +83272,7 @@ var Zkp2pClient = class {
83257
83272
  buildContractMethod(resolveContract, functionName, buildArgs, buildValue) {
83258
83273
  return Object.assign(
83259
83274
  async (params) => {
83260
- const contract = resolveContract();
83275
+ const contract = resolveContract(params);
83261
83276
  if (!contract.address || !contract.abi) {
83262
83277
  throw new Error(`${contract.label} not available`);
83263
83278
  }
@@ -83273,7 +83288,7 @@ var Zkp2pClient = class {
83273
83288
  },
83274
83289
  {
83275
83290
  prepare: async (params) => {
83276
- const contract = resolveContract();
83291
+ const contract = resolveContract(params);
83277
83292
  if (!contract.address || !contract.abi) {
83278
83293
  throw new Error(`${contract.label} not available`);
83279
83294
  }
@@ -83308,8 +83323,8 @@ var Zkp2pClient = class {
83308
83323
  }
83309
83324
  buildRiskManagerMethod(functionName, buildArgs) {
83310
83325
  return this.buildContractMethod(
83311
- () => ({
83312
- address: this.riskManagerAddress,
83326
+ (params) => ({
83327
+ address: params.riskManagerAddress ?? this.riskManagerAddress,
83313
83328
  abi: this.riskManagerAbi,
83314
83329
  label: "RiskManager"
83315
83330
  }),