@gearbox-protocol/sdk 14.10.3-next.1 → 14.10.3-next.3
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/sdk/market/ZapperRegister.js +5 -3
- package/dist/cjs/sdk/market/zapper/IERC20ZapperContract.js +98 -0
- package/dist/cjs/sdk/market/zapper/{IZapperContract.js → IETHZapperContract.js} +45 -10
- package/dist/cjs/sdk/market/zapper/{IETHZapperDepositsContract.js → Zapper.js} +22 -20
- package/dist/cjs/sdk/market/zapper/createZapper.js +45 -0
- package/dist/cjs/sdk/market/zapper/index.js +8 -6
- package/dist/cjs/sdk/pools/PoolService.js +9 -21
- package/dist/esm/abi/iERC20Zapper.js +9 -0
- package/dist/esm/abi/iETHZapper.js +6 -0
- package/dist/esm/sdk/market/ZapperRegister.js +5 -3
- 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 -3
- package/dist/esm/sdk/pools/PoolService.js +11 -24
- package/dist/types/{sdk/market/zapper/IERC20ZapperDepositsContract.d.ts → abi/iERC20Zapper.d.ts} +121 -19
- package/dist/types/{sdk/market/zapper/IZapperContract.d.ts → abi/iETHZapper.d.ts} +33 -19
- package/dist/types/sdk/market/ZapperRegister.d.ts +4 -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 -3
- package/dist/types/sdk/pools/types.d.ts +3 -3
- package/package.json +1 -1
- package/dist/cjs/sdk/market/zapper/IERC20ZapperDepositsContract.js +0 -54
- package/dist/esm/sdk/market/zapper/IERC20ZapperDepositsContract.js +0 -30
- package/dist/esm/sdk/market/zapper/IETHZapperDepositsContract.js +0 -21
- package/dist/esm/sdk/market/zapper/IZapperContract.js +0 -30
- package/dist/types/sdk/market/zapper/IETHZapperDepositsContract.d.ts +0 -47
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IERC20ZapperContract } from "./IERC20ZapperContract.js";
|
|
2
|
+
import { IETHZapperContract } from "./IETHZapperContract.js";
|
|
3
|
+
import { Zapper } from "./Zapper.js";
|
|
4
|
+
function createZapper(sdk, data) {
|
|
5
|
+
if (data.type === "base") {
|
|
6
|
+
const contractType = Zapper.contractType(data.baseParams);
|
|
7
|
+
switch (contractType) {
|
|
8
|
+
case "ZAPPER::ERC4626_UNDERLYING":
|
|
9
|
+
return new IERC20ZapperContract(sdk, data);
|
|
10
|
+
case "ZAPPER::WETH_DEPOSIT":
|
|
11
|
+
return new IETHZapperContract(sdk, data);
|
|
12
|
+
default:
|
|
13
|
+
sdk.logger?.warn(`Unknown zapper contract type: ${contractType}`);
|
|
14
|
+
return new Zapper(data);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return new Zapper(data);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
createZapper
|
|
21
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
1
|
+
export * from "./createZapper.js";
|
|
2
|
+
export * from "./IERC20ZapperContract.js";
|
|
3
|
+
export * from "./IETHZapperContract.js";
|
|
4
|
+
export * from "./Zapper.js";
|
|
@@ -7,10 +7,9 @@ import {
|
|
|
7
7
|
} from "../base/index.js";
|
|
8
8
|
import { NATIVE_ADDRESS } from "../constants/index.js";
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from "../market/zapper/index.js";
|
|
10
|
+
IERC20ZapperContract,
|
|
11
|
+
IETHZapperContract
|
|
12
|
+
} from "../market/index.js";
|
|
14
13
|
import { AddressSet, hexEq } from "../utils/index.js";
|
|
15
14
|
class PoolService extends SDKConstruct {
|
|
16
15
|
/**
|
|
@@ -82,23 +81,15 @@ class PoolService extends SDKConstruct {
|
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
const { zapper } = meta;
|
|
85
|
-
if (zapper
|
|
86
|
-
const
|
|
87
|
-
addr: zapper.baseParams.addr,
|
|
88
|
-
name: `ETHZapper(${this.labelAddress(zapper.baseParams.addr)})`
|
|
89
|
-
});
|
|
90
|
-
const tx2 = zapperContract.depositWithReferral(wallet, referralCode ?? 0n);
|
|
84
|
+
if (zapper instanceof IETHZapperContract) {
|
|
85
|
+
const tx2 = zapper.depositWithReferral(wallet, referralCode ?? 0n);
|
|
91
86
|
tx2.value = collateral.balance.toString();
|
|
92
87
|
return {
|
|
93
88
|
tx: tx2,
|
|
94
89
|
calls: [{ target: zapper.baseParams.addr, callData: tx2.callData }]
|
|
95
90
|
};
|
|
96
|
-
} else if (zapper) {
|
|
97
|
-
const
|
|
98
|
-
addr: zapper.baseParams.addr,
|
|
99
|
-
name: `ERC20Zapper(${this.labelAddress(zapper.baseParams.addr)})`
|
|
100
|
-
});
|
|
101
|
-
const tx2 = permit ? zapperContract.depositWithReferralAndPermit(
|
|
91
|
+
} else if (zapper instanceof IERC20ZapperContract) {
|
|
92
|
+
const tx2 = permit ? zapper.depositWithReferralAndPermit(
|
|
102
93
|
collateral.balance,
|
|
103
94
|
wallet,
|
|
104
95
|
referralCode ?? 0n,
|
|
@@ -106,7 +97,7 @@ class PoolService extends SDKConstruct {
|
|
|
106
97
|
permit.v,
|
|
107
98
|
permit.r,
|
|
108
99
|
permit.s
|
|
109
|
-
) :
|
|
100
|
+
) : zapper.depositWithReferral(
|
|
110
101
|
collateral.balance,
|
|
111
102
|
wallet,
|
|
112
103
|
referralCode ?? 0n
|
|
@@ -180,19 +171,15 @@ class PoolService extends SDKConstruct {
|
|
|
180
171
|
};
|
|
181
172
|
}
|
|
182
173
|
}
|
|
183
|
-
if (meta.zapper) {
|
|
184
|
-
const
|
|
185
|
-
addr: meta.zapper.baseParams.addr,
|
|
186
|
-
name: `Zapper(${this.labelAddress(meta.zapper.baseParams.addr)})`
|
|
187
|
-
});
|
|
188
|
-
const tx2 = permit ? zapperContract.redeemWithPermit(
|
|
174
|
+
if (meta.zapper instanceof IETHZapperContract || meta.zapper instanceof IERC20ZapperContract) {
|
|
175
|
+
const tx2 = permit ? meta.zapper.redeemWithPermit(
|
|
189
176
|
amount,
|
|
190
177
|
wallet,
|
|
191
178
|
permit.deadline,
|
|
192
179
|
permit.v,
|
|
193
180
|
permit.r,
|
|
194
181
|
permit.s
|
|
195
|
-
) :
|
|
182
|
+
) : meta.zapper.redeem(amount, wallet);
|
|
196
183
|
return {
|
|
197
184
|
tx: tx2,
|
|
198
185
|
calls: [{ target: meta.zapper.baseParams.addr, callData: tx2.callData }]
|
package/dist/types/{sdk/market/zapper/IERC20ZapperDepositsContract.d.ts → abi/iERC20Zapper.d.ts}
RENAMED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type { BaseContractArgs, ConstructOptions } from "../../base/index.js";
|
|
3
|
-
import { BaseContract } from "../../base/index.js";
|
|
4
|
-
import type { RawTx } from "../../types/index.js";
|
|
5
|
-
declare const abi: readonly [{
|
|
1
|
+
export declare const ierc20ZapperAbi: readonly [{
|
|
6
2
|
readonly type: "function";
|
|
7
3
|
readonly inputs: readonly [{
|
|
8
4
|
readonly name: "tokenInAmount";
|
|
@@ -194,18 +190,124 @@ declare const abi: readonly [{
|
|
|
194
190
|
readonly type: "uint256";
|
|
195
191
|
}];
|
|
196
192
|
readonly stateMutability: "nonpayable";
|
|
193
|
+
}, {
|
|
194
|
+
readonly type: "function";
|
|
195
|
+
readonly inputs: readonly [];
|
|
196
|
+
readonly name: "pool";
|
|
197
|
+
readonly outputs: readonly [{
|
|
198
|
+
readonly name: "";
|
|
199
|
+
readonly internalType: "address";
|
|
200
|
+
readonly type: "address";
|
|
201
|
+
}];
|
|
202
|
+
readonly stateMutability: "view";
|
|
203
|
+
}, {
|
|
204
|
+
readonly type: "function";
|
|
205
|
+
readonly inputs: readonly [{
|
|
206
|
+
readonly name: "tokenInAmount";
|
|
207
|
+
readonly internalType: "uint256";
|
|
208
|
+
readonly type: "uint256";
|
|
209
|
+
}];
|
|
210
|
+
readonly name: "previewDeposit";
|
|
211
|
+
readonly outputs: readonly [{
|
|
212
|
+
readonly name: "tokenOutAmount";
|
|
213
|
+
readonly internalType: "uint256";
|
|
214
|
+
readonly type: "uint256";
|
|
215
|
+
}];
|
|
216
|
+
readonly stateMutability: "view";
|
|
217
|
+
}, {
|
|
218
|
+
readonly type: "function";
|
|
219
|
+
readonly inputs: readonly [{
|
|
220
|
+
readonly name: "tokenOutAmount";
|
|
221
|
+
readonly internalType: "uint256";
|
|
222
|
+
readonly type: "uint256";
|
|
223
|
+
}];
|
|
224
|
+
readonly name: "previewRedeem";
|
|
225
|
+
readonly outputs: readonly [{
|
|
226
|
+
readonly name: "tokenInAmount";
|
|
227
|
+
readonly internalType: "uint256";
|
|
228
|
+
readonly type: "uint256";
|
|
229
|
+
}];
|
|
230
|
+
readonly stateMutability: "view";
|
|
231
|
+
}, {
|
|
232
|
+
readonly type: "function";
|
|
233
|
+
readonly inputs: readonly [{
|
|
234
|
+
readonly name: "tokenOutAmount";
|
|
235
|
+
readonly internalType: "uint256";
|
|
236
|
+
readonly type: "uint256";
|
|
237
|
+
}, {
|
|
238
|
+
readonly name: "receiver";
|
|
239
|
+
readonly internalType: "address";
|
|
240
|
+
readonly type: "address";
|
|
241
|
+
}];
|
|
242
|
+
readonly name: "redeem";
|
|
243
|
+
readonly outputs: readonly [{
|
|
244
|
+
readonly name: "tokenInAmount";
|
|
245
|
+
readonly internalType: "uint256";
|
|
246
|
+
readonly type: "uint256";
|
|
247
|
+
}];
|
|
248
|
+
readonly stateMutability: "nonpayable";
|
|
249
|
+
}, {
|
|
250
|
+
readonly type: "function";
|
|
251
|
+
readonly inputs: readonly [{
|
|
252
|
+
readonly name: "tokenOutAmount";
|
|
253
|
+
readonly internalType: "uint256";
|
|
254
|
+
readonly type: "uint256";
|
|
255
|
+
}, {
|
|
256
|
+
readonly name: "receiver";
|
|
257
|
+
readonly internalType: "address";
|
|
258
|
+
readonly type: "address";
|
|
259
|
+
}, {
|
|
260
|
+
readonly name: "deadline";
|
|
261
|
+
readonly internalType: "uint256";
|
|
262
|
+
readonly type: "uint256";
|
|
263
|
+
}, {
|
|
264
|
+
readonly name: "v";
|
|
265
|
+
readonly internalType: "uint8";
|
|
266
|
+
readonly type: "uint8";
|
|
267
|
+
}, {
|
|
268
|
+
readonly name: "r";
|
|
269
|
+
readonly internalType: "bytes32";
|
|
270
|
+
readonly type: "bytes32";
|
|
271
|
+
}, {
|
|
272
|
+
readonly name: "s";
|
|
273
|
+
readonly internalType: "bytes32";
|
|
274
|
+
readonly type: "bytes32";
|
|
275
|
+
}];
|
|
276
|
+
readonly name: "redeemWithPermit";
|
|
277
|
+
readonly outputs: readonly [{
|
|
278
|
+
readonly name: "tokenInAmount";
|
|
279
|
+
readonly internalType: "uint256";
|
|
280
|
+
readonly type: "uint256";
|
|
281
|
+
}];
|
|
282
|
+
readonly stateMutability: "nonpayable";
|
|
283
|
+
}, {
|
|
284
|
+
readonly type: "function";
|
|
285
|
+
readonly inputs: readonly [];
|
|
286
|
+
readonly name: "tokenIn";
|
|
287
|
+
readonly outputs: readonly [{
|
|
288
|
+
readonly name: "";
|
|
289
|
+
readonly internalType: "address";
|
|
290
|
+
readonly type: "address";
|
|
291
|
+
}];
|
|
292
|
+
readonly stateMutability: "view";
|
|
293
|
+
}, {
|
|
294
|
+
readonly type: "function";
|
|
295
|
+
readonly inputs: readonly [];
|
|
296
|
+
readonly name: "tokenOut";
|
|
297
|
+
readonly outputs: readonly [{
|
|
298
|
+
readonly name: "";
|
|
299
|
+
readonly internalType: "address";
|
|
300
|
+
readonly type: "address";
|
|
301
|
+
}];
|
|
302
|
+
readonly stateMutability: "view";
|
|
303
|
+
}, {
|
|
304
|
+
readonly type: "function";
|
|
305
|
+
readonly inputs: readonly [];
|
|
306
|
+
readonly name: "underlying";
|
|
307
|
+
readonly outputs: readonly [{
|
|
308
|
+
readonly name: "";
|
|
309
|
+
readonly internalType: "address";
|
|
310
|
+
readonly type: "address";
|
|
311
|
+
}];
|
|
312
|
+
readonly stateMutability: "view";
|
|
197
313
|
}];
|
|
198
|
-
type abi = typeof abi;
|
|
199
|
-
export declare class IERC20ZapperDepositsContract extends BaseContract<abi> {
|
|
200
|
-
constructor(options: ConstructOptions, args: Omit<BaseContractArgs<abi>, "abi">);
|
|
201
|
-
/**
|
|
202
|
-
* Deposits ERC20 tokens into the pool via this zapper using a referral code.
|
|
203
|
-
*/
|
|
204
|
-
depositWithReferral(tokenInAmount: bigint, receiver: Address, referralCode: bigint): RawTx;
|
|
205
|
-
/**
|
|
206
|
-
* Deposits ERC20 tokens via this zapper with a referral code and an
|
|
207
|
-
* EIP-2612 permit signature, skipping a separate approve transaction.
|
|
208
|
-
*/
|
|
209
|
-
depositWithReferralAndPermit(tokenInAmount: bigint, receiver: Address, referralCode: bigint, deadline: bigint, v: number, r: Hex, s: Hex): RawTx;
|
|
210
|
-
}
|
|
211
|
-
export {};
|
|
@@ -1,8 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export declare const iethZapperAbi: readonly [{
|
|
2
|
+
readonly type: "function";
|
|
3
|
+
readonly inputs: readonly [{
|
|
4
|
+
readonly name: "receiver";
|
|
5
|
+
readonly internalType: "address";
|
|
6
|
+
readonly type: "address";
|
|
7
|
+
}];
|
|
8
|
+
readonly name: "deposit";
|
|
9
|
+
readonly outputs: readonly [{
|
|
10
|
+
readonly name: "tokenOutAmount";
|
|
11
|
+
readonly internalType: "uint256";
|
|
12
|
+
readonly type: "uint256";
|
|
13
|
+
}];
|
|
14
|
+
readonly stateMutability: "payable";
|
|
15
|
+
}, {
|
|
16
|
+
readonly type: "function";
|
|
17
|
+
readonly inputs: readonly [{
|
|
18
|
+
readonly name: "receiver";
|
|
19
|
+
readonly internalType: "address";
|
|
20
|
+
readonly type: "address";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "referralCode";
|
|
23
|
+
readonly internalType: "uint256";
|
|
24
|
+
readonly type: "uint256";
|
|
25
|
+
}];
|
|
26
|
+
readonly name: "depositWithReferral";
|
|
27
|
+
readonly outputs: readonly [{
|
|
28
|
+
readonly name: "tokenOutAmount";
|
|
29
|
+
readonly internalType: "uint256";
|
|
30
|
+
readonly type: "uint256";
|
|
31
|
+
}];
|
|
32
|
+
readonly stateMutability: "payable";
|
|
33
|
+
}, {
|
|
6
34
|
readonly type: "function";
|
|
7
35
|
readonly inputs: readonly [];
|
|
8
36
|
readonly name: "pool";
|
|
@@ -123,17 +151,3 @@ declare const abi: readonly [{
|
|
|
123
151
|
}];
|
|
124
152
|
readonly stateMutability: "view";
|
|
125
153
|
}];
|
|
126
|
-
type abi = typeof abi;
|
|
127
|
-
export declare class IZapperContract extends BaseContract<abi> {
|
|
128
|
-
constructor(options: ConstructOptions, args: Omit<BaseContractArgs<abi>, "abi">);
|
|
129
|
-
/**
|
|
130
|
-
* Redeems pool shares (diesel tokens) for the underlying asset via this zapper.
|
|
131
|
-
*/
|
|
132
|
-
redeem(tokenInAmount: bigint, receiver: Address): RawTx;
|
|
133
|
-
/**
|
|
134
|
-
* Redeems pool shares via this zapper with an EIP-2612 permit signature,
|
|
135
|
-
* skipping a separate approve transaction.
|
|
136
|
-
*/
|
|
137
|
-
redeemWithPermit(tokenInAmount: bigint, receiver: Address, deadline: bigint, v: number, r: Hex, s: Hex): RawTx;
|
|
138
|
-
}
|
|
139
|
-
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import { SDKConstruct } from "../base/index.js";
|
|
3
3
|
import { AddressMap } from "../utils/index.js";
|
|
4
|
-
import type
|
|
4
|
+
import { type Zapper } from "./zapper/index.js";
|
|
5
5
|
export declare class ZapperRegister extends SDKConstruct {
|
|
6
6
|
#private;
|
|
7
7
|
/**
|
|
8
8
|
* Load zappers for all pools using periphery compressor, adds hardcoded zappers
|
|
9
9
|
*/
|
|
10
10
|
loadZappers(force?: boolean): Promise<void>;
|
|
11
|
-
get zappers(): AddressMap<
|
|
12
|
-
poolZappers(pool: Address):
|
|
11
|
+
get zappers(): AddressMap<Zapper[]>;
|
|
12
|
+
poolZappers(pool: Address): Zapper[];
|
|
13
13
|
/**
|
|
14
14
|
* Can return multiple zappers if there are multiple zappers for the same tokenIn and tokenOut
|
|
15
15
|
*/
|
|
16
|
-
getZapper(pool: Address, tokenIn: Address, tokenOut: Address): Array<
|
|
16
|
+
getZapper(pool: Address, tokenIn: Address, tokenOut: Address): Array<Zapper> | undefined;
|
|
17
17
|
}
|
|
@@ -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 {};
|