-
Notifications
You must be signed in to change notification settings - Fork 19
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
Featuring Memecoin #62
Conversation
For this project, you can try to query with the following GraphQL code to get a taste of how it works. | ||
|
||
```graphql | ||
{ |
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.
Update this to include an example balances query
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.
if (address == undefined) { | ||
address = Address.create({ | ||
id: accountAddress, | ||
balance: (await erc20.balanceOf(accountAddress)).toBigInt(), |
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.
Should you also update the balance of an address if it's known (e.g. refresh this on each new transaction?)
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.
Ahh I see you do this below
}); | ||
|
||
from.balance = BigInt(from.balance) - value; | ||
to.balance = BigInt(to.balance) + value; |
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 think it's safer to do a full await erc20.balanceOf(accountAddress)
There might be other functions and activities that change this so best to clean reset.
Use Promise.all([..,..] for performance for these two queries
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.
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.
Mostly there, just a few more things
No description provided.