UNPKG

@ledgerhq/coin-aptos

Version:
9 lines 517 B
import { compareAddress } from "./getCoinAndAmounts"; export function calculateAmount(sender, address, amount_in, amount_out) { const is_sender = compareAddress(sender, address); // LL negates the amount for SEND transactions // to show positive amount on the send transaction (ex: in "cancel" tx, when amount will be returned to our account) // we need to make it negative return is_sender ? amount_out.minus(amount_in) : amount_in.minus(amount_out); } //# sourceMappingURL=calculateAmount.js.map