@zkp2p/sdk 0.10.0-rc.0 → 0.10.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
@@ -94,13 +94,14 @@ 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`, including explicit staging OrchestratorV3 routing |
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` |
100
100
  | Seller automated release | `uploadSellerCredential`, `getSellerCredentialStatus`, `verifySellerPayment` |
101
101
  | Delegation and hooks | `setDelegate`, `removeDelegate`, `setRateManager`, `clearRateManager`, `setDepositRateManager`, `clearDepositRateManager`, `setDepositPreIntentHook`, `setDepositWhitelistHook` |
102
102
  | Vault / DRM | `createRateManager`, `setVaultMinRate`, `setVaultMinRatesBatch`, `setVaultFee`, `setVaultConfig`, `getDepositRateManager`, `getManagerFee`, `getEffectiveRate` |
103
103
  | Taker staking | `ensureStakeAllowance`, `depositStake`, `depositStakeFor`, partial withdrawal and full-exit methods, stake-owner permission methods, direct StakeVault reads, and exact risk-capacity math |
104
+ | V3 settlement operations | `releaseMaturedPositions`, `reconcileSettlement(s)`, `reconcileCancellation(s)`, OrchestratorV3 intent prepares, and exported settlement event ABIs |
104
105
  | Oracle config | `setOracleRateConfig`, `setOracleRateConfigBatch`, `removeOracleRateConfig`, `updateCurrencyConfigBatch`, `deactivateCurrenciesBatch`, `supportsInlineOracleRateConfig`, `validateOracleFeedsOnChain` |
105
106
  | RPC reads | `getDeposits`, `getDeposit`, `getDepositsById`, `getIntents`, `getIntent`, `getPvDepositById`, `getPvDepositsFromIds`, `getPvAccountDeposits`, `getPvAccountIntents`, `getPvIntent` |
106
107
  | Indexer | `client.indexer.getDeposits`, `getDepositsWithRelations`, `getDepositById`, `getDepositsByIds`, `getDepositsByIdsWithRelations`, `getDepositsByPayeeHash`, `getIntentsForDeposits`, `getOwnerIntents`, `getIntentsByRateManager`, `getIntentByHash`, `getExpiredIntents`, `getFulfilledIntentEvents`, `getIntentFulfillmentAmounts`, `getFulfillmentAndPayment`, `getDepositFundActivities`, `getMakerFundActivities`, `getDepositDailySnapshots`, `getProfitSnapshotsByDeposits`, `getRateManagers`, `getRateManagerDetail`, `getRateManagerDelegations`, `getDelegationForDeposit`, `getManagerDailySnapshots`, `getManualRateUpdates`, `getOracleConfigUpdates`, `query` |
@@ -256,6 +257,30 @@ Stake writes expose direct and `.prepare()` variants: `depositStake`,
256
257
  StakeVault is currently staging-only; SDK contract resolution fails closed in
257
258
  production/preproduction until a deployment exists.
258
259
 
260
+ The same staging deployment exposes OrchestratorV3 and RiskManager through
261
+ `getDeployedAddresses()`, `getOrchestratorV3Contract()`, and
262
+ `getRiskManagerContract()`. Route an intent explicitly by passing
263
+ `orchestratorAddress: client.getDeployedAddresses().orchestratorV3`.
264
+ OrchestratorV3 signals are ungated: the SDK encodes an empty gating signature
265
+ and zero expiration without calling the curator signing endpoint. Existing
266
+ OrchestratorV2 signaling remains gated.
267
+
268
+ Keeper writes are direct and prepareable:
269
+
270
+ ```ts
271
+ const sweep = await client.releaseMaturedPositions.prepare({
272
+ intentHashes: [intentHash],
273
+ });
274
+ const settlement = await client.reconcileSettlement.prepare({ intentHash });
275
+ const cancellations = await client.reconcileCancellations.prepare({
276
+ intentHashes: [intentHash],
277
+ });
278
+ ```
279
+
280
+ For receipt classification, import `RISK_POSITION_SETTLED_EVENT_ABI` and
281
+ `DEFERRED_PAYOUT_RECORDED_EVENT_ABI` and pass them to viem's
282
+ `decodeEventLog()`.
283
+
259
284
  `getTakerStake()` and `getTakerCapacity()` wrap curator
260
285
  `GET /v2/taker/stake` and `GET /v2/taker/capacity`, the hard replacement for
261
286
  the removed `/v2/taker/tier` endpoint. Platform capacities are alternative
@@ -689,10 +714,14 @@ Hook groups:
689
714
 
