> **Key takeaway:**  ☞   The renaming of "Ledger Live" to "Ledger Wallet" and\
>      "wallet" (in the hardware sense) to "signer" is still in progress.\
>      This page may contain legacy references that will be updated.

# Provider's LiveApp

As explained in the [Sell Integration](../sell) page, you need to modify your LiveApp with some particularities compared to the one that can be found in the Discover section.

Your LiveApp must:

- Use the [Ledger Exchange Services Kit](https://github.com/LedgerHQ/exchange-sdk), in addition to the Wallet API.
- Respond to specific LiveApp URL parameters in order to adapt to the flow inside .
- Have a modified, slightly more complex, Manifest file.
- Follow specific flow/ux requirements.

## Ledger Exchange Services Kit

To learn how to create (or embed if already existing) your user interface for the sell, please follow the [Discover documentation](../../discover/getting-started).

Your LiveApp will interact with , through the [ExchangeSDK](https://github.com/LedgerHQ/exchange-sdk), with the corresponding method.

You will need to set up the SDK with your `providerId` attributed upon request by Ledger.

```js copy
const exchangeSDK = new ExchangeSDK("yourProviderId");
```

### SELL method

This method will need you to provide the following parameters:

- `quoteId`: The id coming from your system and [forwarded to your LiveApp](./providers-liveapp) as a query parameter.
- `fromAccountId`: User's Ledger account id, [previously given to the LiveApp](./providers-liveapp) as a query parameter.
- `fromAmount`: Amount that will be sold.
- `toFiat`: Fiat currency that the user wants to be paid with using provider id.
- `rate`: The crypto/fiat rate.

```js copy
exchangeSDK.sell({
  quoteId: "123abc",
  fromAccountId: "97f06be9-6fb2-5da3-be71-4e762ed6e115", // <Glossary word='Ledger Wallet'></Glossary> uuid4 account (can be a BTC account)
  fromAmount: new BigNumber(1),
  toFiat: "EUR", // provider fiat id
  rate: 66564, // crypto/fiat rate [BTC/EUR]
  type: "SELL",
});
```

## LiveApp URL

The LiveApp needs to respond to a URL with some parameters. LiveApp URLs are used to open your LiveApp with the quote values that the user already entered in .

The LiveApp URL format is already fixed and will depend on the information you provided inside your [LiveApp manifest](../../../../docs/discover/wallet-api/appendix/manifest) (ex: `ledgerlive://discover/sellprovidername`).

- `accountId`: User’s selected account id, where the crypto he wants to sell is stored.
- `cryptoCurrency`: The crypto currency that the user wants to sell. It will contain the [LedgerID](https://developers.ledger.com/docs/ledger-live/exchange/sell/providers-backend#ledger-ids-mapping) value to identify the crypto.
- `fiatCurrency`: The fiat currency that the user wants to be paid with.
- `cryptoAmount`: The crypto amount that the user wants to sell.
- `paymentMethod`: The preferred payment method for the user.
- `mode`: `buy` or `sell`. In this case always sell. Required you share the same base widget url for both usages.
- `bankResidency`: User's Country Code (ALPHA-2)
- `ledgerTransactionId`: ID used by Ledger to track transactions and their completion statuses.
- `customParameters`: Used to include additional URL-encoded key-value parameters in the widget URL.For example: `widgetid%3D247312%26ledgerlive%3Dtrue`.

**Example**:

```
https://sell.provider.widget.com?[accountId]=ua11-…&[cryptoCurrency]=bitcoin&[fiatCurrency]=EUR&[cryptoAmount]=0.04
```

> **Note:** Ledger needs to know how to send referral information through the widget.

## Manifest Permission

Your [LiveApp manifest](../../../../docs/discover/wallet-api/appendix/manifest) should contains at least those permissions request:

```json copy
"permissions": [
  "account.list",
  "currency.list",
  "custom.exchange.start",
  "custom.exchange.complete",
  "custom.exchange.error",
]
```

## Key Generation for Production and Test Environments

To ensure secure communication, you must generate two sets of keys: one for the production environment and one for the test environment. Follow the steps below to generate these keys:

# Testing with the Development Key

After submitting [your keys](/docs/ledger-live/exchange/sell/providers-backend#generate-privatepublic-key) to us and once the CAL team has successfully integrated them, you can proceed to test your integration in .

### Steps to Test in Ledger Wallet

1. Open the **Settings** menu in .
2. Navigate to the **Developer** tab.
3. Locate the setting labeled **Exchange in Test Partner Mode**.
4. Enable this setting to activate the test environment.

![Payload and Payload Signature generation diagram](/exchange/exchange-dev-mode.png)

With this mode enabled, you can verify the functionality of your keys and ensure everything is working as expected in the test environment.
