Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d2c18d1
feat: scaffold initial payment widget component
bassgeta Sep 3, 2025
9ae4ede
feat: reorganize folder structure when lib is added via shad cli, use…
bassgeta Sep 5, 2025
d7a1a57
feat: implement currency selection and buyer info form
bassgeta Sep 8, 2025
1683a73
feat: reorganize the home page and widget due to env issues, implemen…
bassgeta Sep 8, 2025
708d686
feat: make the payment step more granular and decouple functions, con…
bassgeta Sep 9, 2025
bade620
feat: add invoice download as the payment success step
bassgeta Sep 9, 2025
89c6923
feat: rework props and make invoice info configurable by props
bassgeta Sep 10, 2025
b2f24a1
feat: fetch conversion currencies dynamically
bassgeta Sep 10, 2025
fb0b232
feat: add flags for payment success UI elements, add supported curren…
bassgeta Sep 10, 2025
d407216
feat: add option to override the wallet connection with own viem wall…
bassgeta Sep 10, 2025
f524cf1
feat: make the button just be children and add powered by RN subtext
bassgeta Sep 11, 2025
d9d615b
feat: use real wallet logos
bassgeta Sep 11, 2025
b7f9405
feat: use client id instead of API key
bassgeta Sep 11, 2025
12cb559
fix: fix wagmi config error due to wallet connect being initialized t…
bassgeta Sep 11, 2025
0c52196
feat: restyle app to look nicer
bassgeta Sep 11, 2025
badec7b
fix: shadcn build, restyle invoice
bassgeta Sep 11, 2025
53692b7
fix: move wallet icons to base64
bassgeta Sep 11, 2025
c8b3fbb
docs: add code comment containing css overrides
bassgeta Sep 11, 2025
02c381d
refactor: use context instead of prop drilling
bassgeta Sep 12, 2025
50faeb7
feat: add readme.md and code for using an existing viem wallet client
bassgeta Sep 15, 2025
791128b
refactor: locally encapsulate helpers instead of having them in globa…
bassgeta Sep 15, 2025
daebcc9
refactor: use receipt instead of invoice, make company name mandatory…
bassgeta Sep 16, 2025
4242270
feat: zipCode -> postalCode, add customerInfo to payout
bassgeta Sep 16, 2025
be2644e
feat: make form send undefined instead of empty string, start nesting…
bassgeta Sep 16, 2025
54aeb6b
feat: wait for transactions to be mined, update the onSuccess handler
bassgeta Sep 17, 2025
b78219b
feat: code review align
bassgeta Sep 17, 2025
05f91ec
feat: make URL overridable via env
bassgeta Sep 17, 2025
8a05197
feat: code review align, make api url overridable
bassgeta Sep 17, 2025
7b6dff4
feat: handle switching chains before executing payment, pass txHash t…
bassgeta Sep 17, 2025
70ce7e1
feat: nest CSS class, disable pay button
bassgeta Sep 17, 2025
b3347b8
refactor: use supportedCurrencies instead of the top level network pa…
bassgeta Sep 17, 2025
3e505ea
refactor: change receipt info numbers to strings
bassgeta Sep 17, 2025
72e5bf9
fix: make matic and polygon resolve to the polygon network
bassgeta Sep 17, 2025
4c8a456
fix: make the page try to pay 1 dollar instead of 10
bassgeta Sep 17, 2025
c4647e5
build: add deploy to staging and production scripts
bassgeta Sep 17, 2025
c702ddd
fix: comment out actual USDC from the test page
bassgeta Sep 17, 2025
f9e732e
docs: add note for devs to run the registry build before pushing
bassgeta Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 31 additions & 129 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,139 +1,41 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Coverage directory used by tools like istanbul
coverage
*.lcov
# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# nyc test coverage
.nyc_output
# testing
/coverage

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# next.js
/.next/
/out/

# Bower dependency directory (https://bower.io/)
bower_components
# production
/build

# node-waf configuration
.lock-wscript
# misc
.DS_Store
*.pem

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# Dependency directories
node_modules/
jspm_packages/
# env files (can opt-in for committing if needed)
.env*

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# vercel
.vercel

# TypeScript cache
# typescript
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.*
!.env.example

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Sveltekit cache directory
.svelte-kit/

# vitepress build output
**/.vitepress/dist

# vitepress cache directory
**/.vitepress/cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Firebase cache directory
.firebase/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Vite logs files
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
next-env.d.ts
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
# ui-registry
Request Network's reusable components registry for ShadCN
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
90 changes: 90 additions & 0 deletions app/components/payment-widget-wrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
"use client";

import { PaymentWidget } from "@/registry/default/payment-widget/payment-widget";
import type { WalletClient } from "viem";

interface PaymentWidgetWrapperProps {
recipientWallet: string;
walletAccount?: WalletClient;
}

export function PaymentWidgetWrapper({
recipientWallet,
walletAccount,
}: PaymentWidgetWrapperProps) {
const walletConnectProjectId =
process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID || "";
const rnApiClientId = process.env.NEXT_PUBLIC_REQUEST_API_CLIENT_ID || "";

const handleSuccess = async (requestId: string) => {
console.log("Payment successful:", requestId);
};

const handleError = async (error: any) => {
console.error("Payment failed:", error);
};

return (
<PaymentWidget
amountInUsd="10.00"
recipientWallet={recipientWallet}
walletAccount={walletAccount}
paymentConfig={{
walletConnectProjectId,
rnApiClientId,
supportedCurrencies: [
"ETH-sepolia-sepolia",
"fUSDT-sepolia",
"FAU-sepolia",
"USDCn-matic",
],
feeInfo: undefined /* {
feeAddress: "0xEbe98659e162e8fF3520EC71e097C9e0a4F53829",
feePercentage: "10",
},*/,
}}
receiptInfo={{
buyerInfo: {
firstName: "Testo",
email: "[email protected]",
},
companyInfo: {
name: "Request Network Inc.",
address: {
street: "123 Crypto Street",
city: "San Francisco",
state: "CA",
postalCode: "94105",
country: "USA",
},
taxId: "US123456789",
email: "[email protected]",
phone: "+1 (555) 123-4567",
website: "https://request.network",
},
items: [
{
id: "1",
description: "Payment via Request Network",
quantity: 1,
unitPrice: "10.0",
total: "10.0",
currency: "USD",
},
],
totals: {
totalDiscount: "0",
totalTax: "0",
total: "10.0",
totalUSD: "10.0",
},
}}
onSuccess={handleSuccess}
onError={handleError}
>
<div className="flex p-3 bg-blue-500 items-center rounded-2xl text-white">
Pay using crypto
</div>
</PaymentWidget>
);
}
Loading