-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: transaction status #181
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
62def17
to
c1758bc
Compare
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.
This PR changes the native balance to xDAI for me but the payggy still show ETH as native currency (not sure why) so I can not send funds.
token: z.object({ | ||
amount: z.string(), | ||
symbol: z.string(), | ||
decimals: z.number().int().positive(), | ||
}), | ||
to: AddressSchema, | ||
from: AddressSchema, | ||
fee: z.object({ | ||
amount: z.string(), | ||
symbol: z.string(), | ||
decimals: z.number().int().positive(), | ||
}), |
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 keep it as is right now, but later on we should think about whether we don't want to use token address
instead of symbol
as symbols can be ambiguous (although they should not)
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.
Please rename the initializeBalances
to fetchBalances
.
I would also love to keep the firebase
adapter do everything just in the firebase
db (including all transactions etc). I am fine to merge this PR but then I would love to restore the way it originally worked just as we discussed.
async function _checkBalance(token: Token): Promise<void> { | ||
await checkBalance(address, token) | ||
} | ||
|
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 does the object check balances? Shouldn't the app be just checking the balances onload and maybe periodically?
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 because the balance is get through polling and with polling there is always a tradeoff that you either make too many polls and waste resources or too few and then it may be a poor user experience.
I think we should check the balance periodically (let's say once in every minute or so) but if there is a transaction done and it can be expected that changes the balance then it would be good to keep to possibility to force a checkBalance
.
With this PR the Payggy object is able to set the status of the transactions on the backend correctly and update it with messages. It only sends the transaction hash in the messages and the peer in the chat reads the transaction from the blockchain based on that.
What is done:
onMessage
callback async, no longer returns the updated storeupdateStore
function passed as argumentKnown issues:
Token
type so that it does not containamount
field #177) in this PR, but it was very annoying. I suggest removing theamount
from theToken
type, and creating anAmount
type which could have atoken
and avalue
property.ethers@v6
.ethers@v5
would work. Workaround was to set up an alternative endpoint running a different execution client. (JSON RPC - Fix differences between Nethermind and Infura (tested by flood) NethermindEth/nethermind#5921 and getTransaction() error ethers-io/ethers.js#3835)toBigInt
causes unhandled exception #182onMessage
arguments now. It would be better to just have two arguments, oneDataMessage
and oneWakuObjectArgs
. I would also rename the latter toWakuObjectContext
.