Skip to content

Commit

Permalink
feat(rootstock): derive multiple addresses only for specified protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
jsamol committed Jul 27, 2023
1 parent 53da2c2 commit 6a63558
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/services/account/account.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,12 @@ export class AccountProvider {
try {
const identifier = await airGapWallet.protocol.getIdentifier()
// if we have no addresses, derive using webworker and sync, else just sync
const excludedProtocols = [MainProtocolSymbols.ETH, MainProtocolSymbols.OPTIMISM]
const isWalletExcluded = excludedProtocols.some((protocolSymbol: ProtocolSymbols) => identifier.startsWith(protocolSymbol))
// TODO: configure it on the protocol level
const includedProtocols = [MainProtocolSymbols.BTC, MainProtocolSymbols.BTC_SEGWIT, MainProtocolSymbols.GRS]
const isWalletIncluded = includedProtocols.some((protocolSymbol: ProtocolSymbols) => identifier.startsWith(protocolSymbol))
if (
airGapWallet.addresses.length === 0 ||
(airGapWallet.isExtendedPublicKey && !isWalletExcluded && airGapWallet.addresses.length < 20)
(airGapWallet.isExtendedPublicKey && isWalletIncluded && airGapWallet.addresses.length < 20)
) {
const addresses = await this.modulesService.deriveAddresses(airGapWallet)
const key = `${identifier}_${airGapWallet.publicKey}`
Expand Down

0 comments on commit 6a63558

Please sign in to comment.