Skip to content

Commit

Permalink
fix: Scdo amount type (#6355)
Browse files Browse the repository at this point in the history
  • Loading branch information
originalix authored Dec 17, 2024
1 parent 3ad28f4 commit 1933e93
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/kit-bg/src/providers/ProviderApiScdo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { web3Errors } from '@onekeyfe/cross-inpage-provider-errors';
import { IInjectedProviderNames } from '@onekeyfe/cross-inpage-provider-types';
import BigNumber from 'bignumber.js';
import * as ethUtils from 'ethereumjs-util';
import { keccak256 } from 'viem';

Expand Down Expand Up @@ -141,6 +142,12 @@ class ProviderApiScdo extends ProviderApiBase {
'"from" address is invalid for this account',
);
}
if (typeof encodedTx.Amount === 'string') {
const amount = new BigNumber(encodedTx.Amount);
if (amount.isInteger()) {
encodedTx.Amount = amount.toNumber();
}
}
const result =
await this.backgroundApi.serviceDApp.openSignAndSendTransactionModal({
request,
Expand Down

0 comments on commit 1933e93

Please sign in to comment.