@ledgerhq/coin-canton
Version:
22 lines • 789 B
JavaScript
import { isCantonAccount } from "./bridge/serialization";
export function isCantonAccountEmpty(account) {
return (account.operationsCount === 0 &&
account.balance.isZero() &&
!account.subAccounts?.length &&
!account.cantonResources?.pendingTransferProposals?.length);
}
/**
* Check if a Canton account is empty (has no operations, no balance, and no pending transfer proposals)
* @param account - The account to check (must be a Canton account)
* @returns true if the account is empty, false otherwise
*/
export function isAccountEmpty(account) {
if (account.type !== "Account") {
return false;
}
if (!isCantonAccount(account)) {
return false;
}
return isCantonAccountEmpty(account);
}
//# sourceMappingURL=helpers.js.map