export * from "@ledgerhq/coin-framework/transaction/common";
export * from "./signOperation";
export * from "./deviceTransactionConfig";
import transactionModulePerFamily from "../generated/transaction";
export const fromTransactionRaw = (tr) => {
    const TM = transactionModulePerFamily[tr.family];
    // FIXME: something is wrong with TM.fromTransactionRaw expecting a (arg: never) => for some reasons
    return TM.fromTransactionRaw(tr);
};
export const toTransactionRaw = (t) => {
    const TM = transactionModulePerFamily[t.family];
    // FIXME: something is wrong with TM.toTransactionRaw expecting a (arg: never) => for some reasons
    return TM.toTransactionRaw(t);
};
export const fromTransactionStatusRaw = (tr, family) => {
    const TM = transactionModulePerFamily[family];
    return TM.fromTransactionStatusRaw(tr);
};
export const toTransactionStatusRaw = (t, family) => {
    const TM = transactionModulePerFamily[family];
    return TM.toTransactionStatusRaw(t);
};
export const formatTransaction = async (t, a) => {
    const TM = transactionModulePerFamily[t.family];
    // FIXME: something is wrong with TM.formatTransaction expecting a (arg: never) => for some reasons
    return TM.formatTransaction ? await TM.formatTransaction(t, a) : "";
};
export const formatTransactionStatus = (t, ts, mainAccount) => {
    const TM = transactionModulePerFamily[t.family];
    return TM.formatTransactionStatus(t, ts, mainAccount);
};
//# sourceMappingURL=index.js.map