fix: add amount field in stacking-tx

pull/22/head
VPcodebase 3 years ago
parent c202cee254
commit fa00b32ef2
  1. 2
      src/components/ui/utils.tsx
  2. 17
      src/pages/StackingTransactionPage/index.tsx
  3. 1
      src/types/blockchain.ts

@ -80,8 +80,6 @@ export function CalculateTransactionFee(transaction: any) {
maximumFractionDigits: 18,
}).format(fee);
console.log(normalizedFee);
const price = lastPrice;
const bi =

@ -29,6 +29,10 @@ export const StakingTransactionPage = () => {
return null;
}
const { amount, ...restTx } = tx;
const { amount: amountMsg, ...restTxMsg } = tx.msg || {};
return (
<BasePage>
<Box border={{ size: "xsmall", side: "bottom", color: "border" }}>
@ -37,7 +41,7 @@ export const StakingTransactionPage = () => {
</Text>
</Box>
<TransactionDetails transaction={tx} type="__staking" errorMsg={''} />
<TransactionDetails transaction={restTx} type="__staking" errorMsg={""} />
<Box
margin={{ top: "medium" }}
pad={{ bottom: "small" }}
@ -46,9 +50,16 @@ export const StakingTransactionPage = () => {
<Text size="large">Staking Data</Text>
</Box>
<TransactionDetails
transaction={tx.msg}
transaction={
tx.type === "CollectRewards"
? {
...tx.msg,
amount: amount,
}
: restTxMsg
}
type={subTypeMap[tx.type] || ""}
errorMsg={''}
errorMsg={""}
shorMoreHide={true}
/>
</BasePage>

@ -152,6 +152,7 @@ export type RPCStakingTransactionHarmony = {
transactionIndex: string;
v: string;
msg: any; // todo
amount?: string
};
// todo

Loading…
Cancel
Save