Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STREAM-1060: check all token accounts ATA #118

Merged
merged 6 commits into from
Dec 27, 2023

Conversation

Yolley
Copy link
Collaborator

@Yolley Yolley commented Dec 25, 2023

No description provided.

@Yolley Yolley changed the title STREAM-1060: check all token accounts ATA [WIP] STREAM-1060: check all token accounts ATA Dec 26, 2023
@Yolley Yolley changed the title [WIP] STREAM-1060: check all token accounts ATA STREAM-1060: check all token accounts ATA Dec 26, 2023
return;
}
const checkedKeys: Set<PublicKey> = new Set();
const accountArrays = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's create a proper object out of this?
We could just have a type and cast data to it.

Much easier then to work with indexes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you mean here? Seems complex.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's easier to read then associating [1] to senderTokens for instance.

const response = await this.connection.getMultipleAccountsInfo(
accountArrays.map((item) => item[1])
);
for (let i = 0; i < response.length; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we iterate here over accountArrays in forof loop?

for accountArray of accountArrays ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why should we?

Copy link
Contributor

Choose a reason for hiding this comment

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

More clean then traditional for loop with indexes :)

Copy link
Collaborator Author

@Yolley Yolley Dec 27, 2023

Choose a reason for hiding this comment

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

I need it here because every index in response corresponds to index in accountArrays

packages/stream/solana/StreamClient.ts Outdated Show resolved Hide resolved
@Yolley Yolley merged commit 58212d2 into master Dec 27, 2023
1 check passed
@Yolley Yolley deleted the oleg/feature/STREAM-1060_ata_creation branch December 27, 2023 13:19
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants