@web3-onboard/keystone
Advanced tools
Comparing version 2.3.6 to 2.3.7-alpha.1
import type { CustomNetwork, Platform, WalletInit } from '@web3-onboard/common'; | ||
declare function keystone({ customNetwork, filter, containerElement }?: { | ||
declare function keystone({ customNetwork, filter, containerElement, consecutiveEmptyAccountThreshold }?: { | ||
customNetwork?: CustomNetwork; | ||
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; | ||
}): WalletInit; | ||
export default keystone; |
@@ -25,6 +25,6 @@ const DEFAULT_BASE_PATH = "m/44'/60'/0'/0"; | ||
}; | ||
const generateAccounts = async (keyring, provider) => { | ||
const generateAccounts = async (keyring, provider, consecutiveEmptyAccounts) => { | ||
const accounts = []; | ||
let zeroBalanceAccounts = 0, index = 0; | ||
while (zeroBalanceAccounts < 5) { | ||
while (zeroBalanceAccounts < consecutiveEmptyAccounts) { | ||
const account = await getAccount(keyring, provider, index); | ||
@@ -44,3 +44,3 @@ if (account.balance.value.isZero()) { | ||
}; | ||
function keystone({ customNetwork, filter, containerElement } = {}) { | ||
function keystone({ customNetwork, filter, containerElement, consecutiveEmptyAccountThreshold } = {}) { | ||
const getIcon = async () => (await import('./icon.js')).default; | ||
@@ -70,2 +70,3 @@ return ({ device }) => { | ||
const { accountSelect, getCommon, bigNumberFieldsToStrings, getHardwareWalletProvider } = await import('@web3-onboard/hw-common'); | ||
const consecutiveEmptyAccounts = consecutiveEmptyAccountThreshold || 5; | ||
const keyring = AirGappedKeyring.getEmptyKeyring(); | ||
@@ -80,3 +81,3 @@ await keyring.readKeyring(); | ||
ethersProvider = new StaticJsonRpcProvider(currentChain.rpcUrl); | ||
return generateAccounts(keyring, ethersProvider); | ||
return generateAccounts(keyring, ethersProvider, consecutiveEmptyAccounts); | ||
}; | ||
@@ -83,0 +84,0 @@ const getAccounts = async () => { |
{ | ||
"name": "@web3-onboard/keystone", | ||
"version": "2.3.6", | ||
"version": "2.3.7-alpha.1", | ||
"description": "Keystone hardware wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", | ||
@@ -62,4 +62,4 @@ "keywords": [ | ||
"@web3-onboard/common": "^2.3.2", | ||
"@web3-onboard/hw-common": "^2.2.0" | ||
"@web3-onboard/hw-common": "^2.3.0-alpha.1" | ||
} | ||
} |
@@ -16,2 +16,7 @@ # @web3-onboard/keystone | ||
containerElement?: string | ||
/** | ||
* A number that defines the amount of consecutive empty addresses displayed | ||
* within the Account Select modal. Default is 5 | ||
*/ | ||
consecutiveEmptyAccountThreshold?: number | ||
} | ||
@@ -18,0 +23,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44958
321
120
1