useFundWithWallet, useOnramp, useExchangeAccounts, useOpenFundingOptions, usePayWithDynamic) that opened the widget’s funding modals. The JavaScript SDK exposes each funding path — wallet transfer, on-ramp providers, and exchange transfers — as its own function (with a matching React hook), and leaves the “how do you want to add funds?” menu to you.
The on-ramp provider surfaces (MoonPay, Coinbase) are the same build in any JavaScript SDK app: Funding flows (Building UI) covers them with full code. This page is the React→JavaScript translation across every funding path plus what the widget’s funding menu did for you.
Transfer from a connected wallet
transferAmount() sends native currency or a token from a specific walletAccount (from getWalletAccounts()) to a recipient and resolves with the transactionHash. Omit token for the native asset; for an ERC-20 include its { address, decimals }.
On-ramps (buy crypto)
useOnramp becomes one function per provider — build the URL (or order), open it, then reconcile the result in your UI. The MoonPay and Coinbase surfaces are built in Funding flows (Building UI).
For Coinbase,
createCoinbaseOnrampOrder() starts an order and addCoinbaseOnrampOrderEventListener() reports its progress; getMissingVerificationForCoinbaseOnrampOrder() tells you what identity step (if any) the user still needs.
Exchange transfers
useExchangeAccounts becomes the Kraken functions — read the user’s accounts, resolve where funds can go, and start a transfer. See the Kraken integration reference for each function’s parameters and return shape.
The funding menu (what the widget did for you)
useOpenFundingOptions and usePayWithDynamic opened the widget’s funding chooser. There is no modal to open now — and no runtime API that reports which funding methods are enabled, so decide which paths to offer based on what you’ve configured in your Dynamic dashboard, render your own “add funds” menu, and route each choice to the function above. For a pay/checkout experience, compose the deposit flow described in Building for Flow. Concretely, you now own:
- The “add funds” menu — the chooser that offered wallet transfer, on-ramp, and exchange.
- Provider surfaces — where you open the on-ramp URL (tab, popup, or embedded frame) and how you reconcile the result.
- Transfer forms — amount, token, and recipient inputs feeding
transferAmount(). - Progress & receipts — the confirmation UI once a transfer or order completes.
Errors you now own
See also
- Funding flows (Building UI) — build the full add-funds menu and provider surfaces
- Connecting external wallets (Building UI) — add a wallet to fund from
- Building for Flow (Building UI) — deposit and checkout flows
- Using connected wallets — pick the wallet to transfer from