@gvnrdao/dh-sdk 0.0.318 → 0.0.320

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.
@@ -381,7 +381,7 @@ var MAINNET_DEPLOYMENT = {
381
381
  LiquidationManagerModule: "0x74B28695352E7bf736D6c9F76ccb7B4439477De9",
382
382
  CircuitBreakerModule: "0xF7b545d3a4Ee056D06909AB367E2F7bFFE3cB1BC",
383
383
  AdminModule: "0x0023B71B586795eE5fa4E83E384345C1EC8Bb946",
384
- PositionManagerViews: "0x9225647a30bbACA4Acc0491B786869036914242e",
384
+ PositionManagerViews: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
385
385
  PositionManager: "0x12A1836e56139ccaD8722B89519d84233efc224B",
386
386
  OperationAuthorizationRegistry: "0xD4505645b724754f5170a2027804a4265e860d44",
387
387
  ContractVersionRegistry: "0x5e18f77d01940dA5B1D986D373D9A6ad0767008d",
@@ -459,13 +459,13 @@ var MAINNET_DEPLOYMENT = {
459
459
  block: 25472957
460
460
  },
461
461
  PositionManager: {
462
- previousImplementation: "0x9f52BaBB40FbFC5863e45B1A4014cB433950c684",
463
- newImplementation: "0x600Dc0D1C2c0F94882B6Bc09172f8650047Ad5B1",
464
- upgradedAt: "2026-07-06T08:42:47.000Z",
465
- upgradedBy: "AdminModule/Safe audit-batch upgradeToAndCall; executed by 0x2002827d34A781883Ec4c83c36ECC140c3911F2B in tx 0xa1fbe31cb71736514a868e681573dff22c9fab91d69cec157a24a30e29eadbe6 (block 25472368)",
466
- reason: "Reconciled from chain \u2014 mainnet audit rollout batch (cross-ref onchain-auth/.safe-batches/mainnet-audit-execute.json)",
467
- executeTx: "0xa1fbe31cb71736514a868e681573dff22c9fab91d69cec157a24a30e29eadbe6",
468
- block: 25472368
462
+ previousImplementation: "0x600Dc0D1C2c0F94882B6Bc09172f8650047Ad5B1",
463
+ newImplementation: "0x2e7170d6Fb15A876dB726732e72e63109bcB916d",
464
+ upgradedAt: "2026-08-03T08:34:23.000Z",
465
+ 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)",
466
+ 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.",
467
+ executeTx: "0xf1f8d5fc13f45d7a3f932bf1a2d6e29381fdd41cd31298ad785bf7688df07fe6",
468
+ block: 25673200
469
469
  },
470
470
  LoanOperationsManagerModule: {
471
471
  previousImplementation: "0x56671D671e492Dae625413d463D47605Cf54edf6",
@@ -509,6 +509,16 @@ var MAINNET_DEPLOYMENT = {
509
509
  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.",
510
510
  executeTx: "0xf0f237f6c4e958c37de556571908283c59c3fba6ebf9fa3cefb956f37e315a10",
511
511
  block: 25669024
512
+ },
513
+ PositionManagerViews: {
514
+ previousImplementation: "0x9225647a30bbACA4Acc0491B786869036914242e",
515
+ newImplementation: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
516
+ proxy: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
517
+ upgradedAt: "2026-08-03T08:34:23.000Z",
518
+ 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",
519
+ 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.",
520
+ executeTx: "0xf1f8d5fc13f45d7a3f932bf1a2d6e29381fdd41cd31298ad785bf7688df07fe6",
521
+ block: 25673200
512
522
  }
513
523
  },
