-
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
mobile: use bitrefill new parse #1366
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
7882652
to
39ef9d5
Compare
6f0174b
to
f0a7e87
Compare
@@ -13,7 +13,7 @@ export type Action = | |||
| { name: "createBackup" } | |||
| { name: "hideBottomSheet" } | |||
| { name: "swap"; swap: ProposedSwap } | |||
| { name: "bitrefill"; address: Address; amount: DollarStr }; | |||
| { name: "bitrefill"; address: Address; amount: BigIntStr }; |
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.
👍
|
||
return { | ||
recipientAddress: getAddress(recipientAddress), | ||
amount: BigInt(Number(amount)).toString() as BigIntStr, |
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 BigInt(Number(amount))
can be slightly off due to double precision
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.
saw it gets rounded up anyway in BitrefillBottomSheet..
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.
also, actually it's totally fine for USDC. issue only happens with 18-decimal tokens
address, | ||
amount: params.get("amount") || "", | ||
}); | ||
const parsedUri = parsePaymentUri(paymentUri); |
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.
👍
expect(uri.recipientAddress).toEqual( | ||
"0xaCB6230043d1Fc3dE02a43Aa748540bb9F260931" | ||
); | ||
expect(uri.amount).toEqual("100000000"); |
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.
LGreatTM
f0a7e87
to
e8cbc55
Compare
closes #1356