Link.onramp
Link.onramp({})
should only be called when user is authenticated and logged in, otherwise it will require user to reconnect
The on-ramp functionality is available in SDK v1.35.3+ and is a collaboration between Immutable and Providers, such as MoonPay and Layerswap.
We only support ETH, USDC, GODS or IMX token
The list of supported cryptoCurrencies
in the Link SDK:
ExchangeCurrency.USDC
ExchangeCurrency.ETH
ExchangeCurrency.IMX
ExchangeCurrency.GODS
On-ramp with MoonPay provider
To initialize the on-ramp process with an option to choose any available currency, marketplace needs to call the onramp
function:
await link.onramp({});
This displays the Link UI with loaded MoonPay widget:
To initialize the on-ramp process for a specific currency:
await link.onramp({ cryptoCurrencies: ['ETH'] });
This displays the Link UI with loaded MoonPay widget:
To initialize the on-ramp process when a user can choose only specific currencies:
await link.onramp({ cryptoCurrencies: ['ETH', 'USDC'] });
// or
await link.onramp({ cryptoCurrencies: ['IMX', 'GODS'] });
To test the transactions in the Sandbox environment, please use the following test cards:
CARD: Visa NUMBER: 4444493318246892 DATE: 12/2023 CVC: 123
CARD: Mastercard NUMBER: 2222755234426838 DATE: 01/2024 CVC: 123
On-ramp with Layerswap provider
To initialize the on-ramp process with specified provider(by default MoonPay):
await link.onramp({ provider: 'layerswap' });
This displays the Link UI with loaded Layerswap widget:
To test the transactions in the Sandbox environment, please use your exchange account with feature supported Sepolia cryptocurrencies
Errors
See error responses here.