@ffaerber/swarm-connect 0.1.0 → 0.2.0
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/dist/components/SwarmConnectModal.d.ts +2 -1
- package/dist/components/tabs/SwarmTab.d.ts +2 -1
- package/dist/swarm-connect.js +556 -482
- package/dist/swarm-connect.umd.cjs +12 -12
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@ A React connect-button and wizard for [Ethereum Swarm](https://www.ethswarm.org/
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- 🐝 **Bee node detection** — checks a Bee node's `/health` endpoint and surfaces its version.
|
|
8
|
+
- 🔧 **Editable node URL** — users can change the Bee node hostname from the modal and reconnect (defaults to `http://localhost:1633`).
|
|
8
9
|
- 🎟️ **Postage stamp selection** — fetches available stamps from `/stamps` and lets the user pick one.
|
|
9
10
|
- 🦊 **Wallet connect** — injected-wallet connection via [wagmi](https://wagmi.sh/), pinned to Gnosis chain (ID `100`).
|
|
10
11
|
- ✅ **At-a-glance status** — the button shows status dots for node, stamp, wallet, and network.
|
|
@@ -88,6 +89,8 @@ function Status() {
|
|
|
88
89
|
const {
|
|
89
90
|
beeNode, // { isRunning, isChecking, version?, error?, check() }
|
|
90
91
|
stamps, // { stamps, isLoading, error?, fetchStamps(), selectedStampId?, selectStamp() }
|
|
92
|
+
beeApiUrl, // current Bee node URL
|
|
93
|
+
setBeeApiUrl, // change the Bee node URL at runtime, then re-check
|
|
91
94
|
isWalletConnected,
|
|
92
95
|
address,
|
|
93
96
|
isOnGnosis,
|
|
@@ -120,10 +123,12 @@ const { stamps, isLoading, error, fetchStamps, selectedStampId, selectStamp } =
|
|
|
120
123
|
|
|
121
124
|
```ts
|
|
122
125
|
interface SwarmConnectConfig {
|
|
123
|
-
beeApiUrl?: string // defaults to http://localhost:1633
|
|
126
|
+
beeApiUrl?: string // initial Bee node URL; defaults to http://localhost:1633
|
|
124
127
|
}
|
|
125
128
|
```
|
|
126
129
|
|
|
130
|
+
`beeApiUrl` is only the **initial** value. Users can edit the node URL from the modal's Swarm tab (or programmatically via `setBeeApiUrl` from `useSwarmConnect`), which re-checks the node at the new address. This is useful when the Bee node runs on a non-default host or port.
|
|
131
|
+
|
|
127
132
|
"Fully connected" requires all of the following:
|
|
128
133
|
|
|
129
134
|
1. A reachable Bee node (`/health` responds OK).
|
|
@@ -6,6 +6,7 @@ interface SwarmConnectModalProps {
|
|
|
6
6
|
};
|
|
7
7
|
stamps: PostageStampsState;
|
|
8
8
|
beeApiUrl: string;
|
|
9
|
+
setBeeApiUrl: (url: string) => void;
|
|
9
10
|
}
|
|
10
|
-
export declare function SwarmConnectModal({ onClose, beeNode, stamps, beeApiUrl }: SwarmConnectModalProps): import("react").JSX.Element;
|
|
11
|
+
export declare function SwarmConnectModal({ onClose, beeNode, stamps, beeApiUrl, setBeeApiUrl }: SwarmConnectModalProps): import("react").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { BeeNodeStatus, PostageStampsState } from '../../types';
|
|
2
2
|
interface SwarmTabProps {
|
|
3
3
|
beeApiUrl: string;
|
|
4
|
+
setBeeApiUrl: (url: string) => void;
|
|
4
5
|
beeNode: BeeNodeStatus & {
|
|
5
6
|
check: () => void;
|
|
6
7
|
};
|
|
7
8
|
stamps: PostageStampsState;
|
|
8
9
|
}
|
|
9
|
-
export declare function SwarmTab({ beeApiUrl, beeNode, stamps }: SwarmTabProps): import("react").JSX.Element;
|
|
10
|
+
export declare function SwarmTab({ beeApiUrl, setBeeApiUrl, beeNode, stamps }: SwarmTabProps): import("react").JSX.Element;
|
|
10
11
|
export {};
|