@ledgerhq/coin-canton
Version:
35 lines (29 loc) • 952 B
text/typescript
import type { CommonDeviceTransactionField } from "@ledgerhq/ledger-wallet-framework/transaction/common";
import type { Account, AccountLike } from "@ledgerhq/types-live";
import type { Transaction, TransactionStatus } from "../types";
// This method adds additional fields that need to be reviewed when signing a transaction on the device.
async function getDeviceTransactionConfig({
transaction: _,
status: { amount, estimatedFees },
}: {
account: AccountLike;
parentAccount: Account | null | undefined;
transaction: Transaction;
status: TransactionStatus;
}): Promise<Array<CommonDeviceTransactionField>> {
const fields: Array<CommonDeviceTransactionField> = [];
if (!amount.isZero()) {
fields.push({
type: "amount",
label: "Amount",
});
}
if (!estimatedFees.isZero()) {
fields.push({
type: "fees",
label: "Fees",
});
}
return fields;
}
export default getDeviceTransactionConfig;