Ledger’s WalletAPI SDK | Developers

Ledger's WalletAPI SDK

Estimated reading time: One minute

To learn how to create (or embed if already existing) your user interface for the swap, please follow this tutorial.

Your LiveApp will interact with Ledger Live with 2 differents methods:

Those methods are more detailed in github

startExchange

This method will return you a nonce.

A nonce field will is the last parameter you need to provide to the /swap endpoint.
It is a 32 bytes nonce which is generated by the hardware wallet to avoid replay attacks.
It needs to be base 64 URL encoded before being sent to the /swap endpoint.

completeExchange

This method will need you to provide, among other things, 2 important parameters:

  • payload: it is the base64 URL encoded result of your call to the /swap/payload endpoints.
  • signature: it is the base64 URL encoded result of your JWS signature of the previous payload.

Here is a little diagram to explain how the payload and its signature are generated: Payload and Payload Signature generation diagram

  • payload: the trade parameters are assembled in a protobuf message, via the /swap/payload endpoint. Then, with base64 encoding we get the payload field.
  • signature: trom the binary encoding of the previous protobuf (Byte Array), we sign it with ES256 and the provider’s private key to get a Signature Byte Array. Finally, with base64 encoding we get the signature.

Did you find this page helpful?


How would you improve this page for developers?



Provider's LiveApp
Test your LiveApp
Getting Started
Theme Features
Customization

Swap