-
Notifications
You must be signed in to change notification settings - Fork 0
Ledger‐Polkadot
For more information on using Ledger Substrate, please refer to the @zondax/ledger-polkadot and @zondax/ledger-kusama Web3 apps. Developers can find instructions in the Ledger Install documentation
npm i @subwallet-connect/ledger-polkadot
For Ledger Substrate, we currently support two main Substrate networks: Kusama and Polkadot. For more details on how to connect, you can refer to the example in our demo.
type LedgerOptions= {
filter?: Platform[]
containerElement?: string
/**
* A number that defines the amount of consecutive empty addresses displayed
* within the Account Select modal. Default is 5
*/
consecutiveEmptyAccountThreshold?: number
}
import Onboard from '@subwallet-conenct/core'
import ledgerModule from '@subwallet-connect/ledger-polkadot'
const ledger = ledgerModule()
const onboard = Onboard({
// ... other Onboard options
wallets: [
ledger
//... other wallets
]
})
const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
For hardware wallets with Substrate support, we will also provide a SubstrateProvider as the provider to implement interfaces, which include the following methods: polkadot_signMessage
, polkadot_sendTransaction
, polkadot_requestAccounts
You may decide that on certain platforms you do not want to display this wallet as a selectable option. To do that you can use the filter
init option which is an array of platforms that you would like this wallet to not be displayed to the end user:
import Onboard from '@subwallet-connect/core'
import ledgerModule from '@subwallet-connect/ledger-polkadot'
const ledger = ledgerModule ({ filter: ['Safari'] })
const onboard = Onboard({
// ... other Onboard options
wallets: [
ledger
//... other wallets
]
})
const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
The following is a list of the platforms that can be filtered:
type Platform =
| 'Windows Phone'
| 'Windows'
| 'macOS'
| 'iOS'
| 'Android'
| 'Linux'
| 'Chrome OS'
| 'Android Browser'
| 'Chrome'
| 'Chromium'
| 'Firefox'
| 'Microsoft Edge'
| 'Opera'
| 'Safari'
| 'desktop'
| 'mobile'
| 'tablet'