@gearbox-protocol/sdk 8.28.2 → 8.28.4
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.
|
@@ -63,6 +63,9 @@ class EthCallSpy {
|
|
|
63
63
|
get detectedCalls() {
|
|
64
64
|
return this.#detectedCalls;
|
|
65
65
|
}
|
|
66
|
+
get detectedBlock() {
|
|
67
|
+
return this.#detectedBlock;
|
|
68
|
+
}
|
|
66
69
|
#shouldStore(data) {
|
|
67
70
|
if (data.method === "eth_call" && typeof data.params[1] === "string" && // block number is present
|
|
68
71
|
data.params[1]?.startsWith("0x") && // and it's a block number
|
|
@@ -40,6 +40,9 @@ class EthCallSpy {
|
|
|
40
40
|
get detectedCalls() {
|
|
41
41
|
return this.#detectedCalls;
|
|
42
42
|
}
|
|
43
|
+
get detectedBlock() {
|
|
44
|
+
return this.#detectedBlock;
|
|
45
|
+
}
|
|
43
46
|
#shouldStore(data) {
|
|
44
47
|
if (data.method === "eth_call" && typeof data.params[1] === "string" && // block number is present
|
|
45
48
|
data.params[1]?.startsWith("0x") && // and it's a block number
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type { HttpTransportConfig, PublicRpcSchema } from "viem";
|
|
1
|
+
import type { EIP1193Parameters, HttpTransportConfig, PublicRpcSchema } from "viem";
|
|
2
2
|
import type { ILogger } from "../sdk/index.js";
|
|
3
3
|
export type EthCallMethod = Extract<PublicRpcSchema[number], {
|
|
4
4
|
Method: "eth_call";
|
|
5
5
|
}>;
|
|
6
|
+
export type EthCallRequest = EIP1193Parameters<[EthCallMethod]>;
|
|
6
7
|
export interface DetectedCall {
|
|
7
|
-
request:
|
|
8
|
+
request: EthCallRequest;
|
|
8
9
|
response?: EthCallMethod["ReturnType"];
|
|
9
10
|
responseHeaders?: Record<string, string>;
|
|
10
11
|
}
|
|
11
|
-
export type CheckMulticallFn = (data:
|
|
12
|
+
export type CheckMulticallFn = (data: EthCallRequest) => boolean;
|
|
12
13
|
/**
|
|
13
14
|
* Helper to spy on eth_call requests and responses in viem transport
|
|
14
15
|
*/
|
|
@@ -19,4 +20,5 @@ export declare class EthCallSpy {
|
|
|
19
20
|
onFetchRequest: Required<HttpTransportConfig>["onFetchRequest"];
|
|
20
21
|
onFetchResponse: Required<HttpTransportConfig>["onFetchResponse"];
|
|
21
22
|
get detectedCalls(): DetectedCall[];
|
|
23
|
+
get detectedBlock(): bigint;
|
|
22
24
|
}
|