@gearbox-protocol/sdk 13.6.0-apy-plugin.4 → 13.6.0-apy-plugin.6

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.
@@ -73,7 +73,7 @@ const adapterActionSignatures = {
73
73
  310: "function setPairStatusBatch((address,address,address,uint8)[])",
74
74
  311: "function setPairStatusBatch((address,address,address,uint8,uint8)[])"
75
75
  },
76
- [import_types.AdapterType.TRADERJOE_ROUTER]: {
76
+ [import_types.AdapterType.TRADER_JOE_ROUTER]: {
77
77
  310: "function setPoolStatusBatch((address,address,uint256,uint8,bool)[])"
78
78
  },
79
79
  [import_types.AdapterType.UNISWAP_V2_ROUTER]: {
@@ -72,7 +72,7 @@ const adapterConstructorAbi = {
72
72
  [import_types.AdapterType.DAI_USDS_EXCHANGE]: {
73
73
  310: import_conctructorAbiPatterns.BASIC_ADAPTER_ABI
74
74
  },
75
- [import_types.AdapterType.TRADERJOE_ROUTER]: {
75
+ [import_types.AdapterType.TRADER_JOE_ROUTER]: {
76
76
  310: import_conctructorAbiPatterns.BASIC_ADAPTER_ABI
77
77
  },
78
78
  [import_types.AdapterType.UNISWAP_V2_ROUTER]: {
@@ -93,7 +93,7 @@ function createAdapter(options, data, strict) {
93
93
  return new import_contracts.PendleRouterAdapterContract(options, data);
94
94
  case "ADAPTER::STAKING_REWARDS":
95
95
  return new import_contracts.StakingRewardsAdapterContract(options, data);
96
- case "ADAPTER::TRADERJOE_ROUTER":
96
+ case "ADAPTER::TRADER_JOE_ROUTER":
97
97
  return new import_contracts.TraderJoeRouterAdapterContract(options, data);
98
98
  case "ADAPTER::UNISWAP_V2_ROUTER":
99
99
  return new import_contracts.UniswapV2AdapterContract(options, data);
@@ -59,7 +59,7 @@ var AdapterType = /* @__PURE__ */ ((AdapterType2) => {
59
59
  AdapterType2["MIDAS_REDEMPTION_VAULT"] = "MIDAS_REDEMPTION_VAULT";
60
60
  AdapterType2["PENDLE_ROUTER"] = "PENDLE_ROUTER";
61
61
  AdapterType2["STAKING_REWARDS"] = "STAKING_REWARDS";
62
- AdapterType2["TRADERJOE_ROUTER"] = "TRADERJOE_ROUTER";
62
+ AdapterType2["TRADER_JOE_ROUTER"] = "TRADER_JOE_ROUTER";
63
63
  AdapterType2["UNISWAP_V2_ROUTER"] = "UNISWAP_V2_ROUTER";
64
64
  AdapterType2["UNISWAP_V3_ROUTER"] = "UNISWAP_V3_ROUTER";
65
65
  AdapterType2["UNISWAP_V4_GATEWAY"] = "UNISWAP_V4_GATEWAY";
@@ -190,7 +190,7 @@ class GearboxSDK extends import_base.ChainContractsRegister {
190
190
  plugin.sdk = this;
191
191
  }
192
192
  if (options.gasLimit !== null) {
193
- this.gasLimit = options.gasLimit || 550000000n;
193
+ this.gasLimit = options.gasLimit || (0, import_chain.getChain)(this.networkType).gasLimit;
194
194
  }
195
195
  }
196
196
  async #attach(opts) {
@@ -86,7 +86,8 @@ const chains = {
86
86
  address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
87
87
  symbol: "USDC"
88
88
  },
89
- firstBlock: 22358644n
89
+ firstBlock: 22358644n,
90
+ gasLimit: 550000000n
90
91
  },
91
92
  "ethereum-rpc"
92
93
  ),
@@ -102,7 +103,8 @@ const chains = {
102
103
  address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
103
104
  symbol: "USDC"
104
105
  },
105
- firstBlock: 184650310n
106
+ firstBlock: 184650310n,
107
+ gasLimit: 550000000n
106
108
  },
107
109
  "arbitrum-one-rpc"
108
110
  ),
@@ -119,7 +121,8 @@ const chains = {
119
121
  address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
120
122
  symbol: "USDC"
121
123
  },
122
- firstBlock: 118410666n
124
+ firstBlock: 118410666n,
125
+ gasLimit: 550000000n
123
126
  },
124
127
  "optimism-rpc"
125
128
  ),
@@ -132,7 +135,8 @@ const chains = {
132
135
  wellKnownToken: {
133
136
  address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
134
137
  symbol: "USDC"
135
- }
138
+ },
139
+ gasLimit: 550000000n
136
140
  },
