-
Notifications
You must be signed in to change notification settings - Fork 31
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
Conversation
return; | ||
} | ||
const checkedKeys: Set<PublicKey> = new Set(); | ||
const accountArrays = [ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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++) { |
There was a problem hiding this comment.
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 ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should we?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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
No description provided.