@oydual31/more-vaults-sdk 0.2.9 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/{spokeRoutes-FgKCJQYa.d.cts → spokeRoutes-DK7cIW4z.d.cts} +4 -0
- package/dist/{spokeRoutes-FgKCJQYa.d.ts → spokeRoutes-DK7cIW4z.d.ts} +4 -0
- package/dist/viem/index.cjs +604 -5
- package/dist/viem/index.cjs.map +1 -1
- package/dist/viem/index.d.cts +721 -3
- package/dist/viem/index.d.ts +721 -3
- package/dist/viem/index.js +587 -7
- package/dist/viem/index.js.map +1 -1
- package/package.json +1 -1
- package/src/viem/abis.ts +329 -0
- package/src/viem/curatorMulticall.ts +299 -0
- package/src/viem/curatorStatus.ts +255 -0
- package/src/viem/index.ts +34 -0
- package/src/viem/types.ts +79 -0
- package/src/viem/userHelpers.ts +22 -6
package/dist/viem/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Address, Hash, WalletClient, PublicClient } from 'viem';
|
|
2
2
|
export { PublicClient as SdkPublicClient } from 'viem';
|
|
3
|
-
export { A as AsyncRequestFinalResult, a as AsyncRequestStatus, b as AsyncRequestStatusInfo, D as DepositBlockReason, c as DepositEligibility, I as InboundRoute, d as InboundRouteWithBalance, M as MaxWithdrawable, e as MultiChainUserPosition, N as NATIVE_SYMBOL, O as OMNI_FACTORY_ADDRESS, f as OutboundRoute, S as SpokeBalance, U as UserBalances, g as UserPosition, V as VaultDistribution, h as VaultMetadata, i as VaultMode, j as VaultStatus, k as VaultSummary, l as VaultTopology, m as canDeposit, n as discoverVaultTopology, o as ensureAllowance, p as getAllVaultChainIds, q as getAsyncRequestStatus, r as getAsyncRequestStatusLabel, s as getFullVaultTopology, t as getInboundRoutes, u as getMaxWithdrawable, v as getOutboundRoutes, w as getUserBalances, x as getUserBalancesForRoutes, y as getUserPosition, z as getUserPositionMultiChain, B as getVaultDistribution, C as getVaultDistributionWithTopology, E as getVaultMetadata, F as getVaultStatus, G as getVaultSummary, H as getVaultTopology, J as isAsyncMode, K as isOnHubChain, L as previewDeposit, P as previewRedeem, Q as quoteLzFee, R as quoteRouteDepositFee, T as waitForAsyncRequest, W as waitForTx } from '../spokeRoutes-
|
|
3
|
+
export { A as AsyncRequestFinalResult, a as AsyncRequestStatus, b as AsyncRequestStatusInfo, D as DepositBlockReason, c as DepositEligibility, I as InboundRoute, d as InboundRouteWithBalance, M as MaxWithdrawable, e as MultiChainUserPosition, N as NATIVE_SYMBOL, O as OMNI_FACTORY_ADDRESS, f as OutboundRoute, S as SpokeBalance, U as UserBalances, g as UserPosition, V as VaultDistribution, h as VaultMetadata, i as VaultMode, j as VaultStatus, k as VaultSummary, l as VaultTopology, m as canDeposit, n as discoverVaultTopology, o as ensureAllowance, p as getAllVaultChainIds, q as getAsyncRequestStatus, r as getAsyncRequestStatusLabel, s as getFullVaultTopology, t as getInboundRoutes, u as getMaxWithdrawable, v as getOutboundRoutes, w as getUserBalances, x as getUserBalancesForRoutes, y as getUserPosition, z as getUserPositionMultiChain, B as getVaultDistribution, C as getVaultDistributionWithTopology, E as getVaultMetadata, F as getVaultStatus, G as getVaultSummary, H as getVaultTopology, J as isAsyncMode, K as isOnHubChain, L as previewDeposit, P as previewRedeem, Q as quoteLzFee, R as quoteRouteDepositFee, T as waitForAsyncRequest, W as waitForTx } from '../spokeRoutes-DK7cIW4z.js';
|
|
4
4
|
|
|
5
5
|
/** EVM Chain IDs for chains supported by MoreVaults */
|
|
6
6
|
declare const CHAIN_IDS: {
|
|
@@ -1070,6 +1070,488 @@ declare const OFT_ABI: readonly [{
|
|
|
1070
1070
|
}];
|
|
1071
1071
|
readonly stateMutability: "view";
|
|
1072
1072
|
}];
|
|
1073
|
+
/**
|
|
1074
|
+
* MulticallFacet ABI — curator action submission and execution with timelock.
|
|
1075
|
+
*/
|
|
1076
|
+
declare const MULTICALL_ABI: readonly [{
|
|
1077
|
+
readonly type: "function";
|
|
1078
|
+
readonly name: "submitActions";
|
|
1079
|
+
readonly inputs: readonly [{
|
|
1080
|
+
readonly name: "actionsData";
|
|
1081
|
+
readonly type: "bytes[]";
|
|
1082
|
+
}];
|
|
1083
|
+
readonly outputs: readonly [{
|
|
1084
|
+
readonly name: "nonce";
|
|
1085
|
+
readonly type: "uint256";
|
|
1086
|
+
}];
|
|
1087
|
+
readonly stateMutability: "nonpayable";
|
|
1088
|
+
}, {
|
|
1089
|
+
readonly type: "function";
|
|
1090
|
+
readonly name: "executeActions";
|
|
1091
|
+
readonly inputs: readonly [{
|
|
1092
|
+
readonly name: "actionsNonce";
|
|
1093
|
+
readonly type: "uint256";
|
|
1094
|
+
}];
|
|
1095
|
+
readonly outputs: readonly [];
|
|
1096
|
+
readonly stateMutability: "nonpayable";
|
|
1097
|
+
}, {
|
|
1098
|
+
readonly type: "function";
|
|
1099
|
+
readonly name: "getPendingActions";
|
|
1100
|
+
readonly inputs: readonly [{
|
|
1101
|
+
readonly name: "actionsNonce";
|
|
1102
|
+
readonly type: "uint256";
|
|
1103
|
+
}];
|
|
1104
|
+
readonly outputs: readonly [{
|
|
1105
|
+
readonly name: "actionsData";
|
|
1106
|
+
readonly type: "bytes[]";
|
|
1107
|
+
}, {
|
|
1108
|
+
readonly name: "pendingUntil";
|
|
1109
|
+
readonly type: "uint256";
|
|
1110
|
+
}];
|
|
1111
|
+
readonly stateMutability: "view";
|
|
1112
|
+
}, {
|
|
1113
|
+
readonly type: "function";
|
|
1114
|
+
readonly name: "getCurrentNonce";
|
|
1115
|
+
readonly inputs: readonly [];
|
|
1116
|
+
readonly outputs: readonly [{
|
|
1117
|
+
readonly name: "";
|
|
1118
|
+
readonly type: "uint256";
|
|
1119
|
+
}];
|
|
1120
|
+
readonly stateMutability: "view";
|
|
1121
|
+
}, {
|
|
1122
|
+
readonly type: "function";
|
|
1123
|
+
readonly name: "vetoActions";
|
|
1124
|
+
readonly inputs: readonly [{
|
|
1125
|
+
readonly name: "actionsNonces";
|
|
1126
|
+
readonly type: "uint256[]";
|
|
1127
|
+
}];
|
|
1128
|
+
readonly outputs: readonly [];
|
|
1129
|
+
readonly stateMutability: "nonpayable";
|
|
1130
|
+
}];
|
|
1131
|
+
/**
|
|
1132
|
+
* GenericDexFacet ABI — single and batch token swaps through any DEX aggregator.
|
|
1133
|
+
*/
|
|
1134
|
+
declare const DEX_ABI: readonly [{
|
|
1135
|
+
readonly type: "function";
|
|
1136
|
+
readonly name: "executeSwap";
|
|
1137
|
+
readonly inputs: readonly [{
|
|
1138
|
+
readonly name: "params";
|
|
1139
|
+
readonly type: "tuple";
|
|
1140
|
+
readonly components: readonly [{
|
|
1141
|
+
readonly name: "targetContract";
|
|
1142
|
+
readonly type: "address";
|
|
1143
|
+
}, {
|
|
1144
|
+
readonly name: "tokenIn";
|
|
1145
|
+
readonly type: "address";
|
|
1146
|
+
}, {
|
|
1147
|
+
readonly name: "tokenOut";
|
|
1148
|
+
readonly type: "address";
|
|
1149
|
+
}, {
|
|
1150
|
+
readonly name: "maxAmountIn";
|
|
1151
|
+
readonly type: "uint256";
|
|
1152
|
+
}, {
|
|
1153
|
+
readonly name: "minAmountOut";
|
|
1154
|
+
readonly type: "uint256";
|
|
1155
|
+
}, {
|
|
1156
|
+
readonly name: "swapCallData";
|
|
1157
|
+
readonly type: "bytes";
|
|
1158
|
+
}];
|
|
1159
|
+
}];
|
|
1160
|
+
readonly outputs: readonly [{
|
|
1161
|
+
readonly name: "amountOut";
|
|
1162
|
+
readonly type: "uint256";
|
|
1163
|
+
}];
|
|
1164
|
+
readonly stateMutability: "nonpayable";
|
|
1165
|
+
}, {
|
|
1166
|
+
readonly type: "function";
|
|
1167
|
+
readonly name: "executeBatchSwap";
|
|
1168
|
+
readonly inputs: readonly [{
|
|
1169
|
+
readonly name: "params";
|
|
1170
|
+
readonly type: "tuple";
|
|
1171
|
+
readonly components: readonly [{
|
|
1172
|
+
readonly name: "swaps";
|
|
1173
|
+
readonly type: "tuple[]";
|
|
1174
|
+
readonly components: readonly [{
|
|
1175
|
+
readonly name: "targetContract";
|
|
1176
|
+
readonly type: "address";
|
|
1177
|
+
}, {
|
|
1178
|
+
readonly name: "tokenIn";
|
|
1179
|
+
readonly type: "address";
|
|
1180
|
+
}, {
|
|
1181
|
+
readonly name: "tokenOut";
|
|
1182
|
+
readonly type: "address";
|
|
1183
|
+
}, {
|
|
1184
|
+
readonly name: "maxAmountIn";
|
|
1185
|
+
readonly type: "uint256";
|
|
1186
|
+
}, {
|
|
1187
|
+
readonly name: "minAmountOut";
|
|
1188
|
+
readonly type: "uint256";
|
|
1189
|
+
}, {
|
|
1190
|
+
readonly name: "swapCallData";
|
|
1191
|
+
readonly type: "bytes";
|
|
1192
|
+
}];
|
|
1193
|
+
}];
|
|
1194
|
+
}];
|
|
1195
|
+
readonly outputs: readonly [{
|
|
1196
|
+
readonly name: "amountsOut";
|
|
1197
|
+
readonly type: "uint256[]";
|
|
1198
|
+
}];
|
|
1199
|
+
readonly stateMutability: "nonpayable";
|
|
1200
|
+
}];
|
|
1201
|
+
/**
|
|
1202
|
+
* BridgeFacet ABI — curator bridging and cross-chain request initiation.
|
|
1203
|
+
* (extends the existing BRIDGE_ABI with curator-specific functions)
|
|
1204
|
+
*/
|
|
1205
|
+
declare const BRIDGE_FACET_ABI: readonly [{
|
|
1206
|
+
readonly type: "function";
|
|
1207
|
+
readonly name: "executeBridging";
|
|
1208
|
+
readonly inputs: readonly [{
|
|
1209
|
+
readonly name: "adapter";
|
|
1210
|
+
readonly type: "address";
|
|
1211
|
+
}, {
|
|
1212
|
+
readonly name: "token";
|
|
1213
|
+
readonly type: "address";
|
|
1214
|
+
}, {
|
|
1215
|
+
readonly name: "amount";
|
|
1216
|
+
readonly type: "uint256";
|
|
1217
|
+
}, {
|
|
1218
|
+
readonly name: "bridgeSpecificParams";
|
|
1219
|
+
readonly type: "bytes";
|
|
1220
|
+
}];
|
|
1221
|
+
readonly outputs: readonly [];
|
|
1222
|
+
readonly stateMutability: "payable";
|
|
1223
|
+
}, {
|
|
1224
|
+
readonly type: "function";
|
|
1225
|
+
readonly name: "initVaultActionRequest";
|
|
1226
|
+
readonly inputs: readonly [{
|
|
1227
|
+
readonly name: "actionType";
|
|
1228
|
+
readonly type: "uint8";
|
|
1229
|
+
}, {
|
|
1230
|
+
readonly name: "actionCallData";
|
|
1231
|
+
readonly type: "bytes";
|
|
1232
|
+
}, {
|
|
1233
|
+
readonly name: "amountLimit";
|
|
1234
|
+
readonly type: "uint256";
|
|
1235
|
+
}, {
|
|
1236
|
+
readonly name: "extraOptions";
|
|
1237
|
+
readonly type: "bytes";
|
|
1238
|
+
}];
|
|
1239
|
+
readonly outputs: readonly [{
|
|
1240
|
+
readonly name: "guid";
|
|
1241
|
+
readonly type: "bytes32";
|
|
1242
|
+
}];
|
|
1243
|
+
readonly stateMutability: "payable";
|
|
1244
|
+
}, {
|
|
1245
|
+
readonly type: "function";
|
|
1246
|
+
readonly name: "executeRequest";
|
|
1247
|
+
readonly inputs: readonly [{
|
|
1248
|
+
readonly name: "guid";
|
|
1249
|
+
readonly type: "bytes32";
|
|
1250
|
+
}];
|
|
1251
|
+
readonly outputs: readonly [];
|
|
1252
|
+
readonly stateMutability: "nonpayable";
|
|
1253
|
+
}];
|
|
1254
|
+
/**
|
|
1255
|
+
* ERC7540Facet ABI — async deposit and redeem operations on ERC7540 vaults.
|
|
1256
|
+
*/
|
|
1257
|
+
declare const ERC7540_FACET_ABI: readonly [{
|
|
1258
|
+
readonly type: "function";
|
|
1259
|
+
readonly name: "erc7540RequestDeposit";
|
|
1260
|
+
readonly inputs: readonly [{
|
|
1261
|
+
readonly name: "vault";
|
|
1262
|
+
readonly type: "address";
|
|
1263
|
+
}, {
|
|
1264
|
+
readonly name: "assets";
|
|
1265
|
+
readonly type: "uint256";
|
|
1266
|
+
}];
|
|
1267
|
+
readonly outputs: readonly [{
|
|
1268
|
+
readonly name: "requestId";
|
|
1269
|
+
readonly type: "uint256";
|
|
1270
|
+
}];
|
|
1271
|
+
readonly stateMutability: "nonpayable";
|
|
1272
|
+
}, {
|
|
1273
|
+
readonly type: "function";
|
|
1274
|
+
readonly name: "erc7540RequestRedeem";
|
|
1275
|
+
readonly inputs: readonly [{
|
|
1276
|
+
readonly name: "vault";
|
|
1277
|
+
readonly type: "address";
|
|
1278
|
+
}, {
|
|
1279
|
+
readonly name: "shares";
|
|
1280
|
+
readonly type: "uint256";
|
|
1281
|
+
}];
|
|
1282
|
+
readonly outputs: readonly [{
|
|
1283
|
+
readonly name: "requestId";
|
|
1284
|
+
readonly type: "uint256";
|
|
1285
|
+
}];
|
|
1286
|
+
readonly stateMutability: "nonpayable";
|
|
1287
|
+
}, {
|
|
1288
|
+
readonly type: "function";
|
|
1289
|
+
readonly name: "erc7540Deposit";
|
|
1290
|
+
readonly inputs: readonly [{
|
|
1291
|
+
readonly name: "vault";
|
|
1292
|
+
readonly type: "address";
|
|
1293
|
+
}, {
|
|
1294
|
+
readonly name: "assets";
|
|
1295
|
+
readonly type: "uint256";
|
|
1296
|
+
}];
|
|
1297
|
+
readonly outputs: readonly [{
|
|
1298
|
+
readonly name: "shares";
|
|
1299
|
+
readonly type: "uint256";
|
|
1300
|
+
}];
|
|
1301
|
+
readonly stateMutability: "nonpayable";
|
|
1302
|
+
}, {
|
|
1303
|
+
readonly type: "function";
|
|
1304
|
+
readonly name: "erc7540Redeem";
|
|
1305
|
+
readonly inputs: readonly [{
|
|
1306
|
+
readonly name: "vault";
|
|
1307
|
+
readonly type: "address";
|
|
1308
|
+
}, {
|
|
1309
|
+
readonly name: "shares";
|
|
1310
|
+
readonly type: "uint256";
|
|
1311
|
+
}];
|
|
1312
|
+
readonly outputs: readonly [{
|
|
1313
|
+
readonly name: "assets";
|
|
1314
|
+
readonly type: "uint256";
|
|
1315
|
+
}];
|
|
1316
|
+
readonly stateMutability: "nonpayable";
|
|
1317
|
+
}];
|
|
1318
|
+
/**
|
|
1319
|
+
* ConfigurationFacet ABI — extended with curator-relevant read functions.
|
|
1320
|
+
* Augments the existing CONFIG_ABI with additional getters needed by curator dashboard.
|
|
1321
|
+
*/
|
|
1322
|
+
declare const CURATOR_CONFIG_ABI: readonly [{
|
|
1323
|
+
readonly type: "function";
|
|
1324
|
+
readonly name: "curator";
|
|
1325
|
+
readonly inputs: readonly [];
|
|
1326
|
+
readonly outputs: readonly [{
|
|
1327
|
+
readonly name: "";
|
|
1328
|
+
readonly type: "address";
|
|
1329
|
+
}];
|
|
1330
|
+
readonly stateMutability: "view";
|
|
1331
|
+
}, {
|
|
1332
|
+
readonly type: "function";
|
|
1333
|
+
readonly name: "timeLockPeriod";
|
|
1334
|
+
readonly inputs: readonly [];
|
|
1335
|
+
readonly outputs: readonly [{
|
|
1336
|
+
readonly name: "";
|
|
1337
|
+
readonly type: "uint256";
|
|
1338
|
+
}];
|
|
1339
|
+
readonly stateMutability: "view";
|
|
1340
|
+
}, {
|
|
1341
|
+
readonly type: "function";
|
|
1342
|
+
readonly name: "getAvailableAssets";
|
|
1343
|
+
readonly inputs: readonly [];
|
|
1344
|
+
readonly outputs: readonly [{
|
|
1345
|
+
readonly name: "";
|
|
1346
|
+
readonly type: "address[]";
|
|
1347
|
+
}];
|
|
1348
|
+
readonly stateMutability: "view";
|
|
1349
|
+
}, {
|
|
1350
|
+
readonly type: "function";
|
|
1351
|
+
readonly name: "getMaxSlippagePercent";
|
|
1352
|
+
readonly inputs: readonly [];
|
|
1353
|
+
readonly outputs: readonly [{
|
|
1354
|
+
readonly name: "";
|
|
1355
|
+
readonly type: "uint256";
|
|
1356
|
+
}];
|
|
1357
|
+
readonly stateMutability: "view";
|
|
1358
|
+
}, {
|
|
1359
|
+
readonly type: "function";
|
|
1360
|
+
readonly name: "getCrossChainAccountingManager";
|
|
1361
|
+
readonly inputs: readonly [];
|
|
1362
|
+
readonly outputs: readonly [{
|
|
1363
|
+
readonly name: "";
|
|
1364
|
+
readonly type: "address";
|
|
1365
|
+
}];
|
|
1366
|
+
readonly stateMutability: "view";
|
|
1367
|
+
}, {
|
|
1368
|
+
readonly type: "function";
|
|
1369
|
+
readonly name: "paused";
|
|
1370
|
+
readonly inputs: readonly [];
|
|
1371
|
+
readonly outputs: readonly [{
|
|
1372
|
+
readonly name: "";
|
|
1373
|
+
readonly type: "bool";
|
|
1374
|
+
}];
|
|
1375
|
+
readonly stateMutability: "view";
|
|
1376
|
+
}];
|
|
1377
|
+
/**
|
|
1378
|
+
* LzAdapter ABI — fee quoting for bridge and LZ Read operations.
|
|
1379
|
+
*/
|
|
1380
|
+
declare const LZ_ADAPTER_ABI: readonly [{
|
|
1381
|
+
readonly type: "function";
|
|
1382
|
+
readonly name: "quoteBridgeFee";
|
|
1383
|
+
readonly inputs: readonly [{
|
|
1384
|
+
readonly name: "bridgeSpecificParams";
|
|
1385
|
+
readonly type: "bytes";
|
|
1386
|
+
}];
|
|
1387
|
+
readonly outputs: readonly [{
|
|
1388
|
+
readonly name: "nativeFee";
|
|
1389
|
+
readonly type: "uint256";
|
|
1390
|
+
}];
|
|
1391
|
+
readonly stateMutability: "view";
|
|
1392
|
+
}, {
|
|
1393
|
+
readonly type: "function";
|
|
1394
|
+
readonly name: "quoteReadFee";
|
|
1395
|
+
readonly inputs: readonly [{
|
|
1396
|
+
readonly name: "vaults";
|
|
1397
|
+
readonly type: "address[]";
|
|
1398
|
+
}, {
|
|
1399
|
+
readonly name: "eids";
|
|
1400
|
+
readonly type: "uint32[]";
|
|
1401
|
+
}, {
|
|
1402
|
+
readonly name: "_extraOptions";
|
|
1403
|
+
readonly type: "bytes";
|
|
1404
|
+
}];
|
|
1405
|
+
readonly outputs: readonly [{
|
|
1406
|
+
readonly name: "fee";
|
|
1407
|
+
readonly type: "tuple";
|
|
1408
|
+
readonly components: readonly [{
|
|
1409
|
+
readonly name: "nativeFee";
|
|
1410
|
+
readonly type: "uint256";
|
|
1411
|
+
}, {
|
|
1412
|
+
readonly name: "lzTokenFee";
|
|
1413
|
+
readonly type: "uint256";
|
|
1414
|
+
}];
|
|
1415
|
+
}];
|
|
1416
|
+
readonly stateMutability: "view";
|
|
1417
|
+
}];
|
|
1418
|
+
/**
|
|
1419
|
+
* ERC4626Facet ABI — synchronous deposit and redeem into whitelisted ERC-4626 vaults.
|
|
1420
|
+
*/
|
|
1421
|
+
declare const ERC4626_FACET_ABI: readonly [{
|
|
1422
|
+
readonly type: "function";
|
|
1423
|
+
readonly name: "erc4626Deposit";
|
|
1424
|
+
readonly inputs: readonly [{
|
|
1425
|
+
readonly name: "vault";
|
|
1426
|
+
readonly type: "address";
|
|
1427
|
+
}, {
|
|
1428
|
+
readonly name: "assets";
|
|
1429
|
+
readonly type: "uint256";
|
|
1430
|
+
}];
|
|
1431
|
+
readonly outputs: readonly [{
|
|
1432
|
+
readonly name: "shares";
|
|
1433
|
+
readonly type: "uint256";
|
|
1434
|
+
}];
|
|
1435
|
+
readonly stateMutability: "nonpayable";
|
|
1436
|
+
}, {
|
|
1437
|
+
readonly type: "function";
|
|
1438
|
+
readonly name: "erc4626Redeem";
|
|
1439
|
+
readonly inputs: readonly [{
|
|
1440
|
+
readonly name: "vault";
|
|
1441
|
+
readonly type: "address";
|
|
1442
|
+
}, {
|
|
1443
|
+
readonly name: "shares";
|
|
1444
|
+
readonly type: "uint256";
|
|
1445
|
+
}];
|
|
1446
|
+
readonly outputs: readonly [{
|
|
1447
|
+
readonly name: "assets";
|
|
1448
|
+
readonly type: "uint256";
|
|
1449
|
+
}];
|
|
1450
|
+
readonly stateMutability: "nonpayable";
|
|
1451
|
+
}];
|
|
1452
|
+
/**
|
|
1453
|
+
* Vault analysis ABIs — per-vault whitelist and registry reads.
|
|
1454
|
+
*/
|
|
1455
|
+
declare const VAULT_ANALYSIS_ABI: readonly [{
|
|
1456
|
+
readonly type: "function";
|
|
1457
|
+
readonly name: "getAvailableAssets";
|
|
1458
|
+
readonly inputs: readonly [];
|
|
1459
|
+
readonly outputs: readonly [{
|
|
1460
|
+
readonly type: "address[]";
|
|
1461
|
+
}];
|
|
1462
|
+
readonly stateMutability: "view";
|
|
1463
|
+
}, {
|
|
1464
|
+
readonly type: "function";
|
|
1465
|
+
readonly name: "getDepositableAssets";
|
|
1466
|
+
readonly inputs: readonly [];
|
|
1467
|
+
readonly outputs: readonly [{
|
|
1468
|
+
readonly type: "address[]";
|
|
1469
|
+
}];
|
|
1470
|
+
readonly stateMutability: "view";
|
|
1471
|
+
}, {
|
|
1472
|
+
readonly type: "function";
|
|
1473
|
+
readonly name: "isAssetAvailable";
|
|
1474
|
+
readonly inputs: readonly [{
|
|
1475
|
+
readonly name: "asset";
|
|
1476
|
+
readonly type: "address";
|
|
1477
|
+
}];
|
|
1478
|
+
readonly outputs: readonly [{
|
|
1479
|
+
readonly type: "bool";
|
|
1480
|
+
}];
|
|
1481
|
+
readonly stateMutability: "view";
|
|
1482
|
+
}, {
|
|
1483
|
+
readonly type: "function";
|
|
1484
|
+
readonly name: "isAssetDepositable";
|
|
1485
|
+
readonly inputs: readonly [{
|
|
1486
|
+
readonly name: "asset";
|
|
1487
|
+
readonly type: "address";
|
|
1488
|
+
}];
|
|
1489
|
+
readonly outputs: readonly [{
|
|
1490
|
+
readonly type: "bool";
|
|
1491
|
+
}];
|
|
1492
|
+
readonly stateMutability: "view";
|
|
1493
|
+
}, {
|
|
1494
|
+
readonly type: "function";
|
|
1495
|
+
readonly name: "isDepositWhitelistEnabled";
|
|
1496
|
+
readonly inputs: readonly [];
|
|
1497
|
+
readonly outputs: readonly [{
|
|
1498
|
+
readonly type: "bool";
|
|
1499
|
+
}];
|
|
1500
|
+
readonly stateMutability: "view";
|
|
1501
|
+
}, {
|
|
1502
|
+
readonly type: "function";
|
|
1503
|
+
readonly name: "getAvailableToDeposit";
|
|
1504
|
+
readonly inputs: readonly [{
|
|
1505
|
+
readonly name: "depositor";
|
|
1506
|
+
readonly type: "address";
|
|
1507
|
+
}];
|
|
1508
|
+
readonly outputs: readonly [{
|
|
1509
|
+
readonly type: "uint256";
|
|
1510
|
+
}];
|
|
1511
|
+
readonly stateMutability: "view";
|
|
1512
|
+
}, {
|
|
1513
|
+
readonly type: "function";
|
|
1514
|
+
readonly name: "moreVaultsRegistry";
|
|
1515
|
+
readonly inputs: readonly [];
|
|
1516
|
+
readonly outputs: readonly [{
|
|
1517
|
+
readonly type: "address";
|
|
1518
|
+
}];
|
|
1519
|
+
readonly stateMutability: "view";
|
|
1520
|
+
}];
|
|
1521
|
+
/**
|
|
1522
|
+
* MoreVaultsRegistry ABI — global protocol and bridge whitelist checks.
|
|
1523
|
+
*/
|
|
1524
|
+
declare const REGISTRY_ABI: readonly [{
|
|
1525
|
+
readonly type: "function";
|
|
1526
|
+
readonly name: "isWhitelisted";
|
|
1527
|
+
readonly inputs: readonly [{
|
|
1528
|
+
readonly name: "protocol";
|
|
1529
|
+
readonly type: "address";
|
|
1530
|
+
}];
|
|
1531
|
+
readonly outputs: readonly [{
|
|
1532
|
+
readonly type: "bool";
|
|
1533
|
+
}];
|
|
1534
|
+
readonly stateMutability: "view";
|
|
1535
|
+
}, {
|
|
1536
|
+
readonly type: "function";
|
|
1537
|
+
readonly name: "isBridgeAllowed";
|
|
1538
|
+
readonly inputs: readonly [{
|
|
1539
|
+
readonly name: "bridge";
|
|
1540
|
+
readonly type: "address";
|
|
1541
|
+
}];
|
|
1542
|
+
readonly outputs: readonly [{
|
|
1543
|
+
readonly type: "bool";
|
|
1544
|
+
}];
|
|
1545
|
+
readonly stateMutability: "view";
|
|
1546
|
+
}, {
|
|
1547
|
+
readonly type: "function";
|
|
1548
|
+
readonly name: "getAllowedFacets";
|
|
1549
|
+
readonly inputs: readonly [];
|
|
1550
|
+
readonly outputs: readonly [{
|
|
1551
|
+
readonly type: "address[]";
|
|
1552
|
+
}];
|
|
1553
|
+
readonly stateMutability: "view";
|
|
1554
|
+
}];
|
|
1073
1555
|
/**
|
|
1074
1556
|
* Minimal LZ Endpoint V2 ABI for compose queue management.
|
|
1075
1557
|
* Used by the Stargate 2-TX flow to check compose status and execute pending composes.
|
|
@@ -1211,6 +1693,90 @@ interface CrossChainRequestInfo {
|
|
|
1211
1693
|
finalizationResult: bigint;
|
|
1212
1694
|
amountLimit: bigint;
|
|
1213
1695
|
}
|
|
1696
|
+
interface SwapParams {
|
|
1697
|
+
targetContract: Address;
|
|
1698
|
+
tokenIn: Address;
|
|
1699
|
+
tokenOut: Address;
|
|
1700
|
+
maxAmountIn: bigint;
|
|
1701
|
+
minAmountOut: bigint;
|
|
1702
|
+
swapCallData: `0x${string}`;
|
|
1703
|
+
}
|
|
1704
|
+
interface BatchSwapParams {
|
|
1705
|
+
swaps: SwapParams[];
|
|
1706
|
+
}
|
|
1707
|
+
interface BridgeParams {
|
|
1708
|
+
oftToken: Address;
|
|
1709
|
+
dstEid: number;
|
|
1710
|
+
amount: bigint;
|
|
1711
|
+
dstVault: Address;
|
|
1712
|
+
refundAddress: Address;
|
|
1713
|
+
}
|
|
1714
|
+
interface PendingAction {
|
|
1715
|
+
nonce: bigint;
|
|
1716
|
+
actionsData: `0x${string}`[];
|
|
1717
|
+
pendingUntil: bigint;
|
|
1718
|
+
isExecutable: boolean;
|
|
1719
|
+
}
|
|
1720
|
+
interface SubmitActionsResult {
|
|
1721
|
+
txHash: `0x${string}`;
|
|
1722
|
+
nonce: bigint;
|
|
1723
|
+
}
|
|
1724
|
+
type CuratorAction = {
|
|
1725
|
+
type: 'swap';
|
|
1726
|
+
params: SwapParams;
|
|
1727
|
+
} | {
|
|
1728
|
+
type: 'batchSwap';
|
|
1729
|
+
params: BatchSwapParams;
|
|
1730
|
+
} | {
|
|
1731
|
+
type: 'erc4626Deposit';
|
|
1732
|
+
vault: Address;
|
|
1733
|
+
assets: bigint;
|
|
1734
|
+
} | {
|
|
1735
|
+
type: 'erc4626Redeem';
|
|
1736
|
+
vault: Address;
|
|
1737
|
+
shares: bigint;
|
|
1738
|
+
} | {
|
|
1739
|
+
type: 'erc7540RequestDeposit';
|
|
1740
|
+
vault: Address;
|
|
1741
|
+
assets: bigint;
|
|
1742
|
+
} | {
|
|
1743
|
+
type: 'erc7540Deposit';
|
|
1744
|
+
vault: Address;
|
|
1745
|
+
assets: bigint;
|
|
1746
|
+
} | {
|
|
1747
|
+
type: 'erc7540RequestRedeem';
|
|
1748
|
+
vault: Address;
|
|
1749
|
+
shares: bigint;
|
|
1750
|
+
} | {
|
|
1751
|
+
type: 'erc7540Redeem';
|
|
1752
|
+
vault: Address;
|
|
1753
|
+
shares: bigint;
|
|
1754
|
+
};
|
|
1755
|
+
interface CuratorVaultStatus {
|
|
1756
|
+
curator: Address;
|
|
1757
|
+
timeLockPeriod: bigint;
|
|
1758
|
+
maxSlippagePercent: bigint;
|
|
1759
|
+
currentNonce: bigint;
|
|
1760
|
+
availableAssets: Address[];
|
|
1761
|
+
lzAdapter: Address;
|
|
1762
|
+
paused: boolean;
|
|
1763
|
+
}
|
|
1764
|
+
interface AssetInfo {
|
|
1765
|
+
address: Address;
|
|
1766
|
+
symbol: string;
|
|
1767
|
+
name: string;
|
|
1768
|
+
decimals: number;
|
|
1769
|
+
}
|
|
1770
|
+
interface VaultAnalysis {
|
|
1771
|
+
/** All tokens the vault can hold/swap (curator-managed) */
|
|
1772
|
+
availableAssets: AssetInfo[];
|
|
1773
|
+
/** Tokens users can deposit */
|
|
1774
|
+
depositableAssets: AssetInfo[];
|
|
1775
|
+
/** Whether deposit whitelist is enabled (restricts who can deposit) */
|
|
1776
|
+
depositWhitelistEnabled: boolean;
|
|
1777
|
+
/** Registry address for global protocol whitelist checks */
|
|
1778
|
+
registryAddress: Address | null;
|
|
1779
|
+
}
|
|
1214
1780
|
|
|
1215
1781
|
/**
|
|
1216
1782
|
* Typed error classes for the MoreVaults SDK.
|
|
@@ -1846,6 +2412,158 @@ declare function preflightSpokeRedeem(route: {
|
|
|
1846
2412
|
hubLiquidBalance: bigint;
|
|
1847
2413
|
}>;
|
|
1848
2414
|
|
|
2415
|
+
/**
|
|
2416
|
+
* Curator / vault-manager read helpers for the MoreVaults SDK.
|
|
2417
|
+
*
|
|
2418
|
+
* All functions are read-only (no wallet needed) and use multicall for
|
|
2419
|
+
* batched RPC efficiency.
|
|
2420
|
+
*/
|
|
2421
|
+
|
|
2422
|
+
/**
|
|
2423
|
+
* Read a comprehensive status snapshot for the curator dashboard.
|
|
2424
|
+
*
|
|
2425
|
+
* Fetches in two batches (multicall) to minimise round trips:
|
|
2426
|
+
* Batch 1: curator, timeLockPeriod, getMaxSlippagePercent, getCurrentNonce,
|
|
2427
|
+
* getAvailableAssets, getCrossChainAccountingManager, paused
|
|
2428
|
+
*
|
|
2429
|
+
* @param publicClient Viem public client (must be on the vault's chain)
|
|
2430
|
+
* @param vault Vault address (diamond proxy)
|
|
2431
|
+
* @returns CuratorVaultStatus snapshot
|
|
2432
|
+
*/
|
|
2433
|
+
declare function getCuratorVaultStatus(publicClient: PublicClient, vault: Address): Promise<CuratorVaultStatus>;
|
|
2434
|
+
/**
|
|
2435
|
+
* Fetch pending actions for a specific nonce and resolve whether they are
|
|
2436
|
+
* executable (i.e. the timelock has expired).
|
|
2437
|
+
*
|
|
2438
|
+
* @param publicClient Viem public client (must be on the vault's chain)
|
|
2439
|
+
* @param vault Vault address (diamond proxy)
|
|
2440
|
+
* @param nonce Action nonce to query
|
|
2441
|
+
* @returns PendingAction with isExecutable flag set
|
|
2442
|
+
*/
|
|
2443
|
+
declare function getPendingActions(publicClient: PublicClient, vault: Address, nonce: bigint): Promise<PendingAction>;
|
|
2444
|
+
/**
|
|
2445
|
+
* Check whether a given address is the curator of the vault.
|
|
2446
|
+
*
|
|
2447
|
+
* @param publicClient Viem public client (must be on the vault's chain)
|
|
2448
|
+
* @param vault Vault address (diamond proxy)
|
|
2449
|
+
* @param address Address to check
|
|
2450
|
+
* @returns true if address is the current curator
|
|
2451
|
+
*/
|
|
2452
|
+
declare function isCurator(publicClient: PublicClient, vault: Address, address: Address): Promise<boolean>;
|
|
2453
|
+
/**
|
|
2454
|
+
* Full vault analysis — available assets with metadata, depositable assets, whitelist config.
|
|
2455
|
+
* Useful for curator dashboards to understand what the vault can do.
|
|
2456
|
+
*
|
|
2457
|
+
* @param publicClient Viem public client (must be on the vault's chain)
|
|
2458
|
+
* @param vault Vault address (diamond proxy)
|
|
2459
|
+
* @returns VaultAnalysis snapshot
|
|
2460
|
+
*/
|
|
2461
|
+
declare function getVaultAnalysis(publicClient: PublicClient, vault: Address): Promise<VaultAnalysis>;
|
|
2462
|
+
/**
|
|
2463
|
+
* Check if specific protocol addresses are whitelisted in the global registry.
|
|
2464
|
+
* Useful for curators to verify DEX routers before building swap calldata.
|
|
2465
|
+
*
|
|
2466
|
+
* @param publicClient Viem public client (must be on the vault's chain)
|
|
2467
|
+
* @param vault Vault address (diamond proxy)
|
|
2468
|
+
* @param protocols Protocol addresses to check
|
|
2469
|
+
* @returns Record mapping address → whitelisted boolean
|
|
2470
|
+
*/
|
|
2471
|
+
declare function checkProtocolWhitelist(publicClient: PublicClient, vault: Address, protocols: Address[]): Promise<Record<string, boolean>>;
|
|
2472
|
+
|
|
2473
|
+
/**
|
|
2474
|
+
* Curator MulticallFacet write operations for the MoreVaults SDK.
|
|
2475
|
+
*
|
|
2476
|
+
* Provides typed helpers to submit, execute, and veto curator action batches
|
|
2477
|
+
* on any MoreVaults diamond that has the MulticallFacet installed.
|
|
2478
|
+
*
|
|
2479
|
+
* All write functions use the simulate-then-write pattern:
|
|
2480
|
+
* 1. `publicClient.simulateContract` — validates on-chain, catches reverts early
|
|
2481
|
+
* 2. `walletClient.writeContract` — sends the actual transaction
|
|
2482
|
+
*
|
|
2483
|
+
* @module curatorMulticall
|
|
2484
|
+
*/
|
|
2485
|
+
|
|
2486
|
+
/**
|
|
2487
|
+
* Encode a single typed CuratorAction into raw calldata bytes suitable for
|
|
2488
|
+
* passing into `submitActions(bytes[] actionsData)`.
|
|
2489
|
+
*
|
|
2490
|
+
* The encoded bytes are the full ABI-encoded function call (4-byte selector +
|
|
2491
|
+
* arguments) targeting the vault diamond itself — the MulticallFacet will
|
|
2492
|
+
* call `address(this).call(actionsData[i])` for each entry.
|
|
2493
|
+
*
|
|
2494
|
+
* @param action A discriminated-union CuratorAction describing what to do
|
|
2495
|
+
* @returns ABI-encoded calldata bytes (`0x`-prefixed hex string)
|
|
2496
|
+
*/
|
|
2497
|
+
declare function encodeCuratorAction(action: CuratorAction): `0x${string}`;
|
|
2498
|
+
/**
|
|
2499
|
+
* Encode an array of CuratorActions into a calldata array ready for
|
|
2500
|
+
* `submitActions`.
|
|
2501
|
+
*
|
|
2502
|
+
* @param actions Array of typed CuratorAction objects
|
|
2503
|
+
* @returns Array of ABI-encoded calldata hex strings
|
|
2504
|
+
*/
|
|
2505
|
+
declare function buildCuratorBatch(actions: CuratorAction[]): `0x${string}`[];
|
|
2506
|
+
/**
|
|
2507
|
+
* Submit a batch of curator actions to the vault's MulticallFacet.
|
|
2508
|
+
*
|
|
2509
|
+
* When `timeLockPeriod == 0` the contract immediately executes the actions
|
|
2510
|
+
* inside `submitActions` itself. When a timelock is configured the actions
|
|
2511
|
+
* are queued and must be executed later with `executeActions`.
|
|
2512
|
+
*
|
|
2513
|
+
* Uses the simulate-then-write pattern: simulation runs first so any on-chain
|
|
2514
|
+
* revert (wrong curator, bad selector, slippage limit, etc.) surfaces before
|
|
2515
|
+
* any gas is spent on a failing transaction.
|
|
2516
|
+
*
|
|
2517
|
+
* After the write succeeds, the function reads `getCurrentNonce` to determine
|
|
2518
|
+
* which nonce was assigned to this batch (nonce - 1 after the submit increments it).
|
|
2519
|
+
*
|
|
2520
|
+
* @param walletClient Wallet client with curator account attached
|
|
2521
|
+
* @param publicClient Public client for reads and simulation
|
|
2522
|
+
* @param vault Vault address (diamond proxy)
|
|
2523
|
+
* @param actions Array of raw calldata bytes — use `buildCuratorBatch` to build
|
|
2524
|
+
* @returns Transaction hash and the nonce assigned to this batch
|
|
2525
|
+
* @throws If the caller is not the curator, or any action selector is
|
|
2526
|
+
* not allowed, or any action would revert
|
|
2527
|
+
*/
|
|
2528
|
+
declare function submitActions(walletClient: WalletClient, publicClient: PublicClient, vault: Address, actions: `0x${string}`[]): Promise<SubmitActionsResult>;
|
|
2529
|
+
/**
|
|
2530
|
+
* Execute pending actions after their timelock period has expired.
|
|
2531
|
+
*
|
|
2532
|
+
* Can only be called when `block.timestamp >= pendingUntil`. The contract
|
|
2533
|
+
* reverts with `ActionsStillPending` if the timelock has not expired.
|
|
2534
|
+
*
|
|
2535
|
+
* Caller must be the curator (or any address when timeLockPeriod == 0, since
|
|
2536
|
+
* in that case `submitActions` auto-executes and there is nothing to execute here).
|
|
2537
|
+
*
|
|
2538
|
+
* Uses simulate-then-write to surface on-chain reverts early.
|
|
2539
|
+
*
|
|
2540
|
+
* @param walletClient Wallet client with curator account attached
|
|
2541
|
+
* @param publicClient Public client for reads and simulation
|
|
2542
|
+
* @param vault Vault address (diamond proxy)
|
|
2543
|
+
* @param nonce The action batch nonce to execute
|
|
2544
|
+
* @returns Transaction hash
|
|
2545
|
+
*/
|
|
2546
|
+
declare function executeActions(walletClient: WalletClient, publicClient: PublicClient, vault: Address, nonce: bigint): Promise<{
|
|
2547
|
+
txHash: `0x${string}`;
|
|
2548
|
+
}>;
|
|
2549
|
+
/**
|
|
2550
|
+
* Guardian-only: cancel (veto) one or more pending action batches.
|
|
2551
|
+
*
|
|
2552
|
+
* Deletes the pending actions from storage, preventing them from ever being
|
|
2553
|
+
* executed. Only the vault guardian can call this.
|
|
2554
|
+
*
|
|
2555
|
+
* Uses simulate-then-write to catch `NoSuchActions` and permission errors early.
|
|
2556
|
+
*
|
|
2557
|
+
* @param walletClient Wallet client with guardian account attached
|
|
2558
|
+
* @param publicClient Public client for reads and simulation
|
|
2559
|
+
* @param vault Vault address (diamond proxy)
|
|
2560
|
+
* @param nonces Array of action nonces to cancel
|
|
2561
|
+
* @returns Transaction hash
|
|
2562
|
+
*/
|
|
2563
|
+
declare function vetoActions(walletClient: WalletClient, publicClient: PublicClient, vault: Address, nonces: bigint[]): Promise<{
|
|
2564
|
+
txHash: `0x${string}`;
|
|
2565
|
+
}>;
|
|
2566
|
+
|
|
1849
2567
|
/**
|
|
1850
2568
|
* Cast a wagmi PublicClient to the SDK's expected type.
|
|
1851
2569
|
* Use this in React components to avoid `as any` casts:
|
|
@@ -1860,4 +2578,4 @@ declare function preflightSpokeRedeem(route: {
|
|
|
1860
2578
|
*/
|
|
1861
2579
|
declare function asSdkClient(client: unknown): PublicClient;
|
|
1862
2580
|
|
|
1863
|
-
export { ActionType, type ActionTypeValue, type AsyncRequestResult, BRIDGE_ABI, CCManagerNotConfiguredError, CHAIN_IDS, CHAIN_ID_TO_EID, CONFIG_ABI, CapacityFullError, type ComposeData, type CrossChainRequestInfo, type DepositResult, EID_TO_CHAIN_ID, ERC20_ABI, EscrowNotConfiguredError, InsufficientLiquidityError, LZ_EIDS, LZ_ENDPOINT_ABI, LZ_TIMEOUTS, METADATA_ABI, MissingEscrowAddressError, MoreVaultsError, NotHubVaultError, NotWhitelistedError, OFT_ABI, OFT_ROUTES, type RedeemResult, STARGATE_TAXI_CMD, type SpokeDepositResult, type SpokeRedeemRoute, USDC_STARGATE_OFT, USDC_TOKEN, VAULT_ABI, type VaultAddresses, VaultPausedError, WrongChainError, asSdkClient, bridgeAssetsToSpoke, bridgeSharesToHub, depositAsync, depositSimple as depositCrossChainOracleOn, depositFromSpoke, depositFromSpoke as depositFromSpokeAsync, depositMultiAsset, depositSimple, executeCompose, getWithdrawalRequest, mintAsync, preflightAsync, preflightRedeemLiquidity, preflightSpokeDeposit, preflightSpokeRedeem, preflightSync, quoteComposeFee, quoteDepositFromSpokeFee, quoteShareBridgeFee, redeemAsync, redeemShares, requestRedeem, resolveRedeemAddresses, smartDeposit, smartRedeem, waitForCompose, withdrawAssets };
|
|
2581
|
+
export { ActionType, type ActionTypeValue, type AssetInfo, type AsyncRequestResult, BRIDGE_ABI, BRIDGE_FACET_ABI, type BatchSwapParams, type BridgeParams, CCManagerNotConfiguredError, CHAIN_IDS, CHAIN_ID_TO_EID, CONFIG_ABI, CURATOR_CONFIG_ABI, CapacityFullError, type ComposeData, type CrossChainRequestInfo, type CuratorAction, type CuratorVaultStatus, DEX_ABI, type DepositResult, EID_TO_CHAIN_ID, ERC20_ABI, ERC4626_FACET_ABI, ERC7540_FACET_ABI, EscrowNotConfiguredError, InsufficientLiquidityError, LZ_ADAPTER_ABI, LZ_EIDS, LZ_ENDPOINT_ABI, LZ_TIMEOUTS, METADATA_ABI, MULTICALL_ABI, MissingEscrowAddressError, MoreVaultsError, NotHubVaultError, NotWhitelistedError, OFT_ABI, OFT_ROUTES, type PendingAction, REGISTRY_ABI, type RedeemResult, STARGATE_TAXI_CMD, type SpokeDepositResult, type SpokeRedeemRoute, type SubmitActionsResult, type SwapParams, USDC_STARGATE_OFT, USDC_TOKEN, VAULT_ABI, VAULT_ANALYSIS_ABI, type VaultAddresses, type VaultAnalysis, VaultPausedError, WrongChainError, asSdkClient, bridgeAssetsToSpoke, bridgeSharesToHub, buildCuratorBatch, checkProtocolWhitelist, depositAsync, depositSimple as depositCrossChainOracleOn, depositFromSpoke, depositFromSpoke as depositFromSpokeAsync, depositMultiAsset, depositSimple, encodeCuratorAction, executeActions, executeCompose, getCuratorVaultStatus, getPendingActions, getVaultAnalysis, getWithdrawalRequest, isCurator, mintAsync, preflightAsync, preflightRedeemLiquidity, preflightSpokeDeposit, preflightSpokeRedeem, preflightSync, quoteComposeFee, quoteDepositFromSpokeFee, quoteShareBridgeFee, redeemAsync, redeemShares, requestRedeem, resolveRedeemAddresses, smartDeposit, smartRedeem, submitActions, vetoActions, waitForCompose, withdrawAssets };
|