@gearbox-protocol/sdk 14.10.3 → 14.10.5-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/iERC20Zapper.js +33 -0
- package/dist/cjs/abi/iETHZapper.js +30 -0
- package/dist/cjs/dev/AccountOpener.js +4 -5
- package/dist/cjs/sdk/market/ZapperRegister.js +5 -3
- package/dist/cjs/sdk/market/index.js +3 -1
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +20 -0
- package/dist/cjs/sdk/market/zapper/IERC20ZapperContract.js +98 -0
- package/dist/cjs/sdk/market/zapper/IETHZapperContract.js +89 -0
- package/dist/cjs/sdk/market/zapper/Zapper.js +47 -0
- package/dist/cjs/sdk/market/zapper/createZapper.js +45 -0
- package/dist/cjs/sdk/market/zapper/index.js +28 -0
- package/dist/cjs/sdk/pools/PoolService.js +58 -60
- package/dist/esm/abi/iERC20Zapper.js +9 -0
- package/dist/esm/abi/iETHZapper.js +6 -0
- package/dist/esm/dev/AccountOpener.js +4 -5
- package/dist/esm/sdk/market/ZapperRegister.js +5 -3
- package/dist/esm/sdk/market/index.js +1 -0
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +20 -0
- package/dist/esm/sdk/market/zapper/IERC20ZapperContract.js +74 -0
- package/dist/esm/sdk/market/zapper/IETHZapperContract.js +65 -0
- package/dist/esm/sdk/market/zapper/Zapper.js +23 -0
- package/dist/esm/sdk/market/zapper/createZapper.js +21 -0
- package/dist/esm/sdk/market/zapper/index.js +4 -0
- package/dist/esm/sdk/pools/PoolService.js +62 -60
- package/dist/types/abi/iERC20Zapper.d.ts +313 -0
- package/dist/types/abi/iETHZapper.d.ts +153 -0
- package/dist/types/sdk/base/types.d.ts +9 -0
- package/dist/types/sdk/market/ZapperRegister.d.ts +4 -4
- package/dist/types/sdk/market/credit/CreditFacadeV310Contract.d.ts +2 -1
- package/dist/types/sdk/market/credit/CreditSuite.d.ts +2 -2
- package/dist/types/sdk/market/credit/createCreditFacade.d.ts +2 -2
- package/dist/types/sdk/market/credit/types.d.ts +134 -6
- package/dist/types/sdk/market/index.d.ts +1 -0
- package/dist/types/sdk/market/pool/PoolSuite.d.ts +2 -2
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +14 -3
- package/dist/types/sdk/market/pool/createPool.d.ts +2 -2
- package/dist/types/sdk/market/pool/types.d.ts +117 -4
- package/dist/types/sdk/market/zapper/IERC20ZapperContract.d.ts +350 -0
- package/dist/types/sdk/market/zapper/IETHZapperContract.d.ts +186 -0
- package/dist/types/sdk/market/zapper/Zapper.d.ts +13 -0
- package/dist/types/sdk/market/zapper/createZapper.d.ts +6 -0
- package/dist/types/sdk/market/zapper/index.d.ts +4 -0
- package/dist/types/sdk/pools/PoolService.d.ts +3 -3
- package/dist/types/sdk/pools/types.d.ts +10 -5
- package/package.json +1 -1
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import type { Address, Hex } from "viem";
|
|
2
|
+
import { BaseContract } from "../../base/index.js";
|
|
3
|
+
import type { OnchainSDK } from "../../OnchainSDK.js";
|
|
4
|
+
import type { RawTx } from "../../types/index.js";
|
|
5
|
+
import type { ZapperData } from "../types.js";
|
|
6
|
+
declare const abi: readonly [{
|
|
7
|
+
readonly type: "function";
|
|
8
|
+
readonly inputs: readonly [{
|
|
9
|
+
readonly name: "tokenInAmount";
|
|
10
|
+
readonly internalType: "uint256";
|
|
11
|
+
readonly type: "uint256";
|
|
12
|
+
}, {
|
|
13
|
+
readonly name: "receiver";
|
|
14
|
+
readonly internalType: "address";
|
|
15
|
+
readonly type: "address";
|
|
16
|
+
}];
|
|
17
|
+
readonly name: "deposit";
|
|
18
|
+
readonly outputs: readonly [{
|
|
19
|
+
readonly name: "tokenOutAmount";
|
|
20
|
+
readonly internalType: "uint256";
|
|
21
|
+
readonly type: "uint256";
|
|
22
|
+
}];
|
|
23
|
+
readonly stateMutability: "nonpayable";
|
|
24
|
+
}, {
|
|
25
|
+
readonly type: "function";
|
|
26
|
+
readonly inputs: readonly [{
|
|
27
|
+
readonly name: "tokenInAmount";
|
|
28
|
+
readonly internalType: "uint256";
|
|
29
|
+
readonly type: "uint256";
|
|
30
|
+
}, {
|
|
31
|
+
readonly name: "receiver";
|
|
32
|
+
readonly internalType: "address";
|
|
33
|
+
readonly type: "address";
|
|
34
|
+
}, {
|
|
35
|
+
readonly name: "deadline";
|
|
36
|
+
readonly internalType: "uint256";
|
|
37
|
+
readonly type: "uint256";
|
|
38
|
+
}, {
|
|
39
|
+
readonly name: "v";
|
|
40
|
+
readonly internalType: "uint8";
|
|
41
|
+
readonly type: "uint8";
|
|
42
|
+
}, {
|
|
43
|
+
readonly name: "r";
|
|
44
|
+
readonly internalType: "bytes32";
|
|
45
|
+
readonly type: "bytes32";
|
|
46
|
+
}, {
|
|
47
|
+
readonly name: "s";
|
|
48
|
+
readonly internalType: "bytes32";
|
|
49
|
+
readonly type: "bytes32";
|
|
50
|
+
}];
|
|
51
|
+
readonly name: "depositWithPermit";
|
|
52
|
+
readonly outputs: readonly [{
|
|
53
|
+
readonly name: "tokenOutAmount";
|
|
54
|
+
readonly internalType: "uint256";
|
|
55
|
+
readonly type: "uint256";
|
|
56
|
+
}];
|
|
57
|
+
readonly stateMutability: "nonpayable";
|
|
58
|
+
}, {
|
|
59
|
+
readonly type: "function";
|
|
60
|
+
readonly inputs: readonly [{
|
|
61
|
+
readonly name: "tokenInAmount";
|
|
62
|
+
readonly internalType: "uint256";
|
|
63
|
+
readonly type: "uint256";
|
|
64
|
+
}, {
|
|
65
|
+
readonly name: "receiver";
|
|
66
|
+
readonly internalType: "address";
|
|
67
|
+
readonly type: "address";
|
|
68
|
+
}, {
|
|
69
|
+
readonly name: "nonce";
|
|
70
|
+
readonly internalType: "uint256";
|
|
71
|
+
readonly type: "uint256";
|
|
72
|
+
}, {
|
|
73
|
+
readonly name: "expiry";
|
|
74
|
+
readonly internalType: "uint256";
|
|
75
|
+
readonly type: "uint256";
|
|
76
|
+
}, {
|
|
77
|
+
readonly name: "v";
|
|
78
|
+
readonly internalType: "uint8";
|
|
79
|
+
readonly type: "uint8";
|
|
80
|
+
}, {
|
|
81
|
+
readonly name: "r";
|
|
82
|
+
readonly internalType: "bytes32";
|
|
83
|
+
readonly type: "bytes32";
|
|
84
|
+
}, {
|
|
85
|
+
readonly name: "s";
|
|
86
|
+
readonly internalType: "bytes32";
|
|
87
|
+
readonly type: "bytes32";
|
|
88
|
+
}];
|
|
89
|
+
readonly name: "depositWithPermitAllowed";
|
|
90
|
+
readonly outputs: readonly [{
|
|
91
|
+
readonly name: "tokenOutAmount";
|
|
92
|
+
readonly internalType: "uint256";
|
|
93
|
+
readonly type: "uint256";
|
|
94
|
+
}];
|
|
95
|
+
readonly stateMutability: "nonpayable";
|
|
96
|
+
}, {
|
|
97
|
+
readonly type: "function";
|
|
98
|
+
readonly inputs: readonly [{
|
|
99
|
+
readonly name: "tokenInAmount";
|
|
100
|
+
readonly internalType: "uint256";
|
|
101
|
+
readonly type: "uint256";
|
|
102
|
+
}, {
|
|
103
|
+
readonly name: "receiver";
|
|
104
|
+
readonly internalType: "address";
|
|
105
|
+
readonly type: "address";
|
|
106
|
+
}, {
|
|
107
|
+
readonly name: "referralCode";
|
|
108
|
+
readonly internalType: "uint256";
|
|
109
|
+
readonly type: "uint256";
|
|
110
|
+
}];
|
|
111
|
+
readonly name: "depositWithReferral";
|
|
112
|
+
readonly outputs: readonly [{
|
|
113
|
+
readonly name: "tokenOutAmount";
|
|
114
|
+
readonly internalType: "uint256";
|
|
115
|
+
readonly type: "uint256";
|
|
116
|
+
}];
|
|
117
|
+
readonly stateMutability: "nonpayable";
|
|
118
|
+
}, {
|
|
119
|
+
readonly type: "function";
|
|
120
|
+
readonly inputs: readonly [{
|
|
121
|
+
readonly name: "tokenInAmount";
|
|
122
|
+
readonly internalType: "uint256";
|
|
123
|
+
readonly type: "uint256";
|
|
124
|
+
}, {
|
|
125
|
+
readonly name: "receiver";
|
|
126
|
+
readonly internalType: "address";
|
|
127
|
+
readonly type: "address";
|
|
128
|
+
}, {
|
|
129
|
+
readonly name: "referralCode";
|
|
130
|
+
readonly internalType: "uint256";
|
|
131
|
+
readonly type: "uint256";
|
|
132
|
+
}, {
|
|
133
|
+
readonly name: "deadline";
|
|
134
|
+
readonly internalType: "uint256";
|
|
135
|
+
readonly type: "uint256";
|
|
136
|
+
}, {
|
|
137
|
+
readonly name: "v";
|
|
138
|
+
readonly internalType: "uint8";
|
|
139
|
+
readonly type: "uint8";
|
|
140
|
+
}, {
|
|
141
|
+
readonly name: "r";
|
|
142
|
+
readonly internalType: "bytes32";
|
|
143
|
+
readonly type: "bytes32";
|
|
144
|
+
}, {
|
|
145
|
+
readonly name: "s";
|
|
146
|
+
readonly internalType: "bytes32";
|
|
147
|
+
readonly type: "bytes32";
|
|
148
|
+
}];
|
|
149
|
+
readonly name: "depositWithReferralAndPermit";
|
|
150
|
+
readonly outputs: readonly [{
|
|
151
|
+
readonly name: "tokenOutAmount";
|
|
152
|
+
readonly internalType: "uint256";
|
|
153
|
+
readonly type: "uint256";
|
|
154
|
+
}];
|
|
155
|
+
readonly stateMutability: "nonpayable";
|
|
156
|
+
}, {
|
|
157
|
+
readonly type: "function";
|
|
158
|
+
readonly inputs: readonly [{
|
|
159
|
+
readonly name: "tokenInAmount";
|
|
160
|
+
readonly internalType: "uint256";
|
|
161
|
+
readonly type: "uint256";
|
|
162
|
+
}, {
|
|
163
|
+
readonly name: "receiver";
|
|
164
|
+
readonly internalType: "address";
|
|
165
|
+
readonly type: "address";
|
|
166
|
+
}, {
|
|
167
|
+
readonly name: "referralCode";
|
|
168
|
+
readonly internalType: "uint256";
|
|
169
|
+
readonly type: "uint256";
|
|
170
|
+
}, {
|
|
171
|
+
readonly name: "nonce";
|
|
172
|
+
readonly internalType: "uint256";
|
|
173
|
+
readonly type: "uint256";
|
|
174
|
+
}, {
|
|
175
|
+
readonly name: "expiry";
|
|
176
|
+
readonly internalType: "uint256";
|
|
177
|
+
readonly type: "uint256";
|
|
178
|
+
}, {
|
|
179
|
+
readonly name: "v";
|
|
180
|
+
readonly internalType: "uint8";
|
|
181
|
+
readonly type: "uint8";
|
|
182
|
+
}, {
|
|
183
|
+
readonly name: "r";
|
|
184
|
+
readonly internalType: "bytes32";
|
|
185
|
+
readonly type: "bytes32";
|
|
186
|
+
}, {
|
|
187
|
+
readonly name: "s";
|
|
188
|
+
readonly internalType: "bytes32";
|
|
189
|
+
readonly type: "bytes32";
|
|
190
|
+
}];
|
|
191
|
+
readonly name: "depositWithReferralAndPermitAllowed";
|
|
192
|
+
readonly outputs: readonly [{
|
|
193
|
+
readonly name: "tokenOutAmount";
|
|
194
|
+
readonly internalType: "uint256";
|
|
195
|
+
readonly type: "uint256";
|
|
196
|
+
}];
|
|
197
|
+
readonly stateMutability: "nonpayable";
|
|
198
|
+
}, {
|
|
199
|
+
readonly type: "function";
|
|
200
|
+
readonly inputs: readonly [];
|
|
201
|
+
readonly name: "pool";
|
|
202
|
+
readonly outputs: readonly [{
|
|
203
|
+
readonly name: "";
|
|
204
|
+
readonly internalType: "address";
|
|
205
|
+
readonly type: "address";
|
|
206
|
+
}];
|
|
207
|
+
readonly stateMutability: "view";
|
|
208
|
+
}, {
|
|
209
|
+
readonly type: "function";
|
|
210
|
+
readonly inputs: readonly [{
|
|
211
|
+
readonly name: "tokenInAmount";
|
|
212
|
+
readonly internalType: "uint256";
|
|
213
|
+
readonly type: "uint256";
|
|
214
|
+
}];
|
|
215
|
+
readonly name: "previewDeposit";
|
|
216
|
+
readonly outputs: readonly [{
|
|
217
|
+
readonly name: "tokenOutAmount";
|
|
218
|
+
readonly internalType: "uint256";
|
|
219
|
+
readonly type: "uint256";
|
|
220
|
+
}];
|
|
221
|
+
readonly stateMutability: "view";
|
|
222
|
+
}, {
|
|
223
|
+
readonly type: "function";
|
|
224
|
+
readonly inputs: readonly [{
|
|
225
|
+
readonly name: "tokenOutAmount";
|
|
226
|
+
readonly internalType: "uint256";
|
|
227
|
+
readonly type: "uint256";
|
|
228
|
+
}];
|
|
229
|
+
readonly name: "previewRedeem";
|
|
230
|
+
readonly outputs: readonly [{
|
|
231
|
+
readonly name: "tokenInAmount";
|
|
232
|
+
readonly internalType: "uint256";
|
|
233
|
+
readonly type: "uint256";
|
|
234
|
+
}];
|
|
235
|
+
readonly stateMutability: "view";
|
|
236
|
+
}, {
|
|
237
|
+
readonly type: "function";
|
|
238
|
+
readonly inputs: readonly [{
|
|
239
|
+
readonly name: "tokenOutAmount";
|
|
240
|
+
readonly internalType: "uint256";
|
|
241
|
+
readonly type: "uint256";
|
|
242
|
+
}, {
|
|
243
|
+
readonly name: "receiver";
|
|
244
|
+
readonly internalType: "address";
|
|
245
|
+
readonly type: "address";
|
|
246
|
+
}];
|
|
247
|
+
readonly name: "redeem";
|
|
248
|
+
readonly outputs: readonly [{
|
|
249
|
+
readonly name: "tokenInAmount";
|
|
250
|
+
readonly internalType: "uint256";
|
|
251
|
+
readonly type: "uint256";
|
|
252
|
+
}];
|
|
253
|
+
readonly stateMutability: "nonpayable";
|
|
254
|
+
}, {
|
|
255
|
+
readonly type: "function";
|
|
256
|
+
readonly inputs: readonly [{
|
|
257
|
+
readonly name: "tokenOutAmount";
|
|
258
|
+
readonly internalType: "uint256";
|
|
259
|
+
readonly type: "uint256";
|
|
260
|
+
}, {
|
|
261
|
+
readonly name: "receiver";
|
|
262
|
+
readonly internalType: "address";
|
|
263
|
+
readonly type: "address";
|
|
264
|
+
}, {
|
|
265
|
+
readonly name: "deadline";
|
|
266
|
+
readonly internalType: "uint256";
|
|
267
|
+
readonly type: "uint256";
|
|
268
|
+
}, {
|
|
269
|
+
readonly name: "v";
|
|
270
|
+
readonly internalType: "uint8";
|
|
271
|
+
readonly type: "uint8";
|
|
272
|
+
}, {
|
|
273
|
+
readonly name: "r";
|
|
274
|
+
readonly internalType: "bytes32";
|
|
275
|
+
readonly type: "bytes32";
|
|
276
|
+
}, {
|
|
277
|
+
readonly name: "s";
|
|
278
|
+
readonly internalType: "bytes32";
|
|
279
|
+
readonly type: "bytes32";
|
|
280
|
+
}];
|
|
281
|
+
readonly name: "redeemWithPermit";
|
|
282
|
+
readonly outputs: readonly [{
|
|
283
|
+
readonly name: "tokenInAmount";
|
|
284
|
+
readonly internalType: "uint256";
|
|
285
|
+
readonly type: "uint256";
|
|
286
|
+
}];
|
|
287
|
+
readonly stateMutability: "nonpayable";
|
|
288
|
+
}, {
|
|
289
|
+
readonly type: "function";
|
|
290
|
+
readonly inputs: readonly [];
|
|
291
|
+
readonly name: "tokenIn";
|
|
292
|
+
readonly outputs: readonly [{
|
|
293
|
+
readonly name: "";
|
|
294
|
+
readonly internalType: "address";
|
|
295
|
+
readonly type: "address";
|
|
296
|
+
}];
|
|
297
|
+
readonly stateMutability: "view";
|
|
298
|
+
}, {
|
|
299
|
+
readonly type: "function";
|
|
300
|
+
readonly inputs: readonly [];
|
|
301
|
+
readonly name: "tokenOut";
|
|
302
|
+
readonly outputs: readonly [{
|
|
303
|
+
readonly name: "";
|
|
304
|
+
readonly internalType: "address";
|
|
305
|
+
readonly type: "address";
|
|
306
|
+
}];
|
|
307
|
+
readonly stateMutability: "view";
|
|
308
|
+
}, {
|
|
309
|
+
readonly type: "function";
|
|
310
|
+
readonly inputs: readonly [];
|
|
311
|
+
readonly name: "underlying";
|
|
312
|
+
readonly outputs: readonly [{
|
|
313
|
+
readonly name: "";
|
|
314
|
+
readonly internalType: "address";
|
|
315
|
+
readonly type: "address";
|
|
316
|
+
}];
|
|
317
|
+
readonly stateMutability: "view";
|
|
318
|
+
}];
|
|
319
|
+
type abi = typeof abi;
|
|
320
|
+
export declare class IERC20ZapperContract extends BaseContract<abi> implements ZapperData {
|
|
321
|
+
readonly pool: ZapperData["pool"];
|
|
322
|
+
readonly type: ZapperData["type"];
|
|
323
|
+
readonly baseParams: ZapperData["baseParams"];
|
|
324
|
+
readonly tokenIn: ZapperData["tokenIn"];
|
|
325
|
+
readonly tokenOut: ZapperData["tokenOut"];
|
|
326
|
+
constructor(sdk: OnchainSDK, data: ZapperData);
|
|
327
|
+
/**
|
|
328
|
+
* Deposits ERC20 tokens into the pool via this zapper.
|
|
329
|
+
*/
|
|
330
|
+
deposit(tokenInAmount: bigint, receiver: Address): RawTx;
|
|
331
|
+
/**
|
|
332
|
+
* Deposits ERC20 tokens into the pool via this zapper using a referral code.
|
|
333
|
+
*/
|
|
334
|
+
depositWithReferral(tokenInAmount: bigint, receiver: Address, referralCode: bigint): RawTx;
|
|
335
|
+
/**
|
|
336
|
+
* Deposits ERC20 tokens via this zapper with a referral code and an
|
|
337
|
+
* EIP-2612 permit signature, skipping a separate approve transaction.
|
|
338
|
+
*/
|
|
339
|
+
depositWithReferralAndPermit(tokenInAmount: bigint, receiver: Address, referralCode: bigint, deadline: bigint, v: number, r: Hex, s: Hex): RawTx;
|
|
340
|
+
/**
|
|
341
|
+
* Redeems pool shares (diesel tokens) for the underlying asset via this zapper.
|
|
342
|
+
*/
|
|
343
|
+
redeem(tokenInAmount: bigint, receiver: Address): RawTx;
|
|
344
|
+
/**
|
|
345
|
+
* Redeems pool shares via this zapper with an EIP-2612 permit signature,
|
|
346
|
+
* skipping a separate approve transaction.
|
|
347
|
+
*/
|
|
348
|
+
redeemWithPermit(tokenInAmount: bigint, receiver: Address, deadline: bigint, v: number, r: Hex, s: Hex): RawTx;
|
|
349
|
+
}
|
|
350
|
+
export {};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import { BaseContract } from "../../base/index.js";
|
|
3
|
+
import type { OnchainSDK } from "../../OnchainSDK.js";
|
|
4
|
+
import type { RawTx } from "../../types/index.js";
|
|
5
|
+
import type { ZapperData } from "../types.js";
|
|
6
|
+
declare const abi: readonly [{
|
|
7
|
+
readonly type: "function";
|
|
8
|
+
readonly inputs: readonly [{
|
|
9
|
+
readonly name: "receiver";
|
|
10
|
+
readonly internalType: "address";
|
|
11
|
+
readonly type: "address";
|
|
12
|
+
}];
|
|
13
|
+
readonly name: "deposit";
|
|
14
|
+
readonly outputs: readonly [{
|
|
15
|
+
readonly name: "tokenOutAmount";
|
|
16
|
+
readonly internalType: "uint256";
|
|
17
|
+
readonly type: "uint256";
|
|
18
|
+
}];
|
|
19
|
+
readonly stateMutability: "payable";
|
|
20
|
+
}, {
|
|
21
|
+
readonly type: "function";
|
|
22
|
+
readonly inputs: readonly [{
|
|
23
|
+
readonly name: "receiver";
|
|
24
|
+
readonly internalType: "address";
|
|
25
|
+
readonly type: "address";
|
|
26
|
+
}, {
|
|
27
|
+
readonly name: "referralCode";
|
|
28
|
+
readonly internalType: "uint256";
|
|
29
|
+
readonly type: "uint256";
|
|
30
|
+
}];
|
|
31
|
+
readonly name: "depositWithReferral";
|
|
32
|
+
readonly outputs: readonly [{
|
|
33
|
+
readonly name: "tokenOutAmount";
|
|
34
|
+
readonly internalType: "uint256";
|
|
35
|
+
readonly type: "uint256";
|
|
36
|
+
}];
|
|
37
|
+
readonly stateMutability: "payable";
|
|
38
|
+
}, {
|
|
39
|
+
readonly type: "function";
|
|
40
|
+
readonly inputs: readonly [];
|
|
41
|
+
readonly name: "pool";
|
|
42
|
+
readonly outputs: readonly [{
|
|
43
|
+
readonly name: "";
|
|
44
|
+
readonly internalType: "address";
|
|
45
|
+
readonly type: "address";
|
|
46
|
+
}];
|
|
47
|
+
readonly stateMutability: "view";
|
|
48
|
+
}, {
|
|
49
|
+
readonly type: "function";
|
|
50
|
+
readonly inputs: readonly [{
|
|
51
|
+
readonly name: "tokenInAmount";
|
|
52
|
+
readonly internalType: "uint256";
|
|
53
|
+
readonly type: "uint256";
|
|
54
|
+
}];
|
|
55
|
+
readonly name: "previewDeposit";
|
|
56
|
+
readonly outputs: readonly [{
|
|
57
|
+
readonly name: "tokenOutAmount";
|
|
58
|
+
readonly internalType: "uint256";
|
|
59
|
+
readonly type: "uint256";
|
|
60
|
+
}];
|
|
61
|
+
readonly stateMutability: "view";
|
|
62
|
+
}, {
|
|
63
|
+
readonly type: "function";
|
|
64
|
+
readonly inputs: readonly [{
|
|
65
|
+
readonly name: "tokenOutAmount";
|
|
66
|
+
readonly internalType: "uint256";
|
|
67
|
+
readonly type: "uint256";
|
|
68
|
+
}];
|
|
69
|
+
readonly name: "previewRedeem";
|
|
70
|
+
readonly outputs: readonly [{
|
|
71
|
+
readonly name: "tokenInAmount";
|
|
72
|
+
readonly internalType: "uint256";
|
|
73
|
+
readonly type: "uint256";
|
|
74
|
+
}];
|
|
75
|
+
readonly stateMutability: "view";
|
|
76
|
+
}, {
|
|
77
|
+
readonly type: "function";
|
|
78
|
+
readonly inputs: readonly [{
|
|
79
|
+
readonly name: "tokenOutAmount";
|
|
80
|
+
readonly internalType: "uint256";
|
|
81
|
+
readonly type: "uint256";
|
|
82
|
+
}, {
|
|
83
|
+
readonly name: "receiver";
|
|
84
|
+
readonly internalType: "address";
|
|
85
|
+
readonly type: "address";
|
|
86
|
+
}];
|
|
87
|
+
readonly name: "redeem";
|
|
88
|
+
readonly outputs: readonly [{
|
|
89
|
+
readonly name: "tokenInAmount";
|
|
90
|
+
readonly internalType: "uint256";
|
|
91
|
+
readonly type: "uint256";
|
|
92
|
+
}];
|
|
93
|
+
readonly stateMutability: "nonpayable";
|
|
94
|
+
}, {
|
|
95
|
+
readonly type: "function";
|
|
96
|
+
readonly inputs: readonly [{
|
|
97
|
+
readonly name: "tokenOutAmount";
|
|
98
|
+
readonly internalType: "uint256";
|
|
99
|
+
readonly type: "uint256";
|
|
100
|
+
}, {
|
|
101
|
+
readonly name: "receiver";
|
|
102
|
+
readonly internalType: "address";
|
|
103
|
+
readonly type: "address";
|
|
104
|
+
}, {
|
|
105
|
+
readonly name: "deadline";
|
|
106
|
+
readonly internalType: "uint256";
|
|
107
|
+
readonly type: "uint256";
|
|
108
|
+
}, {
|
|
109
|
+
readonly name: "v";
|
|
110
|
+
readonly internalType: "uint8";
|
|
111
|
+
readonly type: "uint8";
|
|
112
|
+
}, {
|
|
113
|
+
readonly name: "r";
|
|
114
|
+
readonly internalType: "bytes32";
|
|
115
|
+
readonly type: "bytes32";
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "s";
|
|
118
|
+
readonly internalType: "bytes32";
|
|
119
|
+
readonly type: "bytes32";
|
|
120
|
+
}];
|
|
121
|
+
readonly name: "redeemWithPermit";
|
|
122
|
+
readonly outputs: readonly [{
|
|
123
|
+
readonly name: "tokenInAmount";
|
|
124
|
+
readonly internalType: "uint256";
|
|
125
|
+
readonly type: "uint256";
|
|
126
|
+
}];
|
|
127
|
+
readonly stateMutability: "nonpayable";
|
|
128
|
+
}, {
|
|
129
|
+
readonly type: "function";
|
|
130
|
+
readonly inputs: readonly [];
|
|
131
|
+
readonly name: "tokenIn";
|
|
132
|
+
readonly outputs: readonly [{
|
|
133
|
+
readonly name: "";
|
|
134
|
+
readonly internalType: "address";
|
|
135
|
+
readonly type: "address";
|
|
136
|
+
}];
|
|
137
|
+
readonly stateMutability: "view";
|
|
138
|
+
}, {
|
|
139
|
+
readonly type: "function";
|
|
140
|
+
readonly inputs: readonly [];
|
|
141
|
+
readonly name: "tokenOut";
|
|
142
|
+
readonly outputs: readonly [{
|
|
143
|
+
readonly name: "";
|
|
144
|
+
readonly internalType: "address";
|
|
145
|
+
readonly type: "address";
|
|
146
|
+
}];
|
|
147
|
+
readonly stateMutability: "view";
|
|
148
|
+
}, {
|
|
149
|
+
readonly type: "function";
|
|
150
|
+
readonly inputs: readonly [];
|
|
151
|
+
readonly name: "underlying";
|
|
152
|
+
readonly outputs: readonly [{
|
|
153
|
+
readonly name: "";
|
|
154
|
+
readonly internalType: "address";
|
|
155
|
+
readonly type: "address";
|
|
156
|
+
}];
|
|
157
|
+
readonly stateMutability: "view";
|
|
158
|
+
}];
|
|
159
|
+
type abi = typeof abi;
|
|
160
|
+
export declare class IETHZapperContract extends BaseContract<abi> implements ZapperData {
|
|
161
|
+
readonly pool: ZapperData["pool"];
|
|
162
|
+
readonly type: ZapperData["type"];
|
|
163
|
+
readonly baseParams: ZapperData["baseParams"];
|
|
164
|
+
readonly tokenIn: ZapperData["tokenIn"];
|
|
165
|
+
readonly tokenOut: ZapperData["tokenOut"];
|
|
166
|
+
constructor(sdk: OnchainSDK, data: ZapperData);
|
|
167
|
+
/**
|
|
168
|
+
* Deposits native ETH into the pool via this zapper.
|
|
169
|
+
*/
|
|
170
|
+
deposit(receiver: Address): RawTx;
|
|
171
|
+
/**
|
|
172
|
+
* Deposits native ETH into the pool via this zapper using a referral code.
|
|
173
|
+
* The caller must attach the deposit amount as msg.value.
|
|
174
|
+
*/
|
|
175
|
+
depositWithReferral(receiver: Address, referralCode: bigint): RawTx;
|
|
176
|
+
/**
|
|
177
|
+
* Redeems pool shares (diesel tokens) for the underlying asset via this zapper.
|
|
178
|
+
*/
|
|
179
|
+
redeem(tokenInAmount: bigint, receiver: Address): RawTx;
|
|
180
|
+
/**
|
|
181
|
+
* Redeems pool shares via this zapper with an EIP-2612 permit signature,
|
|
182
|
+
* skipping a separate approve transaction.
|
|
183
|
+
*/
|
|
184
|
+
redeemWithPermit(tokenInAmount: bigint, receiver: Address, deadline: bigint, v: number, r: Address, s: Address): RawTx;
|
|
185
|
+
}
|
|
186
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { BaseParams } from "../../base/types.js";
|
|
3
|
+
import type { ZapperData } from "../types.js";
|
|
4
|
+
export declare class Zapper implements ZapperData {
|
|
5
|
+
readonly pool: Address;
|
|
6
|
+
readonly type: "migration" | "rwa" | "base";
|
|
7
|
+
readonly baseParams: ZapperData["baseParams"];
|
|
8
|
+
readonly tokenIn: ZapperData["tokenIn"];
|
|
9
|
+
readonly tokenOut: ZapperData["tokenOut"];
|
|
10
|
+
readonly contractType: string;
|
|
11
|
+
constructor(data: ZapperData);
|
|
12
|
+
static contractType(baseParams: BaseParams): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { OnchainSDK } from "../../OnchainSDK.js";
|
|
2
|
+
import type { ZapperData } from "../types.js";
|
|
3
|
+
import { IERC20ZapperContract } from "./IERC20ZapperContract.js";
|
|
4
|
+
import { IETHZapperContract } from "./IETHZapperContract.js";
|
|
5
|
+
import { Zapper } from "./Zapper.js";
|
|
6
|
+
export declare function createZapper(sdk: OnchainSDK, data: ZapperData): Zapper | IETHZapperContract | IERC20ZapperContract;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import { SDKConstruct } from "../base/index.js";
|
|
3
|
-
import type { AddLiquidityProps, DepositMetadata, IPoolsService,
|
|
3
|
+
import type { AddLiquidityProps, DepositMetadata, IPoolsService, PoolServiceCallResult, RemoveLiquidityProps, WithdrawalMetadata } from "./types.js";
|
|
4
4
|
export declare class PoolService extends SDKConstruct implements IPoolsService {
|
|
5
5
|
#private;
|
|
6
6
|
/**
|
|
@@ -18,7 +18,7 @@ export declare class PoolService extends SDKConstruct implements IPoolsService {
|
|
|
18
18
|
/**
|
|
19
19
|
* {@inheritDoc IPoolsService.addLiquidity}
|
|
20
20
|
*/
|
|
21
|
-
addLiquidity(props: AddLiquidityProps):
|
|
21
|
+
addLiquidity(props: AddLiquidityProps): PoolServiceCallResult | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* {@inheritDoc IPoolsService.getWithdrawalTokensIn}
|
|
24
24
|
*/
|
|
@@ -30,7 +30,7 @@ export declare class PoolService extends SDKConstruct implements IPoolsService {
|
|
|
30
30
|
/**
|
|
31
31
|
* {@inheritDoc IPoolsService.removeLiquidity}
|
|
32
32
|
*/
|
|
33
|
-
removeLiquidity(props: RemoveLiquidityProps):
|
|
33
|
+
removeLiquidity(props: RemoveLiquidityProps): PoolServiceCallResult;
|
|
34
34
|
/**
|
|
35
35
|
* {@inheritDoc IPoolsService.getWithdrawalMetadata}
|
|
36
36
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Abi, Address, ContractFunctionArgs, ContractFunctionName } from "viem";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Zapper } from "../market/index.js";
|
|
3
3
|
import type { Asset } from "../router/index.js";
|
|
4
|
+
import type { MultiCall, RawTx } from "../types/transactions.js";
|
|
4
5
|
interface PermitResult {
|
|
5
6
|
r: Address;
|
|
6
7
|
s: Address;
|
|
@@ -19,6 +20,10 @@ export type PoolServiceCall<abi extends Abi | readonly unknown[] = Abi, function
|
|
|
19
20
|
target: Address;
|
|
20
21
|
value?: bigint;
|
|
21
22
|
};
|
|
23
|
+
export interface PoolServiceCallResult {
|
|
24
|
+
tx: RawTx;
|
|
25
|
+
calls: Array<MultiCall>;
|
|
26
|
+
}
|
|
22
27
|
export interface AddLiquidityProps {
|
|
23
28
|
/**
|
|
24
29
|
* Token and amount to deposit.
|
|
@@ -57,7 +62,7 @@ export interface DepositMetadata {
|
|
|
57
62
|
/**
|
|
58
63
|
* Zapper that will perform the deposit, undefined in case of direct pool underlying deposit
|
|
59
64
|
*/
|
|
60
|
-
zapper?:
|
|
65
|
+
zapper?: Zapper;
|
|
61
66
|
/**
|
|
62
67
|
* Before deposit user will nedd to call approve method on token that he wants to deposit,
|
|
63
68
|
* this is the spender address that will be used to call approve method.
|
|
@@ -77,7 +82,7 @@ export interface WithdrawalMetadata {
|
|
|
77
82
|
/**
|
|
78
83
|
* Zapper that will perform the withdrawal, undefined in case of direct pool underlying withdrawal
|
|
79
84
|
*/
|
|
80
|
-
zapper?:
|
|
85
|
+
zapper?: Zapper;
|
|
81
86
|
/**
|
|
82
87
|
* Before withdrawal user will need to call approve method on token that he wants to withdraw (diesel token),
|
|
83
88
|
* this is the spender address that will be used to call approve method.
|
|
@@ -146,13 +151,13 @@ export interface IPoolsService {
|
|
|
146
151
|
* @param props - {@link AddLiquidityProps}
|
|
147
152
|
* @returns - {@link AddLiquidityCall}
|
|
148
153
|
*/
|
|
149
|
-
addLiquidity(props: AddLiquidityProps):
|
|
154
|
+
addLiquidity(props: AddLiquidityProps): PoolServiceCallResult | undefined;
|
|
150
155
|
/**
|
|
151
156
|
* Construct a call to remove liquidity from a Gearbox lending pool.
|
|
152
157
|
*
|
|
153
158
|
* @param props - {@link RemoveLiquidityProps}
|
|
154
159
|
* @returns - {@link RemoveLiquidityCall}
|
|
155
160
|
*/
|
|
156
|
-
removeLiquidity(props: RemoveLiquidityProps):
|
|
161
|
+
removeLiquidity(props: RemoveLiquidityProps): PoolServiceCallResult;
|
|
157
162
|
}
|
|
158
163
|
export {};
|