useInitiateFiatRamp hook to launch the same flow with the amount, asset, and provider you choose.
useInitiateFiatRamp requires @getpara/react-sdk 3.18 or later.Which providers, assets, and networks are available — and their API keys — are configured in the Developer Portal, not in code. Set those up first: see Set Up Fiat Onramps (and the Coinbase-specific steps on that page). The hook only launches the flow; it can’t offer a provider or asset you haven’t enabled.
Basic usage
useInitiateFiatRamp returns a mutation-style handle. Call initiateFiatRamp(params) from a click handler to launch the flow:
Choosing the destination wallet
By default the ramp targets the user’s active wallet. Pass a wallet explicitly to target a different one.- Active wallet (default)
- A specific Para wallet
- An external address
Omit the wallet fields — the on-ramp funds whichever wallet is currently active.
Choosing the provider
Omitprovider to let Para pick the first enabled provider that serves the asset + amount, or name one explicitly. Use the OnRampProvider enum:
provider: OnRampProvider.COINBASE and pick the surface with method:
Selling (off-ramp)
Passtype: OnRampPurchaseType.SELL to launch a withdrawal instead of a purchase (for providers that support selling — see provider support):
Handling the result
UseinitiateFiatRampAsync (or read data/isPending/error off the hook) to observe what happened. The result’s outcome tells you whether the ramp launched directly or fell back to the modal’s prefilled form:
Parameters
useInitiateFiatRamp is the low-level entry point behind the Para Modal’s own Buy button, so it works with the same Developer Portal configuration and the same in-modal Buy/Withdraw UI. See initiateOnRampTransaction for the underlying core method.