@toon-protocol/sdk 0.1.5 → 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
@@ -1,6 +1,6 @@
1
1
  # @toon-protocol/sdk
2
2
 
3
- The building blocks for creating services that participate in the TOON network.
3
+ The building blocks for creating services that participate in the TOON Protocol network. Events are encoded in [TOON format](https://github.com/toon-format/toon) and discovered via [Nostr](https://github.com/nostr-protocol/nips).
4
4
 
5
5
  ## What It Does
6
6
 
@@ -60,7 +60,7 @@ const result = await node.start();
60
60
  console.log(`Connected to ${result.peerCount} peers`);
61
61
  ```
62
62
 
63
- > **Easier path:** If you just want to run a relay, use [`@toon-protocol/town`](../town) — it manages the connector externally so you don't need to embed one. The SDK is for building custom services where you control the full pipeline.
63
+ > **Easier path:** If you just want to run a relay, use [`@toon-protocol/town`](../town) — it wraps the SDK with sensible defaults and runs out of the box. The SDK is for building custom services where you control the full pipeline.
64
64
 
65
65
  ## Where It Sits
66
66
 
@@ -95,11 +95,13 @@ The SDK is the framework layer. You bring handlers; it handles the protocol.
95
95
 
96
96
  | Concept | Description |
97
97
  |---------|-------------|
98
- | **Unified identity** | One secp256k1 key produces both a Nostr pubkey and an EVM address |
98
+ | **Unified identity** | One secp256k1 key produces both a [Nostr](https://github.com/nostr-protocol/nips) pubkey and an EVM address |
99
99
  | **Handler pattern** | `ctx.accept()` / `ctx.reject()` — handlers respond, not return |
100
100
  | **Self-write bypass** | Events from your own pubkey skip pricing |
101
101
  | **Dev mode** | Skip verification and pricing for testing |
102
- | **TOON encoding** | Events encoded in compact text format, not JSON |
102
+ | **[TOON](https://github.com/toon-format/toon) encoding** | Events encoded in compact text format, not JSON |
103
+ | **Address assignment** | ILP addresses are derived from peering topology — your upstream peer assigns your address automatically based on your pubkey. A node with multiple upstream peers has multiple addresses. See [Protocol — ILP Address Hierarchy](../../docs/protocol.md#ilp-address-hierarchy) |
104
+ | **Invisible fee calculation** | The SDK computes multi-hop fees internally. Each intermediary advertises a fee-per-byte; the SDK sums them along the route so `publishEvent()` callers pay one total amount |
103
105
 
104
106
  ## Full Documentation
105
107
 
@@ -0,0 +1,38 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
6
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
7
+ }) : x)(function(x) {
8
+ if (typeof require !== "undefined") return require.apply(this, arguments);
9
+ throw Error('Dynamic require of "' + x + '" is not supported');
10
+ });
11
+ var __esm = (fn, res) => function __init() {
12
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
13
+ };
14
+ var __commonJS = (cb, mod) => function __require2() {
15
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
+ };
17
+ var __export = (target, all) => {
18
+ for (var name in all)
19
+ __defProp(target, name, { get: all[name], enumerable: true });
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (let key of __getOwnPropNames(from))
24
+ if (!__hasOwnProp.call(to, key) && key !== except)
25
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
+ }
27
+ return to;
28
+ };
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ export {
32
+ __require,
33
+ __esm,
34
+ __commonJS,
35
+ __export,
36
+ __toCommonJS
37
+ };
38
+ //# sourceMappingURL=chunk-UP2VWCW5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}