@oydual31/more-vaults-sdk 0.4.2 → 0.6.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.
- package/README.md +94 -0
- package/dist/{spokeRoutes-B8Lnk-t4.d.cts → curatorBridge-CNs59kT9.d.cts} +222 -1
- package/dist/{spokeRoutes-B8Lnk-t4.d.ts → curatorBridge-CNs59kT9.d.ts} +222 -1
- package/dist/ethers/index.cjs +328 -3
- package/dist/ethers/index.cjs.map +1 -1
- package/dist/ethers/index.d.cts +279 -1
- package/dist/ethers/index.d.ts +279 -1
- package/dist/ethers/index.js +318 -5
- package/dist/ethers/index.js.map +1 -1
- package/dist/react/index.cjs +375 -0
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +266 -2
- package/dist/react/index.d.ts +266 -2
- package/dist/react/index.js +372 -2
- package/dist/react/index.js.map +1 -1
- package/dist/viem/index.cjs +377 -0
- package/dist/viem/index.cjs.map +1 -1
- package/dist/viem/index.d.cts +261 -3
- package/dist/viem/index.d.ts +261 -3
- package/dist/viem/index.js +367 -2
- package/dist/viem/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ethers/abis.ts +24 -0
- package/src/ethers/curatorBridge.ts +235 -0
- package/src/ethers/curatorSubVaults.ts +443 -0
- package/src/ethers/index.ts +26 -0
- package/src/ethers/types.ts +99 -0
- package/src/react/index.ts +14 -0
- package/src/react/useCuratorBridgeQuote.ts +43 -0
- package/src/react/useERC7540RequestStatus.ts +43 -0
- package/src/react/useExecuteBridge.ts +50 -0
- package/src/react/useSubVaultPositions.ts +35 -0
- package/src/react/useVaultPortfolio.ts +35 -0
- package/src/viem/abis.ts +24 -0
- package/src/viem/curatorBridge.ts +288 -0
- package/src/viem/curatorSubVaults.ts +514 -0
- package/src/viem/index.ts +23 -0
- package/src/viem/types.ts +100 -0
package/dist/react/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { J as VaultStatus, G as VaultMetadata, z as UserPosition, v as MultiChainUserPosition, o as AsyncRequestStatusInfo, L as VaultTopology, F as VaultDistribution, u as InboundRouteWithBalance, a as CuratorVaultStatus, b as VaultAnalysis, c as VaultAssetBreakdown, P as PendingAction, e as SubmitActionsResult, d as CuratorAction, r as CuratorBridgeParams, g as SubVaultPosition, h as VaultPortfolio, E as ERC7540RequestStatus } from '../curatorBridge-CNs59kT9.cjs';
|
|
3
3
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
4
4
|
import { Address } from 'viem';
|
|
5
5
|
|
|
@@ -645,4 +645,268 @@ declare function useVetoActions(vault: `0x${string}`, chainId: number): _tanstac
|
|
|
645
645
|
nonces: bigint[];
|
|
646
646
|
}, unknown>;
|
|
647
647
|
|
|
648
|
-
|
|
648
|
+
/**
|
|
649
|
+
* Quote the native fee required to bridge assets from the hub vault via LzAdapter.
|
|
650
|
+
*
|
|
651
|
+
* Refreshes every 60s — bridge fees fluctuate with LayerZero network demand.
|
|
652
|
+
*
|
|
653
|
+
* @example
|
|
654
|
+
* ```tsx
|
|
655
|
+
* const { fee, isLoading } = useCuratorBridgeQuote('0xVAULT', 8453, {
|
|
656
|
+
* oftToken: '0x27a16dc786820B16E5c9028b75B99F6f604b5d26',
|
|
657
|
+
* dstEid: 30101,
|
|
658
|
+
* amount: 1_000_000n,
|
|
659
|
+
* dstVault: '0xSpokeVault...',
|
|
660
|
+
* refundAddress: '0xCurator...',
|
|
661
|
+
* })
|
|
662
|
+
* ```
|
|
663
|
+
*/
|
|
664
|
+
declare function useCuratorBridgeQuote(vault: `0x${string}` | undefined, chainId: number, params: CuratorBridgeParams | undefined): {
|
|
665
|
+
fee: bigint | undefined;
|
|
666
|
+
data: bigint;
|
|
667
|
+
error: Error;
|
|
668
|
+
isError: true;
|
|
669
|
+
isPending: false;
|
|
670
|
+
isLoading: false;
|
|
671
|
+
isLoadingError: false;
|
|
672
|
+
isRefetchError: true;
|
|
673
|
+
isSuccess: false;
|
|
674
|
+
isPlaceholderData: false;
|
|
675
|
+
status: "error";
|
|
676
|
+
dataUpdatedAt: number;
|
|
677
|
+
errorUpdatedAt: number;
|
|
678
|
+
failureCount: number;
|
|
679
|
+
failureReason: Error | null;
|
|
680
|
+
errorUpdateCount: number;
|
|
681
|
+
isFetched: boolean;
|
|
682
|
+
isFetchedAfterMount: boolean;
|
|
683
|
+
isFetching: boolean;
|
|
684
|
+
isInitialLoading: boolean;
|
|
685
|
+
isPaused: boolean;
|
|
686
|
+
isRefetching: boolean;
|
|
687
|
+
isStale: boolean;
|
|
688
|
+
isEnabled: boolean;
|
|
689
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
690
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
691
|
+
promise: Promise<bigint>;
|
|
692
|
+
} | {
|
|
693
|
+
fee: bigint | undefined;
|
|
694
|
+
data: bigint;
|
|
695
|
+
error: null;
|
|
696
|
+
isError: false;
|
|
697
|
+
isPending: false;
|
|
698
|
+
isLoading: false;
|
|
699
|
+
isLoadingError: false;
|
|
700
|
+
isRefetchError: false;
|
|
701
|
+
isSuccess: true;
|
|
702
|
+
isPlaceholderData: false;
|
|
703
|
+
status: "success";
|
|
704
|
+
dataUpdatedAt: number;
|
|
705
|
+
errorUpdatedAt: number;
|
|
706
|
+
failureCount: number;
|
|
707
|
+
failureReason: Error | null;
|
|
708
|
+
errorUpdateCount: number;
|
|
709
|
+
isFetched: boolean;
|
|
710
|
+
isFetchedAfterMount: boolean;
|
|
711
|
+
isFetching: boolean;
|
|
712
|
+
isInitialLoading: boolean;
|
|
713
|
+
isPaused: boolean;
|
|
714
|
+
isRefetching: boolean;
|
|
715
|
+
isStale: boolean;
|
|
716
|
+
isEnabled: boolean;
|
|
717
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
718
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
719
|
+
promise: Promise<bigint>;
|
|
720
|
+
} | {
|
|
721
|
+
fee: bigint | undefined;
|
|
722
|
+
data: undefined;
|
|
723
|
+
error: Error;
|
|
724
|
+
isError: true;
|
|
725
|
+
isPending: false;
|
|
726
|
+
isLoading: false;
|
|
727
|
+
isLoadingError: true;
|
|
728
|
+
isRefetchError: false;
|
|
729
|
+
isSuccess: false;
|
|
730
|
+
isPlaceholderData: false;
|
|
731
|
+
status: "error";
|
|
732
|
+
dataUpdatedAt: number;
|
|
733
|
+
errorUpdatedAt: number;
|
|
734
|
+
failureCount: number;
|
|
735
|
+
failureReason: Error | null;
|
|
736
|
+
errorUpdateCount: number;
|
|
737
|
+
isFetched: boolean;
|
|
738
|
+
isFetchedAfterMount: boolean;
|
|
739
|
+
isFetching: boolean;
|
|
740
|
+
isInitialLoading: boolean;
|
|
741
|
+
isPaused: boolean;
|
|
742
|
+
isRefetching: boolean;
|
|
743
|
+
isStale: boolean;
|
|
744
|
+
isEnabled: boolean;
|
|
745
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
746
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
747
|
+
promise: Promise<bigint>;
|
|
748
|
+
} | {
|
|
749
|
+
fee: bigint | undefined;
|
|
750
|
+
data: undefined;
|
|
751
|
+
error: null;
|
|
752
|
+
isError: false;
|
|
753
|
+
isPending: true;
|
|
754
|
+
isLoading: true;
|
|
755
|
+
isLoadingError: false;
|
|
756
|
+
isRefetchError: false;
|
|
757
|
+
isSuccess: false;
|
|
758
|
+
isPlaceholderData: false;
|
|
759
|
+
status: "pending";
|
|
760
|
+
dataUpdatedAt: number;
|
|
761
|
+
errorUpdatedAt: number;
|
|
762
|
+
failureCount: number;
|
|
763
|
+
failureReason: Error | null;
|
|
764
|
+
errorUpdateCount: number;
|
|
765
|
+
isFetched: boolean;
|
|
766
|
+
isFetchedAfterMount: boolean;
|
|
767
|
+
isFetching: boolean;
|
|
768
|
+
isInitialLoading: boolean;
|
|
769
|
+
isPaused: boolean;
|
|
770
|
+
isRefetching: boolean;
|
|
771
|
+
isStale: boolean;
|
|
772
|
+
isEnabled: boolean;
|
|
773
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
774
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
775
|
+
promise: Promise<bigint>;
|
|
776
|
+
} | {
|
|
777
|
+
fee: bigint | undefined;
|
|
778
|
+
data: undefined;
|
|
779
|
+
error: null;
|
|
780
|
+
isError: false;
|
|
781
|
+
isPending: true;
|
|
782
|
+
isLoadingError: false;
|
|
783
|
+
isRefetchError: false;
|
|
784
|
+
isSuccess: false;
|
|
785
|
+
isPlaceholderData: false;
|
|
786
|
+
status: "pending";
|
|
787
|
+
dataUpdatedAt: number;
|
|
788
|
+
errorUpdatedAt: number;
|
|
789
|
+
failureCount: number;
|
|
790
|
+
failureReason: Error | null;
|
|
791
|
+
errorUpdateCount: number;
|
|
792
|
+
isFetched: boolean;
|
|
793
|
+
isFetchedAfterMount: boolean;
|
|
794
|
+
isFetching: boolean;
|
|
795
|
+
isLoading: boolean;
|
|
796
|
+
isInitialLoading: boolean;
|
|
797
|
+
isPaused: boolean;
|
|
798
|
+
isRefetching: boolean;
|
|
799
|
+
isStale: boolean;
|
|
800
|
+
isEnabled: boolean;
|
|
801
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
802
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
803
|
+
promise: Promise<bigint>;
|
|
804
|
+
} | {
|
|
805
|
+
fee: bigint | undefined;
|
|
806
|
+
data: bigint;
|
|
807
|
+
isError: false;
|
|
808
|
+
error: null;
|
|
809
|
+
isPending: false;
|
|
810
|
+
isLoading: false;
|
|
811
|
+
isLoadingError: false;
|
|
812
|
+
isRefetchError: false;
|
|
813
|
+
isSuccess: true;
|
|
814
|
+
isPlaceholderData: true;
|
|
815
|
+
status: "success";
|
|
816
|
+
dataUpdatedAt: number;
|
|
817
|
+
errorUpdatedAt: number;
|
|
818
|
+
failureCount: number;
|
|
819
|
+
failureReason: Error | null;
|
|
820
|
+
errorUpdateCount: number;
|
|
821
|
+
isFetched: boolean;
|
|
822
|
+
isFetchedAfterMount: boolean;
|
|
823
|
+
isFetching: boolean;
|
|
824
|
+
isInitialLoading: boolean;
|
|
825
|
+
isPaused: boolean;
|
|
826
|
+
isRefetching: boolean;
|
|
827
|
+
isStale: boolean;
|
|
828
|
+
isEnabled: boolean;
|
|
829
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
830
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
831
|
+
promise: Promise<bigint>;
|
|
832
|
+
};
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Execute a curator bridge operation via BridgeFacet.executeBridging.
|
|
836
|
+
*
|
|
837
|
+
* This is a direct curator call (NOT via multicall). The vault pauses during
|
|
838
|
+
* bridging for security. Automatically quotes and includes the required
|
|
839
|
+
* LayerZero fee as msg.value.
|
|
840
|
+
*
|
|
841
|
+
* @param vault Hub vault address (diamond proxy)
|
|
842
|
+
* @param token Underlying ERC-20 token address to bridge (NOT the OFT address)
|
|
843
|
+
* @param chainId Chain ID of the hub vault
|
|
844
|
+
*
|
|
845
|
+
* @example
|
|
846
|
+
* ```tsx
|
|
847
|
+
* const { mutateAsync, isPending } = useExecuteBridge('0xVAULT', USDC_ADDRESS, 8453)
|
|
848
|
+
*
|
|
849
|
+
* await mutateAsync({
|
|
850
|
+
* oftToken: '0x27a16dc786820B16E5c9028b75B99F6f604b5d26',
|
|
851
|
+
* dstEid: 30101,
|
|
852
|
+
* amount: 1_000_000n,
|
|
853
|
+
* dstVault: '0xSpokeVault...',
|
|
854
|
+
* refundAddress: curatorAddress,
|
|
855
|
+
* })
|
|
856
|
+
* ```
|
|
857
|
+
*/
|
|
858
|
+
declare function useExecuteBridge(vault: `0x${string}`, token: Address, chainId: number): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, CuratorBridgeParams, unknown>;
|
|
859
|
+
|
|
860
|
+
interface UseSubVaultPositionsOptions {
|
|
861
|
+
/** Refetch interval in ms. Default: 30_000 (30s) */
|
|
862
|
+
refetchInterval?: number;
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Read active sub-vault positions held by a curator vault.
|
|
866
|
+
*
|
|
867
|
+
* Returns ERC4626 and ERC7540 positions with share balances and underlying values.
|
|
868
|
+
* Positions with zero share balance are excluded.
|
|
869
|
+
*
|
|
870
|
+
* @example
|
|
871
|
+
* const { data: positions, isLoading } = useSubVaultPositions('0xVAULT', 8453)
|
|
872
|
+
*/
|
|
873
|
+
declare function useSubVaultPositions(vault: `0x${string}` | undefined, chainId: number, options?: UseSubVaultPositionsOptions): _tanstack_react_query.UseQueryResult<SubVaultPosition[], Error>;
|
|
874
|
+
|
|
875
|
+
interface UseVaultPortfolioOptions {
|
|
876
|
+
/** Refetch interval in ms. Default: 30_000 (30s) */
|
|
877
|
+
refetchInterval?: number;
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Read the full portfolio view for a curator vault.
|
|
881
|
+
*
|
|
882
|
+
* Combines liquid asset balances with ERC4626/ERC7540 sub-vault positions
|
|
883
|
+
* and locked ERC7540 pending assets into a single portfolio snapshot.
|
|
884
|
+
*
|
|
885
|
+
* @example
|
|
886
|
+
* const { data: portfolio, isLoading } = useVaultPortfolio('0xVAULT', 8453)
|
|
887
|
+
*/
|
|
888
|
+
declare function useVaultPortfolio(vault: `0x${string}` | undefined, chainId: number, options?: UseVaultPortfolioOptions): _tanstack_react_query.UseQueryResult<VaultPortfolio, Error>;
|
|
889
|
+
|
|
890
|
+
interface UseERC7540RequestStatusOptions {
|
|
891
|
+
/** Refetch interval in ms. Default: 15_000 (15s) — shorter since pending→claimable transitions matter */
|
|
892
|
+
refetchInterval?: number;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Read ERC7540 async request status for a specific sub-vault.
|
|
896
|
+
*
|
|
897
|
+
* Queries pending and claimable deposit/redeem amounts for the vault
|
|
898
|
+
* acting as controller in the given ERC7540 sub-vault (requestId = 0).
|
|
899
|
+
*
|
|
900
|
+
* @example
|
|
901
|
+
* const { data: status } = useERC7540RequestStatus(
|
|
902
|
+
* '0xVAULT',
|
|
903
|
+
* 8453,
|
|
904
|
+
* '0xSUB_VAULT'
|
|
905
|
+
* )
|
|
906
|
+
* if (status?.canFinalizeDeposit) {
|
|
907
|
+
* // curator can call erc7540Deposit to claim shares
|
|
908
|
+
* }
|
|
909
|
+
*/
|
|
910
|
+
declare function useERC7540RequestStatus(vault: `0x${string}` | undefined, chainId: number, subVault: `0x${string}` | undefined, options?: UseERC7540RequestStatusOptions): _tanstack_react_query.UseQueryResult<ERC7540RequestStatus, Error>;
|
|
911
|
+
|
|
912
|
+
export { AsyncRequestStatusInfo, CuratorAction, CuratorVaultStatus, ERC7540RequestStatus, MultiChainUserPosition, PendingAction, SubVaultPosition, UserPosition, VaultAnalysis, VaultAssetBreakdown, VaultMetadata, VaultPortfolio, VaultStatus, VaultTopology, getRouteTokenDecimals, useAsyncRequestStatus, useCuratorBridgeQuote, useCuratorVaultStatus, useDepositSimple, useERC7540RequestStatus, useExecuteActions, useExecuteBridge, useInboundRoutes, useIsCurator, useLzFee, useOmniDeposit, useOmniRedeem, usePendingActions, useProtocolWhitelist, useRedeemShares, useSmartDeposit, useSmartRedeem, useSubVaultPositions, useSubmitActions, useUserPosition, useUserPositionMultiChain, useVaultAnalysis, useVaultAssetBreakdown, useVaultDistribution, useVaultMetadata, useVaultPortfolio, useVaultStatus, useVaultTopology, useVetoActions };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { J as VaultStatus, G as VaultMetadata, z as UserPosition, v as MultiChainUserPosition, o as AsyncRequestStatusInfo, L as VaultTopology, F as VaultDistribution, u as InboundRouteWithBalance, a as CuratorVaultStatus, b as VaultAnalysis, c as VaultAssetBreakdown, P as PendingAction, e as SubmitActionsResult, d as CuratorAction, r as CuratorBridgeParams, g as SubVaultPosition, h as VaultPortfolio, E as ERC7540RequestStatus } from '../curatorBridge-CNs59kT9.js';
|
|
3
3
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
4
4
|
import { Address } from 'viem';
|
|
5
5
|
|
|
@@ -645,4 +645,268 @@ declare function useVetoActions(vault: `0x${string}`, chainId: number): _tanstac
|
|
|
645
645
|
nonces: bigint[];
|
|
646
646
|
}, unknown>;
|
|
647
647
|
|
|
648
|
-
|
|
648
|
+
/**
|
|
649
|
+
* Quote the native fee required to bridge assets from the hub vault via LzAdapter.
|
|
650
|
+
*
|
|
651
|
+
* Refreshes every 60s — bridge fees fluctuate with LayerZero network demand.
|
|
652
|
+
*
|
|
653
|
+
* @example
|
|
654
|
+
* ```tsx
|
|
655
|
+
* const { fee, isLoading } = useCuratorBridgeQuote('0xVAULT', 8453, {
|
|
656
|
+
* oftToken: '0x27a16dc786820B16E5c9028b75B99F6f604b5d26',
|
|
657
|
+
* dstEid: 30101,
|
|
658
|
+
* amount: 1_000_000n,
|
|
659
|
+
* dstVault: '0xSpokeVault...',
|
|
660
|
+
* refundAddress: '0xCurator...',
|
|
661
|
+
* })
|
|
662
|
+
* ```
|
|
663
|
+
*/
|
|
664
|
+
declare function useCuratorBridgeQuote(vault: `0x${string}` | undefined, chainId: number, params: CuratorBridgeParams | undefined): {
|
|
665
|
+
fee: bigint | undefined;
|
|
666
|
+
data: bigint;
|
|
667
|
+
error: Error;
|
|
668
|
+
isError: true;
|
|
669
|
+
isPending: false;
|
|
670
|
+
isLoading: false;
|
|
671
|
+
isLoadingError: false;
|
|
672
|
+
isRefetchError: true;
|
|
673
|
+
isSuccess: false;
|
|
674
|
+
isPlaceholderData: false;
|
|
675
|
+
status: "error";
|
|
676
|
+
dataUpdatedAt: number;
|
|
677
|
+
errorUpdatedAt: number;
|
|
678
|
+
failureCount: number;
|
|
679
|
+
failureReason: Error | null;
|
|
680
|
+
errorUpdateCount: number;
|
|
681
|
+
isFetched: boolean;
|
|
682
|
+
isFetchedAfterMount: boolean;
|
|
683
|
+
isFetching: boolean;
|
|
684
|
+
isInitialLoading: boolean;
|
|
685
|
+
isPaused: boolean;
|
|
686
|
+
isRefetching: boolean;
|
|
687
|
+
isStale: boolean;
|
|
688
|
+
isEnabled: boolean;
|
|
689
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
690
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
691
|
+
promise: Promise<bigint>;
|
|
692
|
+
} | {
|
|
693
|
+
fee: bigint | undefined;
|
|
694
|
+
data: bigint;
|
|
695
|
+
error: null;
|
|
696
|
+
isError: false;
|
|
697
|
+
isPending: false;
|
|
698
|
+
isLoading: false;
|
|
699
|
+
isLoadingError: false;
|
|
700
|
+
isRefetchError: false;
|
|
701
|
+
isSuccess: true;
|
|
702
|
+
isPlaceholderData: false;
|
|
703
|
+
status: "success";
|
|
704
|
+
dataUpdatedAt: number;
|
|
705
|
+
errorUpdatedAt: number;
|
|
706
|
+
failureCount: number;
|
|
707
|
+
failureReason: Error | null;
|
|
708
|
+
errorUpdateCount: number;
|
|
709
|
+
isFetched: boolean;
|
|
710
|
+
isFetchedAfterMount: boolean;
|
|
711
|
+
isFetching: boolean;
|
|
712
|
+
isInitialLoading: boolean;
|
|
713
|
+
isPaused: boolean;
|
|
714
|
+
isRefetching: boolean;
|
|
715
|
+
isStale: boolean;
|
|
716
|
+
isEnabled: boolean;
|
|
717
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
718
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
719
|
+
promise: Promise<bigint>;
|
|
720
|
+
} | {
|
|
721
|
+
fee: bigint | undefined;
|
|
722
|
+
data: undefined;
|
|
723
|
+
error: Error;
|
|
724
|
+
isError: true;
|
|
725
|
+
isPending: false;
|
|
726
|
+
isLoading: false;
|
|
727
|
+
isLoadingError: true;
|
|
728
|
+
isRefetchError: false;
|
|
729
|
+
isSuccess: false;
|
|
730
|
+
isPlaceholderData: false;
|
|
731
|
+
status: "error";
|
|
732
|
+
dataUpdatedAt: number;
|
|
733
|
+
errorUpdatedAt: number;
|
|
734
|
+
failureCount: number;
|
|
735
|
+
failureReason: Error | null;
|
|
736
|
+
errorUpdateCount: number;
|
|
737
|
+
isFetched: boolean;
|
|
738
|
+
isFetchedAfterMount: boolean;
|
|
739
|
+
isFetching: boolean;
|
|
740
|
+
isInitialLoading: boolean;
|
|
741
|
+
isPaused: boolean;
|
|
742
|
+
isRefetching: boolean;
|
|
743
|
+
isStale: boolean;
|
|
744
|
+
isEnabled: boolean;
|
|
745
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
746
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
747
|
+
promise: Promise<bigint>;
|
|
748
|
+
} | {
|
|
749
|
+
fee: bigint | undefined;
|
|
750
|
+
data: undefined;
|
|
751
|
+
error: null;
|
|
752
|
+
isError: false;
|
|
753
|
+
isPending: true;
|
|
754
|
+
isLoading: true;
|
|
755
|
+
isLoadingError: false;
|
|
756
|
+
isRefetchError: false;
|
|
757
|
+
isSuccess: false;
|
|
758
|
+
isPlaceholderData: false;
|
|
759
|
+
status: "pending";
|
|
760
|
+
dataUpdatedAt: number;
|
|
761
|
+
errorUpdatedAt: number;
|
|
762
|
+
failureCount: number;
|
|
763
|
+
failureReason: Error | null;
|
|
764
|
+
errorUpdateCount: number;
|
|
765
|
+
isFetched: boolean;
|
|
766
|
+
isFetchedAfterMount: boolean;
|
|
767
|
+
isFetching: boolean;
|
|
768
|
+
isInitialLoading: boolean;
|
|
769
|
+
isPaused: boolean;
|
|
770
|
+
isRefetching: boolean;
|
|
771
|
+
isStale: boolean;
|
|
772
|
+
isEnabled: boolean;
|
|
773
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
774
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
775
|
+
promise: Promise<bigint>;
|
|
776
|
+
} | {
|
|
777
|
+
fee: bigint | undefined;
|
|
778
|
+
data: undefined;
|
|
779
|
+
error: null;
|
|
780
|
+
isError: false;
|
|
781
|
+
isPending: true;
|
|
782
|
+
isLoadingError: false;
|
|
783
|
+
isRefetchError: false;
|
|
784
|
+
isSuccess: false;
|
|
785
|
+
isPlaceholderData: false;
|
|
786
|
+
status: "pending";
|
|
787
|
+
dataUpdatedAt: number;
|
|
788
|
+
errorUpdatedAt: number;
|
|
789
|
+
failureCount: number;
|
|
790
|
+
failureReason: Error | null;
|
|
791
|
+
errorUpdateCount: number;
|
|
792
|
+
isFetched: boolean;
|
|
793
|
+
isFetchedAfterMount: boolean;
|
|
794
|
+
isFetching: boolean;
|
|
795
|
+
isLoading: boolean;
|
|
796
|
+
isInitialLoading: boolean;
|
|
797
|
+
isPaused: boolean;
|
|
798
|
+
isRefetching: boolean;
|
|
799
|
+
isStale: boolean;
|
|
800
|
+
isEnabled: boolean;
|
|
801
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
802
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
803
|
+
promise: Promise<bigint>;
|
|
804
|
+
} | {
|
|
805
|
+
fee: bigint | undefined;
|
|
806
|
+
data: bigint;
|
|
807
|
+
isError: false;
|
|
808
|
+
error: null;
|
|
809
|
+
isPending: false;
|
|
810
|
+
isLoading: false;
|
|
811
|
+
isLoadingError: false;
|
|
812
|
+
isRefetchError: false;
|
|
813
|
+
isSuccess: true;
|
|
814
|
+
isPlaceholderData: true;
|
|
815
|
+
status: "success";
|
|
816
|
+
dataUpdatedAt: number;
|
|
817
|
+
errorUpdatedAt: number;
|
|
818
|
+
failureCount: number;
|
|
819
|
+
failureReason: Error | null;
|
|
820
|
+
errorUpdateCount: number;
|
|
821
|
+
isFetched: boolean;
|
|
822
|
+
isFetchedAfterMount: boolean;
|
|
823
|
+
isFetching: boolean;
|
|
824
|
+
isInitialLoading: boolean;
|
|
825
|
+
isPaused: boolean;
|
|
826
|
+
isRefetching: boolean;
|
|
827
|
+
isStale: boolean;
|
|
828
|
+
isEnabled: boolean;
|
|
829
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
830
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
831
|
+
promise: Promise<bigint>;
|
|
832
|
+
};
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Execute a curator bridge operation via BridgeFacet.executeBridging.
|
|
836
|
+
*
|
|
837
|
+
* This is a direct curator call (NOT via multicall). The vault pauses during
|
|
838
|
+
* bridging for security. Automatically quotes and includes the required
|
|
839
|
+
* LayerZero fee as msg.value.
|
|
840
|
+
*
|
|
841
|
+
* @param vault Hub vault address (diamond proxy)
|
|
842
|
+
* @param token Underlying ERC-20 token address to bridge (NOT the OFT address)
|
|
843
|
+
* @param chainId Chain ID of the hub vault
|
|
844
|
+
*
|
|
845
|
+
* @example
|
|
846
|
+
* ```tsx
|
|
847
|
+
* const { mutateAsync, isPending } = useExecuteBridge('0xVAULT', USDC_ADDRESS, 8453)
|
|
848
|
+
*
|
|
849
|
+
* await mutateAsync({
|
|
850
|
+
* oftToken: '0x27a16dc786820B16E5c9028b75B99F6f604b5d26',
|
|
851
|
+
* dstEid: 30101,
|
|
852
|
+
* amount: 1_000_000n,
|
|
853
|
+
* dstVault: '0xSpokeVault...',
|
|
854
|
+
* refundAddress: curatorAddress,
|
|
855
|
+
* })
|
|
856
|
+
* ```
|
|
857
|
+
*/
|
|
858
|
+
declare function useExecuteBridge(vault: `0x${string}`, token: Address, chainId: number): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, CuratorBridgeParams, unknown>;
|
|
859
|
+
|
|
860
|
+
interface UseSubVaultPositionsOptions {
|
|
861
|
+
/** Refetch interval in ms. Default: 30_000 (30s) */
|
|
862
|
+
refetchInterval?: number;
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Read active sub-vault positions held by a curator vault.
|
|
866
|
+
*
|
|
867
|
+
* Returns ERC4626 and ERC7540 positions with share balances and underlying values.
|
|
868
|
+
* Positions with zero share balance are excluded.
|
|
869
|
+
*
|
|
870
|
+
* @example
|
|
871
|
+
* const { data: positions, isLoading } = useSubVaultPositions('0xVAULT', 8453)
|
|
872
|
+
*/
|
|
873
|
+
declare function useSubVaultPositions(vault: `0x${string}` | undefined, chainId: number, options?: UseSubVaultPositionsOptions): _tanstack_react_query.UseQueryResult<SubVaultPosition[], Error>;
|
|
874
|
+
|
|
875
|
+
interface UseVaultPortfolioOptions {
|
|
876
|
+
/** Refetch interval in ms. Default: 30_000 (30s) */
|
|
877
|
+
refetchInterval?: number;
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Read the full portfolio view for a curator vault.
|
|
881
|
+
*
|
|
882
|
+
* Combines liquid asset balances with ERC4626/ERC7540 sub-vault positions
|
|
883
|
+
* and locked ERC7540 pending assets into a single portfolio snapshot.
|
|
884
|
+
*
|
|
885
|
+
* @example
|
|
886
|
+
* const { data: portfolio, isLoading } = useVaultPortfolio('0xVAULT', 8453)
|
|
887
|
+
*/
|
|
888
|
+
declare function useVaultPortfolio(vault: `0x${string}` | undefined, chainId: number, options?: UseVaultPortfolioOptions): _tanstack_react_query.UseQueryResult<VaultPortfolio, Error>;
|
|
889
|
+
|
|
890
|
+
interface UseERC7540RequestStatusOptions {
|
|
891
|
+
/** Refetch interval in ms. Default: 15_000 (15s) — shorter since pending→claimable transitions matter */
|
|
892
|
+
refetchInterval?: number;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Read ERC7540 async request status for a specific sub-vault.
|
|
896
|
+
*
|
|
897
|
+
* Queries pending and claimable deposit/redeem amounts for the vault
|
|
898
|
+
* acting as controller in the given ERC7540 sub-vault (requestId = 0).
|
|
899
|
+
*
|
|
900
|
+
* @example
|
|
901
|
+
* const { data: status } = useERC7540RequestStatus(
|
|
902
|
+
* '0xVAULT',
|
|
903
|
+
* 8453,
|
|
904
|
+
* '0xSUB_VAULT'
|
|
905
|
+
* )
|
|
906
|
+
* if (status?.canFinalizeDeposit) {
|
|
907
|
+
* // curator can call erc7540Deposit to claim shares
|
|
908
|
+
* }
|
|
909
|
+
*/
|
|
910
|
+
declare function useERC7540RequestStatus(vault: `0x${string}` | undefined, chainId: number, subVault: `0x${string}` | undefined, options?: UseERC7540RequestStatusOptions): _tanstack_react_query.UseQueryResult<ERC7540RequestStatus, Error>;
|
|
911
|
+
|
|
912
|
+
export { AsyncRequestStatusInfo, CuratorAction, CuratorVaultStatus, ERC7540RequestStatus, MultiChainUserPosition, PendingAction, SubVaultPosition, UserPosition, VaultAnalysis, VaultAssetBreakdown, VaultMetadata, VaultPortfolio, VaultStatus, VaultTopology, getRouteTokenDecimals, useAsyncRequestStatus, useCuratorBridgeQuote, useCuratorVaultStatus, useDepositSimple, useERC7540RequestStatus, useExecuteActions, useExecuteBridge, useInboundRoutes, useIsCurator, useLzFee, useOmniDeposit, useOmniRedeem, usePendingActions, useProtocolWhitelist, useRedeemShares, useSmartDeposit, useSmartRedeem, useSubVaultPositions, useSubmitActions, useUserPosition, useUserPositionMultiChain, useVaultAnalysis, useVaultAssetBreakdown, useVaultDistribution, useVaultMetadata, useVaultPortfolio, useVaultStatus, useVaultTopology, useVetoActions };
|