@gearbox-protocol/sdk 3.0.0-vfour.354 → 3.0.0-vfour.356

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.
@@ -25,7 +25,7 @@ function generateCastTraceCall(params) {
25
25
  const { to, data, blockNumber, gas, gasPrice, maxPriorityFeePerGas, value } = params;
26
26
  const cmd = ["cast", "call", "--trace", "--rpc-url", "$RPC_URL"];
27
27
  if (blockNumber) {
28
- cmd.push("--block-number", blockNumber.toString());
28
+ cmd.push("--block", blockNumber.toString());
29
29
  }
30
30
  if (gas) {
31
31
  cmd.push("--gas-limit", gas.toString());
@@ -181,6 +181,7 @@ function extractCallError(result) {
181
181
  class SimulateWithPriceUpdatesError extends import_viem.BaseError {
182
182
  cause;
183
183
  timestamp;
184
+ #request;
184
185
  constructor(cause, params) {
185
186
  const { calls, priceUpdates, timestamp, request } = params;
186
187
  const blockNumber = request?.blockNumber ?? 0n;
@@ -198,15 +199,17 @@ class SimulateWithPriceUpdatesError extends import_viem.BaseError {
198
199
  ...priceUpdates,
199
200
  " ",
200
201
  "Calls: ",
201
- ...calls,
202
- " ",
203
- ...request ? ["Raw request: ", (0, import_cast.generateCastTraceCall)(request)] : []
202
+ ...calls
204
203
  ].filter(Boolean),
205
204
  name: "SimulateWithPriceUpdatesError"
206
205
  }
207
206
  );
208
207
  this.cause = cause;
209
208
  this.timestamp = timestamp;
209
+ this.#request = request;
210
+ }
211
+ getCastTraceCall() {
212
+ return this.#request ? (0, import_cast.generateCastTraceCall)(this.#request) : "";
210
213
  }
211
214
  }
212
215
  // Annotate the CommonJS export names for ESM import in node:
@@ -2,7 +2,7 @@ function generateCastTraceCall(params) {
2
2
  const { to, data, blockNumber, gas, gasPrice, maxPriorityFeePerGas, value } = params;
3
3
  const cmd = ["cast", "call", "--trace", "--rpc-url", "$RPC_URL"];
4
4
  if (blockNumber) {
5
- cmd.push("--block-number", blockNumber.toString());
5
+ cmd.push("--block", blockNumber.toString());
6
6
  }
7
7
  if (gas) {
8
8
  cmd.push("--gas-limit", gas.toString());
@@ -161,6 +161,7 @@ function extractCallError(result) {
161
161
  class SimulateWithPriceUpdatesError extends BaseError {
162
162
  cause;
163
163
  timestamp;
164
+ #request;
164
165
  constructor(cause, params) {
165
166
  const { calls, priceUpdates, timestamp, request } = params;
166
167
  const blockNumber = request?.blockNumber ?? 0n;
@@ -178,15 +179,17 @@ class SimulateWithPriceUpdatesError extends BaseError {
178
179
  ...priceUpdates,
179
180
  " ",
180
181
  "Calls: ",
181
- ...calls,
182
- " ",
183
- ...request ? ["Raw request: ", generateCastTraceCall(request)] : []
182
+ ...calls
184
183
  ].filter(Boolean),
185
184
  name: "SimulateWithPriceUpdatesError"
186
185
  }
187
186
  );
188
187
  this.cause = cause;
189
188
  this.timestamp = timestamp;
189
+ this.#request = request;
190
+ }
191
+ getCastTraceCall() {
192
+ return this.#request ? generateCastTraceCall(this.#request) : "";
190
193
  }
191
194
  }
192
195
  export {
@@ -33,7 +33,9 @@ export interface SimulateWithPriceUpdatesErrorParams {
33
33
  request?: CallParameters;
34
34
  }
35
35
  export declare class SimulateWithPriceUpdatesError extends BaseError {
36
+ #private;
36
37
  cause?: Error;
37
38
  readonly timestamp?: bigint;
38
39
  constructor(cause: Error | undefined, params: SimulateWithPriceUpdatesErrorParams);
40
+ getCastTraceCall(): string;
39
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "3.0.0-vfour.354",
3
+ "version": "3.0.0-vfour.356",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",