690
715
  ```ts
691
716
  import {
717
+ DEFERRED_PAYOUT_RECORDED_EVENT_ABI,
692
718
  getContracts,
719
+ getOrchestratorV3Contract,
693
720
  getPaymentMethodsCatalog,
694
721
  getRateManagerContracts,
722
+ getRiskManagerContract,
695
723
  getStakeVaultContract,
724
+ RISK_POSITION_SETTLED_EVENT_ABI,
696
725
  resolveFiatCurrencyBytes32,
697
726
  resolvePaymentMethodHash,
698
727
  } from '@zkp2p/sdk';
@@ -700,6 +729,8 @@ import {
700
729
  const contracts = getContracts(8453, 'production');
701
730
  const rateManagerContracts = getRateManagerContracts(8453, 'production');
702
731
  const stakeVault = getStakeVaultContract(8453, 'staging');
732
+ const orchestratorV3 = getOrchestratorV3Contract(8453, 'staging');
733
+ const riskManager = getRiskManagerContract(8453, 'staging');
703
734
  const paymentMethods = getPaymentMethodsCatalog(8453, 'production');
704
735
  const usdHash = resolveFiatCurrencyBytes32('USD');
705
736
  const wiseHash = resolvePaymentMethodHash('wise', { env: 'production' });
@@ -30582,6 +30582,276 @@ function assertV3EscrowAbiComplete(abi) {
30582
30582
  );
30583
30583
  }
30584
30584
  }
30585
+ var ORCHESTRATOR_V3_ABI = [
30586
+ {
30587
+ inputs: [
30588
+ {
30589
+ internalType: "bytes32",
30590
+ name: "_intentHash",
30591
+ type: "bytes32"
30592
+ }
30593
+ ],
30594
+ name: "cancelIntent",
30595
+ outputs: [],
30596
+ stateMutability: "nonpayable",
30597
+ type: "function"
30598
+ },
30599
+ {
30600
+ inputs: [
30601
+ {
30602
+ components: [
30603
+ {
30604
+ internalType: "bytes",
30605
+ name: "paymentProof",
30606
+ type: "bytes"
30607
+ },
30608
+ {
30609
+ internalType: "bytes32",
30610
+ name: "intentHash",
30611
+ type: "bytes32"
30612
+ },
30613
+ {
30614
+ internalType: "bytes",
30615
+ name: "verificationData",
30616
+ type: "bytes"
30617
+ },
30618
+ {
30619
+ internalType: "bytes",
30620
+ name: "postIntentHookData",
30621
+ type: "bytes"
30622
+ }
30623
+ ],
30624
+ internalType: "struct IOrchestratorV2.FulfillIntentParams",
30625
+ name: "_params",
30626
+ type: "tuple"
30627
+ }
30628
+ ],
30629
+ name: "fulfillIntent",
30630
+ outputs: [],
30631
+ stateMutability: "nonpayable",
30632
+ type: "function"
30633
+ },
30634
+ {
30635
+ inputs: [
30636
+ {
30637
+ components: [
30638
+ {
30639
+ internalType: "address",
30640
+ name: "escrow",
30641
+ type: "address"
30642
+ },
30643
+ {
30644
+ internalType: "uint256",
30645
+ name: "depositId",
30646
+ type: "uint256"
30647
+ },
30648
+ {
30649
+ internalType: "uint256",
30650
+ name: "amount",
30651
+ type: "uint256"
30652
+ },
30653
+ {
30654
+ internalType: "address",
30655
+ name: "to",
30656
+ type: "address"
30657
+ },
30658
+ {
30659
+ internalType: "bytes32",
30660
+ name: "paymentMethod",
30661
+ type: "bytes32"
30662
+ },
30663
+ {
30664
+ internalType: "bytes32",
30665
+ name: "fiatCurrency",
30666
+ type: "bytes32"
30667
+ },
30668
+ {
30669
+ internalType: "uint256",
30670
+ name: "conversionRate",
30671
+ type: "uint256"
30672
+ },
30673
+ {
30674
+ components: [
30675
+ {
30676
+ internalType: "address",
30677
+ name: "recipient",
30678
+ type: "address"
30679
+ },
30680
+ {
30681
+ internalType: "uint256",
30682
+ name: "fee",
30683
+ type: "uint256"
30684
+ }
30685
+ ],
30686
+ internalType: "struct IReferralFee.ReferralFee[]",
30687
+ name: "referralFees",
30688
+ type: "tuple[]"
30689
+ },
30690
+ {
30691
+ internalType: "bytes",
30692
+ name: "gatingServiceSignature",
30693
+ type: "bytes"
30694
+ },
30695
+ {
30696
+ internalType: "uint256",
30697
+ name: "signatureExpiration",
30698
+ type: "uint256"
30699
+ },
30700
+ {
30701
+ internalType: "contract IPostIntentHookV2",
30702
+ name: "postIntentHook",
30703
+ type: "address"
30704
+ },
30705
+ {
30706
+ internalType: "bytes",
30707
+ name: "preIntentHookData",
30708
+ type: "bytes"
30709
+ },
30710
+ {
30711
+ internalType: "bytes",
30712
+ name: "data",
30713
+ type: "bytes"
30714
+ }
30715
+ ],
30716
+ internalType: "struct IOrchestratorV2.SignalIntentParams",
30717
+ name: "_params",
30718
+ type: "tuple"
30719
+ }
30720
+ ],
30721
+ name: "signalIntent",
30722
+ outputs: [],
30723
+ stateMutability: "nonpayable",
30724
+ type: "function"
30725
+ }
30726
+ ];
30727
+ var RISK_MANAGER_ABI = [
30728
+ {
30729
+ anonymous: false,
30730
+ inputs: [
30731
+ {
30732
+ indexed: true,
30733
+ internalType: "bytes32",
30734
+ name: "intentHash",
30735
+ type: "bytes32"
30736
+ },
30737
+ {
30738
+ indexed: true,
30739
+ internalType: "address",
30740
+ name: "stakeOwner",
30741
+ type: "address"
30742
+ },
30743
+ {
30744
+ indexed: true,
30745
+ internalType: "address",
30746
+ name: "lp",
30747
+ type: "address"
30748
+ },
30749
+ {
30750
+ indexed: false,
30751
+ internalType: "enum IRiskManager.RiskMode",
30752
+ name: "mode",
30753
+ type: "uint8"
30754
+ },
30755
+ {
30756
+ indexed: false,
30757
+ internalType: "uint256",
30758
+ name: "releasedAmount",
30759
+ type: "uint256"
30760
+ },
30761
+ {
30762
+ indexed: false,
30763
+ internalType: "uint256",
30764
+ name: "chargebackCoverage",
30765
+ type: "uint256"
30766
+ },
30767
+ {
30768
+ indexed: false,
30769
+ internalType: "uint256",
30770
+ name: "releasedReservation",
30771
+ type: "uint256"
30772
+ },
30773
+ {
30774
+ indexed: false,
30775
+ internalType: "uint64",
30776
+ name: "settledAt",
30777
+ type: "uint64"
30778
+ },
30779
+ {
30780
+ indexed: false,
30781
+ internalType: "uint64",
30782
+ name: "coverageDeadline",
30783
+ type: "uint64"
30784
+ }
30785
+ ],
30786
+ name: "RiskPositionSettled",
30787
+ type: "event"
30788
+ },
30789
+ {
30790
+ inputs: [
30791
+ {
30792
+ internalType: "bytes32",
30793
+ name: "_intentHash",
30794
+ type: "bytes32"
30795
+ }
30796
+ ],
30797
+ name: "reconcileCancellation",
30798
+ outputs: [],
30799
+ stateMutability: "nonpayable",
30800
+ type: "function"
30801
+ },
30802
+ {
30803
+ inputs: [
30804
+ {
30805
+ internalType: "bytes32[]",
30806
+ name: "_intentHashes",
30807
+ type: "bytes32[]"
30808
+ }
30809
+ ],
30810
+ name: "reconcileCancellations",
30811
+ outputs: [],
30812
+ stateMutability: "nonpayable",
30813
+ type: "function"
30814
+ },
30815
+ {
30816
+ inputs: [
30817
+ {
30818
+ internalType: "bytes32",
30819
+ name: "_intentHash",
30820
+ type: "bytes32"
30821
+ }
30822
+ ],
30823
+ name: "reconcileSettlement",
30824
+ outputs: [],
30825
+ stateMutability: "nonpayable",
30826
+ type: "function"
30827
+ },
30828
+ {
30829
+ inputs: [
30830
+ {
30831
+ internalType: "bytes32[]",
30832
+ name: "_intentHashes",
30833
+ type: "bytes32[]"
30834
+ }
30835
+ ],
30836
+ name: "reconcileSettlements",
30837
+ outputs: [],
30838
+ stateMutability: "nonpayable",
30839
+ type: "function"
30840
+ },
30841
+ {
30842
+ inputs: [
30843
+ {
30844
+ internalType: "bytes32[]",
30845
+ name: "_intentHashes",
30846
+ type: "bytes32[]"
30847
+ }
30848
+ ],
30849
+ name: "releaseMaturedPositions",
30850
+ outputs: [],
30851
+ stateMutability: "nonpayable",
30852
+ type: "function"
30853
+ }
30854
+ ];
30585
30855
  var STAKE_VAULT_ABI = [
30586
30856
  {
30587
30857
  inputs: [
@@ -32742,6 +33012,16 @@ var baseStagingOrchestratorV2Override = resolveRuntimeAddressOverride([
32742
33012
  "VITE_ORCHESTRATORV2_ADDRESS"
32743
33013
  ]);
32744
33014
  var baseStagingOrchestratorV2 = baseStagingOrchestratorV2Override ?? pickAddress(baseStagingContracts, ["OrchestratorV2", "Orchestrator_V2"]) ?? "";
33015
+ var ORCHESTRATOR_V3_ADDRESS_BASE_STAGING = "0x79dE2123eE792e77165b2E6E65A54B745E8A734E";
33016
+ var RISK_MANAGER_ADDRESS_BASE_STAGING = "0x57E4b9046EA5ABCe1fc688b77D846aE67222b998";
33017
+ var baseStagingOrchestratorV3 = resolveRuntimeAddressOverride([
33018
+ "VITE_BASE_STAGING_ORCHESTRATOR_V3_ADDRESS",
33019
+ "VITE_ORCHESTRATOR_V3_ADDRESS"
33020
+ ]) ?? pickAddress(baseStagingContracts, ["OrchestratorV3"]) ?? ORCHESTRATOR_V3_ADDRESS_BASE_STAGING;
33021
+ var baseStagingRiskManager = resolveRuntimeAddressOverride([
33022
+ "VITE_BASE_STAGING_RISK_MANAGER_ADDRESS",
33023
+ "VITE_RISK_MANAGER_ADDRESS"
33024
+ ]) ?? pickAddress(baseStagingContracts, ["RiskManager"]) ?? RISK_MANAGER_ADDRESS_BASE_STAGING;
32745
33025
  var STAKE_VAULT_ADDRESS_BASE_STAGING = "0x5c570D2be2bFD8960B2B9F8d2D3C8148A1e24C5f";
32746
33026
  var baseStagingStakeVaultOverride = resolveRuntimeAddressOverride([
32747
33027
  "VITE_BASE_STAGING_STAKE_VAULT_ADDRESS",
@@ -32749,9 +33029,13 @@ var baseStagingStakeVaultOverride = resolveRuntimeAddressOverride([
32749
33029
  ]);
32750
33030
  var baseStagingStakeVault = baseStagingStakeVaultOverride ?? pickAddress(baseStagingContracts, ["StakeVault"]) ?? STAKE_VAULT_ADDRESS_BASE_STAGING;
32751
33031
  var baseStakeVault = pickAddress(baseContracts, ["StakeVault"]);
33032
+ var baseOrchestratorV3 = pickAddress(baseContracts, ["OrchestratorV3"]);
33033
+ var baseRiskManager = pickAddress(baseContracts, ["RiskManager"]);
32752
33034
  var baseEscrowV2Abi = pickAbi(baseAbiRecord, ["EscrowV2"]);
32753
33035
  var baseProtocolViewerV2Abi = pickAbi(baseAbiRecord, ["ProtocolViewerV2"]);
32754
33036
  var baseOrchestratorV2Abi = pickAbi(baseAbiRecord, ["OrchestratorV2"]);
33037
+ var baseOrchestratorV3Abi = pickAbi(baseAbiRecord, ["OrchestratorV3"]) ?? ORCHESTRATOR_V3_ABI;
33038
+ var baseRiskManagerAbi = pickAbi(baseAbiRecord, ["RiskManager"]) ?? RISK_MANAGER_ABI;
32755
33039
  var baseRateManagerV1Abi = pickAbi(baseAbiRecord, [
32756
33040
  "RateManagerV1",
32757
33041
  "DepositRateManagerRegistryV1"
@@ -32773,7 +33057,11 @@ var contractAddressesV2 = {
32773
33057
  indexedEscrowAddresses: uniqueAddresses(baseEscrowV2),
32774
33058
  orchestrator: baseOrchestratorV2,
32775
33059
  orchestratorV2: baseOrchestratorV2,
32776
- orchestratorAddresses: uniqueAddresses(baseOrchestratorV2),
33060
+ orchestratorV3: baseOrchestratorV3,
33061
+ orchestratorAddresses: uniqueAddresses(
33062
+ baseOrchestratorV2,
33063
+ baseOrchestratorV3
33064
+ ),
32777
33065
  unifiedPaymentVerifier: pickAddress(baseContracts, [
32778
33066
  "UnifiedPaymentVerifier",
32779
33067
  "UnifiedPaymentVerifierV2"
@@ -32801,7 +33089,8 @@ var contractAddressesV2 = {
32801
33089
  signatureGatingPreIntentHook: pickAddress(baseContracts, [
32802
33090
  "SignatureGatingPreIntentHook"
32803
33091
  ]),
32804
- stakeVault: baseStakeVault
33092
+ stakeVault: baseStakeVault,
33093
+ riskManager: baseRiskManager
32805
33094
  }
32806
33095
  };
32807
33096
  var contractAddressesV2ByEnv = {
@@ -32812,7 +33101,11 @@ var contractAddressesV2ByEnv = {
32812
33101
  indexedEscrowAddresses: uniqueAddresses(baseStagingEscrowV2),
32813
33102
  orchestrator: baseStagingOrchestratorV2,
32814
33103
  orchestratorV2: baseStagingOrchestratorV2,
32815
- orchestratorAddresses: uniqueAddresses(baseStagingOrchestratorV2),
33104
+ orchestratorV3: baseStagingOrchestratorV3,
33105
+ orchestratorAddresses: uniqueAddresses(
33106
+ baseStagingOrchestratorV2,
33107
+ baseStagingOrchestratorV3
33108
+ ),
32816
33109
  unifiedPaymentVerifier: pickAddress(baseStagingContracts, [
32817
33110
  "UnifiedPaymentVerifier",
32818
33111
  "UnifiedPaymentVerifierV2"
@@ -32839,7 +33132,8 @@ var contractAddressesV2ByEnv = {
32839
33132
  signatureGatingPreIntentHook: pickAddress(baseStagingContracts, [
32840
33133
  "SignatureGatingPreIntentHook"
32841
33134
  ]),
32842
- stakeVault: baseStagingStakeVault
33135
+ stakeVault: baseStagingStakeVault,
33136
+ riskManager: baseStagingRiskManager
32843
33137
  }
32844
33138
  };
32845
33139
  var contractAbisV2 = {
@@ -32848,6 +33142,7 @@ var contractAbisV2 = {
32848
33142
  escrowV2: baseEscrowV2Abi ?? Escrow_default2,
32849
33143
  orchestrator: Orchestrator_default2,
32850
33144
  orchestratorV2: baseOrchestratorV2Abi ?? Orchestrator_default2,
33145
+ orchestratorV3: baseOrchestratorV3Abi,
32851
33146
  unifiedPaymentVerifier: UnifiedPaymentVerifier_default2,
32852
33147
  unifiedPaymentVerifierV2: pickAbi(baseAbiRecord, [
32853
33148
  "UnifiedPaymentVerifierV2"
@@ -32858,7 +33153,8 @@ var contractAbisV2 = {
32858
33153
  rateManagerRegistry: baseRateManagerV1Abi,
32859
33154
  whitelistPreIntentHook: baseWhitelistPreIntentHookAbi,
32860
33155
  signatureGatingPreIntentHook: baseSignatureGatingPreIntentHookAbi,
32861
- stakeVault: pickAbi(baseAbiRecord, ["StakeVault"]) ?? STAKE_VAULT_ABI
33156
+ stakeVault: pickAbi(baseAbiRecord, ["StakeVault"]) ?? STAKE_VAULT_ABI,
33157
+ riskManager: baseRiskManagerAbi
32862
33158
  }
32863
33159
  };
32864
33160
  var EscrowBaseStaging = Escrow_default;
@@ -32871,6 +33167,12 @@ var EscrowV2BaseStaging = pickAbi(baseStagingAbiRecord, ["EscrowV2"]) ?? EscrowB
32871
33167
  var OrchestratorV2BaseStaging = pickAbi(baseStagingAbiRecord, [
32872
33168
  "OrchestratorV2"
32873
33169
  ]) ?? OrchestratorBaseStaging;
33170
+ var OrchestratorV3BaseStaging = pickAbi(baseStagingAbiRecord, [
33171
+ "OrchestratorV3"
33172
+ ]) ?? ORCHESTRATOR_V3_ABI;
33173
+ var RiskManagerBaseStaging = pickAbi(baseStagingAbiRecord, [
33174
+ "RiskManager"
33175
+ ]) ?? RISK_MANAGER_ABI;
32874
33176
  var RateManagerV1BaseStaging = pickAbi(baseStagingAbiRecord, [
32875
33177
  "RateManagerV1",
32876
33178
  "DepositRateManagerRegistryV1"
@@ -32896,6 +33198,7 @@ var contractAbisV2ByEnv = {
32896
33198
  escrowV2: EscrowV2BaseStaging,
32897
33199
  orchestrator: OrchestratorBaseStaging,
32898
33200
  orchestratorV2: OrchestratorV2BaseStaging,
33201
+ orchestratorV3: OrchestratorV3BaseStaging,
32899
33202
  unifiedPaymentVerifier: UnifiedPaymentVerifierBaseStaging,
32900
33203
  unifiedPaymentVerifierV2: UnifiedPaymentVerifierV2BaseStaging,
32901
33204
  protocolViewer: ProtocolViewerBaseStaging,
@@ -32905,7 +33208,8 @@ var contractAbisV2ByEnv = {
32905
33208
  rateManagerController: DepositRateManagerControllerBaseStaging,
32906
33209
  whitelistPreIntentHook: WhitelistPreIntentHookBaseStaging,
32907
33210
  signatureGatingPreIntentHook: SignatureGatingPreIntentHookBaseStaging,
32908
- stakeVault: pickAbi(baseStagingAbiRecord, ["StakeVault"]) ?? STAKE_VAULT_ABI
33211
+ stakeVault: pickAbi(baseStagingAbiRecord, ["StakeVault"]) ?? STAKE_VAULT_ABI,
33212
+ riskManager: RiskManagerBaseStaging
32909
33213
  }
32910
33214
  };
32911
33215
  var v2PaymentMethods = {
@@ -32942,9 +33246,15 @@ function getV21Resolution(options) {
32942
33246
  const orchestratorV2Address = resolvedAddresses.orchestratorV2 ?? resolvedAddresses.orchestrator;
32943
33247
  const orchestratorAddress = orchestratorV2Address;
32944
33248
  const orchestratorV2Abi = resolvedAbis.orchestratorV2 ?? resolvedAbis.orchestrator;
33249
+ const orchestratorV3Address = (isStaging ? resolveRuntimeAddressOverride([
33250
+ "VITE_BASE_STAGING_ORCHESTRATOR_V3_ADDRESS",
33251
+ "VITE_ORCHESTRATOR_V3_ADDRESS"
33252
+ ]) : void 0) ?? resolvedAddresses.orchestratorV3;
33253
+ const orchestratorV3Abi = resolvedAbis.orchestratorV3;
32945
33254
  const orchestratorAbi = orchestratorV2Abi ?? resolvedAbis.orchestrator;
32946
33255
  const orchestratorAddresses = uniqueAddresses(
32947
33256
  orchestratorV2Address,
33257
+ orchestratorV3Address,
32948
33258
  ...resolvedAddresses.orchestratorAddresses ?? []
32949
33259
  );
32950
33260
  const unifiedPaymentVerifierV2Address = resolvedAddresses.unifiedPaymentVerifierV2 ?? resolvedAddresses.unifiedPaymentVerifier;
@@ -32964,8 +33274,16 @@ function getV21Resolution(options) {
32964
33274
  const signatureGatingPreIntentHookAddress = resolvedAddresses.signatureGatingPreIntentHook;
32965
33275
  const whitelistPreIntentHookAbi = resolvedAbis.whitelistPreIntentHook;
32966
33276
  const signatureGatingPreIntentHookAbi = resolvedAbis.signatureGatingPreIntentHook;
32967
- const stakeVaultAddress = resolvedAddresses.stakeVault;
33277
+ const stakeVaultAddress = (isStaging ? resolveRuntimeAddressOverride([
33278
+ "VITE_BASE_STAGING_STAKE_VAULT_ADDRESS",
33279
+ "VITE_STAKE_VAULT_ADDRESS"
33280
+ ]) : void 0) ?? resolvedAddresses.stakeVault;
32968
33281
  const stakeVaultAbi = resolvedAbis.stakeVault;
33282
+ const riskManagerAddress = (isStaging ? resolveRuntimeAddressOverride([
33283
+ "VITE_BASE_STAGING_RISK_MANAGER_ADDRESS",
33284
+ "VITE_RISK_MANAGER_ADDRESS"
33285
+ ]) : void 0) ?? resolvedAddresses.riskManager;
33286
+ const riskManagerAbi = resolvedAbis.riskManager;
32969
33287
  const usdcAddress = resolvedAddresses.usdc;
32970
33288
  const paymentMethods = isStaging ? v2PaymentMethods.base_staging.methods : v2PaymentMethods.base.methods;
32971
33289
  return {
@@ -32983,6 +33301,8 @@ function getV21Resolution(options) {
32983
33301
  orchestratorAddresses,
32984
33302
  orchestratorV2Address,
32985
33303
  orchestratorV2Abi,
33304
+ orchestratorV3Address,
33305
+ orchestratorV3Abi,
32986
33306
  unifiedPaymentVerifierAddress,
32987
33307
  unifiedPaymentVerifierV2Address,
32988
33308
  unifiedPaymentVerifierAbi,
@@ -33002,6 +33322,8 @@ function getV21Resolution(options) {
33002
33322
  signatureGatingPreIntentHookAbi,
33003
33323
  stakeVaultAddress,
33004
33324
  stakeVaultAbi,
33325
+ riskManagerAddress,
33326
+ riskManagerAbi,
33005
33327
  usdcAddress,
33006
33328
  paymentMethods
33007
33329
  };
@@ -73345,6 +73667,15 @@ var baseStaging_default7 = {
73345
73667
  };
73346
73668
 
73347
73669
  // src/contracts.ts
73670
+ var ORCHESTRATOR_V3_ABI2 = ORCHESTRATOR_V3_ABI;
73671
+ var RISK_MANAGER_ABI2 = RISK_MANAGER_ABI;
73672
+ var STAKE_VAULT_ABI2 = STAKE_VAULT_ABI;
73673
+ var RISK_POSITION_SETTLED_EVENT_ABI = RISK_MANAGER_ABI.filter(
73674
+ (entry) => entry.type === "event" && entry.name === "RiskPositionSettled"
73675
+ );
73676
+ var DEFERRED_PAYOUT_RECORDED_EVENT_ABI = STAKE_VAULT_ABI.filter(
73677
+ (entry) => entry.type === "event" && entry.name === "DeferredPayoutRecorded"
73678
+ );
73348
73679
  function unwrapAddresses(mod) {
73349
73680
  if (!mod) return {};
73350
73681
  const m = mod;
@@ -73476,8 +73807,10 @@ function getContracts(chainId, env = "production") {
73476
73807
  escrowAddresses: uniqueAddresses2(pickAddress2(baseContracts2, ["EscrowV2", "Escrow_V2"])),
73477
73808
  orchestrator: pickAddress2(baseContracts2, ["OrchestratorV2", "Orchestrator_V2"]),
73478
73809
  orchestratorV2: pickAddress2(baseContracts2, ["OrchestratorV2", "Orchestrator_V2"]),
73810
+ orchestratorV3: isValidAddress2(coreResolution.orchestratorV3Address) ? coreResolution.orchestratorV3Address : void 0,
73479
73811
  orchestratorAddresses: uniqueAddresses2(
73480
- pickAddress2(baseContracts2, ["OrchestratorV2", "Orchestrator_V2"])
73812
+ pickAddress2(baseContracts2, ["OrchestratorV2", "Orchestrator_V2"]),
73813
+ isValidAddress2(coreResolution.orchestratorV3Address) ? coreResolution.orchestratorV3Address : void 0
73481
73814
  ),
73482
73815
  unifiedPaymentVerifier: pickAddress2(baseContracts2, [
73483
73816
  "UnifiedPaymentVerifierV2",
@@ -73496,7 +73829,8 @@ function getContracts(chainId, env = "production") {
73496
73829
  rateManagerController: pickAddress2(baseContracts2, ["DepositRateManagerController"]),
73497
73830
  chainlinkOracleAdapter: pickAddress2(baseContracts2, ["ChainlinkOracleAdapter"]),
73498
73831
  pythOracleAdapter: pickAddress2(baseContracts2, ["PythOracleAdapter"]),
73499
- stakeVault: stakeVaultAddress
73832
+ stakeVault: stakeVaultAddress,
73833
+ riskManager: isValidAddress2(coreResolution.riskManagerAddress) ? coreResolution.riskManagerAddress : void 0
73500
73834
  }
73501
73835
  };
73502
73836
  const abisByKey = {
@@ -73507,6 +73841,7 @@ function getContracts(chainId, env = "production") {
73507
73841
  orchestratorV2: pickAbi2(base_exports2, [
73508
73842
  "OrchestratorV2"
73509
73843
  ]) ?? Orchestrator_default5,
73844
+ orchestratorV3: coreResolution.orchestratorV3Abi ?? ORCHESTRATOR_V3_ABI2,
73510
73845
  unifiedPaymentVerifier: pickAbi2(base_exports2, [
73511
73846
  "UnifiedPaymentVerifierV2"
73512
73847
  ]) ?? UnifiedPaymentVerifier_default5,
@@ -73528,7 +73863,8 @@ function getContracts(chainId, env = "production") {
73528
73863
  rateManagerController: pickAbi2(base_exports2, [
73529
73864
  "DepositRateManagerController"
73530
73865
  ]),
73531
- stakeVault: coreResolution.stakeVaultAbi
73866
+ stakeVault: coreResolution.stakeVaultAbi,
73867
+ riskManager: coreResolution.riskManagerAbi ?? RISK_MANAGER_ABI2
73532
73868
  }
73533
73869
  };
73534
73870
  if (env === "staging") {
@@ -73544,6 +73880,7 @@ function getContracts(chainId, env = "production") {
73544
73880
  "VITE_ORCHESTRATORV2_ADDRESS"
73545
73881
  ]);
73546
73882
  const stagingOrchestratorCurrent = stagingOrchestratorV2Override ?? pickAddress2(sc, ["OrchestratorV2", "Orchestrator_V2"]);
73883
+ const stagingOrchestratorV3 = isValidAddress2(coreResolution.orchestratorV3Address) ? coreResolution.orchestratorV3Address : void 0;
73547
73884
  const stagingRateManagerV1 = pickAddress2(sc, ["RateManagerV1", "DepositRateManagerRegistryV1"]);
73548
73885
  return {
73549
73886
  addresses: {
@@ -73552,7 +73889,8 @@ function getContracts(chainId, env = "production") {
73552
73889
  escrowAddresses: uniqueAddresses2(stagingEscrowCurrent),
73553
73890
  orchestrator: stagingOrchestratorCurrent,
73554
73891
  orchestratorV2: stagingOrchestratorCurrent,
73555
- orchestratorAddresses: uniqueAddresses2(stagingOrchestratorCurrent),
73892
+ orchestratorV3: stagingOrchestratorV3,
73893
+ orchestratorAddresses: uniqueAddresses2(stagingOrchestratorCurrent, stagingOrchestratorV3),
73556
73894
  unifiedPaymentVerifier: pickAddress2(sc, [
73557
73895
  "UnifiedPaymentVerifierV2",
73558
73896
  "UnifiedPaymentVerifier"
@@ -73577,7 +73915,8 @@ function getContracts(chainId, env = "production") {
73577
73915
  rateManagerController: pickAddress2(sc, ["DepositRateManagerController"]),
73578
73916
  chainlinkOracleAdapter: pickAddress2(sc, ["ChainlinkOracleAdapter"]),
73579
73917
  pythOracleAdapter: pickAddress2(sc, ["PythOracleAdapter"]),
73580
- stakeVault: stakeVaultAddress
73918
+ stakeVault: stakeVaultAddress,
73919
+ riskManager: isValidAddress2(coreResolution.riskManagerAddress) ? coreResolution.riskManagerAddress : void 0
73581
73920
  },
73582
73921
  abis: {
73583
73922
  escrow: Escrow_default6,
@@ -73588,6 +73927,7 @@ function getContracts(chainId, env = "production") {
73588
73927
  orchestratorV2: pickAbi2(baseStaging_exports2, [
73589
73928
  "OrchestratorV2"
73590
73929
  ]) ?? Orchestrator_default6,
73930
+ orchestratorV3: coreResolution.orchestratorV3Abi ?? ORCHESTRATOR_V3_ABI2,
73591
73931
  unifiedPaymentVerifier: pickAbi2(baseStaging_exports2, [
73592
73932
  "UnifiedPaymentVerifierV2"
73593
73933
  ]) ?? UnifiedPaymentVerifier_default6,
@@ -73612,7 +73952,8 @@ function getContracts(chainId, env = "production") {
73612
73952
  rateManagerController: pickAbi2(baseStaging_exports2, [
73613
73953
  "DepositRateManagerController"
73614
73954
  ]),
73615
- stakeVault: coreResolution.stakeVaultAbi
73955
+ stakeVault: coreResolution.stakeVaultAbi,
73956
+ riskManager: coreResolution.riskManagerAbi ?? RISK_MANAGER_ABI2
73616
73957
  }
73617
73958
  };
73618
73959
  }
@@ -73662,6 +74003,20 @@ function getStakeVaultContract(chainId, env = "production") {
73662
74003
  stakeToken: addresses.usdc
73663
74004
  };
73664
74005
  }
74006
+ function getOrchestratorV3Contract(chainId, env = "production") {
74007
+ const { addresses, abis } = getContracts(chainId, env);
74008
+ if (!addresses.orchestratorV3 || !abis.orchestratorV3) {
74009
+ throw new Error(`OrchestratorV3 not available for chainId=${chainId}, env=${env}`);
74010
+ }
74011
+ return { address: addresses.orchestratorV3, abi: abis.orchestratorV3 };
74012
+ }
74013
+ function getRiskManagerContract(chainId, env = "production") {
74014
+ const { addresses, abis } = getContracts(chainId, env);
74015
+ if (!addresses.riskManager || !abis.riskManager) {
74016
+ throw new Error(`RiskManager not available for chainId=${chainId}, env=${env}`);
74017
+ }
74018
+ return { address: addresses.riskManager, abi: abis.riskManager };
74019
+ }
73665
74020
  function ensureBytes32(value, { hashIfAscii = false } = {}) {
73666
74021
  if (value.startsWith("0x")) {
73667
74022
  const bytes = hexToBytes(value);
@@ -74006,6 +74361,6 @@ function enrichPvIntentView(view, chainId, env = "production") {
74006
74361
  };
74007
74362
  }
74008
74363
 
74009
- export { METHOD_NAME_TO_HASH, PAYMENT_PLATFORMS, SUPPORTED_PAYMENT_METHOD_HASHES, asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getGatingServiceAddress, getPaymentMethodsCatalog, getRateManagerContracts, getStakeVaultContract, matchesPaymentMethodNameAndHash, matchesQuotePaymentMethod, parseBigIntLike, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash };
74010
- //# sourceMappingURL=chunk-7M37EVN5.mjs.map
74011
- //# sourceMappingURL=chunk-7M37EVN5.mjs.map
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-NKEAAPPR.mjs.map
74366
+ //# sourceMappingURL=chunk-NKEAAPPR.mjs.map