@xyo-network/xl1-protocol-model 1.28.0 → 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.
- package/README.md +98 -6
- package/package.json +48 -48
package/README.md
CHANGED
|
@@ -1,24 +1,116 @@
|
|
|
1
|
+
[![logo][]][logo-link]
|
|
2
|
+
|
|
1
3
|
# @xyo-network/xl1-protocol-model
|
|
2
4
|
|
|
3
|
-
[![npm
|
|
4
|
-
[![license
|
|
5
|
+
[![npm-badge][]][npm-link]
|
|
6
|
+
[![license-badge][]][license-link]
|
|
7
|
+
|
|
8
|
+
> The foundational type system for the XL1 blockchain — Zod-first, zero workspace deps.
|
|
9
|
+
|
|
10
|
+
## About
|
|
11
|
+
|
|
12
|
+
This is the bottom of the XL1 protocol stack. Every other XL1 package depends on it, directly or transitively. It contains pure type definitions — no runtime logic beyond Zod schema declarations and factory-generated type guards — making it the single source of truth for the XL1 data model.
|
|
5
13
|
|
|
6
|
-
|
|
14
|
+
Most consumers reach this package indirectly via [`@xyo-network/xl1-protocol`](https://www.npmjs.com/package/@xyo-network/xl1-protocol) or [`@xyo-network/xl1-sdk`](https://www.npmjs.com/package/@xyo-network/xl1-sdk). Install it directly only if you need the raw types and want to keep your dependency graph minimal.
|
|
7
15
|
|
|
8
16
|
## Install
|
|
9
17
|
|
|
18
|
+
Using npm:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm i --save @xyo-network/xl1-protocol-model
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Using yarn:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
yarn add @xyo-network/xl1-protocol-model
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Using pnpm:
|
|
31
|
+
|
|
10
32
|
```sh
|
|
11
|
-
|
|
33
|
+
pnpm add @xyo-network/xl1-protocol-model
|
|
12
34
|
```
|
|
13
35
|
|
|
36
|
+
Using bun:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
bun add @xyo-network/xl1-protocol-model
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Zod-First Pattern
|
|
43
|
+
|
|
44
|
+
Every type in this package follows the same pattern: a Zod schema is the source of truth, with the TypeScript type and the guard/cast factories derived from it.
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import { zodAsFactory, zodIsFactory, zodToFactory } from '@xylabs/sdk-js'
|
|
48
|
+
import { z } from 'zod'
|
|
49
|
+
|
|
50
|
+
export const FooZod = z.object({ bar: z.string() }) // 1. schema
|
|
51
|
+
export type Foo = z.infer<typeof FooZod> // 2. derived type
|
|
52
|
+
export const isFoo = zodIsFactory(FooZod) // 3. type guard
|
|
53
|
+
export const asFoo = zodAsFactory(FooZod, 'asFoo') // 4. asserting cast
|
|
54
|
+
export const toFoo = zodToFactory(FooZod, 'toFoo') // 5. non-validating cast
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## What's Inside
|
|
58
|
+
|
|
59
|
+
- **Branded XL1 units** — `AttoXL1`, `FemtoXL1`, `PicoXL1`, `NanoXL1`, `MicroXL1`, `MilliXL1`, `XL1`
|
|
60
|
+
- **Block types** — `BlockBoundWitness`, `HydratedBlock`, signed/unsigned variants, `XL1BlockNumber`
|
|
61
|
+
- **Transaction types** — `TransactionBoundWitness` and `HydratedTransaction` with the full Signed/Unsigned × plain/WithHashMeta/WithStorageMeta variant matrix (9 combinations)
|
|
62
|
+
- **Domain models** — `AccountBalance`, `Chain`, `Permission`, `Position`, `Stake`, `TimeDomain`, `TransferPair`, and 20+ more
|
|
63
|
+
- **Provider primitives** — `Provider<TMoniker>`, `ProviderMoniker`
|
|
64
|
+
- **Payloads** — Bridge, Executable, Hash, StepComplete, Time, StepIdentity
|
|
65
|
+
|
|
66
|
+
## Building Locally
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
xy build @xyo-network/xl1-protocol-model
|
|
70
|
+
xy test @xyo-network/xl1-protocol-model
|
|
71
|
+
xy lint @xyo-network/xl1-protocol-model
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Maintainers
|
|
75
|
+
|
|
76
|
+
<table>
|
|
77
|
+
<tr>
|
|
78
|
+
<td align="center" valign="top" width="120">
|
|
79
|
+
<a href="https://github.com/arietrouw">
|
|
80
|
+
<img src="https://github.com/arietrouw.png" width="80" height="80" alt="Arie Trouw" /><br />
|
|
81
|
+
<sub><b>Arie Trouw</b></sub>
|
|
82
|
+
</a>
|
|
83
|
+
<br />
|
|
84
|
+
<a href="https://arietrouw.com">arietrouw.com</a>
|
|
85
|
+
</td>
|
|
86
|
+
<td align="center" valign="top" width="120">
|
|
87
|
+
<a href="https://github.com/jonesmac">
|
|
88
|
+
<img src="https://github.com/jonesmac.png" width="80" height="80" alt="Matt Jones" /><br />
|
|
89
|
+
<sub><b>Matt Jones</b></sub>
|
|
90
|
+
</a>
|
|
91
|
+
</td>
|
|
92
|
+
<td align="center" valign="top" width="120">
|
|
93
|
+
<a href="https://github.com/JoelBCarter">
|
|
94
|
+
<img src="https://github.com/JoelBCarter.png" width="80" height="80" alt="Joel Carter" /><br />
|
|
95
|
+
<sub><b>Joel Carter</b></sub>
|
|
96
|
+
</a>
|
|
97
|
+
</td>
|
|
98
|
+
</tr>
|
|
99
|
+
</table>
|
|
14
100
|
|
|
15
101
|
## License
|
|
16
102
|
|
|
17
|
-
See the [LICENSE](LICENSE) file
|
|
103
|
+
See the [LICENSE](./LICENSE) file (LGPL-3.0-only).
|
|
104
|
+
|
|
105
|
+
## Credits
|
|
18
106
|
|
|
107
|
+
[Made with 🔥 and ❄️ by XYO](https://xyo.network)
|
|
19
108
|
|
|
109
|
+
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
110
|
+
[logo-link]: https://xyo.network
|
|
20
111
|
|
|
21
112
|
[npm-badge]: https://img.shields.io/npm/v/@xyo-network/xl1-protocol-model.svg
|
|
22
113
|
[npm-link]: https://www.npmjs.com/package/@xyo-network/xl1-protocol-model
|
|
114
|
+
|
|
23
115
|
[license-badge]: https://img.shields.io/npm/l/@xyo-network/xl1-protocol-model.svg
|
|
24
|
-
[license-link]:
|
|
116
|
+
[license-link]: ./LICENSE
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/xl1-protocol-model",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.2",
|
|
4
4
|
"description": "XYO Layer One Protocol Model Types",
|
|
5
5
|
"homepage": "https://xylabs.com",
|
|
6
6
|
"bugs": {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@xylabs/geo": "^5.1.1",
|
|
44
44
|
"@xylabs/sdk-js": "^5.1.1",
|
|
45
45
|
"@xylabs/threads": "~5.1.1",
|
|
46
|
-
"@xylabs/toolchain": "~7.13.
|
|
47
|
-
"@xylabs/tsconfig": "~7.13.
|
|
46
|
+
"@xylabs/toolchain": "~7.13.13",
|
|
47
|
+
"@xylabs/tsconfig": "~7.13.13",
|
|
48
48
|
"@xyo-network/account": "~5.6.1",
|
|
49
49
|
"@xyo-network/account-model": "~5.6.2",
|
|
50
50
|
"@xyo-network/api": "~5.6.1",
|
|
@@ -87,51 +87,51 @@
|
|
|
87
87
|
"zod": "~4.4.3"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
-
"@bitauth/libauth": "
|
|
91
|
-
"@metamask/providers": "
|
|
92
|
-
"@opentelemetry/api": "
|
|
93
|
-
"@opentelemetry/sdk-trace-base": "
|
|
94
|
-
"@scure/base": "
|
|
95
|
-
"@scure/bip39": "
|
|
96
|
-
"@xylabs/geo": "
|
|
97
|
-
"@xylabs/sdk-js": "
|
|
98
|
-
"@xylabs/threads": "
|
|
99
|
-
"@xyo-network/account": "
|
|
100
|
-
"@xyo-network/account-model": "
|
|
101
|
-
"@xyo-network/api": "
|
|
102
|
-
"@xyo-network/api-models": "
|
|
103
|
-
"@xyo-network/boundwitness-builder": "
|
|
104
|
-
"@xyo-network/boundwitness-model": "
|
|
105
|
-
"@xyo-network/boundwitness-wrapper": "
|
|
106
|
-
"@xyo-network/config-payload-plugin": "
|
|
107
|
-
"@xyo-network/huri": "
|
|
108
|
-
"@xyo-network/manifest-model": "
|
|
109
|
-
"@xyo-network/payload-builder": "
|
|
110
|
-
"@xyo-network/payload-model": "
|
|
111
|
-
"@xyo-network/payload-plugin": "
|
|
112
|
-
"@xyo-network/payload-wrapper": "
|
|
113
|
-
"@xyo-network/query-payload-plugin": "
|
|
114
|
-
"@xyo-network/sdk-js": "
|
|
115
|
-
"@xyo-network/sdk-protocol-js": "
|
|
116
|
-
"@xyo-network/wallet": "
|
|
117
|
-
"@xyo-network/wallet-model": "
|
|
118
|
-
"ajv": "
|
|
119
|
-
"async-mutex": "
|
|
120
|
-
"bn.js": "
|
|
121
|
-
"buffer": "
|
|
122
|
-
"chalk": "
|
|
123
|
-
"debug": "
|
|
124
|
-
"ethers": "
|
|
125
|
-
"hash-wasm": "
|
|
126
|
-
"idb": "
|
|
127
|
-
"lru-cache": "
|
|
128
|
-
"mapbox-gl": "
|
|
129
|
-
"observable-fns": "
|
|
130
|
-
"pako": "
|
|
131
|
-
"store2": "
|
|
132
|
-
"wasm-feature-detect": "
|
|
133
|
-
"webextension-polyfill": "
|
|
134
|
-
"zod": "
|
|
90
|
+
"@bitauth/libauth": "~3.0",
|
|
91
|
+
"@metamask/providers": "^22.1",
|
|
92
|
+
"@opentelemetry/api": "^1.9",
|
|
93
|
+
"@opentelemetry/sdk-trace-base": "^2.7",
|
|
94
|
+
"@scure/base": "~2.2",
|
|
95
|
+
"@scure/bip39": "~2.2",
|
|
96
|
+
"@xylabs/geo": "^5.1",
|
|
97
|
+
"@xylabs/sdk-js": "^5.1",
|
|
98
|
+
"@xylabs/threads": "~5.1",
|
|
99
|
+
"@xyo-network/account": "~5.6",
|
|
100
|
+
"@xyo-network/account-model": "~5.6",
|
|
101
|
+
"@xyo-network/api": "~5.6",
|
|
102
|
+
"@xyo-network/api-models": "~5.6",
|
|
103
|
+
"@xyo-network/boundwitness-builder": "~5.6",
|
|
104
|
+
"@xyo-network/boundwitness-model": "~5.6",
|
|
105
|
+
"@xyo-network/boundwitness-wrapper": "~5.6",
|
|
106
|
+
"@xyo-network/config-payload-plugin": "~5.6",
|
|
107
|
+
"@xyo-network/huri": "~5.6",
|
|
108
|
+
"@xyo-network/manifest-model": "~5.6",
|
|
109
|
+
"@xyo-network/payload-builder": "~5.6",
|
|
110
|
+
"@xyo-network/payload-model": "~5.6",
|
|
111
|
+
"@xyo-network/payload-plugin": "~5.6",
|
|
112
|
+
"@xyo-network/payload-wrapper": "~5.6",
|
|
113
|
+
"@xyo-network/query-payload-plugin": "~5.6",
|
|
114
|
+
"@xyo-network/sdk-js": "^5.6",
|
|
115
|
+
"@xyo-network/sdk-protocol-js": "~5.6",
|
|
116
|
+
"@xyo-network/wallet": "~5.6",
|
|
117
|
+
"@xyo-network/wallet-model": "^5.6",
|
|
118
|
+
"ajv": "^8.20",
|
|
119
|
+
"async-mutex": "^0.5",
|
|
120
|
+
"bn.js": "^5.2",
|
|
121
|
+
"buffer": "^6.0",
|
|
122
|
+
"chalk": "^5.6",
|
|
123
|
+
"debug": "~4.4",
|
|
124
|
+
"ethers": "^6.16",
|
|
125
|
+
"hash-wasm": "~4.12",
|
|
126
|
+
"idb": "^8.0",
|
|
127
|
+
"lru-cache": "^11.3",
|
|
128
|
+
"mapbox-gl": "^3.23",
|
|
129
|
+
"observable-fns": "~0.6",
|
|
130
|
+
"pako": "^2.1",
|
|
131
|
+
"store2": "~2.14",
|
|
132
|
+
"wasm-feature-detect": "~1.8",
|
|
133
|
+
"webextension-polyfill": "^0.12",
|
|
134
|
+
"zod": "~4.4"
|
|
135
135
|
},
|
|
136
136
|
"engines": {
|
|
137
137
|
"node": ">=22.3"
|