Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix send ibc token #382

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions src/pages/Transactions/TxActionModal/Send/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ export default function Execute({ open, onClose, data, sendTx, rejectTx, disable
const isNativeToken = data?.txDetails?.txMessage[0]?.denom === coinConfig?.find((e) => e?.type === 'native')?.denom
const otherToken = coinConfig?.find((e) => e?.denom ?? e?.cosmosDenom === data?.txDetails?.txMessage[0]?.denom)

const amount = isNativeToken
? formatNativeToken(data?.txDetails?.txMessage[0]?.amount)
: `${convertAmount(data?.txDetails?.txMessage[0]?.amount, false, otherToken?.decimals)} ${otherToken?.coinDenom}`

const totalAllocationAmount = isNativeToken
? formatNativeToken(
new BigNumber(+data?.txDetails?.txMessage[0]?.amount || 0).plus(+data.txDetails?.fee || 0).toString(),
)
: `${formatWithComma(data?.txDetails?.txMessage[0]?.amount)} ${otherToken?.coinDenom} + ${formatNativeCurrency(
new BigNumber(+gasFee).toString(),
)}`
: `${convertAmount(data?.txDetails?.txMessage[0]?.amount, false, otherToken?.decimals)} ${
otherToken?.coinDenom
} + ${formatNativeCurrency(new BigNumber(+gasFee).toString())}`

const txHandler = async (type) => {
if (type == 'confirm') {
Expand Down Expand Up @@ -110,7 +114,7 @@ export default function Execute({ open, onClose, data, sendTx, rejectTx, disable
<TxContent>
<div>
<div className="label">Amount</div>
<div className="value">{formatNativeToken(data?.txDetails?.txMessage[0]?.amount)}</div>
<div className="value">{amount}</div>
</div>
<div>
<div className="label">Transaction fee</div>
Expand All @@ -128,13 +132,7 @@ export default function Execute({ open, onClose, data, sendTx, rejectTx, disable
</TxContent>
) : (
<>
<Amount
amount={
isNativeToken
? formatNativeToken(data?.txDetails?.txMessage[0]?.amount)
: convertAmount(data?.txDetails?.txMessage[0]?.amount, false, otherToken?.decimals)
}
/>
<Amount amount={amount} />
{action == 'change-sequence' && (
<>
<Gap height={16} />
Expand Down
Loading