diff --git a/src/app/templates/SignumSignView/TransactionView.tsx b/src/app/templates/SignumSignView/TransactionView.tsx index 36b783a..2d75f5e 100644 --- a/src/app/templates/SignumSignView/TransactionView.tsx +++ b/src/app/templates/SignumSignView/TransactionView.tsx @@ -3,6 +3,7 @@ import React, { FC, memo, useMemo } from 'react'; import classNames from 'clsx'; import HashShortView from 'app/atoms/HashShortView'; +import Identicon from 'app/atoms/Identicon'; import IdenticonSignum from 'app/atoms/IdenticonSignum'; import Money from 'app/atoms/Money'; import { t } from 'lib/i18n/react'; @@ -54,7 +55,11 @@ const ExpenseViewItem: FC = ({ expense, last, mainnet = fa return (
- + {expense.hash ? ( + + ) : ( + + )}
diff --git a/src/lib/temple/front/parseSignumTransaction.ts b/src/lib/temple/front/parseSignumTransaction.ts index 57f83d1..aa8e6df 100644 --- a/src/lib/temple/front/parseSignumTransaction.ts +++ b/src/lib/temple/front/parseSignumTransaction.ts @@ -14,6 +14,7 @@ export type ParsedTransactionExpense = { tokenAddress?: string; tokenId?: string; aliasName?: string; + hash?: string; amount: BigNumber; to: string; }; @@ -135,12 +136,26 @@ function parseMiningExpenses(tx: Transaction): ParsedTransactionExpense[] { } function parseContractExpenses(tx: Transaction): ParsedTransactionExpense[] { - return [ - { - to: tx.recipient!, - amount: new BigNumber(tx?.amountNQT || 0) - } - ]; + const amount = new BigNumber(tx?.amountNQT || 0); + + switch (tx.subtype) { + case TransactionSmartContractSubtype.SmartContractCreation: + return [ + { + to: '', + hash: tx.referencedTransactionFullHash || tx.senderPublicKey!, + amount + } + ]; + case TransactionSmartContractSubtype.SmartContractPayment: + default: + return [ + { + to: tx.recipient!, + amount + } + ]; + } } function parseArbitraryExpenses(tx: Transaction): ParsedTransactionExpense[] {