@oydual31/more-vaults-sdk 0.2.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,10 +101,12 @@ declare const OFT_ROUTES: {
101
101
  };
102
102
  };
103
103
  /**
104
- * PYUSDPayPal USD OFT (issued by PayPal/Flow).
104
+ * USDF — USD Flow OFT. Bridges PYUSD (Ethereum) USDF (Flow EVM).
105
+ * On Ethereum: underlying is PayPal USD (PYUSD, 0x6c3ea9...).
106
+ * On Flow: the OFT itself IS the token (USDF, 0x2aabea...).
105
107
  * Routes verified: Eth→Flow ✓
106
108
  */
107
- readonly PYUSD: {
109
+ readonly USDF: {
108
110
  readonly 747: {
109
111
  readonly oft: `0x${string}`;
110
112
  readonly token: `0x${string}`;
@@ -114,6 +116,23 @@ declare const OFT_ROUTES: {
114
116
  readonly token: `0x${string}`;
115
117
  };
116
118
  };
119
+ /**
120
+ * PYUSD — PayPal USD bridged via OFTAdapter (Paxos / LayerZero).
121
+ * Lock/mint architecture: locks PYUSD on Arbitrum, mints PYUSD0 on Flow EVM.
122
+ * On Arbitrum: OFTAdapter wraps native PYUSD (0x46850a...).
123
+ * On Flow: OFTAdapter wraps PYUSD0 (0x99aF3E...), which is the native Paxos token.
124
+ * Routes verified: Arb↔Flow ✓ (EID 30336). No Eth or Base peers.
125
+ */
126
+ readonly PYUSD: {
127
+ readonly 747: {
128
+ readonly oft: `0x${string}`;
129
+ readonly token: `0x${string}`;
130
+ };
131
+ readonly 42161: {
132
+ readonly oft: `0x${string}`;
133
+ readonly token: `0x${string}`;
134
+ };
135
+ };
117
136
  /**
118
137
  * WFLOW — Wrapped FLOW NativeOFTAdapter (issued by Flow Foundation).
119
138
  * Routes verified: Eth→Flow ✓
@@ -354,7 +373,7 @@ declare const OFT_ROUTES: {
354
373
  /**
355
374
  * oftCmd for Stargate v2 taxi mode (immediate per-message delivery).
356
375
  * Pass as `oftCmd` in SendParam when using stgUSDC, USDT, or WETH OFT_ROUTES entries.
357
- * Non-Stargate OFTs (PYUSD, WFLOW, sUSDe, USDe, weETH, rsETH) use empty bytes — pass `'0x'` instead.
376
+ * Non-Stargate OFTs (USDF, WFLOW, sUSDe, USDe, weETH, rsETH) use empty bytes — pass `'0x'` instead.
358
377
  */
359
378
  declare const STARGATE_TAXI_CMD: "0x01";
360
379
  /**
@@ -1051,6 +1070,351 @@ declare const OFT_ABI: readonly [{
1051
1070
  }];
1052
1071
  readonly stateMutability: "view";
1053
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
+ }];
1054
1418
  /**
1055
1419
  * Minimal LZ Endpoint V2 ABI for compose queue management.
1056
1420
  * Used by the Stargate 2-TX flow to check compose status and execute pending composes.
@@ -1192,6 +1556,74 @@ interface CrossChainRequestInfo {
1192
1556
  finalizationResult: bigint;
1193
1557
  amountLimit: bigint;
1194
1558
  }
1559
+ interface SwapParams {
1560
+ targetContract: Address;
1561
+ tokenIn: Address;
1562
+ tokenOut: Address;
1563
+ maxAmountIn: bigint;
1564
+ minAmountOut: bigint;
1565
+ swapCallData: `0x${string}`;
1566
+ }
1567
+ interface BatchSwapParams {
1568
+ swaps: SwapParams[];
1569
+ }
1570
+ interface BridgeParams {
1571
+ oftToken: Address;
1572
+ dstEid: number;
1573
+ amount: bigint;
1574
+ dstVault: Address;
1575
+ refundAddress: Address;
1576
+ }
1577
+ interface PendingAction {
1578
+ nonce: bigint;
1579
+ actionsData: `0x${string}`[];
1580
+ pendingUntil: bigint;
1581
+ isExecutable: boolean;
1582
+ }
1583
+ interface SubmitActionsResult {
1584
+ txHash: `0x${string}`;
1585
+ nonce: bigint;
1586
+ }
1587
+ type CuratorAction = {
1588
+ type: 'swap';
1589
+ params: SwapParams;
1590
+ } | {
1591
+ type: 'batchSwap';
1592
+ params: BatchSwapParams;
1593
+ } | {
1594
+ type: 'erc4626Deposit';
1595
+ vault: Address;
1596
+ assets: bigint;
1597
+ } | {
1598
+ type: 'erc4626Redeem';
1599
+ vault: Address;
1600
+ shares: bigint;
1601
+ } | {
1602
+ type: 'erc7540RequestDeposit';
1603
+ vault: Address;
1604
+ assets: bigint;
1605
+ } | {
1606
+ type: 'erc7540Deposit';
1607
+ vault: Address;
1608
+ assets: bigint;
1609
+ } | {
1610
+ type: 'erc7540RequestRedeem';
1611
+ vault: Address;
1612
+ shares: bigint;
1613
+ } | {
1614
+ type: 'erc7540Redeem';
1615
+ vault: Address;
1616
+ shares: bigint;
1617
+ };
1618
+ interface CuratorVaultStatus {
1619
+ curator: Address;
1620
+ timeLockPeriod: bigint;
1621
+ maxSlippagePercent: bigint;
1622
+ currentNonce: bigint;
1623
+ availableAssets: Address[];
1624
+ lzAdapter: Address;
1625
+ paused: boolean;
1626
+ }
1195
1627
 
1196
1628
  /**
1197
1629
  * Typed error classes for the MoreVaults SDK.
@@ -1827,6 +2259,45 @@ declare function preflightSpokeRedeem(route: {
1827
2259
  hubLiquidBalance: bigint;
1828
2260
  }>;
1829
2261
 
2262
+ /**
2263
+ * Curator / vault-manager read helpers for the MoreVaults SDK.
2264
+ *
2265
+ * All functions are read-only (no wallet needed) and use multicall for
2266
+ * batched RPC efficiency.
2267
+ */
2268
+
2269
+ /**
2270
+ * Read a comprehensive status snapshot for the curator dashboard.
2271
+ *
2272
+ * Fetches in two batches (multicall) to minimise round trips:
2273
+ * Batch 1: curator, timeLockPeriod, getMaxSlippagePercent, getCurrentNonce,
2274
+ * getAvailableAssets, getCrossChainAccountingManager, paused
2275
+ *
2276
+ * @param publicClient Viem public client (must be on the vault's chain)
2277
+ * @param vault Vault address (diamond proxy)
2278
+ * @returns CuratorVaultStatus snapshot
2279
+ */
2280
+ declare function getCuratorVaultStatus(publicClient: PublicClient, vault: Address): Promise<CuratorVaultStatus>;
2281
+ /**
2282
+ * Fetch pending actions for a specific nonce and resolve whether they are
2283
+ * executable (i.e. the timelock has expired).
2284
+ *
2285
+ * @param publicClient Viem public client (must be on the vault's chain)
2286
+ * @param vault Vault address (diamond proxy)
2287
+ * @param nonce Action nonce to query
2288
+ * @returns PendingAction with isExecutable flag set
2289
+ */
2290
+ declare function getPendingActions(publicClient: PublicClient, vault: Address, nonce: bigint): Promise<PendingAction>;
2291
+ /**
2292
+ * Check whether a given address is the curator of the vault.
2293
+ *
2294
+ * @param publicClient Viem public client (must be on the vault's chain)
2295
+ * @param vault Vault address (diamond proxy)
2296
+ * @param address Address to check
2297
+ * @returns true if address is the current curator
2298
+ */
2299
+ declare function isCurator(publicClient: PublicClient, vault: Address, address: Address): Promise<boolean>;
2300
+
1830
2301
  /**
1831
2302
  * Cast a wagmi PublicClient to the SDK's expected type.
1832
2303
  * Use this in React components to avoid `as any` casts:
@@ -1841,4 +2312,4 @@ declare function preflightSpokeRedeem(route: {
1841
2312
  */
1842
2313
  declare function asSdkClient(client: unknown): PublicClient;
1843
2314
 
1844
- 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 };
2315
+ export { ActionType, type ActionTypeValue, 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, 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, type RedeemResult, STARGATE_TAXI_CMD, type SpokeDepositResult, type SpokeRedeemRoute, type SubmitActionsResult, type SwapParams, 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, getCuratorVaultStatus, getPendingActions, getWithdrawalRequest, isCurator, mintAsync, preflightAsync, preflightRedeemLiquidity, preflightSpokeDeposit, preflightSpokeRedeem, preflightSync, quoteComposeFee, quoteDepositFromSpokeFee, quoteShareBridgeFee, redeemAsync, redeemShares, requestRedeem, resolveRedeemAddresses, smartDeposit, smartRedeem, waitForCompose, withdrawAssets };