@gearbox-protocol/sdk 8.27.5 → 8.27.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.
|
@@ -87,7 +87,9 @@ async function simulateWithPriceUpdates(client, parameters) {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
if (parameters.blockNumber
|
|
90
|
+
if (parameters.blockNumber && // this does not work for default multicall3 contracts on some L2 chains, so check on Eth Mainnet only
|
|
91
|
+
// https://docs.arbitrum.io/build-decentralized-apps/arbitrum-vs-ethereum/block-numbers-and-time#case-study-the-multicall-contract
|
|
92
|
+
(client.chain?.id === 1 || parameters.forceBlockNumberCheck)) {
|
|
91
93
|
const r = multicallResults[1];
|
|
92
94
|
if (r.status === "success") {
|
|
93
95
|
const fromMc = BigInt(r.result);
|
|
@@ -68,7 +68,9 @@ async function simulateWithPriceUpdates(client, parameters) {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
if (parameters.blockNumber
|
|
71
|
+
if (parameters.blockNumber && // this does not work for default multicall3 contracts on some L2 chains, so check on Eth Mainnet only
|
|
72
|
+
// https://docs.arbitrum.io/build-decentralized-apps/arbitrum-vs-ethereum/block-numbers-and-time#case-study-the-multicall-contract
|
|
73
|
+
(client.chain?.id === 1 || parameters.forceBlockNumberCheck)) {
|
|
72
74
|
const r = multicallResults[1];
|
|
73
75
|
if (r.status === "success") {
|
|
74
76
|
const fromMc = BigInt(r.result);
|
|
@@ -13,6 +13,10 @@ export type SimulateWithPriceUpdatesParameters<contracts extends readonly unknow
|
|
|
13
13
|
* Defaults to false
|
|
14
14
|
*/
|
|
15
15
|
strictPrices?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Always check block number from multicall
|
|
18
|
+
*/
|
|
19
|
+
forceBlockNumberCheck?: boolean;
|
|
16
20
|
};
|
|
17
21
|
export type SimulateWithPriceUpdatesReturnType<contracts extends readonly unknown[] = readonly ContractFunctionParameters[], options extends {
|
|
18
22
|
error?: Error;
|