@cedros/pay-react 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -53
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -13,11 +13,11 @@ One React component for Stripe and Solana USDC. Uses your existing products. No
|
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## What is Cedros Pay?
|
|
17
17
|
|
|
18
18
|
**One component, two payment rails.** Stripe for cards, Solana USDC for wallets. No second checkout.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Cedros Pay connects traditional payments (Stripe) with crypto (Solana x402) using the product IDs you already have. No deposit wallets to manage. No wallet infrastructure to secure. No custody risk.
|
|
21
21
|
|
|
22
22
|
### The Problem with Traditional Crypto Payments
|
|
23
23
|
|
|
@@ -30,8 +30,6 @@ Adding crypto to your store traditionally requires:
|
|
|
30
30
|
- Building Stripe separately
|
|
31
31
|
- Maintaining two systems
|
|
32
32
|
|
|
33
|
-
**Time:** 3-8 weeks | **Risk:** Custody risk | **Cost:** More DevOps
|
|
34
|
-
|
|
35
33
|
### The Cedros Pay Solution
|
|
36
34
|
|
|
37
35
|
```tsx
|
|
@@ -41,11 +39,9 @@ Adding crypto to your store traditionally requires:
|
|
|
41
39
|
/>
|
|
42
40
|
```
|
|
43
41
|
|
|
44
|
-
**Time:** ~15 minutes | **Risk:** No custody | **Cost:** Less DevOps
|
|
45
|
-
|
|
46
42
|
---
|
|
47
43
|
|
|
48
|
-
##
|
|
44
|
+
## How It Works (x402)
|
|
49
45
|
|
|
50
46
|
x402 makes Solana payments stateless. The client includes a signed transaction with the request. Your backend verifies it on-chain and unlocks the resource.
|
|
51
47
|
|
|
@@ -71,7 +67,7 @@ User → Sign Transaction → Your Backend → Verify On-Chain → Merchant (Dir
|
|
|
71
67
|
|
|
72
68
|
---
|
|
73
69
|
|
|
74
|
-
##
|
|
70
|
+
## Key Features
|
|
75
71
|
|
|
76
72
|
### 1. One Component, Two Rails
|
|
77
73
|
|
|
@@ -129,11 +125,7 @@ X-PAYMENT: <signed-transaction>
|
|
|
129
125
|
React UI + Go backend. Open API.
|
|
130
126
|
|
|
131
127
|
```tsx
|
|
132
|
-
<CedrosPay
|
|
133
|
-
resource="item"
|
|
134
|
-
wallets={customWallets}
|
|
135
|
-
renderModal={CustomModal}
|
|
136
|
-
/>
|
|
128
|
+
<CedrosPay resource="item" wallets={customWallets} renderModal={CustomModal} />
|
|
137
129
|
```
|
|
138
130
|
|
|
139
131
|
**Additional Features:**
|
|
@@ -144,7 +136,7 @@ React UI + Go backend. Open API.
|
|
|
144
136
|
|
|
145
137
|
---
|
|
146
138
|
|
|
147
|
-
##
|
|
139
|
+
## Quick Start (3 Steps in ~3 Minutes)
|
|
148
140
|
|
|
149
141
|
If you can wrap a provider, you can ship dual payments.
|
|
150
142
|
|
|
@@ -189,12 +181,6 @@ function App() {
|
|
|
189
181
|
}
|
|
190
182
|
```
|
|
191
183
|
|
|
192
|
-
**Bundle Size Comparison:**
|
|
193
|
-
|
|
194
|
-
- `@cedros/pay-react` (full): ~100KB + 850KB Solana peer deps
|
|
195
|
-
- `@cedros/pay-react/stripe-only`: ~75KB (no Solana deps)
|
|
196
|
-
- `@cedros/pay-react/crypto-only`: ~100KB + 850KB Solana peer deps
|
|
197
|
-
|
|
198
184
|
### CDN Usage (Optional)
|
|
199
185
|
|
|
200
186
|
For zero-build prototyping or simple sites, you can import directly from a CDN:
|
|
@@ -315,16 +301,13 @@ function Checkout() {
|
|
|
315
301
|
}
|
|
316
302
|
```
|
|
317
303
|
|
|
318
|
-
**Total time:** ~3 minutes
|
|
319
|
-
|
|
320
304
|
**Backend options:** Use the Go server, or implement the open API.
|
|
321
305
|
|
|
322
306
|
**Links:**
|
|
323
307
|
|
|
324
308
|
- [Backend setup →](https://github.com/CedrosPay/server)
|
|
325
|
-
- [Full docs →](https://
|
|
326
|
-
- [Example apps →](https://github.com/CedrosPay/react/tree/main/
|
|
327
|
-
- [Storybook →](https://github.com/CedrosPay/react#-storybook-development)
|
|
309
|
+
- [Full docs →](https://docs.cedrospay.com)
|
|
310
|
+
- [Example apps →](https://github.com/CedrosPay/react/tree/main/examples)
|
|
328
311
|
|
|
329
312
|
**Cross-Domain Backend (Optional):**
|
|
330
313
|
If your backend is on a different domain (e.g., `api.example.com` while your frontend is on `example.com`), explicitly set `serverUrl`:
|
|
@@ -437,7 +420,7 @@ See [Backend Integration](https://github.com/CedrosPay/server) and `@backend-mig
|
|
|
437
420
|
|
|
438
421
|
---
|
|
439
422
|
|
|
440
|
-
##
|
|
423
|
+
## Production Deployment
|
|
441
424
|
|
|
442
425
|
### Content Security Policy (CSP) Headers
|
|
443
426
|
|
|
@@ -795,8 +778,7 @@ const csp = generateCSP({
|
|
|
795
778
|
customRpcProviders: [
|
|
796
779
|
RPC_PROVIDERS.HELIUS, // https://*.helius-rpc.com
|
|
797
780
|
RPC_PROVIDERS.QUICKNODE, // https://*.quicknode.pro
|
|
798
|
-
RPC_PROVIDERS.
|
|
799
|
-
RPC_PROVIDERS.ANKR, // https://rpc.ankr.com
|
|
781
|
+
RPC_PROVIDERS.FLUX, // https://*.fluxrpc.com
|
|
800
782
|
RPC_PROVIDERS.TRITON, // https://*.rpcpool.com
|
|
801
783
|
],
|
|
802
784
|
});
|
|
@@ -1052,7 +1034,7 @@ The i18n system:
|
|
|
1052
1034
|
|
|
1053
1035
|
---
|
|
1054
1036
|
|
|
1055
|
-
##
|
|
1037
|
+
## Type Versioning Policy
|
|
1056
1038
|
|
|
1057
1039
|
Cedros Pay uses **semantic versioning for TypeScript types** to prevent breaking changes from affecting your code.
|
|
1058
1040
|
|
|
@@ -1298,7 +1280,7 @@ For complete control over styling, use the `unstyled` prop to disable all defaul
|
|
|
1298
1280
|
|
|
1299
1281
|
---
|
|
1300
1282
|
|
|
1301
|
-
##
|
|
1283
|
+
## Props Reference
|
|
1302
1284
|
|
|
1303
1285
|
### CedrosProvider Configuration
|
|
1304
1286
|
|
|
@@ -1577,10 +1559,6 @@ All logs include timestamps and severity levels:
|
|
|
1577
1559
|
|
|
1578
1560
|
---
|
|
1579
1561
|
|
|
1580
|
-
## 🔒 API Stability & Versioning
|
|
1581
|
-
|
|
1582
|
-
Cedros Pay is designed for enterprise use with a strong commitment to API stability.
|
|
1583
|
-
|
|
1584
1562
|
### Semantic Versioning
|
|
1585
1563
|
|
|
1586
1564
|
We follow [Semantic Versioning](https://semver.org/):
|
|
@@ -1652,7 +1630,7 @@ const newReq: v2.X402Requirement = { ... };
|
|
|
1652
1630
|
|
|
1653
1631
|
---
|
|
1654
1632
|
|
|
1655
|
-
##
|
|
1633
|
+
## Error Telemetry (Optional)
|
|
1656
1634
|
|
|
1657
1635
|
Cedros Pay includes **opt-in error telemetry** with correlation IDs for production debugging. Telemetry is **disabled by default** and requires explicit configuration.
|
|
1658
1636
|
|
|
@@ -1729,22 +1707,7 @@ function PaymentButton() {
|
|
|
1729
1707
|
}
|
|
1730
1708
|
```
|
|
1731
1709
|
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
---
|
|
1735
|
-
|
|
1736
|
-
## 🧭 Roadmap
|
|
1737
|
-
|
|
1738
|
-
- Stripe + x402 unified dashboard
|
|
1739
|
-
- Subscription management
|
|
1740
|
-
- Facilitator integrations (PayAI, Kora)
|
|
1741
|
-
- Typed SDKs for Go, Node, and Python agents
|
|
1742
|
-
|
|
1743
|
-
---
|
|
1744
|
-
|
|
1745
|
-
**Cedros Pay** — _rooted in Solana, built for the web._
|
|
1746
|
-
|
|
1747
|
-
## 🎨 Storybook Development
|
|
1710
|
+
## Storybook Development
|
|
1748
1711
|
|
|
1749
1712
|
### Setup
|
|
1750
1713
|
|
|
@@ -1819,7 +1782,7 @@ VITE_SERVER_URL=http://localhost:8080
|
|
|
1819
1782
|
| `VITE_STORYBOOK_SERVER_URL` | Override server URL for Storybook | Optional |
|
|
1820
1783
|
| `VITE_STORYBOOK_SOLANA_ENDPOINT` | Override RPC for Storybook | Optional |
|
|
1821
1784
|
|
|
1822
|
-
##
|
|
1785
|
+
## Contributing
|
|
1823
1786
|
|
|
1824
1787
|
We welcome contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines on:
|
|
1825
1788
|
|
|
@@ -1838,6 +1801,6 @@ npm test
|
|
|
1838
1801
|
npm run test:coverage
|
|
1839
1802
|
```
|
|
1840
1803
|
|
|
1841
|
-
##
|
|
1804
|
+
## License
|
|
1842
1805
|
|
|
1843
1806
|
MIT License - see [LICENSE](./LICENSE) for details.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedros/pay-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "React frontend library for Cedros Pay - unified Stripe and Solana x402 payments",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"solana",
|
|
43
43
|
"x402",
|
|
44
44
|
"crypto",
|
|
45
|
-
"react"
|
|
45
|
+
"react",
|
|
46
|
+
"stablecoins"
|
|
46
47
|
],
|
|
47
48
|
"author": "Cedros Pay Team",
|
|
48
49
|
"license": "MIT",
|