Ramp
Endpoint: /action/ramp
Embeds the WalletTwo ramp flow inside your application. The ramp lets a logged-in user buy, sell, or swap tokens using fiat or crypto payment methods. All ramp logic is handled by the RampProvider component; this action is purely the entry point that reads URL parameters and passes them in.
Required user state
User is logged in
LoggedMiddleware
/auth/login
Email is verified
EmailVerifiedMiddleware
/auth/email/verify
Wallet is created
WalletMiddleware
/auth/wallet/register
Iframe URL
https://<WALLETTWO_ORIGIN>/action/ramp?iframe=trueAll parameters are optional and configure the initial state of the ramp flow:
ctrt
_contract
string
Contract address to use for the operation
amt
_amount
string
Pre-filled amount
pm
_paymentMethod
string
Pre-selected payment method
cur
_currency
string
Pre-selected currency code (e.g. USD, EUR)
op
_operator
string
Operator identifier
ntwk
_chainId
number
Chain ID of the target network
ext_id
_externalId
string
Your external reference ID (correlates the ramp session to your own records)
redirect_uri
_redirectUrl
string
URL to redirect the iframe to when the ramp flow completes
use_fiat
useFiat
"true" | "false"
Whether to use the fiat onramp flow. Defaults to true
additional_txns
_additionalTransactions
JSON string
Array of additional transactions to execute alongside the ramp (see below)
iframe
(layout)
"true"
Activates bare rendering mode
Additional transactions (additional_txns)
additional_txns is a JSON-encoded array of transaction objects to be bundled with the ramp operation. Parse errors are swallowed silently; if the JSON is invalid, additional_txns defaults to [].
Expected format:
method
Yes
Name of the contract method to call
params
Yes
Array of arguments for the method
address
Yes
Target contract address
network
Yes
Network/chain identifier
abi
No
Full ABI fragment for the method (if not already known by WalletTwo)
abiURL
Yes
Full ABI fragment for the method (if not already known by WalletTwo)
What happens when the action runs
URL params are read immediately.
If
additional_txnsis present it is JSON-parsed; errors are caught and logged.The view waits for
selectedNetworkfrom the network hook. While waiting, a full-screen spinner is shown.Once the network is available,
RampProvidermounts with all mapped props and drives the rest of the flow.
Loading state
While the selected network is not yet available, the iframe renders only:
This is normal. It resolves as soon as the app's network state is hydrated.
Example URLs
Minimal (fiat onramp, defaults)
Pre-fill fiat EUR purchase on Polygon
Crypto-only, with external reference ID
With additional bundled transaction
Host page integration
The ramp component manages its own navigation states internally. Result handling (success, failure, cancellation) is controlled by redirect_uri or by events fired from RampProvider. Consult the RampProvider documentation for the full event contract emitted during the ramp flow.
Notes
The
ntwkparam is cast toNumber. Passing a non-numeric value results inundefinedbeing passed toRampProvider, which falls back to its own default network.If
use_fiatis not provided, it defaults totrue.ext_idis your reference identifier and is passed through to WalletTwo's records unchanged so you can correlate ramp sessions from your backend.
Last updated