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

mobile: use bitrefill new parse #1366

Merged
merged 1 commit into from
Nov 5, 2024
Merged

Conversation

nalinbhardwaj
Copy link
Member

closes #1356

Copy link

vercel bot commented Nov 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
daimo-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 1:18am
daimo-web-stage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 1:18am

@@ -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 };
Copy link
Member

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,
Copy link
Member

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

Copy link
Member

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..

Copy link
Member

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);
Copy link
Member

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");
Copy link
Member

Choose a reason for hiding this comment

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

🚀

Copy link
Member

@dcposch dcposch left a comment

Choose a reason for hiding this comment

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

LGreatTM

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.

Bitrefill stuck on checkout screen
2 participants