create-sbc-app 0.1.3 → 0.1.5
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
CHANGED
|
@@ -134,8 +134,14 @@ cd my-sbc-app
|
|
|
134
134
|
# Copy environment template
|
|
135
135
|
cp .env.template .env
|
|
136
136
|
|
|
137
|
-
#
|
|
138
|
-
|
|
137
|
+
# then ensure your .env has the environment variables set up
|
|
138
|
+
|
|
139
|
+
# "base" or "baseSepolia"
|
|
140
|
+
VITE_CHAIN="baseSepolia"
|
|
141
|
+
# Custom RPC URL (optional) - e.g. get one from Alchemey at https://dashboard.alchemy.com/apps
|
|
142
|
+
VITE_RPC_URL=
|
|
143
|
+
# Get your SBC API Key at https://dashboard.stablecoin.xyz
|
|
144
|
+
VITE_SBC_API_KEY=
|
|
139
145
|
```
|
|
140
146
|
|
|
141
147
|
### 3. Start Development
|
package/package.json
CHANGED
|
@@ -16,11 +16,14 @@ Copy the example environment file and add your SBC API key:
|
|
|
16
16
|
cp .env.example .env # Optional: for local overrides
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Edit `.env` and add your SBC API key:
|
|
19
|
+
Edit `.env` and add your SBC API key and Chain, with the optional for a custom RPC:
|
|
20
20
|
```bash
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
# "base" or "baseSepolia"
|
|
22
|
+
VITE_CHAIN="baseSepolia"
|
|
23
|
+
# Custom RPC URL (optional) - e.g. get one from Alchemey at https://dashboard.alchemy.com/apps
|
|
24
|
+
VITE_RPC_URL=
|
|
25
|
+
# Get your SBC API Key at https://dashboard.stablecoin.xyz
|
|
26
|
+
VITE_SBC_API_KEY=
|
|
24
27
|
```
|
|
25
28
|
|
|
26
29
|
> **Get your API key:** Visit the [SBC Dashboard](https://dashboard.stablecoin.xyz) to create an account and get your API key.
|
|
@@ -7,6 +7,7 @@ import './App.css';
|
|
|
7
7
|
|
|
8
8
|
// Chain selection helpers
|
|
9
9
|
const chain = (import.meta.env.VITE_CHAIN === 'base') ? base : baseSepolia;
|
|
10
|
+
const rpcUrl = import.meta.env.VITE_RPC_URL;
|
|
10
11
|
|
|
11
12
|
const SBC_TOKEN_ADDRESS = (chain) => {
|
|
12
13
|
if (chain.id === baseSepolia.id) {
|
|
@@ -400,6 +401,7 @@ export default function App() {
|
|
|
400
401
|
const sbcConfig = {
|
|
401
402
|
apiKey: import.meta.env.VITE_SBC_API_KEY || '{{apiKey}}',
|
|
402
403
|
chain,
|
|
404
|
+
rpcUrl,
|
|
403
405
|
wallet: 'auto' as const,
|
|
404
406
|
debug: true,
|
|
405
407
|
walletOptions: { autoConnect: false },
|