@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
- // TODO: fix address
28
- address: "0xF044d86668DB274Ce56179fE24a7ed22dE1f7d46",
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
- // TODO: fix address
36
- address: "0x181b4aDB132Da85e9dB56D025EeB7E18dFd6Ddda",
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
- // TODO: fix address
44
- address: "0x0A31e33E37e6cD720cE347e277b414E22816959c",
45
- // "dWETHV3" "Trade WETH v3"
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" "Gearbox WETH v3"
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
- // TODO: fix address
5
- address: "0xF044d86668DB274Ce56179fE24a7ed22dE1f7d46",
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
- // TODO: fix address
13
- address: "0x181b4aDB132Da85e9dB56D025EeB7E18dFd6Ddda",
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
- // TODO: fix address
21
- address: "0x0A31e33E37e6cD720cE347e277b414E22816959c",
22
- // "dWETHV3" "Trade WETH v3"
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" "Gearbox WETH v3"
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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "9.1.9",
3
+ "version": "9.2.1",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",