@gearbox-protocol/sdk 8.27.4 → 8.27.5

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.
@@ -87,6 +87,23 @@ async function simulateWithPriceUpdates(client, parameters) {
87
87
  }
88
88
  }
89
89
  }
90
+ if (parameters.blockNumber) {
91
+ const r = multicallResults[1];
92
+ if (r.status === "success") {
93
+ const fromMc = BigInt(r.result);
94
+ if (!!r.result && fromMc !== parameters.blockNumber) {
95
+ throw getSimulateWithPriceUpdatesError(
96
+ new import_viem.BaseError(
97
+ `block number returned from multicall (${fromMc}) is different from the one provided (${parameters.blockNumber})`
98
+ ),
99
+ priceUpdates,
100
+ restContracts,
101
+ multicallResults,
102
+ request
103
+ );
104
+ }
105
+ }
106
+ }
90
107
  if (hasError) {
91
108
  const err = getSimulateWithPriceUpdatesError(
92
109
  void 0,
@@ -68,6 +68,23 @@ async function simulateWithPriceUpdates(client, parameters) {
68
68
  }
69
69
  }
70
70
  }
71
+ if (parameters.blockNumber) {
72
+ const r = multicallResults[1];
73
+ if (r.status === "success") {
74
+ const fromMc = BigInt(r.result);
75
+ if (!!r.result && fromMc !== parameters.blockNumber) {
76
+ throw getSimulateWithPriceUpdatesError(
77
+ new BaseError(
78
+ `block number returned from multicall (${fromMc}) is different from the one provided (${parameters.blockNumber})`
79
+ ),
80
+ priceUpdates,
81
+ restContracts,
82
+ multicallResults,
83
+ request
84
+ );
85
+ }
86
+ }
87
+ }
71
88
  if (hasError) {
72
89
  const err = getSimulateWithPriceUpdatesError(
73
90
  void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "8.27.4",
3
+ "version": "8.27.5",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",