@toon-protocol/sdk 0.5.0 → 0.6.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 -19
- package/dist/chunk-XTHUXP63.js +1637 -0
- package/dist/chunk-XTHUXP63.js.map +1 -0
- package/dist/index.d.ts +1960 -0
- package/dist/index.js +1187 -301
- package/dist/index.js.map +1 -1
- package/dist/swap-D4Ozr_BM.d.ts +484 -0
- package/dist/swap.d.ts +3 -0
- package/dist/swap.js +14 -0
- package/dist/swap.js.map +1 -0
- package/package.json +23 -18
package/README.md
CHANGED
|
@@ -80,28 +80,28 @@ The SDK is the framework layer. You bring handlers; it handles the protocol.
|
|
|
80
80
|
|
|
81
81
|
## API Overview
|
|
82
82
|
|
|
83
|
-
| Export
|
|
84
|
-
|
|
85
|
-
| `createNode(config)`
|
|
86
|
-
| `fromMnemonic(phrase)`
|
|
87
|
-
| `fromSecretKey(key)`
|
|
88
|
-
| `generateMnemonic()`
|
|
89
|
-
| `HandlerRegistry`
|
|
90
|
-
| `createHandlerContext()`
|
|
91
|
-
| `createVerificationPipeline()` | Schnorr signature verifier
|
|
92
|
-
| `createPricingValidator()`
|
|
83
|
+
| Export | Purpose |
|
|
84
|
+
| ------------------------------ | ------------------------------------ |
|
|
85
|
+
| `createNode(config)` | Compose a full service node |
|
|
86
|
+
| `fromMnemonic(phrase)` | Derive identity from BIP-39 mnemonic |
|
|
87
|
+
| `fromSecretKey(key)` | Derive identity from raw secret key |
|
|
88
|
+
| `generateMnemonic()` | Generate a new 12-word mnemonic |
|
|
89
|
+
| `HandlerRegistry` | Kind-based handler routing |
|
|
90
|
+
| `createHandlerContext()` | Build handler context objects |
|
|
91
|
+
| `createVerificationPipeline()` | Schnorr signature verifier |
|
|
92
|
+
| `createPricingValidator()` | Payment amount validator |
|
|
93
93
|
|
|
94
94
|
## Key Concepts
|
|
95
95
|
|
|
96
|
-
| Concept
|
|
97
|
-
|
|
98
|
-
| **Unified identity**
|
|
99
|
-
| **Handler pattern**
|
|
100
|
-
| **Self-write bypass**
|
|
101
|
-
| **Dev mode**
|
|
102
|
-
| **[TOON](https://github.com/toon-format/toon) encoding** | Events encoded in compact text format, not JSON
|
|
103
|
-
| **Address assignment**
|
|
104
|
-
| **Invisible fee calculation**
|
|
96
|
+
| Concept | Description |
|
|
97
|
+
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
98
|
+
| **Unified identity** | One secp256k1 key produces both a [Nostr](https://github.com/nostr-protocol/nips) pubkey and an EVM address |
|
|
99
|
+
| **Handler pattern** | `ctx.accept()` / `ctx.reject()` — handlers respond, not return |
|
|
100
|
+
| **Self-write bypass** | Events from your own pubkey skip pricing |
|
|
101
|
+
| **Dev mode** | Skip verification and pricing for testing |
|
|
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 |
|
|
105
105
|
|
|
106
106
|
## Full Documentation
|
|
107
107
|
|