Skip to content

Commit

Permalink
Merge branch 'main' into fix/output-address-zero-balance
Browse files Browse the repository at this point in the history
  • Loading branch information
brancoder authored Apr 23, 2024
2 parents 74b8fe4 + a90bf54 commit c5cf2fe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/src/utils/stardust/associatedOutputsHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,19 @@ export class AssociatedOutputsHelper {
// remove expired basic outputs from basic address associations if they exist
const expiredIds = this.associationToOutputIds.get(AssociationType.BASIC_ADDRESS_EXPIRED);
const filteredOutputIds = outputIds.filter((id) => !expiredIds?.includes(id));
associations.push({ type, outputIds: filteredOutputIds.reverse() });
if (filteredOutputIds.length > 0) {
associations.push({ type, outputIds: filteredOutputIds.reverse() });
}
} else if (
type === AssociationType.NFT_ADDRESS &&
this.associationToOutputIds.get(AssociationType.NFT_ADDRESS_EXPIRED)?.length > 0
) {
// remove expired nft outputs from nft address associations if they exist
const expiredIds = this.associationToOutputIds.get(AssociationType.NFT_ADDRESS_EXPIRED);
const filteredOutputIds = outputIds.filter((id) => !expiredIds?.includes(id));
associations.push({ type, outputIds: filteredOutputIds.reverse() });
if (filteredOutputIds.length > 0) {
associations.push({ type, outputIds: filteredOutputIds.reverse() });
}
} else {
associations.push({ type, outputIds: outputIds.reverse() });
}
Expand Down

0 comments on commit c5cf2fe

Please sign in to comment.