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

[WIP] Project intergalactic - Fiat flow #4714

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

edwardysun
Copy link
Member

@edwardysun edwardysun commented Sep 19, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR introduces enhancements to the buyWithFiat functionality, allowing for the deployment of a smart wallet and improving the handling of onramp transactions. It updates payment options, RPC URLs, and integrates new hooks for better user experience.

Detailed summary

  • Added payOptions for buyWithFiat with preferredProvider.
  • Changed DEFAULT_RPC_URL from rpc.thirdweb.com to rpc.thirdweb-dev.com.
  • Enhanced FiatDetailsScreen with intentId.
  • Introduced isSingleStepExecutionEnabled in getQuote.ts.
  • Added state management for onRampLinkOverride in FiatFlow.tsx.
  • Updated FiatSteps to include smart wallet deployment logic.
  • Implemented useDeploySmartWallet hook for wallet deployment.
  • Integrated smart wallet deployment in FiatScreenContent.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@edwardysun edwardysun added the DO NOT MERGE This pull request is still in progress and is not ready to be merged. label Sep 19, 2024
Copy link

changeset-bot bot commented Sep 19, 2024

⚠️ No Changeset found

Latest commit: 8afb2c4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Sep 19, 2024

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

Name Status Preview Comments Updated (UTC)
docs-v2 ❌ Failed (Inspect) Sep 28, 2024 8:27am
thirdweb_playground ❌ Failed (Inspect) Sep 28, 2024 8:27am
thirdweb-www ❌ Failed (Inspect) Sep 28, 2024 8:27am
wallet-ui ❌ Failed (Inspect) Sep 28, 2024 8:27am

Copy link

graphite-app bot commented Sep 19, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added Playground Changes involving the Playground codebase. packages labels Sep 19, 2024
Copy link
Contributor

github-actions bot commented Sep 19, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 43.73 KB (+0.15% 🔺) 875 ms (+0.15% 🔺) 2.9 s (+11.85% 🔺) 3.8 s
thirdweb (cjs) 101.25 KB (+0.06% 🔺) 2.1 s (+0.06% 🔺) 5.1 s (-20.48% 🔽) 7.1 s
thirdweb (minimal + tree-shaking) 4.85 KB (+0.03% 🔺) 98 ms (+0.03% 🔺) 234 ms (+24.44% 🔺) 331 ms
thirdweb/chains (tree-shaking) 502 B (+0.81% 🔺) 10 ms (0%) 257 ms (+205.96% 🔺) 267 ms
thirdweb/react (minimal + tree-shaking) 16.73 KB (+0.07% 🔺) 335 ms (+0.07% 🔺) 479 ms (-10.02% 🔽) 813 ms

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 9.47368% with 86 lines in your changes missing coverage. Please review.

Project coverage is 50.57%. Comparing base (0a7448c) to head (5142e8e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...eb/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx 9.41% 77 Missing ⚠️
...web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.tsx 0.00% 8 Missing ⚠️
...screens/Buy/pay-transactions/FiatDetailsScreen.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4714      +/-   ##
==========================================
- Coverage   50.62%   50.57%   -0.05%     
==========================================
  Files        1025     1024       -1     
  Lines       54562    54629      +67     
  Branches     3893     3891       -2     
==========================================
+ Hits        27623    27630       +7     
- Misses      26306    26366      +60     
  Partials      633      633              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from ac45d90
packages 46.82% <9.47%> (-0.06%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
packages/thirdweb/src/utils/domains.ts 55.88% <100.00%> (ø)
...screens/Buy/pay-transactions/FiatDetailsScreen.tsx 7.27% <0.00%> (-0.07%) ⬇️
...web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.tsx 9.80% <0.00%> (-0.73%) ⬇️
...eb/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx 5.38% <9.41%> (+0.75%) ⬆️

... and 3 files with indirect coverage changes

buyWithFiat: {
preferredProvider: "STRIPE",
},
}}
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove before merging

@@ -34,7 +34,7 @@ type DomainOverrides = {
export const DEFAULT_RPC_URL = "rpc.thirdweb.com";
const DEFAULT_SOCIAL_URL = "social.thirdweb.com";
const DEFAULT_IN_APP_WALLET_URL = "embedded-wallet.thirdweb.com";
const DEFAULT_PAY_URL = "pay.thirdweb.com";
const DEFAULT_PAY_URL = "pay.thirdweb-dev.com";
Copy link
Member Author

Choose a reason for hiding this comment

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

Change back

const account = useActiveAccount();
const switchChain = useSwitchActiveWalletChain();

const deploySmartWallet = async ({ chain }: { chain: Chain }) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

needs to be better organized

sponsorGas: true,
});

const smartAccount = await smartWalletHandle.connect({
Copy link
Member Author

Choose a reason for hiding this comment

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

Right now, this creates a smart wallet that is deterministic to the account, but not per intent. How can I send in an intentId as the string to be deterministic by?

@@ -31,7 +31,7 @@ type DomainOverrides = {
bundler?: string;
};

export const DEFAULT_RPC_URL = "rpc.thirdweb.com";
export const DEFAULT_RPC_URL = "rpc.thirdweb-dev.com";
Copy link
Member Author

Choose a reason for hiding this comment

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

change back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO NOT MERGE This pull request is still in progress and is not ready to be merged. packages Playground Changes involving the Playground codebase.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant