Hooks
Moon SDK Hooks Documentation
The @moonup/moon-react-native
package provides a set of hooks that allow you to easily interact with the Moon SDK in your React Native project. This documentation page will guide you through the basics of using these hooks.
Table of Contents
Installation
Usage
Hooks
Examples
Installation
To use the Moon SDK hooks in your project, you'll need to install the @moonup/moon-react-native
package. You can install it using npm:
Usage
To use the Moon SDK hooks, you'll need to wrap your application with the MoonContextProvider
. Here's an example of how to do this:
Hooks
The @moonup/moon-react-native
package provides the following hooks:
useMoonConnect
: A hook that returns theconnect
function from the Moon SDK context.useMoonDisconnect
: A hook that returns thedisconnect
function from the Moon SDK context.useUserSession
: A hook that returns thegetUserSession
function from the Moon SDK context.useSolanaSDK
: A hook that returns the Solana SDK instance from the Moon SDK context.useBitcoinSDK
: A hook that returns the Bitcoin SDK instance from the Moon SDK context.useCosmosSDK
: A hook that returns the Cosmos SDK instance from the Moon SDK context.useEosSDK
: A hook that returns the EOS SDK instance from the Moon SDK context.useLitecoinSDK
: A hook that returns the Litecoin SDK instance from the Moon SDK context.useRippleSDK
: A hook that returns the Ripple SDK instance from the Moon SDK context.useTronSDK
: A hook that returns the Tron SDK instance from the Moon SDK context.useBitcoincashSDK
: A hook that returns the Bitcoin Cash SDK instance from the Moon SDK context.useDogecoinSDK
: A hook that returns the Dogecoin SDK instance from the Moon SDK context.useAccountsSDK
: A hook that returns the Accounts SDK instance from the Moon SDK context.useAaveSDK
: A hook that returns the Aave SDK instance from the Moon SDK context.useConveyorfinanceSDK
: A hook that returns the Conveyor Finance SDK instance from the Moon SDK context.useENSSDK
: A hook that returns the ENS SDK instance from the Moon SDK context.useErc20SDK
: A hook that returns the ERC-20 SDK instance from the Moon SDK context.useErc1155SDK
: A hook that returns the ERC-1155 SDK instance from the Moon SDK context.useErc721SDK
: A hook that returns the ERC-721 SDK instance from the Moon SDK context.useOneinchSDK
: A hook that returns the 1inch SDK instance from the Moon SDK context.useUniswapSDK
: A hook that returns the Uniswap SDK instance from the Moon SDK context.useYearnSDK
: A hook that returns the Yearn SDK instance from the Moon SDK context.
Examples
Here are examples of how to use each of the Moon SDK hooks:
useMoonConnect
useMoonConnect
useMoonDisconnect
useMoonDisconnect
useUserSession
useUserSession
useSolanaSDK
useSolanaSDK
The other hooks can be used in a similar way, by replacing useSolanaSDK
with the appropriate hook name and calling the appropriate SDK method.
Last updated