@gvnrdao/dh-sdk 0.0.348 → 0.0.350

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.
@@ -99,6 +99,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
99
99
  { fragment: "error FeeOnTransferNotSupported()", contracts: ["SimplePSMV2"] },
100
100
  { fragment: "error FeeTooHigh(uint256 fee, uint256 max)", contracts: ["PositionManagerErrors"] },
101
101
  { fragment: "error FeeTooLow(uint256 fee, uint256 min)", contracts: ["PositionManagerErrors"] },
102
+ { fragment: "error GlobalReentrancyGuardReentrantCall()", contracts: ["PositionManager", "CollateralManagerModule"] },
102
103
  { fragment: "error ImplNotDeployed()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
103
104
  { fragment: "error ImplementationNotDeployed()", contracts: ["UCDController"] },
104
105
  { fragment: "error InitialBalanceTooLarge()", contracts: ["SimplePSMV2"] },
@@ -63,6 +63,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
63
63
  { fragment: "error FeeOnTransferNotSupported()", contracts: ["SimplePSMV2"] },
64
64
  { fragment: "error FeeTooHigh(uint256 fee, uint256 max)", contracts: ["PositionManagerErrors"] },
65
65
  { fragment: "error FeeTooLow(uint256 fee, uint256 min)", contracts: ["PositionManagerErrors"] },
66
+ { fragment: "error GlobalReentrancyGuardReentrantCall()", contracts: ["PositionManager", "CollateralManagerModule"] },
66
67
  { fragment: "error ImplNotDeployed()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
67
68
  { fragment: "error ImplementationNotDeployed()", contracts: ["UCDController"] },
68
69
  { fragment: "error InitialBalanceTooLarge()", contracts: ["SimplePSMV2"] },
@@ -146,11 +146,11 @@ var SEPOLIA_DEPLOYMENT = {
146
146
  reason: "Shared upgrade script: CollateralManagerModule implementation update"
147
147
  },
148
148
  LiquidationManagerModule: {
149
- previousImplementation: "0x31CD6191d80F484b72925Aa1834c80F5f739252A",
150
- newImplementation: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
151
- upgradedAt: "2026-07-03T20:02:00.579Z",
152
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
153
- reason: "Shared upgrade script: LiquidationManagerModule implementation update"
149
+ previousImplementation: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
150
+ newImplementation: "0xa82640776B1fEBb00c208869E4c6413536be17FA",
151
+ upgradedAt: "2026-10-20T20:21:14.391Z",
152
+ upgradedBy: "0x0f8f23674cc90Ef7107930a4437341fD8B460362",
153
+ reason: "LiquidationManager 1.6.3: EIP-712 domain backfill (Sepolia proxy skipped reinitializer 2)"
154
154
  },
155
155
  BTCSpendAuthorizer: {
156
156
  previousImplementation: "0xdd3DFaEc50d6214d57eA64e8b76ff318b501607b",
@@ -578,7 +578,7 @@ var MAINNET_DEPLOYMENT = {
578
578
  BTC_SPEND_AUTHORIZER: "0xfBbF108486fa07F1B06a811C5b66ed68DD9c508a",
579
579
  BTC_SPEND_AUTHORIZER_IMPL: "0x00D7a47798E8ff169104b748131703B78f23390C",
580
580
  POSITION_MANAGER_VIEWS: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
581
- POSITION_MANAGER_VIEWS_IMPL: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
581
+ POSITION_MANAGER_VIEWS_IMPL: "0x8fe7aF14dB9Bef814c4c8fBc0ce206Cb17F25E8e",
582
582
  POSITION_MANAGER: "0x12A1836e56139ccaD8722B89519d84233efc224B",
583
583
  POSITION_MANAGER_IMPL: "0x2e7170d6Fb15A876dB726732e72e63109bcB916d",
584
584
  LOAN_OPERATIONS_MANAGER_MODULE: "0x2561974A40F1AEed1251d0A090A83cF8536FB9E9",
@@ -113,11 +113,11 @@ var SEPOLIA_DEPLOYMENT = {
113
113
  reason: "Shared upgrade script: CollateralManagerModule implementation update"
114
114
  },
115
115
  LiquidationManagerModule: {
116
- previousImplementation: "0x31CD6191d80F484b72925Aa1834c80F5f739252A",
117
- newImplementation: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
118
- upgradedAt: "2026-07-03T20:02:00.579Z",
119
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
120
- reason: "Shared upgrade script: LiquidationManagerModule implementation update"
116
+ previousImplementation: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
117
+ newImplementation: "0xa82640776B1fEBb00c208869E4c6413536be17FA",
118
+ upgradedAt: "2026-10-20T20:21:14.391Z",
119
+ upgradedBy: "0x0f8f23674cc90Ef7107930a4437341fD8B460362",
120
+ reason: "LiquidationManager 1.6.3: EIP-712 domain backfill (Sepolia proxy skipped reinitializer 2)"
121
121
  },
122
122
  BTCSpendAuthorizer: {
123
123
  previousImplementation: "0xdd3DFaEc50d6214d57eA64e8b76ff318b501607b",
@@ -545,7 +545,7 @@ var MAINNET_DEPLOYMENT = {
545
545
  BTC_SPEND_AUTHORIZER: "0xfBbF108486fa07F1B06a811C5b66ed68DD9c508a",
546
546
  BTC_SPEND_AUTHORIZER_IMPL: "0x00D7a47798E8ff169104b748131703B78f23390C",
547
547
  POSITION_MANAGER_VIEWS: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
548
- POSITION_MANAGER_VIEWS_IMPL: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
548
+ POSITION_MANAGER_VIEWS_IMPL: "0x8fe7aF14dB9Bef814c4c8fBc0ce206Cb17F25E8e",
549
549
  POSITION_MANAGER: "0x12A1836e56139ccaD8722B89519d84233efc224B",
550
550
  POSITION_MANAGER_IMPL: "0x2e7170d6Fb15A876dB726732e72e63109bcB916d",
551
551
  LOAN_OPERATIONS_MANAGER_MODULE: "0x2561974A40F1AEed1251d0A090A83cF8536FB9E9",
package/dist/index.js CHANGED
@@ -171,11 +171,11 @@ var init_deployment_addresses = __esm({
171
171
  reason: "Shared upgrade script: CollateralManagerModule implementation update"
172
172
  },
173
173
  LiquidationManagerModule: {
174
- previousImplementation: "0x31CD6191d80F484b72925Aa1834c80F5f739252A",
175
- newImplementation: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
176
- upgradedAt: "2026-07-03T20:02:00.579Z",
177
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
178
- reason: "Shared upgrade script: LiquidationManagerModule implementation update"
174
+ previousImplementation: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
175
+ newImplementation: "0xa82640776B1fEBb00c208869E4c6413536be17FA",
176
+ upgradedAt: "2026-10-20T20:21:14.391Z",
177
+ upgradedBy: "0x0f8f23674cc90Ef7107930a4437341fD8B460362",
178
+ reason: "LiquidationManager 1.6.3: EIP-712 domain backfill (Sepolia proxy skipped reinitializer 2)"
179
179
  },
180
180
  BTCSpendAuthorizer: {
181
181
  previousImplementation: "0xdd3DFaEc50d6214d57eA64e8b76ff318b501607b",
@@ -603,7 +603,7 @@ var init_deployment_addresses = __esm({
603
603
  BTC_SPEND_AUTHORIZER: "0xfBbF108486fa07F1B06a811C5b66ed68DD9c508a",
604
604
  BTC_SPEND_AUTHORIZER_IMPL: "0x00D7a47798E8ff169104b748131703B78f23390C",
605
605
  POSITION_MANAGER_VIEWS: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
606
- POSITION_MANAGER_VIEWS_IMPL: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
606
+ POSITION_MANAGER_VIEWS_IMPL: "0x8fe7aF14dB9Bef814c4c8fBc0ce206Cb17F25E8e",
607
607
  POSITION_MANAGER: "0x12A1836e56139ccaD8722B89519d84233efc224B",
608
608
  POSITION_MANAGER_IMPL: "0x2e7170d6Fb15A876dB726732e72e63109bcB916d",
609
609
  LOAN_OPERATIONS_MANAGER_MODULE: "0x2561974A40F1AEed1251d0A090A83cF8536FB9E9",
@@ -1402,17 +1402,17 @@ var require_pkg_src = __commonJS({
1402
1402
  hash: "194e1c3e9d2f07873bab8e431ba0cda4f66143b15deb196651a375682408c8c4"
1403
1403
  },
1404
1404
  ucdMintValidator: {
1405
- cid: "QmTheJyLmR3xCyxUUV3Bf3W2bHKe7JZCxCrU5ocha32nL6",
1405
+ cid: "QmRUdAWMRmTno7SBNLj26ptjKYm8wY9CZN7QiNtuZ8oDkZ",
1406
1406
  authorizedCidHex: cidToHex(
1407
- "QmTheJyLmR3xCyxUUV3Bf3W2bHKe7JZCxCrU5ocha32nL6"
1407
+ "QmRUdAWMRmTno7SBNLj26ptjKYm8wY9CZN7QiNtuZ8oDkZ"
1408
1408
  ),
1409
1409
  name: "Ucd Mint Validator",
1410
1410
  description: "Production Ucd Mint Validator",
1411
1411
  version: "1.4.3",
1412
1412
  deployed: true,
1413
- deployedAt: 1792436891664,
1414
- size: 90935,
1415
- hash: "d23ab7c00adfaf6c9feebd47314e98f82c03a2d9af0a13cbe67f2e4fa8c843fc",
1413
+ deployedAt: 1792487391394,
1414
+ size: 91079,
1415
+ hash: "6cb1dfee7f71c2748b036893b9ed4721faf400f65b5fd1dd6e0a692676ad527c",
1416
1416
  validatorWalletAddress: "0xEfb258D455a31d061Bbeb3DE3D2143BdFCB67a6C",
1417
1417
  pkp: {
1418
1418
  publicKey: "0x041ab17cd91fc5c0b761eea6092d032807561b621b82c488826776e04a9158d61ba64d809a4729f0501289d980732cb06d8dfd06999dd9c8efd2f495dad78b31bb",
@@ -1420,17 +1420,17 @@ var require_pkg_src = __commonJS({
1420
1420
  }
1421
1421
  },
1422
1422
  processPaymentValidator: {
1423
- cid: "QmP29cmhkiQnAdzXZJdYRKCw1ckdDj7RLEsLjzJD3udFQc",
1423
+ cid: "Qme4X6mFBWr8ERR33CxQX7V6Y9x5ohJPx6idcYV5wDCpNW",
1424
1424
  authorizedCidHex: cidToHex(
1425
- "QmP29cmhkiQnAdzXZJdYRKCw1ckdDj7RLEsLjzJD3udFQc"
1425
+ "Qme4X6mFBWr8ERR33CxQX7V6Y9x5ohJPx6idcYV5wDCpNW"
1426
1426
  ),
1427
1427
  name: "Process Payment Validator",
1428
1428
  description: "Production Process Payment Validator",
1429
1429
  version: "1.3.3",
1430
1430
  deployed: true,
1431
- deployedAt: 1792436900605,
1432
- size: 86589,
1433
- hash: "e77c8cc4f8564376610110ec29f3663481d04bc677a21671aa0a68b73b866630",
1431
+ deployedAt: 1792487398483,
1432
+ size: 86733,
1433
+ hash: "6cef474b774d1b82988fcb0353c5549c2a2bec343b6b3bef15958b8a42050e51",
1434
1434
  validatorWalletAddress: "0xEfb258D455a31d061Bbeb3DE3D2143BdFCB67a6C",
1435
1435
  pkp: {
1436
1436
  publicKey: "0x04cfccb9b6c7addc79469c0e9fafebef4c70801302c62cdb26b610723a9b8527d23f98a40158c7340d83fd0e62d02b5ec74c12f7a86d98e8c6973b4811110f19ad",
@@ -1438,17 +1438,17 @@ var require_pkg_src = __commonJS({
1438
1438
  }
1439
1439
  },
1440
1440
  extendPositionValidator: {
1441
- cid: "QmZyaWht2hgzfPAzPnCXFhA7K8isENaDFLUXrG5n3d296o",
1441
+ cid: "QmZRw8DcV3MY7qt9JSYRvEtXtq675y6JHsqyx7WyvhFrFv",
1442
1442
  authorizedCidHex: cidToHex(
1443
- "QmZyaWht2hgzfPAzPnCXFhA7K8isENaDFLUXrG5n3d296o"
1443
+ "QmZRw8DcV3MY7qt9JSYRvEtXtq675y6JHsqyx7WyvhFrFv"
1444
1444
  ),
1445
1445
  name: "Extend Position Validator",
1446
1446
  description: "Production Extend Position Validator",
1447
1447
  version: "1.3.3",
1448
1448
  deployed: true,
1449
- deployedAt: 1792436909143,
1450
- size: 83869,
1451
- hash: "14bf14bcd7befa91da34565df7a579b63920d339ab8e1c7a89e937493b119ac5",
1449
+ deployedAt: 1792487408209,
1450
+ size: 84013,
1451
+ hash: "e5073a6a7e6f4731a786936b602147c9176a3fa4b19e6b8c71a79faec6837e30",
1452
1452
  validatorWalletAddress: "0xEfb258D455a31d061Bbeb3DE3D2143BdFCB67a6C",
1453
1453
  pkp: {
1454
1454
  publicKey: "0x04e52338f6a0c3362800f1a94c4c8f08be5030dde0fa217388c53d1c1a4790f4443c9f2886b2d2d8f4b75a9a156e9b028011b1a1cf7648da0e556aa980ec692836",
@@ -1456,17 +1456,17 @@ var require_pkg_src = __commonJS({
1456
1456
  }
1457
1457
  },
1458
1458
  btcWithdrawal: {
1459
- cid: "QmadaqN59k7yBkA5vnpgp1rWv4uv11Yg6dxGLvfuBXnv64",
1459
+ cid: "QmPUCksZufT1aNX8rxaPDxqfbv36oT8A73us6sdauCiBSC",
1460
1460
  authorizedCidHex: cidToHex(
1461
- "QmadaqN59k7yBkA5vnpgp1rWv4uv11Yg6dxGLvfuBXnv64"
1461
+ "QmPUCksZufT1aNX8rxaPDxqfbv36oT8A73us6sdauCiBSC"
1462
1462
  ),
1463
1463
  name: "Btc Withdrawal",
1464
1464
  description: "Production Btc Withdrawal",
1465
1465
  version: "1.3.3",
1466
1466
  deployed: true,
1467
- deployedAt: 1792436917612,
1468
- size: 102257,
1469
- hash: "3d6861750ab93776e4e904d9027a25f16ac5eb65628c3c614635151e79f0fee7",
1467
+ deployedAt: 1792487416965,
1468
+ size: 102401,
1469
+ hash: "aebb2a8721cd919bfc4754b12ca5e08ff2c776e3588994005dc5fad172bcfa42",
1470
1470
  validatorWalletAddress: "0xEfb258D455a31d061Bbeb3DE3D2143BdFCB67a6C",
1471
1471
  pkp: {
1472
1472
  publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
@@ -1474,17 +1474,17 @@ var require_pkg_src = __commonJS({
1474
1474
  }
1475
1475
  },
1476
1476
  liquidationValidator: {
1477
- cid: "QmVNXP64dMe78KVEbgk1BiAo24ztEPW4JGvbRUzbfh3z8a",
1477
+ cid: "QmRQFACoNtDVSKs95MhXPhkLL2tnv62ym31n8DXxHHghpw",
1478
1478
  authorizedCidHex: cidToHex(
1479
- "QmVNXP64dMe78KVEbgk1BiAo24ztEPW4JGvbRUzbfh3z8a"
1479
+ "QmRQFACoNtDVSKs95MhXPhkLL2tnv62ym31n8DXxHHghpw"
1480
1480
  ),
1481
1481
  name: "Liquidation Validator",
1482
1482
  description: "Production Liquidation Validator",
1483
1483
  version: "1.3.3",
1484
1484
  deployed: true,
1485
- deployedAt: 1792436926170,
1486
- size: 71333,
1487
- hash: "6171de135d55e8ab2e7486cebefb5597ac233a0d196e0ded87c14e3ff2c371d5",
1485
+ deployedAt: 1792487425791,
1486
+ size: 71477,
1487
+ hash: "f4d466f290ffb5c07ae1204f239accffb8c26ee74db947255c8031a3cb34fdcd",
1488
1488
  validatorWalletAddress: "0xEfb258D455a31d061Bbeb3DE3D2143BdFCB67a6C",
1489
1489
  pkp: {
1490
1490
  publicKey: "0x041a241de58976c13e3d7ca5a18e494f7330151e3818706135d50176e78ffb673e58b11f0b67a87c73fade6c6b27d6e7a7377ea9f4c10bf31880f1d725f18cc6f8",
@@ -1510,17 +1510,17 @@ var require_pkg_src = __commonJS({
1510
1510
  }
1511
1511
  },
1512
1512
  loanVaultBtcBalance: {
1513
- cid: "QmYnNTLtiogDfMYdL9ZxrP3Y55f798toxeZxn9LFNJgmSc",
1513
+ cid: "QmRzXY7nHYyJPi5yWKbCJNwTnxW7HcrxnAsKyiiGNmztZ5",
1514
1514
  authorizedCidHex: cidToHex(
1515
- "QmYnNTLtiogDfMYdL9ZxrP3Y55f798toxeZxn9LFNJgmSc"
1515
+ "QmRzXY7nHYyJPi5yWKbCJNwTnxW7HcrxnAsKyiiGNmztZ5"
1516
1516
  ),
1517
1517
  name: "Loan Vault Btc Balance",
1518
1518
  description: "Production Loan Vault Btc Balance",
1519
1519
  version: "1.3.3",
1520
1520
  deployed: true,
1521
- deployedAt: 1792436934787,
1522
- size: 61051,
1523
- hash: "df6a49194000ad68a93694cc5b2601d0e3c04bccf773deb0bd4c95803fe1a760",
1521
+ deployedAt: 1792487434368,
1522
+ size: 61212,
1523
+ hash: "0b6b07ceb204a790a9ab83a36597012c733572c7423dd4acf49bde1363d5e96c",
1524
1524
  validatorWalletAddress: "0xEfb258D455a31d061Bbeb3DE3D2143BdFCB67a6C",
1525
1525
  pkp: {
1526
1526
  publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
@@ -1622,17 +1622,17 @@ var require_pkg_src = __commonJS({
1622
1622
  hash: "a04848a16b411362aa7a5ff05ad7c93adc6a1368ef2c5f25dcfbe7c225ff5d1f"
1623
1623
  },
1624
1624
  carryCollateralAttestation: {
1625
- cid: "QmQxCUv2ihnGbQ95dxkjZUaSB8fvg6ri4LN8UQdHTeGWvo",
1625
+ cid: "QmXq8oBGZEP39pAGYe5vMvzMYUHmSVDcBb4o8XYotEE79m",
1626
1626
  authorizedCidHex: cidToHex(
1627
- "QmQxCUv2ihnGbQ95dxkjZUaSB8fvg6ri4LN8UQdHTeGWvo"
1627
+ "QmXq8oBGZEP39pAGYe5vMvzMYUHmSVDcBb4o8XYotEE79m"
1628
1628
  ),
1629
1629
  name: "Carry Collateral Attestation",
1630
1630
  description: "LoanCarryVault collateral attestation (borrower, BTC vault, confirmed BTC)",
1631
1631
  version: "1.1.3",
1632
1632
  deployed: true,
1633
- deployedAt: 1792436994070,
1634
- size: 22131,
1635
- hash: "bad8d5ce3c87985f7b6e6b74581e3e7eb0a9c6ddf4856e460d3e0b2adce00be5"
1633
+ deployedAt: 1792487442698,
1634
+ size: 22275,
1635
+ hash: "0a4203a829b9af30f694190137f80b278b438fe2f885596dba469a6811ca1008"
1636
1636
  },
1637
1637
  carryFundingAttestation: {
1638
1638
  cid: "QmWhox3xUZMNR5NpPZ9WLSPC5GoW4ms88GanVRKr8uuS3W",
@@ -2944,6 +2944,9 @@ ${errorReport}`);
2944
2944
  }
2945
2945
  var VaultSnapshotModule = class {
2946
2946
  constructor(config) {
2947
+ if (!Number.isInteger(config.chainId) || config.chainId <= 0) {
2948
+ throw new Error(`VaultSnapshotModule requires a positive integer chainId, got ${String(config.chainId)}`);
2949
+ }
2947
2950
  this.config = config;
2948
2951
  }
2949
2952
  /**
@@ -2972,8 +2975,7 @@ ${errorReport}`);
2972
2975
  loanOpsManagerAddress: this.config.loanOpsManagerAddress,
2973
2976
  liquidationManagerAddress: this.config.liquidationManagerAddress,
2974
2977
  chain: this.config.chain,
2975
- chainId: this.config.chainId || 1,
2976
- // Default to mainnet if not provided
2978
+ chainId: this.config.chainId,
2977
2979
  rpcUrl: this.config.rpcUrl,
2978
2980
  drpcKey: this.config.drpcKey
2979
2981
  });
@@ -5452,6 +5454,10 @@ ${auth.clientId}`;
5452
5454
  return policy;
5453
5455
  }
5454
5456
  async function executeVaultSnapshot(params) {
5457
+ const chainId = params.chainId;
5458
+ if (chainId === void 0 || !Number.isInteger(chainId) || chainId <= 0) {
5459
+ throw new Error(`executeVaultSnapshot requires a positive integer chainId, got ${String(chainId)}`);
5460
+ }
5455
5461
  global.ethers = {
5456
5462
  ...import_ethers25.ethers,
5457
5463
  providers: {
@@ -5491,8 +5497,7 @@ ${auth.clientId}`;
5491
5497
  const vaultBalance = createVaultBalanceModule({
5492
5498
  contractAddress: params.loanOpsManagerAddress,
5493
5499
  chain: params.chain,
5494
- chainId: params.chainId || 1,
5495
- // Default to mainnet if not provided
5500
+ chainId,
5496
5501
  rpcUrl: params.rpcUrl,
5497
5502
  bitcoinProvider,
5498
5503
  minConfirmations: params.minConfirmations ?? getChainPolicy(params.chain).minBitcoinBalanceConfirmations
@@ -5503,7 +5508,7 @@ ${auth.clientId}`;
5503
5508
  loanOpsManagerAddress: params.loanOpsManagerAddress,
5504
5509
  liquidationManagerAddress: params.liquidationManagerAddress,
5505
5510
  chain: params.chain,
5506
- chainId: params.chainId,
5511
+ chainId,
5507
5512
  rpcUrl: params.rpcUrl,
5508
5513
  vaultBalance,
5509
5514
  priceOracle
@@ -6554,8 +6559,8 @@ var MINT_UCD_GAS_CEILING = BigInt(13e5);
6554
6559
  var WITHDRAW_BTC_GAS_CEILING = BigInt(3e6);
6555
6560
  var MAKE_PAYMENT_GAS_CEILING = BigInt(1e6);
6556
6561
  var EXTEND_POSITION_GAS_CEILING = BigInt(1e6);
6557
- var LIQUIDATION_COMMIT_GAS_CEILING = BigInt(1e6);
6558
- var LIQUIDATION_REVEAL_GAS_CEILING = BigInt(2e6);
6562
+ var LIQUIDATION_COMMIT_GAS_CEILING = BigInt(2e6);
6563
+ var LIQUIDATION_REVEAL_GAS_CEILING = BigInt(25e5);
6559
6564
  var FEE_HISTORY_BLOCK_COUNT = 20;
6560
6565
  var FEE_HISTORY_REWARD_PERCENTILE = 75;
6561
6566
  function isJsonRpcSendable(provider) {
@@ -20727,6 +20732,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
20727
20732
  { fragment: "error FeeOnTransferNotSupported()", contracts: ["SimplePSMV2"] },
20728
20733
  { fragment: "error FeeTooHigh(uint256 fee, uint256 max)", contracts: ["PositionManagerErrors"] },
20729
20734
  { fragment: "error FeeTooLow(uint256 fee, uint256 min)", contracts: ["PositionManagerErrors"] },
20735
+ { fragment: "error GlobalReentrancyGuardReentrantCall()", contracts: ["PositionManager", "CollateralManagerModule"] },
20730
20736
  { fragment: "error ImplNotDeployed()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
20731
20737
  { fragment: "error ImplementationNotDeployed()", contracts: ["UCDController"] },
20732
20738
  { fragment: "error InitialBalanceTooLarge()", contracts: ["SimplePSMV2"] },
@@ -23960,7 +23966,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
23960
23966
  ),
23961
23967
  litActionResult.signature || "0x",
23962
23968
  { gasLimit: LIQUIDATION_COMMIT_GAS_CEILING }
23963
- // see definition: provisional, unverified against a real liquidation
23969
+ // see definition: measured on Sepolia 2026-10-20
23964
23970
  );
23965
23971
  const commitReceipt = await commitTx.wait();
23966
23972
  if (this.config.debug) {
@@ -24059,7 +24065,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
24059
24065
  revealResult.signature || "0x",
24060
24066
  BigInt(revealDeadline.toString()),
24061
24067
  { gasLimit: LIQUIDATION_REVEAL_GAS_CEILING }
24062
- // see definition: provisional, unverified against a real liquidation
24068
+ // see definition: measured on Sepolia 2026-10-20
24063
24069
  );
24064
24070
  if (this.config.debug) {
24065
24071
  log.info(` \u{1F4E4} Reveal TX submitted`, { txHash: revealTx.hash });
@@ -26828,7 +26834,9 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
26828
26834
  const result = await this.executeBTCWithdrawal({
26829
26835
  positionId,
26830
26836
  utxoIdentifier,
26831
- utxoSatoshis: spend.satoshis,
26837
+ // uint256 decodes to bigint; the Phase-2 request is JSON-serialized, so a bigint
26838
+ // here failed every retry with "Do not know how to serialize a BigInt".
26839
+ utxoSatoshis: Number(spend.satoshis),
26832
26840
  networkFee,
26833
26841
  destination: spend.targetAddress,
26834
26842
  // CRIT-1: bind the on-chain-authorized targetAmount into the
@@ -29235,7 +29243,10 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
29235
29243
  const intentSignature = await signer.signMessage((0, import_ethers23.getBytes)(intentHash));
29236
29244
  const response = await fetch(endpoint, {
29237
29245
  method: "POST",
29238
- headers: { "Content-Type": "application/json" },
29246
+ headers: {
29247
+ "Content-Type": "application/json",
29248
+ ...await this.getAuthHeader()
29249
+ },
29239
29250
  body: JSON.stringify({
29240
29251
  positionId: params.positionId,
29241
29252
  liquidatorAddress: params.liquidatorAddress,