@gvnrdao/dh-sdk 0.0.298 → 0.0.299

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.
@@ -136,9 +136,9 @@ var SEPOLIA_DEPLOYMENT = {
136
136
  reason: "Shared upgrade script: PositionManagerCoreModule implementation update"
137
137
  },
138
138
  CollateralManagerModule: {
139
- previousImplementation: "0xd47FE9126daE9A1e0fFdaCf539BE7345D3642bcb",
140
- newImplementation: "0xC232E95951303828CF66eaf76181A7956144d27a",
141
- upgradedAt: "2026-07-03T20:00:13.567Z",
139
+ previousImplementation: "0xCf5d2b210C8e30bE8e05bFC79593b9439b8b9670",
140
+ newImplementation: "0xF57BBbb4818371605e308228A04F8Ec4Dcc5E7Ba",
141
+ upgradedAt: "2026-07-07T16:59:13.883Z",
142
142
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
143
143
  reason: "Shared upgrade script: CollateralManagerModule implementation update"
144
144
  },
@@ -214,6 +214,13 @@ var SEPOLIA_DEPLOYMENT = {
214
214
  upgradedAt: "2026-05-27T12:16:13.356Z",
215
215
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
216
216
  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."
217
+ },
218
+ BitcoinWithdrawalAddressRegistry: {
219
+ previousImplementation: "0xFF270BC4470dBA80430Bd1a3a66EB691599354fA",
220
+ newImplementation: "0x76E0a2c9d89562fD7c50b5f554d7fa25957e39Db",
221
+ upgradedAt: "2026-07-07T16:56:49.844Z",
222
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
223
+ reason: "Shared upgrade script: BitcoinWithdrawalAddressRegistry implementation update"
217
224
  }
218
225
  },
219
226
  history: {
@@ -103,9 +103,9 @@ var SEPOLIA_DEPLOYMENT = {
103
103
  reason: "Shared upgrade script: PositionManagerCoreModule implementation update"
104
104
  },
105
105
  CollateralManagerModule: {
106
- previousImplementation: "0xd47FE9126daE9A1e0fFdaCf539BE7345D3642bcb",
107
- newImplementation: "0xC232E95951303828CF66eaf76181A7956144d27a",
108
- upgradedAt: "2026-07-03T20:00:13.567Z",
106
+ previousImplementation: "0xCf5d2b210C8e30bE8e05bFC79593b9439b8b9670",
107
+ newImplementation: "0xF57BBbb4818371605e308228A04F8Ec4Dcc5E7Ba",
108
+ upgradedAt: "2026-07-07T16:59:13.883Z",
109
109
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
110
110
  reason: "Shared upgrade script: CollateralManagerModule implementation update"
111
111
  },
@@ -181,6 +181,13 @@ var SEPOLIA_DEPLOYMENT = {
181
181
  upgradedAt: "2026-05-27T12:16:13.356Z",
182
182
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
183
183
  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."
184
+ },
185
+ BitcoinWithdrawalAddressRegistry: {
186
+ previousImplementation: "0xFF270BC4470dBA80430Bd1a3a66EB691599354fA",
187
+ newImplementation: "0x76E0a2c9d89562fD7c50b5f554d7fa25957e39Db",
188
+ upgradedAt: "2026-07-07T16:56:49.844Z",
189
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
190
+ reason: "Shared upgrade script: BitcoinWithdrawalAddressRegistry implementation update"
184
191
  }
185
192
  },
