@beaconmcu/auth 0.1.1 → 0.1.2
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 +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,10 @@ await beacon.logout();
|
|
|
28
28
|
|
|
29
29
|
`beacon.getAddress()` returns the address or `null`. `beacon.getNetwork()` returns the active network.
|
|
30
30
|
|
|
31
|
+
## Build with AI
|
|
32
|
+
|
|
33
|
+
Copy a ready-made prompt for Claude, ChatGPT or Cursor from https://dashboard.beaconmcu.space/docs#build-with-ai. It describes the whole SDK, so an assistant can build your app from it. Open one of your apps in the dashboard to get the prompt with your Client ID filled in.
|
|
34
|
+
|
|
31
35
|
## React and Next.js
|
|
32
36
|
|
|
33
37
|
Create one `BeaconAuth` for the whole app, in its own file, and read it from your components:
|
|
@@ -113,7 +117,8 @@ beacon.on("networkChanged", (network) => console.log(network));
|
|
|
113
117
|
```
|
|
114
118
|
|
|
115
119
|
- `"testnet"` has free test XLM (Friendbot). `"mainnet"` is real money.
|
|
116
|
-
-
|
|
120
|
+
- **Which network is used:** your code wins. If `defaultNetwork` is set, that is used. If not, the app's **default network** from the Beacon dashboard (Settings) is used.
|
|
121
|
+
- **Call `getNetwork()` after `login()`.** Before login the SDK has not heard from the wallet, so without `defaultNetwork` in code it reports testnet even if your dashboard says Mainnet. After login it reports the wallet's real network.
|
|
117
122
|
- A network outside `supportedNetworks` is rejected with error code `-6`.
|
|
118
123
|
- Every approval screen in the wallet shows the network, and marks mainnet as "real funds".
|
|
119
124
|
- A Stellar account exists only after it receives at least 1 XLM. On testnet, fund it with Friendbot.
|