Skip to content

Commit fe518b2

Browse files
Fix code mixup with arc-multichain-wallet. (#3)
1 parent 9c0c120 commit fe518b2

160 files changed

Lines changed: 10370 additions & 3768 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# Supabase
2-
NEXT_PUBLIC_SUPABASE_URL=your-project-url
3-
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your-publishable-or-anon-key
2+
NEXT_PUBLIC_SUPABASE_URL=
3+
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY=
4+
SUPABASE_SERVICE_ROLE_KEY=
45

56
# Circle
6-
CIRCLE_API_KEY=your-circle-api-key
7-
CIRCLE_ENTITY_SECRET=your-circle-entity-secret
7+
CIRCLE_API_KEY=
8+
CIRCLE_ENTITY_SECRET=
9+
CIRCLE_BLOCKCHAIN=ARC-TESTNET
10+
CIRCLE_USDC_TOKEN_ID=
11+
12+
# Misc
13+
ADMIN_EMAIL=admin@admin.com

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ jobs:
1515
- name: Install Node
1616
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
1717

18-
- name: Install pnpm
19-
uses: pnpm/action-setup@v4
20-
2118
- name: Install dependencies
22-
run: pnpm install
19+
run: npm install
2320

2421
scan:
2522
needs: lint-and-test

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ yarn-error.log*
3838
# vercel
3939
.vercel
4040

41+
# supabase
42+
supabase/.temp/
43+
4144
# typescript
4245
*.tsbuildinfo
4346
next-env.d.ts
44-
45-
.vscode/

README.md

Lines changed: 62 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,85 @@
1-
# Circle Gateway Multichain USDC
1+
# Arc Commerce
22

3-
This sample app demonstrates how to integrate USDC as a payment method for purchasing credits on Arc.
3+
This project demonstrates how to integrate USDC as a payment method for purchasing credits on Arc.
44

5-
### Install dependencies
5+
## Table of Contents
66

7-
```bash
8-
# Install dependencies
9-
pnpm install
7+
- [Clone and Run Locally](#clone-and-run-locally)
8+
- [Environment Variables](#environment-variables)
109

11-
# Configure environment variables
12-
cp .env.example .env.local
13-
```
10+
## Clone and Run Locally
1411

15-
Update `.env.local`:
12+
1. **Clone and install dependencies:**
1613

17-
```ini
18-
# Supabase
19-
NEXT_PUBLIC_SUPABASE_URL=your-project-url
20-
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your-publishable-or-anon-key
14+
```bash
15+
git clone git@github.com:circlefin/arc-commerce.git
16+
cd top-up
17+
npm install
18+
```
2119

22-
# Circle
23-
CIRCLE_API_KEY=your-circle-api-key
24-
CIRCLE_ENTITY_SECRET=your-circle-entity-secret
25-
```
20+
2. **Set up environment variables:**
2621

27-
### Start Supabase
22+
```bash
23+
cp .env.example .env.local
24+
```
2825

29-
```bash
30-
pnpx supabase start
31-
```
26+
Then edit `.env.local` and fill in all required values (see [Environment Variables](#environment-variables) section below).
3227

33-
### Run Development Server
28+
3. **Start Supabase locally** (requires Docker):
3429

35-
```bash
36-
pnpm run dev
37-
```
30+
```bash
31+
npx supabase start
32+
npx supabase migration up
33+
```
3834

39-
Visit [http://localhost:3000/wallet](http://localhost:3000/wallet)
35+
4. **Start the development server:**
4036

41-
## How It Works
37+
```bash
38+
npm run dev
39+
```
4240

43-
### Unified Balance
41+
The app will be available at [http://localhost:3000](http://localhost:3000/). The admin wallet will be automatically created on first startup.
4442

45-
When you deposit USDC to the Gateway Wallet, it becomes part of your unified balance accessible from any supported chain. The Gateway Wallet uses the same address on all chains: `0x0077777d7EBA4688BDeF3E311b846F25870A19B9`
43+
5. **Set up Circle Webhooks:**
4644

47-
### Deposit Flow
45+
In a separate terminal, start ngrok to expose your local server:
4846

49-
1. Approve Gateway Wallet to spend your USDC
50-
2. Call `deposit()` to transfer USDC to Gateway
51-
3. Balance becomes available across all chains after finalization
47+
```bash
48+
ngrok http 3000
49+
```
5250

53-
### Cross-Chain Transfer Flow
51+
Copy the HTTPS URL from ngrok (e.g., `https://your-ngrok-url.ngrok.io`) and add it to your Circle Console webhooks section:
52+
- Navigate to Circle Console → Webhooks
53+
- Add a new webhook endpoint: `https://your-ngrok-url.ngrok.io/api/circle/webhook`
54+
- Keep ngrok running while developing to receive webhook events
5455

55-
1. Create and sign burn intent (EIP-712)
56-
2. Submit to Gateway API for attestation
57-
3. Call `gatewayMint()` on destination chain
58-
4. USDC minted on destination
56+
## Environment Variables
5957

60-
## Security Notes
58+
Copy `.env.example` to `.env.local` and fill in the required values:
6159

62-
- This is a **testnet demonstration** only
63-
- Private keys are processed server-side and never stored
64-
- Never use mainnet private keys with this application
65-
- Always use HTTPS in production
66-
- Consider hardware wallet integration for production use
60+
```bash
61+
# Supabase
62+
NEXT_PUBLIC_SUPABASE_URL=
63+
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY=
64+
SUPABASE_SERVICE_ROLE_KEY=
6765

68-
## Resources
66+
# Circle
67+
CIRCLE_API_KEY=
68+
CIRCLE_ENTITY_SECRET=
69+
CIRCLE_BLOCKCHAIN=ARC-TESTNET
70+
CIRCLE_USDC_TOKEN_ID=
71+
72+
# Misc
73+
ADMIN_EMAIL=admin@admin.com
74+
```
6975

70-
- [Circle Gateway Documentation](https://developers.circle.com/gateway)
71-
- [Unified Balance Guide](https://developers.circle.com/gateway/howtos/create-unified-usdc-balance)
72-
- [Circle Faucet](https://faucet.circle.com/)
76+
| Variable | Scope | Purpose |
77+
| ------------------------------------- | ----------- | ------------------------------------------------------------------------ |
78+
| `NEXT_PUBLIC_SUPABASE_URL` | Public | Supabase project URL. |
79+
| `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY` | Public | Supabase anonymous/public key. |
80+
| `SUPABASE_SERVICE_ROLE_KEY` | Server-side | Service role for privileged writes (e.g., transaction inserts). |
81+
| `CIRCLE_API_KEY` | Server-side | Used to fetch Circle webhook public keys for signature verification. |
82+
| `CIRCLE_ENTITY_SECRET` | Server-side | Circle entity secret for wallet operations. |
83+
| `CIRCLE_BLOCKCHAIN` | Server-side | Blockchain network identifier (e.g., "ARC-TESTNET"). |
84+
| `CIRCLE_USDC_TOKEN_ID` | Server-side | USDC token ID for the specified blockchain. |
85+
| `ADMIN_EMAIL` | Server-side | Admin user email address. |

0 commit comments

Comments
 (0)