export const getCustomFeesPerFamily = transaction => {
    const { family, maxFeePerGas, maxPriorityFeePerGas, feePerByte, fees, utxoStrategy, gasPrice } = transaction;
    switch (family) {
        case "evm": {
            return {
                maxFeePerGas,
                maxPriorityFeePerGas,
                gasPrice,
            };
        }
        case "bitcoin": {
            return {
                feePerByte,
                utxoStrategy,
            };
        }
        default:
            return {
                fees,
            };
    }
};
export const convertToNonAtomicUnit = ({ amount, account, }) => {
    const fromMagnitude = account.type === "TokenAccount"
        ? account.token.units[0].magnitude || 0
        : account.currency?.units[0].magnitude || 0;
    return amount?.shiftedBy(-fromMagnitude);
};
export const convertToAtomicUnit = ({ amount, account, }) => {
    const fromMagnitude = account.type === "TokenAccount"
        ? account.token.units[0].magnitude || 0
        : account.currency?.units[0].magnitude || 0;
    return amount?.shiftedBy(fromMagnitude);
};
//# sourceMappingURL=utils.js.map