@ffaerber/swarm-connect 0.1.0 → 0.3.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 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).
@@ -0,0 +1,8 @@
1
+ interface StepLabelProps {
2
+ step: number;
3
+ done?: boolean;
4
+ children: string;
5
+ }
6
+ /** Numbered section heading that signals the setup sequence (1 → 2 → 3). */
7
+ export declare function StepLabel({ step, done, children }: StepLabelProps): import("react").JSX.Element;
8
+ export {};
@@ -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
- interface SwarmTabProps {
2
+ interface SwarmSectionProps {
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 SwarmSection({ beeApiUrl, setBeeApiUrl, beeNode, stamps }: SwarmSectionProps): import("react").JSX.Element;
10
11
  export {};
@@ -1 +1,3 @@
1
- export declare function WalletTab(): import("react").JSX.Element;
1
+ export declare function WalletSection({ swarmReady }: {
2
+ swarmReady: boolean;
3
+ }): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  export declare const GNOSIS_CHAIN_ID = 100;
2
2
  export declare const DEFAULT_BEE_API_URL = "http://localhost:1633";
3
+ export declare const BEE_API_URL_STORAGE_KEY = "swarm-connect:bee-api-url";
3
4
  export declare const STYLES: {
4
5
  readonly colors: {
5
6
  readonly primary: "#1a56db";