Device transaction approval

Input: The user clicks on the “swap” button.

Output: The swap method from ExchangeSDK is called. During this call, the partner’s service will be called to build and sign the binary payload.

This payload contains the informations for the swap to be performed including:

  • Payin_address: the partner address to receive payment
  • Refund_address: the client address to receive back the payment funds in case the provider is not able to execute the swap for some unpredictable reason
  • Payout_address: the client address to receive the money resulting from a successful swap
  • Currency_from: set to value of payloadCurrencyFrom from the /swap API request
  • Currency_to: set to value of payloadCurrencyTo from the /swap API request
  • Amount_to_provider: the amount of currency_from that the provider expects to receive from the client
  • Amount_to_wallet: the amount of currency_to that the provider agrees to send to the client in exchange from amount_to_provider. This amount must also include the network fees that the provider will pay to send the crypto to the user.
  • Device_transaction_id: the swap transaction nonce provided by the client at initialization (must be set to value of nonce from the API request)

More detail here.

Transaction approval flow

  1. The user is asked first to unlock their Ledger device to access
  2. The user is asked then to open the app exchange on their Ledger device
  3. The user is redirected to the Confirmation drawer with information sent from the partner payload
  4. The user checks if the information displayed on the Ledger device is the same as in the drawer
  5. The user approves the transaction on his Ledger device. Transactions are broadcasted on the blockchain.
  6. The partner receives the amount and performs the swap
Confirmation modalDevice display
Swap: Amount of tokens to send (Initial amount)Send: Amount of tokens to send (Initial amount)
Receive: Amount of destination token credited (Credited amount)Get estimated: Amount of destination token credited (Credited amount)
Provider: name of the partner
Network fees: Network fees from Ledger account to partnerFees: Network fees from Ledger account to partner
Source: source account name
Destination: Destination account name
Ledger
Copyright © Ledger SAS. All rights reserved. Ledger, Ledger Nano S, Ledger Vault, Ledger OS are registered trademarks of Ledger SAS