Releases: blocknative/web3-onboard
Optional dappId
This release makes the dappId
in the initialization object an optional parameter, so that Onboard.js can be used without an API key. By including a dappId
then you opt in to additional features:
- App onboarding chart analytics that are accessible via your account dashboard
- Connection to the Blocknative infrastructure which removes the need for Onboard to poll the provider to keep an accurate balance state as it can just retrieve the balance after it gets notified of a transaction event on the current account.
If a dappId
is not included in the initialization object, then "Powered by Blocknative" will be displayed on the bottom of each modal by default. If you would like to hide this branding, you can set an additional initialization parameter hideBranding: true
to remove it.
If you have included a dappId
but you would still like the Blocknative branding to be displayed, then set hideBranding: false
.
Changelog:
Fix TypeScript Definitions
This release is mostly to update and fix the TypeScript definitions to be accurate. The bnc-sdk
dependency has been updated and Eslint has been added to the codebase.
Changelog:
WalletConnect Improvements
This release adds an enhancement so that the balance subscription works correctly for WalletConnect by creating a provider specifically to request the balance. There is also a fix so that regular web3 requests work correctly with the provider.
A few changes have been made so that Onboard is compatible with Rollup.js builds. The only current exceptions are that Ledger, Trezor and Authereum cannot be included in the Onboard configuration for a successful build. This is due to the node crypto
module being needed in the global namespace, which is currently problematic (not possible?) due to Rollup not officially supporting node builtins through their plugin ecosystem and the user created plugins haven't been maintained for years. Hopefully this will change in the future and we will update our recommendations accordingly.
The hardware wallet modules are now fully dynamically imported for smaller bundle sizes served to users 😄
Changelog:
WalletConnect Options
Just a small release to add some more options to the WalletConnect module. You can now pass in a rpc
url endpoint and your own bridge
url and that will be passed on to the WalletConnect provider when it is instantiated.
Also included is a fix for a bug for the WalletConnect module where it wouldn't show the QR code as Onboard is waiting on the address promise to resolve, but with WalletConnect it hangs. So timeout has been added to makes sure that it always eventually resolves.
Changelog:
Internal Change
Better Typescript Definitions
This release fixes some of the typescript definitions to be more accurate, specifically the wallet
object that the wallet subscription is called with.
Also included is a couple of small fixes. The Ledger wallet module that was causing an error in Electron apps which has been fixed and the wallet check timeout that defines whether a loading spinner will be shown has been extended.
Changelog:
Update WalletConnect Dependency
This release includes an update to the WalletConnect dependency, which has a reduced bundle size.
Also included is a UI update so that when performing wallet checks, the loading spinner will only show after a delay of 150ms. This prevents the loading spinner from flashing on screen for a brief moment when the user's wallet is in the correct state already, making for a better UX.
"Checking wallet" text has also been added to the loading spinner to better inform the user.
Changelog:
Performance Enhancements
This release includes a few small performance enhancements so that calls to walletSelect and
walletCheck` resolve significantly quicker in some scenarios.
Changelog:
- Enhancement: Remove UI transitions when no UI is shown
Hardware Wallet Sign Message
This release adds the ability to sign messages on Ledger and Trezor wallets:
// using web3.js
const result = await web3.eth.sign('TESTING TESTING 123', address)
// using ethers.js
const result = await signer.signMessage('TESTING TESTING 123')
// using the provider directly
const message = `0x${new Buffer('TESTING TESTING 123').toString('hex')}`
wallet.provider.send(
{
jsonrpc: '2.0',
method: 'eth_sign',
params: [address, message],
id: 42
},
console.log
)
Changelog:
- Enhancement: Hardware Sign Message (#288)
imToken Wallet
This release adds support for imToken wallet. The imToken provider does not support eth_balance
rpc calls, so if you would like the balance subscription to work as it does on other wallets you will need to pass in an optional rpcUrl
into the wallet initialization object:
const config = {
// ...other config options
walletSelect: {
wallets: [
{ walletName: 'imToken', rpcUrl: '<RPC_ENDPOINT>' }
]
}
}
const onboard = Onboard(config)
If you don't pass in a rpcUrl
the wallet will function as normal, but the balance subscription will never get updated as it will have no way of getting access to the wallet's balance.
Also included in this release is a change to the Trust wallet module to allow the same functionality for wallet balance as the Trust wallet provider also doesn't allow eth_balance
rpc calls. So you can now pass in an rpcUrl
to the Trust wallet initialization object for balance updates:
const config = {
// ...other config options
walletSelect: {
wallets: [
{ walletName: 'trust', rpcUrl: '<RPC_ENDPOINT>' }
]
}
}
const onboard = Onboard(config)
NOTE: When you pass in the rpcUrl
it will be for the network that your app is running on, so when the balance subscription is called, the balance value will reflect the balance of that address on the network that your app is running on not necessarily the network that the user's wallet is connected to.
Changelog: