useMojitoWallets

πŸ‘› Returns all wallets for the current user, including the tokens data associated with every wallet.

🚧

Authentication required to use this hook

The useMojitoWallets will call and return a response from the wallet API.

Hooks Sample Code

...
import useMojitoWallets from "mojito-hooks/useMojitoWallets";

function App {
    const { wallets, isLoading } = useMojitoWallets();

    if(isLoading) return <Loader />;

    if(wallets) return (
        <div>
            {wallets.map((item) => <DrawWallet wallet={wallet} />)}
        </div>
    );

    return <div>No wallets available</div>
}

Parameters

πŸ“˜

This hook doesn't accept any parameters.

Result

PropertyDescriptionType
walletsUser wallets.MojitoWallet[]
isLoadingDisplay request loading status, provided for convenience.Boolean
errorThe error object for the query, if an error was thrown.Error
refetchA function to manually refetch the query.(options: T) => Promise<U>
queryResultOriginal React-Query query result.QueryResult<T>