137
141
  "base-rpc"
138
142
  ),
@@ -155,6 +159,7 @@ const chains = {
155
159
  address: "0x29219dd400f2Bf60E5a23d13Be72B486D4038894",
156
160
  symbol: "USDC"
157
161
  },
162
+ gasLimit: 550000000n,
158
163
  firstBlock: 9779380n
159
164
  }),
160
165
  "sonic-rpc"
@@ -167,7 +172,8 @@ const chains = {
167
172
  wellKnownToken: {
168
173
  address: "0xFAfDdbb3FC7688494971a79cc65DCa3EF82079E7",
169
174
  symbol: "USDm"
170
- }
175
+ },
176
+ gasLimit: 550000000n
171
177
  }),
172
178
  // NOTE: Monad chain configs should be updated once the public mainnet is available
173
179
  Monad: (0, import_viem.defineChain)({
@@ -188,7 +194,8 @@ const chains = {
188
194
  address: "0xe7cd86e13AC4309349F30B3435a9d337750fC82D",
189
195
  symbol: "USDT0"
190
196
  },
191
- firstBlock: 34650262n
197
+ firstBlock: 34650262n,
198
+ gasLimit: 200000000n
192
199
  }),
193
200
  Berachain: withPublicNode(
194
201
  {
@@ -206,7 +213,8 @@ const chains = {
206
213
  wellKnownToken: {
207
214
  address: "0x549943e04f40284185054145c6e4e9568c1d3241",
208
215
  symbol: "USDC.e"
209
- }
216
+ },
217
+ gasLimit: 550000000n
210
218
  },
211
219
  "berachain-rpc"
212
220
  ),
@@ -219,7 +227,8 @@ const chains = {
219
227
  wellKnownToken: {
220
228
  address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
221
229
  symbol: "USDC"
222
- }
230
+ },
231
+ gasLimit: 550000000n
223
232
  },
224
233
  "avalanche-c-chain-rpc"
225
234
  ),
@@ -237,7 +246,8 @@ const chains = {
237
246
  address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
238
247
  symbol: "USDC"
239
248
  },
240
- firstBlock: 48761804n
249
+ firstBlock: 48761804n,
250
+ gasLimit: 550000000n
241
251
  },
242
252
  "bsc-rpc"
243
253
  ),
@@ -249,8 +259,9 @@ const chains = {
249
259
  wellKnownToken: {
250
260
  address: "0x79a02482a880bce3f13e09da970dc34db4cd24d1",
251
261
  symbol: "USDC"
252
- }
262
+ },
253
263
  // TODO: has no block explorer API
264
+ gasLimit: 550000000n
254
265
  }),
255
266
  Etherlink: (0, import_viem.defineChain)({
256
267
  ...import_chains.etherlink,
@@ -263,7 +274,8 @@ const chains = {
263
274
  address: "0x796Ea11Fa2dD751eD01b53C372fFDB4AAa8f00F9",
264
275
  symbol: "USDC"
265
276
  },
266
- firstBlock: 16672963n
277
+ firstBlock: 16672963n,
278
+ gasLimit: 550000000n
267
279
  }),
268
280
  Hemi: (0, import_viem.defineChain)({
269
281
  ...import_chains.hemi,
@@ -281,7 +293,8 @@ const chains = {
281
293
  address: "0xcA11bde05977b3631167028862bE2a173976CA11",
282
294
  blockCreated: 484490
283
295
  }
284
- }
296
+ },
297
+ gasLimit: 550000000n
285
298
  }),
