@morpho-org/bundler-sdk-viem 4.2.0 → 4.3.0

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.
Files changed (48) hide show
  1. package/lib/cjs/package.json +1 -0
  2. package/lib/esm/ActionBundle.d.ts +37 -0
  3. package/lib/esm/ActionBundle.js +35 -0
  4. package/lib/esm/BundlerAction.d.ts +470 -0
  5. package/lib/esm/BundlerAction.js +1657 -0
  6. package/lib/esm/abis.d.ts +3014 -0
  7. package/lib/esm/abis.js +2047 -0
  8. package/lib/esm/actions.d.ts +10 -0
  9. package/lib/esm/actions.js +793 -0
  10. package/lib/esm/bundle.d.ts +12 -0
  11. package/lib/esm/bundle.js +11 -0
  12. package/lib/esm/errors.d.ts +30 -0
  13. package/lib/esm/errors.js +54 -0
  14. package/lib/esm/index.d.ts +8 -0
  15. package/lib/esm/index.js +8 -0
  16. package/lib/esm/operations.d.ts +78 -0
  17. package/lib/esm/operations.js +800 -0
  18. package/lib/esm/package.json +1 -0
  19. package/lib/esm/types/actions.d.ts +355 -0
  20. package/lib/esm/types/actions.js +1 -0
  21. package/lib/esm/types/index.d.ts +2 -0
  22. package/lib/esm/types/index.js +2 -0
  23. package/lib/esm/types/operations.d.ts +86 -0
  24. package/lib/esm/types/operations.js +55 -0
  25. package/package.json +25 -16
  26. package/src/index.ts +8 -0
  27. /package/lib/{ActionBundle.d.ts → cjs/ActionBundle.d.ts} +0 -0
  28. /package/lib/{ActionBundle.js → cjs/ActionBundle.js} +0 -0
  29. /package/lib/{BundlerAction.d.ts → cjs/BundlerAction.d.ts} +0 -0
  30. /package/lib/{BundlerAction.js → cjs/BundlerAction.js} +0 -0
  31. /package/lib/{abis.d.ts → cjs/abis.d.ts} +0 -0
  32. /package/lib/{abis.js → cjs/abis.js} +0 -0
  33. /package/lib/{actions.d.ts → cjs/actions.d.ts} +0 -0
  34. /package/lib/{actions.js → cjs/actions.js} +0 -0
  35. /package/lib/{bundle.d.ts → cjs/bundle.d.ts} +0 -0
  36. /package/lib/{bundle.js → cjs/bundle.js} +0 -0
  37. /package/lib/{errors.d.ts → cjs/errors.d.ts} +0 -0
  38. /package/lib/{errors.js → cjs/errors.js} +0 -0
  39. /package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
  40. /package/lib/{index.js → cjs/index.js} +0 -0
  41. /package/lib/{operations.d.ts → cjs/operations.d.ts} +0 -0
  42. /package/lib/{operations.js → cjs/operations.js} +0 -0
  43. /package/lib/{types → cjs/types}/actions.d.ts +0 -0
  44. /package/lib/{types → cjs/types}/actions.js +0 -0
  45. /package/lib/{types → cjs/types}/index.d.ts +0 -0
  46. /package/lib/{types → cjs/types}/index.js +0 -0
  47. /package/lib/{types → cjs/types}/operations.d.ts +0 -0
  48. /package/lib/{types → cjs/types}/operations.js +0 -0
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,37 @@
1
+ import type { SimulationResult } from "@morpho-org/simulation-sdk";
2
+ import type { Account, Address, Chain, Client, Hex, Transport } from "viem";
3
+ import type { Action, SignatureRequirement, TransactionRequirement } from "./types/index.js";
4
+ export declare class ActionBundleRequirements<TR extends {
5
+ tx: {
6
+ to: Address;
7
+ data: Hex;
8
+ };
9
+ } = TransactionRequirement, SR extends SignatureRequirement = SignatureRequirement> {
10
+ readonly txs: TR[];
11
+ readonly signatures: SR[];
12
+ constructor(txs?: TR[], signatures?: SR[]);
13
+ sign(client: Client<Transport, Chain | undefined, Account>): Promise<Hex[]>;
14
+ sign(client: Client, account: Account): Promise<Hex[]>;
15
+ }
16
+ export declare class ActionBundle<TR extends {
17
+ tx: {
18
+ to: Address;
19
+ data: Hex;
20
+ };
21
+ } = TransactionRequirement, SR extends SignatureRequirement = SignatureRequirement> {
22
+ readonly actions: Action[];
23
+ readonly requirements: ActionBundleRequirements<TR, SR>;
24
+ readonly steps?: SimulationResult;
25
+ readonly chainId: number;
26
+ constructor(steps: SimulationResult, actions?: Action[], requirements?: ActionBundleRequirements<TR, SR>);
27
+ constructor(chainId: number, actions?: Action[], requirements?: ActionBundleRequirements<TR, SR>);
28
+ tx(): {
29
+ to: `0x${string}`;
30
+ value: bigint;
31
+ data: `0x${string}`;
32
+ };
33
+ txs(): {
34
+ to: Address;
35
+ data: Hex;
36
+ }[];
37
+ }
@@ -0,0 +1,35 @@
1
+ import { BundlerAction } from "./BundlerAction.js";
2
+ export class ActionBundleRequirements {
3
+ txs;
4
+ signatures;
5
+ constructor(txs = [], signatures = []) {
6
+ this.txs = txs;
7
+ this.signatures = signatures;
8
+ }
9
+ sign(client, account = client.account) {
10
+ return Promise.all(this.signatures.map((requirement) => requirement.sign(client, account)));
11
+ }
12
+ }
13
+ export class ActionBundle {
14
+ actions;
15
+ requirements;
16
+ steps;
17
+ chainId;
18
+ constructor(stepsOrChainId, actions = [], requirements = new ActionBundleRequirements()) {
19
+ this.actions = actions;
20
+ this.requirements = requirements;
21
+ if (typeof stepsOrChainId === "number") {
22
+ this.chainId = stepsOrChainId;
23
+ }
24
+ else {
25
+ this.steps = stepsOrChainId;
26
+ this.chainId = stepsOrChainId[0].chainId;
27
+ }
28
+ }
29
+ tx() {
30
+ return BundlerAction.encodeBundle(this.chainId, this.actions);
31
+ }
32
+ txs() {
33
+ return this.requirements.txs.map(({ tx }) => tx).concat([this.tx()]);
34
+ }
35
+ }
@@ -0,0 +1,470 @@
1
+ import { ChainId, type InputMarketParams } from "@morpho-org/blue-sdk";
2
+ import type { ParaswapOffsets } from "@morpho-org/simulation-sdk";
3
+ import { type Address, type Hex } from "viem";
4
+ import type { Action, Authorization, InputReallocation, Permit2PermitSingle } from "./types/index.js";
5
+ export interface BundlerCall {
6
+ to: Address;
7
+ data: Hex;
8
+ value: bigint;
9
+ skipRevert: boolean;
10
+ callbackHash: Hex;
11
+ }
12
+ /**
13
+ * Namespace to easily encode calls to the Bundler contract, using viem.
14
+ */
15
+ export declare namespace BundlerAction {
16
+ function encodeBundle(chainId: ChainId, actions: Action[]): {
17
+ to: `0x${string}`;
18
+ value: bigint;
19
+ data: `0x${string}`;
20
+ };
21
+ function encode(chainId: ChainId, { type, args }: Action): BundlerCall[];
22
+ /**
23
+ * Encodes a call to the GeneralAdapter1 to transfer native tokens (ETH on ethereum, MATIC on polygon, etc).
24
+ * @param chainId The chain id for which to encode the call.
25
+ * @param owner The owner of native tokens.
26
+ * @param recipient The address to send native tokens to.
27
+ * @param amount The amount of native tokens to send (in wei).
28
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
29
+ */
30
+ function nativeTransfer(chainId: ChainId, owner: Address, recipient: Address, amount: bigint, skipRevert?: boolean): BundlerCall[];
31
+ /**
32
+ * Encodes a call to the requested adapter to transfer ERC20 tokens.
33
+ * @param chainId The chain id for which to encode the call.
34
+ * @param asset The address of the ERC20 token to transfer.
35
+ * @param recipient The address to send tokens to.
36
+ * @param amount The amount of tokens to send.
37
+ * @param adapter The address of the adapter to use.
38
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
39
+ */
40
+ function erc20Transfer(asset: Address, recipient: Address, amount: bigint, adapter: Address, skipRevert?: boolean): BundlerCall[];
41
+ /**
42
+ * Encodes a call to the GeneralAdapter1 to transfer ERC20 tokens with `transferFrom`.
43
+ * @param chainId The chain id for which to encode the call.
44
+ * @param asset The address of the ERC20 token to transfer.
45
+ * @param amount The amount of tokens to send.
46
+ * @param recipient The recipient of ERC20 tokens.
47
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
48
+ */
49
+ function erc20TransferFrom(chainId: ChainId, asset: Address, amount: bigint, recipient: Address, skipRevert?: boolean): BundlerCall[];
50
+ /**
51
+ * Encodes a call to the GeneralAdapter1 to permit an ERC20 token.
52
+ * @param chainId The chain id for which to encode the call.
53
+ * @param owner The address which owns the tokens.
54
+ * @param asset The address of the ERC20 token to permit.
55
+ * @param amount The amount of tokens to permit.
56
+ * @param deadline The timestamp until which the signature is valid.
57
+ * @param signature The Ethers signature to permit the tokens.
58
+ * @param skipRevert Whether to allow the permit to revert without making the whole bundle revert. Defaults to true.
59
+ */
60
+ function permit(chainId: ChainId, owner: Address, asset: Address, amount: bigint, deadline: bigint, signature: Hex, skipRevert?: boolean): BundlerCall[];
61
+ /**
62
+ * Encodes a call to the GeneralAdapter1 to permit DAI.
63
+ * @param chainId The chain id for which to encode the call.
64
+ * @param owner The address which owns the tokens.
65
+ * @param nonce The permit nonce used.
66
+ * @param expiry The timestamp until which the signature is valid.
67
+ * @param allowed The amount of DAI to permit.
68
+ * @param signature The Ethers signature to permit the tokens.
69
+ * @param skipRevert Whether to allow the permit to revert without making the whole bundle revert.
70
+ */
71
+ function permitDai(chainId: ChainId, owner: Address, nonce: bigint, expiry: bigint, allowed: boolean, signature: Hex, skipRevert?: boolean): BundlerCall[];
72
+ /**
73
+ * Encodes a call to permit the chain's GeneralAdapter1 ERC20 tokens via Permit2.
74
+ * @param chainId The chain id for which to encode the call.
75
+ * @param owner The owner of ERC20 tokens.
76
+ * @param permitSingle The permit details to submit to Permit2.
77
+ * @param signature The Ethers signature to permit the tokens.
78
+ * @param skipRevert Whether to allow the permit to revert without making the whole bundle revert. Defaults to true.
79
+ */
80
+ function approve2(chainId: ChainId, owner: Address, permitSingle: Permit2PermitSingle, signature: Hex, skipRevert?: boolean): BundlerCall[];
81
+ /**
82
+ * Encodes a call to the GeneralAdapter1 to transfer ERC20 tokens via Permit2.
83
+ * @param chainId The chain id for which to encode the call.
84
+ * @param asset The address of the ERC20 token to transfer.
85
+ * @param owner The owner of ERC20 tokens.
86
+ * @param amount The amount of tokens to send.
87
+ * @param recipient The recipient of ERC20 tokens.
88
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
89
+ */
90
+ function transferFrom2(chainId: ChainId, asset: Address, amount: bigint, recipient: Address, skipRevert?: boolean): BundlerCall[];
91
+ /**
92
+ * Encodes a call to the GeneralAdapter1 to wrap legacy MORPHO tokens.
93
+ * @param chainId The chain id for which to encode the call.
94
+ * @param recipient The recipient of MORPHO tokens.
95
+ * @param amount The amount of tokens to wrap.
96
+ * @param skipRevert Whether to allow the wrap to revert without making the whole bundler revert. Defaults to false.
97
+ */
98
+ function morphoWrapperDepositFor(chainId: ChainId, recipient: Address, amount: bigint, skipRevert?: boolean): BundlerCall[];
99
+ /**
100
+ * Encodes a call to the GeneralAdapter1 to wrap ERC20 tokens via the provided ERC20Wrapper.
101
+ * @param chainId The chain id for which to encode the call.
102
+ * @param wrapper The address of the ERC20 wrapper token.
103
+ * @param underlying The address of the underlying ERC20 token.
104
+ * @param amount The amount of tokens to send.
105
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
106
+ */
107
+ function erc20WrapperDepositFor(chainId: ChainId, wrapper: Address, underlying: Address, amount: bigint, skipRevert?: boolean): BundlerCall[];
108
+ /**
109
+ * Encodes a call to the GeneralAdapter1 to unwrap ERC20 tokens from the provided ERC20Wrapper.
110
+ * @param chainId The chain id for which to encode the call.
111
+ * @param wrapper The address of the ERC20 wrapper token.
112
+ * @param account The address to send the underlying ERC20 tokens.
113
+ * @param amount The amount of tokens to send.
114
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
115
+ */
116
+ function erc20WrapperWithdrawTo(chainId: ChainId, wrapper: Address, receiver: Address, amount: bigint, skipRevert?: boolean): BundlerCall[];
117
+ /**
118
+ * Encodes a call to the GeneralAdapter1 to mint shares of the provided ERC4626 vault.
119
+ * @param chainId The chain id for which to encode the call.
120
+ * @param erc4626 The address of the ERC4626 vault.
121
+ * @param shares The amount of shares to mint.
122
+ * @param maxSharePrice The maximum amount of assets to pay to get 1 share (scaled by RAY).
123
+ * @param receiver The address to send the shares to.
124
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
125
+ */
126
+ function erc4626Mint(chainId: ChainId, erc4626: Address, shares: bigint, maxSharePrice: bigint, receiver: Address, skipRevert?: boolean): BundlerCall[];
127
+ /**
128
+ * Encodes a call to the GeneralAdapter1 to deposit assets into the provided ERC4626 vault.
129
+ * @param chainId The chain id for which to encode the call.
130
+ * @param erc4626 The address of the ERC4626 vault.
131
+ * @param assets The amount of assets to deposit.
132
+ * @param maxSharePrice The maximum amount of assets to pay to get 1 share (scaled by RAY).
133
+ * @param receiver The address to send the shares to.
134
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
135
+ */
136
+ function erc4626Deposit(chainId: ChainId, erc4626: Address, assets: bigint, maxSharePrice: bigint, receiver: Address, skipRevert?: boolean): BundlerCall[];
137
+ /**
138
+ * Encodes a call to the GeneralAdapter1 to withdraw assets from the provided ERC4626 vault.
139
+ * @param chainId The chain id for which to encode the call.
140
+ * @param erc4626 The address of the ERC4626 vault.
141
+ * @param assets The amount of assets to withdraw.
142
+ * @param minSharePrice The minimum number of assets to receive per share (scaled by RAY).
143
+ * @param receiver The address to send the assets to.
144
+ * @param owner The address on behalf of which the assets are withdrawn.
145
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
146
+ */
147
+ function erc4626Withdraw(chainId: ChainId, erc4626: Address, assets: bigint, minSharePrice: bigint, receiver: Address, owner: Address, skipRevert?: boolean): BundlerCall[];
148
+ /**
149
+ * Encodes a call to the GeneralAdapter1 to redeem shares from the provided ERC4626 vault.
150
+ * @param chainId The chain id for which to encode the call.
151
+ * @param erc4626 The address of the ERC4626 vault.
152
+ * @param shares The amount of shares to redeem.
153
+ * @param minSharePrice The minimum number of assets to receive per share (scaled by RAY).
154
+ * @param receiver The address to send the assets to.
155
+ * @param owner The address on behalf of which the assets are withdrawn.
156
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
157
+ */
158
+ function erc4626Redeem(chainId: ChainId, erc4626: Address, shares: bigint, minSharePrice: bigint, receiver: Address, owner: Address, skipRevert?: boolean): BundlerCall[];
159
+ /**
160
+ * Encodes a call to authorize an account on Morpho Blue.
161
+ * @param chainId The chain id for which to encode the call.
162
+ * @param authorization The authorization details to submit to Morpho Blue.
163
+ * @param signature The Ethers signature to authorize the account.
164
+ * @param skipRevert Whether to allow the authorization call to revert without making the whole bundle revert. Defaults to true.
165
+ */
166
+ function morphoSetAuthorizationWithSig(chainId: ChainId, authorization: Authorization, signature: Hex, skipRevert?: boolean): BundlerCall[];
167
+ /**
168
+ * Encodes a call to the GeneralAdapter1 to supply to a Morpho Blue market.
169
+ * @param chainId The chain id for which to encode the call.
170
+ * @param market The market params to supply to.
171
+ * @param assets The amount of assets to supply.
172
+ * @param shares The amount of supply shares to mint.
173
+ * @param slippageAmount The maximum (resp. minimum) amount of assets (resp. supply shares) to supply (resp. mint) (protects the sender from unexpected slippage).
174
+ * @param onBehalf The address to supply on behalf of.
175
+ * @param callbackCalls The array of calls to execute inside Morpho Blue's `onMorphoSupply` callback.
176
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
177
+ */
178
+ function morphoSupply(chainId: ChainId, market: InputMarketParams, assets: bigint, shares: bigint, slippageAmount: bigint, onBehalf: Address, callbackCalls: BundlerCall[], skipRevert?: boolean): BundlerCall[];
179
+ /**
180
+ * Encodes a call to the GeneralAdapter1 to supply collateral to a Morpho Blue market.
181
+ * @param chainId The chain id for which to encode the call.
182
+ * @param market The market params to supply to.
183
+ * @param assets The amount of assets to supply.
184
+ * @param onBehalf The address to supply on behalf of.
185
+ * @param callbackCalls The array of calls to execute inside Morpho Blue's `onMorphoSupplyCollateral` callback.
186
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
187
+ */
188
+ function morphoSupplyCollateral(chainId: ChainId, market: InputMarketParams, assets: bigint, onBehalf: Address, callbackCalls: BundlerCall[], skipRevert?: boolean): BundlerCall[];
189
+ /**
190
+ * Encodes a call to the GeneralAdapter1 to borrow from a Morpho Blue market.
191
+ * @param chainId The chain id for which to encode the call.
192
+ * @param market The market params to borrow from.
193
+ * @param assets The amount of assets to borrow.
194
+ * @param shares The amount of borrow shares to mint.
195
+ * @param slippageAmount The minimum (resp. maximum) amount of assets (resp. borrow shares) to borrow (resp. mint) (protects the sender from unexpected slippage).
196
+ * @param receiver The address to send borrowed tokens to.
197
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
198
+ */
199
+ function morphoBorrow(chainId: ChainId, market: InputMarketParams, assets: bigint, shares: bigint, slippageAmount: bigint, receiver: Address, skipRevert?: boolean): BundlerCall[];
200
+ /**
201
+ * Encodes a call to the GeneralAdapter1 to repay to a Morpho Blue market.
202
+ * @param chainId The chain id for which to encode the call.
203
+ * @param market The market params to repay to.
204
+ * @param assets The amount of assets to repay.
205
+ * @param shares The amount of borrow shares to redeem.
206
+ * @param slippageAmount The maximum (resp. minimum) amount of assets (resp. borrow shares) to repay (resp. redeem) (protects the sender from unexpected slippage).
207
+ * @param onBehalf The address to repay on behalf of.
208
+ * @param callbackCalls The array of calls to execute inside Morpho Blue's `onMorphoSupply` callback.
209
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
210
+ */
211
+ function morphoRepay(chainId: ChainId, market: InputMarketParams, assets: bigint, shares: bigint, slippageAmount: bigint, onBehalf: Address, callbackCalls: BundlerCall[], skipRevert?: boolean): BundlerCall[];
212
+ /**
213
+ * Encodes a call to the GeneralAdapter1 to withdraw from a Morpho Blue market.
214
+ * @param chainId The chain id for which to encode the call.
215
+ * @param market The market params to withdraw from.
216
+ * @param assets The amount of assets to withdraw.
217
+ * @param shares The amount of supply shares to redeem.
218
+ * @param slippageAmount The minimum (resp. maximum) amount of assets (resp. supply shares) to withdraw (resp. redeem) (protects the sender from unexpected slippage).
219
+ * @param receiver The address to send withdrawn tokens to.
220
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
221
+ */
222
+ function morphoWithdraw(chainId: ChainId, market: InputMarketParams, assets: bigint, shares: bigint, slippageAmount: bigint, receiver: Address, skipRevert?: boolean): BundlerCall[];
223
+ /**
224
+ * Encodes a call to the GeneralAdapter1 to withdraw collateral from a Morpho Blue market.
225
+ * @param chainId The chain id for which to encode the call.
226
+ * @param market The market params to withdraw from.
227
+ * @param assets The amount of assets to withdraw.
228
+ * @param receiver The address to send withdrawn tokens to.
229
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
230
+ */
231
+ function morphoWithdrawCollateral(chainId: ChainId, market: InputMarketParams, assets: bigint, receiver: Address, skipRevert?: boolean): BundlerCall[];
232
+ /**
233
+ * Encodes a call to the GeneralAdapter1 to flash loan from Morpho Blue.
234
+ * @param chainId The chain id for which to encode the call.
235
+ * @param token The address of the ERC20 token to flash loan.
236
+ * @param assets The amount of tokens to flash loan.
237
+ * @param callbackCalls The array of calls to execute inside Morpho Blue's `onMorphoFlashLoan` callback.
238
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
239
+ */
240
+ function morphoFlashLoan(chainId: ChainId, token: Address, assets: bigint, callbackCalls: BundlerCall[], skipRevert?: boolean): BundlerCall[];
241
+ /**
242
+ * Encodes a call to trigger a public reallocation on the PublicAllocator.
243
+ * @param chainId The chain id for which to encode the call.
244
+ * @param vault The vault to reallocate.
245
+ * @param fee The vault public reallocation fee.
246
+ * @param withdrawals The array of withdrawals to perform, before supplying everything to the supply market.
247
+ * @param supplyMarketParams The market params to reallocate to.
248
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
249
+ */
250
+ function publicAllocatorReallocateTo(chainId: ChainId, vault: Address, fee: bigint, withdrawals: InputReallocation[], supplyMarketParams: InputMarketParams, skipRevert?: boolean): BundlerCall[];
251
+ /**
252
+ * Encodes a call to the ParaswapAdapter to buy an exact amount of tokens via Paraswap.
253
+ * @param chainId The chain id for which to encode the call.
254
+ * @param augustus The address of the Augustus router to use.
255
+ * @param callData The encoded call data to execute.
256
+ * @param srcToken The address of the source token.
257
+ * @param dstToken The address of the destination token.
258
+ * @param offsets The offsets in callData of the exact buy amount (`exactAmount`), maximum sell amount (`limitAmount`) and quoted sell amount (`quotedAmount`).
259
+ * @param receiver The address to send the tokens to.
260
+ * @param skipRevert Whether to allow the swap to revert without making the whole bundle revert. Defaults to false.
261
+ */
262
+ function paraswapBuy(chainId: ChainId, augustus: Address, callData: Hex, srcToken: Address, dstToken: Address, offsets: ParaswapOffsets, receiver: Address, skipRevert?: boolean): BundlerCall[];
263
+ /**
264
+ * Encodes a call to the ParaswapAdapter to sell an exact amount of tokens via Paraswap.
265
+ * @param chainId The chain id for which to encode the call.
266
+ * @param augustus The address of the Augustus router to use.
267
+ * @param callData The encoded call data to execute.
268
+ * @param srcToken The address of the source token.
269
+ * @param dstToken The address of the destination token.
270
+ * @param sellEntireBalance Whether to sell the entire balance of the source token.
271
+ * @param offsets The offsets in callData of the exact sell amount (`exactAmount`), minimum buy amount (`limitAmount`) and quoted buy amount (`quotedAmount`).
272
+ * @param receiver The address to send the tokens to.
273
+ * @param skipRevert Whether to allow the swap to revert without making the whole bundle revert. Defaults to false.
274
+ */
275
+ function paraswapSell(chainId: ChainId, augustus: Address, callData: Hex, srcToken: Address, dstToken: Address, sellEntireBalance: boolean, offsets: ParaswapOffsets, receiver: Address, skipRevert?: boolean): BundlerCall[];
276
+ /**
277
+ * Encodes a call to the ParaswapAdapter to buy the exact debt of a position via Paraswap.
278
+ * @param chainId The chain id for which to encode the call.
279
+ * @param augustus The address of the Augustus router to use.
280
+ * @param callData The encoded call data to execute.
281
+ * @param srcToken The address of the source token.
282
+ * @param marketParams The market params of the market with the debt assets to buy.
283
+ * @param offsets The offsets in callData of the exact buy amount (`exactAmount`), maximum sell amount (`limitAmount`) and quoted sell amount (`quotedAmount`).
284
+ * @param onBehalf The address to buy the debt on behalf of.
285
+ * @param receiver The address to send the tokens to.
286
+ * @param skipRevert Whether to allow the swap to revert without making the whole bundle revert. Defaults to false.
287
+ */
288
+ function paraswapBuyMorphoDebt(chainId: ChainId, augustus: Address, callData: Hex, srcToken: Address, marketParams: InputMarketParams, offsets: ParaswapOffsets, onBehalf: Address, receiver: Address, skipRevert?: boolean): BundlerCall[];
289
+ /**
290
+ * Encodes a call to the Universal Rewards Distributor to claim rewards.
291
+ * @param chainId The chain id for which to encode the call.
292
+ * @param distributor The address of the distributor to claim rewards from.
293
+ * @param account The address to claim rewards for.
294
+ * @param reward The address of the reward token to claim.
295
+ * @param amount The amount of rewards to claim.
296
+ * @param proof The Merkle proof to claim the rewards.
297
+ * @param skipRevert Whether to allow the claim to revert without making the whole bundle revert. Defaults to true.
298
+ */
299
+ function urdClaim(distributor: Address, account: Address, reward: Address, amount: bigint, proof: Hex[], skipRevert?: boolean): BundlerCall[];
300
+ /**
301
+ * Encodes a call to the GeneralAdapter1 to wrap native tokens (ETH to WETH on ethereum, MATIC to WMATIC on polygon, etc).
302
+ * @param chainId The chain id for which to encode the call.
303
+ * @param amount The amount of native tokens to wrap (in wei).
304
+ * @param recipient The address to send tokens to.
305
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
306
+ */
307
+ function wrapNative(chainId: ChainId, amount: bigint, recipient: Address, skipRevert?: boolean): BundlerCall[];
308
+ /**
309
+ * Encodes a call to the GeneralAdapter1 to unwrap native tokens (WETH to ETH on ethereum, WMATIC to MATIC on polygon, etc).
310
+ * @param chainId The chain id for which to encode the call.
311
+ * @param amount The amount of native tokens to unwrap (in wei).
312
+ * @param recipient The address to send tokens to.
313
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
314
+ */
315
+ function unwrapNative(chainId: ChainId, amount: bigint, recipient: Address, skipRevert?: boolean): BundlerCall[];
316
+ /**
317
+ * Encodes a call to the GeneralAdapter1 to stake native tokens using Lido (ETH to stETH on ethereum).
318
+ * @param chainId The chain id for which to encode the call.
319
+ * @param amount The amount of native tokens to stake (in wei).
320
+ * @param maxSharePrice The maximum amount of wei to pay for minting 1 share (scaled by RAY).
321
+ * @param referral The referral address to use.
322
+ * @param recipient The address to send stETH to.
323
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
324
+ */
325
+ function stakeEth(chainId: ChainId, amount: bigint, maxSharePrice: bigint, referral: Address, recipient: Address, skipRevert?: boolean): BundlerCall[];
326
+ /**
327
+ * Encodes a call to the GeneralAdapter1 to wrap stETH (stETH to wstETH on ethereum).
328
+ * @param chainId The chain id for which to encode the call.
329
+ * @param amount The amount of stETH to wrap (in wei).
330
+ * @param recipient The address to send wstETH to.
331
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
332
+ */
333
+ function wrapStEth(chainId: ChainId, amount: bigint, recipient: Address, skipRevert?: boolean): BundlerCall[];
334
+ /**
335
+ * Encodes a call to the GeneralAdapter1 to unwrap wstETH (wstETH to stETH on ethereum).
336
+ * @param chainId The chain id for which to encode the call.
337
+ * @param amount The amount of wstETH to unwrap (in wei).
338
+ * @param recipient The address to send stETH to.
339
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
340
+ */
341
+ function unwrapStEth(chainId: ChainId, amount: bigint, recipient: Address, skipRevert?: boolean): BundlerCall[];
342
+ /**
343
+ * Encodes a call to the AaveV2MigrationAdapter to repay a debt on AaveV2.
344
+ * @param chainId The chain id for which to encode the call.
345
+ * @param asset The debt asset to repay.
346
+ * @param amount The amount of debt to repay.
347
+ * @param onBehalf The address on behalf of which to repay.
348
+ * @param rateMode The interest rate mode used by the debt to repay.
349
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
350
+ */
351
+ function aaveV2Repay(chainId: ChainId, asset: Address, amount: bigint, onBehalf: Address, rateMode?: bigint, skipRevert?: boolean): BundlerCall[];
352
+ /**
353
+ * Encodes a call to the AaveV2MigrationAdapter to withdraw from AaveV2.
354
+ * @param chainId The chain id for which to encode the call.
355
+ * @param asset The asset to withdraw.
356
+ * @param amount The amount of asset to withdraw.
357
+ * @param recipient The recipient of ERC20 tokens.
358
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
359
+ */
360
+ function aaveV2Withdraw(chainId: ChainId, asset: Address, amount: bigint, recipient: Address, skipRevert?: boolean): BundlerCall[];
361
+ /**
362
+ * Encodes a call to the AaveV3CoreMigrationAdapter to repay a debt on AaveV3.
363
+ * @param chainId The chain id for which to encode the call.
364
+ * @param asset The debt asset to repay.
365
+ * @param amount The amount of debt to repay.
366
+ * @param onBehalf The address on behalf of which to repay.
367
+ * @param rateMode The interest rate mode used by the debt to repay.
368
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
369
+ */
370
+ function aaveV3Repay(chainId: ChainId, asset: Address, amount: bigint, onBehalf: Address, rateMode?: bigint, skipRevert?: boolean): BundlerCall[];
371
+ /**
372
+ * Encodes a call to the AaveV3CoreMigrationAdapter to withdrawn from AaveV3.
373
+ * @param chainId The chain id for which to encode the call.
374
+ * @param asset The asset to withdraw.
375
+ * @param amount The amount of asset to withdraw.
376
+ * @param recipient The recipient of ERC20 tokens.
377
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
378
+ */
379
+ function aaveV3Withdraw(chainId: ChainId, asset: Address, amount: bigint, recipient: Address, skipRevert?: boolean): BundlerCall[];
380
+ /**
381
+ * Encodes a call to the AaveV3OptimizerMigrationAdapter to repay a debt on Morpho's AaveV3Optimizer.
382
+ * @param chainId The chain id for which to encode the call.
383
+ * @param underlying The underlying debt asset to repay.
384
+ * @param amount The amount of debt to repay.
385
+ * @param onBehalf The address on behalf of which to repay.
386
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
387
+ */
388
+ function aaveV3OptimizerRepay(chainId: ChainId, underlying: Address, amount: bigint, onBehalf: Address, skipRevert?: boolean): BundlerCall[];
389
+ /**
390
+ * Encodes a call to the AaveV3OptimizerMigrationAdapter to withdraw from Morpho's AaveV3Optimizer.
391
+ * @param chainId The chain id for which to encode the call.
392
+ * @param underlying The underlying asset to withdraw.
393
+ * @param amount The amount to withdraw.
394
+ * @param maxIterations The maximum amount of iterations to use for the withdrawal.
395
+ * @param recipient The recipient of ERC20 tokens.
396
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
397
+ */
398
+ function aaveV3OptimizerWithdraw(chainId: ChainId, underlying: Address, amount: bigint, maxIterations: bigint, recipient: Address, skipRevert?: boolean): BundlerCall[];
399
+ /**
400
+ * Encodes a call to the AaveV3OptimizerMigrationAdapter to withdraw collateral from Morpho's AaveV3Optimizer.
401
+ * @param chainId The chain id for which to encode the call.
402
+ * @param underlying The underlying asset to withdraw.
403
+ * @param amount The amount to withdraw.
404
+ * @param recipient The recipient of ERC20 tokens.
405
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
406
+ */
407
+ function aaveV3OptimizerWithdrawCollateral(chainId: ChainId, underlying: Address, amount: bigint, recipient: Address, skipRevert?: boolean): BundlerCall[];
408
+ /**
409
+ * Encodes a call to the AaveV3 optimizer to approve the chain's AaveV3OptimizerMigrationAdapter.
410
+ * as the sender's manager on Morpho's AaveV3Optimizer.
411
+ * @param chainId The chain id for which to encode the call.
412
+ * @param owner The owner of the AaveV3Optimizer position.
413
+ * @param isApproved Whether the manager is approved.
414
+ * @param nonce The nonce used to sign.
415
+ * @param deadline The timestamp until which the signature is valid.
416
+ * @param signature The Ethers signature to submit.
417
+ * @param skipRevert Whether to allow the signature to revert without making the whole bundle revert. Defaults to true.
418
+ */
419
+ function aaveV3OptimizerApproveManagerWithSig(chainId: ChainId, aaveV3Optimizer: Address, owner: Address, isApproved: boolean, nonce: bigint, deadline: bigint, signature: Hex, skipRevert?: boolean): BundlerCall[];
420
+ /**
421
+ * Encodes a call to the CompoundV2MigrationAdapter to repay a debt on CompoundV2.
422
+ * @param chainId The chain id for which to encode the call.
423
+ * @param cToken The cToken on which to repay the debt.
424
+ * @param amount The amount of debt to repay.
425
+ * @param onBehalf The account on behalf of which to repay.
426
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
427
+ */
428
+ function compoundV2Repay(chainId: ChainId, cToken: Address, amount: bigint, isEth: boolean, onBehalf: Address, skipRevert?: boolean): BundlerCall[];
429
+ /**
430
+ * Encodes a call to the CompoundV2MigrationAdapter to withdraw collateral from CompoundV2.
431
+ * @param chainId The chain id for which to encode the call.
432
+ * @param cToken The cToken on which to withdraw.
433
+ * @param amount The amount to withdraw.
434
+ * @param recipient The recipient of ERC20 tokens.
435
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
436
+ */
437
+ function compoundV2Redeem(chainId: ChainId, cToken: Address, amount: bigint, isEth: boolean, recipient: Address, skipRevert?: boolean): BundlerCall[];
438
+ /**
439
+ * Encodes a call to the CompoundV3MigrationAdapter to repay a debt on CompoundV3.
440
+ * @param chainId The chain id for which to encode the call.
441
+ * @param instance The CompoundV3 instance on which to repay the debt.
442
+ * @param amount The amount of debt to repay.
443
+ * @param onBehalf The address on behalf of which to repay.
444
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
445
+ */
446
+ function compoundV3Repay(chainId: ChainId, instance: Address, amount: bigint, onBehalf: Address, skipRevert?: boolean): BundlerCall[];
447
+ /**
448
+ * Encodes a call to the CompoundV3MigrationAdapter to withdraw collateral from CompoundV3.
449
+ * @param chainId The chain id for which to encode the call.
450
+ * @param instance The CompoundV3 instance on which to withdraw.
451
+ * @param asset The asset to withdraw.
452
+ * @param amount The amount to withdraw.
453
+ * @param recipient The recipient of ERC20 tokens.
454
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
455
+ */
456
+ function compoundV3WithdrawFrom(chainId: ChainId, instance: Address, asset: Address, amount: bigint, recipient: Address, skipRevert?: boolean): BundlerCall[];
457
+ /**
458
+ * Encodes a call to the CompoundV3 instance to allow the chain's CompoundV3MigrationAdapter.
459
+ * to act on the sender's position on CompoundV3.
460
+ * @param chainId The chain id for which to encode the call.
461
+ * @param instance The CompoundV3 instance on which to submit the signature.
462
+ * @param owner The owner of the CompoundV3 position.
463
+ * @param isAllowed Whether the manager is allowed.
464
+ * @param nonce The nonce used to sign.
465
+ * @param expiry The timestamp until which the signature is valid.
466
+ * @param signature The Ethers signature to submit.
467
+ * @param skipRevert Whether to allow the signature to revert without making the whole bundle revert. Defaults to true.
468
+ */
469
+ function compoundV3AllowBySig(chainId: ChainId, instance: Address, owner: Address, isAllowed: boolean, nonce: bigint, expiry: bigint, signature: Hex, skipRevert?: boolean): BundlerCall[];
470
+ }