@gearbox-protocol/sdk 9.1.9 → 9.2.1
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.
|
@@ -91,7 +91,8 @@ class RevolverTransport {
|
|
|
91
91
|
get value() {
|
|
92
92
|
return {
|
|
93
93
|
rotate: (reason) => this.rotate(reason),
|
|
94
|
-
currentTransportName: () => this.currentTransportName()
|
|
94
|
+
currentTransportName: () => this.currentTransportName(),
|
|
95
|
+
statuses: () => this.statuses()
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
98
|
request = async (r) => {
|
|
@@ -203,6 +204,13 @@ class RevolverTransport {
|
|
|
203
204
|
currentTransportName() {
|
|
204
205
|
return this.#transport({}).config.name;
|
|
205
206
|
}
|
|
207
|
+
statuses() {
|
|
208
|
+
const now = Date.now();
|
|
209
|
+
return this.#transports.map((t, i) => ({
|
|
210
|
+
id: t.transport({}).config.name,
|
|
211
|
+
status: t.cooldown < now ? this.#index === i ? "active" : "standby" : "cooldown"
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
206
214
|
get #logger() {
|
|
207
215
|
return this.#config.logger;
|
|
208
216
|
}
|
|
@@ -23,29 +23,44 @@ __export(poolMigration_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(poolMigration_exports);
|
|
24
24
|
const POOL_DELAYED_MIGRATION_CONTRACTS = {
|
|
25
25
|
Mainnet: [
|
|
26
|
+
// USDC
|
|
26
27
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// "dUSDCV3" "Trade USDC v3"
|
|
28
|
+
address: "0x4174aEe40eC3f27A68252663547Bc60E0B1b58c1",
|
|
29
|
+
// "dUSDCV3" "Chaos"
|
|
30
30
|
poolIn: "0xda00000035fef4082f78def6a8903bee419fbf8e",
|
|
31
31
|
// "USDC" "invariant"
|
|
32
32
|
poolOut: "0xc155444481854c60e7a29f4150373f479988f32d"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// "dUSDCV3" "Trade USDC v3"
|
|
35
|
+
address: "0xD2F14195b00cDBB5A7ba63273086C7eBc685F16D",
|
|
36
|
+
// "dUSDCV3" "Chaos"
|
|
38
37
|
poolIn: "0xda00000035fef4082f78def6a8903bee419fbf8e",
|
|
39
38
|
// "USDC" "tulipa"
|
|
40
39
|
poolOut: "0xf0795c47fa58d00f5f77f4d5c01f31ee891e21b4"
|
|
41
40
|
},
|
|
41
|
+
// wstETH
|
|
42
42
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
address: "0x0a5722f8D321B2e072d92FA78fEb0B2f84E600A3",
|
|
44
|
+
// "dwstETHV3" "Chaos"
|
|
45
|
+
poolIn: "0xff94993fa7ea27efc943645f95adb36c1b81244b",
|
|
46
|
+
// "dcp0xLRT" "cp0x"
|
|
47
|
+
poolOut: "0x72ccb97cbdc40f8fb7ffa42ed93ae74923547200"
|
|
48
|
+
},
|
|
49
|
+
// WETH
|
|
50
|
+
{
|
|
51
|
+
address: "0x4a981692330F40853dcEc441d6603f5BdfFCbEb2",
|
|
52
|
+
// "dWETHV3" "Chaos"
|
|
46
53
|
poolIn: "0xda0002859b2d05f66a753d8241fcde8623f26f4f",
|
|
47
|
-
// "dWETHV3-cp0x" "
|
|
54
|
+
// "dWETHV3-cp0x" "cp0x"
|
|
48
55
|
poolOut: "0xf00b548f1b69cb5ee559d891e03a196fb5101d4a"
|
|
56
|
+
},
|
|
57
|
+
// tBTC
|
|
58
|
+
{
|
|
59
|
+
address: "0x88C7f9267F0a5690a182504D86c4161e41A8487A",
|
|
60
|
+
// "dtBTCV3" "Chaos"
|
|
61
|
+
poolIn: "0x7354ec6e852108411e681d13e11185c3a2567981",
|
|
62
|
+
// "Re7tBTC" "re7"
|
|
63
|
+
poolOut: "0xf791ecc5f2472637eac9dfe3f7894c0b32c32bdf"
|
|
49
64
|
}
|
|
50
65
|
]
|
|
51
66
|
};
|
|
@@ -74,7 +74,8 @@ class RevolverTransport {
|
|
|
74
74
|
get value() {
|
|
75
75
|
return {
|
|
76
76
|
rotate: (reason) => this.rotate(reason),
|
|
77
|
-
currentTransportName: () => this.currentTransportName()
|
|
77
|
+
currentTransportName: () => this.currentTransportName(),
|
|
78
|
+
statuses: () => this.statuses()
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
81
|
request = async (r) => {
|
|
@@ -186,6 +187,13 @@ class RevolverTransport {
|
|
|
186
187
|
currentTransportName() {
|
|
187
188
|
return this.#transport({}).config.name;
|
|
188
189
|
}
|
|
190
|
+
statuses() {
|
|
191
|
+
const now = Date.now();
|
|
192
|
+
return this.#transports.map((t, i) => ({
|
|
193
|
+
id: t.transport({}).config.name,
|
|
194
|
+
status: t.cooldown < now ? this.#index === i ? "active" : "standby" : "cooldown"
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
189
197
|
get #logger() {
|
|
190
198
|
return this.#config.logger;
|
|
191
199
|
}
|
|
@@ -1,28 +1,43 @@
|
|
|
1
1
|
const POOL_DELAYED_MIGRATION_CONTRACTS = {
|
|
2
2
|
Mainnet: [
|
|
3
|
+
// USDC
|
|
3
4
|
{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// "dUSDCV3" "Trade USDC v3"
|
|
5
|
+
address: "0x4174aEe40eC3f27A68252663547Bc60E0B1b58c1",
|
|
6
|
+
// "dUSDCV3" "Chaos"
|
|
7
7
|
poolIn: "0xda00000035fef4082f78def6a8903bee419fbf8e",
|
|
8
8
|
// "USDC" "invariant"
|
|
9
9
|
poolOut: "0xc155444481854c60e7a29f4150373f479988f32d"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// "dUSDCV3" "Trade USDC v3"
|
|
12
|
+
address: "0xD2F14195b00cDBB5A7ba63273086C7eBc685F16D",
|
|
13
|
+
// "dUSDCV3" "Chaos"
|
|
15
14
|
poolIn: "0xda00000035fef4082f78def6a8903bee419fbf8e",
|
|
16
15
|
// "USDC" "tulipa"
|
|
17
16
|
poolOut: "0xf0795c47fa58d00f5f77f4d5c01f31ee891e21b4"
|
|
18
17
|
},
|
|
18
|
+
// wstETH
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
address: "0x0a5722f8D321B2e072d92FA78fEb0B2f84E600A3",
|
|
21
|
+
// "dwstETHV3" "Chaos"
|
|
22
|
+
poolIn: "0xff94993fa7ea27efc943645f95adb36c1b81244b",
|
|
23
|
+
// "dcp0xLRT" "cp0x"
|
|
24
|
+
poolOut: "0x72ccb97cbdc40f8fb7ffa42ed93ae74923547200"
|
|
25
|
+
},
|
|
26
|
+
// WETH
|
|
27
|
+
{
|
|
28
|
+
address: "0x4a981692330F40853dcEc441d6603f5BdfFCbEb2",
|
|
29
|
+
// "dWETHV3" "Chaos"
|
|
23
30
|
poolIn: "0xda0002859b2d05f66a753d8241fcde8623f26f4f",
|
|
24
|
-
// "dWETHV3-cp0x" "
|
|
31
|
+
// "dWETHV3-cp0x" "cp0x"
|
|
25
32
|
poolOut: "0xf00b548f1b69cb5ee559d891e03a196fb5101d4a"
|
|
33
|
+
},
|
|
34
|
+
// tBTC
|
|
35
|
+
{
|
|
36
|
+
address: "0x88C7f9267F0a5690a182504D86c4161e41A8487A",
|
|
37
|
+
// "dtBTCV3" "Chaos"
|
|
38
|
+
poolIn: "0x7354ec6e852108411e681d13e11185c3a2567981",
|
|
39
|
+
// "Re7tBTC" "re7"
|
|
40
|
+
poolOut: "0xf791ecc5f2472637eac9dfe3f7894c0b32c32bdf"
|
|
26
41
|
}
|
|
27
42
|
]
|
|
28
43
|
};
|
|
@@ -2,6 +2,10 @@ import { BaseError, type ClientConfig, type EIP1193RequestFn, type Transport, ty
|
|
|
2
2
|
import type { HttpRpcClientOptions } from "viem/utils";
|
|
3
3
|
import type { ILogger, NetworkType } from "../sdk/index.js";
|
|
4
4
|
import { type ProviderConfig } from "./providers.js";
|
|
5
|
+
export interface ProviderStatus {
|
|
6
|
+
id: string;
|
|
7
|
+
status: "active" | "cooldown" | "standby";
|
|
8
|
+
}
|
|
5
9
|
type OnRequestFn = (providerName: string, ...args: Parameters<Required<HttpRpcClientOptions>["onRequest"]>) => ReturnType<Required<HttpRpcClientOptions>["onRequest"]>;
|
|
6
10
|
type OnResponseFn = (providerName: string, ...args: Parameters<Required<HttpRpcClientOptions>["onResponse"]>) => ReturnType<Required<HttpRpcClientOptions>["onResponse"]>;
|
|
7
11
|
export interface RevolverTransportConfig {
|
|
@@ -53,6 +57,10 @@ export interface RevolverTransportValue {
|
|
|
53
57
|
* Returns the name of the current transport
|
|
54
58
|
*/
|
|
55
59
|
currentTransportName: () => string;
|
|
60
|
+
/**
|
|
61
|
+
* Returns statuses of all providers
|
|
62
|
+
*/
|
|
63
|
+
statuses: () => ProviderStatus[];
|
|
56
64
|
}
|
|
57
65
|
export declare class RevolverTransport implements ReturnType<Transport<"revolver", RevolverTransportValue>> {
|
|
58
66
|
#private;
|
|
@@ -77,5 +85,6 @@ export declare class RevolverTransport implements ReturnType<Transport<"revolver
|
|
|
77
85
|
*/
|
|
78
86
|
rotate(reason?: BaseError): Promise<boolean>;
|
|
79
87
|
currentTransportName(): string;
|
|
88
|
+
statuses(): ProviderStatus[];
|
|
80
89
|
}
|
|
81
90
|
export {};
|