286
299
  Lisk: (0, import_viem.defineChain)({
287
300
  ...import_chains.lisk,
@@ -293,7 +306,8 @@ const chains = {
293
306
  wellKnownToken: {
294
307
  address: "0xF242275d3a6527d877f2c927a82D9b057609cc71",
295
308
  symbol: "USDC.e"
296
- }
309
+ },
310
+ gasLimit: 550000000n
297
311
  }),
298
312
  Plasma: (0, import_viem.defineChain)({
299
313
  ...import_chains.plasma,
@@ -314,7 +328,8 @@ const chains = {
314
328
  address: "0xcA11bde05977b3631167028862bE2a173976CA11"
315
329
  }
316
330
  },
317
- firstBlock: 670913n
331
+ firstBlock: 670913n,
332
+ gasLimit: 550000000n
318
333
  }),
319
334
  Somnia: (0, import_viem.defineChain)({
320
335
  ...import_chains.somnia,
@@ -334,7 +349,8 @@ const chains = {
334
349
  address: "0x67B302E35Aef5EEE8c32D934F5856869EF428330",
335
350
  symbol: "USDT"
336
351
  },
337
- firstBlock: 147687380n
352
+ firstBlock: 147687380n,
353
+ gasLimit: 550000000n
338
354
  })
339
355
  };
