Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SELL info considering ExchangeSDK release #178

Merged
merged 2 commits into from
May 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 28 additions & 1 deletion pages/docs/exchange/sell/providers-liveapp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,34 @@ You will need to set up the SDK with your `providerId` attributed upon request b

### SELL method

[TBD] Contact Ledger for more info.
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
* `accountId`: user's account id, [previously given to the LiveApp](./providers-liveapp) as a query parameter
* `amount`: amount that will be sell
sprohaszka-ledger marked this conversation as resolved.
Show resolved Hide resolved
* `feeStrategy`: `SLOW`, `MEDIUM`, `FAST` or `CUSTOM`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do you handle custom if no other param ?
we should re-discuss how to handle fees definition.
For swap with moonpay, the Custom is quite broken :/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fee is handle the same way it is handled by the swap (AFAIK). This is more on Ledger Live side :/

* `getSellPayload`: callback method called by the sell process to retrieve the payload (see below)

The `getSellPayload` is a callback that during the Sell process will be called with a `nonce`.
This value is required to craft on your side the Sell Payload, which will be returned by the callback.

```js copy
exchangeSDK.swap({
sprohaszka-ledger marked this conversation as resolved.
Show resolved Hide resolved
quoteId: "1234",
accountId: "07AB5930-C73A-433F-A2FA-920640AF3A02",
amount: "0.8",
feeStrategy: "SLOW",
getSellPayload: (nonce, sellAddress, amount) => {
// Crafting Payload...
return {
recipientAddress: "0xc0ffee254729296a45a3885639AC7E10F9d54979"
amount: BigInt("800000000000000000")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should document when the amount is expected in smallestDenomination and when it's in natural unit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe better naming of the vars : amountInSmallestDenomination / amountInUsualUnit ?

binaryPayload: "YiA1CuoMl_dH8dD3YIFGFKR1I4AbGut9C8u6oqT0a_gYSw==",
signature: "HA8qBfo8yFNzbV60Ws8GT54UWeing3kcDIdnov2nT9gFB58JybFE1sK0Ext3kARXhZ9J1sbltkBSeuzBdSkjVg==",
};
}
});
```

## LiveApp URL

Expand Down