# Link.offramp

## Link.offramp

OFF-RAMP REQUIRES AUTHENTICATED USER

`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 XpansionChain and providers, such as MoonPay and Layerswap.

LIMITED CURRENCY SUPPORT WITH MOONPAY

We only support ETH, USDC, GODS or IMX token

#### Off-ramp with MoonPay provider[​](https://docs.x.immutable.com/docs/x/link-off-ramp#off-ramp-with-moonpay-provider) <a href="#off-ramp-with-moonpay-provider" id="off-ramp-with-moonpay-provider"></a>

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:

![Off-ramp without parameters](https://3017072639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7a6afyDwSEkvWtt1UhmH%2Fuploads%2FvF4l7woVQDcinpIxAZ3P%2F1.png?alt=media\&token=2426e1f3-dd67-4415-8562-9e3f60fa9e5a)

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:

![Off-ramp with specific currency](https://3017072639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7a6afyDwSEkvWtt1UhmH%2Fuploads%2FymkEPhLkcBLlQOpXFfYI%2F2.png?alt=media\&token=cccc4a40-5dbc-49ef-ba01-7b4222f94488)

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 specific currency and amount](https://3017072639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7a6afyDwSEkvWtt1UhmH%2Fuploads%2FsqSsa6hnDujG54W8j6hq%2F3.png?alt=media\&token=0ce0a23f-b8c0-42ce-b987-32d877b71c60)

#### Off-ramp with Layerswap provider[​](https://docs.x.immutable.com/docs/x/link-off-ramp#off-ramp-with-layerswap-provider) <a href="#off-ramp-with-layerswap-provider" id="off-ramp-with-layerswap-provider"></a>

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:

![Off-ramp with specified provider](https://3017072639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7a6afyDwSEkvWtt1UhmH%2Fuploads%2F7i0B03pNuJcCUuPRKSh2%2F3%E5%A4%A7%E6%A0%87%E9%A2%98%20%20%E7%AC%AC%E4%BA%8C%E4%B8%AA%E6%A1%86%E6%A1%86%20%E7%AC%AC%E4%B8%89%E8%A1%8C%20%E7%AC%AC%E5%9B%9B%E8%A1%8C%E7%9A%84%E5%9B%BE%E6%A0%87.png?alt=media\&token=1739fdcc-8a18-4eb7-ac97-2c0abf996031)

### Errors[​](https://docs.x.immutable.com/docs/x/link-off-ramp#errors) <a href="#errors" id="errors"></a>

See error responses <mark style="color:blue;">here</mark>.[\
](https://docs.x.immutable.com/docs/x/link-easy-login)