340
356
  const networkByChainId = Object.values(chains).reduce((acc, chain) => {
@@ -74,7 +74,7 @@ const SDKOptions = import_v4.z.object({
74
74
  /**
75
75
  * Explicit gas limit for read-only `eth_call` requests.
76
76
  * `null` disables the gas limit entirely; `undefined` uses the SDK default.
77
- * Default gas limit is 550_000_000 (550M).
77
+ * Default to value from {@link GearboxChain.gasLimit}
78
78
  **/
79
79
  gasLimit: import_v4.z.bigint().nonnegative().nullable().optional()
80
80
  });
@@ -24,6 +24,8 @@ __export(simulateWithPriceUpdates_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(simulateWithPriceUpdates_exports);
26
26
  var import_viem = require("viem");
27
+ var import_actions = require("viem/actions");
28
+ var import_utils = require("viem/utils");
27
29
  var import_errors = require("../../../abi/errors.js");
28
30
  var import_iUpdatablePriceFeed = require("../../../abi/iUpdatablePriceFeed.js");
29
31
  var import_cast = require("./cast.js");
@@ -53,6 +55,41 @@ async function simulateWithPriceUpdates(client, parameters) {
53
55
  "client chain not configured. multicallAddress is required."
54
56
  );
55
57
  }
58
+ if (priceUpdates.length === 0 && restContracts.length === 1) {
59
+ const contract = restContracts[0];
60
+ const { abi, address, args, functionName } = contract;
61
+ const callData = (0, import_viem.encodeFunctionData)({ abi, args, functionName });
62
+ const request2 = {
63
+ batch: false,
64
+ data: callData,
65
+ to: address,
66
+ blockNumber: rest.blockNumber,
67
+ blockTag: rest.blockTag,
68
+ gas: rest.gas,
69
+ account: rest.account ? (0, import_utils.parseAccount)(rest.account) : client.account,
70
+ value: rest.value
71
+ };
72
+ try {
73
+ const { data } = await (0, import_utils.getAction)(client, import_actions.call, "call")(request2);
74
+ const result = (0, import_viem.decodeFunctionResult)({
75
+ abi,
76
+ args,
77
+ data: data || "0x",
78
+ functionName
79
+ });
80
+ return [
81
+ result
82
+ ];
83
+ } catch (e) {
84
+ throw getSimulateWithPriceUpdatesError(
85
+ e,
86
+ priceUpdates,
87
+ restContracts,
88
+ void 0,
89
+ request2
90
+ );
91
+ }
92
+ }
56
93
  let request;
57
94
  try {
58
95
  const contracts = [
@@ -173,8 +210,8 @@ function getSimulateWithPriceUpdatesError(cause, priceUpdates, calls, results, r
173
210
  return [extractCallError(result), p.pretty, tsValid].filter(Boolean).join(" ");
174
211
  });
175
212
  const prettyCalls = callsResults.map((c, i) => {
176
- const call = calls[i];
177
- return [extractCallError(c), `${call.address}.${call.functionName}`].filter(Boolean).join(" ");
213
+ const call2 = calls[i];
214
+ return [extractCallError(c), `${call2.address}.${call2.functionName}`].filter(Boolean).join(" ");
178
215
  });
179
216
  if (results[0]?.status === "failure") {
180
217
  prettyCalls.unshift(
@@ -48,7 +48,7 @@ const adapterActionSignatures = {
48
48
  310: "function setPairStatusBatch((address,address,address,uint8)[])",
49
49
  311: "function setPairStatusBatch((address,address,address,uint8,uint8)[])"
50
50
  },
51
- [AdapterType.TRADERJOE_ROUTER]: {
51
+ [AdapterType.TRADER_JOE_ROUTER]: {
52
52
  310: "function setPoolStatusBatch((address,address,uint256,uint8,bool)[])"
53
53
  },
54
54
  [AdapterType.UNISWAP_V2_ROUTER]: {
@@ -63,7 +63,7 @@ const adapterConstructorAbi = {
63
63
  [AdapterType.DAI_USDS_EXCHANGE]: {
64
64
  310: BASIC_ADAPTER_ABI
65
65
  },
66
- [AdapterType.TRADERJOE_ROUTER]: {
66
+ [AdapterType.TRADER_JOE_ROUTER]: {
67
67
  310: BASIC_ADAPTER_ABI
68
68
  },
69
69
  [AdapterType.UNISWAP_V2_ROUTER]: {
@@ -109,7 +109,7 @@ function createAdapter(options, data, strict) {
109
109
  return new PendleRouterAdapterContract(options, data);
110
110
  case "ADAPTER::STAKING_REWARDS":
111
111
  return new StakingRewardsAdapterContract(options, data);
112
- case "ADAPTER::TRADERJOE_ROUTER":
112
+ case "ADAPTER::TRADER_JOE_ROUTER":
113
113
  return new TraderJoeRouterAdapterContract(options, data);
114
114
  case "ADAPTER::UNISWAP_V2_ROUTER":
115
115
  return new UniswapV2AdapterContract(options, data);
@@ -36,7 +36,7 @@ var AdapterType = /* @__PURE__ */ ((AdapterType2) => {
36
36
  AdapterType2["MIDAS_REDEMPTION_VAULT"] = "MIDAS_REDEMPTION_VAULT";
37
37
  AdapterType2["PENDLE_ROUTER"] = "PENDLE_ROUTER";
38
38
  AdapterType2["STAKING_REWARDS"] = "STAKING_REWARDS";
39
- AdapterType2["TRADERJOE_ROUTER"] = "TRADERJOE_ROUTER";
39
+ AdapterType2["TRADER_JOE_ROUTER"] = "TRADER_JOE_ROUTER";
40
40
  AdapterType2["UNISWAP_V2_ROUTER"] = "UNISWAP_V2_ROUTER";
41
41
  AdapterType2["UNISWAP_V3_ROUTER"] = "UNISWAP_V3_ROUTER";
42
42
  AdapterType2["UNISWAP_V4_GATEWAY"] = "UNISWAP_V4_GATEWAY";
@@ -181,7 +181,7 @@ class GearboxSDK extends ChainContractsRegister {
181
181
  plugin.sdk = this;
182
182
  }
183
183
  if (options.gasLimit !== null) {
184
- this.gasLimit = options.gasLimit || 550000000n;
184
+ this.gasLimit = options.gasLimit || getChain(this.networkType).gasLimit;
185
185
  }
186
186
  }
187
187
  async #attach(opts) {
@@ -72,7 +72,8 @@ const chains = {
72
72
  address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
73
73
  symbol: "USDC"
74
74
  },
75
- firstBlock: 22358644n
75
+ firstBlock: 22358644n,
76
+ gasLimit: 550000000n
76
77
  },
77
78
  "ethereum-rpc"
78
79
  ),
@@ -88,7 +89,8 @@ const chains = {
88
89
  address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
89
90
  symbol: "USDC"
90
91
  },
91
- firstBlock: 184650310n
92
+ firstBlock: 184650310n,
93
+ gasLimit: 550000000n
92
94
  },
93
95
  "arbitrum-one-rpc"
94
96
  ),
@@ -105,7 +107,8 @@ const chains = {
105
107
  address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
106
108
  symbol: "USDC"
107
109
  },
108
- firstBlock: 118410666n
110
+ firstBlock: 118410666n,
111
+ gasLimit: 550000000n
109
112
  },
110
113
  "optimism-rpc"
111
114
  ),
@@ -118,7 +121,8 @@ const chains = {
118
121
  wellKnownToken: {
119
122
  address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
120
123
  symbol: "USDC"
121
- }
124
+ },
125
+ gasLimit: 550000000n
122
126
  },
123
127
  "base-rpc"
124
128
  ),
@@ -141,6 +145,7 @@ const chains = {
141
145
  address: "0x29219dd400f2Bf60E5a23d13Be72B486D4038894",
142
146
  symbol: "USDC"
143
147
  },
148
+ gasLimit: 550000000n,
144
149
  firstBlock: 9779380n
145
150
  }),
146
151
  "sonic-rpc"
@@ -153,7 +158,8 @@ const chains = {
153
158
  wellKnownToken: {
154
159
  address: "0xFAfDdbb3FC7688494971a79cc65DCa3EF82079E7",
155
160
  symbol: "USDm"
156
- }
161
+ },
162
+ gasLimit: 550000000n
157
163
  }),
