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

feat: buildPayTransaction utilities in preparation for Pay button #1177

Merged
merged 8 commits into from
Aug 31, 2024

Conversation

avidreder
Copy link
Contributor

@avidreder avidreder commented Aug 28, 2024

What changed? Why?

  • Adds utility for making RPC call to hydrate a charge and build a Pay Transaction
  • Adds supporting types
  • Adds utility and constants for handling errors

Notes to reviewers

How has it been tested?

Copy link

vercel bot commented Aug 28, 2024

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

Name Status Preview Comments Updated (UTC)
onchainkit-coverage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 31, 2024 0:15am
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 31, 2024 0:15am

Copy link

vercel bot commented Aug 28, 2024

@avidreder is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@avidreder avidreder changed the title Add charge hydration utilities in preparation for Pay button feat: charge hydration utilities in preparation for Pay button Aug 28, 2024
src/pay/types.ts Outdated Show resolved Hide resolved
@Zizzamia
Copy link
Contributor

Going forward for all APIs, let's have them live in the api module :)

src/api/hydrateCharge.ts Outdated Show resolved Hide resolved
src/api/hydrateCharge.ts Outdated Show resolved Hide resolved
src/api/hydrateCharge.ts Outdated Show resolved Hide resolved
src/pay/types.ts Outdated Show resolved Hide resolved
src/api/types.ts Outdated Show resolved Hide resolved
@avidreder avidreder changed the title feat: charge hydration utilities in preparation for Pay button feat: buildPayTransaction utilities in preparation for Pay button Aug 30, 2024
export type BuildPayTransactionParams = {
address: Address; // The address of the wallet paying
chainId: number; // The Chain ID of the payment Network (only Base is supported)
chargeId: string; // The ID of the Commerce Charge to be paid
Copy link
Contributor

Choose a reason for hiding this comment

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

Where can I read more about what's a Commerce Charge? Do we have live docs anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is probably the page I would point to: https://docs.cdp.coinbase.com/commerce-onchain/docs/crypto-payments for an overview of what a charge is (though not great info for this context, we'll have to update it).

Where do you think we should add this link in the code?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok let's come back on this one, mostly i am questioning the word charge.

@Zizzamia
Copy link
Contributor

Great start!!!

@Zizzamia Zizzamia merged commit 7578e03 into coinbase:main Aug 31, 2024
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants