@morpho-org/bundler-sdk-viem 2.3.0-next.0 → 3.0.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/lib/BundlerAction.d.ts +177 -107
- package/lib/BundlerAction.js +1036 -403
- package/lib/abis.d.ts +3062 -0
- package/lib/abis.js +2095 -0
- package/lib/actions.d.ts +0 -1
- package/lib/actions.js +92 -163
- package/lib/errors.d.ts +4 -1
- package/lib/errors.js +6 -0
- package/lib/operations.js +67 -58
- package/lib/types/actions.d.ts +73 -27
- package/package.json +10 -10
package/lib/BundlerAction.d.ts
CHANGED
|
@@ -1,116 +1,154 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ChainId, type InputMarketParams } from "@morpho-org/blue-sdk";
|
|
2
2
|
import { type Address, type Hex } from "viem";
|
|
3
3
|
import type { Action, Authorization, InputReallocation, Permit2PermitSingle } from "./types/index.js";
|
|
4
|
-
export
|
|
4
|
+
export interface BundlerCall {
|
|
5
|
+
to: Address;
|
|
6
|
+
data: Hex;
|
|
7
|
+
value: bigint;
|
|
8
|
+
skipRevert: boolean;
|
|
9
|
+
callbackHash: Hex;
|
|
10
|
+
}
|
|
5
11
|
/**
|
|
6
12
|
* Namespace to easily encode calls to the Bundler contract, using ethers.
|
|
7
13
|
*/
|
|
8
14
|
export declare namespace BundlerAction {
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
function encodeBundle(chainId: ChainId, actions: Action[]): {
|
|
16
|
+
to: `0x${string}`;
|
|
17
|
+
value: bigint;
|
|
18
|
+
data: `0x${string}`;
|
|
19
|
+
};
|
|
20
|
+
function encode(chainId: ChainId, { type, args }: Action): BundlerCall[];
|
|
21
|
+
/**
|
|
22
|
+
* Encodes a call to the Adapter to transfer native tokens (ETH on ethereum, MATIC on polygon, etc).
|
|
23
|
+
* @param chainId The chain id for which to encode the call.
|
|
24
|
+
* @param owner The owner of native tokens.
|
|
12
25
|
* @param recipient The address to send native tokens to.
|
|
13
26
|
* @param amount The amount of native tokens to send (in wei).
|
|
14
27
|
*/
|
|
15
|
-
function nativeTransfer(recipient: Address, amount: bigint): BundlerCall;
|
|
28
|
+
function nativeTransfer(chainId: ChainId, owner: Address, recipient: Address, amount: bigint): BundlerCall[];
|
|
16
29
|
/**
|
|
17
|
-
* Encodes a call to the
|
|
30
|
+
* Encodes a call to the Adapter to transfer ERC20 tokens.
|
|
31
|
+
* @param chainId The chain id for which to encode the call.
|
|
18
32
|
* @param asset The address of the ERC20 token to transfer.
|
|
19
33
|
* @param recipient The address to send tokens to.
|
|
20
34
|
* @param amount The amount of tokens to send.
|
|
21
35
|
*/
|
|
22
|
-
function erc20Transfer(asset: Address, recipient: Address, amount: bigint): BundlerCall;
|
|
36
|
+
function erc20Transfer(chainId: ChainId, asset: Address, recipient: Address, amount: bigint): BundlerCall[];
|
|
23
37
|
/**
|
|
24
|
-
* Encodes a call to the
|
|
38
|
+
* Encodes a call to the Adapter to transfer ERC20 tokens from the sender to the Bundler.
|
|
39
|
+
* @param chainId The chain id for which to encode the call.
|
|
25
40
|
* @param asset The address of the ERC20 token to transfer.
|
|
26
41
|
* @param amount The amount of tokens to send.
|
|
42
|
+
* @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
|
|
27
43
|
*/
|
|
28
|
-
function erc20TransferFrom(asset: Address, amount: bigint): BundlerCall;
|
|
44
|
+
function erc20TransferFrom(chainId: ChainId, asset: Address, amount: bigint, recipient?: Address): BundlerCall[];
|
|
29
45
|
/**
|
|
30
|
-
* Encodes a call to the
|
|
46
|
+
* Encodes a call to the Adapter to permit an ERC20 token.
|
|
47
|
+
* @param chainId The chain id for which to encode the call.
|
|
48
|
+
* @param owner The address which owns the tokens.
|
|
31
49
|
* @param asset The address of the ERC20 token to permit.
|
|
32
50
|
* @param amount The amount of tokens to permit.
|
|
33
51
|
* @param deadline The timestamp until which the signature is valid.
|
|
34
52
|
* @param signature The Ethers signature to permit the tokens.
|
|
53
|
+
* @param spender The address allowed to spend the tokens.
|
|
35
54
|
* @param skipRevert Whether to allow the permit to revert without making the whole multicall revert.
|
|
36
55
|
*/
|
|
37
|
-
function permit(asset: Address, amount: bigint, deadline: bigint, signature: Hex, skipRevert
|
|
56
|
+
function permit(chainId: ChainId, owner: Address, asset: Address, amount: bigint, deadline: bigint, signature: Hex, spender?: Address, skipRevert?: boolean): BundlerCall[];
|
|
38
57
|
/**
|
|
39
|
-
* Encodes a call to the
|
|
58
|
+
* Encodes a call to the Adapter to permit DAI.
|
|
59
|
+
* @param chainId The chain id for which to encode the call.
|
|
60
|
+
* @param owner The address which owns the tokens.
|
|
40
61
|
* @param nonce The permit nonce used.
|
|
41
62
|
* @param expiry The timestamp until which the signature is valid.
|
|
42
63
|
* @param allowed The amount of DAI to permit.
|
|
43
64
|
* @param signature The Ethers signature to permit the tokens.
|
|
65
|
+
* @param spender The address allowed to spend the tokens.
|
|
44
66
|
* @param skipRevert Whether to allow the permit to revert without making the whole multicall revert.
|
|
45
67
|
*/
|
|
46
|
-
function permitDai(nonce: bigint, expiry: bigint, allowed: boolean, signature: Hex, skipRevert
|
|
68
|
+
function permitDai(chainId: ChainId, owner: Address, nonce: bigint, expiry: bigint, allowed: boolean, signature: Hex, spender?: Address, skipRevert?: boolean): BundlerCall[];
|
|
47
69
|
/**
|
|
48
|
-
* Encodes a call to the
|
|
70
|
+
* Encodes a call to the Adapter to permit ERC20 tokens via Permit2.
|
|
71
|
+
* @param chainId The chain id for which to encode the call.
|
|
72
|
+
* @param owner The owner of ERC20 tokens.
|
|
49
73
|
* @param permitSingle The permit details to submit to Permit2.
|
|
50
74
|
* @param signature The Ethers signature to permit the tokens.
|
|
51
75
|
* @param skipRevert Whether to allow the permit to revert without making the whole multicall revert.
|
|
52
76
|
*/
|
|
53
|
-
function approve2(permitSingle: Permit2PermitSingle, signature: Hex, skipRevert
|
|
77
|
+
function approve2(chainId: ChainId, owner: Address, permitSingle: Permit2PermitSingle, signature: Hex, skipRevert?: boolean): BundlerCall[];
|
|
54
78
|
/**
|
|
55
|
-
* Encodes a call to the
|
|
79
|
+
* Encodes a call to the Adapter to transfer ERC20 tokens via Permit2 from the sender to the Bundler.
|
|
80
|
+
* @param chainId The chain id for which to encode the call.
|
|
56
81
|
* @param asset The address of the ERC20 token to transfer.
|
|
82
|
+
* @param owner The owner of ERC20 tokens.
|
|
57
83
|
* @param amount The amount of tokens to send.
|
|
84
|
+
* @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
|
|
58
85
|
*/
|
|
59
|
-
function transferFrom2(asset: Address, amount: bigint): BundlerCall;
|
|
86
|
+
function transferFrom2(chainId: ChainId, asset: Address, owner: Address, amount: bigint, recipient?: Address): BundlerCall[];
|
|
60
87
|
/**
|
|
61
|
-
* Encodes a call to the
|
|
88
|
+
* Encodes a call to the Adapter to wrap ERC20 tokens via the provided ERC20Wrapper.
|
|
89
|
+
* @param chainId The chain id for which to encode the call.
|
|
62
90
|
* @param wrapper The address of the ERC20 wrapper token.
|
|
91
|
+
* @param underlying The address of the underlying ERC20 token.
|
|
63
92
|
* @param amount The amount of tokens to send.
|
|
64
93
|
*/
|
|
65
|
-
function erc20WrapperDepositFor(wrapper: Address, amount: bigint): BundlerCall;
|
|
94
|
+
function erc20WrapperDepositFor(chainId: ChainId, wrapper: Address, underlying: Address, amount: bigint): BundlerCall[];
|
|
66
95
|
/**
|
|
67
|
-
* Encodes a call to the
|
|
96
|
+
* Encodes a call to the Adapter to unwrap ERC20 tokens from the provided ERC20Wrapper.
|
|
97
|
+
* @param chainId The chain id for which to encode the call.
|
|
68
98
|
* @param wrapper The address of the ERC20 wrapper token.
|
|
69
99
|
* @param account The address to send the underlying ERC20 tokens.
|
|
70
100
|
* @param amount The amount of tokens to send.
|
|
71
101
|
*/
|
|
72
|
-
function erc20WrapperWithdrawTo(wrapper: Address,
|
|
102
|
+
function erc20WrapperWithdrawTo(chainId: ChainId, wrapper: Address, receiver: Address, amount: bigint): BundlerCall[];
|
|
73
103
|
/**
|
|
74
|
-
* Encodes a call to the
|
|
104
|
+
* Encodes a call to the Adapter to mint shares of the provided ERC4626 vault.
|
|
105
|
+
* @param chainId The chain id for which to encode the call.
|
|
75
106
|
* @param erc4626 The address of the ERC4626 vault.
|
|
76
107
|
* @param shares The amount of shares to mint.
|
|
77
|
-
* @param
|
|
108
|
+
* @param maxSharePrice The maximum amount of assets to pay to get 1 share (scaled by RAY).
|
|
78
109
|
* @param receiver The address to send the shares to.
|
|
79
110
|
*/
|
|
80
|
-
function erc4626Mint(erc4626: Address, shares: bigint,
|
|
111
|
+
function erc4626Mint(chainId: ChainId, erc4626: Address, shares: bigint, maxSharePrice: bigint, receiver: Address): BundlerCall[];
|
|
81
112
|
/**
|
|
82
|
-
* Encodes a call to the
|
|
113
|
+
* Encodes a call to the Adapter to deposit assets into the provided ERC4626 vault.
|
|
114
|
+
* @param chainId The chain id for which to encode the call.
|
|
83
115
|
* @param erc4626 The address of the ERC4626 vault.
|
|
84
116
|
* @param assets The amount of assets to deposit.
|
|
85
|
-
* @param
|
|
117
|
+
* @param maxSharePrice The maximum amount of assets to pay to get 1 share (scaled by RAY).
|
|
86
118
|
* @param receiver The address to send the shares to.
|
|
87
119
|
*/
|
|
88
|
-
function erc4626Deposit(erc4626: Address, assets: bigint,
|
|
120
|
+
function erc4626Deposit(chainId: ChainId, erc4626: Address, assets: bigint, maxSharePrice: bigint, receiver: Address): BundlerCall[];
|
|
89
121
|
/**
|
|
90
|
-
* Encodes a call to the
|
|
122
|
+
* Encodes a call to the Adapter to withdraw assets from the provided ERC4626 vault.
|
|
123
|
+
* @param chainId The chain id for which to encode the call.
|
|
91
124
|
* @param erc4626 The address of the ERC4626 vault.
|
|
92
125
|
* @param assets The amount of assets to withdraw.
|
|
93
|
-
* @param
|
|
126
|
+
* @param minSharePrice The minimum number of assets to receive per share (scaled by RAY).
|
|
94
127
|
* @param receiver The address to send the assets to.
|
|
128
|
+
* @param owner The address on behalf of which the assets are withdrawn.
|
|
95
129
|
*/
|
|
96
|
-
function erc4626Withdraw(erc4626: Address, assets: bigint,
|
|
130
|
+
function erc4626Withdraw(chainId: ChainId, erc4626: Address, assets: bigint, minSharePrice: bigint, receiver: Address, owner: Address): BundlerCall[];
|
|
97
131
|
/**
|
|
98
|
-
* Encodes a call to the
|
|
132
|
+
* Encodes a call to the Adapter to redeem shares from the provided ERC4626 vault.
|
|
133
|
+
* @param chainId The chain id for which to encode the call.
|
|
99
134
|
* @param erc4626 The address of the ERC4626 vault.
|
|
100
135
|
* @param shares The amount of shares to redeem.
|
|
101
|
-
* @param
|
|
136
|
+
* @param minSharePrice The minimum number of assets to receive per share (scaled by RAY).
|
|
102
137
|
* @param receiver The address to send the assets to.
|
|
138
|
+
* @param owner The address on behalf of which the assets are withdrawn.
|
|
103
139
|
*/
|
|
104
|
-
function erc4626Redeem(erc4626: Address, shares: bigint,
|
|
140
|
+
function erc4626Redeem(chainId: ChainId, erc4626: Address, shares: bigint, minSharePrice: bigint, receiver: Address, owner: Address): BundlerCall[];
|
|
105
141
|
/**
|
|
106
|
-
* Encodes a call to the
|
|
142
|
+
* Encodes a call to the Adapter to authorize an account on Morpho Blue.
|
|
143
|
+
* @param chainId The chain id for which to encode the call.
|
|
107
144
|
* @param authorization The authorization details to submit to Morpho Blue.
|
|
108
145
|
* @param signature The Ethers signature to authorize the account.
|
|
109
146
|
* @param skipRevert Whether to allow the authorization call to revert without making the whole multicall revert.
|
|
110
147
|
*/
|
|
111
|
-
function morphoSetAuthorizationWithSig(authorization: Authorization, signature: Hex, skipRevert
|
|
148
|
+
function morphoSetAuthorizationWithSig(chainId: ChainId, authorization: Authorization, signature: Hex, skipRevert?: boolean): BundlerCall[];
|
|
112
149
|
/**
|
|
113
|
-
* Encodes a call to the
|
|
150
|
+
* Encodes a call to the Adapter to supply to a Morpho Blue market.
|
|
151
|
+
* @param chainId The chain id for which to encode the call.
|
|
114
152
|
* @param market The market params to supply to.
|
|
115
153
|
* @param assets The amount of assets to supply.
|
|
116
154
|
* @param shares The amount of supply shares to mint.
|
|
@@ -118,26 +156,29 @@ export declare namespace BundlerAction {
|
|
|
118
156
|
* @param onBehalf The address to supply on behalf of.
|
|
119
157
|
* @param callbackCalls The array of calls to execute inside Morpho Blue's `onMorphoSupply` callback.
|
|
120
158
|
*/
|
|
121
|
-
function morphoSupply(market: InputMarketParams, assets: bigint, shares: bigint, slippageAmount: bigint, onBehalf: Address, callbackCalls: BundlerCall[]): BundlerCall;
|
|
159
|
+
function morphoSupply(chainId: ChainId, market: InputMarketParams, assets: bigint, shares: bigint, slippageAmount: bigint, onBehalf: Address, callbackCalls: BundlerCall[]): BundlerCall[];
|
|
122
160
|
/**
|
|
123
|
-
* Encodes a call to the
|
|
161
|
+
* Encodes a call to the Adapter to supply collateral to a Morpho Blue market.
|
|
162
|
+
* @param chainId The chain id for which to encode the call.
|
|
124
163
|
* @param market The market params to supply to.
|
|
125
164
|
* @param assets The amount of assets to supply.
|
|
126
165
|
* @param onBehalf The address to supply on behalf of.
|
|
127
166
|
* @param callbackCalls The array of calls to execute inside Morpho Blue's `onMorphoSupplyCollateral` callback.
|
|
128
167
|
*/
|
|
129
|
-
function morphoSupplyCollateral(market: InputMarketParams, assets: bigint, onBehalf: Address, callbackCalls: BundlerCall[]): BundlerCall;
|
|
168
|
+
function morphoSupplyCollateral(chainId: ChainId, market: InputMarketParams, assets: bigint, onBehalf: Address, callbackCalls: BundlerCall[]): BundlerCall[];
|
|
130
169
|
/**
|
|
131
|
-
* Encodes a call to the
|
|
170
|
+
* Encodes a call to the Adapter to borrow from a Morpho Blue market.
|
|
171
|
+
* @param chainId The chain id for which to encode the call.
|
|
132
172
|
* @param market The market params to borrow from.
|
|
133
173
|
* @param assets The amount of assets to borrow.
|
|
134
174
|
* @param shares The amount of borrow shares to mint.
|
|
135
175
|
* @param slippageAmount The minimum (resp. maximum) amount of assets (resp. borrow shares) to borrow (resp. mint) (protects the sender from unexpected slippage).
|
|
136
176
|
* @param receiver The address to send borrowed tokens to.
|
|
137
177
|
*/
|
|
138
|
-
function morphoBorrow(market: InputMarketParams, assets: bigint, shares: bigint, slippageAmount: bigint, receiver: Address): BundlerCall;
|
|
178
|
+
function morphoBorrow(chainId: ChainId, market: InputMarketParams, assets: bigint, shares: bigint, slippageAmount: bigint, receiver: Address): BundlerCall[];
|
|
139
179
|
/**
|
|
140
|
-
* Encodes a call to the
|
|
180
|
+
* Encodes a call to the Adapter to repay to a Morpho Blue market.
|
|
181
|
+
* @param chainId The chain id for which to encode the call.
|
|
141
182
|
* @param market The market params to repay to.
|
|
142
183
|
* @param assets The amount of assets to repay.
|
|
143
184
|
* @param shares The amount of borrow shares to redeem.
|
|
@@ -145,41 +186,45 @@ export declare namespace BundlerAction {
|
|
|
145
186
|
* @param onBehalf The address to repay on behalf of.
|
|
146
187
|
* @param callbackCalls The array of calls to execute inside Morpho Blue's `onMorphoSupply` callback.
|
|
147
188
|
*/
|
|
148
|
-
function morphoRepay(market: InputMarketParams, assets: bigint, shares: bigint, slippageAmount: bigint, onBehalf: Address, callbackCalls: BundlerCall[]): BundlerCall;
|
|
189
|
+
function morphoRepay(chainId: ChainId, market: InputMarketParams, assets: bigint, shares: bigint, slippageAmount: bigint, onBehalf: Address, callbackCalls: BundlerCall[]): BundlerCall[];
|
|
149
190
|
/**
|
|
150
|
-
* Encodes a call to the
|
|
191
|
+
* Encodes a call to the Adapter to withdraw from a Morpho Blue market.
|
|
192
|
+
* @param chainId The chain id for which to encode the call.
|
|
151
193
|
* @param market The market params to withdraw from.
|
|
152
194
|
* @param assets The amount of assets to withdraw.
|
|
153
195
|
* @param shares The amount of supply shares to redeem.
|
|
154
196
|
* @param slippageAmount The minimum (resp. maximum) amount of assets (resp. supply shares) to withdraw (resp. redeem) (protects the sender from unexpected slippage).
|
|
155
197
|
* @param receiver The address to send withdrawn tokens to.
|
|
156
198
|
*/
|
|
157
|
-
function morphoWithdraw(market: InputMarketParams, assets: bigint, shares: bigint, slippageAmount: bigint, receiver: Address): BundlerCall;
|
|
199
|
+
function morphoWithdraw(chainId: ChainId, market: InputMarketParams, assets: bigint, shares: bigint, slippageAmount: bigint, receiver: Address): BundlerCall[];
|
|
158
200
|
/**
|
|
159
|
-
* Encodes a call to the
|
|
201
|
+
* Encodes a call to the Adapter to withdraw collateral from a Morpho Blue market.
|
|
202
|
+
* @param chainId The chain id for which to encode the call.
|
|
160
203
|
* @param market The market params to withdraw from.
|
|
161
204
|
* @param assets The amount of assets to withdraw.
|
|
162
205
|
* @param receiver The address to send withdrawn tokens to.
|
|
163
206
|
*/
|
|
164
|
-
function morphoWithdrawCollateral(market: InputMarketParams, assets: bigint, receiver: Address): BundlerCall;
|
|
207
|
+
function morphoWithdrawCollateral(chainId: ChainId, market: InputMarketParams, assets: bigint, receiver: Address): BundlerCall[];
|
|
165
208
|
/**
|
|
166
|
-
* Encodes a call to the
|
|
209
|
+
* Encodes a call to the Adapter to flash loan from Morpho Blue.
|
|
210
|
+
* @param chainId The chain id for which to encode the call.
|
|
167
211
|
* @param asset The address of the ERC20 token to flash loan.
|
|
168
212
|
* @param amount The amount of tokens to flash loan.
|
|
169
213
|
* @param callbackCalls The array of calls to execute inside Morpho Blue's `onMorphoFlashLoan` callback.
|
|
170
214
|
*/
|
|
171
|
-
function morphoFlashLoan(asset: Address, amount: bigint, callbackCalls: BundlerCall[]): BundlerCall;
|
|
215
|
+
function morphoFlashLoan(chainId: ChainId, asset: Address, amount: bigint, callbackCalls: BundlerCall[]): BundlerCall[];
|
|
172
216
|
/**
|
|
173
|
-
* Encodes a call to the
|
|
174
|
-
* @param
|
|
217
|
+
* Encodes a call to the Adapter to trigger a public reallocation on the PublicAllocator.
|
|
218
|
+
* @param chainId The chain id for which to encode the call.
|
|
175
219
|
* @param vault The vault to reallocate.
|
|
176
|
-
* @param
|
|
220
|
+
* @param fee The vault public reallocation fee.
|
|
177
221
|
* @param withdrawals The array of withdrawals to perform, before supplying everything to the supply market.
|
|
178
222
|
* @param supplyMarketParams The market params to reallocate to.
|
|
179
223
|
*/
|
|
180
|
-
function
|
|
224
|
+
function publicAllocatorReallocateTo(chainId: ChainId, vault: Address, fee: bigint, withdrawals: InputReallocation[], supplyMarketParams: InputMarketParams): BundlerCall[];
|
|
181
225
|
/**
|
|
182
|
-
* Encodes a call to the
|
|
226
|
+
* Encodes a call to the Adapter to claim rewards from the Universal Rewards Distributor.
|
|
227
|
+
* @param chainId The chain id for which to encode the call.
|
|
183
228
|
* @param distributor The address of the distributor to claim rewards from.
|
|
184
229
|
* @param account The address to claim rewards for.
|
|
185
230
|
* @param reward The address of the reward token to claim.
|
|
@@ -187,135 +232,160 @@ export declare namespace BundlerAction {
|
|
|
187
232
|
* @param proof The Merkle proof to claim the rewards.
|
|
188
233
|
* @param skipRevert Whether to allow the claim to revert without making the whole multicall revert.
|
|
189
234
|
*/
|
|
190
|
-
function urdClaim(distributor: Address, account: Address, reward: Address, amount: bigint, proof: Hex[], skipRevert
|
|
235
|
+
function urdClaim(distributor: Address, account: Address, reward: Address, amount: bigint, proof: Hex[], skipRevert?: boolean): BundlerCall[];
|
|
191
236
|
/**
|
|
192
|
-
* Encodes a call to the
|
|
237
|
+
* Encodes a call to the Adapter to wrap native tokens (ETH to WETH on ethereum, MATIC to WMATIC on polygon, etc).
|
|
238
|
+
* @param chainId The chain id for which to encode the call.
|
|
193
239
|
* @param amount The amount of native tokens to wrap (in wei).
|
|
240
|
+
* @param recipient The address to send tokens to. Defaults to the chain's bundler3 general adapter.
|
|
194
241
|
*/
|
|
195
|
-
function wrapNative(amount: bigint): BundlerCall;
|
|
242
|
+
function wrapNative(chainId: ChainId, amount: bigint, recipient?: Address): BundlerCall[];
|
|
196
243
|
/**
|
|
197
|
-
* Encodes a call to the
|
|
244
|
+
* Encodes a call to the Adapter to unwrap native tokens (WETH to ETH on ethereum, WMATIC to MATIC on polygon, etc).
|
|
245
|
+
* @param chainId The chain id for which to encode the call.
|
|
198
246
|
* @param amount The amount of native tokens to unwrap (in wei).
|
|
247
|
+
* @param recipient The address to send tokens to. Defaults to the chain's bundler3 general adapter.
|
|
199
248
|
*/
|
|
200
|
-
function unwrapNative(amount: bigint): BundlerCall;
|
|
249
|
+
function unwrapNative(chainId: ChainId, amount: bigint, recipient?: Address): BundlerCall[];
|
|
201
250
|
/**
|
|
202
|
-
* Encodes a call to the
|
|
251
|
+
* Encodes a call to the Adapter to stake native tokens using Lido (ETH to stETH on ethereum).
|
|
252
|
+
* @param chainId The chain id for which to encode the call.
|
|
203
253
|
* @param amount The amount of native tokens to stake (in wei).
|
|
204
|
-
* @param
|
|
254
|
+
* @param maxSharePrice The maximum amount of wei to pay for minting 1 share (scaled by RAY).
|
|
205
255
|
* @param referral The referral address to use.
|
|
256
|
+
* @param recipient The address to send stETH to. Defaults to the chain's bundler3 general adapter.
|
|
206
257
|
*/
|
|
207
|
-
function stakeEth(amount: bigint,
|
|
258
|
+
function stakeEth(chainId: ChainId, amount: bigint, maxSharePrice: bigint, referral: Address, recipient?: Address): BundlerCall[];
|
|
208
259
|
/**
|
|
209
|
-
* Encodes a call to the
|
|
260
|
+
* Encodes a call to the Adapter to wrap stETH (stETH to wstETH on ethereum).
|
|
261
|
+
* @param chainId The chain id for which to encode the call.
|
|
210
262
|
* @param amount The amount of stETH to wrap (in wei).
|
|
263
|
+
* @param recipient The address to send wstETH to. Defaults to the chain's bundler3 general adapter.
|
|
211
264
|
*/
|
|
212
|
-
function wrapStEth(amount: bigint): BundlerCall;
|
|
265
|
+
function wrapStEth(chainId: ChainId, amount: bigint, recipient?: Address): BundlerCall[];
|
|
213
266
|
/**
|
|
214
|
-
* Encodes a call to the
|
|
267
|
+
* Encodes a call to the Adapter to unwrap wstETH (wstETH to stETH on ethereum).
|
|
268
|
+
* @param chainId The chain id for which to encode the call.
|
|
215
269
|
* @param amount The amount of wstETH to unwrap (in wei).
|
|
270
|
+
* @param recipient The address to send stETH to. Defaults to the chain's bundler3 general adapter.
|
|
216
271
|
*/
|
|
217
|
-
function unwrapStEth(amount: bigint): BundlerCall;
|
|
272
|
+
function unwrapStEth(chainId: ChainId, amount: bigint, recipient?: Address): BundlerCall[];
|
|
218
273
|
/**
|
|
219
|
-
*
|
|
220
|
-
*
|
|
274
|
+
* Encodes a call to the Adapter to repay a debt on AaveV2.
|
|
275
|
+
* @param chainId The chain id for which to encode the call.
|
|
221
276
|
* @param asset The debt asset to repay.
|
|
222
277
|
* @param amount The amount of debt to repay.
|
|
278
|
+
* @param onBehalf The address on behalf of which to repay.
|
|
223
279
|
* @param rateMode The interest rate mode used by the debt to repay.
|
|
224
280
|
*/
|
|
225
|
-
function aaveV2Repay(asset: Address, amount: bigint,
|
|
281
|
+
function aaveV2Repay(chainId: ChainId, asset: Address, amount: bigint, onBehalf: Address, rateMode?: bigint): BundlerCall[];
|
|
226
282
|
/**
|
|
227
|
-
*
|
|
228
|
-
*
|
|
283
|
+
* Encodes a call to the Adapter to withdrawn from AaveV2.
|
|
284
|
+
* @param chainId The chain id for which to encode the call.
|
|
229
285
|
* @param asset The asset to withdraw.
|
|
230
286
|
* @param amount The amount of asset to withdraw.
|
|
287
|
+
* @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
|
|
231
288
|
*/
|
|
232
|
-
function aaveV2Withdraw(asset: Address, amount: bigint): BundlerCall;
|
|
289
|
+
function aaveV2Withdraw(chainId: ChainId, asset: Address, amount: bigint, recipient?: Address): BundlerCall[];
|
|
233
290
|
/**
|
|
234
|
-
*
|
|
235
|
-
*
|
|
291
|
+
* Encodes a call to the Adapter to repay a debt on AaveV3.
|
|
292
|
+
* @param chainId The chain id for which to encode the call.
|
|
236
293
|
* @param asset The debt asset to repay.
|
|
237
294
|
* @param amount The amount of debt to repay.
|
|
295
|
+
* @param onBehalf The address on behalf of which to repay.
|
|
238
296
|
* @param rateMode The interest rate mode used by the debt to repay.
|
|
239
297
|
*/
|
|
240
|
-
function aaveV3Repay(asset: Address, amount: bigint,
|
|
298
|
+
function aaveV3Repay(chainId: ChainId, asset: Address, amount: bigint, onBehalf: Address, rateMode?: bigint): BundlerCall[];
|
|
241
299
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
300
|
+
* Encodes a call to the Adapter to withdrawn from AaveV3.
|
|
301
|
+
* @param chainId The chain id for which to encode the call.
|
|
244
302
|
* @param asset The asset to withdraw.
|
|
245
303
|
* @param amount The amount of asset to withdraw.
|
|
304
|
+
* @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
|
|
246
305
|
*/
|
|
247
|
-
function aaveV3Withdraw(asset: Address, amount: bigint): BundlerCall;
|
|
306
|
+
function aaveV3Withdraw(chainId: ChainId, asset: Address, amount: bigint, recipient?: Address): BundlerCall[];
|
|
248
307
|
/**
|
|
249
|
-
*
|
|
250
|
-
*
|
|
308
|
+
* Encodes a call to the Adapter to repay a debt on Morpho's AaveV3Optimizer.
|
|
309
|
+
* @param chainId The chain id for which to encode the call.
|
|
251
310
|
* @param underlying The underlying debt asset to repay.
|
|
252
311
|
* @param amount The amount of debt to repay.
|
|
253
|
-
* @param
|
|
312
|
+
* @param onBehalf The address on behalf of which to repay.
|
|
254
313
|
*/
|
|
255
|
-
function aaveV3OptimizerRepay(underlying: Address, amount: bigint): BundlerCall;
|
|
314
|
+
function aaveV3OptimizerRepay(chainId: ChainId, underlying: Address, amount: bigint, onBehalf: Address): BundlerCall[];
|
|
256
315
|
/**
|
|
257
|
-
*
|
|
258
|
-
*
|
|
316
|
+
* Encodes a call to the Adapter to withdraw from Morpho's AaveV3Optimizer.
|
|
317
|
+
* @param chainId The chain id for which to encode the call.
|
|
259
318
|
* @param underlying The underlying asset to withdraw.
|
|
260
319
|
* @param amount The amount to withdraw.
|
|
261
320
|
* @param maxIterations The maximum amount of iterations to use for the withdrawal.
|
|
321
|
+
* @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
|
|
262
322
|
*/
|
|
263
|
-
function aaveV3OptimizerWithdraw(underlying: Address, amount: bigint, maxIterations: bigint): BundlerCall;
|
|
323
|
+
function aaveV3OptimizerWithdraw(chainId: ChainId, underlying: Address, amount: bigint, maxIterations: bigint, recipient?: Address): BundlerCall[];
|
|
264
324
|
/**
|
|
265
|
-
*
|
|
266
|
-
*
|
|
325
|
+
* Encodes a call to the Adapter to withdraw collateral from Morpho's AaveV3Optimizer.
|
|
326
|
+
* @param chainId The chain id for which to encode the call.
|
|
267
327
|
* @param underlying The underlying asset to withdraw.
|
|
268
328
|
* @param amount The amount to withdraw.
|
|
329
|
+
* @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
|
|
269
330
|
*/
|
|
270
|
-
function aaveV3OptimizerWithdrawCollateral(underlying: Address, amount: bigint): BundlerCall;
|
|
331
|
+
function aaveV3OptimizerWithdrawCollateral(chainId: ChainId, underlying: Address, amount: bigint, recipient?: Address): BundlerCall[];
|
|
271
332
|
/**
|
|
272
|
-
*
|
|
273
|
-
*
|
|
333
|
+
* Encodes a call to the Adapter to approve the Bundler as the sender's manager on Morpho's AaveV3Optimizer.
|
|
334
|
+
* @param chainId The chain id for which to encode the call.
|
|
335
|
+
* @param owner The owner of the AaveV3Optimizer position.
|
|
274
336
|
* @param isApproved Whether the manager is approved.
|
|
275
337
|
* @param nonce The nonce used to sign.
|
|
276
338
|
* @param deadline The timestamp until which the signature is valid.
|
|
277
339
|
* @param signature The Ethers signature to submit.
|
|
340
|
+
* @param manager The address of the manager to approve. Defaults to the chain's bundler3 AaveV3OptimizerMigrationAdapter.
|
|
278
341
|
* @param skipRevert Whether to allow the signature to revert without making the whole multicall revert.
|
|
279
342
|
*/
|
|
280
|
-
function aaveV3OptimizerApproveManagerWithSig(isApproved: boolean, nonce: bigint, deadline: bigint, signature: Hex, skipRevert
|
|
343
|
+
function aaveV3OptimizerApproveManagerWithSig(chainId: ChainId, owner: Address, isApproved: boolean, nonce: bigint, deadline: bigint, signature: Hex, manager?: Address, skipRevert?: boolean): BundlerCall[];
|
|
281
344
|
/**
|
|
282
|
-
*
|
|
283
|
-
*
|
|
345
|
+
* Encodes a call to the Adapter to repay a debt on CompoundV2.
|
|
346
|
+
* @param chainId The chain id for which to encode the call.
|
|
284
347
|
* @param cToken The cToken on which to repay the debt.
|
|
285
348
|
* @param amount The amount of debt to repay.
|
|
349
|
+
* @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
|
|
286
350
|
*/
|
|
287
|
-
function compoundV2Repay(cToken: Address, amount: bigint): BundlerCall;
|
|
351
|
+
function compoundV2Repay(chainId: ChainId, cToken: Address, amount: bigint, recipient?: Address): BundlerCall[];
|
|
288
352
|
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
353
|
+
* Encodes a call to the Adapter to withdraw collateral from CompoundV2.
|
|
354
|
+
* @param chainId The chain id for which to encode the call.
|
|
291
355
|
* @param cToken The cToken on which to withdraw.
|
|
292
356
|
* @param amount The amount to withdraw.
|
|
357
|
+
* @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
|
|
293
358
|
*/
|
|
294
|
-
function compoundV2Redeem(cToken: Address, amount: bigint): BundlerCall;
|
|
359
|
+
function compoundV2Redeem(chainId: ChainId, cToken: Address, amount: bigint, recipient?: Address): BundlerCall[];
|
|
295
360
|
/**
|
|
296
|
-
*
|
|
297
|
-
*
|
|
361
|
+
* Encodes a call to the Adapter to repay a debt on CompoundV3.
|
|
362
|
+
* @param chainId The chain id for which to encode the call.
|
|
298
363
|
* @param instance The CompoundV3 instance on which to repay the debt.
|
|
299
364
|
* @param amount The amount of debt to repay.
|
|
365
|
+
* @param onBehalf The address on behalf of which to repay.
|
|
300
366
|
*/
|
|
301
|
-
function compoundV3Repay(instance: Address, amount: bigint): BundlerCall;
|
|
367
|
+
function compoundV3Repay(chainId: ChainId, instance: Address, amount: bigint, onBehalf: Address): BundlerCall[];
|
|
302
368
|
/**
|
|
303
|
-
*
|
|
304
|
-
*
|
|
369
|
+
* Encodes a call to the Adapter to withdraw collateral from CompoundV3.
|
|
370
|
+
* @param chainId The chain id for which to encode the call.
|
|
305
371
|
* @param instance The CompoundV3 instance on which to withdraw.
|
|
372
|
+
* @param asset The asset to withdraw.
|
|
306
373
|
* @param amount The amount to withdraw.
|
|
374
|
+
* @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
|
|
307
375
|
*/
|
|
308
|
-
function compoundV3WithdrawFrom(instance: Address, asset: Address, amount: bigint): BundlerCall;
|
|
376
|
+
function compoundV3WithdrawFrom(chainId: ChainId, instance: Address, asset: Address, amount: bigint, recipient?: Address): BundlerCall[];
|
|
309
377
|
/**
|
|
310
|
-
*
|
|
311
|
-
*
|
|
378
|
+
* Encodes a call to the Adapter to allow the Bundler to act on the sender's position on CompoundV3.
|
|
379
|
+
* @param chainId The chain id for which to encode the call.
|
|
312
380
|
* @param instance The CompoundV3 instance on which to submit the signature.
|
|
381
|
+
* @param owner The owner of the CompoundV3 position.
|
|
313
382
|
* @param isAllowed Whether the manager is allowed.
|
|
314
383
|
* @param nonce The nonce used to sign.
|
|
315
384
|
* @param expiry The timestamp until which the signature is valid.
|
|
316
385
|
* @param signature The Ethers signature to submit.
|
|
386
|
+
* @param manager The address of the manager to approve. Defaults to the chain's bundler3 CompoundV3MigrationAdapter.
|
|
317
387
|
* @param skipRevert Whether to allow the signature to revert without making the whole multicall revert.
|
|
318
388
|
*/
|
|
319
|
-
function compoundV3AllowBySig(instance: Address, isAllowed: boolean, nonce: bigint, expiry: bigint, signature: Hex, skipRevert
|
|
389
|
+
function compoundV3AllowBySig(chainId: ChainId, instance: Address, owner: Address, isAllowed: boolean, nonce: bigint, expiry: bigint, signature: Hex, manager?: Address, skipRevert?: boolean): BundlerCall[];
|
|
320
390
|
}
|
|
321
391
|
export default BundlerAction;
|