From 1e20ec8d87314f0443dfec577e8b300678414dbc Mon Sep 17 00:00:00 2001 From: Tom Beynon Date: Thu, 13 Oct 2022 18:58:33 +0100 Subject: [PATCH] Disable Evmos ledger support --- src/networks.json | 3 ++- src/utils/Network.mjs | 1 + src/utils/SignerProvider.mjs | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/networks.json b/src/networks.json index 1fc88803..5afef9d9 100644 --- a/src/networks.json +++ b/src/networks.json @@ -79,7 +79,8 @@ "name": "evmos", "txTimeout": 120000, "ownerAddress": "evmosvaloper1umk407eed7af6anvut6llg2zevnf0dn0feqqny", - "maxPerDay": 1 + "maxPerDay": 1, + "ledgerSupport": false }, { "name": "sifchain", diff --git a/src/utils/Network.mjs b/src/utils/Network.mjs index 7fa54ee5..c386e805 100644 --- a/src/utils/Network.mjs +++ b/src/utils/Network.mjs @@ -85,6 +85,7 @@ class Network { this.coinGeckoId = this.chain.coinGeckoId this.estimatedApr = this.chain.estimatedApr this.apyEnabled = data.apyEnabled !== false && !!this.estimatedApr && this.estimatedApr > 0 + this.ledgerSupport = this.chain.ledgerSupport ?? true this.authzSupport = this.chain.authzSupport this.authzAminoSupport = this.chain.authzAminoSupport this.defaultGasPrice = this.decimals && format(bignumber(multiply(0.000000025, pow(10, this.decimals))), { notation: 'fixed', precision: 4}) + this.denom diff --git a/src/utils/SignerProvider.mjs b/src/utils/SignerProvider.mjs index b3f2b219..7609d712 100644 --- a/src/utils/SignerProvider.mjs +++ b/src/utils/SignerProvider.mjs @@ -38,9 +38,13 @@ export default class SignerProvider { return this.provider.enable(chainId) } - getKey(network){ + async getKey(network){ const { chainId } = network - return this.provider.getKey(chainId) + const key = await this.provider.getKey(chainId) + if(!network.ledgerSupport && (key.isNanoLedger || key.isHardware)){ + throw new Error('Ledger support is coming soon') + } + return key } getSigner(network){