@gearbox-protocol/sdk 14.8.7 → 14.10.0-next.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.
- package/dist/cjs/abi/IWithdrawalCompressorV311.js +315 -0
- package/dist/cjs/{plugins/apy/apy-cache.js → common-utils/axios-cache/AxiosCache.js} +31 -20
- package/dist/cjs/common-utils/axios-cache/index.js +22 -0
- package/dist/cjs/common-utils/index.js +2 -0
- package/dist/cjs/plugins/apy/ApyPlugin.js +4 -4
- package/dist/cjs/plugins/apy/index.js +0 -2
- package/dist/cjs/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.js +3 -2
- package/dist/cjs/plugins/remote-configs/CustomConfigSource.js +41 -0
- package/dist/cjs/plugins/remote-configs/RemoteConfigSource.js +56 -0
- package/dist/cjs/plugins/remote-configs/RemoteConfigsPlugin.js +186 -0
- package/dist/cjs/plugins/remote-configs/index.js +28 -0
- package/dist/cjs/plugins/remote-configs/package.json +1 -0
- package/dist/cjs/plugins/remote-configs/types.js +16 -0
- package/dist/cjs/sdk/OnchainSDK.js +2 -2
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +13 -6
- package/dist/cjs/sdk/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/esm/abi/IWithdrawalCompressorV311.js +291 -0
- package/dist/esm/{plugins/apy/apy-cache.js → common-utils/axios-cache/AxiosCache.js} +27 -16
- package/dist/esm/common-utils/axios-cache/index.js +1 -0
- package/dist/esm/common-utils/index.js +1 -0
- package/dist/esm/plugins/apy/ApyPlugin.js +4 -4
- package/dist/esm/plugins/apy/index.js +0 -1
- package/dist/esm/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.js +3 -2
- package/dist/esm/plugins/remote-configs/CustomConfigSource.js +17 -0
- package/dist/esm/plugins/remote-configs/RemoteConfigSource.js +32 -0
- package/dist/esm/plugins/remote-configs/RemoteConfigsPlugin.js +165 -0
- package/dist/esm/plugins/remote-configs/index.js +4 -0
- package/dist/esm/plugins/remote-configs/package.json +1 -0
- package/dist/esm/plugins/remote-configs/types.js +0 -0
- package/dist/esm/sdk/OnchainSDK.js +2 -2
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +13 -6
- package/dist/esm/sdk/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/types/abi/IWithdrawalCompressorV311.d.ts +327 -0
- package/dist/types/{plugins/apy/apy-cache.d.ts → common-utils/axios-cache/AxiosCache.d.ts} +6 -7
- package/dist/types/common-utils/axios-cache/index.d.ts +1 -0
- package/dist/types/common-utils/index.d.ts +1 -0
- package/dist/types/plugins/apy/index.d.ts +0 -1
- package/dist/types/plugins/delayed-withdrawal/types.d.ts +10 -2
- package/dist/types/plugins/remote-configs/CustomConfigSource.d.ts +13 -0
- package/dist/types/plugins/remote-configs/RemoteConfigSource.d.ts +31 -0
- package/dist/types/plugins/remote-configs/RemoteConfigsPlugin.d.ts +24 -0
- package/dist/types/plugins/remote-configs/index.d.ts +4 -0
- package/dist/types/plugins/remote-configs/types.d.ts +24 -0
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +4 -1
- package/package.json +1 -1
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
export declare const iWithdrawalCompressorV311Abi: readonly [{
|
|
2
|
+
readonly inputs: readonly [{
|
|
3
|
+
readonly internalType: "address";
|
|
4
|
+
readonly name: "_owner";
|
|
5
|
+
readonly type: "address";
|
|
6
|
+
}, {
|
|
7
|
+
readonly internalType: "address";
|
|
8
|
+
readonly name: "addressProvider_";
|
|
9
|
+
readonly type: "address";
|
|
10
|
+
}];
|
|
11
|
+
readonly stateMutability: "nonpayable";
|
|
12
|
+
readonly type: "constructor";
|
|
13
|
+
}, {
|
|
14
|
+
readonly anonymous: false;
|
|
15
|
+
readonly inputs: readonly [{
|
|
16
|
+
readonly indexed: true;
|
|
17
|
+
readonly internalType: "address";
|
|
18
|
+
readonly name: "previousOwner";
|
|
19
|
+
readonly type: "address";
|
|
20
|
+
}, {
|
|
21
|
+
readonly indexed: true;
|
|
22
|
+
readonly internalType: "address";
|
|
23
|
+
readonly name: "newOwner";
|
|
24
|
+
readonly type: "address";
|
|
25
|
+
}];
|
|
26
|
+
readonly name: "OwnershipTransferred";
|
|
27
|
+
readonly type: "event";
|
|
28
|
+
}, {
|
|
29
|
+
readonly inputs: readonly [];
|
|
30
|
+
readonly name: "addressProvider";
|
|
31
|
+
readonly outputs: readonly [{
|
|
32
|
+
readonly internalType: "address";
|
|
33
|
+
readonly name: "";
|
|
34
|
+
readonly type: "address";
|
|
35
|
+
}];
|
|
36
|
+
readonly stateMutability: "view";
|
|
37
|
+
readonly type: "function";
|
|
38
|
+
}, {
|
|
39
|
+
readonly inputs: readonly [{
|
|
40
|
+
readonly internalType: "bytes32";
|
|
41
|
+
readonly name: "";
|
|
42
|
+
readonly type: "bytes32";
|
|
43
|
+
}];
|
|
44
|
+
readonly name: "compressorTypeToCompressor";
|
|
45
|
+
readonly outputs: readonly [{
|
|
46
|
+
readonly internalType: "address";
|
|
47
|
+
readonly name: "";
|
|
48
|
+
readonly type: "address";
|
|
49
|
+
}];
|
|
50
|
+
readonly stateMutability: "view";
|
|
51
|
+
readonly type: "function";
|
|
52
|
+
}, {
|
|
53
|
+
readonly inputs: readonly [];
|
|
54
|
+
readonly name: "contractType";
|
|
55
|
+
readonly outputs: readonly [{
|
|
56
|
+
readonly internalType: "bytes32";
|
|
57
|
+
readonly name: "";
|
|
58
|
+
readonly type: "bytes32";
|
|
59
|
+
}];
|
|
60
|
+
readonly stateMutability: "view";
|
|
61
|
+
readonly type: "function";
|
|
62
|
+
}, {
|
|
63
|
+
readonly inputs: readonly [{
|
|
64
|
+
readonly internalType: "address";
|
|
65
|
+
readonly name: "creditAccount";
|
|
66
|
+
readonly type: "address";
|
|
67
|
+
}];
|
|
68
|
+
readonly name: "getCurrentWithdrawals";
|
|
69
|
+
readonly outputs: readonly [{
|
|
70
|
+
readonly components: readonly [{
|
|
71
|
+
readonly internalType: "address";
|
|
72
|
+
readonly name: "token";
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
}, {
|
|
75
|
+
readonly internalType: "address";
|
|
76
|
+
readonly name: "withdrawalPhantomToken";
|
|
77
|
+
readonly type: "address";
|
|
78
|
+
}, {
|
|
79
|
+
readonly internalType: "uint256";
|
|
80
|
+
readonly name: "withdrawalTokenSpent";
|
|
81
|
+
readonly type: "uint256";
|
|
82
|
+
}, {
|
|
83
|
+
readonly components: readonly [{
|
|
84
|
+
readonly internalType: "address";
|
|
85
|
+
readonly name: "token";
|
|
86
|
+
readonly type: "address";
|
|
87
|
+
}, {
|
|
88
|
+
readonly internalType: "bool";
|
|
89
|
+
readonly name: "isDelayed";
|
|
90
|
+
readonly type: "bool";
|
|
91
|
+
}, {
|
|
92
|
+
readonly internalType: "uint256";
|
|
93
|
+
readonly name: "amount";
|
|
94
|
+
readonly type: "uint256";
|
|
95
|
+
}];
|
|
96
|
+
readonly internalType: "struct WithdrawalOutput[]";
|
|
97
|
+
readonly name: "outputs";
|
|
98
|
+
readonly type: "tuple[]";
|
|
99
|
+
}, {
|
|
100
|
+
readonly components: readonly [{
|
|
101
|
+
readonly internalType: "address";
|
|
102
|
+
readonly name: "target";
|
|
103
|
+
readonly type: "address";
|
|
104
|
+
}, {
|
|
105
|
+
readonly internalType: "bytes";
|
|
106
|
+
readonly name: "callData";
|
|
107
|
+
readonly type: "bytes";
|
|
108
|
+
}];
|
|
109
|
+
readonly internalType: "struct MultiCall[]";
|
|
110
|
+
readonly name: "claimCalls";
|
|
111
|
+
readonly type: "tuple[]";
|
|
112
|
+
}];
|
|
113
|
+
readonly internalType: "struct ClaimableWithdrawal[]";
|
|
114
|
+
readonly name: "";
|
|
115
|
+
readonly type: "tuple[]";
|
|
116
|
+
}, {
|
|
117
|
+
readonly components: readonly [{
|
|
118
|
+
readonly internalType: "address";
|
|
119
|
+
readonly name: "token";
|
|
120
|
+
readonly type: "address";
|
|
121
|
+
}, {
|
|
122
|
+
readonly internalType: "address";
|
|
123
|
+
readonly name: "withdrawalPhantomToken";
|
|
124
|
+
readonly type: "address";
|
|
125
|
+
}, {
|
|
126
|
+
readonly components: readonly [{
|
|
127
|
+
readonly internalType: "address";
|
|
128
|
+
readonly name: "token";
|
|
129
|
+
readonly type: "address";
|
|
130
|
+
}, {
|
|
131
|
+
readonly internalType: "bool";
|
|
132
|
+
readonly name: "isDelayed";
|
|
133
|
+
readonly type: "bool";
|
|
134
|
+
}, {
|
|
135
|
+
readonly internalType: "uint256";
|
|
136
|
+
readonly name: "amount";
|
|
137
|
+
readonly type: "uint256";
|
|
138
|
+
}];
|
|
139
|
+
readonly internalType: "struct WithdrawalOutput[]";
|
|
140
|
+
readonly name: "expectedOutputs";
|
|
141
|
+
readonly type: "tuple[]";
|
|
142
|
+
}, {
|
|
143
|
+
readonly internalType: "uint256";
|
|
144
|
+
readonly name: "claimableAt";
|
|
145
|
+
readonly type: "uint256";
|
|
146
|
+
}];
|
|
147
|
+
readonly internalType: "struct PendingWithdrawal[]";
|
|
148
|
+
readonly name: "";
|
|
149
|
+
readonly type: "tuple[]";
|
|
150
|
+
}];
|
|
151
|
+
readonly stateMutability: "view";
|
|
152
|
+
readonly type: "function";
|
|
153
|
+
}, {
|
|
154
|
+
readonly inputs: readonly [{
|
|
155
|
+
readonly internalType: "address";
|
|
156
|
+
readonly name: "creditManager";
|
|
157
|
+
readonly type: "address";
|
|
158
|
+
}];
|
|
159
|
+
readonly name: "getWithdrawableAssets";
|
|
160
|
+
readonly outputs: readonly [{
|
|
161
|
+
readonly components: readonly [{
|
|
162
|
+
readonly internalType: "address";
|
|
163
|
+
readonly name: "token";
|
|
164
|
+
readonly type: "address";
|
|
165
|
+
}, {
|
|
166
|
+
readonly internalType: "address";
|
|
167
|
+
readonly name: "withdrawalPhantomToken";
|
|
168
|
+
readonly type: "address";
|
|
169
|
+
}, {
|
|
170
|
+
readonly internalType: "address";
|
|
171
|
+
readonly name: "underlying";
|
|
172
|
+
readonly type: "address";
|
|
173
|
+
}, {
|
|
174
|
+
readonly internalType: "uint256";
|
|
175
|
+
readonly name: "withdrawalLength";
|
|
176
|
+
readonly type: "uint256";
|
|
177
|
+
}, {
|
|
178
|
+
readonly internalType: "uint256";
|
|
179
|
+
readonly name: "maxWithdrawals";
|
|
180
|
+
readonly type: "uint256";
|
|
181
|
+
}];
|
|
182
|
+
readonly internalType: "struct WithdrawableAsset[]";
|
|
183
|
+
readonly name: "";
|
|
184
|
+
readonly type: "tuple[]";
|
|
185
|
+
}];
|
|
186
|
+
readonly stateMutability: "view";
|
|
187
|
+
readonly type: "function";
|
|
188
|
+
}, {
|
|
189
|
+
readonly inputs: readonly [{
|
|
190
|
+
readonly internalType: "address";
|
|
191
|
+
readonly name: "creditAccount";
|
|
192
|
+
readonly type: "address";
|
|
193
|
+
}, {
|
|
194
|
+
readonly internalType: "address";
|
|
195
|
+
readonly name: "token";
|
|
196
|
+
readonly type: "address";
|
|
197
|
+
}, {
|
|
198
|
+
readonly internalType: "uint256";
|
|
199
|
+
readonly name: "amount";
|
|
200
|
+
readonly type: "uint256";
|
|
201
|
+
}];
|
|
202
|
+
readonly name: "getWithdrawalRequestResult";
|
|
203
|
+
readonly outputs: readonly [{
|
|
204
|
+
readonly components: readonly [{
|
|
205
|
+
readonly internalType: "address";
|
|
206
|
+
readonly name: "token";
|
|
207
|
+
readonly type: "address";
|
|
208
|
+
}, {
|
|
209
|
+
readonly internalType: "uint256";
|
|
210
|
+
readonly name: "amountIn";
|
|
211
|
+
readonly type: "uint256";
|
|
212
|
+
}, {
|
|
213
|
+
readonly components: readonly [{
|
|
214
|
+
readonly internalType: "address";
|
|
215
|
+
readonly name: "token";
|
|
216
|
+
readonly type: "address";
|
|
217
|
+
}, {
|
|
218
|
+
readonly internalType: "bool";
|
|
219
|
+
readonly name: "isDelayed";
|
|
220
|
+
readonly type: "bool";
|
|
221
|
+
}, {
|
|
222
|
+
readonly internalType: "uint256";
|
|
223
|
+
readonly name: "amount";
|
|
224
|
+
readonly type: "uint256";
|
|
225
|
+
}];
|
|
226
|
+
readonly internalType: "struct WithdrawalOutput[]";
|
|
227
|
+
readonly name: "outputs";
|
|
228
|
+
readonly type: "tuple[]";
|
|
229
|
+
}, {
|
|
230
|
+
readonly components: readonly [{
|
|
231
|
+
readonly internalType: "address";
|
|
232
|
+
readonly name: "target";
|
|
233
|
+
readonly type: "address";
|
|
234
|
+
}, {
|
|
235
|
+
readonly internalType: "bytes";
|
|
236
|
+
readonly name: "callData";
|
|
237
|
+
readonly type: "bytes";
|
|
238
|
+
}];
|
|
239
|
+
readonly internalType: "struct MultiCall[]";
|
|
240
|
+
readonly name: "requestCalls";
|
|
241
|
+
readonly type: "tuple[]";
|
|
242
|
+
}, {
|
|
243
|
+
readonly internalType: "uint256";
|
|
244
|
+
readonly name: "claimableAt";
|
|
245
|
+
readonly type: "uint256";
|
|
246
|
+
}];
|
|
247
|
+
readonly internalType: "struct RequestableWithdrawal";
|
|
248
|
+
readonly name: "withdrawal";
|
|
249
|
+
readonly type: "tuple";
|
|
250
|
+
}];
|
|
251
|
+
readonly stateMutability: "view";
|
|
252
|
+
readonly type: "function";
|
|
253
|
+
}, {
|
|
254
|
+
readonly inputs: readonly [];
|
|
255
|
+
readonly name: "owner";
|
|
256
|
+
readonly outputs: readonly [{
|
|
257
|
+
readonly internalType: "address";
|
|
258
|
+
readonly name: "";
|
|
259
|
+
readonly type: "address";
|
|
260
|
+
}];
|
|
261
|
+
readonly stateMutability: "view";
|
|
262
|
+
readonly type: "function";
|
|
263
|
+
}, {
|
|
264
|
+
readonly inputs: readonly [];
|
|
265
|
+
readonly name: "renounceOwnership";
|
|
266
|
+
readonly outputs: readonly [];
|
|
267
|
+
readonly stateMutability: "nonpayable";
|
|
268
|
+
readonly type: "function";
|
|
269
|
+
}, {
|
|
270
|
+
readonly inputs: readonly [{
|
|
271
|
+
readonly internalType: "address";
|
|
272
|
+
readonly name: "subcompressor";
|
|
273
|
+
readonly type: "address";
|
|
274
|
+
}];
|
|
275
|
+
readonly name: "setSubcompressor";
|
|
276
|
+
readonly outputs: readonly [];
|
|
277
|
+
readonly stateMutability: "nonpayable";
|
|
278
|
+
readonly type: "function";
|
|
279
|
+
}, {
|
|
280
|
+
readonly inputs: readonly [{
|
|
281
|
+
readonly internalType: "bytes32";
|
|
282
|
+
readonly name: "withdrawableType";
|
|
283
|
+
readonly type: "bytes32";
|
|
284
|
+
}, {
|
|
285
|
+
readonly internalType: "bytes32";
|
|
286
|
+
readonly name: "compressorType";
|
|
287
|
+
readonly type: "bytes32";
|
|
288
|
+
}];
|
|
289
|
+
readonly name: "setWithdrawableTypeToCompressorType";
|
|
290
|
+
readonly outputs: readonly [];
|
|
291
|
+
readonly stateMutability: "nonpayable";
|
|
292
|
+
readonly type: "function";
|
|
293
|
+
}, {
|
|
294
|
+
readonly inputs: readonly [{
|
|
295
|
+
readonly internalType: "address";
|
|
296
|
+
readonly name: "newOwner";
|
|
297
|
+
readonly type: "address";
|
|
298
|
+
}];
|
|
299
|
+
readonly name: "transferOwnership";
|
|
300
|
+
readonly outputs: readonly [];
|
|
301
|
+
readonly stateMutability: "nonpayable";
|
|
302
|
+
readonly type: "function";
|
|
303
|
+
}, {
|
|
304
|
+
readonly inputs: readonly [];
|
|
305
|
+
readonly name: "version";
|
|
306
|
+
readonly outputs: readonly [{
|
|
307
|
+
readonly internalType: "uint256";
|
|
308
|
+
readonly name: "";
|
|
309
|
+
readonly type: "uint256";
|
|
310
|
+
}];
|
|
311
|
+
readonly stateMutability: "view";
|
|
312
|
+
readonly type: "function";
|
|
313
|
+
}, {
|
|
314
|
+
readonly inputs: readonly [{
|
|
315
|
+
readonly internalType: "bytes32";
|
|
316
|
+
readonly name: "";
|
|
317
|
+
readonly type: "bytes32";
|
|
318
|
+
}];
|
|
319
|
+
readonly name: "withdrawableTypeToCompressorType";
|
|
320
|
+
readonly outputs: readonly [{
|
|
321
|
+
readonly internalType: "bytes32";
|
|
322
|
+
readonly name: "";
|
|
323
|
+
readonly type: "bytes32";
|
|
324
|
+
}];
|
|
325
|
+
readonly stateMutability: "view";
|
|
326
|
+
readonly type: "function";
|
|
327
|
+
}];
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import type { Output } from "../../rewards/apy/index.js";
|
|
2
1
|
import type { ILogger } from "../../sdk/index.js";
|
|
3
2
|
/**
|
|
4
|
-
* Process-wide cache for
|
|
3
|
+
* Process-wide cache for axios JSON responses.
|
|
5
4
|
*
|
|
6
|
-
* Multiple
|
|
5
|
+
* Multiple plugin instances (one per SDK / network) share the same
|
|
7
6
|
* cached HTTP response so that only **one** request is made per TTL window
|
|
8
7
|
* regardless of how many SDK instances exist.
|
|
9
8
|
*
|
|
10
9
|
* Concurrent callers that arrive while a fetch is already in flight
|
|
11
10
|
* are de-duplicated — they all await the same promise.
|
|
12
11
|
*/
|
|
13
|
-
export declare class
|
|
12
|
+
export declare class AxiosCache<T> {
|
|
14
13
|
#private;
|
|
15
14
|
private constructor();
|
|
16
15
|
/**
|
|
17
16
|
* Returns a shared cache instance for the given URL.
|
|
18
17
|
* The same instance is reused across all callers with identical URL.
|
|
19
18
|
*/
|
|
20
|
-
static get(url: string, ttlMs: number, logger?: ILogger):
|
|
19
|
+
static get<T>(url: string, ttlMs: number, logger?: ILogger, getLogMeta?: (data: T) => string): AxiosCache<T>;
|
|
21
20
|
/**
|
|
22
|
-
* Returns cached
|
|
21
|
+
* Returns cached data if fresh, otherwise fetches from the network.
|
|
23
22
|
* Concurrent calls are de-duplicated.
|
|
24
23
|
*/
|
|
25
|
-
fetch(): Promise<
|
|
24
|
+
fetch(): Promise<T>;
|
|
26
25
|
/** Evicts all cached entries. Mainly useful for tests. */
|
|
27
26
|
static clearAll(): void;
|
|
28
27
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AxiosCache.js";
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import type { Address, GetContractReturnType, PublicClient } from "viem";
|
|
2
2
|
import type { iWithdrawalCompressorV310Abi } from "../../abi/IWithdrawalCompressorV310.js";
|
|
3
|
+
import type { iWithdrawalCompressorV311Abi } from "../../abi/IWithdrawalCompressorV311.js";
|
|
3
4
|
import type { BaseContractStateHuman } from "../../sdk/index.js";
|
|
4
5
|
type WithdrawalCompressorV310InstanceType = GetContractReturnType<typeof iWithdrawalCompressorV310Abi, PublicClient>;
|
|
5
|
-
|
|
6
|
+
type WithdrawalCompressorV311InstanceType = GetContractReturnType<typeof iWithdrawalCompressorV311Abi, PublicClient>;
|
|
7
|
+
type WithdrawableAssetV310 = Awaited<ReturnType<WithdrawalCompressorV310InstanceType["read"]["getWithdrawableAssets"]>>[number] & {
|
|
6
8
|
creditManager: Address;
|
|
7
9
|
disabled: boolean;
|
|
8
10
|
};
|
|
9
|
-
|
|
11
|
+
type WithdrawableAssetV311 = Awaited<ReturnType<WithdrawalCompressorV311InstanceType["read"]["getWithdrawableAssets"]>>[number] & {
|
|
12
|
+
creditManager: Address;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
};
|
|
15
|
+
type CommonType = WithdrawableAssetV310 & Partial<Omit<WithdrawableAssetV311, keyof WithdrawableAssetV310>>;
|
|
16
|
+
export type WithdrawableAsset = CommonType;
|
|
17
|
+
export interface WithdrawableAssetStateHuman extends CommonType, BaseContractStateHuman {
|
|
10
18
|
}
|
|
11
19
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PoolConfigPayload } from "../../common-utils/static/pool-config.js";
|
|
2
|
+
import type { StrategyConfigPayload } from "../../common-utils/static/strategy.js";
|
|
3
|
+
import type { ConfigSource } from "./types.js";
|
|
4
|
+
export interface CustomConfigSourceOptions {
|
|
5
|
+
getPools: () => Promise<PoolConfigPayload[]>;
|
|
6
|
+
getStrategies: () => Promise<StrategyConfigPayload[]>;
|
|
7
|
+
}
|
|
8
|
+
export declare class CustomConfigSource implements ConfigSource {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(options: CustomConfigSourceOptions);
|
|
11
|
+
getPools(): Promise<PoolConfigPayload[]>;
|
|
12
|
+
getStrategies(): Promise<StrategyConfigPayload[]>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PoolConfigPayload } from "../../common-utils/static/pool-config.js";
|
|
2
|
+
import type { StrategyConfigPayload } from "../../common-utils/static/strategy.js";
|
|
3
|
+
import type { ILogger } from "../../sdk/index.js";
|
|
4
|
+
import type { ConfigSource } from "./types.js";
|
|
5
|
+
export interface RemoteConfigSourceOptions {
|
|
6
|
+
/**
|
|
7
|
+
* URL for pools config JSON.
|
|
8
|
+
* @default "https://static.gearbox.finance/client-v3/configs/pools/pools.json"
|
|
9
|
+
*/
|
|
10
|
+
poolsUrl?: string;
|
|
11
|
+
/**
|
|
12
|
+
* URL for strategies config JSON.
|
|
13
|
+
* @default "https://static.gearbox.finance/client-v3/configs/strategies/strategies.json"
|
|
14
|
+
*/
|
|
15
|
+
strategiesUrl?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Cache TTL in milliseconds.
|
|
18
|
+
* @default 60_000
|
|
19
|
+
*/
|
|
20
|
+
cacheTtlMs?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Optional logger for cache diagnostics.
|
|
23
|
+
*/
|
|
24
|
+
logger?: ILogger;
|
|
25
|
+
}
|
|
26
|
+
export declare class RemoteConfigSource implements ConfigSource {
|
|
27
|
+
#private;
|
|
28
|
+
constructor(options?: RemoteConfigSourceOptions);
|
|
29
|
+
getPools(): Promise<Array<PoolConfigPayload>>;
|
|
30
|
+
getStrategies(): Promise<Array<StrategyConfigPayload>>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PoolConfigPayload } from "../../common-utils/static/pool-config.js";
|
|
2
|
+
import type { NotValidatedStrategy } from "../../common-utils/utils/strategies/types/strategy.js";
|
|
3
|
+
import { BasePlugin, type IOnchainSDKPlugin } from "../../sdk/index.js";
|
|
4
|
+
import type { RemoteConfigsPluginOptions, RemoteConfigsPluginState } from "./types.js";
|
|
5
|
+
export declare class RemoteConfigsPlugin extends BasePlugin<RemoteConfigsPluginState> implements IOnchainSDKPlugin<RemoteConfigsPluginState> {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(loadOnAttach?: boolean, options?: RemoteConfigsPluginOptions);
|
|
8
|
+
get loaded(): boolean;
|
|
9
|
+
load(force?: boolean): Promise<RemoteConfigsPluginState>;
|
|
10
|
+
syncState(): Promise<void>;
|
|
11
|
+
get state(): RemoteConfigsPluginState;
|
|
12
|
+
hydrate(state: RemoteConfigsPluginState): void;
|
|
13
|
+
stateHuman(_?: boolean): RemoteConfigsPluginState;
|
|
14
|
+
/**
|
|
15
|
+
* Pool configs for the current SDK network.
|
|
16
|
+
* @throws if plugin is not loaded
|
|
17
|
+
*/
|
|
18
|
+
get pools(): PoolConfigPayload[];
|
|
19
|
+
/**
|
|
20
|
+
* Strategy configs for the current SDK network.
|
|
21
|
+
* @throws if plugin is not loaded
|
|
22
|
+
*/
|
|
23
|
+
get strategies(): NotValidatedStrategy[];
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PoolConfigPayload } from "../../common-utils/static/pool-config.js";
|
|
2
|
+
import type { StrategyConfigPayload } from "../../common-utils/static/strategy.js";
|
|
3
|
+
import type { NotValidatedStrategy } from "../../common-utils/utils/strategies/types/strategy.js";
|
|
4
|
+
export interface RemoteConfigsPluginState {
|
|
5
|
+
pools: PoolConfigPayload[];
|
|
6
|
+
strategies: NotValidatedStrategy[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Abstraction for a config provider.
|
|
10
|
+
* Multiple sources can be composed; the plugin tries them in order
|
|
11
|
+
* until one succeeds.
|
|
12
|
+
*/
|
|
13
|
+
export interface ConfigSource {
|
|
14
|
+
getPools(): Promise<PoolConfigPayload[]>;
|
|
15
|
+
getStrategies(): Promise<StrategyConfigPayload[]>;
|
|
16
|
+
}
|
|
17
|
+
export interface RemoteConfigsPluginOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Ordered list of config sources.
|
|
20
|
+
* Defaults to `[new RemoteConfigSource()]` if omitted.
|
|
21
|
+
*/
|
|
22
|
+
sources?: ConfigSource[];
|
|
23
|
+
}
|
|
24
|
+
export type { NotValidatedStrategy, PoolConfigPayload, StrategyConfigPayload };
|
|
@@ -22,7 +22,10 @@ export interface CreditAccountServiceOptions {
|
|
|
22
22
|
* @param chainId - Numeric chain ID.
|
|
23
23
|
* @returns Withdrawal compressor address, or `undefined`.
|
|
24
24
|
**/
|
|
25
|
-
export declare function getWithdrawalCompressorAddress(chainId: number):
|
|
25
|
+
export declare function getWithdrawalCompressorAddress(chainId: number): {
|
|
26
|
+
address: Address;
|
|
27
|
+
version: 311 | 310;
|
|
28
|
+
};
|
|
26
29
|
/**
|
|
27
30
|
* Service for querying and operating on Gearbox credit accounts.
|
|
28
31
|
*
|