Skip to content

Commit

Permalink
fix problem with build, add missing getDisplayTransferInfo method
Browse files Browse the repository at this point in the history
  • Loading branch information
bogos committed Jan 5, 2024
1 parent 83d2d2c commit 1a065de
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/TxTable/TxDetailItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ export const TxDetailItem = ({
if (!txData.type) {
return (
<Accordion
key={txData.txId}
key={txData.txId ?? txData.id}
expanded={expanded}
onChange={handleChange(txData.txId)}
onChange={handleChange(txData.txId ?? txData.id)}
>
<Grid
sx={{
Expand Down
25 changes: 23 additions & 2 deletions src/hooks/transactions/getDisplayInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MultisigSdk, Psp22Sdk } from "xsigners-sdk-test";
import { ChainExtended } from "@/config/chain";
import { TX_TYPE_IMG } from "@/config/images";
import { ContractParam } from "@/domain/repositores/ISquidDbRepository";
import { TransactionProposed } from "@/domain/TransactionProposed";
import { FullTxProposed } from "@/domain/TransactionProposed";
import { TransactionDisplayInfo } from "@/domain/TransactionProposedItemUi";
import { ApiPromise, ContractPromise } from "@/services/substrate/types";
import { decodeCallArgs } from "@/utils/blockchain";
Expand All @@ -20,7 +20,7 @@ const PSP22_TRANSFER_METHOD_SELECTOR = "0xdb20f9f5";
interface Props {
multisigAddress: string;
apiPromise: ApiPromise;
txProposed: TransactionProposed;
txProposed: FullTxProposed;
nativeToken: ChainExtended & { decimals: number };
}

Expand Down Expand Up @@ -163,3 +163,24 @@ export const getDisplayInfo = async ({

return displayInfo;
};

export const getDisplayTransferInfo = async ({
txProposed,
nativeToken,
}: Props): Promise<TransactionDisplayInfo> => {
const displayInfo: TransactionDisplayInfo = {
img: TX_TYPE_IMG.RECEIVE,
type: "Receive",
txMsg: "from",
valueAmount: "",
to: txProposed.to,
from: txProposed.from,
};

displayInfo.valueAmount = `${balanceToFixed(
txProposed.value,
nativeToken.decimals
)} ${nativeToken.token}`;

return displayInfo;
};
1 change: 0 additions & 1 deletion src/pages/app/transactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useGetXsignerSelected } from "@/hooks/xsignerSelected/useGetXsignerSele

export default function TxPage() {
const { xSignerSelected } = useGetXsignerSelected();

if (!xSignerSelected) {
return <FallbackSpinner />;
}
Expand Down

0 comments on commit 1a065de

Please sign in to comment.