@ledgerhq/coin-stacks
Version:
Ledger Stacks Coin integration
11 lines • 450 B
JavaScript
/**
* Helper to get a subaccount from its id
* Used to identify if a transaction is for a token account
*/
export 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;
};
//# sourceMappingURL=token.js.map