Skip to content

Commit

Permalink
fix: cfx moon swap error (#4602)
Browse files Browse the repository at this point in the history
  • Loading branch information
weatherstar authored May 17, 2024
1 parent 0cc2124 commit e9b0a1d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/kit-bg/src/providers/ProviderApiConflux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import BigNumber from 'bignumber.js';

import { ETHMessageTypes } from '@onekeyhq/engine/src/types/message';
import type { EvmExtraInfo } from '@onekeyhq/engine/src/types/network';
import { conflux } from '@onekeyhq/engine/src/vaults/impl/cfx/sdk';
import type { IEncodedTxCfx } from '@onekeyhq/engine/src/vaults/impl/cfx/Vault';
import type VaultConflux from '@onekeyhq/engine/src/vaults/impl/cfx/Vault';
import { getActiveWalletAccount } from '@onekeyhq/kit/src/hooks';
Expand Down Expand Up @@ -232,6 +233,12 @@ class ProviderApiConflux extends ProviderApiBase {
request: IJsBridgeMessagePayload,
transaction: IEncodedTxCfx,
) {
const gasPrice = new BigNumber(transaction.gasPrice ?? 0);

if (gasPrice.isLessThan(conflux.CONST.MIN_GAS_PRICE)) {
delete transaction.gasPrice;
}

debugLogger.providerApi.info('cfx_sendTransaction', request, transaction);
const result = await this.backgroundApi.serviceDapp?.openSignAndSendModal(
request,
Expand Down

0 comments on commit e9b0a1d

Please sign in to comment.