@ledgerhq/coin-stacks
Version:
Ledger Stacks Coin integration
15 lines • 591 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSubAccount = void 0;
/**
* Helper to get a subaccount from its id
* Used to identify if a transaction is for a token account
*/
const getSubAccount = (account, transaction) => {
if (!transaction.subAccountId || !account.subAccounts)
return undefined;
const subAccount = account.subAccounts.find(a => a.id === transaction.subAccountId);
return subAccount?.type === "TokenAccount" ? subAccount : undefined;
};
exports.getSubAccount = getSubAccount;
//# sourceMappingURL=token.js.map