This file defines the JSON-RPC spec of the Platform API. This is meant to be implemented by all clients.
Platform-TS | |
---|---|
JSON-RPC 2.0 (Over postMessage) | ✅ |
JSON-RPC 2.0 (Over HTTP) | ❌ |
JSON-RPC 2.0 (Over HTTPS) | ❌ |
JSON-RPC 2.0 (Over WS) | ❌ |
Let the user sign a transaction through Ledger Live
Returns the raw signed transaction to broadcast.
accountId (string)
: Ledger Live id of the accounttransaction (RawTransaction)
: The transaction object in the currency family-specific formatparams? (SignParams)
: Parameters for the sign modalparams.useApp? (string)
: The name of the Ledger Nano app to use for the signing process
{
"jsonrpc": "2.0",
"id": 1,
"method": "transaction.sign",
"params": {
"accountId": "",
"transaction": {},
"params": {
"useApp": ""
}
}
}
{
"jsonrpc": "2.0",
"id": -1,
"result": {}
}
Let the user sign the provided message through Ledger Live. In Ethereum context, this is an EIP-191 message or an EIP-712 message
Returns the message signed.
accountId (string)
: Ledger Live id of the accountmessage (hexString)
: Message the user should sign
{
"jsonrpc": "2.0",
"id": 1,
"method": "message.sign",
"params": {
"accountId": "",
"message": ""
}
}
{
"jsonrpc": "2.0",
"id": -1,
"result": {}
}
Broadcast a previously signed transaction through Ledger Live.
Returns the hash of the transaction.
accountId (string)
: Ledger Live id of the accountsignedTransaction (hexString)
: A RawSignedTransaction returned by Ledger Live when signing with SignTransaction
{
"jsonrpc": "2.0",
"id": 1,
"method": "transaction.broadcast",
"params": {
"accountId": "",
"signedTransaction": ""
}
}
{
"jsonrpc": "2.0",
"id": -1,
"result": {}
}
List accounts added by user on Ledger Live.
Returns the list of accounts added by the current user on Ledger Live.
includeTokens? (boolean)
: Allow the user to pick token accounts.
{
"jsonrpc": "2.0",
"id": 1,
"method": "account.list",
"params": {
"includeTokens": false
}
}
{
"jsonrpc": "2.0",
"id": -1,
"result": [{}]
}
Let user choose an account in a Ledger Live, providing filters for choosing currency or allowing add account.
Returns the account selected by the user.
currencies? (string[])
: Select a set of currencies by id. Globing is enabled.allowAddAccount? (boolean)
: Allow the user to create a new account during the flow.includeTokens? (boolean)
: Allow the user to pick token accounts.
{
"jsonrpc": "2.0",
"id": 1,
"method": "account.request",
"params": {
"currencies": [],
"allowAddAccount": true,
"includeTokens": false
}
}
{
"jsonrpc": "2.0",
"id": -1,
"result": {}
}
Let user verify it's account address on his device through Ledger Live.
Returns the verified address or an error message if the verification doesn't succeed.
accountId (string)
: Ledger Live id of the account
{
"jsonrpc": "2.0",
"id": 1,
"method": "account.receive",
"params": {
"accountId": ""
}
}
{
"jsonrpc": "2.0",
"id": -1,
"result": ""
}
Synchronize an account with its network and return an updated view of the account.
Returns an updated view of the account.
accountId (string)
: Ledger Live id of the account
{
"jsonrpc": "2.0",
"id": 1,
"method": "account.sync",
"params": {
"accountId": ""
}
}
{
"jsonrpc": "2.0",
"id": -1,
"result": {}
}
List cryptocurrencies supported by Ledger Live, providing filters by name or ticker.
Returns the list of corresponding cryptocurrencies.
currencies? (string[])
: Select a set of currencies by id. Globing is enabled.includeTokens? (boolean)
: Include tokens in the results.
{
"jsonrpc": "2.0",
"id": 1,
"method": "currency.list",
"params": {
"currencies": [],
"includeTokens": false
}
}
{
"jsonrpc": "2.0",
"id": -1,
"result": [{}]
}
Start the exchange process by generating a nonce on Ledger device.
Returns a transaction ID used to complete the exchange process.
exchangeType (ExchangeType)
: used by the exchange transport to discern between swap/sell/fund
{
"jsonrpc": "2.0",
"id": 1,
"method": "exchange.start",
"params": {
"exchangeType": "SWAP"
}
}
{
"jsonrpc": "2.0",
"id": -1,
"result": {}
}
Complete an exchange process by passing by the exchange content and its signature. User will be prompted on its device to approve the exchange. If the exchange is validated, the transaction is then signed and broadcasted to the network.
Returns the broadcasted transaction details.
provider (string)
: Used to verify the signaturefromAccountId (string)
: Live identifier of the account used as a source for the tx or the parent when a new token is not listed yet.toAccountId (string)
: (Swap) Live identifier of the account used as a destination or the parent when a new token is not listed yet.transaction (RawTransaction)
: Transaction containing the recipient and amountbinaryPayload (hexString)
: Blueprint of the data that we'll allow signingsignature (hexString)
: Ensures the source of the payloadfeesStrategy (FeesLevel)
: Slow / Medium / FastexchangeType (ExchangeType)
: used by the exchange transport to discern between swap/sell/fundswapId (string)
: (Swap) Live identifier of the swap used by backendrate (number)
: (Swap) Rate provider used in the transactiontokenCurrency (string)
: New token used not listed by wallet-api yet
{
"jsonrpc": "2.0",
"id": 1,
"method": "exchange.complete",
"params": {
"provider": "",
"fromAccountId": "",
"toAccountId": "",
"transaction": {},
"binaryPayload": "",
"signature": "",
"feesStrategy": "medium",
"exchangeType": "SWAP",
"swapId": "1234",
"rate": 1,
}
}
{
"jsonrpc": "2.0",
"id": -1,
"result": {}
}
Get capabilities of the server as a list of available rpc calls.
Returns a dictionary of booleans.
No parameters
{
"jsonrpc": "2.0",
"id": 1,
"method": "wallet.getCapabilities",
"params": {}
}
{
"jsonrpc": "2.0",
"id": -1,
"result": {
"transaction.sign": true,
"transaction.broadcast": true,
"message.sign": true,
"currency.list": true
}
}