@gvnrdao/dh-sdk 0.0.317 → 0.0.319

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/dist/index.js CHANGED
@@ -94,11 +94,11 @@ var init_deployment_addresses = __esm({
94
94
  },
95
95
  upgraded: {
96
96
  PositionManager: {
97
- previousImplementation: "0x3a493909920DF104D4048c2c20270B9DAFC81716",
98
- newImplementation: "0x607a80aee6eF425C7eC7bA5230E5FAFC95B0388F",
99
- upgradedAt: "2026-07-23T23:55:25.994Z",
97
+ previousImplementation: "0xb1885Be99BA64Bba773Bf423783A0334B7109409",
98
+ newImplementation: "0xfA7413a4547F496BF223ed25DF443c17ef6D4668",
99
+ upgradedAt: "2026-07-30T17:55:25.314Z",
100
100
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
101
- reason: "Shared upgrade script: PositionManager implementation update"
101
+ reason: "Add setViews escape hatch so PositionManagerViews can be repointed (mainnet Views is a frozen non-proxy)"
102
102
  },
103
103
  LoanOperationsManagerModule: {
104
104
  previousImplementation: "0x8c20e9Edf44146718F2EF15eEF47A201CaC229B8",
@@ -122,16 +122,16 @@ var init_deployment_addresses = __esm({
122
122
  reason: "Shared upgrade script: TermManagerModule implementation update"
123
123
  },
124
124
  CircuitBreakerModule: {
125
- previousImplementation: "0xA5b11b895fB5a49731ab81BF9FC807b9029c8C98",
126
- newImplementation: "0xF6277dEF72D51312CC99616B5380f34Eb7603D75",
127
- upgradedAt: "2026-05-17T19:22:13.051Z",
125
+ previousImplementation: "0xF6277dEF72D51312CC99616B5380f34Eb7603D75",
126
+ newImplementation: "0x4b28F1d4ecBcc13b51a8d0f890e6d5bF4966EEB4",
127
+ upgradedAt: "2026-07-30T09:28:12.835Z",
128
128
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
129
129
  reason: "Shared upgrade script: CircuitBreakerModule implementation update"
130
130
  },
131
131
  AdminModule: {
132
- previousImplementation: "0xF94A1801Fcc416e621Ae83B8030D1fE08b2DeB41",
133
- newImplementation: "0xBBA86246169f81a307Fafff02C1e3D8456aab973",
134
- upgradedAt: "2026-05-18T21:20:49.009Z",
132
+ previousImplementation: "0xBBA86246169f81a307Fafff02C1e3D8456aab973",
133
+ newImplementation: "0x2905964e27BD78595cf8fFa6FFc5A99E54F399c4",
134
+ upgradedAt: "2026-07-30T09:02:25.915Z",
135
135
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
136
136
  reason: "Shared upgrade script: AdminModule implementation update"
137
137
  },
@@ -192,21 +192,18 @@ var init_deployment_addresses = __esm({
192
192
  reason: "Shared upgrade script: SimplePSMV2 implementation update"
193
193
  },
194
194
  UpgradeValidator: {
195
- previousImplementation: "0x535c9d66F9CFa4f2337cF6074BFc8fdcBBb9cFC4",
196
- newImplementation: "0x2Dd375041Be067E7d12bAB2106911Ce209EbD12f",
197
- upgradedAt: "2026-05-17T15:58:37.805Z",
195
+ previousImplementation: "0x2Dd375041Be067E7d12bAB2106911Ce209EbD12f",
196
+ newImplementation: "0x9E70e1D07AB11ac9dD37B67AA091Efe97d7Ed84b",
197
+ upgradedAt: "2026-07-30T09:32:13.726Z",
198
198
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
199
199
  reason: "Shared upgrade script: UpgradeValidator implementation update"
200
200
  },
201
201
  LITActionValidator: {
202
- proxy: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
203
- previousImplementation: "0xc71935a9B7A54e9D1FD266ab4D216644974A154d",
204
- implementation: "0xE2f99EA35b4DA01A66338427EC9077581d28FDb5",
205
- version: "2.3.0",
206
- upgradedAt: "2026-05-18T21:30:13.008Z",
202
+ previousImplementation: "0xE2f99EA35b4DA01A66338427EC9077581d28FDb5",
203
+ newImplementation: "0x8FF30Fab0cC09C67dF6DF0ee017f817d5B101457",
204
+ upgradedAt: "2026-07-30T09:30:13.928Z",
207
205
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
208
- upgradeTx: "0xf287387ea7190138d0fd183d9381d8c051d3521569bb9d0e7d6c3dcb46d65964",
209
- note: "M-03: removed validateLITActionSignature, LIT_PROTOCOL_ROLE, isValidatedPKP, getValidationProof, helpers"
206
+ reason: "Shared upgrade script: LITActionValidator implementation update"
210
207
  },
211
208
  ContractVersionRegistry: {
212
209
  previousImplementation: "0x327Ced106C2804283994F0C0e2436E4B76AA7dAD",
@@ -216,11 +213,11 @@ var init_deployment_addresses = __esm({
216
213
  reason: "Shared upgrade script: ContractVersionRegistry implementation update"
217
214
  },
218
215
  PositionDelegateRegistry: {
219
- previousImplementation: "0xAE227De03D5aeDC870d6e096D9C6652E001a92aF",
220
- newImplementation: "0x301fa9AA527016D033e151b982C64cD8670a39E3",
221
- upgradedAt: "2026-05-17T16:00:25.211Z",
216
+ previousImplementation: "0x301fa9AA527016D033e151b982C64cD8670a39E3",
217
+ newImplementation: "0xc681c48688cdAA966119E265e4a378ef8Fe0eBcA",
218
+ upgradedAt: "2026-07-30T09:02:27.050Z",
222
219
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
223
- reason: "Shared upgrade script: PositionDelegateRegistry implementation update"
220
+ reason: "Reconciled implementation from chain"
224
221
  },
225
222
  OperationAuthorizationRegistry: {
226
223
  previousImplementation: "0xF56090039c268B90f1867075813B5B36C40092B4",
@@ -230,18 +227,18 @@ var init_deployment_addresses = __esm({
230
227
  reason: "Shared upgrade script: OperationAuthorizationRegistry implementation update"
231
228
  },
232
229
  FeeRecipientRegistry: {
233
- previousImplementation: "0x974a0f64d572a4F4e1395aaeB22d1c2685D22459",
234
- newImplementation: "0xd08513a7cB2dd354B26cDDf549616F12054c34c9",
235
- upgradedAt: "2026-05-15T17:52:37.448Z",
230
+ previousImplementation: "0xd08513a7cB2dd354B26cDDf549616F12054c34c9",
231
+ newImplementation: "0x44057f5Ca13B1C3a74E5507c372704F3c8c5834f",
232
+ upgradedAt: "2026-07-30T09:23:25.934Z",
236
233
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
237
- reason: "Shared upgrade script: FeeRecipientRegistry v1.1.0 \u2014 _authorizeUpgrade gated by onlyAdminModule + AccessControlEnumerable base"
234
+ reason: "Shared upgrade script: FeeRecipientRegistry implementation update"
238
235
  },
239
236
  BitcoinProviderRegistry: {
240
- previousImplementation: "0x225309A4ae6D146ba93A3278A7b40224FfC81448",
241
- newImplementation: "0xc5899d53426aD9354CEdAFe3002cbd3aBfAC46ab",
242
- upgradedAt: "2026-05-27T12:16:13.356Z",
237
+ previousImplementation: "0xc5899d53426aD9354CEdAFe3002cbd3aBfAC46ab",
238
+ newImplementation: "0x37A8D9a57f9dEa7ae7D5B7BC7B1BB61a80960eB7",
239
+ upgradedAt: "2026-07-30T09:26:01.725Z",
243
240
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
244
- reason: "Audit C-7: BitcoinProviderRegistry v1.0.0 \u2192 v1.1.0 \u2014 per-chainId CID allowlist (addAllowedCid / removeAllowedCid / isAllowedCid views). Storage gap 46 \u2192 43."
241
+ reason: "Shared upgrade script: BitcoinProviderRegistry implementation update"
245
242
  },
246
243
  BitcoinWithdrawalAddressRegistry: {
247
244
  previousImplementation: "0xFF270BC4470dBA80430Bd1a3a66EB691599354fA",
@@ -320,27 +317,27 @@ var init_deployment_addresses = __esm({
320
317
  UCD_CONTROLLER_IMPL: "0x91204831bBCfcDCEa5fEE09B0d875778E9651690",
321
318
  LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "0x6Ad08177F264f441074921C437670D1fA5934676",
322
319
  TERM_MANAGER_MODULE_IMPL: "0xA2D6543faFA9d84C16Cd5e5E34F746B6e138F54d",
323
- CIRCUIT_BREAKER_MODULE_IMPL: "0xF6277dEF72D51312CC99616B5380f34Eb7603D75",
324
- ADMIN_MODULE_IMPL: "0xBBA86246169f81a307Fafff02C1e3D8456aab973",
320
+ CIRCUIT_BREAKER_MODULE_IMPL: "0x4b28F1d4ecBcc13b51a8d0f890e6d5bF4966EEB4",
321
+ ADMIN_MODULE_IMPL: "0x2905964e27BD78595cf8fFa6FFc5A99E54F399c4",
325
322
  POSITION_MANAGER_VIEWS_IMPL: "0xA455B542cFb36AF8451fc420dB89e590E5c87cef",
326
- POSITION_MANAGER_IMPL: "0x607a80aee6eF425C7eC7bA5230E5FAFC95B0388F",
323
+ POSITION_MANAGER_IMPL: "0xfA7413a4547F496BF223ed25DF443c17ef6D4668",
327
324
  SIMPLE_PSM_V2: "0x19EcF7BA26e054fd4Ff06009A03070103dbBB058",
328
325
  SIMPLE_PSM_V2_IMPL: "0xE38010BE47B389922A1cd4b533470F0af7d20101",
329
326
  UCD_TOKEN_IMPL: "0xa6C8C4cfc7DD3dCE5F1259A4a1eAf8461aA8CeC8",
330
327
  POSITION_MANAGER_CORE_MODULE: "0xfFAA39a08887FeFB697eBC8691A8630CbCC33391",
331
328
  POSITION_MANAGER_CORE_MODULE_IMPL: "0x0E721048c066C5589C41f97785f7E5737ac2BEB3",
332
329
  COLLATERAL_MANAGER_MODULE: "0x967E92c976Fc0fa8268D37D4d6B7245d912aA7dB",
333
- COLLATERAL_MANAGER_MODULE_IMPL: "0xC232E95951303828CF66eaf76181A7956144d27a",
330
+ COLLATERAL_MANAGER_MODULE_IMPL: "0xF57BBbb4818371605e308228A04F8Ec4Dcc5E7Ba",
334
331
  LIQUIDATION_MANAGER_MODULE: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
335
332
  LIQUIDATION_MANAGER_MODULE_IMPL: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
336
333
  BTC_SPEND_AUTHORIZER: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
337
334
  BTC_SPEND_AUTHORIZER_IMPL: "0xdd3DFaEc50d6214d57eA64e8b76ff318b501607b",
338
335
  UPGRADE_VALIDATOR: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
339
- UPGRADE_VALIDATOR_IMPL: "0x2Dd375041Be067E7d12bAB2106911Ce209EbD12f",
336
+ UPGRADE_VALIDATOR_IMPL: "0x9E70e1D07AB11ac9dD37B67AA091Efe97d7Ed84b",
340
337
  BITCOIN_PROVIDER_REGISTRY: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
341
- BITCOIN_PROVIDER_REGISTRY_IMPL: "0xc5899d53426aD9354CEdAFe3002cbd3aBfAC46ab",
338
+ BITCOIN_PROVIDER_REGISTRY_IMPL: "0x37A8D9a57f9dEa7ae7D5B7BC7B1BB61a80960eB7",
342
339
  LIT_ACTION_VALIDATOR: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
343
- LIT_ACTION_VALIDATOR_IMPL: "0xE2f99EA35b4DA01A66338427EC9077581d28FDb5",
340
+ LIT_ACTION_VALIDATOR_IMPL: "0x8FF30Fab0cC09C67dF6DF0ee017f817d5B101457",
344
341
  CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
345
342
  CONTRACT_VERSION_REGISTRY_IMPL: "0xF3389De4bCeC735e4F6d35b9f71170D96037D1B7",
346
343
  MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
@@ -349,10 +346,10 @@ var init_deployment_addresses = __esm({
349
346
  POSITION_DELEGATE_REGISTRY_IMPL: "0xc681c48688cdAA966119E265e4a378ef8Fe0eBcA",
350
347
  AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
351
348
  FEE_RECIPIENT_REGISTRY: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
352
- FEE_RECIPIENT_REGISTRY_IMPL: "0xd08513a7cB2dd354B26cDDf549616F12054c34c9",
349
+ FEE_RECIPIENT_REGISTRY_IMPL: "0x44057f5Ca13B1C3a74E5507c372704F3c8c5834f",
353
350
  OPERATION_AUTHORIZATION_REGISTRY_IMPL: "0xe0D981B60351f0f8fFDA2b50C8180Fb37CeF3883",
354
351
  BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
355
- BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY_IMPL: "0xFF270BC4470dBA80430Bd1a3a66EB691599354fA",
352
+ BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY_IMPL: "0x76E0a2c9d89562fD7c50b5f554d7fa25957e39Db",
356
353
  CARRY_AGENT_REGISTRY: "0x5595CB538D44E6Cf179D20364fD631D0477e69f7",
357
354
  CARRY_AGENT_REGISTRY_IMPL: "0x1b11a3D5e46F3672E643c997f0d569DFf0b64a01",
358
355
  AGENT_DELEGATION_REGISTRY: "0x6AE7fc6bE0925126b9D25b1B7Ce5AD5d127ec025",
@@ -409,7 +406,7 @@ var init_deployment_addresses = __esm({
409
406
  LiquidationManagerModule: "0x74B28695352E7bf736D6c9F76ccb7B4439477De9",
410
407
  CircuitBreakerModule: "0xF7b545d3a4Ee056D06909AB367E2F7bFFE3cB1BC",
411
408
  AdminModule: "0x0023B71B586795eE5fa4E83E384345C1EC8Bb946",
412
- PositionManagerViews: "0x9225647a30bbACA4Acc0491B786869036914242e",
409
+ PositionManagerViews: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
413
410
  PositionManager: "0x12A1836e56139ccaD8722B89519d84233efc224B",
414
411
  OperationAuthorizationRegistry: "0xD4505645b724754f5170a2027804a4265e860d44",
415
412
  ContractVersionRegistry: "0x5e18f77d01940dA5B1D986D373D9A6ad0767008d",
@@ -418,7 +415,9 @@ var init_deployment_addresses = __esm({
418
415
  BitcoinProviderRegistry: "0x4ab3Fb96e02893Ed6FAa61bad1918390c8DbbFFC",
419
416
  BitcoinWithdrawalAddressRegistry: "0xf667f77FDba7458345f227eB6Bfe4148243E7270",
420
417
  SimplePSMV2: "0xfE0C14B4E614f40Bf58845b4B04CeD17fd116532",
421
- PKPValidation: "0x29922d3ccb86516f6C24F89f1eb3068655ca7Fa0"
418
+ PKPValidation: "0x29922d3ccb86516f6C24F89f1eb3068655ca7Fa0",
419
+ AgentDelegationRegistry: "0x54853b7E91ce2Be34ce65655D80c4447e67187Fa",
420
+ DHAgentDelegate: "0x70232d0caBe529e29a01A442423d7e03BBd414c8"
422
421
  },
423
422
  upgraded: {
424
423
  SimplePSMV2: {
@@ -433,16 +432,20 @@ var init_deployment_addresses = __esm({
433
432
  CollateralManagerModule: {
434
433
  previousImplementation: "0x1919860e528Cd2AbbD31a17858c986b8aCc8C185",
435
434
  newImplementation: "0x55110B9dd6B2c9f812564e7a1ef42b3c76E1A3Bb",
436
- upgradedAt: "2026-07-08T20:33:59Z",
437
- upgradedBy: "AdminModule generic-op 0x740efe0cfe85044479cbd8ee3058aa244057d90703dd2b37044dd6787cbf3485 (3-of-5 ADMIN_ROLE Safes, 24h timelock; executed by 0xfb3B8cbeFB7D666A6Af34C53e189EdC31862a7be in tx 0x430c8e450f12d3d9359cde356ac5e2ef39661d7a89884b5674a596c1090f6cff)",
438
- reason: "Validator gas fix (#420): BitcoinAddressValidator packed-table lookups; VERSION 1.3.0 -> 1.3.1"
435
+ upgradedAt: "2026-07-08T20:33:59.000Z",
436
+ upgradedBy: "AdminModule generic-op 0x740efe0cfe85044479cbd8ee3058aa244057d90703dd2b37044dd6787cbf3485 (3-of-5 ADMIN_ROLE Safes, 24h timelock; executed via Safe 0xfb3B8cbeFB7D666A6Af34C53e189EdC31862a7be, submitted by EOA 0x2002827d34A781883Ec4c83c36ECC140c3911F2B, tx 0x430c8e450f12d3d9359cde356ac5e2ef39661d7a89884b5674a596c1090f6cff, block 25490267)",
437
+ reason: "Validator gas fix (#420): BitcoinAddressValidator packed-table lookups; VERSION 1.3.0 -> 1.3.1. NOTE: not part of the audit rollout batch \u2014 reconcile-deployment-record.ts --write templates every row as 'audit rollout batch'; this hand-authored provenance is the accurate one, restore it if --write flattens it again.",
438
+ executeTx: "0x430c8e450f12d3d9359cde356ac5e2ef39661d7a89884b5674a596c1090f6cff",
439
+ block: 25490267
439
440
  },
440
441
  BitcoinWithdrawalAddressRegistry: {
441
442
  previousImplementation: "0x11731bFEC3068F2cc19D016381dfEA3B93013b1C",
442
443
  newImplementation: "0x190c08300Ae650fb88ed8156445BBeb13bE9E8a3",
443
- upgradedAt: "2026-07-08T20:33:59Z",
444
- upgradedBy: "AdminModule generic-op 0x2603a486c0f34554b864cc1d909b325c7e105331da10ec0fd7e0b9373fa76207 (3-of-5 ADMIN_ROLE Safes, 24h timelock; executed by 0xfb3B8cbeFB7D666A6Af34C53e189EdC31862a7be in tx 0x430c8e450f12d3d9359cde356ac5e2ef39661d7a89884b5674a596c1090f6cff)",
445
- reason: "Validator gas fix (#420): BitcoinAddressValidator packed-table lookups; VERSION 1.0.0 -> 1.0.1"
444
+ upgradedAt: "2026-07-08T20:33:59.000Z",
445
+ upgradedBy: "AdminModule generic-op 0x2603a486c0f34554b864cc1d909b325c7e105331da10ec0fd7e0b9373fa76207 (3-of-5 ADMIN_ROLE Safes, 24h timelock; executed via Safe 0xfb3B8cbeFB7D666A6Af34C53e189EdC31862a7be, submitted by EOA 0x2002827d34A781883Ec4c83c36ECC140c3911F2B, tx 0x430c8e450f12d3d9359cde356ac5e2ef39661d7a89884b5674a596c1090f6cff, block 25490267)",
446
+ reason: "Validator gas fix (#420): BitcoinAddressValidator packed-table lookups; VERSION 1.0.0 -> 1.0.1. NOTE: not part of the audit rollout batch \u2014 see the CollateralManagerModule row above.",
447
+ executeTx: "0x430c8e450f12d3d9359cde356ac5e2ef39661d7a89884b5674a596c1090f6cff",
448
+ block: 25490267
446
449
  },
447
450
  UCDController: {
448
451
  previousImplementation: "0x16f94AcC78cE87bEeBCfF90552091B3EfC071E48",
@@ -481,13 +484,13 @@ var init_deployment_addresses = __esm({
481
484
  block: 25472957
482
485
  },
483
486
  PositionManager: {
484
- previousImplementation: "0x9f52BaBB40FbFC5863e45B1A4014cB433950c684",
485
- newImplementation: "0x600Dc0D1C2c0F94882B6Bc09172f8650047Ad5B1",
486
- upgradedAt: "2026-07-06T08:42:47.000Z",
487
- upgradedBy: "AdminModule/Safe audit-batch upgradeToAndCall; executed by 0x2002827d34A781883Ec4c83c36ECC140c3911F2B in tx 0xa1fbe31cb71736514a868e681573dff22c9fab91d69cec157a24a30e29eadbe6 (block 25472368)",
488
- reason: "Reconciled from chain \u2014 mainnet audit rollout batch (cross-ref onchain-auth/.safe-batches/mainnet-audit-execute.json)",
489
- executeTx: "0xa1fbe31cb71736514a868e681573dff22c9fab91d69cec157a24a30e29eadbe6",
490
- block: 25472368
487
+ previousImplementation: "0x600Dc0D1C2c0F94882B6Bc09172f8650047Ad5B1",
488
+ newImplementation: "0x2e7170d6Fb15A876dB726732e72e63109bcB916d",
489
+ upgradedAt: "2026-08-03T08:34:23.000Z",
490
+ upgradedBy: "AdminModule generic-op 0x69b79a906ed2 (3-of-3 signatures, 24h timelock; proposed by 0xEba7BfAeB35ee18408b424Ee0BB45AdDf776589f, executed in the release batch onchain-auth/.safe-batches/mainnet-release-execute-B.json, submitted by EOA 0x2002827d34A781883Ec4c83c36ECC140c3911F2B, tx 0xf1f8d5fc13f45d7a3f932bf1a2d6e29381fdd41cd31298ad785bf7688df07fe6, block 25673200)",
491
+ reason: "2026-08 agent-stack release, Execute B: agent-delegation digest rebind. makePayment/mintUCD/extendPosition now bind their EIP-712 digest to the STORED borrower rather than msg.sender, so a scoped AgentDelegationRegistry grant can submit; withdrawBTC still binds msg.sender and stays non-delegable. Also adds setViews(address), which the same batch used to repoint PM at the replacement PositionManagerViews. NOTE: VERSION reads 1.5.4 on BOTH sides of this upgrade \u2014 verify by implementation ADDRESS, never by VERSION(). NOTE: not the July audit rollout batch \u2014 reconcile-deployment-record.ts --write templates every row with that text; this hand-authored provenance is the accurate one, restore it if --write flattens it again.",
492
+ executeTx: "0xf1f8d5fc13f45d7a3f932bf1a2d6e29381fdd41cd31298ad785bf7688df07fe6",
493
+ block: 25673200
491
494
  },
492
495
  LoanOperationsManagerModule: {
493
496
  previousImplementation: "0x56671D671e492Dae625413d463D47605Cf54edf6",
@@ -506,6 +509,41 @@ var init_deployment_addresses = __esm({
506
509
  reason: "Reconciled from chain \u2014 mainnet audit rollout batch (cross-ref onchain-auth/.safe-batches/mainnet-audit-execute.json)",
507
510
  executeTx: "0x9820e259700865a281b8376e248044048ba2fed1d17c811ac66ac54d36711a5b",
508
511
  block: 25472961
512
+ },
513
+ BitcoinProviderRegistry: {
514
+ newImplementation: "0x7Bc9473E45fb3EA594e8b13992F57D0444902ddB",
515
+ upgradedAt: "2026-06-16T17:51:11.000Z",
516
+ upgradedBy: "AdminModule/Safe audit-batch upgradeToAndCall; executed by 0xEba7BfAeB35ee18408b424Ee0BB45AdDf776589f in tx 0xf97e21ce2bc23876d60414c24ce6f45b2f0dd5e1ce42aca84f245f90f18ea17d (block 25331694)",
517
+ reason: "Reconciled from chain \u2014 mainnet audit rollout batch (cross-ref onchain-auth/.safe-batches/mainnet-audit-execute.json)",
518
+ executeTx: "0xf97e21ce2bc23876d60414c24ce6f45b2f0dd5e1ce42aca84f245f90f18ea17d",
519
+ block: 25331694
520
+ },
521
+ FeeRecipientRegistry: {
522
+ newImplementation: "0xEfAeB37faAdc2D420dC6F99128296B79fDDe74bE",
523
+ upgradedAt: "2026-06-16T17:30:35.000Z",
524
+ upgradedBy: "AdminModule/Safe audit-batch upgradeToAndCall; executed by 0xEba7BfAeB35ee18408b424Ee0BB45AdDf776589f in tx 0xc8f592166923f83b9b0cfc44e67c2ec75f79ca95be4f8ffa01654f702eaac502 (block 25331591)",
525
+ reason: "Reconciled from chain \u2014 mainnet audit rollout batch (cross-ref onchain-auth/.safe-batches/mainnet-audit-execute.json)",
526
+ executeTx: "0xc8f592166923f83b9b0cfc44e67c2ec75f79ca95be4f8ffa01654f702eaac502",
527
+ block: 25331591
528
+ },
529
+ PositionDelegateRegistry: {
530
+ previousImplementation: "0x3c7B975c03F549fe0656D9cbbA218BcF1C7092af",
531
+ newImplementation: "0x560a87251b3D306116F32D6e197FD068577e5349",
532
+ upgradedAt: "2026-08-02T18:34:35.000Z",
533
+ upgradedBy: "AdminModule generic-op 0x9acc88e33647ed5158ea161728c60ee4afecea7e3767735e7c1af0bb10ee0cb5 (3-of-3 signatures, 24h timelock; proposed by 0xEba7BfAeB35ee18408b424Ee0BB45AdDf776589f, executed in the release batch onchain-auth/.safe-batches/mainnet-release-execute-A.json, submitted by EOA 0x2002827d34A781883Ec4c83c36ECC140c3911F2B, tx 0xf0f237f6c4e958c37de556571908283c59c3fba6ebf9fa3cefb956f37e315a10, block 25669024)",
534
+ reason: "2026-08 agent-stack release: PositionDelegateRegistry VERSION 1.1.0 -> 2.0.0 via upgradeToAndCall + initializeV2(AdminModule, registrar 0x5D54E0BE\u2026, pauser 0xC205Ae99\u2026) \u2014 kill-switch, deny-only registrar, permanent delegate burn. NOTE: not the July audit rollout batch \u2014 reconcile-deployment-record.ts --write templates every row with that text; this hand-authored provenance is the accurate one, restore it if --write flattens it again.",
535
+ executeTx: "0xf0f237f6c4e958c37de556571908283c59c3fba6ebf9fa3cefb956f37e315a10",
536
+ block: 25669024
537
+ },
538
+ PositionManagerViews: {
539
+ previousImplementation: "0x9225647a30bbACA4Acc0491B786869036914242e",
540
+ newImplementation: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
541
+ proxy: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
542
+ upgradedAt: "2026-08-03T08:34:23.000Z",
543
+ upgradedBy: "REPLACED, not upgraded. Fresh ERC1967Proxy (atomically initialized) + AdminModule generic-op 0x848a97186f0d PositionManager.setViews(proxy) \u2014 3-of-3, 24h timelock, executed in onchain-auth/.safe-batches/mainnet-release-execute-B.json",
544
+ reason: "2026-08 agent-stack release. The mainnet PositionManagerViews at 0x9225647a was deployed as a BARE implementation (EIP-1967 slot 0x00), so upgradeToAndCall reverts UUPSUnauthorizedCallContext \u2014 it could never be upgraded. PositionManager.setViews (added in the same Execute B batch) removed the repoint blocker, so Views was replaced behind a new proxy rather than upgraded. This makes the Pashov F3 renewal debt-ceiling check REACHABLE for the first time: ExceedsMaxLoan (0x499e7985) is present in 0xE68DC096 and absent from 0x9225647a. Views holds no protocol state (8 wiring slots + roles + pause), which is what made replacement safe. The old contract is ABANDONED, not decommissioned \u2014 it stays live and callable as the rollback target for setViews. NOTE: VERSION reads 1.1.1 on both sides; verify by address.",
545
+ executeTx: "0xf1f8d5fc13f45d7a3f932bf1a2d6e29381fdd41cd31298ad785bf7688df07fe6",
546
+ block: 25673200
509
547
  }
510
548
  },
511
549
  latestEnv: {
@@ -514,7 +552,7 @@ var init_deployment_addresses = __esm({
514
552
  FEE_RECIPIENT_REGISTRY: "0x8fbCAAdA198E1C246ecEb2fB021C5A3d8050c6B3",
515
553
  FEE_RECIPIENT_REGISTRY_IMPL: "0xEfAeB37faAdc2D420dC6F99128296B79fDDe74bE",
516
554
  POSITION_DELEGATE_REGISTRY: "0xf0aa2678aD4F60f49e8F7725089B5E86B7F8FE4C",
517
- POSITION_DELEGATE_REGISTRY_IMPL: "0x3c7B975c03F549fe0656D9cbbA218BcF1C7092af",
555
+ POSITION_DELEGATE_REGISTRY_IMPL: "0x560a87251b3D306116F32D6e197FD068577e5349",
518
556
  BITCOIN_PROVIDER_REGISTRY: "0x4ab3Fb96e02893Ed6FAa61bad1918390c8DbbFFC",
519
557
  BITCOIN_PROVIDER_REGISTRY_IMPL: "0x7Bc9473E45fb3EA594e8b13992F57D0444902ddB",
520
558
  BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY: "0xf667f77FDba7458345f227eB6Bfe4148243E7270",
@@ -539,16 +577,19 @@ var init_deployment_addresses = __esm({
539
577
  ADMIN_MODULE_IMPL: "0xb4C5C7E051A1e672F014B25CB5D55B225Aa0D512",
540
578
  BTC_SPEND_AUTHORIZER: "0xfBbF108486fa07F1B06a811C5b66ed68DD9c508a",
541
579
  BTC_SPEND_AUTHORIZER_IMPL: "0x40c9e8C46C65E0A57BB63da5368868A9E8Df81A5",
542
- POSITION_MANAGER_VIEWS: "0x9225647a30bbACA4Acc0491B786869036914242e",
543
- POSITION_MANAGER_VIEWS_IMPL: "0x9225647a30bbACA4Acc0491B786869036914242e",
580
+ POSITION_MANAGER_VIEWS: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
581
+ POSITION_MANAGER_VIEWS_IMPL: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
544
582
  POSITION_MANAGER: "0x12A1836e56139ccaD8722B89519d84233efc224B",
545
- POSITION_MANAGER_IMPL: "0x600Dc0D1C2c0F94882B6Bc09172f8650047Ad5B1",
583
+ POSITION_MANAGER_IMPL: "0x2e7170d6Fb15A876dB726732e72e63109bcB916d",
546
584
  LOAN_OPERATIONS_MANAGER_MODULE: "0x2561974A40F1AEed1251d0A090A83cF8536FB9E9",
547
585
  LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "0x7d90aAB4466f59BA9aC9C7a9BF14dC53734336e7",
548
586
  UPGRADE_VALIDATOR: "0xC46Ae71F22e3741A6CF46E399aE914C4868fEbed",
549
587
  UPGRADE_VALIDATOR_IMPL: "0x4f835e77D1211299a1cbb8Aa2b42d9B390cC95CA",
550
588
  OPERATION_AUTHORIZATION_REGISTRY: "0xD4505645b724754f5170a2027804a4265e860d44",
551
- OPERATION_AUTHORIZATION_REGISTRY_IMPL: "0x493118746840EDB2D396E71632D2E774CA14070e"
589
+ OPERATION_AUTHORIZATION_REGISTRY_IMPL: "0x493118746840EDB2D396E71632D2E774CA14070e",
590
+ AGENT_DELEGATION_REGISTRY: "0x54853b7E91ce2Be34ce65655D80c4447e67187Fa",
591
+ AGENT_DELEGATION_REGISTRY_IMPL: "0xa9fF405Edd4329fc3159a64F56B37EBD253e4928",
592
+ DH_AGENT_DELEGATE: "0x70232d0caBe529e29a01A442423d7e03BBd414c8"
552
593
  }
553
594
  };
554
595
  MAINNET_CONTRACTS = {
@@ -565,7 +606,7 @@ var init_deployment_addresses = __esm({
565
606
  LiquidationManagerModule: "0x74B28695352E7bf736D6c9F76ccb7B4439477De9",
566
607
  CircuitBreakerModule: "0xF7b545d3a4Ee056D06909AB367E2F7bFFE3cB1BC",
567
608
  AdminModule: "0x0023B71B586795eE5fa4E83E384345C1EC8Bb946",
568
- PositionManagerViews: "0x9225647a30bbACA4Acc0491B786869036914242e",
609
+ PositionManagerViews: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
569
610
  PositionManager: "0x12A1836e56139ccaD8722B89519d84233efc224B",
570
611
  OperationAuthorizationRegistry: "0xD4505645b724754f5170a2027804a4265e860d44",
571
612
  ContractVersionRegistry: "0x5e18f77d01940dA5B1D986D373D9A6ad0767008d",
@@ -574,7 +615,9 @@ var init_deployment_addresses = __esm({
574
615
  BitcoinProviderRegistry: "0x4ab3Fb96e02893Ed6FAa61bad1918390c8DbbFFC",
575
616
  BitcoinWithdrawalAddressRegistry: "0xf667f77FDba7458345f227eB6Bfe4148243E7270",
576
617
  SimplePSMV2: "0xfE0C14B4E614f40Bf58845b4B04CeD17fd116532",
577
- PKPValidation: "0x29922d3ccb86516f6C24F89f1eb3068655ca7Fa0"
618
+ PKPValidation: "0x29922d3ccb86516f6C24F89f1eb3068655ca7Fa0",
619
+ AgentDelegationRegistry: "0x54853b7E91ce2Be34ce65655D80c4447e67187Fa",
620
+ DHAgentDelegate: "0x70232d0caBe529e29a01A442423d7e03BBd414c8"
578
621
  };
579
622
  LOCALHOST_DEPLOYMENT = {
580
623
  network: "localhost",
@@ -1383,7 +1426,11 @@ var require_pkg_src = __commonJS({
1383
1426
  ),
1384
1427
  name: "Btc Withdrawal",
1385
1428
  description: "Production Btc Withdrawal",
1386
- version: "1.2.1",
1429
+ // Monotonic per action, NOT a shared release train — the EIP-1271 rotation
1430
+ // stamped its cohort 1.2.1, but this action was already at 1.2.3 from the vout
1431
+ // canonicalization fix. Reusing the cohort stamp made a newer CID read as older
1432
+ // than the one it replaced, which a rotation ceremony would treat as a rollback.
1433
+ version: "1.2.4",
1387
1434
  deployed: true,
1388
1435
  deployedAt: 1785226412397,
1389
1436
  size: 92754,
@@ -6572,6 +6619,7 @@ function sessionStoreKey(address, chainId, endpoint) {
6572
6619
  return STORE_PREFIX + `${address.trim().toLowerCase()}:${chainId}:${endpoint.replace(/\/+$/, "")}`;
6573
6620
  }
6574
6621
  var PENDING_ENVELOPE_TTL_SECONDS = 8 * 60;
6622
+ var EOA_PENDING_ENVELOPE_TTL_SECONDS = 60;
6575
6623
  function pendingEnvelopeKey(sessionKey) {
6576
6624
  return sessionKey + ":pending";
6577
6625
  }
@@ -6619,7 +6667,7 @@ var LocalStorageSessionStore = class {
6619
6667
  } catch {
6620
6668
  }
6621
6669
  }
6622
- loadPending(key) {
6670
+ loadPending(key, maxAgeSeconds = PENDING_ENVELOPE_TTL_SECONDS) {
6623
6671
  let raw;
6624
6672
  try {
6625
6673
  raw = window.localStorage.getItem(pendingEnvelopeKey(key));
@@ -6636,7 +6684,7 @@ var LocalStorageSessionStore = class {
6636
6684
  return null;
6637
6685
  }
6638
6686
  const nowSec = Math.floor(Date.now() / 1e3);
6639
- if (!isPendingEnvelopeShape(parsed) || nowSec >= parsed.issuedAt + PENDING_ENVELOPE_TTL_SECONDS) {
6687
+ if (!isPendingEnvelopeShape(parsed) || nowSec >= parsed.issuedAt + maxAgeSeconds) {
6640
6688
  this.clearPending(key);
6641
6689
  return null;
6642
6690
  }
@@ -6670,12 +6718,12 @@ var MemorySessionStore = class {
6670
6718
  clear(key) {
6671
6719
  this.entries.delete(key);
6672
6720
  }
6673
- loadPending(key) {
6721
+ loadPending(key, maxAgeSeconds = PENDING_ENVELOPE_TTL_SECONDS) {
6674
6722
  const envelope = this.pending.get(key);
6675
6723
  if (!envelope)
6676
6724
  return null;
6677
6725
  const nowSec = Math.floor(Date.now() / 1e3);
6678
- if (nowSec >= envelope.issuedAt + PENDING_ENVELOPE_TTL_SECONDS) {
6726
+ if (nowSec >= envelope.issuedAt + maxAgeSeconds) {
6679
6727
  this.pending.delete(key);
6680
6728
  return null;
6681
6729
  }
@@ -6709,15 +6757,23 @@ var REFRESH_LEEWAY_SECONDS = 30;
6709
6757
  var LOGIN_RETRY_BASE_MS = 3e4;
6710
6758
  var LOGIN_RETRY_MAX_MS = 5 * 6e4;
6711
6759
  var ServerLoginError = class extends Error {
6712
- constructor(message, status) {
6760
+ constructor(message, status, reason) {
6713
6761
  super(message);
6714
6762
  this.status = status;
6763
+ this.reason = reason;
6715
6764
  this.name = "ServerLoginError";
6716
6765
  }
6717
6766
  };
6718
6767
  function isLoginRejection(error) {
6719
6768
  return error instanceof ServerLoginError && error.status >= 400 && error.status < 500 && error.status !== 429;
6720
6769
  }
6770
+ var SPENT_ENVELOPE_REASONS = /* @__PURE__ */ new Set(["replayed_nonce", "expired_issuedAt"]);
6771
+ function isSpentEnvelope(error) {
6772
+ if (!isLoginRejection(error))
6773
+ return false;
6774
+ const { reason, status } = error;
6775
+ return reason ? SPENT_ENVELOPE_REASONS.has(reason) : status === 409;
6776
+ }
6721
6777
  var ServerSession = class {
6722
6778
  signer;
6723
6779
  serviceEndpoint;
@@ -6748,6 +6804,12 @@ var ServerSession = class {
6748
6804
  * `clear()` can drop the persisted token without an async address lookup.
6749
6805
  */
6750
6806
  lastStoreKey = null;
6807
+ /**
6808
+ * Whether the signer is a smart-contract wallet, memoized after the first
6809
+ * `eth_getCode`. Decides which of the server's two first-use windows bounds
6810
+ * envelope reuse; a signer cannot change kind for the life of the session.
6811
+ */
6812
+ contractSigner = null;
6751
6813
  constructor(opts) {
6752
6814
  assertSafeServiceEndpoint(opts.serviceEndpoint);
6753
6815
  this.signer = opts.signer;
@@ -6946,6 +7008,34 @@ var ServerSession = class {
6946
7008
  return null;
6947
7009
  }
6948
7010
  }
7011
+ /**
7012
+ * How long a pending envelope for THIS signer may be reused, in seconds.
7013
+ *
7014
+ * The server grants an EOA 120s to make an envelope's first use and a contract
7015
+ * wallet 600s, so one local TTL is necessarily wrong for one of them. Deployed
7016
+ * code has bytecode; an EOA does not — one `eth_getCode`, memoized, settles it.
7017
+ *
7018
+ * Reports the CONTRACT window when it cannot tell, which is the behavior that
7019
+ * shipped before the split. The asymmetry is intended: guessing "EOA" for a
7020
+ * Safe hands it a new message and orphans the owner signatures already
7021
+ * collected, while guessing "contract" for an EOA now costs one rejected
7022
+ * attempt, because a rejection clears the envelope.
7023
+ */
7024
+ async pendingEnvelopeTtl() {
7025
+ if (this.contractSigner === null) {
7026
+ try {
7027
+ const provider = this.signer.provider;
7028
+ if (!provider)
7029
+ return PENDING_ENVELOPE_TTL_SECONDS;
7030
+ const address = await this.signer.getAddress();
7031
+ const code = await provider.getCode(address);
7032
+ this.contractSigner = typeof code === "string" && code !== "0x";
7033
+ } catch {
7034
+ return PENDING_ENVELOPE_TTL_SECONDS;
7035
+ }
7036
+ }
7037
+ return this.contractSigner ? PENDING_ENVELOPE_TTL_SECONDS : EOA_PENDING_ENVELOPE_TTL_SECONDS;
7038
+ }
6949
7039
  async getOrRefresh() {
6950
7040
  const nowSec = this.now();
6951
7041
  if (this.cached && this.cached.expiresAt - REFRESH_LEEWAY_SECONDS > nowSec) {
@@ -6967,10 +7057,10 @@ var ServerSession = class {
6967
7057
  }
6968
7058
  this.onSignaturePrompt?.();
6969
7059
  let session;
7060
+ const store = this.store;
7061
+ const storeKey = store ? this.lastStoreKey : null;
6970
7062
  try {
6971
- const store = this.store;
6972
- const storeKey = store ? this.lastStoreKey : null;
6973
- const reuse = storeKey ? store.loadPending?.(storeKey) ?? void 0 : void 0;
7063
+ const reuse = storeKey ? store.loadPending?.(storeKey, await this.pendingEnvelopeTtl()) ?? void 0 : void 0;
6974
7064
  const payload = await buildSignedLoginPayload(
6975
7065
  this.signer,
6976
7066
  this.chainId,
@@ -6993,6 +7083,9 @@ var ServerSession = class {
6993
7083
  this.onSignatureResolved?.(true);
6994
7084
  } catch (error) {
6995
7085
  this.onSignatureResolved?.(false);
7086
+ if (storeKey && isSpentEnvelope(error)) {
7087
+ store.clearPending?.(storeKey);
7088
+ }
6996
7089
  const failures = (this.promptBackoff?.failures ?? 0) + 1;
6997
7090
  this.promptBackoff = {
6998
7091
  failures,
@@ -7021,9 +7114,17 @@ var ServerSession = class {
7021
7114
  });
7022
7115
  if (!res.ok) {
7023
7116
  const detail = await res.text().catch(() => "");
7117
+ let reason;
7118
+ try {
7119
+ const parsed = JSON.parse(detail);
7120
+ if (typeof parsed?.reason === "string")
7121
+ reason = parsed.reason;
7122
+ } catch {
7123
+ }
7024
7124
  throw new ServerLoginError(
7025
7125
  `lit-ops-server login failed: HTTP ${res.status} ${detail.slice(0, 200)}`,
7026
- res.status
7126
+ res.status,
7127
+ reason
7027
7128
  );
7028
7129
  }
7029
7130
  const body = await res.json();
@@ -8056,9 +8157,6 @@ var UCD_CONTROLLER_ABI = [
8056
8157
  "function balanceOf(address account) external view returns (uint256)",
8057
8158
  "function transfer(address to, uint256 amount) external returns (bool)"
8058
8159
  ];
8059
- var PRICE_FEED_ABI = [
8060
- "function getLatestPrice() external view returns (int256)"
8061
- ];
8062
8160
  var TERM_MANAGER_ABI = [
8063
8161
  "function getAvailableTerms() external view returns (uint256[] memory termIds, uint256[] memory durationDays, uint256[] memory interestRateBps)",
8064
8162
  "function getValidTermsWithFees() external view returns (uint256[] terms, uint88[] originationFees, uint88[] extensionFees)"
@@ -8126,11 +8224,6 @@ var ContractManager = class {
8126
8224
  UCD_CONTROLLER_ABI,
8127
8225
  contractRunner
8128
8226
  ),
8129
- priceFeed: new import_ethers10.Contract(
8130
- contractAddresses.priceFeedConsumer || import_ethers10.ZeroAddress,
8131
- PRICE_FEED_ABI,
8132
- contractRunner
8133
- ),
8134
8227
  termManager: new import_ethers10.Contract(
8135
8228
  contractAddresses.termManager || import_ethers10.ZeroAddress,
8136
8229
  TERM_MANAGER_ABI,
@@ -8176,7 +8269,6 @@ var ContractManager = class {
8176
8269
  "ucdToken"
8177
8270
  ];
8178
8271
  const optionalAddresses = [
8179
- "priceFeedConsumer",
8180
8272
  "loanOperationsManager",
8181
8273
  "termManager",
8182
8274
  "circuitBreaker",
@@ -8262,16 +8354,6 @@ var ContractManager = class {
8262
8354
  }
8263
8355
  return success(contractsResult.value.ucdController);
8264
8356
  }
8265
- /**
8266
- * Get Price Feed contract
8267
- */
8268
- getPriceFeed() {
8269
- const contractsResult = this.getContracts();
8270
- if (!contractsResult.success) {
8271
- return contractsResult;
8272
- }
8273
- return success(contractsResult.value.priceFeed);
8274
- }
8275
8357
  /**
8276
8358
  * Get Term Manager contract
8277
8359
  */
@@ -17934,6 +18016,7 @@ var DelegateDenyReason = /* @__PURE__ */ ((DelegateDenyReason2) => {
17934
18016
  DelegateDenyReason2[DelegateDenyReason2["PAUSED"] = 1] = "PAUSED";
17935
18017
  DelegateDenyReason2[DelegateDenyReason2["NO_DELEGATE"] = 2] = "NO_DELEGATE";
17936
18018
  DelegateDenyReason2[DelegateDenyReason2["NOT_DELEGATE"] = 3] = "NOT_DELEGATE";
18019
+ DelegateDenyReason2[DelegateDenyReason2["BURNED"] = 4] = "BURNED";
17937
18020
  return DelegateDenyReason2;
17938
18021
  })(DelegateDenyReason || {});
17939
18022
  var DELEGATE_STATUS_ABI = [
@@ -24626,22 +24709,28 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
24626
24709
  * @throws if timeout is reached before subgraph catches up
24627
24710
  */
24628
24711
  // ============================================================================
24629
- // HIGH-LEVEL API - Agent Delegation (auto-renew) — SEPOLIA ONLY
24712
+ // HIGH-LEVEL API - Agent Delegation (auto-renew)
24630
24713
  // ============================================================================
24631
- /** Guard: the AgentDelegationRegistry MVP is deployed on Sepolia only. */
24632
- async assertAgentDelegationSepolia() {
24633
- const chainId = Number((await this.getProviderOrThrow().getNetwork()).chainId);
24634
- if (chainId !== 11155111) {
24635
- throw new SDKError({
24636
- message: `Agent auto-renew delegation is Sepolia-only (chainId 11155111); got ${chainId}`,
24637
- category: "NETWORK" /* NETWORK */,
24638
- severity: "HIGH" /* HIGH */
24639
- });
24640
- }
24714
+ /**
24715
+ * Guard: resolve the AgentDelegationRegistry for the configured network.
24716
+ *
24717
+ * Deployment presence IS the availability test — there is deliberately no chainId
24718
+ * allow-list here. The registry is deployed per network (Sepolia 2026-07, mainnet
24719
+ * 2026-08 agent-stack release) and `getNetworkConfig` populates the address from the
24720
+ * generated deployment table, so a chain without a deployment resolves to `""` and
24721
+ * fails closed below. Adding a chain therefore needs no SDK code change — which is
24722
+ * exactly how the previous hardcoded `chainId !== 11155111` gate went stale and kept
24723
+ * the mainnet toggle dark after the registry shipped.
24724
+ *
24725
+ * Callers that need the availability answer WITHOUT throwing (e.g. to decide whether to
24726
+ * render a toggle at all) should ask the deployment table directly rather than calling this
24727
+ * and catching — `ALL_DEPLOYMENTS` is published on the `@gvnrdao/dh-sdk/deployments` subpath.
24728
+ */
24729
+ agentDelegationRegistryOrThrow() {
24641
24730
  const addr = this.config.contractAddresses?.agentDelegationRegistry;
24642
24731
  if (!addr) {
24643
24732
  throw new SDKError({
24644
- message: "AgentDelegationRegistry address not configured \u2014 provide contractAddresses.agentDelegationRegistry",
24733
+ message: "AgentDelegationRegistry is not available on this network \u2014 no deployment address is configured (contractAddresses.agentDelegationRegistry)",
24645
24734
  category: "CONFIGURATION" /* CONFIGURATION */,
24646
24735
  severity: "HIGH" /* HIGH */
24647
24736
  });
@@ -24653,7 +24742,7 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
24653
24742
  * Pure view — no signer required.
24654
24743
  */
24655
24744
  async getAutoRenewStatus(positionId, user) {
24656
- const addr = await this.assertAgentDelegationSepolia();
24745
+ const addr = this.agentDelegationRegistryOrThrow();
24657
24746
  const registry = AgentDelegationRegistry__factory.connect(addr, this.getProviderOrThrow());
24658
24747
  const pid = this.toBytes32(positionId);
24659
24748
  const grant = await registry.getLoanGrant(pid);
@@ -24673,7 +24762,7 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
24673
24762
  * registers it, then records the position's renew grant. Borrower-signed.
24674
24763
  */
24675
24764
  async enableAutoRenew(positionId, options) {
24676
- const addr = await this.assertAgentDelegationSepolia();
24765
+ const addr = this.agentDelegationRegistryOrThrow();
24677
24766
  const pdrAddr = this.config.contractAddresses?.positionDelegateRegistry;
24678
24767
  if (!pdrAddr) {
24679
24768
  throw new SDKError({
@@ -24713,7 +24802,7 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
24713
24802
  }
24714
24803
  /** Disable auto-renew delegation for a position (clears the grant). Borrower-signed. */
24715
24804
  async disableAutoRenew(positionId) {
24716
- const addr = await this.assertAgentDelegationSepolia();
24805
+ const addr = this.agentDelegationRegistryOrThrow();
24717
24806
  const signer = this.getSignerOrThrow();
24718
24807
  const user = await signer.getAddress();
24719
24808
  const registry = AgentDelegationRegistry__factory.connect(addr, signer);