186
193
  history: {
package/dist/index.js CHANGED
@@ -161,9 +161,9 @@ var init_deployment_addresses = __esm({
161
161
  reason: "Shared upgrade script: PositionManagerCoreModule implementation update"
162
162
  },
163
163
  CollateralManagerModule: {
164
- previousImplementation: "0xd47FE9126daE9A1e0fFdaCf539BE7345D3642bcb",
165
- newImplementation: "0xC232E95951303828CF66eaf76181A7956144d27a",
166
- upgradedAt: "2026-07-03T20:00:13.567Z",
164
+ previousImplementation: "0xCf5d2b210C8e30bE8e05bFC79593b9439b8b9670",
165
+ newImplementation: "0xF57BBbb4818371605e308228A04F8Ec4Dcc5E7Ba",
166
+ upgradedAt: "2026-07-07T16:59:13.883Z",
167
167
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
168
168
  reason: "Shared upgrade script: CollateralManagerModule implementation update"
169
169
  },
@@ -239,6 +239,13 @@ var init_deployment_addresses = __esm({
239
239
  upgradedAt: "2026-05-27T12:16:13.356Z",
240
240
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
241
241
  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."
242
+ },
243
+ BitcoinWithdrawalAddressRegistry: {
244
+ previousImplementation: "0xFF270BC4470dBA80430Bd1a3a66EB691599354fA",
245
+ newImplementation: "0x76E0a2c9d89562fD7c50b5f554d7fa25957e39Db",
246
+ upgradedAt: "2026-07-07T16:56:49.844Z",
247
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
248
+ reason: "Shared upgrade script: BitcoinWithdrawalAddressRegistry implementation update"
242
249
  }
243
250
  },
244
251
  history: {
@@ -15958,8 +15965,8 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
15958
15965
  };
15959
15966
  }
15960
15967
  }
15961
- const network2 = await this.getProviderOrThrow().getNetwork();
15962
- const chainId = Number(network2.chainId);
15968
+ const network = await this.getProviderOrThrow().getNetwork();
15969
+ const chainId = Number(network.chainId);
15963
15970
  const signer2 = this.getSignerOrThrow();
15964
15971
  const contracts = {
15965
15972
  PositionManager: this.config.contractAddresses?.positionManager || "",
@@ -15987,10 +15994,10 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
15987
15994
  ` UCDController: ${contracts?.UCDController || "MISSING"}`
15988
15995
  );
15989
15996
  }
15990
- const chain = this.config.chain || (Number(network2.chainId) === 1 ? "ethereum" : "sepolia");
15997
+ const chain = this.config.chain || (Number(network.chainId) === 1 ? "ethereum" : "sepolia");
15991
15998
  const devBitcoinProviderUrl = request.customBitcoinRpcUrl || this.config.bitcoinProviders?.[0]?.url;
15992
15999
  if (this.config.debug) {
15993
- log.info(` Network: ${chain} (chainId: ${network2.chainId})`);
16000
+ log.info(` Network: ${chain} (chainId: ${network.chainId})`);
15994
16001
  }
15995
16002
  const MAX_RETRIES = 3;
15996
16003
  const RETRY_DELAY_MS = 2e3;
