Skip to content

Commit

Permalink
fix: ibc send large numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
fmorency committed Nov 26, 2024
1 parent 76cf30a commit f8bc045
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions components/bank/forms/ibcSendForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, useMemo } from 'react';
import { chainName } from '@/config';
import { useFeeEstimation, useTx } from '@/hooks';
import { ibc } from '@liftedinit/manifestjs';
import { getIbcInfo } from '@/utils';
import { getIbcInfo, parseNumberToBigInt } from '@/utils';
import { PiCaretDownBold } from 'react-icons/pi';
import { MdContacts } from 'react-icons/md';
import { CombinedBalanceInfo } from '@/utils/types';
Expand Down Expand Up @@ -108,9 +108,7 @@ export default function IbcSendForm({
setIsSending(true);
try {
const exponent = values.selectedToken.metadata?.denom_units[1]?.exponent ?? 6;
const amountInBaseUnits = Math.floor(
parseFloat(values.amount) * Math.pow(10, exponent)
).toString();
const amountInBaseUnits = parseNumberToBigInt(values.amount, exponent).toString();

const { source_port, source_channel } = getIbcInfo(chainName ?? '', destinationChain ?? '');

Expand Down

0 comments on commit f8bc045

Please sign in to comment.