@oydual31/more-vaults-sdk 1.0.0 → 1.1.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 +1 -1
- package/dist/{curatorBridge-CR9eYhuM.d.cts → curatorBridge-DDNgHubw.d.cts} +27 -12
- package/dist/{curatorBridge-CR9eYhuM.d.ts → curatorBridge-DDNgHubw.d.ts} +27 -12
- package/dist/ethers/index.cjs +482 -160
- package/dist/ethers/index.cjs.map +1 -1
- package/dist/ethers/index.d.cts +158 -10
- package/dist/ethers/index.d.ts +158 -10
- package/dist/ethers/index.js +469 -161
- package/dist/ethers/index.js.map +1 -1
- package/dist/react/index.cjs +522 -227
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +522 -227
- package/dist/react/index.js.map +1 -1
- package/dist/viem/index.cjs +877 -446
- package/dist/viem/index.cjs.map +1 -1
- package/dist/viem/index.d.cts +154 -12
- package/dist/viem/index.d.ts +154 -12
- package/dist/viem/index.js +865 -447
- package/dist/viem/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ethers/adminActions.ts +161 -31
- package/src/ethers/crossChainFlows.ts +6 -0
- package/src/ethers/curatorBridge.ts +23 -12
- package/src/ethers/curatorMulticall.ts +27 -6
- package/src/ethers/curatorStatus.ts +7 -2
- package/src/ethers/curatorSubVaults.ts +11 -2
- package/src/ethers/depositFlows.ts +69 -36
- package/src/ethers/errorParser.ts +96 -0
- package/src/ethers/errors.ts +107 -0
- package/src/ethers/index.ts +15 -1
- package/src/ethers/preflight.ts +27 -60
- package/src/ethers/redeemFlows.ts +69 -26
- package/src/ethers/spokeRoutes.ts +7 -6
- package/src/ethers/topology.ts +17 -6
- package/src/ethers/userHelpers.ts +2 -1
- package/src/ethers/utils.ts +88 -14
- package/src/react/useInboundRoutes.ts +4 -3
- package/src/viem/adminActions.ts +214 -82
- package/src/viem/crossChainFlows.ts +42 -28
- package/src/viem/curatorBridge.ts +31 -9
- package/src/viem/curatorMulticall.ts +39 -21
- package/src/viem/curatorStatus.ts +64 -41
- package/src/viem/curatorSubVaults.ts +23 -14
- package/src/viem/depositFlows.ts +97 -57
- package/src/viem/distribution.ts +7 -1
- package/src/viem/errorParser.ts +96 -0
- package/src/viem/errors.ts +107 -0
- package/src/viem/index.ts +13 -0
- package/src/viem/preflight.ts +26 -59
- package/src/viem/redeemFlows.ts +106 -44
- package/src/viem/spokeRoutes.ts +128 -59
- package/src/viem/topology.ts +69 -53
- package/src/viem/userHelpers.ts +108 -42
- package/src/viem/utils.ts +62 -34
package/README.md
CHANGED
|
@@ -876,11 +876,15 @@ declare function discoverVaultTopology(vault: Address, publicClient?: PublicClie
|
|
|
876
876
|
* Useful for showing a "Switch to Base" prompt before deposit.
|
|
877
877
|
*
|
|
878
878
|
* @param currentChainId Chain ID the wallet is currently connected to
|
|
879
|
-
* @param topology Result of getVaultTopology
|
|
879
|
+
* @param topology Result of getVaultTopology or discoverVaultTopology
|
|
880
|
+
* @returns true if the wallet is already on the hub chain
|
|
880
881
|
*/
|
|
881
882
|
declare function isOnHubChain(currentChainId: number, topology: VaultTopology): boolean;
|
|
882
883
|
/**
|
|
883
884
|
* Get all chain IDs where this vault is deployed (hub + all spokes).
|
|
885
|
+
*
|
|
886
|
+
* @param topology Result of getVaultTopology or discoverVaultTopology
|
|
887
|
+
* @returns Array starting with the hub chainId followed by all spoke chainIds
|
|
884
888
|
*/
|
|
885
889
|
declare function getAllVaultChainIds(topology: VaultTopology): number[];
|
|
886
890
|
|
|
@@ -999,23 +1003,33 @@ interface InboundRouteWithBalance extends InboundRoute {
|
|
|
999
1003
|
userBalance: bigint;
|
|
1000
1004
|
}
|
|
1001
1005
|
/**
|
|
1002
|
-
* Find all valid
|
|
1006
|
+
* Find all valid inbound deposit routes for a vault.
|
|
1007
|
+
*
|
|
1008
|
+
* Accepts a single asset address **or an array** of depositable asset addresses.
|
|
1009
|
+
* When an array is passed (multi-asset vaults), routes for each asset are fetched
|
|
1010
|
+
* in parallel and merged — topology and async-mode are fetched only once.
|
|
1003
1011
|
*
|
|
1004
|
-
*
|
|
1005
|
-
*
|
|
1006
|
-
* The hub chain is always included as a 'direct' deposit option.
|
|
1012
|
+
* The hub chain is always included as a 'direct' (or 'direct-async') option for
|
|
1013
|
+
* every depositable asset, even if the token is not in OFT_ROUTES.
|
|
1007
1014
|
*
|
|
1008
|
-
* Routes that revert on quoteSend() (no liquidity, no peer) are excluded.
|
|
1015
|
+
* Routes that revert on quoteSend() (no liquidity, no peer) are excluded silently.
|
|
1009
1016
|
*
|
|
1010
|
-
* @param hubChainId Chain ID of the vault hub (e.g.
|
|
1011
|
-
* @param vault Vault address
|
|
1012
|
-
* @param vaultAsset
|
|
1013
|
-
* @param userAddress User address (used as receiver for fee
|
|
1017
|
+
* @param hubChainId Chain ID of the vault hub (e.g. 747 for Flow EVM)
|
|
1018
|
+
* @param vault Vault address
|
|
1019
|
+
* @param vaultAsset Single asset address OR array of depositable asset addresses
|
|
1020
|
+
* @param userAddress User address (used as receiver for fee quotes)
|
|
1021
|
+
* @returns Array of InboundRoute objects; hub direct route(s) are first
|
|
1014
1022
|
*/
|
|
1015
|
-
declare function getInboundRoutes(hubChainId: number, vault: Address, vaultAsset: Address, userAddress: Address): Promise<InboundRoute[]>;
|
|
1023
|
+
declare function getInboundRoutes(hubChainId: number, vault: Address, vaultAsset: Address | Address[], userAddress: Address): Promise<InboundRoute[]>;
|
|
1016
1024
|
/**
|
|
1017
1025
|
* Fetch user token balances for each inbound route in parallel.
|
|
1018
|
-
*
|
|
1026
|
+
*
|
|
1027
|
+
* Routes with native token as the source (zeroAddress) return the chain's
|
|
1028
|
+
* native gas balance instead of an ERC-20 balance.
|
|
1029
|
+
*
|
|
1030
|
+
* @param routes Array of InboundRoute objects from getInboundRoutes
|
|
1031
|
+
* @param userAddress User wallet address to query balances for
|
|
1032
|
+
* @returns Each route extended with the user's current token balance
|
|
1019
1033
|
*/
|
|
1020
1034
|
declare function getUserBalancesForRoutes(routes: InboundRoute[], userAddress: Address): Promise<InboundRouteWithBalance[]>;
|
|
1021
1035
|
/**
|
|
@@ -1027,6 +1041,7 @@ declare function getUserBalancesForRoutes(routes: InboundRoute[], userAddress: A
|
|
|
1027
1041
|
*
|
|
1028
1042
|
* @param hubChainId Chain ID of the vault hub (e.g. 8453 for Base)
|
|
1029
1043
|
* @param vault Vault address (to resolve registered spoke chains)
|
|
1044
|
+
* @returns Array of OutboundRoute objects; hub is always at index 0
|
|
1030
1045
|
*/
|
|
1031
1046
|
declare function getOutboundRoutes(hubChainId: number, vault: Address): Promise<OutboundRoute[]>;
|
|
1032
1047
|
/**
|
|
@@ -876,11 +876,15 @@ declare function discoverVaultTopology(vault: Address, publicClient?: PublicClie
|
|
|
876
876
|
* Useful for showing a "Switch to Base" prompt before deposit.
|
|
877
877
|
*
|
|
878
878
|
* @param currentChainId Chain ID the wallet is currently connected to
|
|
879
|
-
* @param topology Result of getVaultTopology
|
|
879
|
+
* @param topology Result of getVaultTopology or discoverVaultTopology
|
|
880
|
+
* @returns true if the wallet is already on the hub chain
|
|
880
881
|
*/
|
|
881
882
|
declare function isOnHubChain(currentChainId: number, topology: VaultTopology): boolean;
|
|
882
883
|
/**
|
|
883
884
|
* Get all chain IDs where this vault is deployed (hub + all spokes).
|
|
885
|
+
*
|
|
886
|
+
* @param topology Result of getVaultTopology or discoverVaultTopology
|
|
887
|
+
* @returns Array starting with the hub chainId followed by all spoke chainIds
|
|
884
888
|
*/
|
|
885
889
|
declare function getAllVaultChainIds(topology: VaultTopology): number[];
|
|
886
890
|
|
|
@@ -999,23 +1003,33 @@ interface InboundRouteWithBalance extends InboundRoute {
|
|
|
999
1003
|
userBalance: bigint;
|
|
1000
1004
|
}
|
|
1001
1005
|
/**
|
|
1002
|
-
* Find all valid
|
|
1006
|
+
* Find all valid inbound deposit routes for a vault.
|
|
1007
|
+
*
|
|
1008
|
+
* Accepts a single asset address **or an array** of depositable asset addresses.
|
|
1009
|
+
* When an array is passed (multi-asset vaults), routes for each asset are fetched
|
|
1010
|
+
* in parallel and merged — topology and async-mode are fetched only once.
|
|
1003
1011
|
*
|
|
1004
|
-
*
|
|
1005
|
-
*
|
|
1006
|
-
* The hub chain is always included as a 'direct' deposit option.
|
|
1012
|
+
* The hub chain is always included as a 'direct' (or 'direct-async') option for
|
|
1013
|
+
* every depositable asset, even if the token is not in OFT_ROUTES.
|
|
1007
1014
|
*
|
|
1008
|
-
* Routes that revert on quoteSend() (no liquidity, no peer) are excluded.
|
|
1015
|
+
* Routes that revert on quoteSend() (no liquidity, no peer) are excluded silently.
|
|
1009
1016
|
*
|
|
1010
|
-
* @param hubChainId Chain ID of the vault hub (e.g.
|
|
1011
|
-
* @param vault Vault address
|
|
1012
|
-
* @param vaultAsset
|
|
1013
|
-
* @param userAddress User address (used as receiver for fee
|
|
1017
|
+
* @param hubChainId Chain ID of the vault hub (e.g. 747 for Flow EVM)
|
|
1018
|
+
* @param vault Vault address
|
|
1019
|
+
* @param vaultAsset Single asset address OR array of depositable asset addresses
|
|
1020
|
+
* @param userAddress User address (used as receiver for fee quotes)
|
|
1021
|
+
* @returns Array of InboundRoute objects; hub direct route(s) are first
|
|
1014
1022
|
*/
|
|
1015
|
-
declare function getInboundRoutes(hubChainId: number, vault: Address, vaultAsset: Address, userAddress: Address): Promise<InboundRoute[]>;
|
|
1023
|
+
declare function getInboundRoutes(hubChainId: number, vault: Address, vaultAsset: Address | Address[], userAddress: Address): Promise<InboundRoute[]>;
|
|
1016
1024
|
/**
|
|
1017
1025
|
* Fetch user token balances for each inbound route in parallel.
|
|
1018
|
-
*
|
|
1026
|
+
*
|
|
1027
|
+
* Routes with native token as the source (zeroAddress) return the chain's
|
|
1028
|
+
* native gas balance instead of an ERC-20 balance.
|
|
1029
|
+
*
|
|
1030
|
+
* @param routes Array of InboundRoute objects from getInboundRoutes
|
|
1031
|
+
* @param userAddress User wallet address to query balances for
|
|
1032
|
+
* @returns Each route extended with the user's current token balance
|
|
1019
1033
|
*/
|
|
1020
1034
|
declare function getUserBalancesForRoutes(routes: InboundRoute[], userAddress: Address): Promise<InboundRouteWithBalance[]>;
|
|
1021
1035
|
/**
|
|
@@ -1027,6 +1041,7 @@ declare function getUserBalancesForRoutes(routes: InboundRoute[], userAddress: A
|
|
|
1027
1041
|
*
|
|
1028
1042
|
* @param hubChainId Chain ID of the vault hub (e.g. 8453 for Base)
|
|
1029
1043
|
* @param vault Vault address (to resolve registered spoke chains)
|
|
1044
|
+
* @returns Array of OutboundRoute objects; hub is always at index 0
|
|
1030
1045
|
*/
|
|
1031
1046
|
declare function getOutboundRoutes(hubChainId: number, vault: Address): Promise<OutboundRoute[]>;
|
|
1032
1047
|
/**
|