@toon-protocol/client 0.17.0 → 0.19.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 +19 -24
- package/dist/index.d.ts +730 -9
- package/dist/index.js +896 -63
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -51,14 +51,11 @@ pnpm add mina-signer
|
|
|
51
51
|
These coordinates go straight into the [`ToonClient` config](#quick-start) below.
|
|
52
52
|
|
|
53
53
|
> **Local development (from a clone of this repo, not the npm package).** To try the client
|
|
54
|
-
> end-to-end against a throwaway local network
|
|
55
|
-
>
|
|
56
|
-
>
|
|
57
|
-
>
|
|
58
|
-
>
|
|
59
|
-
> curl http://localhost:19100/health # peer 1 health
|
|
60
|
-
> ./scripts/sdk-e2e-infra.sh down # stop
|
|
61
|
-
> ```
|
|
54
|
+
> end-to-end against a throwaway local network — Anvil + two peer nodes + relays — see
|
|
55
|
+
> [`packages/client/tests/e2e/README.md`](tests/e2e/README.md) for the service topology and manual
|
|
56
|
+
> testing snippet. Its automated setup steps assume the monorepo's `scripts/sdk-e2e-infra.sh`
|
|
57
|
+
> wrapper and a `docker-compose-sdk-e2e.yml`, neither of which ships in this extracted repo; treat
|
|
58
|
+
> those steps as a reference for provisioning the equivalent infrastructure yourself.
|
|
62
59
|
>
|
|
63
60
|
> | Service | Port | Purpose |
|
|
64
61
|
> | ---------------- | ----- | --------------------------------------------------- |
|
|
@@ -275,38 +272,36 @@ pnpm test:coverage # Run with coverage report
|
|
|
275
272
|
|
|
276
273
|
### E2E Tests
|
|
277
274
|
|
|
278
|
-
E2E tests require
|
|
275
|
+
E2E tests require Docker Compose infrastructure. See
|
|
276
|
+
[tests/e2e/README.md](tests/e2e/README.md) for the service topology — note its automated setup
|
|
277
|
+
script isn't included in this extracted repo either (see the Prerequisites section above), so
|
|
278
|
+
provision the equivalent infrastructure manually, then run:
|
|
279
279
|
|
|
280
280
|
```bash
|
|
281
|
-
# Start infrastructure
|
|
282
|
-
./scripts/sdk-e2e-infra.sh up
|
|
283
|
-
|
|
284
|
-
# Run E2E tests
|
|
285
281
|
cd packages/client
|
|
286
282
|
pnpm test:e2e
|
|
287
283
|
```
|
|
288
284
|
|
|
289
|
-
See [tests/e2e/README.md](tests/e2e/README.md) for detailed E2E setup.
|
|
290
|
-
|
|
291
285
|
---
|
|
292
286
|
|
|
293
287
|
## Examples
|
|
294
288
|
|
|
295
|
-
See [examples/
|
|
289
|
+
See [examples/](examples/) for standalone client examples:
|
|
296
290
|
|
|
297
|
-
- **
|
|
298
|
-
- **
|
|
299
|
-
- **
|
|
300
|
-
- **
|
|
291
|
+
- **Basic Publish** (`basic-publish.ts`): Publish a Nostr event to the TOON network
|
|
292
|
+
- **Publish and Verify** (`publish-and-verify.ts`): Publish an event and verify via connector logs
|
|
293
|
+
- **Publish to Peer1** (`publish-to-peer1.ts`): Multi-hop ILP routing via a peer connector
|
|
294
|
+
- **Multi-Hop Routing** (`multi-hop-routing.ts`): Route an event through peer1 to the genesis relay
|
|
295
|
+
- **With Payment Channels** (`with-payment-channels.ts`): Configure EVM payment channels and publish with a signed balance proof
|
|
301
296
|
|
|
302
297
|
---
|
|
303
298
|
|
|
304
299
|
## Related Packages
|
|
305
300
|
|
|
306
|
-
- **[@toon-protocol/core](
|
|
307
|
-
- **[@toon-protocol/relay](
|
|
308
|
-
- **[@toon-protocol/sdk](
|
|
309
|
-
- **[@toon-protocol/bls](
|
|
301
|
+
- **[@toon-protocol/core](https://www.npmjs.com/package/@toon-protocol/core)** — Core protocol (peer discovery, bootstrap, `buildBlobStorageRequest`)
|
|
302
|
+
- **[@toon-protocol/relay](https://www.npmjs.com/package/@toon-protocol/relay)** — Operator product running the apex connector plus relay/swap/store nodes; also exports `encodeEventToToon` / `decodeEventFromToon` for event encoding
|
|
303
|
+
- **[@toon-protocol/sdk](https://www.npmjs.com/package/@toon-protocol/sdk)** — Higher-level helpers including `streamSwap()` for multi-chain swaps via a **swap**
|
|
304
|
+
- **[@toon-protocol/bls](https://www.npmjs.com/package/@toon-protocol/bls)** — Business Logic Server (pricing, validation, storage)
|
|
310
305
|
|
|
311
306
|
---
|
|
312
307
|
|