@toon-protocol/client 0.14.8 → 0.14.10
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 +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The **client library** for TOON Protocol — _pay-to-write Nostr over Interledger (ILP)_. Use it to **pay for and publish** writes to a network of service nodes. **Reads are free; writes cost a signed EIP-712 payment-channel claim** against an on-chain deposit.
|
|
4
4
|
|
|
5
|
-
> **`client` vs `relay`.** This package (`@toon-protocol/client`) is what an _app or end user_ uses to **pay** and publish. It does **not** run any relay or node. The nodes are operated separately by **`@toon-protocol/relay`** (the operator product, which runs an _apex_ connector plus `
|
|
5
|
+
> **`client` vs `relay`.** This package (`@toon-protocol/client`) is what an _app or end user_ uses to **pay** and publish. It does **not** run any relay or node. The nodes are operated separately by **`@toon-protocol/relay`** (the operator product, which runs an _apex_ connector plus `relay` / `swap` / `store` children). Don't confuse the **client** (pays) with **`@toon-protocol/relay`** (operates a node cluster), or the **relay** child node (a single Nostr-WS node) with the full **relay** operator stack.
|
|
6
6
|
|
|
7
7
|
## Which call pays which node
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Every write is an ILP packet carrying a signed payment-channel claim. The client
|
|
|
10
10
|
|
|
11
11
|
| Client call | Node type | What it does |
|
|
12
12
|
| --------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| `client.publishEvent(event)` | **
|
|
13
|
+
| `client.publishEvent(event)` | **relay** | Publish a Nostr event (e.g. `kind:1`) to the relay. |
|
|
14
14
|
| `requestBlobStorage(client, …)` | **store** | NIP-90 compute/storage. Builds and publishes a `kind:5094` event that uploads a blob to Arweave — the job request **is** the payment — and decodes the Arweave tx ID from the FULFILL response. |
|
|
15
15
|
| `client.sendSwapPacket(…)` | **swap** | Multi-chain token swap (low-level). Most callers use the higher-level `streamSwap()` from `@toon-protocol/sdk`, which is built on `sendSwapPacket`. |
|
|
16
16
|
|
|
@@ -304,7 +304,7 @@ See [examples/client-example/](../../examples/client-example/) for standalone cl
|
|
|
304
304
|
## Related Packages
|
|
305
305
|
|
|
306
306
|
- **[@toon-protocol/core](../core/)** — Core protocol (peer discovery, bootstrap, `buildBlobStorageRequest`)
|
|
307
|
-
- **[@toon-protocol/relay](../relay/)** — Operator product running the apex connector plus
|
|
307
|
+
- **[@toon-protocol/relay](../relay/)** — Operator product running the apex connector plus relay/swap/store nodes; also exports `encodeEventToToon` / `decodeEventFromToon` for event encoding
|
|
308
308
|
- **[@toon-protocol/sdk](../sdk/)** — Higher-level helpers including `streamSwap()` for multi-chain swaps via a **swap**
|
|
309
309
|
- **[@toon-protocol/bls](../bls/)** — Business Logic Server (pricing, validation, storage)
|
|
310
310
|
|
package/dist/index.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ interface SolanaChannelClientOptions {
|
|
|
61
61
|
* the connector's `Poseidon([balA,balB,salt]) / Poseidon(zkApp.x)` commitment
|
|
62
62
|
* (verified field-by-field against the connector's o1js verify). A
|
|
63
63
|
* Mina-denominated paid publish is ACCEPTED at `validateClaimMessage` and the
|
|
64
|
-
* apex FULFILLs to
|
|
64
|
+
* apex FULFILLs to relay. On-chain SETTLE remains gated for non-EVM dynamic
|
|
65
65
|
* hidden-service peers by connector#88 (`No chain configured for peer`).
|
|
66
66
|
* `zkAppAddress` must be a REAL deployed payment-channel zkApp the apex's Mina
|
|
67
67
|
* provider can resolve on-chain (the e2e harness deploys it deterministically).
|
package/dist/index.js
CHANGED
|
@@ -4145,8 +4145,7 @@ var Http402Client = class {
|
|
|
4145
4145
|
claim
|
|
4146
4146
|
);
|
|
4147
4147
|
} finally {
|
|
4148
|
-
await btp.disconnect().catch(() =>
|
|
4149
|
-
});
|
|
4148
|
+
await btp.disconnect().catch(() => void 0);
|
|
4150
4149
|
}
|
|
4151
4150
|
}
|
|
4152
4151
|
if (choice.kind === "btp") {
|
|
@@ -5026,7 +5025,9 @@ var ToonClient = class {
|
|
|
5026
5025
|
const tokens = this.config.preferredTokens;
|
|
5027
5026
|
if (evmAddress && rpcUrls && tokens) {
|
|
5028
5027
|
const chainKeys = this.config.supportedChains ?? Object.keys(rpcUrls);
|
|
5029
|
-
const
|
|
5028
|
+
const usableEvm = (c) => c.startsWith("evm") && Boolean(rpcUrls[c]) && Boolean(tokens[c]);
|
|
5029
|
+
const settlementKeys = Object.keys(this.config.settlementAddresses ?? {});
|
|
5030
|
+
const chainKey = settlementKeys.find((c) => usableEvm(c)) ?? chainKeys.find(usableEvm);
|
|
5030
5031
|
const rpcUrl = chainKey ? rpcUrls[chainKey] : void 0;
|
|
5031
5032
|
const tokenAddress = chainKey ? tokens[chainKey] : void 0;
|
|
5032
5033
|
if (chainKey && rpcUrl && tokenAddress) {
|