@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
16 lines (14 loc) • 534 B
text/typescript
import { SwapTransactionType } from "./types";
export const maybeTezosAccountUnrevealedAccount = (
swapTransaction: SwapTransactionType,
): Error | undefined => {
if (
swapTransaction?.transaction?.family == "tezos" &&
swapTransaction?.transaction?.estimatedFees &&
!swapTransaction?.transaction?.fees?.eq(swapTransaction?.transaction?.estimatedFees)
) {
const tezosError = new Error("Cannot swap with an unrevealed Tezos account");
tezosError.name = "TezosUnrevealedAccount";
return tezosError;
}
};