@paxoslabs/amplify-sdk 0.5.1 → 0.5.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/CHANGELOG.md +7 -45
- package/README.md +22 -22
- package/dist/{chain-utils-D_b2LEEi.d.mts → chain-utils-5r2UnCDS.d.mts} +57 -1
- package/dist/{chain-utils-D_b2LEEi.d.ts → chain-utils-5r2UnCDS.d.ts} +57 -1
- package/dist/{chunk-L5XT67QZ.js → chunk-4NQPS3JC.js} +813 -147
- package/dist/chunk-4NQPS3JC.js.map +1 -0
- package/dist/{chunk-7RWWVUHP.mjs → chunk-6CU533DM.mjs} +2 -2
- package/dist/chunk-6CU533DM.mjs.map +1 -0
- package/dist/chunk-6JLKHV6O.js +128 -0
- package/dist/chunk-6JLKHV6O.js.map +1 -0
- package/dist/{chunk-YAYUSBC6.js → chunk-FHE43NKY.js} +12 -12
- package/dist/chunk-FHE43NKY.js.map +1 -0
- package/dist/chunk-GOJQYEJQ.js +3212 -0
- package/dist/chunk-GOJQYEJQ.js.map +1 -0
- package/dist/{chunk-3D6EDR3Z.mjs → chunk-LMNADWTH.mjs} +703 -41
- package/dist/chunk-LMNADWTH.mjs.map +1 -0
- package/dist/chunk-ODXJYXUH.mjs +3168 -0
- package/dist/chunk-ODXJYXUH.mjs.map +1 -0
- package/dist/{chunk-WJGSTAPB.mjs → chunk-QMFYPHX5.mjs} +300 -87
- package/dist/chunk-QMFYPHX5.mjs.map +1 -0
- package/dist/{chunk-3I3PYX2F.js → chunk-TNL23CO2.js} +2 -2
- package/dist/chunk-TNL23CO2.js.map +1 -0
- package/dist/{chunk-E6SBQNDA.mjs → chunk-UY2WD7MF.mjs} +3 -3
- package/dist/chunk-UY2WD7MF.mjs.map +1 -0
- package/dist/chunk-WD6QFSXZ.js +701 -0
- package/dist/chunk-WD6QFSXZ.js.map +1 -0
- package/dist/chunk-Y5LBT2WT.mjs +118 -0
- package/dist/chunk-Y5LBT2WT.mjs.map +1 -0
- package/dist/core.d.mts +50 -7
- package/dist/core.d.ts +50 -7
- package/dist/core.js +32 -16
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +4 -4
- package/dist/core.mjs.map +1 -1
- package/dist/display.d.mts +212 -3
- package/dist/display.d.ts +212 -3
- package/dist/display.js +27 -11
- package/dist/display.mjs +5 -5
- package/dist/index-D8RtV9cB.d.mts +5114 -0
- package/dist/index-ev_V5sjt.d.ts +5114 -0
- package/dist/index.d.mts +41 -6
- package/dist/index.d.ts +41 -6
- package/dist/index.js +90 -58
- package/dist/index.mjs +6 -6
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +13 -13
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs +3 -3
- package/dist/utils.mjs.map +1 -1
- package/dist/vaults.d.mts +3 -3817
- package/dist/vaults.d.ts +3 -3817
- package/dist/vaults.js +26 -26
- package/dist/vaults.mjs +5 -5
- package/package.json +30 -65
- package/dist/chunk-3D6EDR3Z.mjs.map +0 -1
- package/dist/chunk-3I3PYX2F.js.map +0 -1
- package/dist/chunk-7RWWVUHP.mjs.map +0 -1
- package/dist/chunk-AUDMOT6F.js +0 -1230
- package/dist/chunk-AUDMOT6F.js.map +0 -1
- package/dist/chunk-E5DH5YEE.js +0 -1485
- package/dist/chunk-E5DH5YEE.js.map +0 -1
- package/dist/chunk-E6SBQNDA.mjs.map +0 -1
- package/dist/chunk-JLZL25CY.mjs +0 -1450
- package/dist/chunk-JLZL25CY.mjs.map +0 -1
- package/dist/chunk-L5XT67QZ.js.map +0 -1
- package/dist/chunk-WJGSTAPB.mjs.map +0 -1
- package/dist/chunk-XVDK6J72.js +0 -484
- package/dist/chunk-XVDK6J72.js.map +0 -1
- package/dist/chunk-Y6RXVDQN.mjs +0 -1222
- package/dist/chunk-Y6RXVDQN.mjs.map +0 -1
- package/dist/chunk-YAYUSBC6.js.map +0 -1
package/dist/vaults.d.mts
CHANGED
|
@@ -1,3818 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
export { a as AlreadyApprovedAuthorizationResult, b as ApprovalAuthorizationResult, c as ApproveDepositTokenTxData, d as ApproveWithdrawOrderTxData, C as CancelWithdrawOrderTxData, D as DepositAuthMethod, e as DepositAuthorizationResult, f as DepositTxData, E as EIP712Domain, P as PERMIT_TYPES, j as ParsedPermitSignature, k as PermitAuthorizationResult, l as PermitDepositResult, m as PermitSignatureData, a4 as PrepareApproveDepositTokenTxParams, a5 as PrepareApproveWithdrawOrderTxDataParams, n as PrepareCancelWithdrawOrderTxDataParams, o as PrepareDepositAuthorizationParams, p as PrepareDepositParams, q as PrepareDepositPermitSignatureParams, r as PrepareDepositResult, a6 as PrepareDepositTxDataParams, s as PrepareDepositWithPermitTxDataParams, t as PrepareWithdrawOrderTxDataParams, u as PrepareWithdrawalAuthorizationParams, v as PrepareWithdrawalParams, w as PrepareWithdrawalResult, S as StandardDepositResult, U as UnencodedDepositWithPermitData, W as WithdrawAlreadyApprovedAuthorizationResult, z as WithdrawApprovalAuthorizationResult, B as WithdrawAuthMethod, F as WithdrawAuthorizationResult, G as WithdrawOrderTxData, H as isAlreadyApprovedAuth, I as isApprovalAuth, L as isPermitAuth, N as isWithdrawAlreadyApprovedAuth, O as isWithdrawApprovalAuth, Q as parsePermitSignature, R as prepareApproveDepositTokenTxData, T as prepareApproveWithdrawOrderTxData, V as prepareCancelWithdrawOrderTxData, X as prepareDeposit, Y as prepareDepositAuthorization, Z as prepareDepositPermitSignature, _ as prepareDepositTxData, $ as prepareDepositWithPermitTxData, a0 as prepareWithdrawOrderTxData, a1 as prepareWithdrawal, a2 as prepareWithdrawalAuthorization, a3 as toEthSignTypedDataV4 } from './index-D8RtV9cB.mjs';
|
|
2
|
+
import 'viem';
|
|
3
|
+
import './chain-utils-5r2UnCDS.mjs';
|
|
3
4
|
import 'viem/chains';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @file Approve Asset for deposit functionality for Paxos Labs vaults
|
|
7
|
-
* @module vaults/deposit
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Parameters required for preparing an ERC20 approval transaction
|
|
12
|
-
*
|
|
13
|
-
* @interface PrepareApproveDepositTokenTxParams
|
|
14
|
-
* @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
|
|
15
|
-
* @property {Address} depositAsset - Token contract address to approve. Must match the vault's supported asset.
|
|
16
|
-
* @property {string} [approvalAmount] - Optional amount to approve as a decimal string (defaults to maximum approval)
|
|
17
|
-
* @property {ChainId} chainId - ID of the chain where the approval will occur. Must match the vault's chain.
|
|
18
|
-
*/
|
|
19
|
-
interface PrepareApproveDepositTokenTxParams {
|
|
20
|
-
vaultName: string;
|
|
21
|
-
depositAsset: Address;
|
|
22
|
-
approvalAmount?: string;
|
|
23
|
-
chainId: ChainId;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Result object containing transaction data for an ERC20 approval operation
|
|
27
|
-
* @interface ApproveDepositTokenTxData
|
|
28
|
-
* @property {typeof erc20Abi} abi - ABI for the ERC20 token contract
|
|
29
|
-
* @property {Address} address - Address of the ERC20 token being approved
|
|
30
|
-
* @property {'approve'} functionName - Name of the function to call
|
|
31
|
-
* @property {[Address, bigint]} args - Arguments for the approve function:
|
|
32
|
-
* [spender (CommunityCodeDepositor address), amount]
|
|
33
|
-
*/
|
|
34
|
-
interface ApproveDepositTokenTxData {
|
|
35
|
-
abi: typeof erc20Abi;
|
|
36
|
-
address: Address;
|
|
37
|
-
functionName: "approve";
|
|
38
|
-
args: [Address, bigint];
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Prepares the transaction data needed to approve a deposit token for the vault
|
|
42
|
-
*
|
|
43
|
-
* This function prepares an ERC20 approval transaction that allows the vault's
|
|
44
|
-
* CommunityCodeDepositor contract to spend the user's deposit tokens.
|
|
45
|
-
* The vault is validated against the provided `vaultName`, `chainId`, and `depositAsset`.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```typescript
|
|
49
|
-
* const approveData = await prepareApproveDepositTokenTxData({
|
|
50
|
-
* vaultName: "Amplify USDC Core",
|
|
51
|
-
* depositAsset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
|
|
52
|
-
* approvalAmount: "1000.0", // Approve 1000 USDC
|
|
53
|
-
* chainId: 1,
|
|
54
|
-
* });
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
* @param {PrepareApproveDepositTokenTxParams} params - Parameters for the approval operation
|
|
58
|
-
* @returns {Promise<ApproveDepositTokenTxData>} Promise resolving to the prepared transaction data
|
|
59
|
-
* @throws {APIError} If vault not found, chain/asset mismatch, or contracts not configured
|
|
60
|
-
*/
|
|
61
|
-
declare function prepareApproveDepositTokenTxData({ vaultName, depositAsset, approvalAmount, chainId, }: PrepareApproveDepositTokenTxParams): Promise<ApproveDepositTokenTxData>;
|
|
62
|
-
|
|
63
|
-
declare const CommunityCodeDepositorAbi: readonly [{
|
|
64
|
-
readonly inputs: readonly [{
|
|
65
|
-
readonly internalType: "contract TellerWithMultiAssetSupport";
|
|
66
|
-
readonly name: "_teller";
|
|
67
|
-
readonly type: "address";
|
|
68
|
-
}, {
|
|
69
|
-
readonly internalType: "contract INativeWrapper";
|
|
70
|
-
readonly name: "_nativeWrapper";
|
|
71
|
-
readonly type: "address";
|
|
72
|
-
}, {
|
|
73
|
-
readonly internalType: "contract Authority";
|
|
74
|
-
readonly name: "_rolesAuthority";
|
|
75
|
-
readonly type: "address";
|
|
76
|
-
}, {
|
|
77
|
-
readonly internalType: "bool";
|
|
78
|
-
readonly name: "_isNativeDepositSupported";
|
|
79
|
-
readonly type: "bool";
|
|
80
|
-
}, {
|
|
81
|
-
readonly internalType: "address";
|
|
82
|
-
readonly name: "_owner";
|
|
83
|
-
readonly type: "address";
|
|
84
|
-
}];
|
|
85
|
-
readonly stateMutability: "nonpayable";
|
|
86
|
-
readonly type: "constructor";
|
|
87
|
-
}, {
|
|
88
|
-
readonly inputs: readonly [];
|
|
89
|
-
readonly name: "IncorrectNativeDepositAmount";
|
|
90
|
-
readonly type: "error";
|
|
91
|
-
}, {
|
|
92
|
-
readonly inputs: readonly [];
|
|
93
|
-
readonly name: "NativeDepositNotSupported";
|
|
94
|
-
readonly type: "error";
|
|
95
|
-
}, {
|
|
96
|
-
readonly inputs: readonly [];
|
|
97
|
-
readonly name: "NativeWrapperAccountantDecimalsMismatch";
|
|
98
|
-
readonly type: "error";
|
|
99
|
-
}, {
|
|
100
|
-
readonly inputs: readonly [];
|
|
101
|
-
readonly name: "PermitFailedAndAllowanceTooLow";
|
|
102
|
-
readonly type: "error";
|
|
103
|
-
}, {
|
|
104
|
-
readonly inputs: readonly [];
|
|
105
|
-
readonly name: "ZeroAddress";
|
|
106
|
-
readonly type: "error";
|
|
107
|
-
}, {
|
|
108
|
-
readonly anonymous: false;
|
|
109
|
-
readonly inputs: readonly [{
|
|
110
|
-
readonly indexed: true;
|
|
111
|
-
readonly internalType: "address";
|
|
112
|
-
readonly name: "user";
|
|
113
|
-
readonly type: "address";
|
|
114
|
-
}, {
|
|
115
|
-
readonly indexed: true;
|
|
116
|
-
readonly internalType: "contract Authority";
|
|
117
|
-
readonly name: "newAuthority";
|
|
118
|
-
readonly type: "address";
|
|
119
|
-
}];
|
|
120
|
-
readonly name: "AuthorityUpdated";
|
|
121
|
-
readonly type: "event";
|
|
122
|
-
}, {
|
|
123
|
-
readonly anonymous: false;
|
|
124
|
-
readonly inputs: readonly [{
|
|
125
|
-
readonly indexed: true;
|
|
126
|
-
readonly internalType: "address";
|
|
127
|
-
readonly name: "depositor";
|
|
128
|
-
readonly type: "address";
|
|
129
|
-
}, {
|
|
130
|
-
readonly indexed: true;
|
|
131
|
-
readonly internalType: "contract ERC20";
|
|
132
|
-
readonly name: "depositAsset";
|
|
133
|
-
readonly type: "address";
|
|
134
|
-
}, {
|
|
135
|
-
readonly indexed: false;
|
|
136
|
-
readonly internalType: "uint256";
|
|
137
|
-
readonly name: "depositAmount";
|
|
138
|
-
readonly type: "uint256";
|
|
139
|
-
}, {
|
|
140
|
-
readonly indexed: false;
|
|
141
|
-
readonly internalType: "uint256";
|
|
142
|
-
readonly name: "minimumMint";
|
|
143
|
-
readonly type: "uint256";
|
|
144
|
-
}, {
|
|
145
|
-
readonly indexed: false;
|
|
146
|
-
readonly internalType: "address";
|
|
147
|
-
readonly name: "to";
|
|
148
|
-
readonly type: "address";
|
|
149
|
-
}, {
|
|
150
|
-
readonly indexed: false;
|
|
151
|
-
readonly internalType: "bytes32";
|
|
152
|
-
readonly name: "depositHash";
|
|
153
|
-
readonly type: "bytes32";
|
|
154
|
-
}, {
|
|
155
|
-
readonly indexed: true;
|
|
156
|
-
readonly internalType: "bytes";
|
|
157
|
-
readonly name: "distributorCode";
|
|
158
|
-
readonly type: "bytes";
|
|
159
|
-
}];
|
|
160
|
-
readonly name: "DepositWithDistributorCode";
|
|
161
|
-
readonly type: "event";
|
|
162
|
-
}, {
|
|
163
|
-
readonly anonymous: false;
|
|
164
|
-
readonly inputs: readonly [{
|
|
165
|
-
readonly indexed: true;
|
|
166
|
-
readonly internalType: "address";
|
|
167
|
-
readonly name: "user";
|
|
168
|
-
readonly type: "address";
|
|
169
|
-
}, {
|
|
170
|
-
readonly indexed: true;
|
|
171
|
-
readonly internalType: "address";
|
|
172
|
-
readonly name: "newOwner";
|
|
173
|
-
readonly type: "address";
|
|
174
|
-
}];
|
|
175
|
-
readonly name: "OwnershipTransferred";
|
|
176
|
-
readonly type: "event";
|
|
177
|
-
}, {
|
|
178
|
-
readonly inputs: readonly [];
|
|
179
|
-
readonly name: "authority";
|
|
180
|
-
readonly outputs: readonly [{
|
|
181
|
-
readonly internalType: "contract Authority";
|
|
182
|
-
readonly name: "";
|
|
183
|
-
readonly type: "address";
|
|
184
|
-
}];
|
|
185
|
-
readonly stateMutability: "view";
|
|
186
|
-
readonly type: "function";
|
|
187
|
-
}, {
|
|
188
|
-
readonly inputs: readonly [];
|
|
189
|
-
readonly name: "boringVault";
|
|
190
|
-
readonly outputs: readonly [{
|
|
191
|
-
readonly internalType: "address";
|
|
192
|
-
readonly name: "";
|
|
193
|
-
readonly type: "address";
|
|
194
|
-
}];
|
|
195
|
-
readonly stateMutability: "view";
|
|
196
|
-
readonly type: "function";
|
|
197
|
-
}, {
|
|
198
|
-
readonly inputs: readonly [{
|
|
199
|
-
readonly internalType: "contract ERC20";
|
|
200
|
-
readonly name: "depositAsset";
|
|
201
|
-
readonly type: "address";
|
|
202
|
-
}, {
|
|
203
|
-
readonly internalType: "uint256";
|
|
204
|
-
readonly name: "depositAmount";
|
|
205
|
-
readonly type: "uint256";
|
|
206
|
-
}, {
|
|
207
|
-
readonly internalType: "uint256";
|
|
208
|
-
readonly name: "minimumMint";
|
|
209
|
-
readonly type: "uint256";
|
|
210
|
-
}, {
|
|
211
|
-
readonly internalType: "address";
|
|
212
|
-
readonly name: "to";
|
|
213
|
-
readonly type: "address";
|
|
214
|
-
}, {
|
|
215
|
-
readonly internalType: "bytes";
|
|
216
|
-
readonly name: "distributorCode";
|
|
217
|
-
readonly type: "bytes";
|
|
218
|
-
}];
|
|
219
|
-
readonly name: "deposit";
|
|
220
|
-
readonly outputs: readonly [{
|
|
221
|
-
readonly internalType: "uint256";
|
|
222
|
-
readonly name: "shares";
|
|
223
|
-
readonly type: "uint256";
|
|
224
|
-
}];
|
|
225
|
-
readonly stateMutability: "nonpayable";
|
|
226
|
-
readonly type: "function";
|
|
227
|
-
}, {
|
|
228
|
-
readonly inputs: readonly [{
|
|
229
|
-
readonly internalType: "uint256";
|
|
230
|
-
readonly name: "depositAmount";
|
|
231
|
-
readonly type: "uint256";
|
|
232
|
-
}, {
|
|
233
|
-
readonly internalType: "uint256";
|
|
234
|
-
readonly name: "minimumMint";
|
|
235
|
-
readonly type: "uint256";
|
|
236
|
-
}, {
|
|
237
|
-
readonly internalType: "address";
|
|
238
|
-
readonly name: "to";
|
|
239
|
-
readonly type: "address";
|
|
240
|
-
}, {
|
|
241
|
-
readonly internalType: "bytes";
|
|
242
|
-
readonly name: "distributorCode";
|
|
243
|
-
readonly type: "bytes";
|
|
244
|
-
}];
|
|
245
|
-
readonly name: "depositNative";
|
|
246
|
-
readonly outputs: readonly [{
|
|
247
|
-
readonly internalType: "uint256";
|
|
248
|
-
readonly name: "shares";
|
|
249
|
-
readonly type: "uint256";
|
|
250
|
-
}];
|
|
251
|
-
readonly stateMutability: "payable";
|
|
252
|
-
readonly type: "function";
|
|
253
|
-
}, {
|
|
254
|
-
readonly inputs: readonly [];
|
|
255
|
-
readonly name: "depositNonce";
|
|
256
|
-
readonly outputs: readonly [{
|
|
257
|
-
readonly internalType: "uint256";
|
|
258
|
-
readonly name: "";
|
|
259
|
-
readonly type: "uint256";
|
|
260
|
-
}];
|
|
261
|
-
readonly stateMutability: "view";
|
|
262
|
-
readonly type: "function";
|
|
263
|
-
}, {
|
|
264
|
-
readonly inputs: readonly [{
|
|
265
|
-
readonly internalType: "contract ERC20";
|
|
266
|
-
readonly name: "depositAsset";
|
|
267
|
-
readonly type: "address";
|
|
268
|
-
}, {
|
|
269
|
-
readonly internalType: "uint256";
|
|
270
|
-
readonly name: "depositAmount";
|
|
271
|
-
readonly type: "uint256";
|
|
272
|
-
}, {
|
|
273
|
-
readonly internalType: "uint256";
|
|
274
|
-
readonly name: "minimumMint";
|
|
275
|
-
readonly type: "uint256";
|
|
276
|
-
}, {
|
|
277
|
-
readonly internalType: "address";
|
|
278
|
-
readonly name: "to";
|
|
279
|
-
readonly type: "address";
|
|
280
|
-
}, {
|
|
281
|
-
readonly internalType: "bytes";
|
|
282
|
-
readonly name: "distributorCode";
|
|
283
|
-
readonly type: "bytes";
|
|
284
|
-
}, {
|
|
285
|
-
readonly internalType: "uint256";
|
|
286
|
-
readonly name: "deadline";
|
|
287
|
-
readonly type: "uint256";
|
|
288
|
-
}, {
|
|
289
|
-
readonly internalType: "uint8";
|
|
290
|
-
readonly name: "v";
|
|
291
|
-
readonly type: "uint8";
|
|
292
|
-
}, {
|
|
293
|
-
readonly internalType: "bytes32";
|
|
294
|
-
readonly name: "r";
|
|
295
|
-
readonly type: "bytes32";
|
|
296
|
-
}, {
|
|
297
|
-
readonly internalType: "bytes32";
|
|
298
|
-
readonly name: "s";
|
|
299
|
-
readonly type: "bytes32";
|
|
300
|
-
}];
|
|
301
|
-
readonly name: "depositWithPermit";
|
|
302
|
-
readonly outputs: readonly [{
|
|
303
|
-
readonly internalType: "uint256";
|
|
304
|
-
readonly name: "shares";
|
|
305
|
-
readonly type: "uint256";
|
|
306
|
-
}];
|
|
307
|
-
readonly stateMutability: "nonpayable";
|
|
308
|
-
readonly type: "function";
|
|
309
|
-
}, {
|
|
310
|
-
readonly inputs: readonly [];
|
|
311
|
-
readonly name: "isNativeDepositSupported";
|
|
312
|
-
readonly outputs: readonly [{
|
|
313
|
-
readonly internalType: "bool";
|
|
314
|
-
readonly name: "";
|
|
315
|
-
readonly type: "bool";
|
|
316
|
-
}];
|
|
317
|
-
readonly stateMutability: "view";
|
|
318
|
-
readonly type: "function";
|
|
319
|
-
}, {
|
|
320
|
-
readonly inputs: readonly [];
|
|
321
|
-
readonly name: "nativeWrapper";
|
|
322
|
-
readonly outputs: readonly [{
|
|
323
|
-
readonly internalType: "contract INativeWrapper";
|
|
324
|
-
readonly name: "";
|
|
325
|
-
readonly type: "address";
|
|
326
|
-
}];
|
|
327
|
-
readonly stateMutability: "view";
|
|
328
|
-
readonly type: "function";
|
|
329
|
-
}, {
|
|
330
|
-
readonly inputs: readonly [];
|
|
331
|
-
readonly name: "owner";
|
|
332
|
-
readonly outputs: readonly [{
|
|
333
|
-
readonly internalType: "address";
|
|
334
|
-
readonly name: "";
|
|
335
|
-
readonly type: "address";
|
|
336
|
-
}];
|
|
337
|
-
readonly stateMutability: "view";
|
|
338
|
-
readonly type: "function";
|
|
339
|
-
}, {
|
|
340
|
-
readonly inputs: readonly [{
|
|
341
|
-
readonly internalType: "contract Authority";
|
|
342
|
-
readonly name: "newAuthority";
|
|
343
|
-
readonly type: "address";
|
|
344
|
-
}];
|
|
345
|
-
readonly name: "setAuthority";
|
|
346
|
-
readonly outputs: readonly [];
|
|
347
|
-
readonly stateMutability: "nonpayable";
|
|
348
|
-
readonly type: "function";
|
|
349
|
-
}, {
|
|
350
|
-
readonly inputs: readonly [];
|
|
351
|
-
readonly name: "teller";
|
|
352
|
-
readonly outputs: readonly [{
|
|
353
|
-
readonly internalType: "contract TellerWithMultiAssetSupport";
|
|
354
|
-
readonly name: "";
|
|
355
|
-
readonly type: "address";
|
|
356
|
-
}];
|
|
357
|
-
readonly stateMutability: "view";
|
|
358
|
-
readonly type: "function";
|
|
359
|
-
}, {
|
|
360
|
-
readonly inputs: readonly [{
|
|
361
|
-
readonly internalType: "address";
|
|
362
|
-
readonly name: "newOwner";
|
|
363
|
-
readonly type: "address";
|
|
364
|
-
}];
|
|
365
|
-
readonly name: "transferOwnership";
|
|
366
|
-
readonly outputs: readonly [];
|
|
367
|
-
readonly stateMutability: "nonpayable";
|
|
368
|
-
readonly type: "function";
|
|
369
|
-
}];
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* @file Deposit functionality for Nucleus vaults
|
|
373
|
-
* @module vaults/deposit
|
|
374
|
-
*/
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* Result object containing transaction data for a deposit operation
|
|
378
|
-
* @interface DepositTxData
|
|
379
|
-
* @property {typeof CommunityCodeDepositorAbi} abi - ABI for the CommunityCodeDepositor contract
|
|
380
|
-
* @property {Address} address - Address of the CommunityCodeDepositor contract
|
|
381
|
-
* @property {'deposit'} functionName - Name of the function to call
|
|
382
|
-
* @property {readonly [depositAsset: Address, depositAmount: bigint, minimumMint: bigint, to: Address, distributorCode: Hex]} args - Arguments for the deposit function:
|
|
383
|
-
* [depositAsset, depositAmount, minimumMint, to, distributorCode]
|
|
384
|
-
* @property {number} chainId - ID of the chain where the transaction should be executed
|
|
385
|
-
*/
|
|
386
|
-
interface DepositTxData {
|
|
387
|
-
abi: typeof CommunityCodeDepositorAbi;
|
|
388
|
-
address: Address;
|
|
389
|
-
functionName: "deposit";
|
|
390
|
-
args: readonly [
|
|
391
|
-
depositAsset: Address,
|
|
392
|
-
depositAmount: bigint,
|
|
393
|
-
minimumMint: bigint,
|
|
394
|
-
to: Address,
|
|
395
|
-
distributorCode: Hex
|
|
396
|
-
];
|
|
397
|
-
chainId: number;
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* Parameters for prepareDepositTxData()
|
|
401
|
-
*
|
|
402
|
-
* @interface PrepareDepositTxDataParams
|
|
403
|
-
* @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
|
|
404
|
-
* @property {Address} to - Ethereum address of the recipient. Must be the same as the address used to sign the deposit transaction.
|
|
405
|
-
* @property {Address} depositAsset - Token contract address to deposit. Must match the vault's supported asset.
|
|
406
|
-
* @property {string} depositAmount - Amount of assets to deposit as a decimal string (e.g., "1.5")
|
|
407
|
-
* @property {ChainId} chainId - ID of the chain where the deposit will occur. Must match the vault's chain.
|
|
408
|
-
* @property {number} [slippage] - Optional (default is 50 (0.5%)): Maximum acceptable slippage in basis points (e.g., 100 for 1%).
|
|
409
|
-
* @property {string} [distributorCode] - Optional (default is empty string): Distributor code for fee attribution
|
|
410
|
-
*/
|
|
411
|
-
interface PrepareDepositTxDataParams {
|
|
412
|
-
vaultName: string;
|
|
413
|
-
to: Address;
|
|
414
|
-
depositAsset: Address;
|
|
415
|
-
depositAmount: string;
|
|
416
|
-
chainId: ChainId;
|
|
417
|
-
slippage?: number;
|
|
418
|
-
distributorCode?: string;
|
|
419
|
-
}
|
|
420
|
-
/**
|
|
421
|
-
* Prepares the transaction data needed to deposit assets into a vault
|
|
422
|
-
*
|
|
423
|
-
* This function calculates the minimum amount of vault tokens to be minted based on
|
|
424
|
-
* the current exchange rate and the specified slippage tolerance. The vault is resolved
|
|
425
|
-
* and validated against the provided `vaultName`, `chainId`, and `depositAsset`.
|
|
426
|
-
*
|
|
427
|
-
* ```typescript
|
|
428
|
-
* const depositData = await prepareDepositTxData({
|
|
429
|
-
* vaultName: 'Amplify USDC Core',
|
|
430
|
-
* to: '0x1234...',
|
|
431
|
-
* depositAsset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
|
|
432
|
-
* depositAmount: "1.0",
|
|
433
|
-
* chainId: 1,
|
|
434
|
-
* slippage: 100, // 1% slippage (100 bps)
|
|
435
|
-
* distributorCode: 'my-distributor-code',
|
|
436
|
-
* });
|
|
437
|
-
* ```
|
|
438
|
-
*
|
|
439
|
-
* @param {PrepareDepositTxDataParams} params - Parameters for the deposit operation
|
|
440
|
-
* @returns {Promise<DepositTxData>} Promise resolving to the prepared transaction data
|
|
441
|
-
* @throws {APIError} If vault cannot be resolved, asset not found, or contracts not configured
|
|
442
|
-
*/
|
|
443
|
-
declare function prepareDepositTxData(params: PrepareDepositTxDataParams): Promise<DepositTxData>;
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* @file Deposit with permit functionality for Nucleus vaults
|
|
447
|
-
* @module vaults/deposit/deposit-with-permit
|
|
448
|
-
*/
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* Strict EIP-712 domain separator conforming to the EIP-712 TypedData JSON schema
|
|
452
|
-
* Compatible with viem's TypedDataDomain and standard EIP-712 signing libraries
|
|
453
|
-
*
|
|
454
|
-
* This interface matches viem/abitype's TypedDataDomain for seamless integration
|
|
455
|
-
* with viem's signTypedData() and wagmi's signTypedDataAsync().
|
|
456
|
-
*
|
|
457
|
-
* @see {@link https://eips.ethereum.org/EIPS/eip-712#specification-of-the-eth_signtypeddata-json-rpc EIP-712 Specification}
|
|
458
|
-
*
|
|
459
|
-
* @property name - Human-readable name of the signing domain
|
|
460
|
-
* @property version - Version of the signing domain
|
|
461
|
-
* @property chainId - Ethereum chain ID as a number (not bigint)
|
|
462
|
-
* @property verifyingContract - Address of the contract that will verify the signature
|
|
463
|
-
* @property salt - Optional salt for disambiguation (hex string)
|
|
464
|
-
*/
|
|
465
|
-
interface EIP712Domain {
|
|
466
|
-
name: string;
|
|
467
|
-
version: string;
|
|
468
|
-
chainId: number;
|
|
469
|
-
verifyingContract: Address;
|
|
470
|
-
salt?: Hex;
|
|
471
|
-
}
|
|
472
|
-
/**
|
|
473
|
-
* T008: EIP-2612 Permit type definition
|
|
474
|
-
* Standard structure for permit typed data per EIP-2612 specification
|
|
475
|
-
*/
|
|
476
|
-
declare const PERMIT_TYPES: {
|
|
477
|
-
readonly Permit: readonly [{
|
|
478
|
-
readonly name: "owner";
|
|
479
|
-
readonly type: "address";
|
|
480
|
-
}, {
|
|
481
|
-
readonly name: "spender";
|
|
482
|
-
readonly type: "address";
|
|
483
|
-
}, {
|
|
484
|
-
readonly name: "value";
|
|
485
|
-
readonly type: "uint256";
|
|
486
|
-
}, {
|
|
487
|
-
readonly name: "nonce";
|
|
488
|
-
readonly type: "uint256";
|
|
489
|
-
}, {
|
|
490
|
-
readonly name: "deadline";
|
|
491
|
-
readonly type: "uint256";
|
|
492
|
-
}];
|
|
493
|
-
};
|
|
494
|
-
/**
|
|
495
|
-
* Converts PermitSignatureData to the format required by eth_signTypedData_v4
|
|
496
|
-
*
|
|
497
|
-
* Use this when calling eth_signTypedData_v4 directly via a provider (e.g., Privy
|
|
498
|
-
* embedded wallets). For viem/wagmi, use the PermitSignatureData directly.
|
|
499
|
-
*
|
|
500
|
-
* Key differences from viem/wagmi format:
|
|
501
|
-
* - Includes EIP712Domain in the types object (viem auto-adds this)
|
|
502
|
-
* - Converts bigint values to strings for JSON serialization
|
|
503
|
-
*
|
|
504
|
-
* @param permitData - Permit data from prepareDepositPermitSignature()
|
|
505
|
-
* @returns JSON string ready for eth_signTypedData_v4 params
|
|
506
|
-
*
|
|
507
|
-
* @example
|
|
508
|
-
* ```typescript
|
|
509
|
-
* // With Privy embedded wallet
|
|
510
|
-
* const permitData = await prepareDepositPermitSignature({...});
|
|
511
|
-
* const provider = await wallet.getEthereumProvider();
|
|
512
|
-
* const signature = await provider.request({
|
|
513
|
-
* method: 'eth_signTypedData_v4',
|
|
514
|
-
* params: [wallet.address, toEthSignTypedDataV4(permitData)],
|
|
515
|
-
* });
|
|
516
|
-
* ```
|
|
517
|
-
*/
|
|
518
|
-
declare function toEthSignTypedDataV4(permitData: PermitSignatureData): string;
|
|
519
|
-
/**
|
|
520
|
-
* T009: Complete EIP-712 typed data for permit signature
|
|
521
|
-
* Returned by prepareDepositPermitSignature() ready for wallet signing
|
|
522
|
-
*
|
|
523
|
-
* Compatible with viem's signTypedData(), wagmi's signTypedDataAsync(),
|
|
524
|
-
* and Privy's signTypedData(). Pass this object directly to the signing function.
|
|
525
|
-
*
|
|
526
|
-
* @property domain - EIP-712 domain separator with numeric chainId
|
|
527
|
-
* @property types - EIP-2612 Permit type structure
|
|
528
|
-
* @property message - Permit message fields with uint256 values as decimal strings
|
|
529
|
-
* @property primaryType - Always "Permit" for EIP-2612
|
|
530
|
-
*
|
|
531
|
-
* @remarks
|
|
532
|
-
* The message uses decimal string representations for uint256 values to ensure:
|
|
533
|
-
* 1. JSON serialization compatibility (required for Privy embedded wallets)
|
|
534
|
-
* 2. Compatibility with viem, wagmi, and Privy signing functions
|
|
535
|
-
* 3. Compliance with EIP-712 JSON schema specification
|
|
536
|
-
*
|
|
537
|
-
* @example
|
|
538
|
-
* ```typescript
|
|
539
|
-
* // With wagmi
|
|
540
|
-
* const signature = await signTypedDataAsync(permitData);
|
|
541
|
-
*
|
|
542
|
-
* // With viem
|
|
543
|
-
* const signature = await walletClient.signTypedData(permitData);
|
|
544
|
-
*
|
|
545
|
-
* // With Privy
|
|
546
|
-
* const signature = await wallet.signTypedData(permitData);
|
|
547
|
-
* ```
|
|
548
|
-
*/
|
|
549
|
-
type PermitSignatureData = Awaited<ReturnType<typeof prepareDepositPermitSignature>>;
|
|
550
|
-
/**
|
|
551
|
-
* T009: Parsed permit signature components
|
|
552
|
-
* Returned by parsePermitSignature() after converting hex signature
|
|
553
|
-
*
|
|
554
|
-
* @property v - Recovery ID (27 or 28)
|
|
555
|
-
* @property r - First 32 bytes of signature
|
|
556
|
-
* @property s - Second 32 bytes of signature
|
|
557
|
-
*/
|
|
558
|
-
interface ParsedPermitSignature {
|
|
559
|
-
v: number;
|
|
560
|
-
r: Hex;
|
|
561
|
-
s: Hex;
|
|
562
|
-
}
|
|
563
|
-
/**
|
|
564
|
-
* T009: Parameters for prepareDepositPermitSignature
|
|
565
|
-
* Input parameters for generating permit typed data
|
|
566
|
-
*
|
|
567
|
-
* @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
|
|
568
|
-
* @property {Address} depositAsset - Token contract address to deposit. Must match the vault's supported asset.
|
|
569
|
-
* @property {string} depositAmount - Deposit amount as decimal string (e.g., "100.25")
|
|
570
|
-
* @property {Address} to - User address (permit owner)
|
|
571
|
-
* @property {ChainId} chainId - Chain ID where the vault is deployed. Must match the vault's chain.
|
|
572
|
-
* @property {bigint} [deadline] - Optional permit expiration (defaults to 1 hour from now)
|
|
573
|
-
* @property {bigint} [nonce] - Optional pre-fetched nonce (skips RPC call if provided)
|
|
574
|
-
* @property {number} [decimals] - Optional pre-fetched token decimals (skips RPC call)
|
|
575
|
-
* @property {string} [tokenName] - Optional pre-fetched token name for EIP-712 domain (skips RPC call)
|
|
576
|
-
* @property {string} [tokenVersion] - Optional pre-fetched token version for EIP-712 domain (skips RPC call, defaults to "1")
|
|
577
|
-
*/
|
|
578
|
-
interface PrepareDepositPermitSignatureParams {
|
|
579
|
-
vaultName: string;
|
|
580
|
-
depositAsset: Address;
|
|
581
|
-
depositAmount: string;
|
|
582
|
-
to: Address;
|
|
583
|
-
chainId: ChainId;
|
|
584
|
-
deadline?: bigint;
|
|
585
|
-
/** Pre-fetched nonce from getTokenPermitInfoWithAllowance */
|
|
586
|
-
nonce?: bigint;
|
|
587
|
-
/** Pre-fetched token decimals */
|
|
588
|
-
decimals?: number;
|
|
589
|
-
/** Pre-fetched token name for EIP-712 domain */
|
|
590
|
-
tokenName?: string;
|
|
591
|
-
/** Pre-fetched token version for EIP-712 domain (defaults to "1") */
|
|
592
|
-
tokenVersion?: string;
|
|
593
|
-
}
|
|
594
|
-
type UnencodedDepositWithPermitData = Awaited<ReturnType<typeof prepareDepositWithPermitTxData>>;
|
|
595
|
-
/**
|
|
596
|
-
* T018-T030: Prepare complete EIP-712 typed data for permit signature
|
|
597
|
-
*
|
|
598
|
-
* Reads token metadata (name, version, nonce) from the blockchain and
|
|
599
|
-
* constructs the complete EIP-712 structure for wallet signing.
|
|
600
|
-
*
|
|
601
|
-
* @param params - Permit signature parameters
|
|
602
|
-
* @returns Complete EIP-712 typed data ready for signing
|
|
603
|
-
* @throws {APIError} If token doesn't support EIP-2612, vault not found, or chain unsupported
|
|
604
|
-
*
|
|
605
|
-
* @example
|
|
606
|
-
* ```typescript
|
|
607
|
-
* const permitData = await prepareDepositPermitSignature({
|
|
608
|
-
* vaultName: 'Amplify USDC Core',
|
|
609
|
-
* depositAsset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
|
|
610
|
-
* depositAmount: '1000.0',
|
|
611
|
-
* to: userAddress,
|
|
612
|
-
* chainId: 1,
|
|
613
|
-
* deadline: BigInt(Math.floor(Date.now() / 1000) + 3600),
|
|
614
|
-
* });
|
|
615
|
-
*
|
|
616
|
-
* // Sign with wallet
|
|
617
|
-
* const signature = await signTypedData(permitData);
|
|
618
|
-
* ```
|
|
619
|
-
*/
|
|
620
|
-
declare function prepareDepositPermitSignature(params: PrepareDepositPermitSignatureParams): Promise<{
|
|
621
|
-
account: `0x${string}`;
|
|
622
|
-
domain: {
|
|
623
|
-
name: string;
|
|
624
|
-
version: string;
|
|
625
|
-
chainId: number;
|
|
626
|
-
verifyingContract: `0x${string}`;
|
|
627
|
-
};
|
|
628
|
-
types: {
|
|
629
|
-
readonly Permit: readonly [{
|
|
630
|
-
readonly name: "owner";
|
|
631
|
-
readonly type: "address";
|
|
632
|
-
}, {
|
|
633
|
-
readonly name: "spender";
|
|
634
|
-
readonly type: "address";
|
|
635
|
-
}, {
|
|
636
|
-
readonly name: "value";
|
|
637
|
-
readonly type: "uint256";
|
|
638
|
-
}, {
|
|
639
|
-
readonly name: "nonce";
|
|
640
|
-
readonly type: "uint256";
|
|
641
|
-
}, {
|
|
642
|
-
readonly name: "deadline";
|
|
643
|
-
readonly type: "uint256";
|
|
644
|
-
}];
|
|
645
|
-
};
|
|
646
|
-
primaryType: "Permit";
|
|
647
|
-
message: {
|
|
648
|
-
owner: `0x${string}`;
|
|
649
|
-
spender: `0x${string}`;
|
|
650
|
-
value: bigint;
|
|
651
|
-
nonce: bigint;
|
|
652
|
-
deadline: bigint;
|
|
653
|
-
};
|
|
654
|
-
}>;
|
|
655
|
-
/**
|
|
656
|
-
* T036-T040: Parse raw hex signature into v, r, s components
|
|
657
|
-
*
|
|
658
|
-
* Handles both v-based and yParity-based signature formats.
|
|
659
|
-
* Converts yParity to v by adding 27 if needed.
|
|
660
|
-
*
|
|
661
|
-
* @param signature - Raw hex signature from wallet
|
|
662
|
-
* @returns Parsed signature components (v, r, s)
|
|
663
|
-
* @throws {APIError} If signature format is invalid
|
|
664
|
-
*
|
|
665
|
-
* @example
|
|
666
|
-
* ```typescript
|
|
667
|
-
* const signature = await signTypedData(permitData);
|
|
668
|
-
* const { v, r, s } = parsePermitSignature(signature);
|
|
669
|
-
* // Use v, r, s in smart contract call
|
|
670
|
-
* ```
|
|
671
|
-
*/
|
|
672
|
-
declare function parsePermitSignature(signature: Hex): ParsedPermitSignature;
|
|
673
|
-
/**
|
|
674
|
-
* T048: Parameters for prepareDepositWithPermitTxData()
|
|
675
|
-
* Accepts raw signature and deadline for complete transaction encoding.
|
|
676
|
-
*
|
|
677
|
-
* @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
|
|
678
|
-
* @property {Address} to - Recipient address for vault shares
|
|
679
|
-
* @property {Address} depositAsset - Token contract address to deposit. Must match the vault's supported asset.
|
|
680
|
-
* @property {string} depositAmount - Amount to deposit as a decimal string (e.g., "100.25")
|
|
681
|
-
* @property {ChainId} chainId - Chain ID where the vault is deployed. Must match the vault's chain.
|
|
682
|
-
* @property {Hex} signature - Raw hex signature from wallet signing of permit typed data
|
|
683
|
-
* @property {bigint} deadline - Permit expiration timestamp (must match the signed permit)
|
|
684
|
-
* @property {number} [slippage] - Optional slippage in basis points (default: 50 = 0.5%)
|
|
685
|
-
* @property {string} [distributorCode] - Optional distributor code for fee attribution
|
|
686
|
-
*
|
|
687
|
-
* @example
|
|
688
|
-
* ```typescript
|
|
689
|
-
* const permitData = await prepareDepositPermitSignature({ ... });
|
|
690
|
-
* const signature = await signTypedData(permitData);
|
|
691
|
-
*
|
|
692
|
-
* const params: PrepareDepositWithPermitTxDataParams = {
|
|
693
|
-
* vaultName: "Amplify USDC Core",
|
|
694
|
-
* to: "0x1234567890123456789012345678901234567890",
|
|
695
|
-
* depositAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
|
|
696
|
-
* depositAmount: "100.25",
|
|
697
|
-
* chainId: 1,
|
|
698
|
-
* signature,
|
|
699
|
-
* deadline: permitData.message.deadline,
|
|
700
|
-
* slippage: 100, // 1%
|
|
701
|
-
* distributorCode: "my-distributor-code",
|
|
702
|
-
* };
|
|
703
|
-
* ```
|
|
704
|
-
*/
|
|
705
|
-
interface PrepareDepositWithPermitTxDataParams {
|
|
706
|
-
vaultName: string;
|
|
707
|
-
to: Address;
|
|
708
|
-
depositAsset: Address;
|
|
709
|
-
depositAmount: string;
|
|
710
|
-
chainId: ChainId;
|
|
711
|
-
signature: Hex;
|
|
712
|
-
deadline: bigint;
|
|
713
|
-
slippage?: number;
|
|
714
|
-
distributorCode?: string;
|
|
715
|
-
}
|
|
716
|
-
/**
|
|
717
|
-
* T048-T057: Prepare complete deposit transaction with permit signature
|
|
718
|
-
*
|
|
719
|
-
* Accepts raw signature and deadline, parses signature internally,
|
|
720
|
-
* resolves vault, calculates minimum mint with slippage, and
|
|
721
|
-
* encodes the complete depositWithPermit function call.
|
|
722
|
-
*
|
|
723
|
-
* @param params - Deposit parameters including signature and deadline
|
|
724
|
-
* @returns Encoded transaction data ready for submission
|
|
725
|
-
* @throws {APIError} If vault not found, invalid signature, or parameter validation fails
|
|
726
|
-
*
|
|
727
|
-
* @example
|
|
728
|
-
* ```typescript
|
|
729
|
-
* // Submit transaction
|
|
730
|
-
* await sendTransaction({
|
|
731
|
-
* to: txData.address,
|
|
732
|
-
* data: txData.data,
|
|
733
|
-
* });
|
|
734
|
-
* ```
|
|
735
|
-
*/
|
|
736
|
-
declare function prepareDepositWithPermitTxData(params: PrepareDepositWithPermitTxDataParams): Promise<{
|
|
737
|
-
data: {
|
|
738
|
-
abi: readonly [{
|
|
739
|
-
readonly inputs: readonly [{
|
|
740
|
-
readonly internalType: "contract TellerWithMultiAssetSupport";
|
|
741
|
-
readonly name: "_teller";
|
|
742
|
-
readonly type: "address";
|
|
743
|
-
}, {
|
|
744
|
-
readonly internalType: "contract INativeWrapper";
|
|
745
|
-
readonly name: "_nativeWrapper";
|
|
746
|
-
readonly type: "address";
|
|
747
|
-
}, {
|
|
748
|
-
readonly internalType: "contract Authority";
|
|
749
|
-
readonly name: "_rolesAuthority";
|
|
750
|
-
readonly type: "address";
|
|
751
|
-
}, {
|
|
752
|
-
readonly internalType: "bool";
|
|
753
|
-
readonly name: "_isNativeDepositSupported";
|
|
754
|
-
readonly type: "bool";
|
|
755
|
-
}, {
|
|
756
|
-
readonly internalType: "address";
|
|
757
|
-
readonly name: "_owner";
|
|
758
|
-
readonly type: "address";
|
|
759
|
-
}];
|
|
760
|
-
readonly stateMutability: "nonpayable";
|
|
761
|
-
readonly type: "constructor";
|
|
762
|
-
}, {
|
|
763
|
-
readonly inputs: readonly [];
|
|
764
|
-
readonly name: "IncorrectNativeDepositAmount";
|
|
765
|
-
readonly type: "error";
|
|
766
|
-
}, {
|
|
767
|
-
readonly inputs: readonly [];
|
|
768
|
-
readonly name: "NativeDepositNotSupported";
|
|
769
|
-
readonly type: "error";
|
|
770
|
-
}, {
|
|
771
|
-
readonly inputs: readonly [];
|
|
772
|
-
readonly name: "NativeWrapperAccountantDecimalsMismatch";
|
|
773
|
-
readonly type: "error";
|
|
774
|
-
}, {
|
|
775
|
-
readonly inputs: readonly [];
|
|
776
|
-
readonly name: "PermitFailedAndAllowanceTooLow";
|
|
777
|
-
readonly type: "error";
|
|
778
|
-
}, {
|
|
779
|
-
readonly inputs: readonly [];
|
|
780
|
-
readonly name: "ZeroAddress";
|
|
781
|
-
readonly type: "error";
|
|
782
|
-
}, {
|
|
783
|
-
readonly anonymous: false;
|
|
784
|
-
readonly inputs: readonly [{
|
|
785
|
-
readonly indexed: true;
|
|
786
|
-
readonly internalType: "address";
|
|
787
|
-
readonly name: "user";
|
|
788
|
-
readonly type: "address";
|
|
789
|
-
}, {
|
|
790
|
-
readonly indexed: true;
|
|
791
|
-
readonly internalType: "contract Authority";
|
|
792
|
-
readonly name: "newAuthority";
|
|
793
|
-
readonly type: "address";
|
|
794
|
-
}];
|
|
795
|
-
readonly name: "AuthorityUpdated";
|
|
796
|
-
readonly type: "event";
|
|
797
|
-
}, {
|
|
798
|
-
readonly anonymous: false;
|
|
799
|
-
readonly inputs: readonly [{
|
|
800
|
-
readonly indexed: true;
|
|
801
|
-
readonly internalType: "address";
|
|
802
|
-
readonly name: "depositor";
|
|
803
|
-
readonly type: "address";
|
|
804
|
-
}, {
|
|
805
|
-
readonly indexed: true;
|
|
806
|
-
readonly internalType: "contract ERC20";
|
|
807
|
-
readonly name: "depositAsset";
|
|
808
|
-
readonly type: "address";
|
|
809
|
-
}, {
|
|
810
|
-
readonly indexed: false;
|
|
811
|
-
readonly internalType: "uint256";
|
|
812
|
-
readonly name: "depositAmount";
|
|
813
|
-
readonly type: "uint256";
|
|
814
|
-
}, {
|
|
815
|
-
readonly indexed: false;
|
|
816
|
-
readonly internalType: "uint256";
|
|
817
|
-
readonly name: "minimumMint";
|
|
818
|
-
readonly type: "uint256";
|
|
819
|
-
}, {
|
|
820
|
-
readonly indexed: false;
|
|
821
|
-
readonly internalType: "address";
|
|
822
|
-
readonly name: "to";
|
|
823
|
-
readonly type: "address";
|
|
824
|
-
}, {
|
|
825
|
-
readonly indexed: false;
|
|
826
|
-
readonly internalType: "bytes32";
|
|
827
|
-
readonly name: "depositHash";
|
|
828
|
-
readonly type: "bytes32";
|
|
829
|
-
}, {
|
|
830
|
-
readonly indexed: true;
|
|
831
|
-
readonly internalType: "bytes";
|
|
832
|
-
readonly name: "distributorCode";
|
|
833
|
-
readonly type: "bytes";
|
|
834
|
-
}];
|
|
835
|
-
readonly name: "DepositWithDistributorCode";
|
|
836
|
-
readonly type: "event";
|
|
837
|
-
}, {
|
|
838
|
-
readonly anonymous: false;
|
|
839
|
-
readonly inputs: readonly [{
|
|
840
|
-
readonly indexed: true;
|
|
841
|
-
readonly internalType: "address";
|
|
842
|
-
readonly name: "user";
|
|
843
|
-
readonly type: "address";
|
|
844
|
-
}, {
|
|
845
|
-
readonly indexed: true;
|
|
846
|
-
readonly internalType: "address";
|
|
847
|
-
readonly name: "newOwner";
|
|
848
|
-
readonly type: "address";
|
|
849
|
-
}];
|
|
850
|
-
readonly name: "OwnershipTransferred";
|
|
851
|
-
readonly type: "event";
|
|
852
|
-
}, {
|
|
853
|
-
readonly inputs: readonly [];
|
|
854
|
-
readonly name: "authority";
|
|
855
|
-
readonly outputs: readonly [{
|
|
856
|
-
readonly internalType: "contract Authority";
|
|
857
|
-
readonly name: "";
|
|
858
|
-
readonly type: "address";
|
|
859
|
-
}];
|
|
860
|
-
readonly stateMutability: "view";
|
|
861
|
-
readonly type: "function";
|
|
862
|
-
}, {
|
|
863
|
-
readonly inputs: readonly [];
|
|
864
|
-
readonly name: "boringVault";
|
|
865
|
-
readonly outputs: readonly [{
|
|
866
|
-
readonly internalType: "address";
|
|
867
|
-
readonly name: "";
|
|
868
|
-
readonly type: "address";
|
|
869
|
-
}];
|
|
870
|
-
readonly stateMutability: "view";
|
|
871
|
-
readonly type: "function";
|
|
872
|
-
}, {
|
|
873
|
-
readonly inputs: readonly [{
|
|
874
|
-
readonly internalType: "contract ERC20";
|
|
875
|
-
readonly name: "depositAsset";
|
|
876
|
-
readonly type: "address";
|
|
877
|
-
}, {
|
|
878
|
-
readonly internalType: "uint256";
|
|
879
|
-
readonly name: "depositAmount";
|
|
880
|
-
readonly type: "uint256";
|
|
881
|
-
}, {
|
|
882
|
-
readonly internalType: "uint256";
|
|
883
|
-
readonly name: "minimumMint";
|
|
884
|
-
readonly type: "uint256";
|
|
885
|
-
}, {
|
|
886
|
-
readonly internalType: "address";
|
|
887
|
-
readonly name: "to";
|
|
888
|
-
readonly type: "address";
|
|
889
|
-
}, {
|
|
890
|
-
readonly internalType: "bytes";
|
|
891
|
-
readonly name: "distributorCode";
|
|
892
|
-
readonly type: "bytes";
|
|
893
|
-
}];
|
|
894
|
-
readonly name: "deposit";
|
|
895
|
-
readonly outputs: readonly [{
|
|
896
|
-
readonly internalType: "uint256";
|
|
897
|
-
readonly name: "shares";
|
|
898
|
-
readonly type: "uint256";
|
|
899
|
-
}];
|
|
900
|
-
readonly stateMutability: "nonpayable";
|
|
901
|
-
readonly type: "function";
|
|
902
|
-
}, {
|
|
903
|
-
readonly inputs: readonly [{
|
|
904
|
-
readonly internalType: "uint256";
|
|
905
|
-
readonly name: "depositAmount";
|
|
906
|
-
readonly type: "uint256";
|
|
907
|
-
}, {
|
|
908
|
-
readonly internalType: "uint256";
|
|
909
|
-
readonly name: "minimumMint";
|
|
910
|
-
readonly type: "uint256";
|
|
911
|
-
}, {
|
|
912
|
-
readonly internalType: "address";
|
|
913
|
-
readonly name: "to";
|
|
914
|
-
readonly type: "address";
|
|
915
|
-
}, {
|
|
916
|
-
readonly internalType: "bytes";
|
|
917
|
-
readonly name: "distributorCode";
|
|
918
|
-
readonly type: "bytes";
|
|
919
|
-
}];
|
|
920
|
-
readonly name: "depositNative";
|
|
921
|
-
readonly outputs: readonly [{
|
|
922
|
-
readonly internalType: "uint256";
|
|
923
|
-
readonly name: "shares";
|
|
924
|
-
readonly type: "uint256";
|
|
925
|
-
}];
|
|
926
|
-
readonly stateMutability: "payable";
|
|
927
|
-
readonly type: "function";
|
|
928
|
-
}, {
|
|
929
|
-
readonly inputs: readonly [];
|
|
930
|
-
readonly name: "depositNonce";
|
|
931
|
-
readonly outputs: readonly [{
|
|
932
|
-
readonly internalType: "uint256";
|
|
933
|
-
readonly name: "";
|
|
934
|
-
readonly type: "uint256";
|
|
935
|
-
}];
|
|
936
|
-
readonly stateMutability: "view";
|
|
937
|
-
readonly type: "function";
|
|
938
|
-
}, {
|
|
939
|
-
readonly inputs: readonly [{
|
|
940
|
-
readonly internalType: "contract ERC20";
|
|
941
|
-
readonly name: "depositAsset";
|
|
942
|
-
readonly type: "address";
|
|
943
|
-
}, {
|
|
944
|
-
readonly internalType: "uint256";
|
|
945
|
-
readonly name: "depositAmount";
|
|
946
|
-
readonly type: "uint256";
|
|
947
|
-
}, {
|
|
948
|
-
readonly internalType: "uint256";
|
|
949
|
-
readonly name: "minimumMint";
|
|
950
|
-
readonly type: "uint256";
|
|
951
|
-
}, {
|
|
952
|
-
readonly internalType: "address";
|
|
953
|
-
readonly name: "to";
|
|
954
|
-
readonly type: "address";
|
|
955
|
-
}, {
|
|
956
|
-
readonly internalType: "bytes";
|
|
957
|
-
readonly name: "distributorCode";
|
|
958
|
-
readonly type: "bytes";
|
|
959
|
-
}, {
|
|
960
|
-
readonly internalType: "uint256";
|
|
961
|
-
readonly name: "deadline";
|
|
962
|
-
readonly type: "uint256";
|
|
963
|
-
}, {
|
|
964
|
-
readonly internalType: "uint8";
|
|
965
|
-
readonly name: "v";
|
|
966
|
-
readonly type: "uint8";
|
|
967
|
-
}, {
|
|
968
|
-
readonly internalType: "bytes32";
|
|
969
|
-
readonly name: "r";
|
|
970
|
-
readonly type: "bytes32";
|
|
971
|
-
}, {
|
|
972
|
-
readonly internalType: "bytes32";
|
|
973
|
-
readonly name: "s";
|
|
974
|
-
readonly type: "bytes32";
|
|
975
|
-
}];
|
|
976
|
-
readonly name: "depositWithPermit";
|
|
977
|
-
readonly outputs: readonly [{
|
|
978
|
-
readonly internalType: "uint256";
|
|
979
|
-
readonly name: "shares";
|
|
980
|
-
readonly type: "uint256";
|
|
981
|
-
}];
|
|
982
|
-
readonly stateMutability: "nonpayable";
|
|
983
|
-
readonly type: "function";
|
|
984
|
-
}, {
|
|
985
|
-
readonly inputs: readonly [];
|
|
986
|
-
readonly name: "isNativeDepositSupported";
|
|
987
|
-
readonly outputs: readonly [{
|
|
988
|
-
readonly internalType: "bool";
|
|
989
|
-
readonly name: "";
|
|
990
|
-
readonly type: "bool";
|
|
991
|
-
}];
|
|
992
|
-
readonly stateMutability: "view";
|
|
993
|
-
readonly type: "function";
|
|
994
|
-
}, {
|
|
995
|
-
readonly inputs: readonly [];
|
|
996
|
-
readonly name: "nativeWrapper";
|
|
997
|
-
readonly outputs: readonly [{
|
|
998
|
-
readonly internalType: "contract INativeWrapper";
|
|
999
|
-
readonly name: "";
|
|
1000
|
-
readonly type: "address";
|
|
1001
|
-
}];
|
|
1002
|
-
readonly stateMutability: "view";
|
|
1003
|
-
readonly type: "function";
|
|
1004
|
-
}, {
|
|
1005
|
-
readonly inputs: readonly [];
|
|
1006
|
-
readonly name: "owner";
|
|
1007
|
-
readonly outputs: readonly [{
|
|
1008
|
-
readonly internalType: "address";
|
|
1009
|
-
readonly name: "";
|
|
1010
|
-
readonly type: "address";
|
|
1011
|
-
}];
|
|
1012
|
-
readonly stateMutability: "view";
|
|
1013
|
-
readonly type: "function";
|
|
1014
|
-
}, {
|
|
1015
|
-
readonly inputs: readonly [{
|
|
1016
|
-
readonly internalType: "contract Authority";
|
|
1017
|
-
readonly name: "newAuthority";
|
|
1018
|
-
readonly type: "address";
|
|
1019
|
-
}];
|
|
1020
|
-
readonly name: "setAuthority";
|
|
1021
|
-
readonly outputs: readonly [];
|
|
1022
|
-
readonly stateMutability: "nonpayable";
|
|
1023
|
-
readonly type: "function";
|
|
1024
|
-
}, {
|
|
1025
|
-
readonly inputs: readonly [];
|
|
1026
|
-
readonly name: "teller";
|
|
1027
|
-
readonly outputs: readonly [{
|
|
1028
|
-
readonly internalType: "contract TellerWithMultiAssetSupport";
|
|
1029
|
-
readonly name: "";
|
|
1030
|
-
readonly type: "address";
|
|
1031
|
-
}];
|
|
1032
|
-
readonly stateMutability: "view";
|
|
1033
|
-
readonly type: "function";
|
|
1034
|
-
}, {
|
|
1035
|
-
readonly inputs: readonly [{
|
|
1036
|
-
readonly internalType: "address";
|
|
1037
|
-
readonly name: "newOwner";
|
|
1038
|
-
readonly type: "address";
|
|
1039
|
-
}];
|
|
1040
|
-
readonly name: "transferOwnership";
|
|
1041
|
-
readonly outputs: readonly [];
|
|
1042
|
-
readonly stateMutability: "nonpayable";
|
|
1043
|
-
readonly type: "function";
|
|
1044
|
-
}];
|
|
1045
|
-
functionName: string;
|
|
1046
|
-
args: (number | bigint | `0x${string}`)[];
|
|
1047
|
-
};
|
|
1048
|
-
address: `0x${string}`;
|
|
1049
|
-
chainId: number;
|
|
1050
|
-
}>;
|
|
1051
|
-
|
|
1052
|
-
/**
|
|
1053
|
-
* @file Unified deposit module with wrapper functions
|
|
1054
|
-
* @module vaults/deposit
|
|
1055
|
-
*
|
|
1056
|
-
* Provides high-level wrapper functions for deposit authorization and execution:
|
|
1057
|
-
* - `prepareDepositAuthorization`: Determines optimal authorization method (permit/approval)
|
|
1058
|
-
* - `prepareDeposit`: Unified deposit preparation with automatic routing
|
|
1059
|
-
*/
|
|
1060
|
-
|
|
1061
|
-
/**
|
|
1062
|
-
* Authorization methods for deposit operations
|
|
1063
|
-
*
|
|
1064
|
-
* Extensible const object for current and future authorization mechanisms:
|
|
1065
|
-
* - PERMIT: EIP-2612 off-chain signature (gas efficient, single transaction)
|
|
1066
|
-
* - APPROVAL: Traditional ERC20 approval (two transactions)
|
|
1067
|
-
* - ALREADY_APPROVED: Existing allowance is sufficient (no action needed)
|
|
1068
|
-
*
|
|
1069
|
-
* @example
|
|
1070
|
-
* ```typescript
|
|
1071
|
-
* import { DepositAuthMethod } from "@paxoslabs/amplify-sdk";
|
|
1072
|
-
*
|
|
1073
|
-
* if (result.method === DepositAuthMethod.PERMIT) {
|
|
1074
|
-
* // Handle permit flow
|
|
1075
|
-
* }
|
|
1076
|
-
* ```
|
|
1077
|
-
*/
|
|
1078
|
-
declare const DepositAuthMethod: {
|
|
1079
|
-
readonly PERMIT: "permit";
|
|
1080
|
-
readonly APPROVAL: "approval";
|
|
1081
|
-
readonly ALREADY_APPROVED: "already_approved";
|
|
1082
|
-
};
|
|
1083
|
-
type DepositAuthMethod = (typeof DepositAuthMethod)[keyof typeof DepositAuthMethod];
|
|
1084
|
-
/**
|
|
1085
|
-
* Permit authorization result
|
|
1086
|
-
* Returned when token supports EIP-2612 permit
|
|
1087
|
-
*/
|
|
1088
|
-
interface PermitAuthorizationResult {
|
|
1089
|
-
method: typeof DepositAuthMethod.PERMIT;
|
|
1090
|
-
/** EIP-712 typed data ready for wallet signing */
|
|
1091
|
-
permitData: PermitSignatureData;
|
|
1092
|
-
}
|
|
1093
|
-
/**
|
|
1094
|
-
* Approval authorization result
|
|
1095
|
-
* Returned when an ERC20 approval transaction is needed
|
|
1096
|
-
*/
|
|
1097
|
-
interface ApprovalAuthorizationResult {
|
|
1098
|
-
method: typeof DepositAuthMethod.APPROVAL;
|
|
1099
|
-
/** Transaction data for ERC20 approve() call */
|
|
1100
|
-
txData: ApproveDepositTokenTxData;
|
|
1101
|
-
}
|
|
1102
|
-
/**
|
|
1103
|
-
* Already approved authorization result
|
|
1104
|
-
* Returned when existing allowance is sufficient for the deposit
|
|
1105
|
-
*/
|
|
1106
|
-
interface AlreadyApprovedAuthorizationResult {
|
|
1107
|
-
method: typeof DepositAuthMethod.ALREADY_APPROVED;
|
|
1108
|
-
/** Current allowance (human-readable) */
|
|
1109
|
-
allowance: string;
|
|
1110
|
-
/** Current allowance as BigInt string */
|
|
1111
|
-
allowanceAsBigInt: string;
|
|
1112
|
-
}
|
|
1113
|
-
/**
|
|
1114
|
-
* Discriminated union of all authorization result types
|
|
1115
|
-
*
|
|
1116
|
-
* Use type guards or type narrowing with `result.method` to access specific fields:
|
|
1117
|
-
*
|
|
1118
|
-
* @example Using type guards (recommended)
|
|
1119
|
-
* ```typescript
|
|
1120
|
-
* import {
|
|
1121
|
-
* prepareDepositAuthorization,
|
|
1122
|
-
* isPermitAuth,
|
|
1123
|
-
* isApprovalAuth,
|
|
1124
|
-
* isAlreadyApprovedAuth,
|
|
1125
|
-
* } from "@paxoslabs/amplify-sdk";
|
|
1126
|
-
*
|
|
1127
|
-
* const result = await prepareDepositAuthorization({...});
|
|
1128
|
-
*
|
|
1129
|
-
* if (isPermitAuth(result)) {
|
|
1130
|
-
* // TypeScript knows result.permitData exists
|
|
1131
|
-
* const signature = await signTypedData(result.permitData);
|
|
1132
|
-
* } else if (isApprovalAuth(result)) {
|
|
1133
|
-
* // TypeScript knows result.txData exists
|
|
1134
|
-
* await writeContract(result.txData);
|
|
1135
|
-
* } else if (isAlreadyApprovedAuth(result)) {
|
|
1136
|
-
* // TypeScript knows result.allowance exists
|
|
1137
|
-
* console.log(`Already approved: ${result.allowance}`);
|
|
1138
|
-
* }
|
|
1139
|
-
* ```
|
|
1140
|
-
*
|
|
1141
|
-
* @example Using switch statement
|
|
1142
|
-
* ```typescript
|
|
1143
|
-
* switch (result.method) {
|
|
1144
|
-
* case DepositAuthMethod.PERMIT:
|
|
1145
|
-
* // TypeScript knows result.permitData exists
|
|
1146
|
-
* const signature = await signTypedData(result.permitData);
|
|
1147
|
-
* break;
|
|
1148
|
-
* case DepositAuthMethod.APPROVAL:
|
|
1149
|
-
* // TypeScript knows result.txData exists
|
|
1150
|
-
* await writeContract(result.txData);
|
|
1151
|
-
* break;
|
|
1152
|
-
* case DepositAuthMethod.ALREADY_APPROVED:
|
|
1153
|
-
* // TypeScript knows result.allowance exists
|
|
1154
|
-
* console.log(`Already approved: ${result.allowance}`);
|
|
1155
|
-
* break;
|
|
1156
|
-
* }
|
|
1157
|
-
* ```
|
|
1158
|
-
*/
|
|
1159
|
-
type DepositAuthorizationResult = PermitAuthorizationResult | ApprovalAuthorizationResult | AlreadyApprovedAuthorizationResult;
|
|
1160
|
-
/**
|
|
1161
|
-
* Type guard for permit authorization result
|
|
1162
|
-
*
|
|
1163
|
-
* @param result - Authorization result to check
|
|
1164
|
-
* @returns true if result is a permit authorization
|
|
1165
|
-
*
|
|
1166
|
-
* @example
|
|
1167
|
-
* ```typescript
|
|
1168
|
-
* if (isPermitAuth(result)) {
|
|
1169
|
-
* // TypeScript knows result.permitData exists
|
|
1170
|
-
* const signature = await signTypedData(result.permitData);
|
|
1171
|
-
* }
|
|
1172
|
-
* ```
|
|
1173
|
-
*/
|
|
1174
|
-
declare function isPermitAuth(result: DepositAuthorizationResult): result is PermitAuthorizationResult;
|
|
1175
|
-
/**
|
|
1176
|
-
* Type guard for approval authorization result
|
|
1177
|
-
*
|
|
1178
|
-
* @param result - Authorization result to check
|
|
1179
|
-
* @returns true if result requires an ERC20 approval transaction
|
|
1180
|
-
*
|
|
1181
|
-
* @example
|
|
1182
|
-
* ```typescript
|
|
1183
|
-
* if (isApprovalAuth(result)) {
|
|
1184
|
-
* // TypeScript knows result.txData exists
|
|
1185
|
-
* await writeContract(result.txData);
|
|
1186
|
-
* }
|
|
1187
|
-
* ```
|
|
1188
|
-
*/
|
|
1189
|
-
declare function isApprovalAuth(result: DepositAuthorizationResult): result is ApprovalAuthorizationResult;
|
|
1190
|
-
/**
|
|
1191
|
-
* Type guard for already-approved authorization result
|
|
1192
|
-
*
|
|
1193
|
-
* @param result - Authorization result to check
|
|
1194
|
-
* @returns true if existing allowance is sufficient (no action needed)
|
|
1195
|
-
*
|
|
1196
|
-
* @example
|
|
1197
|
-
* ```typescript
|
|
1198
|
-
* if (isAlreadyApprovedAuth(result)) {
|
|
1199
|
-
* // TypeScript knows result.allowance exists
|
|
1200
|
-
* console.log(`Sufficient allowance: ${result.allowance}`);
|
|
1201
|
-
* }
|
|
1202
|
-
* ```
|
|
1203
|
-
*/
|
|
1204
|
-
declare function isAlreadyApprovedAuth(result: DepositAuthorizationResult): result is AlreadyApprovedAuthorizationResult;
|
|
1205
|
-
/**
|
|
1206
|
-
* Parameters for prepareDepositAuthorization
|
|
1207
|
-
*/
|
|
1208
|
-
interface PrepareDepositAuthorizationParams {
|
|
1209
|
-
/** Human-readable vault name (e.g. "Amplify USDC Core") */
|
|
1210
|
-
vaultName: string;
|
|
1211
|
-
/** Token contract address to deposit. Must match the vault's supported asset. */
|
|
1212
|
-
depositAsset: Address;
|
|
1213
|
-
/** Amount of assets to deposit as decimal string (e.g., "100.25") */
|
|
1214
|
-
depositAmount: string;
|
|
1215
|
-
/** User's wallet address (permit owner / approval sender) */
|
|
1216
|
-
to: Address;
|
|
1217
|
-
/** Chain ID where the vault is deployed. Must match the vault's chain. */
|
|
1218
|
-
chainId: ChainId;
|
|
1219
|
-
/** Optional deadline for permit signature (defaults to 1 hour from now) */
|
|
1220
|
-
deadline?: bigint;
|
|
1221
|
-
/** Force specific authorization method (bypasses automatic detection) */
|
|
1222
|
-
forceMethod?: "permit" | "approval";
|
|
1223
|
-
}
|
|
1224
|
-
/**
|
|
1225
|
-
* Parameters for prepareDeposit
|
|
1226
|
-
* Unified deposit function accepting optional permit signature
|
|
1227
|
-
*/
|
|
1228
|
-
interface PrepareDepositParams {
|
|
1229
|
-
/** Human-readable vault name (e.g. "Amplify USDC Core") */
|
|
1230
|
-
vaultName: string;
|
|
1231
|
-
/** Token contract address to deposit. Must match the vault's supported asset. */
|
|
1232
|
-
depositAsset: Address;
|
|
1233
|
-
/** Amount of assets to deposit as decimal string (e.g., "100.25") */
|
|
1234
|
-
depositAmount: string;
|
|
1235
|
-
/** Recipient address for vault shares */
|
|
1236
|
-
to: Address;
|
|
1237
|
-
/** Chain ID where the vault is deployed. Must match the vault's chain. */
|
|
1238
|
-
chainId: ChainId;
|
|
1239
|
-
/** Optional slippage in basis points (default: 50 = 0.5%) */
|
|
1240
|
-
slippage?: number;
|
|
1241
|
-
/** Optional distributor code for fee attribution */
|
|
1242
|
-
distributorCode?: string;
|
|
1243
|
-
/** Optional permit signature (hex string from wallet signing) */
|
|
1244
|
-
signature?: Hex;
|
|
1245
|
-
/** Optional permit deadline (must match signature deadline) */
|
|
1246
|
-
deadline?: bigint;
|
|
1247
|
-
/** Force deposit method (bypasses automatic routing) */
|
|
1248
|
-
forceMethod?: "permit" | "approval";
|
|
1249
|
-
}
|
|
1250
|
-
/**
|
|
1251
|
-
* Standard deposit result (approval flow)
|
|
1252
|
-
*/
|
|
1253
|
-
interface StandardDepositResult {
|
|
1254
|
-
method: typeof DepositAuthMethod.APPROVAL;
|
|
1255
|
-
txData: DepositTxData;
|
|
1256
|
-
}
|
|
1257
|
-
/**
|
|
1258
|
-
* Permit deposit result
|
|
1259
|
-
*/
|
|
1260
|
-
interface PermitDepositResult {
|
|
1261
|
-
method: typeof DepositAuthMethod.PERMIT;
|
|
1262
|
-
txData: UnencodedDepositWithPermitData;
|
|
1263
|
-
}
|
|
1264
|
-
/**
|
|
1265
|
-
* Unified deposit result
|
|
1266
|
-
* Returns either standard deposit or permit deposit transaction data
|
|
1267
|
-
*/
|
|
1268
|
-
type PrepareDepositResult = StandardDepositResult | PermitDepositResult;
|
|
1269
|
-
/**
|
|
1270
|
-
* Prepares authorization for a deposit operation
|
|
1271
|
-
*
|
|
1272
|
-
* Intelligently determines the best authorization method:
|
|
1273
|
-
* 1. Check if token supports EIP-2612 permit → return permit signature data
|
|
1274
|
-
* 2. Check existing allowance → if sufficient, return "already approved"
|
|
1275
|
-
* 3. Otherwise → return approval transaction data
|
|
1276
|
-
*
|
|
1277
|
-
* Supports force override via `forceMethod` parameter.
|
|
1278
|
-
*
|
|
1279
|
-
* @param params - Authorization parameters
|
|
1280
|
-
* @returns Discriminated union of authorization results
|
|
1281
|
-
* @throws {APIError} If vault not found, chain not supported, or token invalid
|
|
1282
|
-
*
|
|
1283
|
-
* @example
|
|
1284
|
-
* ```typescript
|
|
1285
|
-
* import { prepareDepositAuthorization, DepositAuthMethod } from "@paxoslabs/amplify-sdk";
|
|
1286
|
-
*
|
|
1287
|
-
* const authResult = await prepareDepositAuthorization({
|
|
1288
|
-
* vaultName: "Amplify USDC Core",
|
|
1289
|
-
* depositAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
|
|
1290
|
-
* depositAmount: "1000.0",
|
|
1291
|
-
* to: "0x1234...",
|
|
1292
|
-
* chainId: 1,
|
|
1293
|
-
* });
|
|
1294
|
-
*
|
|
1295
|
-
* if (authResult.method === DepositAuthMethod.PERMIT) {
|
|
1296
|
-
* const signature = await signTypedData(authResult.permitData);
|
|
1297
|
-
* // Use signature in prepareDeposit
|
|
1298
|
-
* } else if (authResult.method === DepositAuthMethod.APPROVAL) {
|
|
1299
|
-
* await writeContract(authResult.txData);
|
|
1300
|
-
* // Wait for confirmation, then call prepareDeposit
|
|
1301
|
-
* } else {
|
|
1302
|
-
* // Already approved, proceed directly to deposit
|
|
1303
|
-
* console.log(`Approved amount: ${authResult.allowance}`);
|
|
1304
|
-
* }
|
|
1305
|
-
* ```
|
|
1306
|
-
*/
|
|
1307
|
-
declare function prepareDepositAuthorization(params: PrepareDepositAuthorizationParams): Promise<{
|
|
1308
|
-
method: "approval";
|
|
1309
|
-
txData: ApproveDepositTokenTxData;
|
|
1310
|
-
permitData?: undefined;
|
|
1311
|
-
allowance?: undefined;
|
|
1312
|
-
allowanceAsBigInt?: undefined;
|
|
1313
|
-
} | {
|
|
1314
|
-
method: "permit";
|
|
1315
|
-
permitData: {
|
|
1316
|
-
account: `0x${string}`;
|
|
1317
|
-
domain: {
|
|
1318
|
-
name: string;
|
|
1319
|
-
version: string;
|
|
1320
|
-
chainId: number;
|
|
1321
|
-
verifyingContract: `0x${string}`;
|
|
1322
|
-
};
|
|
1323
|
-
types: {
|
|
1324
|
-
readonly Permit: readonly [{
|
|
1325
|
-
readonly name: "owner";
|
|
1326
|
-
readonly type: "address";
|
|
1327
|
-
}, {
|
|
1328
|
-
readonly name: "spender";
|
|
1329
|
-
readonly type: "address";
|
|
1330
|
-
}, {
|
|
1331
|
-
readonly name: "value";
|
|
1332
|
-
readonly type: "uint256";
|
|
1333
|
-
}, {
|
|
1334
|
-
readonly name: "nonce";
|
|
1335
|
-
readonly type: "uint256";
|
|
1336
|
-
}, {
|
|
1337
|
-
readonly name: "deadline";
|
|
1338
|
-
readonly type: "uint256";
|
|
1339
|
-
}];
|
|
1340
|
-
};
|
|
1341
|
-
primaryType: "Permit";
|
|
1342
|
-
message: {
|
|
1343
|
-
owner: `0x${string}`;
|
|
1344
|
-
spender: `0x${string}`;
|
|
1345
|
-
value: bigint;
|
|
1346
|
-
nonce: bigint;
|
|
1347
|
-
deadline: bigint;
|
|
1348
|
-
};
|
|
1349
|
-
};
|
|
1350
|
-
txData?: undefined;
|
|
1351
|
-
allowance?: undefined;
|
|
1352
|
-
allowanceAsBigInt?: undefined;
|
|
1353
|
-
} | {
|
|
1354
|
-
method: "already_approved";
|
|
1355
|
-
allowance: string;
|
|
1356
|
-
allowanceAsBigInt: string;
|
|
1357
|
-
txData?: undefined;
|
|
1358
|
-
permitData?: undefined;
|
|
1359
|
-
}>;
|
|
1360
|
-
/**
|
|
1361
|
-
* Unified deposit preparation function
|
|
1362
|
-
*
|
|
1363
|
-
* Intelligently routes to permit deposit or standard deposit based on:
|
|
1364
|
-
* 1. Presence of signature/deadline parameters → permit deposit
|
|
1365
|
-
* 2. Force method override → specified method
|
|
1366
|
-
* 3. Otherwise → standard deposit
|
|
1367
|
-
*
|
|
1368
|
-
* @param params - Deposit parameters with optional permit signature
|
|
1369
|
-
* @returns Discriminated union of deposit transaction data
|
|
1370
|
-
* @throws {APIError} If vault not found, invalid signature, or validation fails
|
|
1371
|
-
*
|
|
1372
|
-
* @example
|
|
1373
|
-
* ```typescript
|
|
1374
|
-
* import { prepareDeposit, DepositAuthMethod } from "@paxoslabs/amplify-sdk";
|
|
1375
|
-
*
|
|
1376
|
-
* // Scenario 1: Permit deposit (with signature from prepareDepositAuthorization)
|
|
1377
|
-
* const permitDeposit = await prepareDeposit({
|
|
1378
|
-
* vaultName: "Amplify USDC Core",
|
|
1379
|
-
* depositAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
1380
|
-
* depositAmount: "1000.0",
|
|
1381
|
-
* to: "0x1234...",
|
|
1382
|
-
* chainId: 1,
|
|
1383
|
-
* signature: "0xabc...",
|
|
1384
|
-
* deadline: 1234567890n,
|
|
1385
|
-
* });
|
|
1386
|
-
* // permitDeposit.method === DepositAuthMethod.PERMIT
|
|
1387
|
-
*
|
|
1388
|
-
* // Scenario 2: Standard deposit (after approval)
|
|
1389
|
-
* const standardDeposit = await prepareDeposit({
|
|
1390
|
-
* vaultName: "Amplify USDC Core",
|
|
1391
|
-
* depositAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
1392
|
-
* depositAmount: "1000.0",
|
|
1393
|
-
* to: "0x1234...",
|
|
1394
|
-
* chainId: 1,
|
|
1395
|
-
* });
|
|
1396
|
-
* // standardDeposit.method === DepositAuthMethod.APPROVAL
|
|
1397
|
-
*
|
|
1398
|
-
* // Submit transaction
|
|
1399
|
-
* await writeContract(standardDeposit.txData);
|
|
1400
|
-
* ```
|
|
1401
|
-
*/
|
|
1402
|
-
declare function prepareDeposit(params: PrepareDepositParams): Promise<PrepareDepositResult>;
|
|
1403
|
-
|
|
1404
|
-
declare const BoringVaultAbi: readonly [{
|
|
1405
|
-
readonly type: "constructor";
|
|
1406
|
-
readonly inputs: readonly [{
|
|
1407
|
-
readonly name: "_owner";
|
|
1408
|
-
readonly type: "address";
|
|
1409
|
-
readonly internalType: "address";
|
|
1410
|
-
}, {
|
|
1411
|
-
readonly name: "_name";
|
|
1412
|
-
readonly type: "string";
|
|
1413
|
-
readonly internalType: "string";
|
|
1414
|
-
}, {
|
|
1415
|
-
readonly name: "_symbol";
|
|
1416
|
-
readonly type: "string";
|
|
1417
|
-
readonly internalType: "string";
|
|
1418
|
-
}, {
|
|
1419
|
-
readonly name: "_decimals";
|
|
1420
|
-
readonly type: "uint8";
|
|
1421
|
-
readonly internalType: "uint8";
|
|
1422
|
-
}];
|
|
1423
|
-
readonly stateMutability: "nonpayable";
|
|
1424
|
-
}, {
|
|
1425
|
-
readonly type: "receive";
|
|
1426
|
-
readonly stateMutability: "payable";
|
|
1427
|
-
}, {
|
|
1428
|
-
readonly type: "function";
|
|
1429
|
-
readonly name: "DOMAIN_SEPARATOR";
|
|
1430
|
-
readonly inputs: readonly [];
|
|
1431
|
-
readonly outputs: readonly [{
|
|
1432
|
-
readonly name: "";
|
|
1433
|
-
readonly type: "bytes32";
|
|
1434
|
-
readonly internalType: "bytes32";
|
|
1435
|
-
}];
|
|
1436
|
-
readonly stateMutability: "view";
|
|
1437
|
-
}, {
|
|
1438
|
-
readonly type: "function";
|
|
1439
|
-
readonly name: "allowance";
|
|
1440
|
-
readonly inputs: readonly [{
|
|
1441
|
-
readonly name: "";
|
|
1442
|
-
readonly type: "address";
|
|
1443
|
-
readonly internalType: "address";
|
|
1444
|
-
}, {
|
|
1445
|
-
readonly name: "";
|
|
1446
|
-
readonly type: "address";
|
|
1447
|
-
readonly internalType: "address";
|
|
1448
|
-
}];
|
|
1449
|
-
readonly outputs: readonly [{
|
|
1450
|
-
readonly name: "";
|
|
1451
|
-
readonly type: "uint256";
|
|
1452
|
-
readonly internalType: "uint256";
|
|
1453
|
-
}];
|
|
1454
|
-
readonly stateMutability: "view";
|
|
1455
|
-
}, {
|
|
1456
|
-
readonly type: "function";
|
|
1457
|
-
readonly name: "approve";
|
|
1458
|
-
readonly inputs: readonly [{
|
|
1459
|
-
readonly name: "spender";
|
|
1460
|
-
readonly type: "address";
|
|
1461
|
-
readonly internalType: "address";
|
|
1462
|
-
}, {
|
|
1463
|
-
readonly name: "amount";
|
|
1464
|
-
readonly type: "uint256";
|
|
1465
|
-
readonly internalType: "uint256";
|
|
1466
|
-
}];
|
|
1467
|
-
readonly outputs: readonly [{
|
|
1468
|
-
readonly name: "";
|
|
1469
|
-
readonly type: "bool";
|
|
1470
|
-
readonly internalType: "bool";
|
|
1471
|
-
}];
|
|
1472
|
-
readonly stateMutability: "nonpayable";
|
|
1473
|
-
}, {
|
|
1474
|
-
readonly type: "function";
|
|
1475
|
-
readonly name: "authority";
|
|
1476
|
-
readonly inputs: readonly [];
|
|
1477
|
-
readonly outputs: readonly [{
|
|
1478
|
-
readonly name: "";
|
|
1479
|
-
readonly type: "address";
|
|
1480
|
-
readonly internalType: "contract Authority";
|
|
1481
|
-
}];
|
|
1482
|
-
readonly stateMutability: "view";
|
|
1483
|
-
}, {
|
|
1484
|
-
readonly type: "function";
|
|
1485
|
-
readonly name: "balanceOf";
|
|
1486
|
-
readonly inputs: readonly [{
|
|
1487
|
-
readonly name: "";
|
|
1488
|
-
readonly type: "address";
|
|
1489
|
-
readonly internalType: "address";
|
|
1490
|
-
}];
|
|
1491
|
-
readonly outputs: readonly [{
|
|
1492
|
-
readonly name: "";
|
|
1493
|
-
readonly type: "uint256";
|
|
1494
|
-
readonly internalType: "uint256";
|
|
1495
|
-
}];
|
|
1496
|
-
readonly stateMutability: "view";
|
|
1497
|
-
}, {
|
|
1498
|
-
readonly type: "function";
|
|
1499
|
-
readonly name: "decimals";
|
|
1500
|
-
readonly inputs: readonly [];
|
|
1501
|
-
readonly outputs: readonly [{
|
|
1502
|
-
readonly name: "";
|
|
1503
|
-
readonly type: "uint8";
|
|
1504
|
-
readonly internalType: "uint8";
|
|
1505
|
-
}];
|
|
1506
|
-
readonly stateMutability: "view";
|
|
1507
|
-
}, {
|
|
1508
|
-
readonly type: "function";
|
|
1509
|
-
readonly name: "enter";
|
|
1510
|
-
readonly inputs: readonly [{
|
|
1511
|
-
readonly name: "from";
|
|
1512
|
-
readonly type: "address";
|
|
1513
|
-
readonly internalType: "address";
|
|
1514
|
-
}, {
|
|
1515
|
-
readonly name: "asset";
|
|
1516
|
-
readonly type: "address";
|
|
1517
|
-
readonly internalType: "contract ERC20";
|
|
1518
|
-
}, {
|
|
1519
|
-
readonly name: "assetAmount";
|
|
1520
|
-
readonly type: "uint256";
|
|
1521
|
-
readonly internalType: "uint256";
|
|
1522
|
-
}, {
|
|
1523
|
-
readonly name: "to";
|
|
1524
|
-
readonly type: "address";
|
|
1525
|
-
readonly internalType: "address";
|
|
1526
|
-
}, {
|
|
1527
|
-
readonly name: "shareAmount";
|
|
1528
|
-
readonly type: "uint256";
|
|
1529
|
-
readonly internalType: "uint256";
|
|
1530
|
-
}];
|
|
1531
|
-
readonly outputs: readonly [];
|
|
1532
|
-
readonly stateMutability: "nonpayable";
|
|
1533
|
-
}, {
|
|
1534
|
-
readonly type: "function";
|
|
1535
|
-
readonly name: "exit";
|
|
1536
|
-
readonly inputs: readonly [{
|
|
1537
|
-
readonly name: "to";
|
|
1538
|
-
readonly type: "address";
|
|
1539
|
-
readonly internalType: "address";
|
|
1540
|
-
}, {
|
|
1541
|
-
readonly name: "asset";
|
|
1542
|
-
readonly type: "address";
|
|
1543
|
-
readonly internalType: "contract ERC20";
|
|
1544
|
-
}, {
|
|
1545
|
-
readonly name: "assetAmount";
|
|
1546
|
-
readonly type: "uint256";
|
|
1547
|
-
readonly internalType: "uint256";
|
|
1548
|
-
}, {
|
|
1549
|
-
readonly name: "from";
|
|
1550
|
-
readonly type: "address";
|
|
1551
|
-
readonly internalType: "address";
|
|
1552
|
-
}, {
|
|
1553
|
-
readonly name: "shareAmount";
|
|
1554
|
-
readonly type: "uint256";
|
|
1555
|
-
readonly internalType: "uint256";
|
|
1556
|
-
}];
|
|
1557
|
-
readonly outputs: readonly [];
|
|
1558
|
-
readonly stateMutability: "nonpayable";
|
|
1559
|
-
}, {
|
|
1560
|
-
readonly type: "function";
|
|
1561
|
-
readonly name: "hook";
|
|
1562
|
-
readonly inputs: readonly [];
|
|
1563
|
-
readonly outputs: readonly [{
|
|
1564
|
-
readonly name: "";
|
|
1565
|
-
readonly type: "address";
|
|
1566
|
-
readonly internalType: "contract BeforeTransferHook";
|
|
1567
|
-
}];
|
|
1568
|
-
readonly stateMutability: "view";
|
|
1569
|
-
}, {
|
|
1570
|
-
readonly type: "function";
|
|
1571
|
-
readonly name: "manage";
|
|
1572
|
-
readonly inputs: readonly [{
|
|
1573
|
-
readonly name: "targets";
|
|
1574
|
-
readonly type: "address[]";
|
|
1575
|
-
readonly internalType: "address[]";
|
|
1576
|
-
}, {
|
|
1577
|
-
readonly name: "data";
|
|
1578
|
-
readonly type: "bytes[]";
|
|
1579
|
-
readonly internalType: "bytes[]";
|
|
1580
|
-
}, {
|
|
1581
|
-
readonly name: "values";
|
|
1582
|
-
readonly type: "uint256[]";
|
|
1583
|
-
readonly internalType: "uint256[]";
|
|
1584
|
-
}];
|
|
1585
|
-
readonly outputs: readonly [{
|
|
1586
|
-
readonly name: "results";
|
|
1587
|
-
readonly type: "bytes[]";
|
|
1588
|
-
readonly internalType: "bytes[]";
|
|
1589
|
-
}];
|
|
1590
|
-
readonly stateMutability: "nonpayable";
|
|
1591
|
-
}, {
|
|
1592
|
-
readonly type: "function";
|
|
1593
|
-
readonly name: "manage";
|
|
1594
|
-
readonly inputs: readonly [{
|
|
1595
|
-
readonly name: "target";
|
|
1596
|
-
readonly type: "address";
|
|
1597
|
-
readonly internalType: "address";
|
|
1598
|
-
}, {
|
|
1599
|
-
readonly name: "data";
|
|
1600
|
-
readonly type: "bytes";
|
|
1601
|
-
readonly internalType: "bytes";
|
|
1602
|
-
}, {
|
|
1603
|
-
readonly name: "value";
|
|
1604
|
-
readonly type: "uint256";
|
|
1605
|
-
readonly internalType: "uint256";
|
|
1606
|
-
}];
|
|
1607
|
-
readonly outputs: readonly [{
|
|
1608
|
-
readonly name: "result";
|
|
1609
|
-
readonly type: "bytes";
|
|
1610
|
-
readonly internalType: "bytes";
|
|
1611
|
-
}];
|
|
1612
|
-
readonly stateMutability: "nonpayable";
|
|
1613
|
-
}, {
|
|
1614
|
-
readonly type: "function";
|
|
1615
|
-
readonly name: "name";
|
|
1616
|
-
readonly inputs: readonly [];
|
|
1617
|
-
readonly outputs: readonly [{
|
|
1618
|
-
readonly name: "";
|
|
1619
|
-
readonly type: "string";
|
|
1620
|
-
readonly internalType: "string";
|
|
1621
|
-
}];
|
|
1622
|
-
readonly stateMutability: "view";
|
|
1623
|
-
}, {
|
|
1624
|
-
readonly type: "function";
|
|
1625
|
-
readonly name: "nonces";
|
|
1626
|
-
readonly inputs: readonly [{
|
|
1627
|
-
readonly name: "";
|
|
1628
|
-
readonly type: "address";
|
|
1629
|
-
readonly internalType: "address";
|
|
1630
|
-
}];
|
|
1631
|
-
readonly outputs: readonly [{
|
|
1632
|
-
readonly name: "";
|
|
1633
|
-
readonly type: "uint256";
|
|
1634
|
-
readonly internalType: "uint256";
|
|
1635
|
-
}];
|
|
1636
|
-
readonly stateMutability: "view";
|
|
1637
|
-
}, {
|
|
1638
|
-
readonly type: "function";
|
|
1639
|
-
readonly name: "onERC1155BatchReceived";
|
|
1640
|
-
readonly inputs: readonly [{
|
|
1641
|
-
readonly name: "";
|
|
1642
|
-
readonly type: "address";
|
|
1643
|
-
readonly internalType: "address";
|
|
1644
|
-
}, {
|
|
1645
|
-
readonly name: "";
|
|
1646
|
-
readonly type: "address";
|
|
1647
|
-
readonly internalType: "address";
|
|
1648
|
-
}, {
|
|
1649
|
-
readonly name: "";
|
|
1650
|
-
readonly type: "uint256[]";
|
|
1651
|
-
readonly internalType: "uint256[]";
|
|
1652
|
-
}, {
|
|
1653
|
-
readonly name: "";
|
|
1654
|
-
readonly type: "uint256[]";
|
|
1655
|
-
readonly internalType: "uint256[]";
|
|
1656
|
-
}, {
|
|
1657
|
-
readonly name: "";
|
|
1658
|
-
readonly type: "bytes";
|
|
1659
|
-
readonly internalType: "bytes";
|
|
1660
|
-
}];
|
|
1661
|
-
readonly outputs: readonly [{
|
|
1662
|
-
readonly name: "";
|
|
1663
|
-
readonly type: "bytes4";
|
|
1664
|
-
readonly internalType: "bytes4";
|
|
1665
|
-
}];
|
|
1666
|
-
readonly stateMutability: "nonpayable";
|
|
1667
|
-
}, {
|
|
1668
|
-
readonly type: "function";
|
|
1669
|
-
readonly name: "onERC1155Received";
|
|
1670
|
-
readonly inputs: readonly [{
|
|
1671
|
-
readonly name: "";
|
|
1672
|
-
readonly type: "address";
|
|
1673
|
-
readonly internalType: "address";
|
|
1674
|
-
}, {
|
|
1675
|
-
readonly name: "";
|
|
1676
|
-
readonly type: "address";
|
|
1677
|
-
readonly internalType: "address";
|
|
1678
|
-
}, {
|
|
1679
|
-
readonly name: "";
|
|
1680
|
-
readonly type: "uint256";
|
|
1681
|
-
readonly internalType: "uint256";
|
|
1682
|
-
}, {
|
|
1683
|
-
readonly name: "";
|
|
1684
|
-
readonly type: "uint256";
|
|
1685
|
-
readonly internalType: "uint256";
|
|
1686
|
-
}, {
|
|
1687
|
-
readonly name: "";
|
|
1688
|
-
readonly type: "bytes";
|
|
1689
|
-
readonly internalType: "bytes";
|
|
1690
|
-
}];
|
|
1691
|
-
readonly outputs: readonly [{
|
|
1692
|
-
readonly name: "";
|
|
1693
|
-
readonly type: "bytes4";
|
|
1694
|
-
readonly internalType: "bytes4";
|
|
1695
|
-
}];
|
|
1696
|
-
readonly stateMutability: "nonpayable";
|
|
1697
|
-
}, {
|
|
1698
|
-
readonly type: "function";
|
|
1699
|
-
readonly name: "onERC721Received";
|
|
1700
|
-
readonly inputs: readonly [{
|
|
1701
|
-
readonly name: "";
|
|
1702
|
-
readonly type: "address";
|
|
1703
|
-
readonly internalType: "address";
|
|
1704
|
-
}, {
|
|
1705
|
-
readonly name: "";
|
|
1706
|
-
readonly type: "address";
|
|
1707
|
-
readonly internalType: "address";
|
|
1708
|
-
}, {
|
|
1709
|
-
readonly name: "";
|
|
1710
|
-
readonly type: "uint256";
|
|
1711
|
-
readonly internalType: "uint256";
|
|
1712
|
-
}, {
|
|
1713
|
-
readonly name: "";
|
|
1714
|
-
readonly type: "bytes";
|
|
1715
|
-
readonly internalType: "bytes";
|
|
1716
|
-
}];
|
|
1717
|
-
readonly outputs: readonly [{
|
|
1718
|
-
readonly name: "";
|
|
1719
|
-
readonly type: "bytes4";
|
|
1720
|
-
readonly internalType: "bytes4";
|
|
1721
|
-
}];
|
|
1722
|
-
readonly stateMutability: "nonpayable";
|
|
1723
|
-
}, {
|
|
1724
|
-
readonly type: "function";
|
|
1725
|
-
readonly name: "owner";
|
|
1726
|
-
readonly inputs: readonly [];
|
|
1727
|
-
readonly outputs: readonly [{
|
|
1728
|
-
readonly name: "";
|
|
1729
|
-
readonly type: "address";
|
|
1730
|
-
readonly internalType: "address";
|
|
1731
|
-
}];
|
|
1732
|
-
readonly stateMutability: "view";
|
|
1733
|
-
}, {
|
|
1734
|
-
readonly type: "function";
|
|
1735
|
-
readonly name: "permit";
|
|
1736
|
-
readonly inputs: readonly [{
|
|
1737
|
-
readonly name: "owner";
|
|
1738
|
-
readonly type: "address";
|
|
1739
|
-
readonly internalType: "address";
|
|
1740
|
-
}, {
|
|
1741
|
-
readonly name: "spender";
|
|
1742
|
-
readonly type: "address";
|
|
1743
|
-
readonly internalType: "address";
|
|
1744
|
-
}, {
|
|
1745
|
-
readonly name: "value";
|
|
1746
|
-
readonly type: "uint256";
|
|
1747
|
-
readonly internalType: "uint256";
|
|
1748
|
-
}, {
|
|
1749
|
-
readonly name: "deadline";
|
|
1750
|
-
readonly type: "uint256";
|
|
1751
|
-
readonly internalType: "uint256";
|
|
1752
|
-
}, {
|
|
1753
|
-
readonly name: "v";
|
|
1754
|
-
readonly type: "uint8";
|
|
1755
|
-
readonly internalType: "uint8";
|
|
1756
|
-
}, {
|
|
1757
|
-
readonly name: "r";
|
|
1758
|
-
readonly type: "bytes32";
|
|
1759
|
-
readonly internalType: "bytes32";
|
|
1760
|
-
}, {
|
|
1761
|
-
readonly name: "s";
|
|
1762
|
-
readonly type: "bytes32";
|
|
1763
|
-
readonly internalType: "bytes32";
|
|
1764
|
-
}];
|
|
1765
|
-
readonly outputs: readonly [];
|
|
1766
|
-
readonly stateMutability: "nonpayable";
|
|
1767
|
-
}, {
|
|
1768
|
-
readonly type: "function";
|
|
1769
|
-
readonly name: "setAuthority";
|
|
1770
|
-
readonly inputs: readonly [{
|
|
1771
|
-
readonly name: "newAuthority";
|
|
1772
|
-
readonly type: "address";
|
|
1773
|
-
readonly internalType: "contract Authority";
|
|
1774
|
-
}];
|
|
1775
|
-
readonly outputs: readonly [];
|
|
1776
|
-
readonly stateMutability: "nonpayable";
|
|
1777
|
-
}, {
|
|
1778
|
-
readonly type: "function";
|
|
1779
|
-
readonly name: "setBeforeTransferHook";
|
|
1780
|
-
readonly inputs: readonly [{
|
|
1781
|
-
readonly name: "_hook";
|
|
1782
|
-
readonly type: "address";
|
|
1783
|
-
readonly internalType: "address";
|
|
1784
|
-
}];
|
|
1785
|
-
readonly outputs: readonly [];
|
|
1786
|
-
readonly stateMutability: "nonpayable";
|
|
1787
|
-
}, {
|
|
1788
|
-
readonly type: "function";
|
|
1789
|
-
readonly name: "supportsInterface";
|
|
1790
|
-
readonly inputs: readonly [{
|
|
1791
|
-
readonly name: "interfaceId";
|
|
1792
|
-
readonly type: "bytes4";
|
|
1793
|
-
readonly internalType: "bytes4";
|
|
1794
|
-
}];
|
|
1795
|
-
readonly outputs: readonly [{
|
|
1796
|
-
readonly name: "";
|
|
1797
|
-
readonly type: "bool";
|
|
1798
|
-
readonly internalType: "bool";
|
|
1799
|
-
}];
|
|
1800
|
-
readonly stateMutability: "view";
|
|
1801
|
-
}, {
|
|
1802
|
-
readonly type: "function";
|
|
1803
|
-
readonly name: "symbol";
|
|
1804
|
-
readonly inputs: readonly [];
|
|
1805
|
-
readonly outputs: readonly [{
|
|
1806
|
-
readonly name: "";
|
|
1807
|
-
readonly type: "string";
|
|
1808
|
-
readonly internalType: "string";
|
|
1809
|
-
}];
|
|
1810
|
-
readonly stateMutability: "view";
|
|
1811
|
-
}, {
|
|
1812
|
-
readonly type: "function";
|
|
1813
|
-
readonly name: "totalSupply";
|
|
1814
|
-
readonly inputs: readonly [];
|
|
1815
|
-
readonly outputs: readonly [{
|
|
1816
|
-
readonly name: "";
|
|
1817
|
-
readonly type: "uint256";
|
|
1818
|
-
readonly internalType: "uint256";
|
|
1819
|
-
}];
|
|
1820
|
-
readonly stateMutability: "view";
|
|
1821
|
-
}, {
|
|
1822
|
-
readonly type: "function";
|
|
1823
|
-
readonly name: "transfer";
|
|
1824
|
-
readonly inputs: readonly [{
|
|
1825
|
-
readonly name: "to";
|
|
1826
|
-
readonly type: "address";
|
|
1827
|
-
readonly internalType: "address";
|
|
1828
|
-
}, {
|
|
1829
|
-
readonly name: "amount";
|
|
1830
|
-
readonly type: "uint256";
|
|
1831
|
-
readonly internalType: "uint256";
|
|
1832
|
-
}];
|
|
1833
|
-
readonly outputs: readonly [{
|
|
1834
|
-
readonly name: "";
|
|
1835
|
-
readonly type: "bool";
|
|
1836
|
-
readonly internalType: "bool";
|
|
1837
|
-
}];
|
|
1838
|
-
readonly stateMutability: "nonpayable";
|
|
1839
|
-
}, {
|
|
1840
|
-
readonly type: "function";
|
|
1841
|
-
readonly name: "transferFrom";
|
|
1842
|
-
readonly inputs: readonly [{
|
|
1843
|
-
readonly name: "from";
|
|
1844
|
-
readonly type: "address";
|
|
1845
|
-
readonly internalType: "address";
|
|
1846
|
-
}, {
|
|
1847
|
-
readonly name: "to";
|
|
1848
|
-
readonly type: "address";
|
|
1849
|
-
readonly internalType: "address";
|
|
1850
|
-
}, {
|
|
1851
|
-
readonly name: "amount";
|
|
1852
|
-
readonly type: "uint256";
|
|
1853
|
-
readonly internalType: "uint256";
|
|
1854
|
-
}];
|
|
1855
|
-
readonly outputs: readonly [{
|
|
1856
|
-
readonly name: "";
|
|
1857
|
-
readonly type: "bool";
|
|
1858
|
-
readonly internalType: "bool";
|
|
1859
|
-
}];
|
|
1860
|
-
readonly stateMutability: "nonpayable";
|
|
1861
|
-
}, {
|
|
1862
|
-
readonly type: "function";
|
|
1863
|
-
readonly name: "transferOwnership";
|
|
1864
|
-
readonly inputs: readonly [{
|
|
1865
|
-
readonly name: "newOwner";
|
|
1866
|
-
readonly type: "address";
|
|
1867
|
-
readonly internalType: "address";
|
|
1868
|
-
}];
|
|
1869
|
-
readonly outputs: readonly [];
|
|
1870
|
-
readonly stateMutability: "nonpayable";
|
|
1871
|
-
}, {
|
|
1872
|
-
readonly type: "event";
|
|
1873
|
-
readonly name: "Approval";
|
|
1874
|
-
readonly inputs: readonly [{
|
|
1875
|
-
readonly name: "owner";
|
|
1876
|
-
readonly type: "address";
|
|
1877
|
-
readonly indexed: true;
|
|
1878
|
-
readonly internalType: "address";
|
|
1879
|
-
}, {
|
|
1880
|
-
readonly name: "spender";
|
|
1881
|
-
readonly type: "address";
|
|
1882
|
-
readonly indexed: true;
|
|
1883
|
-
readonly internalType: "address";
|
|
1884
|
-
}, {
|
|
1885
|
-
readonly name: "amount";
|
|
1886
|
-
readonly type: "uint256";
|
|
1887
|
-
readonly indexed: false;
|
|
1888
|
-
readonly internalType: "uint256";
|
|
1889
|
-
}];
|
|
1890
|
-
readonly anonymous: false;
|
|
1891
|
-
}, {
|
|
1892
|
-
readonly type: "event";
|
|
1893
|
-
readonly name: "AuthorityUpdated";
|
|
1894
|
-
readonly inputs: readonly [{
|
|
1895
|
-
readonly name: "user";
|
|
1896
|
-
readonly type: "address";
|
|
1897
|
-
readonly indexed: true;
|
|
1898
|
-
readonly internalType: "address";
|
|
1899
|
-
}, {
|
|
1900
|
-
readonly name: "newAuthority";
|
|
1901
|
-
readonly type: "address";
|
|
1902
|
-
readonly indexed: true;
|
|
1903
|
-
readonly internalType: "contract Authority";
|
|
1904
|
-
}];
|
|
1905
|
-
readonly anonymous: false;
|
|
1906
|
-
}, {
|
|
1907
|
-
readonly type: "event";
|
|
1908
|
-
readonly name: "Enter";
|
|
1909
|
-
readonly inputs: readonly [{
|
|
1910
|
-
readonly name: "from";
|
|
1911
|
-
readonly type: "address";
|
|
1912
|
-
readonly indexed: true;
|
|
1913
|
-
readonly internalType: "address";
|
|
1914
|
-
}, {
|
|
1915
|
-
readonly name: "asset";
|
|
1916
|
-
readonly type: "address";
|
|
1917
|
-
readonly indexed: true;
|
|
1918
|
-
readonly internalType: "address";
|
|
1919
|
-
}, {
|
|
1920
|
-
readonly name: "amount";
|
|
1921
|
-
readonly type: "uint256";
|
|
1922
|
-
readonly indexed: false;
|
|
1923
|
-
readonly internalType: "uint256";
|
|
1924
|
-
}, {
|
|
1925
|
-
readonly name: "to";
|
|
1926
|
-
readonly type: "address";
|
|
1927
|
-
readonly indexed: true;
|
|
1928
|
-
readonly internalType: "address";
|
|
1929
|
-
}, {
|
|
1930
|
-
readonly name: "shares";
|
|
1931
|
-
readonly type: "uint256";
|
|
1932
|
-
readonly indexed: false;
|
|
1933
|
-
readonly internalType: "uint256";
|
|
1934
|
-
}];
|
|
1935
|
-
readonly anonymous: false;
|
|
1936
|
-
}, {
|
|
1937
|
-
readonly type: "event";
|
|
1938
|
-
readonly name: "Exit";
|
|
1939
|
-
readonly inputs: readonly [{
|
|
1940
|
-
readonly name: "to";
|
|
1941
|
-
readonly type: "address";
|
|
1942
|
-
readonly indexed: true;
|
|
1943
|
-
readonly internalType: "address";
|
|
1944
|
-
}, {
|
|
1945
|
-
readonly name: "asset";
|
|
1946
|
-
readonly type: "address";
|
|
1947
|
-
readonly indexed: true;
|
|
1948
|
-
readonly internalType: "address";
|
|
1949
|
-
}, {
|
|
1950
|
-
readonly name: "amount";
|
|
1951
|
-
readonly type: "uint256";
|
|
1952
|
-
readonly indexed: false;
|
|
1953
|
-
readonly internalType: "uint256";
|
|
1954
|
-
}, {
|
|
1955
|
-
readonly name: "from";
|
|
1956
|
-
readonly type: "address";
|
|
1957
|
-
readonly indexed: true;
|
|
1958
|
-
readonly internalType: "address";
|
|
1959
|
-
}, {
|
|
1960
|
-
readonly name: "shares";
|
|
1961
|
-
readonly type: "uint256";
|
|
1962
|
-
readonly indexed: false;
|
|
1963
|
-
readonly internalType: "uint256";
|
|
1964
|
-
}];
|
|
1965
|
-
readonly anonymous: false;
|
|
1966
|
-
}, {
|
|
1967
|
-
readonly type: "event";
|
|
1968
|
-
readonly name: "OwnershipTransferred";
|
|
1969
|
-
readonly inputs: readonly [{
|
|
1970
|
-
readonly name: "user";
|
|
1971
|
-
readonly type: "address";
|
|
1972
|
-
readonly indexed: true;
|
|
1973
|
-
readonly internalType: "address";
|
|
1974
|
-
}, {
|
|
1975
|
-
readonly name: "newOwner";
|
|
1976
|
-
readonly type: "address";
|
|
1977
|
-
readonly indexed: true;
|
|
1978
|
-
readonly internalType: "address";
|
|
1979
|
-
}];
|
|
1980
|
-
readonly anonymous: false;
|
|
1981
|
-
}, {
|
|
1982
|
-
readonly type: "event";
|
|
1983
|
-
readonly name: "Transfer";
|
|
1984
|
-
readonly inputs: readonly [{
|
|
1985
|
-
readonly name: "from";
|
|
1986
|
-
readonly type: "address";
|
|
1987
|
-
readonly indexed: true;
|
|
1988
|
-
readonly internalType: "address";
|
|
1989
|
-
}, {
|
|
1990
|
-
readonly name: "to";
|
|
1991
|
-
readonly type: "address";
|
|
1992
|
-
readonly indexed: true;
|
|
1993
|
-
readonly internalType: "address";
|
|
1994
|
-
}, {
|
|
1995
|
-
readonly name: "amount";
|
|
1996
|
-
readonly type: "uint256";
|
|
1997
|
-
readonly indexed: false;
|
|
1998
|
-
readonly internalType: "uint256";
|
|
1999
|
-
}];
|
|
2000
|
-
readonly anonymous: false;
|
|
2001
|
-
}, {
|
|
2002
|
-
readonly type: "error";
|
|
2003
|
-
readonly name: "AddressEmptyCode";
|
|
2004
|
-
readonly inputs: readonly [{
|
|
2005
|
-
readonly name: "target";
|
|
2006
|
-
readonly type: "address";
|
|
2007
|
-
readonly internalType: "address";
|
|
2008
|
-
}];
|
|
2009
|
-
}, {
|
|
2010
|
-
readonly type: "error";
|
|
2011
|
-
readonly name: "AddressInsufficientBalance";
|
|
2012
|
-
readonly inputs: readonly [{
|
|
2013
|
-
readonly name: "account";
|
|
2014
|
-
readonly type: "address";
|
|
2015
|
-
readonly internalType: "address";
|
|
2016
|
-
}];
|
|
2017
|
-
}, {
|
|
2018
|
-
readonly type: "error";
|
|
2019
|
-
readonly name: "FailedInnerCall";
|
|
2020
|
-
readonly inputs: readonly [];
|
|
2021
|
-
}];
|
|
2022
|
-
|
|
2023
|
-
/**
|
|
2024
|
-
* Parameters required for preparing a vault-share approval transaction
|
|
2025
|
-
*
|
|
2026
|
-
* @interface PrepareApproveWithdrawOrderTxDataParams
|
|
2027
|
-
* @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
|
|
2028
|
-
* @property {Address} wantAssetAddress - Address of the want token. Must match the vault's supported asset.
|
|
2029
|
-
* @property {string} [withdrawAmount] - Optional amount to approve as a decimal string (defaults to maximum approval)
|
|
2030
|
-
* @property {ChainId} chainId - ID of the chain where the vault is deployed. Must match the vault's chain.
|
|
2031
|
-
* @property {number} [shareDecimals] - Optional: Pre-fetched vault share decimals (avoids redundant RPC call)
|
|
2032
|
-
*/
|
|
2033
|
-
interface PrepareApproveWithdrawOrderTxDataParams {
|
|
2034
|
-
vaultName: string;
|
|
2035
|
-
wantAssetAddress: Address;
|
|
2036
|
-
withdrawAmount?: string;
|
|
2037
|
-
chainId: ChainId;
|
|
2038
|
-
/** Pre-fetched vault share decimals (avoids redundant RPC call) */
|
|
2039
|
-
shareDecimals?: number;
|
|
2040
|
-
}
|
|
2041
|
-
/**
|
|
2042
|
-
* Result object containing transaction data for a vault shares approval operation (vault shares token)
|
|
2043
|
-
* @interface ApproveWithdrawOrderTxData
|
|
2044
|
-
* @property {typeof BoringVaultAbi} abi - ABI for the BoringVault contract (vault shares token)
|
|
2045
|
-
* @property {Address} address - Address of the BoringVault (vault shares token)
|
|
2046
|
-
* @property {'approve'} functionName - Name of the function to call
|
|
2047
|
-
* @property {[Address, bigint]} args - Arguments for the approve function:
|
|
2048
|
-
* [spender (WithdrawQueue address), amount]
|
|
2049
|
-
*/
|
|
2050
|
-
interface ApproveWithdrawOrderTxData {
|
|
2051
|
-
abi: typeof BoringVaultAbi;
|
|
2052
|
-
address: Address;
|
|
2053
|
-
functionName: "approve";
|
|
2054
|
-
args: [Address, bigint];
|
|
2055
|
-
}
|
|
2056
|
-
/**
|
|
2057
|
-
* Prepares the transaction data needed to approve vault shares for the WithdrawQueue contract
|
|
2058
|
-
*
|
|
2059
|
-
* The vault is resolved and validated against `vaultName`, `chainId`, and `wantAssetAddress`
|
|
2060
|
-
* before any calldata is constructed.
|
|
2061
|
-
*
|
|
2062
|
-
* @example
|
|
2063
|
-
* ```typescript
|
|
2064
|
-
* const approveData = await prepareApproveWithdrawOrderTxData({
|
|
2065
|
-
* vaultName: "Amplify USDC Core",
|
|
2066
|
-
* wantAssetAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
|
|
2067
|
-
* withdrawAmount: "10.0", // Approve 10 vault shares
|
|
2068
|
-
* chainId: 1,
|
|
2069
|
-
* });
|
|
2070
|
-
* ```
|
|
2071
|
-
*
|
|
2072
|
-
* @param {PrepareApproveWithdrawOrderTxDataParams} params - Parameters for the approval operation
|
|
2073
|
-
* @param {string} params.vaultName - Human-readable vault name
|
|
2074
|
-
* @param {Address} params.wantAssetAddress - Address of the want token
|
|
2075
|
-
* @param {string} [params.withdrawAmount] - Optional amount to approve as a decimal string (defaults to maximum approval)
|
|
2076
|
-
* @param {ChainId} params.chainId - ID of the chain where the vault is deployed
|
|
2077
|
-
*
|
|
2078
|
-
* @returns {Promise<ApproveWithdrawOrderTxData>} Promise resolving to the prepared transaction data
|
|
2079
|
-
* @throws {APIError} If vault not found, chain/asset mismatch, or contracts not configured
|
|
2080
|
-
*/
|
|
2081
|
-
declare function prepareApproveWithdrawOrderTxData({ vaultName, wantAssetAddress, withdrawAmount, chainId, shareDecimals, }: PrepareApproveWithdrawOrderTxDataParams): Promise<ApproveWithdrawOrderTxData>;
|
|
2082
|
-
|
|
2083
|
-
declare const WithdrawQueueAbi: readonly [{
|
|
2084
|
-
readonly inputs: readonly [{
|
|
2085
|
-
readonly internalType: "string";
|
|
2086
|
-
readonly name: "_name";
|
|
2087
|
-
readonly type: "string";
|
|
2088
|
-
}, {
|
|
2089
|
-
readonly internalType: "string";
|
|
2090
|
-
readonly name: "_symbol";
|
|
2091
|
-
readonly type: "string";
|
|
2092
|
-
}, {
|
|
2093
|
-
readonly internalType: "address";
|
|
2094
|
-
readonly name: "_feeRecipient";
|
|
2095
|
-
readonly type: "address";
|
|
2096
|
-
}, {
|
|
2097
|
-
readonly internalType: "contract TellerWithMultiAssetSupport";
|
|
2098
|
-
readonly name: "_tellerWithMultiAssetSupport";
|
|
2099
|
-
readonly type: "address";
|
|
2100
|
-
}, {
|
|
2101
|
-
readonly internalType: "contract IFeeModule";
|
|
2102
|
-
readonly name: "_feeModule";
|
|
2103
|
-
readonly type: "address";
|
|
2104
|
-
}, {
|
|
2105
|
-
readonly internalType: "uint256";
|
|
2106
|
-
readonly name: "_minimumOrderSize";
|
|
2107
|
-
readonly type: "uint256";
|
|
2108
|
-
}, {
|
|
2109
|
-
readonly internalType: "address";
|
|
2110
|
-
readonly name: "_owner";
|
|
2111
|
-
readonly type: "address";
|
|
2112
|
-
}];
|
|
2113
|
-
readonly stateMutability: "nonpayable";
|
|
2114
|
-
readonly type: "constructor";
|
|
2115
|
-
}, {
|
|
2116
|
-
readonly inputs: readonly [];
|
|
2117
|
-
readonly name: "ECDSAInvalidSignature";
|
|
2118
|
-
readonly type: "error";
|
|
2119
|
-
}, {
|
|
2120
|
-
readonly inputs: readonly [{
|
|
2121
|
-
readonly internalType: "uint256";
|
|
2122
|
-
readonly name: "length";
|
|
2123
|
-
readonly type: "uint256";
|
|
2124
|
-
}];
|
|
2125
|
-
readonly name: "ECDSAInvalidSignatureLength";
|
|
2126
|
-
readonly type: "error";
|
|
2127
|
-
}, {
|
|
2128
|
-
readonly inputs: readonly [{
|
|
2129
|
-
readonly internalType: "bytes32";
|
|
2130
|
-
readonly name: "s";
|
|
2131
|
-
readonly type: "bytes32";
|
|
2132
|
-
}];
|
|
2133
|
-
readonly name: "ECDSAInvalidSignatureS";
|
|
2134
|
-
readonly type: "error";
|
|
2135
|
-
}, {
|
|
2136
|
-
readonly inputs: readonly [];
|
|
2137
|
-
readonly name: "ERC721EnumerableForbiddenBatchMint";
|
|
2138
|
-
readonly type: "error";
|
|
2139
|
-
}, {
|
|
2140
|
-
readonly inputs: readonly [{
|
|
2141
|
-
readonly internalType: "address";
|
|
2142
|
-
readonly name: "sender";
|
|
2143
|
-
readonly type: "address";
|
|
2144
|
-
}, {
|
|
2145
|
-
readonly internalType: "uint256";
|
|
2146
|
-
readonly name: "tokenId";
|
|
2147
|
-
readonly type: "uint256";
|
|
2148
|
-
}, {
|
|
2149
|
-
readonly internalType: "address";
|
|
2150
|
-
readonly name: "owner";
|
|
2151
|
-
readonly type: "address";
|
|
2152
|
-
}];
|
|
2153
|
-
readonly name: "ERC721IncorrectOwner";
|
|
2154
|
-
readonly type: "error";
|
|
2155
|
-
}, {
|
|
2156
|
-
readonly inputs: readonly [{
|
|
2157
|
-
readonly internalType: "address";
|
|
2158
|
-
readonly name: "operator";
|
|
2159
|
-
readonly type: "address";
|
|
2160
|
-
}, {
|
|
2161
|
-
readonly internalType: "uint256";
|
|
2162
|
-
readonly name: "tokenId";
|
|
2163
|
-
readonly type: "uint256";
|
|
2164
|
-
}];
|
|
2165
|
-
readonly name: "ERC721InsufficientApproval";
|
|
2166
|
-
readonly type: "error";
|
|
2167
|
-
}, {
|
|
2168
|
-
readonly inputs: readonly [{
|
|
2169
|
-
readonly internalType: "address";
|
|
2170
|
-
readonly name: "approver";
|
|
2171
|
-
readonly type: "address";
|
|
2172
|
-
}];
|
|
2173
|
-
readonly name: "ERC721InvalidApprover";
|
|
2174
|
-
readonly type: "error";
|
|
2175
|
-
}, {
|
|
2176
|
-
readonly inputs: readonly [{
|
|
2177
|
-
readonly internalType: "address";
|
|
2178
|
-
readonly name: "operator";
|
|
2179
|
-
readonly type: "address";
|
|
2180
|
-
}];
|
|
2181
|
-
readonly name: "ERC721InvalidOperator";
|
|
2182
|
-
readonly type: "error";
|
|
2183
|
-
}, {
|
|
2184
|
-
readonly inputs: readonly [{
|
|
2185
|
-
readonly internalType: "address";
|
|
2186
|
-
readonly name: "owner";
|
|
2187
|
-
readonly type: "address";
|
|
2188
|
-
}];
|
|
2189
|
-
readonly name: "ERC721InvalidOwner";
|
|
2190
|
-
readonly type: "error";
|
|
2191
|
-
}, {
|
|
2192
|
-
readonly inputs: readonly [{
|
|
2193
|
-
readonly internalType: "address";
|
|
2194
|
-
readonly name: "receiver";
|
|
2195
|
-
readonly type: "address";
|
|
2196
|
-
}];
|
|
2197
|
-
readonly name: "ERC721InvalidReceiver";
|
|
2198
|
-
readonly type: "error";
|
|
2199
|
-
}, {
|
|
2200
|
-
readonly inputs: readonly [{
|
|
2201
|
-
readonly internalType: "address";
|
|
2202
|
-
readonly name: "sender";
|
|
2203
|
-
readonly type: "address";
|
|
2204
|
-
}];
|
|
2205
|
-
readonly name: "ERC721InvalidSender";
|
|
2206
|
-
readonly type: "error";
|
|
2207
|
-
}, {
|
|
2208
|
-
readonly inputs: readonly [{
|
|
2209
|
-
readonly internalType: "uint256";
|
|
2210
|
-
readonly name: "tokenId";
|
|
2211
|
-
readonly type: "uint256";
|
|
2212
|
-
}];
|
|
2213
|
-
readonly name: "ERC721NonexistentToken";
|
|
2214
|
-
readonly type: "error";
|
|
2215
|
-
}, {
|
|
2216
|
-
readonly inputs: readonly [{
|
|
2217
|
-
readonly internalType: "address";
|
|
2218
|
-
readonly name: "owner";
|
|
2219
|
-
readonly type: "address";
|
|
2220
|
-
}, {
|
|
2221
|
-
readonly internalType: "uint256";
|
|
2222
|
-
readonly name: "index";
|
|
2223
|
-
readonly type: "uint256";
|
|
2224
|
-
}];
|
|
2225
|
-
readonly name: "ERC721OutOfBoundsIndex";
|
|
2226
|
-
readonly type: "error";
|
|
2227
|
-
}, {
|
|
2228
|
-
readonly inputs: readonly [{
|
|
2229
|
-
readonly internalType: "address";
|
|
2230
|
-
readonly name: "token";
|
|
2231
|
-
readonly type: "address";
|
|
2232
|
-
}];
|
|
2233
|
-
readonly name: "SafeERC20FailedOperation";
|
|
2234
|
-
readonly type: "error";
|
|
2235
|
-
}, {
|
|
2236
|
-
readonly inputs: readonly [];
|
|
2237
|
-
readonly name: "Unauthorized";
|
|
2238
|
-
readonly type: "error";
|
|
2239
|
-
}, {
|
|
2240
|
-
readonly inputs: readonly [];
|
|
2241
|
-
readonly name: "ZeroAddress";
|
|
2242
|
-
readonly type: "error";
|
|
2243
|
-
}, {
|
|
2244
|
-
readonly inputs: readonly [{
|
|
2245
|
-
readonly internalType: "uint256";
|
|
2246
|
-
readonly name: "orderIndex";
|
|
2247
|
-
readonly type: "uint256";
|
|
2248
|
-
}];
|
|
2249
|
-
readonly name: "OrderAlreadyProcessed";
|
|
2250
|
-
readonly type: "error";
|
|
2251
|
-
}, {
|
|
2252
|
-
readonly inputs: readonly [{
|
|
2253
|
-
readonly internalType: "uint256";
|
|
2254
|
-
readonly name: "orderIndex";
|
|
2255
|
-
readonly type: "uint256";
|
|
2256
|
-
}, {
|
|
2257
|
-
readonly internalType: "enum WithdrawQueue.OrderType";
|
|
2258
|
-
readonly name: "currentStatus";
|
|
2259
|
-
readonly type: "uint8";
|
|
2260
|
-
}];
|
|
2261
|
-
readonly name: "InvalidOrderType";
|
|
2262
|
-
readonly type: "error";
|
|
2263
|
-
}, {
|
|
2264
|
-
readonly inputs: readonly [{
|
|
2265
|
-
readonly internalType: "uint256";
|
|
2266
|
-
readonly name: "orderIndex";
|
|
2267
|
-
readonly type: "uint256";
|
|
2268
|
-
}];
|
|
2269
|
-
readonly name: "InvalidOrderIndex";
|
|
2270
|
-
readonly type: "error";
|
|
2271
|
-
}, {
|
|
2272
|
-
readonly inputs: readonly [{
|
|
2273
|
-
readonly internalType: "uint256";
|
|
2274
|
-
readonly name: "amount";
|
|
2275
|
-
readonly type: "uint256";
|
|
2276
|
-
}, {
|
|
2277
|
-
readonly internalType: "uint256";
|
|
2278
|
-
readonly name: "minimum";
|
|
2279
|
-
readonly type: "uint256";
|
|
2280
|
-
}];
|
|
2281
|
-
readonly name: "AmountBelowMinimum";
|
|
2282
|
-
readonly type: "error";
|
|
2283
|
-
}, {
|
|
2284
|
-
readonly inputs: readonly [{
|
|
2285
|
-
readonly internalType: "uint256";
|
|
2286
|
-
readonly name: "deadline";
|
|
2287
|
-
readonly type: "uint256";
|
|
2288
|
-
}, {
|
|
2289
|
-
readonly internalType: "uint256";
|
|
2290
|
-
readonly name: "currentTimestamp";
|
|
2291
|
-
readonly type: "uint256";
|
|
2292
|
-
}];
|
|
2293
|
-
readonly name: "SignatureExpired";
|
|
2294
|
-
readonly type: "error";
|
|
2295
|
-
}, {
|
|
2296
|
-
readonly inputs: readonly [{
|
|
2297
|
-
readonly internalType: "uint256";
|
|
2298
|
-
readonly name: "ordersToProcess";
|
|
2299
|
-
readonly type: "uint256";
|
|
2300
|
-
}, {
|
|
2301
|
-
readonly internalType: "uint256";
|
|
2302
|
-
readonly name: "latestOrder";
|
|
2303
|
-
readonly type: "uint256";
|
|
2304
|
-
}];
|
|
2305
|
-
readonly name: "NotEnoughOrdersToProcess";
|
|
2306
|
-
readonly type: "error";
|
|
2307
|
-
}, {
|
|
2308
|
-
readonly inputs: readonly [{
|
|
2309
|
-
readonly internalType: "uint256";
|
|
2310
|
-
readonly name: "ordersToProcess";
|
|
2311
|
-
readonly type: "uint256";
|
|
2312
|
-
}];
|
|
2313
|
-
readonly name: "InvalidOrdersCount";
|
|
2314
|
-
readonly type: "error";
|
|
2315
|
-
}, {
|
|
2316
|
-
readonly inputs: readonly [{
|
|
2317
|
-
readonly internalType: "address";
|
|
2318
|
-
readonly name: "intendedDepositor";
|
|
2319
|
-
readonly type: "address";
|
|
2320
|
-
}, {
|
|
2321
|
-
readonly internalType: "address";
|
|
2322
|
-
readonly name: "depositor";
|
|
2323
|
-
readonly type: "address";
|
|
2324
|
-
}];
|
|
2325
|
-
readonly name: "InvalidEip2612Signature";
|
|
2326
|
-
readonly type: "error";
|
|
2327
|
-
}, {
|
|
2328
|
-
readonly inputs: readonly [{
|
|
2329
|
-
readonly internalType: "address";
|
|
2330
|
-
readonly name: "intendedDepositor";
|
|
2331
|
-
readonly type: "address";
|
|
2332
|
-
}, {
|
|
2333
|
-
readonly internalType: "address";
|
|
2334
|
-
readonly name: "depositor";
|
|
2335
|
-
readonly type: "address";
|
|
2336
|
-
}];
|
|
2337
|
-
readonly name: "InvalidDepositor";
|
|
2338
|
-
readonly type: "error";
|
|
2339
|
-
}, {
|
|
2340
|
-
readonly inputs: readonly [];
|
|
2341
|
-
readonly name: "PermitFailedAndAllowanceTooLow";
|
|
2342
|
-
readonly type: "error";
|
|
2343
|
-
}, {
|
|
2344
|
-
readonly inputs: readonly [];
|
|
2345
|
-
readonly name: "TellerVaultMissmatch";
|
|
2346
|
-
readonly type: "error";
|
|
2347
|
-
}, {
|
|
2348
|
-
readonly inputs: readonly [{
|
|
2349
|
-
readonly internalType: "address";
|
|
2350
|
-
readonly name: "attemptedToCancel";
|
|
2351
|
-
readonly type: "address";
|
|
2352
|
-
}, {
|
|
2353
|
-
readonly internalType: "address";
|
|
2354
|
-
readonly name: "orderOwner";
|
|
2355
|
-
readonly type: "address";
|
|
2356
|
-
}];
|
|
2357
|
-
readonly name: "OnlyOrderOwnerCanCancel";
|
|
2358
|
-
readonly type: "error";
|
|
2359
|
-
}, {
|
|
2360
|
-
readonly inputs: readonly [];
|
|
2361
|
-
readonly name: "QueueMustBeEmpty";
|
|
2362
|
-
readonly type: "error";
|
|
2363
|
-
}, {
|
|
2364
|
-
readonly inputs: readonly [{
|
|
2365
|
-
readonly internalType: "contract IERC20";
|
|
2366
|
-
readonly name: "asset";
|
|
2367
|
-
readonly type: "address";
|
|
2368
|
-
}];
|
|
2369
|
-
readonly name: "AssetNotSupported";
|
|
2370
|
-
readonly type: "error";
|
|
2371
|
-
}, {
|
|
2372
|
-
readonly inputs: readonly [];
|
|
2373
|
-
readonly name: "InvalidAssetsOut";
|
|
2374
|
-
readonly type: "error";
|
|
2375
|
-
}, {
|
|
2376
|
-
readonly inputs: readonly [];
|
|
2377
|
-
readonly name: "EmptyArray";
|
|
2378
|
-
readonly type: "error";
|
|
2379
|
-
}, {
|
|
2380
|
-
readonly inputs: readonly [{
|
|
2381
|
-
readonly internalType: "contract IERC20";
|
|
2382
|
-
readonly name: "wantAsset";
|
|
2383
|
-
readonly type: "address";
|
|
2384
|
-
}, {
|
|
2385
|
-
readonly internalType: "uint256";
|
|
2386
|
-
readonly name: "expectedAssetsOut";
|
|
2387
|
-
readonly type: "uint256";
|
|
2388
|
-
}, {
|
|
2389
|
-
readonly internalType: "uint256";
|
|
2390
|
-
readonly name: "vaultBalanceOfWantAsset";
|
|
2391
|
-
readonly type: "uint256";
|
|
2392
|
-
}];
|
|
2393
|
-
readonly name: "VaultInsufficientBalance";
|
|
2394
|
-
readonly type: "error";
|
|
2395
|
-
}, {
|
|
2396
|
-
readonly inputs: readonly [];
|
|
2397
|
-
readonly name: "TellerIsPaused";
|
|
2398
|
-
readonly type: "error";
|
|
2399
|
-
}, {
|
|
2400
|
-
readonly anonymous: false;
|
|
2401
|
-
readonly inputs: readonly [{
|
|
2402
|
-
readonly indexed: true;
|
|
2403
|
-
readonly internalType: "address";
|
|
2404
|
-
readonly name: "owner";
|
|
2405
|
-
readonly type: "address";
|
|
2406
|
-
}, {
|
|
2407
|
-
readonly indexed: true;
|
|
2408
|
-
readonly internalType: "address";
|
|
2409
|
-
readonly name: "approved";
|
|
2410
|
-
readonly type: "address";
|
|
2411
|
-
}, {
|
|
2412
|
-
readonly indexed: true;
|
|
2413
|
-
readonly internalType: "uint256";
|
|
2414
|
-
readonly name: "tokenId";
|
|
2415
|
-
readonly type: "uint256";
|
|
2416
|
-
}];
|
|
2417
|
-
readonly name: "Approval";
|
|
2418
|
-
readonly type: "event";
|
|
2419
|
-
}, {
|
|
2420
|
-
readonly anonymous: false;
|
|
2421
|
-
readonly inputs: readonly [{
|
|
2422
|
-
readonly indexed: true;
|
|
2423
|
-
readonly internalType: "address";
|
|
2424
|
-
readonly name: "owner";
|
|
2425
|
-
readonly type: "address";
|
|
2426
|
-
}, {
|
|
2427
|
-
readonly indexed: true;
|
|
2428
|
-
readonly internalType: "address";
|
|
2429
|
-
readonly name: "operator";
|
|
2430
|
-
readonly type: "address";
|
|
2431
|
-
}, {
|
|
2432
|
-
readonly indexed: false;
|
|
2433
|
-
readonly internalType: "bool";
|
|
2434
|
-
readonly name: "approved";
|
|
2435
|
-
readonly type: "bool";
|
|
2436
|
-
}];
|
|
2437
|
-
readonly name: "ApprovalForAll";
|
|
2438
|
-
readonly type: "event";
|
|
2439
|
-
}, {
|
|
2440
|
-
readonly anonymous: false;
|
|
2441
|
-
readonly inputs: readonly [{
|
|
2442
|
-
readonly indexed: true;
|
|
2443
|
-
readonly internalType: "address";
|
|
2444
|
-
readonly name: "user";
|
|
2445
|
-
readonly type: "address";
|
|
2446
|
-
}, {
|
|
2447
|
-
readonly indexed: true;
|
|
2448
|
-
readonly internalType: "address";
|
|
2449
|
-
readonly name: "newAuthority";
|
|
2450
|
-
readonly type: "address";
|
|
2451
|
-
}];
|
|
2452
|
-
readonly name: "AuthorityUpdated";
|
|
2453
|
-
readonly type: "event";
|
|
2454
|
-
}, {
|
|
2455
|
-
readonly anonymous: false;
|
|
2456
|
-
readonly inputs: readonly [{
|
|
2457
|
-
readonly indexed: true;
|
|
2458
|
-
readonly internalType: "contract IFeeModule";
|
|
2459
|
-
readonly name: "oldFeeModule";
|
|
2460
|
-
readonly type: "address";
|
|
2461
|
-
}, {
|
|
2462
|
-
readonly indexed: true;
|
|
2463
|
-
readonly internalType: "contract IFeeModule";
|
|
2464
|
-
readonly name: "newFeeModule";
|
|
2465
|
-
readonly type: "address";
|
|
2466
|
-
}];
|
|
2467
|
-
readonly name: "FeeModuleUpdated";
|
|
2468
|
-
readonly type: "event";
|
|
2469
|
-
}, {
|
|
2470
|
-
readonly anonymous: false;
|
|
2471
|
-
readonly inputs: readonly [{
|
|
2472
|
-
readonly indexed: true;
|
|
2473
|
-
readonly internalType: "address";
|
|
2474
|
-
readonly name: "oldFeeRecipient";
|
|
2475
|
-
readonly type: "address";
|
|
2476
|
-
}, {
|
|
2477
|
-
readonly indexed: true;
|
|
2478
|
-
readonly internalType: "address";
|
|
2479
|
-
readonly name: "newFeeRecipient";
|
|
2480
|
-
readonly type: "address";
|
|
2481
|
-
}];
|
|
2482
|
-
readonly name: "FeeRecipientUpdated";
|
|
2483
|
-
readonly type: "event";
|
|
2484
|
-
}, {
|
|
2485
|
-
readonly anonymous: false;
|
|
2486
|
-
readonly inputs: readonly [{
|
|
2487
|
-
readonly indexed: false;
|
|
2488
|
-
readonly internalType: "uint256";
|
|
2489
|
-
readonly name: "oldMinimum";
|
|
2490
|
-
readonly type: "uint256";
|
|
2491
|
-
}, {
|
|
2492
|
-
readonly indexed: false;
|
|
2493
|
-
readonly internalType: "uint256";
|
|
2494
|
-
readonly name: "newMinimum";
|
|
2495
|
-
readonly type: "uint256";
|
|
2496
|
-
}];
|
|
2497
|
-
readonly name: "MinimumOrderSizeUpdated";
|
|
2498
|
-
readonly type: "event";
|
|
2499
|
-
}, {
|
|
2500
|
-
readonly anonymous: false;
|
|
2501
|
-
readonly inputs: readonly [{
|
|
2502
|
-
readonly indexed: true;
|
|
2503
|
-
readonly internalType: "uint256";
|
|
2504
|
-
readonly name: "orderIndex";
|
|
2505
|
-
readonly type: "uint256";
|
|
2506
|
-
}, {
|
|
2507
|
-
readonly components: readonly [{
|
|
2508
|
-
readonly internalType: "uint256";
|
|
2509
|
-
readonly name: "amountOffer";
|
|
2510
|
-
readonly type: "uint256";
|
|
2511
|
-
}, {
|
|
2512
|
-
readonly internalType: "contract IERC20";
|
|
2513
|
-
readonly name: "wantAsset";
|
|
2514
|
-
readonly type: "address";
|
|
2515
|
-
}, {
|
|
2516
|
-
readonly internalType: "address";
|
|
2517
|
-
readonly name: "refundReceiver";
|
|
2518
|
-
readonly type: "address";
|
|
2519
|
-
}, {
|
|
2520
|
-
readonly internalType: "enum WithdrawQueue.OrderType";
|
|
2521
|
-
readonly name: "orderType";
|
|
2522
|
-
readonly type: "uint8";
|
|
2523
|
-
}, {
|
|
2524
|
-
readonly internalType: "bool";
|
|
2525
|
-
readonly name: "didOrderFailTransfer";
|
|
2526
|
-
readonly type: "bool";
|
|
2527
|
-
}];
|
|
2528
|
-
readonly indexed: false;
|
|
2529
|
-
readonly internalType: "struct WithdrawQueue.Order";
|
|
2530
|
-
readonly name: "order";
|
|
2531
|
-
readonly type: "tuple";
|
|
2532
|
-
}, {
|
|
2533
|
-
readonly indexed: true;
|
|
2534
|
-
readonly internalType: "address";
|
|
2535
|
-
readonly name: "receiver";
|
|
2536
|
-
readonly type: "address";
|
|
2537
|
-
}, {
|
|
2538
|
-
readonly indexed: true;
|
|
2539
|
-
readonly internalType: "address";
|
|
2540
|
-
readonly name: "depositor";
|
|
2541
|
-
readonly type: "address";
|
|
2542
|
-
}, {
|
|
2543
|
-
readonly indexed: false;
|
|
2544
|
-
readonly internalType: "bool";
|
|
2545
|
-
readonly name: "isSubmittedViaSignature";
|
|
2546
|
-
readonly type: "bool";
|
|
2547
|
-
}];
|
|
2548
|
-
readonly name: "OrderSubmitted";
|
|
2549
|
-
readonly type: "event";
|
|
2550
|
-
}, {
|
|
2551
|
-
readonly anonymous: false;
|
|
2552
|
-
readonly inputs: readonly [{
|
|
2553
|
-
readonly indexed: true;
|
|
2554
|
-
readonly internalType: "uint256";
|
|
2555
|
-
readonly name: "startIndex";
|
|
2556
|
-
readonly type: "uint256";
|
|
2557
|
-
}, {
|
|
2558
|
-
readonly indexed: true;
|
|
2559
|
-
readonly internalType: "uint256";
|
|
2560
|
-
readonly name: "endIndex";
|
|
2561
|
-
readonly type: "uint256";
|
|
2562
|
-
}];
|
|
2563
|
-
readonly name: "OrdersProcessedInRange";
|
|
2564
|
-
readonly type: "event";
|
|
2565
|
-
}, {
|
|
2566
|
-
readonly anonymous: false;
|
|
2567
|
-
readonly inputs: readonly [{
|
|
2568
|
-
readonly indexed: true;
|
|
2569
|
-
readonly internalType: "uint256";
|
|
2570
|
-
readonly name: "orderIndex";
|
|
2571
|
-
readonly type: "uint256";
|
|
2572
|
-
}, {
|
|
2573
|
-
readonly components: readonly [{
|
|
2574
|
-
readonly internalType: "uint256";
|
|
2575
|
-
readonly name: "amountOffer";
|
|
2576
|
-
readonly type: "uint256";
|
|
2577
|
-
}, {
|
|
2578
|
-
readonly internalType: "contract IERC20";
|
|
2579
|
-
readonly name: "wantAsset";
|
|
2580
|
-
readonly type: "address";
|
|
2581
|
-
}, {
|
|
2582
|
-
readonly internalType: "address";
|
|
2583
|
-
readonly name: "refundReceiver";
|
|
2584
|
-
readonly type: "address";
|
|
2585
|
-
}, {
|
|
2586
|
-
readonly internalType: "enum WithdrawQueue.OrderType";
|
|
2587
|
-
readonly name: "orderType";
|
|
2588
|
-
readonly type: "uint8";
|
|
2589
|
-
}, {
|
|
2590
|
-
readonly internalType: "bool";
|
|
2591
|
-
readonly name: "didOrderFailTransfer";
|
|
2592
|
-
readonly type: "bool";
|
|
2593
|
-
}];
|
|
2594
|
-
readonly indexed: false;
|
|
2595
|
-
readonly internalType: "struct WithdrawQueue.Order";
|
|
2596
|
-
readonly name: "order";
|
|
2597
|
-
readonly type: "tuple";
|
|
2598
|
-
}, {
|
|
2599
|
-
readonly indexed: true;
|
|
2600
|
-
readonly internalType: "address";
|
|
2601
|
-
readonly name: "receiver";
|
|
2602
|
-
readonly type: "address";
|
|
2603
|
-
}, {
|
|
2604
|
-
readonly indexed: true;
|
|
2605
|
-
readonly internalType: "bool";
|
|
2606
|
-
readonly name: "isForceProcessed";
|
|
2607
|
-
readonly type: "bool";
|
|
2608
|
-
}];
|
|
2609
|
-
readonly name: "OrderProcessed";
|
|
2610
|
-
readonly type: "event";
|
|
2611
|
-
}, {
|
|
2612
|
-
readonly anonymous: false;
|
|
2613
|
-
readonly inputs: readonly [{
|
|
2614
|
-
readonly indexed: true;
|
|
2615
|
-
readonly internalType: "uint256";
|
|
2616
|
-
readonly name: "orderIndex";
|
|
2617
|
-
readonly type: "uint256";
|
|
2618
|
-
}, {
|
|
2619
|
-
readonly components: readonly [{
|
|
2620
|
-
readonly internalType: "uint256";
|
|
2621
|
-
readonly name: "amountOffer";
|
|
2622
|
-
readonly type: "uint256";
|
|
2623
|
-
}, {
|
|
2624
|
-
readonly internalType: "contract IERC20";
|
|
2625
|
-
readonly name: "wantAsset";
|
|
2626
|
-
readonly type: "address";
|
|
2627
|
-
}, {
|
|
2628
|
-
readonly internalType: "address";
|
|
2629
|
-
readonly name: "refundReceiver";
|
|
2630
|
-
readonly type: "address";
|
|
2631
|
-
}, {
|
|
2632
|
-
readonly internalType: "enum WithdrawQueue.OrderType";
|
|
2633
|
-
readonly name: "orderType";
|
|
2634
|
-
readonly type: "uint8";
|
|
2635
|
-
}, {
|
|
2636
|
-
readonly internalType: "bool";
|
|
2637
|
-
readonly name: "didOrderFailTransfer";
|
|
2638
|
-
readonly type: "bool";
|
|
2639
|
-
}];
|
|
2640
|
-
readonly indexed: false;
|
|
2641
|
-
readonly internalType: "struct WithdrawQueue.Order";
|
|
2642
|
-
readonly name: "order";
|
|
2643
|
-
readonly type: "tuple";
|
|
2644
|
-
}];
|
|
2645
|
-
readonly name: "OrderRefunded";
|
|
2646
|
-
readonly type: "event";
|
|
2647
|
-
}, {
|
|
2648
|
-
readonly anonymous: false;
|
|
2649
|
-
readonly inputs: readonly [{
|
|
2650
|
-
readonly indexed: true;
|
|
2651
|
-
readonly internalType: "uint256";
|
|
2652
|
-
readonly name: "orderIndex";
|
|
2653
|
-
readonly type: "uint256";
|
|
2654
|
-
}, {
|
|
2655
|
-
readonly indexed: true;
|
|
2656
|
-
readonly internalType: "bool";
|
|
2657
|
-
readonly name: "isMarkedByUser";
|
|
2658
|
-
readonly type: "bool";
|
|
2659
|
-
}];
|
|
2660
|
-
readonly name: "OrderMarkedForRefund";
|
|
2661
|
-
readonly type: "event";
|
|
2662
|
-
}, {
|
|
2663
|
-
readonly anonymous: false;
|
|
2664
|
-
readonly inputs: readonly [{
|
|
2665
|
-
readonly indexed: true;
|
|
2666
|
-
readonly internalType: "address";
|
|
2667
|
-
readonly name: "user";
|
|
2668
|
-
readonly type: "address";
|
|
2669
|
-
}, {
|
|
2670
|
-
readonly indexed: true;
|
|
2671
|
-
readonly internalType: "address";
|
|
2672
|
-
readonly name: "newOwner";
|
|
2673
|
-
readonly type: "address";
|
|
2674
|
-
}];
|
|
2675
|
-
readonly name: "OwnershipTransferred";
|
|
2676
|
-
readonly type: "event";
|
|
2677
|
-
}, {
|
|
2678
|
-
readonly anonymous: false;
|
|
2679
|
-
readonly inputs: readonly [{
|
|
2680
|
-
readonly indexed: true;
|
|
2681
|
-
readonly internalType: "contract TellerWithMultiAssetSupport";
|
|
2682
|
-
readonly name: "oldTeller";
|
|
2683
|
-
readonly type: "address";
|
|
2684
|
-
}, {
|
|
2685
|
-
readonly indexed: true;
|
|
2686
|
-
readonly internalType: "contract TellerWithMultiAssetSupport";
|
|
2687
|
-
readonly name: "newTeller";
|
|
2688
|
-
readonly type: "address";
|
|
2689
|
-
}];
|
|
2690
|
-
readonly name: "TellerUpdated";
|
|
2691
|
-
readonly type: "event";
|
|
2692
|
-
}, {
|
|
2693
|
-
readonly anonymous: false;
|
|
2694
|
-
readonly inputs: readonly [{
|
|
2695
|
-
readonly indexed: true;
|
|
2696
|
-
readonly internalType: "address";
|
|
2697
|
-
readonly name: "from";
|
|
2698
|
-
readonly type: "address";
|
|
2699
|
-
}, {
|
|
2700
|
-
readonly indexed: true;
|
|
2701
|
-
readonly internalType: "address";
|
|
2702
|
-
readonly name: "to";
|
|
2703
|
-
readonly type: "address";
|
|
2704
|
-
}, {
|
|
2705
|
-
readonly indexed: true;
|
|
2706
|
-
readonly internalType: "uint256";
|
|
2707
|
-
readonly name: "tokenId";
|
|
2708
|
-
readonly type: "uint256";
|
|
2709
|
-
}];
|
|
2710
|
-
readonly name: "Transfer";
|
|
2711
|
-
readonly type: "event";
|
|
2712
|
-
}, {
|
|
2713
|
-
readonly inputs: readonly [];
|
|
2714
|
-
readonly name: "CANCEL_ORDER_TYPEHASH";
|
|
2715
|
-
readonly outputs: readonly [{
|
|
2716
|
-
readonly internalType: "bytes32";
|
|
2717
|
-
readonly name: "";
|
|
2718
|
-
readonly type: "bytes32";
|
|
2719
|
-
}];
|
|
2720
|
-
readonly stateMutability: "view";
|
|
2721
|
-
readonly type: "function";
|
|
2722
|
-
}, {
|
|
2723
|
-
readonly inputs: readonly [];
|
|
2724
|
-
readonly name: "authority";
|
|
2725
|
-
readonly outputs: readonly [{
|
|
2726
|
-
readonly internalType: "contract Authority";
|
|
2727
|
-
readonly name: "";
|
|
2728
|
-
readonly type: "address";
|
|
2729
|
-
}];
|
|
2730
|
-
readonly stateMutability: "view";
|
|
2731
|
-
readonly type: "function";
|
|
2732
|
-
}, {
|
|
2733
|
-
readonly inputs: readonly [{
|
|
2734
|
-
readonly internalType: "address";
|
|
2735
|
-
readonly name: "owner";
|
|
2736
|
-
readonly type: "address";
|
|
2737
|
-
}];
|
|
2738
|
-
readonly name: "balanceOf";
|
|
2739
|
-
readonly outputs: readonly [{
|
|
2740
|
-
readonly internalType: "uint256";
|
|
2741
|
-
readonly name: "";
|
|
2742
|
-
readonly type: "uint256";
|
|
2743
|
-
}];
|
|
2744
|
-
readonly stateMutability: "view";
|
|
2745
|
-
readonly type: "function";
|
|
2746
|
-
}, {
|
|
2747
|
-
readonly inputs: readonly [{
|
|
2748
|
-
readonly internalType: "uint256";
|
|
2749
|
-
readonly name: "tokenId";
|
|
2750
|
-
readonly type: "uint256";
|
|
2751
|
-
}];
|
|
2752
|
-
readonly name: "ownerOf";
|
|
2753
|
-
readonly outputs: readonly [{
|
|
2754
|
-
readonly internalType: "address";
|
|
2755
|
-
readonly name: "";
|
|
2756
|
-
readonly type: "address";
|
|
2757
|
-
}];
|
|
2758
|
-
readonly stateMutability: "view";
|
|
2759
|
-
readonly type: "function";
|
|
2760
|
-
}, {
|
|
2761
|
-
readonly inputs: readonly [{
|
|
2762
|
-
readonly internalType: "uint256";
|
|
2763
|
-
readonly name: "orderIndex";
|
|
2764
|
-
readonly type: "uint256";
|
|
2765
|
-
}];
|
|
2766
|
-
readonly name: "cancelOrder";
|
|
2767
|
-
readonly outputs: readonly [];
|
|
2768
|
-
readonly stateMutability: "nonpayable";
|
|
2769
|
-
readonly type: "function";
|
|
2770
|
-
}, {
|
|
2771
|
-
readonly inputs: readonly [{
|
|
2772
|
-
readonly internalType: "uint256";
|
|
2773
|
-
readonly name: "orderIndex";
|
|
2774
|
-
readonly type: "uint256";
|
|
2775
|
-
}, {
|
|
2776
|
-
readonly internalType: "uint256";
|
|
2777
|
-
readonly name: "deadline";
|
|
2778
|
-
readonly type: "uint256";
|
|
2779
|
-
}, {
|
|
2780
|
-
readonly internalType: "bytes";
|
|
2781
|
-
readonly name: "cancelSignature";
|
|
2782
|
-
readonly type: "bytes";
|
|
2783
|
-
}];
|
|
2784
|
-
readonly name: "cancelOrderWithSignature";
|
|
2785
|
-
readonly outputs: readonly [];
|
|
2786
|
-
readonly stateMutability: "nonpayable";
|
|
2787
|
-
readonly type: "function";
|
|
2788
|
-
}, {
|
|
2789
|
-
readonly inputs: readonly [];
|
|
2790
|
-
readonly name: "feeModule";
|
|
2791
|
-
readonly outputs: readonly [{
|
|
2792
|
-
readonly internalType: "contract IFeeModule";
|
|
2793
|
-
readonly name: "";
|
|
2794
|
-
readonly type: "address";
|
|
2795
|
-
}];
|
|
2796
|
-
readonly stateMutability: "view";
|
|
2797
|
-
readonly type: "function";
|
|
2798
|
-
}, {
|
|
2799
|
-
readonly inputs: readonly [];
|
|
2800
|
-
readonly name: "feeRecipient";
|
|
2801
|
-
readonly outputs: readonly [{
|
|
2802
|
-
readonly internalType: "address";
|
|
2803
|
-
readonly name: "";
|
|
2804
|
-
readonly type: "address";
|
|
2805
|
-
}];
|
|
2806
|
-
readonly stateMutability: "view";
|
|
2807
|
-
readonly type: "function";
|
|
2808
|
-
}, {
|
|
2809
|
-
readonly inputs: readonly [{
|
|
2810
|
-
readonly internalType: "uint256";
|
|
2811
|
-
readonly name: "orderIndex";
|
|
2812
|
-
readonly type: "uint256";
|
|
2813
|
-
}];
|
|
2814
|
-
readonly name: "forceProcess";
|
|
2815
|
-
readonly outputs: readonly [];
|
|
2816
|
-
readonly stateMutability: "nonpayable";
|
|
2817
|
-
readonly type: "function";
|
|
2818
|
-
}, {
|
|
2819
|
-
readonly inputs: readonly [{
|
|
2820
|
-
readonly internalType: "uint256[]";
|
|
2821
|
-
readonly name: "orderIndices";
|
|
2822
|
-
readonly type: "uint256[]";
|
|
2823
|
-
}];
|
|
2824
|
-
readonly name: "forceProcessOrders";
|
|
2825
|
-
readonly outputs: readonly [];
|
|
2826
|
-
readonly stateMutability: "nonpayable";
|
|
2827
|
-
readonly type: "function";
|
|
2828
|
-
}, {
|
|
2829
|
-
readonly inputs: readonly [{
|
|
2830
|
-
readonly internalType: "uint256";
|
|
2831
|
-
readonly name: "orderIndex";
|
|
2832
|
-
readonly type: "uint256";
|
|
2833
|
-
}];
|
|
2834
|
-
readonly name: "getOrderStatus";
|
|
2835
|
-
readonly outputs: readonly [{
|
|
2836
|
-
readonly internalType: "enum WithdrawQueue.OrderStatus";
|
|
2837
|
-
readonly name: "";
|
|
2838
|
-
readonly type: "uint8";
|
|
2839
|
-
}];
|
|
2840
|
-
readonly stateMutability: "view";
|
|
2841
|
-
readonly type: "function";
|
|
2842
|
-
}, {
|
|
2843
|
-
readonly inputs: readonly [{
|
|
2844
|
-
readonly internalType: "uint256";
|
|
2845
|
-
readonly name: "tokenId";
|
|
2846
|
-
readonly type: "uint256";
|
|
2847
|
-
}];
|
|
2848
|
-
readonly name: "getApproved";
|
|
2849
|
-
readonly outputs: readonly [{
|
|
2850
|
-
readonly internalType: "address";
|
|
2851
|
-
readonly name: "";
|
|
2852
|
-
readonly type: "address";
|
|
2853
|
-
}];
|
|
2854
|
-
readonly stateMutability: "view";
|
|
2855
|
-
readonly type: "function";
|
|
2856
|
-
}, {
|
|
2857
|
-
readonly inputs: readonly [];
|
|
2858
|
-
readonly name: "lastProcessedOrder";
|
|
2859
|
-
readonly outputs: readonly [{
|
|
2860
|
-
readonly internalType: "uint256";
|
|
2861
|
-
readonly name: "";
|
|
2862
|
-
readonly type: "uint256";
|
|
2863
|
-
}];
|
|
2864
|
-
readonly stateMutability: "view";
|
|
2865
|
-
readonly type: "function";
|
|
2866
|
-
}, {
|
|
2867
|
-
readonly inputs: readonly [];
|
|
2868
|
-
readonly name: "latestOrder";
|
|
2869
|
-
readonly outputs: readonly [{
|
|
2870
|
-
readonly internalType: "uint256";
|
|
2871
|
-
readonly name: "";
|
|
2872
|
-
readonly type: "uint256";
|
|
2873
|
-
}];
|
|
2874
|
-
readonly stateMutability: "view";
|
|
2875
|
-
readonly type: "function";
|
|
2876
|
-
}, {
|
|
2877
|
-
readonly inputs: readonly [{
|
|
2878
|
-
readonly internalType: "contract IERC20";
|
|
2879
|
-
readonly name: "token";
|
|
2880
|
-
readonly type: "address";
|
|
2881
|
-
}, {
|
|
2882
|
-
readonly internalType: "uint256";
|
|
2883
|
-
readonly name: "amount";
|
|
2884
|
-
readonly type: "uint256";
|
|
2885
|
-
}, {
|
|
2886
|
-
readonly internalType: "address";
|
|
2887
|
-
readonly name: "receiver";
|
|
2888
|
-
readonly type: "address";
|
|
2889
|
-
}];
|
|
2890
|
-
readonly name: "manageERC20";
|
|
2891
|
-
readonly outputs: readonly [];
|
|
2892
|
-
readonly stateMutability: "nonpayable";
|
|
2893
|
-
readonly type: "function";
|
|
2894
|
-
}, {
|
|
2895
|
-
readonly inputs: readonly [];
|
|
2896
|
-
readonly name: "minimumOrderSize";
|
|
2897
|
-
readonly outputs: readonly [{
|
|
2898
|
-
readonly internalType: "uint256";
|
|
2899
|
-
readonly name: "";
|
|
2900
|
-
readonly type: "uint256";
|
|
2901
|
-
}];
|
|
2902
|
-
readonly stateMutability: "view";
|
|
2903
|
-
readonly type: "function";
|
|
2904
|
-
}, {
|
|
2905
|
-
readonly inputs: readonly [];
|
|
2906
|
-
readonly name: "name";
|
|
2907
|
-
readonly outputs: readonly [{
|
|
2908
|
-
readonly internalType: "string";
|
|
2909
|
-
readonly name: "";
|
|
2910
|
-
readonly type: "string";
|
|
2911
|
-
}];
|
|
2912
|
-
readonly stateMutability: "view";
|
|
2913
|
-
readonly type: "function";
|
|
2914
|
-
}, {
|
|
2915
|
-
readonly inputs: readonly [{
|
|
2916
|
-
readonly internalType: "address";
|
|
2917
|
-
readonly name: "";
|
|
2918
|
-
readonly type: "address";
|
|
2919
|
-
}];
|
|
2920
|
-
readonly name: "nonces";
|
|
2921
|
-
readonly outputs: readonly [{
|
|
2922
|
-
readonly internalType: "uint256";
|
|
2923
|
-
readonly name: "";
|
|
2924
|
-
readonly type: "uint256";
|
|
2925
|
-
}];
|
|
2926
|
-
readonly stateMutability: "view";
|
|
2927
|
-
readonly type: "function";
|
|
2928
|
-
}, {
|
|
2929
|
-
readonly inputs: readonly [];
|
|
2930
|
-
readonly name: "offerAsset";
|
|
2931
|
-
readonly outputs: readonly [{
|
|
2932
|
-
readonly internalType: "contract IERC20";
|
|
2933
|
-
readonly name: "";
|
|
2934
|
-
readonly type: "address";
|
|
2935
|
-
}];
|
|
2936
|
-
readonly stateMutability: "view";
|
|
2937
|
-
readonly type: "function";
|
|
2938
|
-
}, {
|
|
2939
|
-
readonly inputs: readonly [];
|
|
2940
|
-
readonly name: "owner";
|
|
2941
|
-
readonly outputs: readonly [{
|
|
2942
|
-
readonly internalType: "address";
|
|
2943
|
-
readonly name: "";
|
|
2944
|
-
readonly type: "address";
|
|
2945
|
-
}];
|
|
2946
|
-
readonly stateMutability: "view";
|
|
2947
|
-
readonly type: "function";
|
|
2948
|
-
}, {
|
|
2949
|
-
readonly inputs: readonly [{
|
|
2950
|
-
readonly internalType: "uint256";
|
|
2951
|
-
readonly name: "";
|
|
2952
|
-
readonly type: "uint256";
|
|
2953
|
-
}];
|
|
2954
|
-
readonly name: "orderAtQueueIndex";
|
|
2955
|
-
readonly outputs: readonly [{
|
|
2956
|
-
readonly components: readonly [{
|
|
2957
|
-
readonly internalType: "uint256";
|
|
2958
|
-
readonly name: "amountOffer";
|
|
2959
|
-
readonly type: "uint256";
|
|
2960
|
-
}, {
|
|
2961
|
-
readonly internalType: "contract IERC20";
|
|
2962
|
-
readonly name: "wantAsset";
|
|
2963
|
-
readonly type: "address";
|
|
2964
|
-
}, {
|
|
2965
|
-
readonly internalType: "address";
|
|
2966
|
-
readonly name: "refundReceiver";
|
|
2967
|
-
readonly type: "address";
|
|
2968
|
-
}, {
|
|
2969
|
-
readonly internalType: "enum WithdrawQueue.OrderType";
|
|
2970
|
-
readonly name: "orderType";
|
|
2971
|
-
readonly type: "uint8";
|
|
2972
|
-
}, {
|
|
2973
|
-
readonly internalType: "bool";
|
|
2974
|
-
readonly name: "didOrderFailTransfer";
|
|
2975
|
-
readonly type: "bool";
|
|
2976
|
-
}];
|
|
2977
|
-
readonly internalType: "struct WithdrawQueue.Order";
|
|
2978
|
-
readonly name: "";
|
|
2979
|
-
readonly type: "tuple";
|
|
2980
|
-
}];
|
|
2981
|
-
readonly stateMutability: "view";
|
|
2982
|
-
readonly type: "function";
|
|
2983
|
-
}, {
|
|
2984
|
-
readonly inputs: readonly [{
|
|
2985
|
-
readonly internalType: "address";
|
|
2986
|
-
readonly name: "owner";
|
|
2987
|
-
readonly type: "address";
|
|
2988
|
-
}, {
|
|
2989
|
-
readonly internalType: "address";
|
|
2990
|
-
readonly name: "operator";
|
|
2991
|
-
readonly type: "address";
|
|
2992
|
-
}];
|
|
2993
|
-
readonly name: "isApprovedForAll";
|
|
2994
|
-
readonly outputs: readonly [{
|
|
2995
|
-
readonly internalType: "bool";
|
|
2996
|
-
readonly name: "";
|
|
2997
|
-
readonly type: "bool";
|
|
2998
|
-
}];
|
|
2999
|
-
readonly stateMutability: "view";
|
|
3000
|
-
readonly type: "function";
|
|
3001
|
-
}, {
|
|
3002
|
-
readonly inputs: readonly [{
|
|
3003
|
-
readonly internalType: "uint256";
|
|
3004
|
-
readonly name: "orderIndex";
|
|
3005
|
-
readonly type: "uint256";
|
|
3006
|
-
}];
|
|
3007
|
-
readonly name: "refundOrder";
|
|
3008
|
-
readonly outputs: readonly [];
|
|
3009
|
-
readonly stateMutability: "nonpayable";
|
|
3010
|
-
readonly type: "function";
|
|
3011
|
-
}, {
|
|
3012
|
-
readonly inputs: readonly [{
|
|
3013
|
-
readonly internalType: "uint256[]";
|
|
3014
|
-
readonly name: "orderIndices";
|
|
3015
|
-
readonly type: "uint256[]";
|
|
3016
|
-
}];
|
|
3017
|
-
readonly name: "refundOrders";
|
|
3018
|
-
readonly outputs: readonly [];
|
|
3019
|
-
readonly stateMutability: "nonpayable";
|
|
3020
|
-
readonly type: "function";
|
|
3021
|
-
}, {
|
|
3022
|
-
readonly inputs: readonly [{
|
|
3023
|
-
readonly internalType: "uint256";
|
|
3024
|
-
readonly name: "ordersToProcess";
|
|
3025
|
-
readonly type: "uint256";
|
|
3026
|
-
}];
|
|
3027
|
-
readonly name: "processOrders";
|
|
3028
|
-
readonly outputs: readonly [];
|
|
3029
|
-
readonly stateMutability: "nonpayable";
|
|
3030
|
-
readonly type: "function";
|
|
3031
|
-
}, {
|
|
3032
|
-
readonly inputs: readonly [{
|
|
3033
|
-
readonly components: readonly [{
|
|
3034
|
-
readonly internalType: "uint256";
|
|
3035
|
-
readonly name: "amountOffer";
|
|
3036
|
-
readonly type: "uint256";
|
|
3037
|
-
}, {
|
|
3038
|
-
readonly internalType: "contract IERC20";
|
|
3039
|
-
readonly name: "wantAsset";
|
|
3040
|
-
readonly type: "address";
|
|
3041
|
-
}, {
|
|
3042
|
-
readonly internalType: "address";
|
|
3043
|
-
readonly name: "intendedDepositor";
|
|
3044
|
-
readonly type: "address";
|
|
3045
|
-
}, {
|
|
3046
|
-
readonly internalType: "address";
|
|
3047
|
-
readonly name: "receiver";
|
|
3048
|
-
readonly type: "address";
|
|
3049
|
-
}, {
|
|
3050
|
-
readonly internalType: "address";
|
|
3051
|
-
readonly name: "refundReceiver";
|
|
3052
|
-
readonly type: "address";
|
|
3053
|
-
}, {
|
|
3054
|
-
readonly components: readonly [{
|
|
3055
|
-
readonly internalType: "enum WithdrawQueue.ApprovalMethod";
|
|
3056
|
-
readonly name: "approvalMethod";
|
|
3057
|
-
readonly type: "uint8";
|
|
3058
|
-
}, {
|
|
3059
|
-
readonly internalType: "uint8";
|
|
3060
|
-
readonly name: "approvalV";
|
|
3061
|
-
readonly type: "uint8";
|
|
3062
|
-
}, {
|
|
3063
|
-
readonly internalType: "bytes32";
|
|
3064
|
-
readonly name: "approvalR";
|
|
3065
|
-
readonly type: "bytes32";
|
|
3066
|
-
}, {
|
|
3067
|
-
readonly internalType: "bytes32";
|
|
3068
|
-
readonly name: "approvalS";
|
|
3069
|
-
readonly type: "bytes32";
|
|
3070
|
-
}, {
|
|
3071
|
-
readonly internalType: "bool";
|
|
3072
|
-
readonly name: "submitWithSignature";
|
|
3073
|
-
readonly type: "bool";
|
|
3074
|
-
}, {
|
|
3075
|
-
readonly internalType: "uint256";
|
|
3076
|
-
readonly name: "deadline";
|
|
3077
|
-
readonly type: "uint256";
|
|
3078
|
-
}, {
|
|
3079
|
-
readonly internalType: "bytes";
|
|
3080
|
-
readonly name: "eip2612Signature";
|
|
3081
|
-
readonly type: "bytes";
|
|
3082
|
-
}];
|
|
3083
|
-
readonly internalType: "struct WithdrawQueue.SignatureParams";
|
|
3084
|
-
readonly name: "signatureParams";
|
|
3085
|
-
readonly type: "tuple";
|
|
3086
|
-
}];
|
|
3087
|
-
readonly internalType: "struct WithdrawQueue.SubmitOrderParams";
|
|
3088
|
-
readonly name: "params";
|
|
3089
|
-
readonly type: "tuple";
|
|
3090
|
-
}];
|
|
3091
|
-
readonly name: "submitOrder";
|
|
3092
|
-
readonly outputs: readonly [{
|
|
3093
|
-
readonly internalType: "uint256";
|
|
3094
|
-
readonly name: "orderIndex";
|
|
3095
|
-
readonly type: "uint256";
|
|
3096
|
-
}];
|
|
3097
|
-
readonly stateMutability: "nonpayable";
|
|
3098
|
-
readonly type: "function";
|
|
3099
|
-
}, {
|
|
3100
|
-
readonly inputs: readonly [{
|
|
3101
|
-
readonly components: readonly [{
|
|
3102
|
-
readonly internalType: "uint256";
|
|
3103
|
-
readonly name: "amountOffer";
|
|
3104
|
-
readonly type: "uint256";
|
|
3105
|
-
}, {
|
|
3106
|
-
readonly internalType: "contract IERC20";
|
|
3107
|
-
readonly name: "wantAsset";
|
|
3108
|
-
readonly type: "address";
|
|
3109
|
-
}, {
|
|
3110
|
-
readonly internalType: "address";
|
|
3111
|
-
readonly name: "intendedDepositor";
|
|
3112
|
-
readonly type: "address";
|
|
3113
|
-
}, {
|
|
3114
|
-
readonly internalType: "address";
|
|
3115
|
-
readonly name: "receiver";
|
|
3116
|
-
readonly type: "address";
|
|
3117
|
-
}, {
|
|
3118
|
-
readonly internalType: "address";
|
|
3119
|
-
readonly name: "refundReceiver";
|
|
3120
|
-
readonly type: "address";
|
|
3121
|
-
}, {
|
|
3122
|
-
readonly components: readonly [{
|
|
3123
|
-
readonly internalType: "enum WithdrawQueue.ApprovalMethod";
|
|
3124
|
-
readonly name: "approvalMethod";
|
|
3125
|
-
readonly type: "uint8";
|
|
3126
|
-
}, {
|
|
3127
|
-
readonly internalType: "uint8";
|
|
3128
|
-
readonly name: "approvalV";
|
|
3129
|
-
readonly type: "uint8";
|
|
3130
|
-
}, {
|
|
3131
|
-
readonly internalType: "bytes32";
|
|
3132
|
-
readonly name: "approvalR";
|
|
3133
|
-
readonly type: "bytes32";
|
|
3134
|
-
}, {
|
|
3135
|
-
readonly internalType: "bytes32";
|
|
3136
|
-
readonly name: "approvalS";
|
|
3137
|
-
readonly type: "bytes32";
|
|
3138
|
-
}, {
|
|
3139
|
-
readonly internalType: "bool";
|
|
3140
|
-
readonly name: "submitWithSignature";
|
|
3141
|
-
readonly type: "bool";
|
|
3142
|
-
}, {
|
|
3143
|
-
readonly internalType: "uint256";
|
|
3144
|
-
readonly name: "deadline";
|
|
3145
|
-
readonly type: "uint256";
|
|
3146
|
-
}, {
|
|
3147
|
-
readonly internalType: "bytes";
|
|
3148
|
-
readonly name: "eip2612Signature";
|
|
3149
|
-
readonly type: "bytes";
|
|
3150
|
-
}];
|
|
3151
|
-
readonly internalType: "struct WithdrawQueue.SignatureParams";
|
|
3152
|
-
readonly name: "signatureParams";
|
|
3153
|
-
readonly type: "tuple";
|
|
3154
|
-
}];
|
|
3155
|
-
readonly internalType: "struct WithdrawQueue.SubmitOrderParams";
|
|
3156
|
-
readonly name: "params";
|
|
3157
|
-
readonly type: "tuple";
|
|
3158
|
-
}, {
|
|
3159
|
-
readonly internalType: "uint256";
|
|
3160
|
-
readonly name: "ordersToProcess";
|
|
3161
|
-
readonly type: "uint256";
|
|
3162
|
-
}];
|
|
3163
|
-
readonly name: "submitOrderAndProcess";
|
|
3164
|
-
readonly outputs: readonly [{
|
|
3165
|
-
readonly internalType: "uint256";
|
|
3166
|
-
readonly name: "orderIndex";
|
|
3167
|
-
readonly type: "uint256";
|
|
3168
|
-
}];
|
|
3169
|
-
readonly stateMutability: "nonpayable";
|
|
3170
|
-
readonly type: "function";
|
|
3171
|
-
}, {
|
|
3172
|
-
readonly inputs: readonly [{
|
|
3173
|
-
readonly components: readonly [{
|
|
3174
|
-
readonly internalType: "uint256";
|
|
3175
|
-
readonly name: "amountOffer";
|
|
3176
|
-
readonly type: "uint256";
|
|
3177
|
-
}, {
|
|
3178
|
-
readonly internalType: "contract IERC20";
|
|
3179
|
-
readonly name: "wantAsset";
|
|
3180
|
-
readonly type: "address";
|
|
3181
|
-
}, {
|
|
3182
|
-
readonly internalType: "address";
|
|
3183
|
-
readonly name: "intendedDepositor";
|
|
3184
|
-
readonly type: "address";
|
|
3185
|
-
}, {
|
|
3186
|
-
readonly internalType: "address";
|
|
3187
|
-
readonly name: "receiver";
|
|
3188
|
-
readonly type: "address";
|
|
3189
|
-
}, {
|
|
3190
|
-
readonly internalType: "address";
|
|
3191
|
-
readonly name: "refundReceiver";
|
|
3192
|
-
readonly type: "address";
|
|
3193
|
-
}, {
|
|
3194
|
-
readonly components: readonly [{
|
|
3195
|
-
readonly internalType: "enum WithdrawQueue.ApprovalMethod";
|
|
3196
|
-
readonly name: "approvalMethod";
|
|
3197
|
-
readonly type: "uint8";
|
|
3198
|
-
}, {
|
|
3199
|
-
readonly internalType: "uint8";
|
|
3200
|
-
readonly name: "approvalV";
|
|
3201
|
-
readonly type: "uint8";
|
|
3202
|
-
}, {
|
|
3203
|
-
readonly internalType: "bytes32";
|
|
3204
|
-
readonly name: "approvalR";
|
|
3205
|
-
readonly type: "bytes32";
|
|
3206
|
-
}, {
|
|
3207
|
-
readonly internalType: "bytes32";
|
|
3208
|
-
readonly name: "approvalS";
|
|
3209
|
-
readonly type: "bytes32";
|
|
3210
|
-
}, {
|
|
3211
|
-
readonly internalType: "bool";
|
|
3212
|
-
readonly name: "submitWithSignature";
|
|
3213
|
-
readonly type: "bool";
|
|
3214
|
-
}, {
|
|
3215
|
-
readonly internalType: "uint256";
|
|
3216
|
-
readonly name: "deadline";
|
|
3217
|
-
readonly type: "uint256";
|
|
3218
|
-
}, {
|
|
3219
|
-
readonly internalType: "bytes";
|
|
3220
|
-
readonly name: "eip2612Signature";
|
|
3221
|
-
readonly type: "bytes";
|
|
3222
|
-
}];
|
|
3223
|
-
readonly internalType: "struct WithdrawQueue.SignatureParams";
|
|
3224
|
-
readonly name: "signatureParams";
|
|
3225
|
-
readonly type: "tuple";
|
|
3226
|
-
}];
|
|
3227
|
-
readonly internalType: "struct WithdrawQueue.SubmitOrderParams";
|
|
3228
|
-
readonly name: "params";
|
|
3229
|
-
readonly type: "tuple";
|
|
3230
|
-
}];
|
|
3231
|
-
readonly name: "submitOrderAndProcessAll";
|
|
3232
|
-
readonly outputs: readonly [{
|
|
3233
|
-
readonly internalType: "uint256";
|
|
3234
|
-
readonly name: "orderIndex";
|
|
3235
|
-
readonly type: "uint256";
|
|
3236
|
-
}];
|
|
3237
|
-
readonly stateMutability: "nonpayable";
|
|
3238
|
-
readonly type: "function";
|
|
3239
|
-
}, {
|
|
3240
|
-
readonly inputs: readonly [];
|
|
3241
|
-
readonly name: "symbol";
|
|
3242
|
-
readonly outputs: readonly [{
|
|
3243
|
-
readonly internalType: "string";
|
|
3244
|
-
readonly name: "";
|
|
3245
|
-
readonly type: "string";
|
|
3246
|
-
}];
|
|
3247
|
-
readonly stateMutability: "view";
|
|
3248
|
-
readonly type: "function";
|
|
3249
|
-
}, {
|
|
3250
|
-
readonly inputs: readonly [{
|
|
3251
|
-
readonly internalType: "bytes4";
|
|
3252
|
-
readonly name: "interfaceId";
|
|
3253
|
-
readonly type: "bytes4";
|
|
3254
|
-
}];
|
|
3255
|
-
readonly name: "supportsInterface";
|
|
3256
|
-
readonly outputs: readonly [{
|
|
3257
|
-
readonly internalType: "bool";
|
|
3258
|
-
readonly name: "";
|
|
3259
|
-
readonly type: "bool";
|
|
3260
|
-
}];
|
|
3261
|
-
readonly stateMutability: "view";
|
|
3262
|
-
readonly type: "function";
|
|
3263
|
-
}, {
|
|
3264
|
-
readonly inputs: readonly [];
|
|
3265
|
-
readonly name: "tellerWithMultiAssetSupport";
|
|
3266
|
-
readonly outputs: readonly [{
|
|
3267
|
-
readonly internalType: "contract TellerWithMultiAssetSupport";
|
|
3268
|
-
readonly name: "";
|
|
3269
|
-
readonly type: "address";
|
|
3270
|
-
}];
|
|
3271
|
-
readonly stateMutability: "view";
|
|
3272
|
-
readonly type: "function";
|
|
3273
|
-
}, {
|
|
3274
|
-
readonly inputs: readonly [{
|
|
3275
|
-
readonly internalType: "uint256";
|
|
3276
|
-
readonly name: "tokenId";
|
|
3277
|
-
readonly type: "uint256";
|
|
3278
|
-
}];
|
|
3279
|
-
readonly name: "tokenByIndex";
|
|
3280
|
-
readonly outputs: readonly [{
|
|
3281
|
-
readonly internalType: "uint256";
|
|
3282
|
-
readonly name: "";
|
|
3283
|
-
readonly type: "uint256";
|
|
3284
|
-
}];
|
|
3285
|
-
readonly stateMutability: "view";
|
|
3286
|
-
readonly type: "function";
|
|
3287
|
-
}, {
|
|
3288
|
-
readonly inputs: readonly [{
|
|
3289
|
-
readonly internalType: "address";
|
|
3290
|
-
readonly name: "owner";
|
|
3291
|
-
readonly type: "address";
|
|
3292
|
-
}, {
|
|
3293
|
-
readonly internalType: "uint256";
|
|
3294
|
-
readonly name: "index";
|
|
3295
|
-
readonly type: "uint256";
|
|
3296
|
-
}];
|
|
3297
|
-
readonly name: "tokenOfOwnerByIndex";
|
|
3298
|
-
readonly outputs: readonly [{
|
|
3299
|
-
readonly internalType: "uint256";
|
|
3300
|
-
readonly name: "";
|
|
3301
|
-
readonly type: "uint256";
|
|
3302
|
-
}];
|
|
3303
|
-
readonly stateMutability: "view";
|
|
3304
|
-
readonly type: "function";
|
|
3305
|
-
}, {
|
|
3306
|
-
readonly inputs: readonly [{
|
|
3307
|
-
readonly internalType: "uint256";
|
|
3308
|
-
readonly name: "tokenId";
|
|
3309
|
-
readonly type: "uint256";
|
|
3310
|
-
}];
|
|
3311
|
-
readonly name: "tokenURI";
|
|
3312
|
-
readonly outputs: readonly [{
|
|
3313
|
-
readonly internalType: "string";
|
|
3314
|
-
readonly name: "";
|
|
3315
|
-
readonly type: "string";
|
|
3316
|
-
}];
|
|
3317
|
-
readonly stateMutability: "view";
|
|
3318
|
-
readonly type: "function";
|
|
3319
|
-
}, {
|
|
3320
|
-
readonly inputs: readonly [];
|
|
3321
|
-
readonly name: "totalSupply";
|
|
3322
|
-
readonly outputs: readonly [{
|
|
3323
|
-
readonly internalType: "uint256";
|
|
3324
|
-
readonly name: "";
|
|
3325
|
-
readonly type: "uint256";
|
|
3326
|
-
}];
|
|
3327
|
-
readonly stateMutability: "view";
|
|
3328
|
-
readonly type: "function";
|
|
3329
|
-
}, {
|
|
3330
|
-
readonly inputs: readonly [{
|
|
3331
|
-
readonly internalType: "address";
|
|
3332
|
-
readonly name: "from";
|
|
3333
|
-
readonly type: "address";
|
|
3334
|
-
}, {
|
|
3335
|
-
readonly internalType: "address";
|
|
3336
|
-
readonly name: "to";
|
|
3337
|
-
readonly type: "address";
|
|
3338
|
-
}, {
|
|
3339
|
-
readonly internalType: "uint256";
|
|
3340
|
-
readonly name: "tokenId";
|
|
3341
|
-
readonly type: "uint256";
|
|
3342
|
-
}];
|
|
3343
|
-
readonly name: "transferFrom";
|
|
3344
|
-
readonly outputs: readonly [];
|
|
3345
|
-
readonly stateMutability: "nonpayable";
|
|
3346
|
-
readonly type: "function";
|
|
3347
|
-
}, {
|
|
3348
|
-
readonly inputs: readonly [{
|
|
3349
|
-
readonly internalType: "address";
|
|
3350
|
-
readonly name: "from";
|
|
3351
|
-
readonly type: "address";
|
|
3352
|
-
}, {
|
|
3353
|
-
readonly internalType: "address";
|
|
3354
|
-
readonly name: "to";
|
|
3355
|
-
readonly type: "address";
|
|
3356
|
-
}, {
|
|
3357
|
-
readonly internalType: "uint256";
|
|
3358
|
-
readonly name: "tokenId";
|
|
3359
|
-
readonly type: "uint256";
|
|
3360
|
-
}];
|
|
3361
|
-
readonly name: "safeTransferFrom";
|
|
3362
|
-
readonly outputs: readonly [];
|
|
3363
|
-
readonly stateMutability: "nonpayable";
|
|
3364
|
-
readonly type: "function";
|
|
3365
|
-
}, {
|
|
3366
|
-
readonly inputs: readonly [{
|
|
3367
|
-
readonly internalType: "address";
|
|
3368
|
-
readonly name: "from";
|
|
3369
|
-
readonly type: "address";
|
|
3370
|
-
}, {
|
|
3371
|
-
readonly internalType: "address";
|
|
3372
|
-
readonly name: "to";
|
|
3373
|
-
readonly type: "address";
|
|
3374
|
-
}, {
|
|
3375
|
-
readonly internalType: "uint256";
|
|
3376
|
-
readonly name: "tokenId";
|
|
3377
|
-
readonly type: "uint256";
|
|
3378
|
-
}, {
|
|
3379
|
-
readonly internalType: "bytes";
|
|
3380
|
-
readonly name: "_data";
|
|
3381
|
-
readonly type: "bytes";
|
|
3382
|
-
}];
|
|
3383
|
-
readonly name: "safeTransferFrom";
|
|
3384
|
-
readonly outputs: readonly [];
|
|
3385
|
-
readonly stateMutability: "nonpayable";
|
|
3386
|
-
readonly type: "function";
|
|
3387
|
-
}, {
|
|
3388
|
-
readonly inputs: readonly [{
|
|
3389
|
-
readonly internalType: "address";
|
|
3390
|
-
readonly name: "operator";
|
|
3391
|
-
readonly type: "address";
|
|
3392
|
-
}, {
|
|
3393
|
-
readonly internalType: "bool";
|
|
3394
|
-
readonly name: "approved";
|
|
3395
|
-
readonly type: "bool";
|
|
3396
|
-
}];
|
|
3397
|
-
readonly name: "setApprovalForAll";
|
|
3398
|
-
readonly outputs: readonly [];
|
|
3399
|
-
readonly stateMutability: "nonpayable";
|
|
3400
|
-
readonly type: "function";
|
|
3401
|
-
}, {
|
|
3402
|
-
readonly inputs: readonly [{
|
|
3403
|
-
readonly internalType: "contract IFeeModule";
|
|
3404
|
-
readonly name: "_feeModule";
|
|
3405
|
-
readonly type: "address";
|
|
3406
|
-
}];
|
|
3407
|
-
readonly name: "setFeeModule";
|
|
3408
|
-
readonly outputs: readonly [];
|
|
3409
|
-
readonly stateMutability: "nonpayable";
|
|
3410
|
-
readonly type: "function";
|
|
3411
|
-
}, {
|
|
3412
|
-
readonly inputs: readonly [{
|
|
3413
|
-
readonly internalType: "address";
|
|
3414
|
-
readonly name: "_feeRecipient";
|
|
3415
|
-
readonly type: "address";
|
|
3416
|
-
}];
|
|
3417
|
-
readonly name: "setFeeRecipient";
|
|
3418
|
-
readonly outputs: readonly [];
|
|
3419
|
-
readonly stateMutability: "nonpayable";
|
|
3420
|
-
readonly type: "function";
|
|
3421
|
-
}, {
|
|
3422
|
-
readonly inputs: readonly [{
|
|
3423
|
-
readonly internalType: "contract TellerWithMultiAssetSupport";
|
|
3424
|
-
readonly name: "_newTeller";
|
|
3425
|
-
readonly type: "address";
|
|
3426
|
-
}];
|
|
3427
|
-
readonly name: "setTellerWithMultiAssetSupport";
|
|
3428
|
-
readonly outputs: readonly [];
|
|
3429
|
-
readonly stateMutability: "nonpayable";
|
|
3430
|
-
readonly type: "function";
|
|
3431
|
-
}, {
|
|
3432
|
-
readonly inputs: readonly [{
|
|
3433
|
-
readonly internalType: "address";
|
|
3434
|
-
readonly name: "newOwner";
|
|
3435
|
-
readonly type: "address";
|
|
3436
|
-
}];
|
|
3437
|
-
readonly name: "setOwner";
|
|
3438
|
-
readonly outputs: readonly [];
|
|
3439
|
-
readonly stateMutability: "nonpayable";
|
|
3440
|
-
readonly type: "function";
|
|
3441
|
-
}, {
|
|
3442
|
-
readonly inputs: readonly [{
|
|
3443
|
-
readonly internalType: "contract Authority";
|
|
3444
|
-
readonly name: "newAuthority";
|
|
3445
|
-
readonly type: "address";
|
|
3446
|
-
}];
|
|
3447
|
-
readonly name: "setAuthority";
|
|
3448
|
-
readonly outputs: readonly [];
|
|
3449
|
-
readonly stateMutability: "nonpayable";
|
|
3450
|
-
readonly type: "function";
|
|
3451
|
-
}, {
|
|
3452
|
-
readonly inputs: readonly [{
|
|
3453
|
-
readonly internalType: "uint256";
|
|
3454
|
-
readonly name: "_newMinimum";
|
|
3455
|
-
readonly type: "uint256";
|
|
3456
|
-
}];
|
|
3457
|
-
readonly name: "updateAssetMinimumOrderSize";
|
|
3458
|
-
readonly outputs: readonly [];
|
|
3459
|
-
readonly stateMutability: "nonpayable";
|
|
3460
|
-
readonly type: "function";
|
|
3461
|
-
}, {
|
|
3462
|
-
readonly inputs: readonly [{
|
|
3463
|
-
readonly internalType: "address";
|
|
3464
|
-
readonly name: "to";
|
|
3465
|
-
readonly type: "address";
|
|
3466
|
-
}, {
|
|
3467
|
-
readonly internalType: "uint256";
|
|
3468
|
-
readonly name: "tokenId";
|
|
3469
|
-
readonly type: "uint256";
|
|
3470
|
-
}];
|
|
3471
|
-
readonly name: "approve";
|
|
3472
|
-
readonly outputs: readonly [];
|
|
3473
|
-
readonly stateMutability: "nonpayable";
|
|
3474
|
-
readonly type: "function";
|
|
3475
|
-
}];
|
|
3476
|
-
|
|
3477
|
-
/**
|
|
3478
|
-
* @file Cancel withdrawal order functionality for WithdrawQueue contract
|
|
3479
|
-
* @module vaults/withdraw/cancel-withdraw
|
|
3480
|
-
*/
|
|
3481
|
-
|
|
3482
|
-
/**
|
|
3483
|
-
* Parameters for preparing a cancel withdrawal order transaction
|
|
3484
|
-
*
|
|
3485
|
-
* @interface PrepareCancelWithdrawOrderTxDataParams
|
|
3486
|
-
* @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
|
|
3487
|
-
* @property {Address} wantAsset - Address of the want token (used to validate the vault). Must match the vault's supported asset.
|
|
3488
|
-
* @property {ChainId} chainId - ID of the chain where the order exists. Must match the vault's chain.
|
|
3489
|
-
* @property {bigint} orderIndex - Index of the order to cancel (provided by user)
|
|
3490
|
-
*/
|
|
3491
|
-
interface PrepareCancelWithdrawOrderTxDataParams {
|
|
3492
|
-
vaultName: string;
|
|
3493
|
-
wantAsset: Address;
|
|
3494
|
-
chainId: ChainId;
|
|
3495
|
-
orderIndex: bigint;
|
|
3496
|
-
}
|
|
3497
|
-
/**
|
|
3498
|
-
* Transaction data for canceling a withdrawal order on the WithdrawQueue contract
|
|
3499
|
-
*
|
|
3500
|
-
* Ready-to-use transaction data that can be passed directly to viem's writeContract
|
|
3501
|
-
* or wagmi's useWriteContract hook.
|
|
3502
|
-
*
|
|
3503
|
-
* @interface CancelWithdrawOrderTxData
|
|
3504
|
-
*/
|
|
3505
|
-
interface CancelWithdrawOrderTxData {
|
|
3506
|
-
abi: typeof WithdrawQueueAbi;
|
|
3507
|
-
address: Address;
|
|
3508
|
-
functionName: "cancelOrder";
|
|
3509
|
-
args: [orderIndex: bigint];
|
|
3510
|
-
chainId: number;
|
|
3511
|
-
}
|
|
3512
|
-
/**
|
|
3513
|
-
* Prepares transaction data to cancel a withdrawal order on the WithdrawQueue contract
|
|
3514
|
-
*
|
|
3515
|
-
* The vault is resolved and validated against `vaultName`, `chainId`, and `wantAsset`
|
|
3516
|
-
* before any calldata is constructed. Only the order owner can cancel their order.
|
|
3517
|
-
*
|
|
3518
|
-
* @param {PrepareCancelWithdrawOrderTxDataParams} params - Parameters for the cancel operation
|
|
3519
|
-
* @returns {Promise<CancelWithdrawOrderTxData>} Promise resolving to the prepared transaction data
|
|
3520
|
-
* @throws {APIError} If vault not found, chain/asset mismatch, or contracts not configured
|
|
3521
|
-
*
|
|
3522
|
-
* @example
|
|
3523
|
-
* ```typescript
|
|
3524
|
-
* import { prepareCancelWithdrawOrderTxData } from "@paxoslabs/amplify-sdk";
|
|
3525
|
-
*
|
|
3526
|
-
* const txData = await prepareCancelWithdrawOrderTxData({
|
|
3527
|
-
* vaultName: "Amplify USDC Core",
|
|
3528
|
-
* wantAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
|
|
3529
|
-
* chainId: 1,
|
|
3530
|
-
* orderIndex: 42n,
|
|
3531
|
-
* });
|
|
3532
|
-
*
|
|
3533
|
-
* // Execute with viem
|
|
3534
|
-
* const hash = await walletClient.writeContract(txData);
|
|
3535
|
-
*
|
|
3536
|
-
* // Or with wagmi
|
|
3537
|
-
* const { writeContract } = useWriteContract();
|
|
3538
|
-
* await writeContract(txData);
|
|
3539
|
-
* ```
|
|
3540
|
-
*/
|
|
3541
|
-
declare const prepareCancelWithdrawOrderTxData: ({ vaultName, wantAsset, chainId, orderIndex, }: PrepareCancelWithdrawOrderTxDataParams) => Promise<CancelWithdrawOrderTxData>;
|
|
3542
|
-
|
|
3543
|
-
/**
|
|
3544
|
-
* @file Standard withdrawal functionality for WithdrawQueue contract
|
|
3545
|
-
* @module vaults/withdraw/standard-withdraw
|
|
3546
|
-
*/
|
|
3547
|
-
|
|
3548
|
-
/**
|
|
3549
|
-
* Empty signature params for submitOrder when no permit/signature is used
|
|
3550
|
-
*
|
|
3551
|
-
* The contract expects this struct even when using pre-approved allowance.
|
|
3552
|
-
* ApprovalMethod enum: 0 = NONE, 1 = PERMIT, 2 = ALLOWANCE
|
|
3553
|
-
*/
|
|
3554
|
-
declare const EMPTY_SIGNATURE_PARAMS: {
|
|
3555
|
-
readonly approvalMethod: 0;
|
|
3556
|
-
readonly approvalV: 0;
|
|
3557
|
-
readonly approvalR: `0x${string}`;
|
|
3558
|
-
readonly approvalS: `0x${string}`;
|
|
3559
|
-
readonly submitWithSignature: false;
|
|
3560
|
-
readonly deadline: 0n;
|
|
3561
|
-
readonly eip2612Signature: `0x${string}`;
|
|
3562
|
-
};
|
|
3563
|
-
/**
|
|
3564
|
-
* Parameters for preparing a submit order transaction
|
|
3565
|
-
*
|
|
3566
|
-
* @interface PrepareWithdrawOrderTxDataParams
|
|
3567
|
-
* @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
|
|
3568
|
-
* @property {Address} wantAsset - Address of the token to receive upon withdrawal. Must match the vault's supported asset.
|
|
3569
|
-
* @property {Address} userAddress - User's wallet address (used for intendedDepositor, receiver, refundReceiver)
|
|
3570
|
-
* @property {ChainId} chainId - ID of the chain where the vault is deployed. Must match the vault's chain.
|
|
3571
|
-
* @property {string} amountOffer - Amount of vault shares to withdraw as a decimal string
|
|
3572
|
-
*/
|
|
3573
|
-
interface PrepareWithdrawOrderTxDataParams {
|
|
3574
|
-
vaultName: string;
|
|
3575
|
-
wantAsset: Address;
|
|
3576
|
-
userAddress: Address;
|
|
3577
|
-
chainId: ChainId;
|
|
3578
|
-
amountOffer: string;
|
|
3579
|
-
}
|
|
3580
|
-
/**
|
|
3581
|
-
* Transaction data for submitting a withdrawal order to the WithdrawQueue contract
|
|
3582
|
-
*
|
|
3583
|
-
* Ready-to-use transaction data that can be passed directly to viem's writeContract
|
|
3584
|
-
* or wagmi's useWriteContract hook.
|
|
3585
|
-
*
|
|
3586
|
-
* @interface WithdrawOrderTxData
|
|
3587
|
-
*/
|
|
3588
|
-
interface WithdrawOrderTxData {
|
|
3589
|
-
abi: typeof WithdrawQueueAbi;
|
|
3590
|
-
address: Address;
|
|
3591
|
-
functionName: "submitOrder";
|
|
3592
|
-
args: [
|
|
3593
|
-
{
|
|
3594
|
-
amountOffer: bigint;
|
|
3595
|
-
wantAsset: Address;
|
|
3596
|
-
intendedDepositor: Address;
|
|
3597
|
-
receiver: Address;
|
|
3598
|
-
refundReceiver: Address;
|
|
3599
|
-
signatureParams: typeof EMPTY_SIGNATURE_PARAMS;
|
|
3600
|
-
}
|
|
3601
|
-
];
|
|
3602
|
-
chainId: number;
|
|
3603
|
-
}
|
|
3604
|
-
/**
|
|
3605
|
-
* Prepares transaction data to submit a withdrawal order to the WithdrawQueue contract
|
|
3606
|
-
*
|
|
3607
|
-
* The vault is resolved and validated against `vaultName`, `chainId`, and `wantAsset`
|
|
3608
|
-
* before any calldata is constructed. Unlike the old AtomicQueue, this does not require
|
|
3609
|
-
* exchange rate queries or slippage parameters.
|
|
3610
|
-
* It intentionally does not perform allowance pre-checks; callers should use
|
|
3611
|
-
* `prepareWithdrawalAuthorization` when they need approval routing.
|
|
3612
|
-
*
|
|
3613
|
-
* @param {PrepareWithdrawOrderTxDataParams} params - Parameters for the withdraw operation
|
|
3614
|
-
* @returns {Promise<WithdrawOrderTxData>} Promise resolving to the prepared transaction data
|
|
3615
|
-
* @throws {APIError} If vault not found, chain/asset mismatch, or contracts not configured
|
|
3616
|
-
*
|
|
3617
|
-
* @example
|
|
3618
|
-
* ```typescript
|
|
3619
|
-
* import { prepareWithdrawOrderTxData } from "@paxoslabs/amplify-sdk";
|
|
3620
|
-
*
|
|
3621
|
-
* const txData = await prepareWithdrawOrderTxData({
|
|
3622
|
-
* vaultName: "Amplify USDC Core",
|
|
3623
|
-
* wantAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
|
|
3624
|
-
* userAddress: "0x1234...",
|
|
3625
|
-
* chainId: 1,
|
|
3626
|
-
* amountOffer: "1.0", // 1 vault share
|
|
3627
|
-
* });
|
|
3628
|
-
*
|
|
3629
|
-
* // Execute with viem
|
|
3630
|
-
* const hash = await walletClient.writeContract(txData);
|
|
3631
|
-
*
|
|
3632
|
-
* // Or with wagmi
|
|
3633
|
-
* const { writeContract } = useWriteContract();
|
|
3634
|
-
* await writeContract(txData);
|
|
3635
|
-
* ```
|
|
3636
|
-
*/
|
|
3637
|
-
declare const prepareWithdrawOrderTxData: ({ vaultName, wantAsset, userAddress, chainId, amountOffer, }: PrepareWithdrawOrderTxDataParams) => Promise<WithdrawOrderTxData>;
|
|
3638
|
-
|
|
3639
|
-
/**
|
|
3640
|
-
* @file Unified withdrawal module with wrapper functions
|
|
3641
|
-
* @module vaults/withdraw
|
|
3642
|
-
*
|
|
3643
|
-
* Provides high-level wrapper functions for withdrawal authorization:
|
|
3644
|
-
* - `prepareWithdrawal`: Unified withdrawal preparation wrapper
|
|
3645
|
-
* - `prepareWithdrawalAuthorization`: Determines if approval is needed
|
|
3646
|
-
*/
|
|
3647
|
-
|
|
3648
|
-
/**
|
|
3649
|
-
* Authorization methods for withdrawal operations
|
|
3650
|
-
*
|
|
3651
|
-
* Withdrawals do not support EIP-2612 permit — only two paths:
|
|
3652
|
-
* - APPROVAL: ERC20 approval of vault shares to WithdrawQueue
|
|
3653
|
-
* - ALREADY_APPROVED: Existing allowance is sufficient
|
|
3654
|
-
*
|
|
3655
|
-
* @example
|
|
3656
|
-
* ```typescript
|
|
3657
|
-
* import { WithdrawAuthMethod } from "@paxoslabs/amplify-sdk";
|
|
3658
|
-
*
|
|
3659
|
-
* if (result.method === WithdrawAuthMethod.ALREADY_APPROVED) {
|
|
3660
|
-
* // Proceed directly to withdrawal
|
|
3661
|
-
* }
|
|
3662
|
-
* ```
|
|
3663
|
-
*/
|
|
3664
|
-
declare const WithdrawAuthMethod: {
|
|
3665
|
-
readonly APPROVAL: "approval";
|
|
3666
|
-
readonly ALREADY_APPROVED: "already_approved";
|
|
3667
|
-
};
|
|
3668
|
-
type WithdrawAuthMethod = (typeof WithdrawAuthMethod)[keyof typeof WithdrawAuthMethod];
|
|
3669
|
-
/**
|
|
3670
|
-
* Approval authorization result
|
|
3671
|
-
* Returned when an ERC20 approval transaction is needed
|
|
3672
|
-
*/
|
|
3673
|
-
interface WithdrawApprovalAuthorizationResult {
|
|
3674
|
-
method: typeof WithdrawAuthMethod.APPROVAL;
|
|
3675
|
-
/** Transaction data for ERC20 approve() call on vault shares */
|
|
3676
|
-
txData: ApproveWithdrawOrderTxData;
|
|
3677
|
-
}
|
|
3678
|
-
/**
|
|
3679
|
-
* Already approved authorization result
|
|
3680
|
-
* Returned when existing allowance is sufficient for the withdrawal
|
|
3681
|
-
*/
|
|
3682
|
-
interface WithdrawAlreadyApprovedAuthorizationResult {
|
|
3683
|
-
method: typeof WithdrawAuthMethod.ALREADY_APPROVED;
|
|
3684
|
-
/** Current allowance (human-readable) */
|
|
3685
|
-
allowance: string;
|
|
3686
|
-
/** Current allowance as BigInt string */
|
|
3687
|
-
allowanceAsBigInt: string;
|
|
3688
|
-
}
|
|
3689
|
-
/**
|
|
3690
|
-
* Discriminated union of all withdrawal authorization result types
|
|
3691
|
-
*
|
|
3692
|
-
* Use type guards or type narrowing with `result.method`:
|
|
3693
|
-
*
|
|
3694
|
-
* @example Using type guards (recommended)
|
|
3695
|
-
* ```typescript
|
|
3696
|
-
* import {
|
|
3697
|
-
* prepareWithdrawalAuthorization,
|
|
3698
|
-
* isWithdrawApprovalAuth,
|
|
3699
|
-
* isWithdrawAlreadyApprovedAuth,
|
|
3700
|
-
* } from "@paxoslabs/amplify-sdk";
|
|
3701
|
-
*
|
|
3702
|
-
* const result = await prepareWithdrawalAuthorization({...});
|
|
3703
|
-
*
|
|
3704
|
-
* if (isWithdrawApprovalAuth(result)) {
|
|
3705
|
-
* await writeContract(result.txData);
|
|
3706
|
-
* } else if (isWithdrawAlreadyApprovedAuth(result)) {
|
|
3707
|
-
* console.log(`Already approved: ${result.allowance}`);
|
|
3708
|
-
* }
|
|
3709
|
-
* ```
|
|
3710
|
-
*/
|
|
3711
|
-
type WithdrawAuthorizationResult = WithdrawApprovalAuthorizationResult | WithdrawAlreadyApprovedAuthorizationResult;
|
|
3712
|
-
/**
|
|
3713
|
-
* Type guard for approval authorization result
|
|
3714
|
-
*
|
|
3715
|
-
* @param result - Authorization result to check
|
|
3716
|
-
* @returns true if result requires an ERC20 approval transaction
|
|
3717
|
-
*/
|
|
3718
|
-
declare function isWithdrawApprovalAuth(result: WithdrawAuthorizationResult): result is WithdrawApprovalAuthorizationResult;
|
|
3719
|
-
/**
|
|
3720
|
-
* Type guard for already-approved authorization result
|
|
3721
|
-
*
|
|
3722
|
-
* @param result - Authorization result to check
|
|
3723
|
-
* @returns true if existing allowance is sufficient
|
|
3724
|
-
*/
|
|
3725
|
-
declare function isWithdrawAlreadyApprovedAuth(result: WithdrawAuthorizationResult): result is WithdrawAlreadyApprovedAuthorizationResult;
|
|
3726
|
-
/**
|
|
3727
|
-
* Parameters for prepareWithdrawalAuthorization
|
|
3728
|
-
*/
|
|
3729
|
-
interface PrepareWithdrawalAuthorizationParams {
|
|
3730
|
-
/** Human-readable vault name (e.g. "Amplify USDC Core") */
|
|
3731
|
-
vaultName: string;
|
|
3732
|
-
/** Token address the user wants to receive upon withdrawal. Must match the vault's supported asset. */
|
|
3733
|
-
wantAsset: Address;
|
|
3734
|
-
/** Amount of vault shares to withdraw as decimal string */
|
|
3735
|
-
withdrawAmount: string;
|
|
3736
|
-
/** User's wallet address (owner of vault shares) */
|
|
3737
|
-
userAddress: Address;
|
|
3738
|
-
/** Chain ID where the vault is deployed. Must match the vault's chain. */
|
|
3739
|
-
chainId: ChainId;
|
|
3740
|
-
/**
|
|
3741
|
-
* Force specific authorization routing behavior:
|
|
3742
|
-
* - "approval": Always return approval tx data
|
|
3743
|
-
* - "allowance_check": Always check allowance (skip smart-wallet heuristic)
|
|
3744
|
-
*/
|
|
3745
|
-
forceMethod?: "approval" | "allowance_check";
|
|
3746
|
-
}
|
|
3747
|
-
/**
|
|
3748
|
-
* Parameters for prepareWithdrawal
|
|
3749
|
-
* Unified withdrawal wrapper that maps to standard withdraw tx preparation.
|
|
3750
|
-
*/
|
|
3751
|
-
interface PrepareWithdrawalParams {
|
|
3752
|
-
/** Human-readable vault name (e.g. "Amplify USDC Core") */
|
|
3753
|
-
vaultName: string;
|
|
3754
|
-
/** Token address the user wants to receive upon withdrawal. Must match the vault's supported asset. */
|
|
3755
|
-
wantAsset: Address;
|
|
3756
|
-
/** Amount of vault shares to withdraw as decimal string */
|
|
3757
|
-
withdrawAmount: string;
|
|
3758
|
-
/** User's wallet address (owner of vault shares) */
|
|
3759
|
-
userAddress: Address;
|
|
3760
|
-
/** Chain ID where the vault is deployed. Must match the vault's chain. */
|
|
3761
|
-
chainId: ChainId;
|
|
3762
|
-
}
|
|
3763
|
-
/**
|
|
3764
|
-
* Unified withdrawal result
|
|
3765
|
-
* Currently routes to standard WithdrawQueue order preparation.
|
|
3766
|
-
*/
|
|
3767
|
-
type PrepareWithdrawalResult = WithdrawOrderTxData;
|
|
3768
|
-
/**
|
|
3769
|
-
* Unified withdrawal preparation wrapper
|
|
3770
|
-
*
|
|
3771
|
-
* Provides a stable high-level API for withdrawal execution while reusing
|
|
3772
|
-
* the low-level WithdrawQueue transaction builder under the hood.
|
|
3773
|
-
*
|
|
3774
|
-
* @param params - Withdrawal parameters
|
|
3775
|
-
* @returns Transaction data for submitOrder on WithdrawQueue
|
|
3776
|
-
* @throws {APIError} If preparation fails
|
|
3777
|
-
*/
|
|
3778
|
-
declare function prepareWithdrawal(params: PrepareWithdrawalParams): Promise<PrepareWithdrawalResult>;
|
|
3779
|
-
/**
|
|
3780
|
-
* Prepares authorization for a withdrawal operation
|
|
3781
|
-
*
|
|
3782
|
-
* Determines if the user needs to approve vault shares for the
|
|
3783
|
-
* WithdrawQueue contract:
|
|
3784
|
-
* 1. Optional force override (`forceMethod`)
|
|
3785
|
-
* 2. Auto smart-wallet heuristic (returns approval for smart wallets)
|
|
3786
|
-
* 3. Check existing allowance → if sufficient, return "already approved"
|
|
3787
|
-
* 4. Otherwise → return approval transaction data
|
|
3788
|
-
*
|
|
3789
|
-
* @param params - Authorization parameters
|
|
3790
|
-
* @returns Discriminated union of authorization results
|
|
3791
|
-
* @throws {APIError} If vault not found or approval check fails
|
|
3792
|
-
*
|
|
3793
|
-
* @example
|
|
3794
|
-
* ```typescript
|
|
3795
|
-
* import {
|
|
3796
|
-
* prepareWithdrawalAuthorization,
|
|
3797
|
-
* WithdrawAuthMethod,
|
|
3798
|
-
* } from "@paxoslabs/amplify-sdk";
|
|
3799
|
-
*
|
|
3800
|
-
* const authResult = await prepareWithdrawalAuthorization({
|
|
3801
|
-
* vaultName: "Amplify USDC Core",
|
|
3802
|
-
* wantAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
3803
|
-
* withdrawAmount: "1.0",
|
|
3804
|
-
* userAddress: "0x1234...",
|
|
3805
|
-
* chainId: 1,
|
|
3806
|
-
* });
|
|
3807
|
-
*
|
|
3808
|
-
* if (authResult.method === WithdrawAuthMethod.APPROVAL) {
|
|
3809
|
-
* await writeContract(authResult.txData);
|
|
3810
|
-
* // Wait for confirmation, then submit withdraw order
|
|
3811
|
-
* } else {
|
|
3812
|
-
* // Already approved, proceed to withdrawal
|
|
3813
|
-
* }
|
|
3814
|
-
* ```
|
|
3815
|
-
*/
|
|
3816
|
-
declare function prepareWithdrawalAuthorization(params: PrepareWithdrawalAuthorizationParams): Promise<WithdrawAuthorizationResult>;
|
|
3817
|
-
|
|
3818
|
-
export { type AlreadyApprovedAuthorizationResult, type ApprovalAuthorizationResult, type ApproveDepositTokenTxData, type ApproveWithdrawOrderTxData, type CancelWithdrawOrderTxData, DepositAuthMethod, type DepositAuthorizationResult, type DepositTxData, type EIP712Domain, PERMIT_TYPES, type ParsedPermitSignature, type PermitAuthorizationResult, type PermitDepositResult, type PermitSignatureData, type PrepareApproveDepositTokenTxParams, type PrepareApproveWithdrawOrderTxDataParams, type PrepareCancelWithdrawOrderTxDataParams, type PrepareDepositAuthorizationParams, type PrepareDepositParams, type PrepareDepositPermitSignatureParams, type PrepareDepositResult, type PrepareDepositTxDataParams, type PrepareDepositWithPermitTxDataParams, type PrepareWithdrawOrderTxDataParams, type PrepareWithdrawalAuthorizationParams, type PrepareWithdrawalParams, type PrepareWithdrawalResult, type StandardDepositResult, type UnencodedDepositWithPermitData, type WithdrawAlreadyApprovedAuthorizationResult, type WithdrawApprovalAuthorizationResult, WithdrawAuthMethod, type WithdrawAuthorizationResult, type WithdrawOrderTxData, isAlreadyApprovedAuth, isApprovalAuth, isPermitAuth, isWithdrawAlreadyApprovedAuth, isWithdrawApprovalAuth, parsePermitSignature, prepareApproveDepositTokenTxData, prepareApproveWithdrawOrderTxData, prepareCancelWithdrawOrderTxData, prepareDeposit, prepareDepositAuthorization, prepareDepositPermitSignature, prepareDepositTxData, prepareDepositWithPermitTxData, prepareWithdrawOrderTxData, prepareWithdrawal, prepareWithdrawalAuthorization, toEthSignTypedDataV4 };
|