Skip to content

Latest commit

 

History

History
544 lines (329 loc) · 16.7 KB

modules.md

File metadata and controls

544 lines (329 loc) · 16.7 KB

@ledgerhq/live-app-sdk / Exports

@ledgerhq/live-app-sdk

Table of contents

Enumerations

Classes

Interfaces

Type Aliases

Functions

Type Aliases

Account

Ƭ Account: Object

A ledger live cryptocurrency account

remarks This is a slightly modified subset of the Account type used by the Ledger Live platform.

see Account reference in Ledger Live Common doc for more infos

Type declaration

Name Type Description
address string The "next" public address where a user should receive funds. In the context of Bitcoin, the address is "renewed" each time funds are received in order to allow some privacy. In other blockchains, the address might never change
balance BigNumber The total amount of assets that this account holds
blockHeight number Tracks the current blockchain block height
currency string The associated cryptocurrency id of the Account
id string The unique identifier of this account used internally by Ledger Live software
lastSyncDate Date The date of the last time a synchronization was performed. In other words, tracks how up-to-date the Account data is
name string The account’s name set by the user.
spendableBalance BigNumber The amount of the balance that can be spent. Most of the time it will be equal to the balance, but this can vary in some blockchains

Defined in

types.ts:162


AlgorandOperationMode

Ƭ AlgorandOperationMode: "send" | "optIn" | "claimReward" | "optOut"

Defined in

families/algorand/types.ts:8


ApplicationDetails

Ƭ ApplicationDetails: Object

Informations about a device application

Type declaration

Name Type Description
name string Name of the application
version string Version of the application (SemVer)

Defined in

types.ts:200


BaseCurrency

Ƭ BaseCurrency: Object

Base currency model

Type declaration

Name Type Description
color string Used for UI
id string The unique internal id of the currency
name string The display name of the currency
ticker string The ticker name in exchanges / countervalue apis (e.g. BTC, ETH, USDT).
units Unit[] Array of available units for the currency

Defined in

types.ts:237


CosmosOperationMode

Ƭ CosmosOperationMode: "send" | "delegate" | "undelegate" | "redelegate" | "claimReward" | "claimRewardCompound"

Defined in

families/cosmos/types.ts:8


CryptoCurrency

Ƭ CryptoCurrency: BaseCurrency & { family: string ; type: CryptoCurrency }

Crypto currency model

Defined in

types.ts:263


Currency

Ƭ Currency: CryptoCurrency | ERC20TokenCurrency

Defined in

types.ts:304


DeviceInfo

Ƭ DeviceInfo: Object

Information about a device

Type declaration

Name Type Description
modelId DeviceModel The model of the device
version string The version of the firmware

Defined in

types.ts:134


ERC20TokenCurrency

Ƭ ERC20TokenCurrency: TokenCurrency & { contract: string ; standard: ERC20 }

ERC20 token currency model

Defined in

types.ts:293


EcdsaSignature

Ƭ EcdsaSignature: Buffer

The ECDSA signature of the payload

Defined in

types.ts:53


ExchangeDeviceTxId

Ƭ ExchangeDeviceTxId: string

A transaction ID used to complete the exchange process

Defined in

types.ts:58


ExchangePayload

Ƭ ExchangePayload: Buffer

Metadata used to describe a secure exchange between a Ledger device and a partner (for sell, swap and funding)

ref: https://github.com/LedgerHQ/app-exchange/blob/master/src/proto/protocol.proto

Defined in

types.ts:48


MessageHandler

Ƭ MessageHandler: (payload: unknown) => Promise<void>

Type declaration

▸ (payload): Promise<void>

Simple contract for handling a Message received through a Transport protocol

alpha

Parameters
Name Type
payload unknown
Returns

Promise<void>

Defined in

types.ts:18


PolkadotOperationMode

Ƭ PolkadotOperationMode: "send" | "bond" | "unbond" | "rebond" | "withdrawUnbonded" | "setController" | "nominate" | "chill" | "claimReward"

Defined in

families/polkadot/types.ts:8


RawAccount

Ƭ RawAccount: Object

The raw representation of the Account type

