@xyo-network/xl1-rpc 1.27.1 → 1.28.2

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.
Files changed (2) hide show
  1. package/README.md +102 -6
  2. package/package.json +58 -58
package/README.md CHANGED
@@ -1,24 +1,120 @@
1
+ [![logo][]][logo-link]
2
+
1
3
  # @xyo-network/xl1-rpc
2
4
 
3
- [![npm][npm-badge]][npm-link]
4
- [![license][license-badge]][license-link]
5
+ [![npm-badge][]][npm-link]
6
+ [![license-badge][]][license-link]
7
+
8
+ > JSON-RPC layer for XL1 — maps protocol viewers and runners to network-callable methods over HTTP, postMessage, or in-memory transports.
9
+
10
+ ## About
5
11
 
6
- > XYO Layer One API
12
+ This package bridges XL1 protocol interfaces (from [`@xyo-network/xl1-protocol-lib`](https://www.npmjs.com/package/@xyo-network/xl1-protocol-lib)) to JSON-RPC. It builds on `@metamask/json-rpc-engine` and provides Zod-based serialization for both request params and responses, a registry of all RPC schemas, engine handler factories, and four transport implementations.
13
+
14
+ Most consumers reach this package via the [`@xyo-network/xl1-sdk`](https://www.npmjs.com/package/@xyo-network/xl1-sdk) aggregate. Install directly when you're building an RPC client/server or implementing a custom transport.
7
15
 
8
16
  ## Install
9
17
 
18
+ Using npm:
19
+
20
+ ```sh
21
+ npm i --save @xyo-network/xl1-rpc
22
+ ```
23
+
24
+ Using yarn:
25
+
10
26
  ```sh
11
- {{pm}} add {{name}}
27
+ yarn add @xyo-network/xl1-rpc
12
28
  ```
13
29
 
30
+ Using pnpm:
31
+
32
+ ```sh
33
+ pnpm add @xyo-network/xl1-rpc
34
+ ```
35
+
36
+ Using bun:
37
+
38
+ ```sh
39
+ bun add @xyo-network/xl1-rpc
40
+ ```
41
+
42
+ ## Build Targets
43
+
44
+ This package ships both neutral/browser and Node-specific bundles. The Node bundle adds `rpcEngineFromConnection` for server-side setup.
45
+
46
+ ## What's Inside
47
+
48
+ **Type system**
49
+
50
+ - 25 RPC type-mapping files deriving `${viewer}_${method}` names and handler types from each viewer's `Methods` interface
51
+ - 22 Zod schema maps with `to`/`from` serialization transforms for request and response
52
+ - `AllRpcSchemas` — aggregate registry of every schema, used by transports for auto-validation
53
+
54
+ **Engine handlers**
55
+
56
+ - 16 `rpcMethodHandlersFrom*` factories that adapt a viewer/runner instance into JSON-RPC method handlers
57
+ - `rpcMethodHandlersFromConnection` — full orchestrator that wires every handler from an `XyoConnection`
58
+
59
+ **Providers (client-side)**
60
+
61
+ - `JsonRpc*Viewer` and `JsonRpc*Runner` implementations that delegate to a transport
62
+ - `JsonRpcXyoViewer` — composite client viewer covering the full read surface
63
+
64
+ **Transports**
65
+
66
+ - `MemoryRpcTransport` — in-memory engine, useful for tests and same-process composition
67
+ - `HttpRpcTransport` — HTTP/HTTPS transport
68
+ - `PostMessageRpcTransport` — cross-window messaging with `SessionEnvelope` and `MessageBus` abstraction (used by browser wallet integrations)
69
+
70
+ ## Building Locally
71
+
72
+ ```sh
73
+ xy build @xyo-network/xl1-rpc
74
+ xy test @xyo-network/xl1-rpc
75
+ xy lint @xyo-network/xl1-rpc
76
+ ```
77
+
78
+ ## Maintainers
79
+
80
+ <table>
81
+ <tr>
82
+ <td align="center" valign="top" width="120">
83
+ <a href="https://github.com/arietrouw">
84
+ <img src="https://github.com/arietrouw.png" width="80" height="80" alt="Arie Trouw" /><br />
85
+ <sub><b>Arie Trouw</b></sub>
86
+ </a>
87
+ <br />
88
+ <a href="https://arietrouw.com">arietrouw.com</a>
89
+ </td>
90
+ <td align="center" valign="top" width="120">
91
+ <a href="https://github.com/jonesmac">
92
+ <img src="https://github.com/jonesmac.png" width="80" height="80" alt="Matt Jones" /><br />
93
+ <sub><b>Matt Jones</b></sub>
94
+ </a>
95
+ </td>
96
+ <td align="center" valign="top" width="120">
97
+ <a href="https://github.com/JoelBCarter">
98
+ <img src="https://github.com/JoelBCarter.png" width="80" height="80" alt="Joel Carter" /><br />
99
+ <sub><b>Joel Carter</b></sub>
100
+ </a>
101
+ </td>
102
+ </tr>
103
+ </table>
14
104
 
15
105
  ## License
16
106
 
17
- See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
107
+ See the [LICENSE](./LICENSE) file (LGPL-3.0-only).
18
108
 
109
+ ## Credits
19
110
 
111
+ [Made with 🔥 and ❄️ by XYO](https://xyo.network)
112
+
113
+ [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
114
+ [logo-link]: https://xyo.network
20
115
 
21
116
  [npm-badge]: https://img.shields.io/npm/v/@xyo-network/xl1-rpc.svg
22
117
  [npm-link]: https://www.npmjs.com/package/@xyo-network/xl1-rpc
118
+
23
119
  [license-badge]: https://img.shields.io/npm/l/@xyo-network/xl1-rpc.svg
24
- [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
120
+ [license-link]: ./LICENSE
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/package.json",
3
3
  "name": "@xyo-network/xl1-rpc",
4
- "version": "1.27.1",
4
+ "version": "1.28.2",
5
5
  "description": "XYO Layer One API",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -45,8 +45,8 @@
45
45
  "README.md"
46
46
  ],
47
47
  "dependencies": {
48
- "@xyo-network/xl1-protocol-lib": "~1.27.1",
49
- "@xyo-network/xl1-protocol-sdk": "~1.27.1"
48
+ "@xyo-network/xl1-protocol-sdk": "~1.28.2",
49
+ "@xyo-network/xl1-protocol-lib": "~1.28.2"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@bitauth/libauth": "~3.0.0",
@@ -61,8 +61,8 @@
61
61
  "@xylabs/geo": "^5.1.1",
62
62
  "@xylabs/sdk-js": "^5.1.1",
63
63
  "@xylabs/threads": "~5.1.1",
64
- "@xylabs/toolchain": "~7.13.4",
65
- "@xylabs/tsconfig": "~7.13.4",
64
+ "@xylabs/toolchain": "~7.13.13",
65
+ "@xylabs/tsconfig": "~7.13.13",
66
66
  "@xyo-network/account": "~5.6.1",
67
67
  "@xyo-network/account-model": "~5.6.2",
68
68
  "@xyo-network/api": "~5.6.1",
@@ -81,7 +81,7 @@
81
81
  "@xyo-network/sdk-js": "^5.6.3",
82
82
  "@xyo-network/sdk-protocol-js": "~5.6.2",
83
83
  "@xyo-network/wallet": "~5.6.1",
84
- "@xyo-network/wallet-model": "~5.6.2",
84
+ "@xyo-network/wallet-model": "^5.6.2",
85
85
  "ajv": "^8.20.0",
86
86
  "async-mutex": "^0.5.0",
87
87
  "bn.js": "^5.2.3",
@@ -97,7 +97,7 @@
97
97
  "lru-cache": "^11.3.6",
98
98
  "mapbox-gl": "^3.23.1",
99
99
  "observable-fns": "~0.6.1",
100
- "pako": "~2.1.0",
100
+ "pako": "^2.1.0",
101
101
  "store2": "~2.14.4",
102
102
  "tslib": "^2.8.1",
103
103
  "typescript": "~5.9.3",
@@ -107,59 +107,59 @@
107
107
  "wasm-feature-detect": "~1.8.0",
108
108
  "webextension-polyfill": "^0.12.0",
109
109
  "zod": "~4.4.3",
110
- "@xyo-network/xl1-test": "~1.27.1"
110
+ "@xyo-network/xl1-test": "~1.28.2"
111
111
  },
112
112
  "peerDependencies": {
113
- "@bitauth/libauth": ">=3.0.0 <3.1",
114
- "@metamask/json-rpc-engine": ">=10.3.0 <11",
115
- "@metamask/providers": ">=22.1.1 <23",
116
- "@metamask/utils": ">=11.11.0 <12",
117
- "@opentelemetry/api": ">=1.9.1 <2",
118
- "@opentelemetry/sdk-trace-base": ">=2.7.1 <3",
119
- "@scure/base": ">=2.2.0 <2.3",
120
- "@scure/bip39": ">=2.2.0 <2.3",
121
- "@xylabs/fetch": ">=5.1.1 <6",
122
- "@xylabs/geo": ">=5.1.1 <6",
123
- "@xylabs/sdk-js": ">=5.1.1 <6",
124
- "@xylabs/threads": ">=5.1.1 <5.2",
125
- "@xyo-network/account": ">=5.6.1 <5.7",
126
- "@xyo-network/account-model": ">=5.6.2 <5.7",
127
- "@xyo-network/api": ">=5.6.1 <5.7",
128
- "@xyo-network/api-models": ">=5.6.2 <5.7",
129
- "@xyo-network/boundwitness-builder": ">=5.6.1 <5.7",
130
- "@xyo-network/boundwitness-model": ">=5.6.2 <5.7",
131
- "@xyo-network/boundwitness-wrapper": ">=5.6.1 <5.7",
132
- "@xyo-network/config-payload-plugin": ">=5.6.2 <5.7",
133
- "@xyo-network/huri": ">=5.6.1 <5.7",
134
- "@xyo-network/manifest-model": ">=5.6.2 <5.7",
135
- "@xyo-network/payload-builder": ">=5.6.1 <5.7",
136
- "@xyo-network/payload-model": ">=5.6.2 <5.7",
137
- "@xyo-network/payload-plugin": ">=5.6.2 <5.7",
138
- "@xyo-network/payload-wrapper": ">=5.6.1 <5.7",
139
- "@xyo-network/query-payload-plugin": ">=5.6.2 <5.7",
140
- "@xyo-network/sdk-js": ">=5.6.3 <6",
141
- "@xyo-network/sdk-protocol-js": ">=5.6.2 <5.7",
142
- "@xyo-network/wallet": ">=5.6.1 <5.7",
143
- "@xyo-network/wallet-model": ">=5.6.2 <5.7",
144
- "ajv": ">=8.20.0 <9",
145
- "async-mutex": ">=0.5.0 <1",
146
- "bn.js": ">=5.2.3 <6",
147
- "buffer": ">=6.0.3 <7",
148
- "chalk": ">=5.6.2 <6",
149
- "cosmiconfig": ">=9.0.1 <10",
150
- "debug": ">=4.4.3 <4.5",
151
- "ethers": ">=6.16.0 <7",
152
- "hash-wasm": ">=4.12.0 <4.13",
153
- "idb": ">=8.0.3 <9",
154
- "lru-cache": ">=11.3.6 <12",
155
- "mapbox-gl": ">=3.23.1 <4",
156
- "observable-fns": ">=0.6.1 <0.7",
157
- "pako": ">=2.1.0 <2.2",
158
- "store2": ">=2.14.4 <2.15",
159
- "uuid": ">=14.0.0 <14.1",
160
- "wasm-feature-detect": ">=1.8.0 <1.9",
161
- "webextension-polyfill": ">=0.12.0 <1",
162
- "zod": ">=4.4.3 <4.5"
113
+ "@bitauth/libauth": "~3.0",
114
+ "@metamask/json-rpc-engine": "^10.3",
115
+ "@metamask/providers": "^22.1",
116
+ "@metamask/utils": "^11.11",
117
+ "@opentelemetry/api": "^1.9",
118
+ "@opentelemetry/sdk-trace-base": "^2.7",
119
+ "@scure/base": "~2.2",
120
+ "@scure/bip39": "~2.2",
121
+ "@xylabs/fetch": "^5.1",
122
+ "@xylabs/geo": "^5.1",
123
+ "@xylabs/sdk-js": "^5.1",
124
+ "@xylabs/threads": "~5.1",
125
+ "@xyo-network/account": "~5.6",
126
+ "@xyo-network/account-model": "~5.6",
127
+ "@xyo-network/api": "~5.6",
128
+ "@xyo-network/api-models": "~5.6",
129
+ "@xyo-network/boundwitness-builder": "~5.6",
130
+ "@xyo-network/boundwitness-model": "~5.6",
131
+ "@xyo-network/boundwitness-wrapper": "~5.6",
132
+ "@xyo-network/config-payload-plugin": "~5.6",
133
+ "@xyo-network/huri": "~5.6",
134
+ "@xyo-network/manifest-model": "~5.6",
135
+ "@xyo-network/payload-builder": "~5.6",
136
+ "@xyo-network/payload-model": "~5.6",
137
+ "@xyo-network/payload-plugin": "~5.6",
138
+ "@xyo-network/payload-wrapper": "~5.6",
139
+ "@xyo-network/query-payload-plugin": "~5.6",
140
+ "@xyo-network/sdk-js": "^5.6",
141
+ "@xyo-network/sdk-protocol-js": "~5.6",
142
+ "@xyo-network/wallet": "~5.6",
143
+ "@xyo-network/wallet-model": "^5.6",
144
+ "ajv": "^8.20",
145
+ "async-mutex": "^0.5",
146
+ "bn.js": "^5.2",
147
+ "buffer": "^6.0",
148
+ "chalk": "^5.6",
149
+ "cosmiconfig": "^9.0",
150
+ "debug": "~4.4",
151
+ "ethers": "^6.16",
152
+ "hash-wasm": "~4.12",
153
+ "idb": "^8.0",
154
+ "lru-cache": "^11.3",
155
+ "mapbox-gl": "^3.23",
156
+ "observable-fns": "~0.6",
157
+ "pako": "^2.1",
158
+ "store2": "~2.14",
159
+ "uuid": "~14.0",
160
+ "wasm-feature-detect": "~1.8",
161
+ "webextension-polyfill": "^0.12",
162
+ "zod": "~4.4"
163
163
  },
164
164
  "engines": {
165
165
  "node": ">=22"