Skip to content

Commit

Permalink
revert sol tx filter solution (#4256)
Browse files Browse the repository at this point in the history
  • Loading branch information
callensm authored Jun 30, 2023
1 parent b190fb8 commit 70c567a
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions backend/native/backpack-api/src/routes/graphql/clients/helius.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,12 @@ export class Helius extends RESTDataSource {
until?: string,
mint?: string
): Promise<EnrichedTransaction[]> {
let isNativeTransferFilter = false;
let target = address;

if (mint) {
if (mint !== SystemProgram.programId.toBase58()) {
target = getATAAddressSync({
mint: new PublicKey(mint),
owner: new PublicKey(address),
}).toBase58();
} else {
isNativeTransferFilter = true;
}
if (mint && mint !== SystemProgram.programId.toBase58()) {
target = getATAAddressSync({
mint: new PublicKey(mint),
owner: new PublicKey(address),
}).toBase58();
}

return this.get(`/v0/addresses/${target}/transactions`, {
Expand All @@ -124,12 +118,6 @@ export class Helius extends RESTDataSource {
commitment: "confirmed",
before,
until,
...(isNativeTransferFilter
? {
source: Source.SYSTEM_PROGRAM,
type: TransactionType.TRANSFER,
}
: undefined),
},
});
}
Expand Down

1 comment on commit 70c567a

@vercel
Copy link

@vercel vercel bot commented on 70c567a Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.