Link.offramp
Link.offramp({})
should only be called when user is authenticated and logged in, otherwise it will require user to reconnect
The off-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
Off-ramp with MoonPay provider
To initialize the off-ramp process with an option to choose any available currency and amount, marketplace needs to call the off-ramp function:
await link.offramp({});
This displays the Link UI with a screen when a user need to choose currency and anter amount:
To initialize the off-ramp process for a specific currency:
await link.offramp({ cryptoCurrencies: ['ETH'] });
This displays the Link UI with a screen when a user can only enter amount with already populated currency:
To initialize the off-ramp process with defined currency and amount:
await link.offramp({ cryptoCurrencies: ['ETH'], amount: '0.01' });
This displays the Link UI with loaded MoonPay widget:
Off-ramp with Layerswap provider
To initialize the off-ramp process with specified provider(by default MoonPay):
await link.offramp({ provider: 'layerswap' });
This displays the Link UI with loaded Layerswap widget:
Errors
See error responses here.