@xyo-network/xl1-protocol-model 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 +98 -6
  2. package/package.json +50 -50
package/README.md CHANGED
@@ -1,24 +1,116 @@
1
+ [![logo][]][logo-link]
2
+
1
3
  # @xyo-network/xl1-protocol-model
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
+ > 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
- > XYO Layer One Protocol Model Types
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
- {{pm}} add {{name}}
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 for license rights and limitations (LGPL-3.0-only).
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]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
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.27.1",
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.4",
47
- "@xylabs/tsconfig": "~7.13.4",
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",
@@ -63,7 +63,7 @@
63
63
  "@xyo-network/sdk-js": "^5.6.3",
64
64
  "@xyo-network/sdk-protocol-js": "~5.6.2",
65
65
  "@xyo-network/wallet": "~5.6.1",
66
- "@xyo-network/wallet-model": "~5.6.2",
66
+ "@xyo-network/wallet-model": "^5.6.2",
67
67
  "ajv": "^8.20.0",
68
68
  "async-mutex": "^0.5.0",
69
69
  "bn.js": "^5.2.3",
@@ -77,7 +77,7 @@
77
77
  "lru-cache": "^11.3.6",
78
78
  "mapbox-gl": "^3.23.1",
79
79
  "observable-fns": "~0.6.1",
80
- "pako": "~2.1.0",
80
+ "pako": "^2.1.0",
81
81
  "store2": "~2.14.4",
82
82
  "typescript": "~5.9.3",
83
83
  "vite": "^8.0.10",
@@ -87,51 +87,51 @@
87
87
  "zod": "~4.4.3"
88
88
  },
89
89
  "peerDependencies": {
90
- "@bitauth/libauth": ">=3.0.0 <3.1",
91
- "@metamask/providers": ">=22.1.1 <23",
92
- "@opentelemetry/api": ">=1.9.1 <2",
93
- "@opentelemetry/sdk-trace-base": ">=2.7.1 <3",
94
- "@scure/base": ">=2.2.0 <2.3",
95
- "@scure/bip39": ">=2.2.0 <2.3",
96
- "@xylabs/geo": ">=5.1.1 <6",
97
- "@xylabs/sdk-js": ">=5.1.1 <6",
98
- "@xylabs/threads": ">=5.1.1 <5.2",
99
- "@xyo-network/account": ">=5.6.1 <5.7",
100
- "@xyo-network/account-model": ">=5.6.2 <5.7",
101
- "@xyo-network/api": ">=5.6.1 <5.7",
102
- "@xyo-network/api-models": ">=5.6.2 <5.7",
103
- "@xyo-network/boundwitness-builder": ">=5.6.1 <5.7",
104
- "@xyo-network/boundwitness-model": ">=5.6.2 <5.7",
105
- "@xyo-network/boundwitness-wrapper": ">=5.6.1 <5.7",
106
- "@xyo-network/config-payload-plugin": ">=5.6.2 <5.7",
107
- "@xyo-network/huri": ">=5.6.1 <5.7",
108
- "@xyo-network/manifest-model": ">=5.6.2 <5.7",
109
- "@xyo-network/payload-builder": ">=5.6.1 <5.7",
110
- "@xyo-network/payload-model": ">=5.6.2 <5.7",
111
- "@xyo-network/payload-plugin": ">=5.6.2 <5.7",
112
- "@xyo-network/payload-wrapper": ">=5.6.1 <5.7",
113
- "@xyo-network/query-payload-plugin": ">=5.6.2 <5.7",
114
- "@xyo-network/sdk-js": ">=5.6.3 <6",
115
- "@xyo-network/sdk-protocol-js": ">=5.6.2 <5.7",
116
- "@xyo-network/wallet": ">=5.6.1 <5.7",
117
- "@xyo-network/wallet-model": ">=5.6.2 <5.7",
118
- "ajv": ">=8.20.0 <9",
119
- "async-mutex": ">=0.5.0 <1",
120
- "bn.js": ">=5.2.3 <6",
121
- "buffer": ">=6.0.3 <7",
122
- "chalk": ">=5.6.2 <6",
123
- "debug": ">=4.4.3 <4.5",
124
- "ethers": ">=6.16.0 <7",
125
- "hash-wasm": ">=4.12.0 <4.13",
126
- "idb": ">=8.0.3 <9",
127
- "lru-cache": ">=11.3.6 <12",
128
- "mapbox-gl": ">=3.23.1 <4",
129
- "observable-fns": ">=0.6.1 <0.7",
130
- "pako": ">=2.1.0 <2.2",
131
- "store2": ">=2.14.4 <2.15",
132
- "wasm-feature-detect": ">=1.8.0 <1.9",
133
- "webextension-polyfill": ">=0.12.0 <1",
134
- "zod": ">=4.4.3 <4.5"
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"