@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
20 lines (17 loc) • 591 B
text/typescript
import { getMainAccount } from "@ledgerhq/ledger-wallet-framework/account/index";
import { getAccountBridge } from "../bridge";
import type { Account, AccountLike } from "@ledgerhq/types-live";
export {
getReceiveFlowError,
checkAccountSupported,
} from "@ledgerhq/ledger-wallet-framework/account/support";
export function canSend(account: AccountLike, parentAccount: Account | null | undefined): boolean {
try {
getAccountBridge(account, parentAccount).createTransaction(
getMainAccount(account, parentAccount),
);
return true;
} catch {
return false;
}
}