@xyo-network/xl1-protocol-lib 1.28.0 → 1.28.3
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 +103 -6
- package/package.json +49 -49
package/README.md
CHANGED
|
@@ -1,24 +1,121 @@
|
|
|
1
|
+
[![logo][]][logo-link]
|
|
2
|
+
|
|
1
3
|
# @xyo-network/xl1-protocol-lib
|
|
2
4
|
|
|
3
|
-
[![npm
|
|
4
|
-
[![license
|
|
5
|
+
[![npm-badge][]][npm-link]
|
|
6
|
+
[![license-badge][]][license-link]
|
|
7
|
+
|
|
8
|
+
> The runtime contract layer for XL1 — viewer, runner, repository, and provider interfaces.
|
|
9
|
+
|
|
10
|
+
## About
|
|
11
|
+
|
|
12
|
+
This is the "contract" layer of the XL1 protocol. It bridges the pure types in [`@xyo-network/xl1-protocol-model`](https://www.npmjs.com/package/@xyo-network/xl1-protocol-model) to the interfaces that runtime code depends on. Concrete implementations live in [`@xyo-network/xl1-protocol-sdk`](https://www.npmjs.com/package/@xyo-network/xl1-protocol-sdk) and [`@xyo-network/xl1-providers`](https://www.npmjs.com/package/@xyo-network/xl1-providers).
|
|
5
13
|
|
|
6
|
-
|
|
14
|
+
Most consumers reach this package via the [`@xyo-network/xl1-protocol`](https://www.npmjs.com/package/@xyo-network/xl1-protocol) aggregate. Install it directly when you're authoring a new viewer/runner implementation and only need the contracts.
|
|
7
15
|
|
|
8
16
|
## Install
|
|
9
17
|
|
|
18
|
+
Using npm:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm i --save @xyo-network/xl1-protocol-lib
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Using yarn:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
yarn add @xyo-network/xl1-protocol-lib
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Using pnpm:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
pnpm add @xyo-network/xl1-protocol-lib
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Using bun:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
bun add @xyo-network/xl1-protocol-lib
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Viewer Interface Pattern
|
|
43
|
+
|
|
44
|
+
Each viewer has three parts: a Methods interface (the RPC-exposable subset), a Moniker constant (for provider registration), and a full Viewer interface combining the two.
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
export interface BlockViewerMethods {
|
|
48
|
+
blocksByHash(hash: Hash, limit?: number): Promisable<SignedHydratedBlockWithHashMeta[]>
|
|
49
|
+
currentBlock(): Promisable<SignedHydratedBlockWithHashMeta>
|
|
50
|
+
payloadsByHash(hash: Hash[]): Promisable<PayloadMap>
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const BlockViewerMoniker = 'BlockViewer' as const
|
|
54
|
+
export type BlockViewerMoniker = typeof BlockViewerMoniker
|
|
55
|
+
|
|
56
|
+
export interface BlockViewer<TMoniker extends ProviderMoniker = BlockViewerMoniker>
|
|
57
|
+
extends BlockViewerMethods, Provider<TMoniker> {
|
|
58
|
+
blockByHash(hash: Hash): Promisable<SignedHydratedBlockWithHashMeta | null>
|
|
59
|
+
currentBlockNumber(): Promisable<XL1BlockNumber>
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## What's Inside
|
|
64
|
+
|
|
65
|
+
- **25+ Viewers** — block, account-balance, stake, finalization, mempool, network, time, transaction, and the composite `XyoViewer` aggregator
|
|
66
|
+
- **Runners** — block, finalization, mempool, dead-letter-queue, stake; produce/finalize/submit/prune operations
|
|
67
|
+
- **Repositories** — generic `ReadRepository` / `WriteRepository` / `IterableRepository` plus payload- and transaction-specific variants
|
|
68
|
+
- **Providers** — `XyoConnection`, `XyoGateway` / `XyoGatewayRunner`, `XyoNetwork`, `XyoSigner`, `DataLakeProvider`, `TransactionHelper`
|
|
69
|
+
- **Permissions** — EIP-2255 invoker permissions and `XyoPermissions` (get/request/revoke)
|
|
70
|
+
|
|
71
|
+
## Building Locally
|
|
72
|
+
|
|
10
73
|
```sh
|
|
11
|
-
|
|
74
|
+
xy build @xyo-network/xl1-protocol-lib
|
|
75
|
+
xy test @xyo-network/xl1-protocol-lib
|
|
76
|
+
xy lint @xyo-network/xl1-protocol-lib
|
|
12
77
|
```
|
|
13
78
|
|
|
79
|
+
## Maintainers
|
|
80
|
+
|
|
81
|
+
<table>
|
|
82
|
+
<tr>
|
|
83
|
+
<td align="center" valign="top" width="120" bgcolor="#000000" style="background-color:#000000;">
|
|
84
|
+
<a href="https://github.com/arietrouw">
|
|
85
|
+
<img src="https://github.com/arietrouw.png" width="80" height="80" alt="Arie Trouw" /><br />
|
|
86
|
+
<sub><b>Arie Trouw</b></sub>
|
|
87
|
+
</a>
|
|
88
|
+
<br />
|
|
89
|
+
<a href="https://arietrouw.com">arietrouw.com</a>
|
|
90
|
+
</td>
|
|
91
|
+
<td align="center" valign="top" width="120" bgcolor="#000000" style="background-color:#000000;">
|
|
92
|
+
<a href="https://github.com/jonesmac">
|
|
93
|
+
<img src="https://github.com/jonesmac.png" width="80" height="80" alt="Matt Jones" /><br />
|
|
94
|
+
<sub><b>Matt Jones</b></sub>
|
|
95
|
+
</a>
|
|
96
|
+
</td>
|
|
97
|
+
<td align="center" valign="top" width="120" bgcolor="#000000" style="background-color:#000000;">
|
|
98
|
+
<a href="https://github.com/JoelBCarter">
|
|
99
|
+
<img src="https://github.com/JoelBCarter.png" width="80" height="80" alt="Joel Carter" /><br />
|
|
100
|
+
<sub><b>Joel Carter</b></sub>
|
|
101
|
+
</a>
|
|
102
|
+
</td>
|
|
103
|
+
</tr>
|
|
104
|
+
</table>
|
|
14
105
|
|
|
15
106
|
## License
|
|
16
107
|
|
|
17
|
-
See the [LICENSE](LICENSE) file
|
|
108
|
+
See the [LICENSE](./LICENSE) file (LGPL-3.0-only).
|
|
18
109
|
|
|
110
|
+
## Credits
|
|
19
111
|
|
|
112
|
+
[Made with 🔥 and ❄️ by XYO](https://xyo.network)
|
|
113
|
+
|
|
114
|
+
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
115
|
+
[logo-link]: https://xyo.network
|
|
20
116
|
|
|
21
117
|
[npm-badge]: https://img.shields.io/npm/v/@xyo-network/xl1-protocol-lib.svg
|
|
22
118
|
[npm-link]: https://www.npmjs.com/package/@xyo-network/xl1-protocol-lib
|
|
119
|
+
|
|
23
120
|
[license-badge]: https://img.shields.io/npm/l/@xyo-network/xl1-protocol-lib.svg
|
|
24
|
-
[license-link]:
|
|
121
|
+
[license-link]: ./LICENSE
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/xl1-protocol-lib",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.3",
|
|
4
4
|
"description": "XYO Layer One Protocol",
|
|
5
5
|
"homepage": "https://xylabs.com",
|
|
6
6
|
"bugs": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"README.md"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@xyo-network/xl1-protocol-model": "~1.28.
|
|
37
|
+
"@xyo-network/xl1-protocol-model": "~1.28.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@bitauth/libauth": "~3.0.0",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@xylabs/geo": "^5.1.1",
|
|
47
47
|
"@xylabs/sdk-js": "^5.1.1",
|
|
48
48
|
"@xylabs/threads": "~5.1.1",
|
|
49
|
-
"@xylabs/toolchain": "~7.13.
|
|
50
|
-
"@xylabs/tsconfig": "~7.13.
|
|
49
|
+
"@xylabs/toolchain": "~7.13.13",
|
|
50
|
+
"@xylabs/tsconfig": "~7.13.13",
|
|
51
51
|
"@xyo-network/account": "~5.6.1",
|
|
52
52
|
"@xyo-network/account-model": "~5.6.2",
|
|
53
53
|
"@xyo-network/api": "~5.6.1",
|
|
@@ -90,51 +90,51 @@
|
|
|
90
90
|
"zod": "~4.4.3"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
|
-
"@bitauth/libauth": "
|
|
94
|
-
"@metamask/providers": "
|
|
95
|
-
"@opentelemetry/api": "
|
|
96
|
-
"@opentelemetry/sdk-trace-base": "
|
|
97
|
-
"@scure/base": "
|
|
98
|
-
"@scure/bip39": "
|
|
99
|
-
"@xylabs/geo": "
|
|
100
|
-
"@xylabs/sdk-js": "
|
|
101
|
-
"@xylabs/threads": "
|
|
102
|
-
"@xyo-network/account": "
|
|
103
|
-
"@xyo-network/account-model": "
|
|
104
|
-
"@xyo-network/api": "
|
|
105
|
-
"@xyo-network/api-models": "
|
|
106
|
-
"@xyo-network/boundwitness-builder": "
|
|
107
|
-
"@xyo-network/boundwitness-model": "
|
|
108
|
-
"@xyo-network/boundwitness-wrapper": "
|
|
109
|
-
"@xyo-network/config-payload-plugin": "
|
|
110
|
-
"@xyo-network/huri": "
|
|
111
|
-
"@xyo-network/manifest-model": "
|
|
112
|
-
"@xyo-network/payload-builder": "
|
|
113
|
-
"@xyo-network/payload-model": "
|
|
114
|
-
"@xyo-network/payload-plugin": "
|
|
115
|
-
"@xyo-network/payload-wrapper": "
|
|
116
|
-
"@xyo-network/query-payload-plugin": "
|
|
117
|
-
"@xyo-network/sdk-js": "
|
|
118
|
-
"@xyo-network/sdk-protocol-js": "
|
|
119
|
-
"@xyo-network/wallet": "
|
|
120
|
-
"@xyo-network/wallet-model": "
|
|
121
|
-
"ajv": "
|
|
122
|
-
"async-mutex": "
|
|
123
|
-
"bn.js": "
|
|
124
|
-
"buffer": "
|
|
125
|
-
"chalk": "
|
|
126
|
-
"debug": "
|
|
127
|
-
"ethers": "
|
|
128
|
-
"hash-wasm": "
|
|
129
|
-
"idb": "
|
|
130
|
-
"lru-cache": "
|
|
131
|
-
"mapbox-gl": "
|
|
132
|
-
"observable-fns": "
|
|
133
|
-
"pako": "
|
|
134
|
-
"store2": "
|
|
135
|
-
"wasm-feature-detect": "
|
|
136
|
-
"webextension-polyfill": "
|
|
137
|
-
"zod": "
|
|
93
|
+
"@bitauth/libauth": "~3.0",
|
|
94
|
+
"@metamask/providers": "^22.1",
|
|
95
|
+
"@opentelemetry/api": "^1.9",
|
|
96
|
+
"@opentelemetry/sdk-trace-base": "^2.7",
|
|
97
|
+
"@scure/base": "~2.2",
|
|
98
|
+
"@scure/bip39": "~2.2",
|
|
99
|
+
"@xylabs/geo": "^5.1",
|
|
100
|
+
"@xylabs/sdk-js": "^5.1",
|
|
101
|
+
"@xylabs/threads": "~5.1",
|
|
102
|
+
"@xyo-network/account": "~5.6",
|
|
103
|
+
"@xyo-network/account-model": "~5.6",
|
|
104
|
+
"@xyo-network/api": "~5.6",
|
|
105
|
+
"@xyo-network/api-models": "~5.6",
|
|
106
|
+
"@xyo-network/boundwitness-builder": "~5.6",
|
|
107
|
+
"@xyo-network/boundwitness-model": "~5.6",
|
|
108
|
+
"@xyo-network/boundwitness-wrapper": "~5.6",
|
|
109
|
+
"@xyo-network/config-payload-plugin": "~5.6",
|
|
110
|
+
"@xyo-network/huri": "~5.6",
|
|
111
|
+
"@xyo-network/manifest-model": "~5.6",
|
|
112
|
+
"@xyo-network/payload-builder": "~5.6",
|
|
113
|
+
"@xyo-network/payload-model": "~5.6",
|
|
114
|
+
"@xyo-network/payload-plugin": "~5.6",
|
|
115
|
+
"@xyo-network/payload-wrapper": "~5.6",
|
|
116
|
+
"@xyo-network/query-payload-plugin": "~5.6",
|
|
117
|
+
"@xyo-network/sdk-js": "^5.6",
|
|
118
|
+
"@xyo-network/sdk-protocol-js": "~5.6",
|
|
119
|
+
"@xyo-network/wallet": "~5.6",
|
|
120
|
+
"@xyo-network/wallet-model": "^5.6",
|
|
121
|
+
"ajv": "^8.20",
|
|
122
|
+
"async-mutex": "^0.5",
|
|
123
|
+
"bn.js": "^5.2",
|
|
124
|
+
"buffer": "^6.0",
|
|
125
|
+
"chalk": "^5.6",
|
|
126
|
+
"debug": "~4.4",
|
|
127
|
+
"ethers": "^6.16",
|
|
128
|
+
"hash-wasm": "~4.12",
|
|
129
|
+
"idb": "^8.0",
|
|
130
|
+
"lru-cache": "^11.3",
|
|
131
|
+
"mapbox-gl": "^3.23",
|
|
132
|
+
"observable-fns": "~0.6",
|
|
133
|
+
"pako": "^2.1",
|
|
134
|
+
"store2": "~2.14",
|
|
135
|
+
"wasm-feature-detect": "~1.8",
|
|
136
|
+
"webextension-polyfill": "^0.12",
|
|
137
|
+
"zod": "~4.4"
|
|
138
138
|
},
|
|
139
139
|
"engines": {
|
|
140
140
|
"node": ">=22.3"
|