158
164
  // NOTE: Monad chain configs should be updated once the public mainnet is available
159
165
  Monad: defineChain({
@@ -174,7 +180,8 @@ const chains = {
174
180
  address: "0xe7cd86e13AC4309349F30B3435a9d337750fC82D",
175
181
  symbol: "USDT0"
176
182
  },
177
- firstBlock: 34650262n
183
+ firstBlock: 34650262n,
184
+ gasLimit: 200000000n
178
185
  }),
179
186
  Berachain: withPublicNode(
180
187
  {
@@ -192,7 +199,8 @@ const chains = {
192
199
  wellKnownToken: {
193
200
  address: "0x549943e04f40284185054145c6e4e9568c1d3241",
194
201
  symbol: "USDC.e"
195
- }
202
+ },
203
+ gasLimit: 550000000n
196
204
  },
197
205
  "berachain-rpc"
198
206
  ),
@@ -205,7 +213,8 @@ const chains = {
205
213
  wellKnownToken: {
206
214
  address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
207
215
  symbol: "USDC"
208
- }
216
+ },
217
+ gasLimit: 550000000n
209
218
  },
210
219
  "avalanche-c-chain-rpc"
211
220
  ),
@@ -223,7 +232,8 @@ const chains = {
223
232
  address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
224
233
  symbol: "USDC"
225
234
  },
226
- firstBlock: 48761804n
235
+ firstBlock: 48761804n,
236
+ gasLimit: 550000000n
227
237
  },
228
238
  "bsc-rpc"
229
239
  ),
@@ -235,8 +245,9 @@ const chains = {
235
245
  wellKnownToken: {
236
246
  address: "0x79a02482a880bce3f13e09da970dc34db4cd24d1",
237
247
  symbol: "USDC"
238
- }
248
+ },
239
249
  // TODO: has no block explorer API
250
+ gasLimit: 550000000n
240
251
  }),
241
252
  Etherlink: defineChain({
242
253
  ...etherlink,
@@ -249,7 +260,8 @@ const chains = {
249
260
  address: "0x796Ea11Fa2dD751eD01b53C372fFDB4AAa8f00F9",
250
261
  symbol: "USDC"
251
262
  },
252
- firstBlock: 16672963n
263
+ firstBlock: 16672963n,
264
+ gasLimit: 550000000n
253
265
  }),
254
266
  Hemi: defineChain({
255
267
  ...hemi,
@@ -267,7 +279,8 @@ const chains = {
267
279
  address: "0xcA11bde05977b3631167028862bE2a173976CA11",
268
280
  blockCreated: 484490
269
281
  }
270
- }
282
+ },
283
+ gasLimit: 550000000n
271
284
  }),
272
285
  Lisk: defineChain({
273
286
  ...lisk,
@@ -279,7 +292,8 @@ const chains = {
279
292
  wellKnownToken: {
280
293
  address: "0xF242275d3a6527d877f2c927a82D9b057609cc71",
281
294
  symbol: "USDC.e"
282
- }
295
+ },
296
+ gasLimit: 550000000n
283
297
  }),
