// SPDX-FileCopyrightText: © 2026 LEDGER SAS // SPDX-License-Identifier: Apache-2.0 import type { StellarCoinConfig } from '../config' import { StrKey } from '@stellar/stellar-sdk' import { NULL_ACCOUNT } from '@stellar/stellar-sdk/contract' import { fetchSigners } from '../network' export async function isAccountMultiSign( config: StellarCoinConfig, account: string ): Promise { const signers = await fetchSigners(config, account) return signers.length > 1 } /** * Returns true if address is valid, false if it's invalid (can't parse or wrong checksum) * * @param {*} address */ export function isAddressValid(address: string): boolean { if (!address || address === NULL_ACCOUNT) return false try { return StrKey.isValidEd25519PublicKey(address) || StrKey.isValidMed25519PublicKey(address) } catch { return false } } /** Compile-time exhaustiveness helper: call when a value should be `never`. */ export function assertUnreachable(_: never): never { throw new Error('unreachable assertion failed') }