see Account for information regarding individual fields. Each field type is the serialized version of the corresponding Account type

Type declaration

Name Type
address string
balance string
blockHeight number
currency string
id string
lastSyncDate string
name string
spendableBalance string

Defined in

rawTypes.ts:17


RawSignedTransaction

Ƭ RawSignedTransaction: Object

The raw representation of a signed transaction returned by the Ledger Live platform

remarks This type is returned by Ledger Live when signing with signTransaction and is only used as a payload by the broadcastSignedTransaction function to actually broadcast the transaction to the blockchain

Type declaration

Name Type
expirationDate string | null
operation unknown
signature string
signatureRaw? unknown

Defined in

rawTypes.ts:60


RawTransaction

Ƭ RawTransaction: RawEthereumTransaction | RawBitcoinTransaction | RawAlgorandTransaction | RawCryptoOrgTransaction | RawRippleTransaction | RawCosmosTransaction | RawTezosTransaction | RawPolkadotTransaction | RawStellarTransaction | RawTronTransaction

The raw representation of the generic Transaction type.

Defined in

rawTypes.ts:42


TezosOperationMode

Ƭ TezosOperationMode: "send" | "delegate" | "undelegate"

Defined in

families/tezos/types.ts:8


TokenCurrency

Ƭ TokenCurrency: BaseCurrency & { parent: string ; type: TokenCurrency }

Token currency model

Defined in

types.ts:278


Transaction

Ƭ Transaction: EthereumTransaction | BitcoinTransaction | AlgorandTransaction | CryptoOrgTransaction | RippleTransaction | CosmosTransaction | TezosTransaction | PolkadotTransaction | StellarTransaction | TronTransaction

Description of an unsigned transaction. This type is used to build transactions and then sign them with a Ledger device and finally broadcast them to the network upon user validation.

Defined in

types.ts:104


TronOperationMode

Ƭ TronOperationMode: "send" | "freeze" | "unfreeze" | "vote" | "claimReward"

Defined in

families/tron/types.ts:6


TronResource

Ƭ TronResource: "BANDWIDTH" | "ENERGY"

Defined in

families/tron/types.ts:13


Unit

Ƭ Unit: Object

A unit describes a given representation of a currency for humans. A currency can have many units, for instance, we can assume Euro have euros and cents. We can define Bitcoin to have: bitcoin, mBTC, bit, satoshi (but that's up to us really).

remarks This is a slightly modified subset of the Unit type used by the Ledger Live platform.

see Unit reference in Ledger Live Common doc for more informations

Type declaration

Name Type Description
code string String to use when formatting the unit. like 'BTC' or 'USD'
magnitude number Number of digits after the '.' in context of this unit
name string Display name of a given unit (example: satoshi)

Defined in

types.ts:219

Functions

deserializeAccount

deserializeAccount(rawAccount): Account

Deserialize a RawAccount object after it has been received over JSON-RPC protocol from the Ledger Live platform

Parameters

Name Type Description
rawAccount RawAccount The raw account representation to deserialize

Returns

Account

The object account of the provided raw account representation

Defined in

serializers.ts:84


deserializeTransaction

deserializeTransaction(rawTransaction): Transaction

Deserialize a RawTransaction object after it has been received over JSON-RPC protocol from the Ledger Live platform

Parameters

Name Type Description
rawTransaction RawTransaction The raw transaction representation to deserialize

Returns

Transaction

The object transaction of the provided raw transaction representation

Defined in

serializers.ts:147


serializeAccount

serializeAccount(account): RawAccount

Serialize an Account object in order to send it over JSON-RPC protocol to the Ledger Live platform

Parameters

Name Type Description
account Account The account object to serialize

Returns

RawAccount

The raw representation of the provided account object

Defined in

serializers.ts:55


serializeTransaction

serializeTransaction(transaction): RawTransaction

Serialize an Transaction object in order to send it over JSON-RPC protocol to the Ledger Live platform

Parameters

Name Type Description
transaction Transaction The transaction object to serialize

Returns

RawTransaction

The raw representation of the provided transaction object

Defined in

serializers.ts:113