514
524
  latestEnv: {
@@ -542,10 +552,10 @@ var MAINNET_DEPLOYMENT = {
542
552
  ADMIN_MODULE_IMPL: "0xb4C5C7E051A1e672F014B25CB5D55B225Aa0D512",
543
553
  BTC_SPEND_AUTHORIZER: "0xfBbF108486fa07F1B06a811C5b66ed68DD9c508a",
544
554
  BTC_SPEND_AUTHORIZER_IMPL: "0x40c9e8C46C65E0A57BB63da5368868A9E8Df81A5",
545
- POSITION_MANAGER_VIEWS: "0x9225647a30bbACA4Acc0491B786869036914242e",
546
- POSITION_MANAGER_VIEWS_IMPL: "0x9225647a30bbACA4Acc0491B786869036914242e",
555
+ POSITION_MANAGER_VIEWS: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
556
+ POSITION_MANAGER_VIEWS_IMPL: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
547
557
  POSITION_MANAGER: "0x12A1836e56139ccaD8722B89519d84233efc224B",
548
- POSITION_MANAGER_IMPL: "0x600Dc0D1C2c0F94882B6Bc09172f8650047Ad5B1",
558
+ POSITION_MANAGER_IMPL: "0x2e7170d6Fb15A876dB726732e72e63109bcB916d",
549
559
  LOAN_OPERATIONS_MANAGER_MODULE: "0x2561974A40F1AEed1251d0A090A83cF8536FB9E9",
550
560
  LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "0x7d90aAB4466f59BA9aC9C7a9BF14dC53734336e7",
551
561
  UPGRADE_VALIDATOR: "0xC46Ae71F22e3741A6CF46E399aE914C4868fEbed",
@@ -571,7 +581,7 @@ var MAINNET_CONTRACTS = {
571
581
  LiquidationManagerModule: "0x74B28695352E7bf736D6c9F76ccb7B4439477De9",
572
582
  CircuitBreakerModule: "0xF7b545d3a4Ee056D06909AB367E2F7bFFE3cB1BC",
573
583
  AdminModule: "0x0023B71B586795eE5fa4E83E384345C1EC8Bb946",
574
- PositionManagerViews: "0x9225647a30bbACA4Acc0491B786869036914242e",
584
+ PositionManagerViews: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
575
585
  PositionManager: "0x12A1836e56139ccaD8722B89519d84233efc224B",
576
586
  OperationAuthorizationRegistry: "0xD4505645b724754f5170a2027804a4265e860d44",
577
587
  ContractVersionRegistry: "0x5e18f77d01940dA5B1D986D373D9A6ad0767008d",
@@ -348,7 +348,7 @@ var MAINNET_DEPLOYMENT = {
348
348
  LiquidationManagerModule: "0x74B28695352E7bf736D6c9F76ccb7B4439477De9",
349
349
  CircuitBreakerModule: "0xF7b545d3a4Ee056D06909AB367E2F7bFFE3cB1BC",
350
350
  AdminModule: "0x0023B71B586795eE5fa4E83E384345C1EC8Bb946",
351
- PositionManagerViews: "0x9225647a30bbACA4Acc0491B786869036914242e",
351
+ PositionManagerViews: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
352
352
  PositionManager: "0x12A1836e56139ccaD8722B89519d84233efc224B",
353
353
  OperationAuthorizationRegistry: "0xD4505645b724754f5170a2027804a4265e860d44",
354
354
  ContractVersionRegistry: "0x5e18f77d01940dA5B1D986D373D9A6ad0767008d",
@@ -426,13 +426,13 @@ var MAINNET_DEPLOYMENT = {
426
426
  block: 25472957
427
427
  },
428
428
  PositionManager: {
429
- previousImplementation: "0x9f52BaBB40FbFC5863e45B1A4014cB433950c684",
430
- newImplementation: "0x600Dc0D1C2c0F94882B6Bc09172f8650047Ad5B1",
431
- upgradedAt: "2026-07-06T08:42:47.000Z",
432
- upgradedBy: "AdminModule/Safe audit-batch upgradeToAndCall; executed by 0x2002827d34A781883Ec4c83c36ECC140c3911F2B in tx 0xa1fbe31cb71736514a868e681573dff22c9fab91d69cec157a24a30e29eadbe6 (block 25472368)",
433
- reason: "Reconciled from chain \u2014 mainnet audit rollout batch (cross-ref onchain-auth/.safe-batches/mainnet-audit-execute.json)",
434
- executeTx: "0xa1fbe31cb71736514a868e681573dff22c9fab91d69cec157a24a30e29eadbe6",
435
- block: 25472368
429
+ previousImplementation: "0x600Dc0D1C2c0F94882B6Bc09172f8650047Ad5B1",
430
+ newImplementation: "0x2e7170d6Fb15A876dB726732e72e63109bcB916d",
431
+ upgradedAt: "2026-08-03T08:34:23.000Z",
432
+ 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)",
433
+ 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.",
434
+ executeTx: "0xf1f8d5fc13f45d7a3f932bf1a2d6e29381fdd41cd31298ad785bf7688df07fe6",
435
+ block: 25673200
436
436
  },
437
437
  LoanOperationsManagerModule: {
438
438
  previousImplementation: "0x56671D671e492Dae625413d463D47605Cf54edf6",
@@ -476,6 +476,16 @@ var MAINNET_DEPLOYMENT = {
476
476
  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.",
477
477
  executeTx: "0xf0f237f6c4e958c37de556571908283c59c3fba6ebf9fa3cefb956f37e315a10",
478
478
  block: 25669024
479
+ },
480
+ PositionManagerViews: {
481
+ previousImplementation: "0x9225647a30bbACA4Acc0491B786869036914242e",
482
+ newImplementation: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
483
+ proxy: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
484
+ upgradedAt: "2026-08-03T08:34:23.000Z",
485
+ 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",
486
+ 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.",
487
+ executeTx: "0xf1f8d5fc13f45d7a3f932bf1a2d6e29381fdd41cd31298ad785bf7688df07fe6",
488
+ block: 25673200
479
489
  }
480
490
  },
481
491
  latestEnv: {
@@ -509,10 +519,10 @@ var MAINNET_DEPLOYMENT = {
509
519
  ADMIN_MODULE_IMPL: "0xb4C5C7E051A1e672F014B25CB5D55B225Aa0D512",
510
520
  BTC_SPEND_AUTHORIZER: "0xfBbF108486fa07F1B06a811C5b66ed68DD9c508a",
511
521
  BTC_SPEND_AUTHORIZER_IMPL: "0x40c9e8C46C65E0A57BB63da5368868A9E8Df81A5",
512
- POSITION_MANAGER_VIEWS: "0x9225647a30bbACA4Acc0491B786869036914242e",
513
- POSITION_MANAGER_VIEWS_IMPL: "0x9225647a30bbACA4Acc0491B786869036914242e",
522
+ POSITION_MANAGER_VIEWS: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
523
+ POSITION_MANAGER_VIEWS_IMPL: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
514
524
  POSITION_MANAGER: "0x12A1836e56139ccaD8722B89519d84233efc224B",
515
- POSITION_MANAGER_IMPL: "0x600Dc0D1C2c0F94882B6Bc09172f8650047Ad5B1",
525
+ POSITION_MANAGER_IMPL: "0x2e7170d6Fb15A876dB726732e72e63109bcB916d",
516
526
  LOAN_OPERATIONS_MANAGER_MODULE: "0x2561974A40F1AEed1251d0A090A83cF8536FB9E9",
517
527
  LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "0x7d90aAB4466f59BA9aC9C7a9BF14dC53734336e7",
518
528
  UPGRADE_VALIDATOR: "0xC46Ae71F22e3741A6CF46E399aE914C4868fEbed",
@@ -538,7 +548,7 @@ var MAINNET_CONTRACTS = {
538
548
  LiquidationManagerModule: "0x74B28695352E7bf736D6c9F76ccb7B4439477De9",
539
549
  CircuitBreakerModule: "0xF7b545d3a4Ee056D06909AB367E2F7bFFE3cB1BC",
540
550
  AdminModule: "0x0023B71B586795eE5fa4E83E384345C1EC8Bb946",
541
- PositionManagerViews: "0x9225647a30bbACA4Acc0491B786869036914242e",
551
+ PositionManagerViews: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
542
552
  PositionManager: "0x12A1836e56139ccaD8722B89519d84233efc224B",
543
553
  OperationAuthorizationRegistry: "0xD4505645b724754f5170a2027804a4265e860d44",
544
554
  ContractVersionRegistry: "0x5e18f77d01940dA5B1D986D373D9A6ad0767008d",
package/dist/index.js CHANGED
@@ -406,7 +406,7 @@ var init_deployment_addresses = __esm({
406
406
  LiquidationManagerModule: "0x74B28695352E7bf736D6c9F76ccb7B4439477De9",
407
407
  CircuitBreakerModule: "0xF7b545d3a4Ee056D06909AB367E2F7bFFE3cB1BC",
408
408
  AdminModule: "0x0023B71B586795eE5fa4E83E384345C1EC8Bb946",
409
- PositionManagerViews: "0x9225647a30bbACA4Acc0491B786869036914242e",
409
+ PositionManagerViews: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
410
410
  PositionManager: "0x12A1836e56139ccaD8722B89519d84233efc224B",
411
411
  OperationAuthorizationRegistry: "0xD4505645b724754f5170a2027804a4265e860d44",
412
412
  ContractVersionRegistry: "0x5e18f77d01940dA5B1D986D373D9A6ad0767008d",
@@ -484,13 +484,13 @@ var init_deployment_addresses = __esm({
484
484
  block: 25472957
485
485
  },
486
486
  PositionManager: {
487
- previousImplementation: "0x9f52BaBB40FbFC5863e45B1A4014cB433950c684",
488
- newImplementation: "0x600Dc0D1C2c0F94882B6Bc09172f8650047Ad5B1",
489
- upgradedAt: "2026-07-06T08:42:47.000Z",
490
- upgradedBy: "AdminModule/Safe audit-batch upgradeToAndCall; executed by 0x2002827d34A781883Ec4c83c36ECC140c3911F2B in tx 0xa1fbe31cb71736514a868e681573dff22c9fab91d69cec157a24a30e29eadbe6 (block 25472368)",
491
- reason: "Reconciled from chain \u2014 mainnet audit rollout batch (cross-ref onchain-auth/.safe-batches/mainnet-audit-execute.json)",
492
- executeTx: "0xa1fbe31cb71736514a868e681573dff22c9fab91d69cec157a24a30e29eadbe6",
493
- 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
494
494
  },
495
495
  LoanOperationsManagerModule: {
496
496
  previousImplementation: "0x56671D671e492Dae625413d463D47605Cf54edf6",
@@ -534,6 +534,16 @@ var init_deployment_addresses = __esm({
534
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
535
  executeTx: "0xf0f237f6c4e958c37de556571908283c59c3fba6ebf9fa3cefb956f37e315a10",
536
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
537
547
  }
538
548
  },
539
549
  latestEnv: {
@@ -567,10 +577,10 @@ var init_deployment_addresses = __esm({
567
577
  ADMIN_MODULE_IMPL: "0xb4C5C7E051A1e672F014B25CB5D55B225Aa0D512",
568
578
  BTC_SPEND_AUTHORIZER: "0xfBbF108486fa07F1B06a811C5b66ed68DD9c508a",
569
579
  BTC_SPEND_AUTHORIZER_IMPL: "0x40c9e8C46C65E0A57BB63da5368868A9E8Df81A5",
570
- POSITION_MANAGER_VIEWS: "0x9225647a30bbACA4Acc0491B786869036914242e",
571
- POSITION_MANAGER_VIEWS_IMPL: "0x9225647a30bbACA4Acc0491B786869036914242e",
580
+ POSITION_MANAGER_VIEWS: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
581
+ POSITION_MANAGER_VIEWS_IMPL: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
572
582
  POSITION_MANAGER: "0x12A1836e56139ccaD8722B89519d84233efc224B",
573
- POSITION_MANAGER_IMPL: "0x600Dc0D1C2c0F94882B6Bc09172f8650047Ad5B1",
583
+ POSITION_MANAGER_IMPL: "0x2e7170d6Fb15A876dB726732e72e63109bcB916d",
574
584
  LOAN_OPERATIONS_MANAGER_MODULE: "0x2561974A40F1AEed1251d0A090A83cF8536FB9E9",
575
585
  LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "0x7d90aAB4466f59BA9aC9C7a9BF14dC53734336e7",
576
586
  UPGRADE_VALIDATOR: "0xC46Ae71F22e3741A6CF46E399aE914C4868fEbed",
@@ -596,7 +606,7 @@ var init_deployment_addresses = __esm({
596
606
  LiquidationManagerModule: "0x74B28695352E7bf736D6c9F76ccb7B4439477De9",
597
607
  CircuitBreakerModule: "0xF7b545d3a4Ee056D06909AB367E2F7bFFE3cB1BC",
598
608
  AdminModule: "0x0023B71B586795eE5fa4E83E384345C1EC8Bb946",
599
- PositionManagerViews: "0x9225647a30bbACA4Acc0491B786869036914242e",
609
+ PositionManagerViews: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
600
610
  PositionManager: "0x12A1836e56139ccaD8722B89519d84233efc224B",
601
611
  OperationAuthorizationRegistry: "0xD4505645b724754f5170a2027804a4265e860d44",
602
612
  ContractVersionRegistry: "0x5e18f77d01940dA5B1D986D373D9A6ad0767008d",
@@ -6609,6 +6619,7 @@ function sessionStoreKey(address, chainId, endpoint) {
6609
6619
  return STORE_PREFIX + `${address.trim().toLowerCase()}:${chainId}:${endpoint.replace(/\/+$/, "")}`;
6610
6620
  }
6611
6621
  var PENDING_ENVELOPE_TTL_SECONDS = 8 * 60;
6622
+ var EOA_PENDING_ENVELOPE_TTL_SECONDS = 60;
6612
6623
  function pendingEnvelopeKey(sessionKey) {
6613
6624
  return sessionKey + ":pending";
6614
6625
  }
@@ -6656,7 +6667,7 @@ var LocalStorageSessionStore = class {
6656
6667
  } catch {
6657
6668
  }
6658
6669
  }
6659
- loadPending(key) {
6670
+ loadPending(key, maxAgeSeconds = PENDING_ENVELOPE_TTL_SECONDS) {
6660
6671
  let raw;
6661
6672
  try {
6662
6673
  raw = window.localStorage.getItem(pendingEnvelopeKey(key));
@@ -6673,7 +6684,7 @@ var LocalStorageSessionStore = class {
6673
6684
  return null;
6674
6685
  }
6675
6686
  const nowSec = Math.floor(Date.now() / 1e3);
6676
- if (!isPendingEnvelopeShape(parsed) || nowSec >= parsed.issuedAt + PENDING_ENVELOPE_TTL_SECONDS) {
6687
+ if (!isPendingEnvelopeShape(parsed) || nowSec >= parsed.issuedAt + maxAgeSeconds) {
6677
6688
  this.clearPending(key);
6678
6689
  return null;
6679
6690
  }
@@ -6707,12 +6718,12 @@ var MemorySessionStore = class {
6707
6718
  clear(key) {
6708
6719
  this.entries.delete(key);
6709
6720
  }
6710
- loadPending(key) {
6721
+ loadPending(key, maxAgeSeconds = PENDING_ENVELOPE_TTL_SECONDS) {
6711
6722
  const envelope = this.pending.get(key);
6712
6723
  if (!envelope)
6713
6724
  return null;
6714
6725
  const nowSec = Math.floor(Date.now() / 1e3);
6715
- if (nowSec >= envelope.issuedAt + PENDING_ENVELOPE_TTL_SECONDS) {
6726
+ if (nowSec >= envelope.issuedAt + maxAgeSeconds) {
6716
6727
  this.pending.delete(key);
6717
6728
  return null;
6718
6729
  }
@@ -6746,15 +6757,23 @@ var REFRESH_LEEWAY_SECONDS = 30;
6746
6757
  var LOGIN_RETRY_BASE_MS = 3e4;
6747
6758
  var LOGIN_RETRY_MAX_MS = 5 * 6e4;
6748
6759
  var ServerLoginError = class extends Error {
6749
- constructor(message, status) {
6760
+ constructor(message, status, reason) {
6750
6761
  super(message);
6751
6762
  this.status = status;
6763
+ this.reason = reason;
6752
6764
  this.name = "ServerLoginError";
6753
6765
  }
6754
6766
  };
6755
6767
  function isLoginRejection(error) {
6756
6768
  return error instanceof ServerLoginError && error.status >= 400 && error.status < 500 && error.status !== 429;
6757
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
+ }
6758
6777
  var ServerSession = class {
6759
6778
  signer;
6760
6779
  serviceEndpoint;
@@ -6785,6 +6804,12 @@ var ServerSession = class {
6785
6804
  * `clear()` can drop the persisted token without an async address lookup.
6786
6805
  */
6787
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;
6788
6813
  constructor(opts) {
6789
6814
  assertSafeServiceEndpoint(opts.serviceEndpoint);
6790
6815
  this.signer = opts.signer;
@@ -6983,6 +7008,34 @@ var ServerSession = class {
6983
7008
  return null;
6984
7009
  }
6985
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
+ }
6986
7039
  async getOrRefresh() {
6987
7040
  const nowSec = this.now();
6988
7041
  if (this.cached && this.cached.expiresAt - REFRESH_LEEWAY_SECONDS > nowSec) {
@@ -7004,10 +7057,10 @@ var ServerSession = class {
7004
7057
  }
7005
7058
  this.onSignaturePrompt?.();
7006
7059
  let session;
7060
+ const store = this.store;
7061
+ const storeKey = store ? this.lastStoreKey : null;
7007
7062
  try {
7008
- const store = this.store;
7009
- const storeKey = store ? this.lastStoreKey : null;
7010
- const reuse = storeKey ? store.loadPending?.(storeKey) ?? void 0 : void 0;
7063
+ const reuse = storeKey ? store.loadPending?.(storeKey, await this.pendingEnvelopeTtl()) ?? void 0 : void 0;
7011
7064
  const payload = await buildSignedLoginPayload(
7012
7065
  this.signer,
7013
7066
  this.chainId,
@@ -7030,6 +7083,9 @@ var ServerSession = class {
7030
7083
  this.onSignatureResolved?.(true);
7031
7084
  } catch (error) {
7032
7085
  this.onSignatureResolved?.(false);
7086
+ if (storeKey && isSpentEnvelope(error)) {
7087
+ store.clearPending?.(storeKey);
7088
+ }
7033
7089
  const failures = (this.promptBackoff?.failures ?? 0) + 1;
7034
7090
  this.promptBackoff = {
7035
7091
  failures,
@@ -7058,9 +7114,17 @@ var ServerSession = class {
7058
7114
  });
7059
7115
  if (!res.ok) {
7060
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
+ }
7061
7124
  throw new ServerLoginError(
7062
7125
  `lit-ops-server login failed: HTTP ${res.status} ${detail.slice(0, 200)}`,
7063
- res.status
7126
+ res.status,
7127
+ reason
7064
7128
  );
7065
7129
  }
7066
7130
  const body = await res.json();
@@ -12709,7 +12773,7 @@ var DiamondHandsGraph = class {
12709
12773
  async getPSMConfiguration() {
12710
12774
  const query = `
12711
12775
  query GetPSMConfiguration {
12712
- psmConfiguration(id: "psm") {
12776
+ psmConfiguration: psmconfiguration(id: "psm") {
12713
12777
  id
12714
12778
  version
12715
12779
  redeemEnabled
@@ -12831,7 +12895,7 @@ var DiamondHandsGraph = class {
12831
12895
  const whereClause = whereConditions.length > 0 ? `where: { ${whereConditions.join(", ")} }` : "";
12832
12896
  const query = `
12833
12897
  query GetPSMTransactions($first: Int!, $skip: Int!) {
12834
- psmTransactions(${whereClause}, first: $first, skip: $skip, orderBy: timestamp, orderDirection: desc) {
12898
+ psmTransactions: psmtransactions(${whereClause}, first: $first, skip: $skip, orderBy: timestamp, orderDirection: desc) {
12835
12899
  id
12836
12900
  type
12837
12901
  user
@@ -12866,7 +12930,7 @@ var DiamondHandsGraph = class {
12866
12930
  const whereClause = whereConditions.length > 0 ? `where: { ${whereConditions.join(", ")} }` : "";
12867
12931
  const query = `
12868
12932
  query GetPSMDailyMetrics($first: Int!) {
12869
- psmDailyMetrics(${whereClause}, first: $first, orderBy: date, orderDirection: desc) {
12933
+ psmDailyMetrics: psmdailyMetrics(${whereClause}, first: $first, orderBy: date, orderDirection: desc) {
12870
12934
  id
12871
12935
  date
12872
12936
  totalSwapVolume
@@ -13590,7 +13654,7 @@ var DiamondHandsGraph = class {
13590
13654
  }` : ""}
13591
13655
 
13592
13656
  ${includeKind("psm") ? `
13593
- psmTransactions(
13657
+ psmTransactions: psmtransactions(
13594
13658
  ${buildTimeWhereClause()}
13595
13659
  first: $limit, orderBy: timestamp, orderDirection: $orderDirection
13596
13660
  ) {
@@ -24645,22 +24709,28 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
24645
24709
  * @throws if timeout is reached before subgraph catches up
24646
24710
  */
24647
24711
  // ============================================================================
24648
- // HIGH-LEVEL API - Agent Delegation (auto-renew) — SEPOLIA ONLY
24712
+ // HIGH-LEVEL API - Agent Delegation (auto-renew)
24649
24713
  // ============================================================================
24650
- /** Guard: the AgentDelegationRegistry MVP is deployed on Sepolia only. */
24651
- async assertAgentDelegationSepolia() {
24652
- const chainId = Number((await this.getProviderOrThrow().getNetwork()).chainId);
24653
- if (chainId !== 11155111) {
24654
- throw new SDKError({
24655
- message: `Agent auto-renew delegation is Sepolia-only (chainId 11155111); got ${chainId}`,
24656
- category: "NETWORK" /* NETWORK */,
24657
- severity: "HIGH" /* HIGH */
24658
- });
24659
- }
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() {
24660
24730
  const addr = this.config.contractAddresses?.agentDelegationRegistry;
24661
24731
  if (!addr) {
24662
24732
  throw new SDKError({
24663
- 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)",
24664
24734
  category: "CONFIGURATION" /* CONFIGURATION */,
24665
24735
  severity: "HIGH" /* HIGH */
24666
24736
  });
@@ -24672,7 +24742,7 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
24672
24742
  * Pure view — no signer required.
24673
24743
  */
24674
24744
  async getAutoRenewStatus(positionId, user) {
24675
- const addr = await this.assertAgentDelegationSepolia();
24745
+ const addr = this.agentDelegationRegistryOrThrow();
24676
24746
  const registry = AgentDelegationRegistry__factory.connect(addr, this.getProviderOrThrow());
24677
24747
  const pid = this.toBytes32(positionId);
24678
24748
  const grant = await registry.getLoanGrant(pid);
@@ -24692,7 +24762,7 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
24692
24762
  * registers it, then records the position's renew grant. Borrower-signed.
24693
24763
  */
24694
24764
  async enableAutoRenew(positionId, options) {
24695
- const addr = await this.assertAgentDelegationSepolia();
24765
+ const addr = this.agentDelegationRegistryOrThrow();
24696
24766
  const pdrAddr = this.config.contractAddresses?.positionDelegateRegistry;
24697
24767
  if (!pdrAddr) {
24698
24768
  throw new SDKError({
@@ -24732,7 +24802,7 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
24732
24802
  }
24733
24803
  /** Disable auto-renew delegation for a position (clears the grant). Borrower-signed. */
24734
24804
  async disableAutoRenew(positionId) {
24735
- const addr = await this.assertAgentDelegationSepolia();
24805
+ const addr = this.agentDelegationRegistryOrThrow();
24736
24806
  const signer = this.getSignerOrThrow();
24737
24807
  const user = await signer.getAddress();
24738
24808
  const registry = AgentDelegationRegistry__factory.connect(addr, signer);