@ledgerhq/coin-tezos
Version:
21 lines • 764 B
JavaScript
import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
import BigNumber from "bignumber.js";
export const buildOptimisticOperation = (account, transaction, operationType) => {
const txHash = ""; // resolved at broadcast time
const { id: accountId } = account;
return {
id: encodeOperationId(accountId, txHash, operationType),
hash: txHash,
type: operationType,
value: transaction.amount,
fee: transaction.fees || new BigNumber(0),
extra: {},
blockHash: null,
blockHeight: null,
senders: [account.freshAddress],
recipients: [transaction.recipient],
accountId,
date: new Date(),
};
};
//# sourceMappingURL=buildOptimisticOperation.js.map