@zendfi/sdk 0.3.0 → 0.3.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 +38 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,10 +26,21 @@ pnpm add @zendfi/sdk
|
|
|
26
26
|
### 1. Set your API key
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
# .env.local
|
|
30
|
-
|
|
29
|
+
# .env.local or .env
|
|
30
|
+
|
|
31
|
+
# For development (uses Solana devnet)
|
|
32
|
+
ZENDFI_API_KEY=zfi_test_your_test_api_key_here
|
|
33
|
+
|
|
34
|
+
# For production (uses Solana mainnet)
|
|
35
|
+
# ZENDFI_API_KEY=zfi_live_your_live_api_key_here
|
|
31
36
|
```
|
|
32
37
|
|
|
38
|
+
**API Key Modes:**
|
|
39
|
+
- `zfi_test_*` keys route to **Solana Devnet** (free test SOL, no real money)
|
|
40
|
+
- `zfi_live_*` keys route to **Solana Mainnet** (real crypto transactions)
|
|
41
|
+
|
|
42
|
+
The SDK automatically detects the mode from your API key prefix.
|
|
43
|
+
|
|
33
44
|
### 2. Create a payment
|
|
34
45
|
|
|
35
46
|
```typescript
|
|
@@ -62,6 +73,31 @@ const payment = await client.createPayment({
|
|
|
62
73
|
|
|
63
74
|
That's it! The SDK handles everything else automatically. 🎉
|
|
64
75
|
|
|
76
|
+
## Test vs Live Mode
|
|
77
|
+
|
|
78
|
+
ZendFi provides separate API keys for testing and production:
|
|
79
|
+
|
|
80
|
+
| Mode | API Key Prefix | Network | Purpose |
|
|
81
|
+
|------|---------------|---------|---------|
|
|
82
|
+
| **Test** | `zfi_test_` | Solana Devnet | Development & testing with fake SOL |
|
|
83
|
+
| **Live** | `zfi_live_` | Solana Mainnet | Production with real crypto |
|
|
84
|
+
|
|
85
|
+
### Getting Test SOL
|
|
86
|
+
|
|
87
|
+
For testing on devnet:
|
|
88
|
+
1. Use your `zfi_test_` API key
|
|
89
|
+
2. Get free devnet SOL from [sol-faucet.com](https://www.sol-faucet.com/) or `solana airdrop`
|
|
90
|
+
3. All transactions use test tokens (no real value)
|
|
91
|
+
|
|
92
|
+
### Going Live
|
|
93
|
+
|
|
94
|
+
When ready for production:
|
|
95
|
+
1. Switch to your `zfi_live_` API key
|
|
96
|
+
2. All transactions will use real crypto on mainnet
|
|
97
|
+
3. Customers pay with real SOL/USDC/USDT
|
|
98
|
+
|
|
99
|
+
The SDK automatically routes to the correct network based on your API key prefix!
|
|
100
|
+
|
|
65
101
|
## Usage
|
|
66
102
|
|
|
67
103
|
### Payments
|