-
Notifications
You must be signed in to change notification settings - Fork 10
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 sold | ||
* `feeStrategy`: `SLOW`, `MEDIUM`, `FAST` or `CUSTOM`. | ||
* `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.sell({ | ||
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") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
||
|
There was a problem hiding this comment.
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 :/
There was a problem hiding this comment.
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 :/