@@ -16613,10 +16620,6 @@ Position: ${request.positionId}`
16613
16620
  if (!signerProvider) {
16614
16621
  throw new Error("Signer must have a provider attached");
16615
16622
  }
16616
- const network = await signerProvider.getNetwork();
16617
- const networkChainIdNum = Number(network.chainId);
16618
- const isSepolia = networkChainIdNum === 11155111;
16619
- const isLocalhost = networkChainIdNum === 1337 || networkChainIdNum === 31337;
16620
16623
  const MAX_SKEW_SECONDS = 300;
16621
16624
  const FINAL_SAFETY_MARGIN = 60;
16622
16625
  const QUANTUM_WINDOW_SECONDS2 = 60;
@@ -16819,24 +16822,18 @@ Message: ${errorMessage}`
16819
16822
  Error data: ${errorData || "none"}`
16820
16823
  );
16821
16824
  }
16822
- if (isSepolia || isLocalhost) {
16823
- if (this.config.debug) {
16824
- log.info(
16825
- "\u2705 Static call OK \u2014 broadcasting mintUCD with gas ceiling (Sepolia)",
16826
- {}
16827
- );
16828
- }
16829
- tx = await sendEip1559Transaction({
16830
- signer,
16831
- to: positionManagerAddress,
16832
- data: mintCalldata,
16833
- gasLimit: MINT_UCD_GAS_CEILING
16834
- });
16835
- } else {
16836
- throw new Error(
16837
- `mintUCD: eth_estimateGas failed (chainId ${network.chainId}). Static call succeeded; fixed gas ceiling fallback is only supported on Sepolia (11155111) and localhost.`
16825
+ if (this.config.debug) {
16826
+ log.info(
16827
+ "\u2705 Static call OK \u2014 broadcasting mintUCD with fixed gas ceiling",
16828
+ {}
16838
16829
  );
16839
16830
  }
16831
+ tx = await sendEip1559Transaction({
16832
+ signer,
16833
+ to: positionManagerAddress,
16834
+ data: mintCalldata,
16835
+ gasLimit: MINT_UCD_GAS_CEILING
16836
+ });
16840
16837
  }
16841
16838
  const receipt = await signerProvider.waitForTransaction(
16842
16839
  tx.hash,
package/dist/index.mjs CHANGED
@@ -167,9 +167,9 @@ var init_deployment_addresses = __esm({
167
167
  reason: "Shared upgrade script: PositionManagerCoreModule implementation update"
168
168
  },
169
169
  CollateralManagerModule: {
170
- previousImplementation: "0xd47FE9126daE9A1e0fFdaCf539BE7345D3642bcb",
171
- newImplementation: "0xC232E95951303828CF66eaf76181A7956144d27a",
172
- upgradedAt: "2026-07-03T20:00:13.567Z",
170
+ previousImplementation: "0xCf5d2b210C8e30bE8e05bFC79593b9439b8b9670",
171
+ newImplementation: "0xF57BBbb4818371605e308228A04F8Ec4Dcc5E7Ba",
172
+ upgradedAt: "2026-07-07T16:59:13.883Z",
173
173
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
174
174
  reason: "Shared upgrade script: CollateralManagerModule implementation update"
175
175
  },
@@ -245,6 +245,13 @@ var init_deployment_addresses = __esm({
245
245
  upgradedAt: "2026-05-27T12:16:13.356Z",
246
246
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
247
247
  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."
248
+ },
249
+ BitcoinWithdrawalAddressRegistry: {
250
+ previousImplementation: "0xFF270BC4470dBA80430Bd1a3a66EB691599354fA",
251
+ newImplementation: "0x76E0a2c9d89562fD7c50b5f554d7fa25957e39Db",
252
+ upgradedAt: "2026-07-07T16:56:49.844Z",
253
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
254
+ reason: "Shared upgrade script: BitcoinWithdrawalAddressRegistry implementation update"
248
255
  }
249
256
  },
250
257
  history: {
@@ -15886,8 +15893,8 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
15886
15893
  };
15887
15894
  }
15888
15895
  }
15889
- const network2 = await this.getProviderOrThrow().getNetwork();
15890
- const chainId = Number(network2.chainId);
15896
+ const network = await this.getProviderOrThrow().getNetwork();
15897
+ const chainId = Number(network.chainId);
15891
15898
  const signer2 = this.getSignerOrThrow();
15892
15899
  const contracts = {
15893
15900
  PositionManager: this.config.contractAddresses?.positionManager || "",
@@ -15915,10 +15922,10 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
15915
15922
  ` UCDController: ${contracts?.UCDController || "MISSING"}`
15916
15923
  );
15917
15924
  }
15918
- const chain = this.config.chain || (Number(network2.chainId) === 1 ? "ethereum" : "sepolia");
15925
+ const chain = this.config.chain || (Number(network.chainId) === 1 ? "ethereum" : "sepolia");
15919
15926
  const devBitcoinProviderUrl = request.customBitcoinRpcUrl || this.config.bitcoinProviders?.[0]?.url;
15920
15927
  if (this.config.debug) {
15921
- log.info(` Network: ${chain} (chainId: ${network2.chainId})`);
15928
+ log.info(` Network: ${chain} (chainId: ${network.chainId})`);
15922
15929
  }
15923
15930
  const MAX_RETRIES = 3;
15924
15931
  const RETRY_DELAY_MS = 2e3;
@@ -16541,10 +16548,6 @@ Position: ${request.positionId}`
16541
16548
  if (!signerProvider) {
16542
16549
  throw new Error("Signer must have a provider attached");
16543
16550
  }