284
298
  Plasma: defineChain({
285
299
  ...plasma,
@@ -300,7 +314,8 @@ const chains = {
300
314
  address: "0xcA11bde05977b3631167028862bE2a173976CA11"
301
315
  }
302
316
  },
303
- firstBlock: 670913n
317
+ firstBlock: 670913n,
318
+ gasLimit: 550000000n
304
319
  }),
305
320
  Somnia: defineChain({
306
321
  ...somnia,
@@ -320,7 +335,8 @@ const chains = {
320
335
  address: "0x67B302E35Aef5EEE8c32D934F5856869EF428330",
321
336
  symbol: "USDT"
322
337
  },
323
- firstBlock: 147687380n
338
+ firstBlock: 147687380n,
339
+ gasLimit: 550000000n
324
340
  })
325
341
  };
326
342
  const networkByChainId = Object.values(chains).reduce((acc, chain) => {
@@ -54,7 +54,7 @@ const SDKOptions = z.object({
54
54
  /**
55
55
  * Explicit gas limit for read-only `eth_call` requests.
56
56
  * `null` disables the gas limit entirely; `undefined` uses the SDK default.
57
- * Default gas limit is 550_000_000 (550M).
57
+ * Default to value from {@link GearboxChain.gasLimit}
58
58
  **/
59
59
  gasLimit: z.bigint().nonnegative().nullable().optional()
60
60
  });
@@ -3,8 +3,12 @@ import {
3
3
  CallExecutionError,
4
4
  ContractFunctionRevertedError,
5
5
  decodeFunctionData,
6
+ decodeFunctionResult,
7
+ encodeFunctionData,
6
8
  parseAbi
7
9
  } from "viem";
10
+ import { call } from "viem/actions";
11
+ import { getAction, parseAccount } from "viem/utils";
8
12
  import { errorAbis } from "../../../abi/errors.js";
9
13
  import { iUpdatablePriceFeedAbi } from "../../../abi/iUpdatablePriceFeed.js";
10
14
  import { generateCastTraceCall } from "./cast.js";
@@ -34,6 +38,41 @@ async function simulateWithPriceUpdates(client, parameters) {
34
38
  "client chain not configured. multicallAddress is required."
35
39
  );
36
40
  }
41
+ if (priceUpdates.length === 0 && restContracts.length === 1) {
42
+ const contract = restContracts[0];
43
+ const { abi, address, args, functionName } = contract;
44
+ const callData = encodeFunctionData({ abi, args, functionName });
45
+ const request2 = {
46
+ batch: false,
47
+ data: callData,
48
+ to: address,
49
+ blockNumber: rest.blockNumber,
50
+ blockTag: rest.blockTag,
51
+ gas: rest.gas,
52
+ account: rest.account ? parseAccount(rest.account) : client.account,
53
+ value: rest.value
54
+ };
55
+ try {
56
+ const { data } = await getAction(client, call, "call")(request2);
57
+ const result = decodeFunctionResult({
58
+ abi,
59
+ args,
60
+ data: data || "0x",
61
+ functionName
62
+ });
63
+ return [
64
+ result
65
+ ];
66
+ } catch (e) {
67
+ throw getSimulateWithPriceUpdatesError(
68
+ e,
69
+ priceUpdates,
70
+ restContracts,
71
+ void 0,
72
+ request2
73
+ );
74
+ }
75
+ }
37
76
  let request;
38
77
  try {
39
78
  const contracts = [
@@ -154,8 +193,8 @@ function getSimulateWithPriceUpdatesError(cause, priceUpdates, calls, results, r
154
193
  return [extractCallError(result), p.pretty, tsValid].filter(Boolean).join(" ");
155
194
  });
156
195
  const prettyCalls = callsResults.map((c, i) => {
157
- const call = calls[i];
158
- return [extractCallError(c), `${call.address}.${call.functionName}`].filter(Boolean).join(" ");
196
+ const call2 = calls[i];
197
+ return [extractCallError(c), `${call2.address}.${call2.functionName}`].filter(Boolean).join(" ");
159
198
  });
160
199
  if (results[0]?.status === "failure") {
161
200
  prettyCalls.unshift(
@@ -2,7 +2,7 @@ import type { AbiParameter, Address } from "viem";
2
2
  import type { BaseContractStateHuman } from "../../sdk/types/state-human.js";
3
3
  import type { LegacyAdapterOperation } from "./legacyAdapterOperations.js";
4
4
  export type VersionedAbi = Record<number, readonly AbiParameter[]>;
5
- export type AdapterContractType = "ADAPTER::ACCOUNT_MIGRATOR" | "ADAPTER::BALANCER_V3_ROUTER" | "ADAPTER::BALANCER_V3_WRAPPER" | "ADAPTER::BALANCER_VAULT" | "ADAPTER::CAMELOT_V3_ROUTER" | "ADAPTER::CURVE_STABLE_NG" | "ADAPTER::CURVE_V1_2ASSETS" | "ADAPTER::CURVE_V1_3ASSETS" | "ADAPTER::CURVE_V1_4ASSETS" | "ADAPTER::CURVE_V1_STECRV_POOL" | "ADAPTER::CURVE_V1_WRAPPER" | "ADAPTER::CVX_V1_BASE_REWARD_POOL" | "ADAPTER::CVX_V1_BOOSTER" | "ADAPTER::DAI_USDS_EXCHANGE" | "ADAPTER::EQUALIZER_ROUTER" | "ADAPTER::ERC4626_VAULT" | "ADAPTER::ERC4626_VAULT_REFERRAL" | "ADAPTER::FLUID_DEX" | "ADAPTER::INFINIFI_GATEWAY" | "ADAPTER::INFINIFI_UNWINDING" | "ADAPTER::INFRARED_VAULT" | "ADAPTER::KELP_DEPOSIT_POOL" | "ADAPTER::KELP_WITHDRAWAL" | "ADAPTER::KODIAK_ISLAND_GATEWAY" | "ADAPTER::LIDO_V1" | "ADAPTER::LIDO_WSTETH_V1" | "ADAPTER::MELLOW_CLAIMER" | "ADAPTER::MELLOW_DVV" | "ADAPTER::MELLOW_ERC4626_VAULT" | "ADAPTER::MELLOW_LRT_VAULT" | "ADAPTER::MELLOW_WRAPPER" | "ADAPTER::MELLOW_DEPOSIT_QUEUE_QUEUE" | "ADAPTER::MELLOW_REDEEM_QUEUE_QUEUE" | "ADAPTER::MIDAS_ISSUANCE_VAULT" | "ADAPTER::MIDAS_REDEMPTION_VAULT" | "ADAPTER::PENDLE_ROUTER" | "ADAPTER::STAKING_REWARDS" | "ADAPTER::TRADERJOE_ROUTER" | "ADAPTER::UNISWAP_V2_ROUTER" | "ADAPTER::UNISWAP_V3_ROUTER" | "ADAPTER::UNISWAP_V4_GATEWAY" | "ADAPTER::UPSHIFT_VAULT" | "ADAPTER::VELODROME_V2_ROUTER" | "ADAPTER::YEARN_V2";
5
+ export type AdapterContractType = "ADAPTER::ACCOUNT_MIGRATOR" | "ADAPTER::BALANCER_V3_ROUTER" | "ADAPTER::BALANCER_V3_WRAPPER" | "ADAPTER::BALANCER_VAULT" | "ADAPTER::CAMELOT_V3_ROUTER" | "ADAPTER::CURVE_STABLE_NG" | "ADAPTER::CURVE_V1_2ASSETS" | "ADAPTER::CURVE_V1_3ASSETS" | "ADAPTER::CURVE_V1_4ASSETS" | "ADAPTER::CURVE_V1_STECRV_POOL" | "ADAPTER::CURVE_V1_WRAPPER" | "ADAPTER::CVX_V1_BASE_REWARD_POOL" | "ADAPTER::CVX_V1_BOOSTER" | "ADAPTER::DAI_USDS_EXCHANGE" | "ADAPTER::EQUALIZER_ROUTER" | "ADAPTER::ERC4626_VAULT" | "ADAPTER::ERC4626_VAULT_REFERRAL" | "ADAPTER::FLUID_DEX" | "ADAPTER::INFINIFI_GATEWAY" | "ADAPTER::INFINIFI_UNWINDING" | "ADAPTER::INFRARED_VAULT" | "ADAPTER::KELP_DEPOSIT_POOL" | "ADAPTER::KELP_WITHDRAWAL" | "ADAPTER::KODIAK_ISLAND_GATEWAY" | "ADAPTER::LIDO_V1" | "ADAPTER::LIDO_WSTETH_V1" | "ADAPTER::MELLOW_CLAIMER" | "ADAPTER::MELLOW_DVV" | "ADAPTER::MELLOW_ERC4626_VAULT" | "ADAPTER::MELLOW_LRT_VAULT" | "ADAPTER::MELLOW_WRAPPER" | "ADAPTER::MELLOW_DEPOSIT_QUEUE_QUEUE" | "ADAPTER::MELLOW_REDEEM_QUEUE_QUEUE" | "ADAPTER::MIDAS_ISSUANCE_VAULT" | "ADAPTER::MIDAS_REDEMPTION_VAULT" | "ADAPTER::PENDLE_ROUTER" | "ADAPTER::STAKING_REWARDS" | "ADAPTER::TRADER_JOE_ROUTER" | "ADAPTER::UNISWAP_V2_ROUTER" | "ADAPTER::UNISWAP_V3_ROUTER" | "ADAPTER::UNISWAP_V4_GATEWAY" | "ADAPTER::UPSHIFT_VAULT" | "ADAPTER::VELODROME_V2_ROUTER" | "ADAPTER::YEARN_V2";
6
6
  export declare enum AdapterType {
7
7
  ACCOUNT_MIGRATOR = "ACCOUNT_MIGRATOR",
8
8
  BALANCER_V3_ROUTER = "BALANCER_V3_ROUTER",
@@ -41,7 +41,7 @@ export declare enum AdapterType {
41
41
  MIDAS_REDEMPTION_VAULT = "MIDAS_REDEMPTION_VAULT",
42
42
  PENDLE_ROUTER = "PENDLE_ROUTER",
43
43
  STAKING_REWARDS = "STAKING_REWARDS",
44
- TRADERJOE_ROUTER = "TRADERJOE_ROUTER",
44
+ TRADER_JOE_ROUTER = "TRADER_JOE_ROUTER",
45
45
  UNISWAP_V2_ROUTER = "UNISWAP_V2_ROUTER",
46
46
  UNISWAP_V3_ROUTER = "UNISWAP_V3_ROUTER",
47
47
  UNISWAP_V4_GATEWAY = "UNISWAP_V4_GATEWAY",
@@ -5,6 +5,7 @@ import type { gaugeCompressorAbi } from "../../abi/compressors/gaugeCompressor.j
5
5
  import type { marketCompressorAbi } from "../../abi/compressors/marketCompressor.js";
6
6
  import type { peripheryCompressorAbi } from "../../abi/compressors/peripheryCompressor.js";
7
7
  import type { rewardsCompressorAbi } from "../../abi/compressors/rewardsCompressor.js";
8
+ import type { NetworkType } from "../chain/index.js";
8
9
  /**
9
10
  * Recursively unwraps array types to their element type.
10
11
  **/
@@ -244,6 +245,14 @@ export interface IBaseContract {
244
245
  * labeling methods for user-facing output.
245
246
  */
246
247
  readonly name: string;
248
+ /**
249
+ * Chain ID of the contract.
250
+ **/
251
+ readonly chainId: number;
252
+ /**
253
+ * Network type of the contract.
254
+ **/
255
+ readonly networkType: NetworkType;
247
256
  /**
248
257
  * @internal
249
258
  * `true` when the local state has diverged from on-chain and needs a sync.
@@ -42,6 +42,10 @@ export interface GearboxChain extends Chain {
42
42
  * Block number when the Gearbox address provider was deployed.
43
43
  **/
44
44
  firstBlock?: bigint;
45
+ /**
46
+ * Default read-only calls gas limit for this chain.
47
+ */
48
+ gasLimit: bigint;
45
49
  }
46
50
  /**
47
51
  * Tuple of all network labels the SDK can work with.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "13.6.0-apy-plugin.4",
3
+ "version": "13.6.0-apy-plugin.6",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",