Hooks
useFunding
Only available from SDK V1
Summary
This hook can be used to trigger an Onramp UI so that users can immediately buy crypto with fiat.
How it works
After setting up your onramp provider, you can use the useFunding to prompt your user to fund their wallet.
UseFunding exposes the following attributes:
Method | Type | Description |
---|---|---|
enabled | boolean | Weather funding is enable and ready to use |
openExternalFunding | function | Trigger the onramp UI with required onrampProvider attribute and optional address and token attributes, returns a Promise that will resolve once the onramp UI is closed |
connectWalletForFunding | function | Trigger connecting a wallet in order to fund your primary wallet |
fundWithExternalWallet | function | Triggers a transaction to your primary wallet from a connected wallet given fromWallet and amount |
Examples
Example on funding your primary wallet from an external wallet
Example on a custom onramp button.
Was this page helpful?