From 08c1b045ed9d447a5eeedd81b333cb9d1eae61dc Mon Sep 17 00:00:00 2001 From: Leon Date: Thu, 14 Mar 2024 21:23:20 +0800 Subject: [PATCH] fix: btc fork fee limit (#4247) --- packages/engine/src/vaults/impl/bch/provider.ts | 6 +++++- packages/engine/src/vaults/impl/doge/provider.ts | 2 +- packages/kit/src/views/Send/utils/useBtcCustomFee.ts | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/engine/src/vaults/impl/bch/provider.ts b/packages/engine/src/vaults/impl/bch/provider.ts index 1d29e2e5995..8fc7919c50a 100644 --- a/packages/engine/src/vaults/impl/bch/provider.ts +++ b/packages/engine/src/vaults/impl/bch/provider.ts @@ -32,6 +32,10 @@ export default class Provider extends BaseProvider { override getPsbt(): Psbt { // @ts-expect-error - return new BitcoinForkJS.Psbt({ network: this.network, forkCoin: 'bch' }); + return new BitcoinForkJS.Psbt({ + network: this.network, + forkCoin: 'bch', + maximumFeeRate: 10000, + }); } } diff --git a/packages/engine/src/vaults/impl/doge/provider.ts b/packages/engine/src/vaults/impl/doge/provider.ts index bb9e6c08727..467de3228b3 100644 --- a/packages/engine/src/vaults/impl/doge/provider.ts +++ b/packages/engine/src/vaults/impl/doge/provider.ts @@ -8,7 +8,7 @@ export default class Provider extends BaseProvider { override getPsbt(): Psbt { return new BitcoinJS.Psbt({ network: this.network, - maximumFeeRate: 10000, + maximumFeeRate: 1000000, }); } } diff --git a/packages/kit/src/views/Send/utils/useBtcCustomFee.ts b/packages/kit/src/views/Send/utils/useBtcCustomFee.ts index 1fe145c8126..9406823e50d 100644 --- a/packages/kit/src/views/Send/utils/useBtcCustomFee.ts +++ b/packages/kit/src/views/Send/utils/useBtcCustomFee.ts @@ -47,14 +47,14 @@ export function useBtcCustomFeeForm({ highValue: string; }) => { const min = 0; - const max = 2000; + const max = 1000000; const valueBN = new BigNumber(value); if (valueBN.isLessThanOrEqualTo(min) || valueBN.isGreaterThan(max)) { throw new OneKeyValidatorError( 'msg__enter_a_fee_rate_between_str_and_str', { min: '0', - max: '2000', + max: '1000000', }, ); }