16544
- const network = await signerProvider.getNetwork();
16545
- const networkChainIdNum = Number(network.chainId);
16546
- const isSepolia = networkChainIdNum === 11155111;
16547
- const isLocalhost = networkChainIdNum === 1337 || networkChainIdNum === 31337;
16548
16551
  const MAX_SKEW_SECONDS = 300;
16549
16552
  const FINAL_SAFETY_MARGIN = 60;
16550
16553
  const QUANTUM_WINDOW_SECONDS2 = 60;
@@ -16747,24 +16750,18 @@ Message: ${errorMessage}`
16747
16750
  Error data: ${errorData || "none"}`
16748
16751
  );
16749
16752
  }
16750
- if (isSepolia || isLocalhost) {
16751
- if (this.config.debug) {
16752
- log.info(
16753
- "\u2705 Static call OK \u2014 broadcasting mintUCD with gas ceiling (Sepolia)",
16754
- {}
16755
- );
16756
- }
16757
- tx = await sendEip1559Transaction({
16758
- signer,
16759
- to: positionManagerAddress,
16760
- data: mintCalldata,
16761
- gasLimit: MINT_UCD_GAS_CEILING
16762
- });
16763
- } else {
16764
- throw new Error(
16765
- `mintUCD: eth_estimateGas failed (chainId ${network.chainId}). Static call succeeded; fixed gas ceiling fallback is only supported on Sepolia (11155111) and localhost.`
16753
+ if (this.config.debug) {
16754
+ log.info(
16755
+ "\u2705 Static call OK \u2014 broadcasting mintUCD with fixed gas ceiling",
16756
+ {}
16766
16757
  );
16767
16758
  }
16759
+ tx = await sendEip1559Transaction({
16760
+ signer,
16761
+ to: positionManagerAddress,
16762
+ data: mintCalldata,
16763
+ gasLimit: MINT_UCD_GAS_CEILING
16764
+ });
16768
16765
  }
16769
16766
  const receipt = await signerProvider.waitForTransaction(
16770
16767
  tx.hash,
@@ -8,8 +8,9 @@ import { type Provider, type Signer, type TransactionResponse } from "ethers";
8
8
  * estimateContractCallGasWithMargin() (real eth_estimateGas + 25% margin) on
9
9
  * mainnet, so this value is NOT normally what gets submitted -- it only
10
10
  * becomes the literal gasLimit if (a) the estimate comes back anomalously
11
- * high, or (b) eth_estimateGas itself fails, which is a hard error on
12
- * mainnet and only falls back to this raw value on Sepolia/localhost.
11
+ * high, or (b) eth_estimateGas itself fails (some RPCs return bare 0x even
12
+ * for valid txs), in which case after a static call proves the tx valid —
13
+ * this raw value is used as the gasLimit on any chain.
13
14
  * Previously 10,000,000 with a comment claiming "mintUCD + LIT validation
14
15
  * can exceed 7M gas" -- no evidence of that was found across 16 real mint
15
16
  * transactions checked (1 mainnet, 15 recent Sepolia, 2026-07-02): the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gvnrdao/dh-sdk",
3
- "version": "0.0.298",
3
+ "version": "0.0.299",
4
4
  "description": "TypeScript SDK for Diamond Hands Protocol - Bitcoin-backed lending with LIT Protocol PKPs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",