ENS Support & Custom Networks for Hardware Wallets & Other fixes
This release adds some exciting new features: ENS support, custom networks for hardware wallets, and updates to a few wallets. Further more it adds fixes for a Keepkey transaction signing bug. The detectedwallet
option is now enabled by default regardless of if you are using the default wallet list or a custom list.
ENS Support
With Onboard you now have the ability to get a users ENS name as well as any text records they may have. To use this feature simply add a callback function within the subscriptions object like so:
const onboard = Onboard({
...
subscriptions: {
wallet: wallet => {
web3 = new Web3(wallet.provider)
},
ens: ens => {
console.log(ens)
// { name: 'myname.eth', avatar: 'https://i.imgur.com/LcZFSMn.png', getText: '...', contentHash: '...' }
}
}
})
Whenever the user selects a wallet or their address changes, the ens callback will execute with the updated ens object. To get a text record for a user's ENS name such as their avatar, use the getText
method.
Example:
...
ens: ens => {
if(ens) {
const avatarUrl = ens.getText('avatar')
console.log(avatarUrl) // https://i.imgur.com/LcZFSMn.png
}
}
...
Custom Networks for Hardware Wallets
Onboard now supports passing in custom network info for hardware wallets allowing users to use their hardware wallets with non-Ethereum networks such as Energy Web Chain.
Example:
const onboard = Onboard({
networkId: 1234
//... other options
walletSelect: {
wallets:[
{
walletName: 'ledger',
rpcUrl: RPC_URL,
customNetwork: {
networkId: number
genesis: GenesisBlock
hardforks: Hardfork[]
bootstrapNodes: BootstrapNode[]
}
},
]
}
})
You can view an example configuration here
Changelog:
- 1.29.0-0.4.1: [feature] Allow Hardware wallets to add custom network info (#457)
- 1.29.0-0.4.3: [feature] Detail how to access Gnosis Safe Apps (#615)
- 1.29.0-0.5.3: [feature] Adds ens support (#618)
- [chore] XDEFI strict provider [3.0.6] (#606)
- 1.29.0-0.4.2: [refactor] Network name helper and remove unused networkId helper #613
- 1.29.0-0.5.4: [update] WalletLink to 2.1.6 (#614)
- 1.29.0-0.5.5: [refactor] detected wallet (#625)
- 1.29.0-0.5.6: [fix] keepkey eth sign transaction issue (#624)
- 1.29.0-0.5.7: Adds avatar to ens object (#629)
- 1.29.0-0.5.8: [fix] keepkey message signing (#630)
- 1.29.0-0.5.9: Fix ens on non-ethereum networks - filter out detected wallet (#633)
- 1.29.0-0.5.10: Fix Trezor txn sign issue (#635)
- 1.29.0-0.5.11: Revert lattice changes (#636)