@latticexyz/schema-type 1.41.0 → 1.41.1-alpha.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.
Files changed (53) hide show
  1. package/dist/typescript/AbiTypeToSchemaType.d.ts +4 -0
  2. package/dist/typescript/AbiTypeToSchemaType.js +3 -0
  3. package/dist/typescript/AbiTypeToSchemaType.js.map +1 -0
  4. package/dist/typescript/AbiTypes.d.ts +4 -0
  5. package/dist/typescript/AbiTypes.js +3 -0
  6. package/dist/typescript/AbiTypes.js.map +1 -0
  7. package/dist/typescript/ArraySchemaType.d.ts +2 -0
  8. package/dist/typescript/ArraySchemaType.js +2 -0
  9. package/dist/typescript/ArraySchemaType.js.map +1 -0
  10. package/dist/typescript/DynamicSchemaType.d.ts +3 -0
  11. package/dist/typescript/DynamicSchemaType.js +2 -0
  12. package/dist/typescript/DynamicSchemaType.js.map +1 -0
  13. package/dist/typescript/SchemaType.d.ts +0 -211
  14. package/dist/typescript/SchemaType.js +0 -365
  15. package/dist/typescript/SchemaType.js.map +1 -1
  16. package/dist/typescript/SchemaTypeArrayToElement.d.ts +201 -0
  17. package/dist/typescript/SchemaTypeArrayToElement.js +102 -0
  18. package/dist/typescript/SchemaTypeArrayToElement.js.map +1 -0
  19. package/dist/typescript/SchemaTypeToAbiType.d.ts +200 -0
  20. package/dist/typescript/SchemaTypeToAbiType.js +202 -0
  21. package/dist/typescript/SchemaTypeToAbiType.js.map +1 -0
  22. package/dist/typescript/SchemaTypeToPrimitive.d.ts +201 -0
  23. package/dist/typescript/SchemaTypeToPrimitive.js +2 -0
  24. package/dist/typescript/SchemaTypeToPrimitive.js.map +1 -0
  25. package/dist/typescript/StaticAbiTypes.d.ts +4 -0
  26. package/dist/typescript/StaticAbiTypes.js +5 -0
  27. package/dist/typescript/StaticAbiTypes.js.map +1 -0
  28. package/dist/typescript/StaticSchemaType.d.ts +3 -0
  29. package/dist/typescript/StaticSchemaType.js +2 -0
  30. package/dist/typescript/StaticSchemaType.js.map +1 -0
  31. package/dist/typescript/encodeSchema.d.ts +8 -0
  32. package/dist/typescript/encodeSchema.js +43 -0
  33. package/dist/typescript/encodeSchema.js.map +1 -0
  34. package/dist/typescript/getStaticByteLength.d.ts +2 -0
  35. package/dist/typescript/getStaticByteLength.js +26 -0
  36. package/dist/typescript/getStaticByteLength.js.map +1 -0
  37. package/dist/typescript/index.d.ts +14 -0
  38. package/dist/typescript/index.js +9 -0
  39. package/dist/typescript/index.js.map +1 -0
  40. package/package.json +4 -4
  41. package/src/typescript/AbiTypeToSchemaType.ts +6 -0
  42. package/src/typescript/AbiTypes.ts +5 -0
  43. package/src/typescript/ArraySchemaType.ts +101 -0
  44. package/src/typescript/DynamicSchemaType.ts +4 -0
  45. package/src/typescript/SchemaType.ts +0 -485
  46. package/src/typescript/SchemaTypeArrayToElement.ts +109 -0
  47. package/src/typescript/SchemaTypeToAbiType.ts +210 -0
  48. package/src/typescript/SchemaTypeToPrimitive.ts +210 -0
  49. package/src/typescript/StaticAbiTypes.ts +10 -0
  50. package/src/typescript/StaticSchemaType.ts +4 -0
  51. package/src/typescript/encodeSchema.ts +47 -0
  52. package/src/typescript/getStaticByteLength.ts +25 -0
  53. package/src/typescript/index.ts +15 -0
@@ -0,0 +1,202 @@
1
+ import { SchemaType } from "./SchemaType.js";
2
+ export const SchemaTypeToAbiType = {
3
+ [SchemaType.UINT8]: "uint8",
4
+ [SchemaType.UINT16]: "uint16",
5
+ [SchemaType.UINT24]: "uint24",
6
+ [SchemaType.UINT32]: "uint32",
7
+ [SchemaType.UINT40]: "uint40",
8
+ [SchemaType.UINT48]: "uint48",
9
+ [SchemaType.UINT56]: "uint56",
10
+ [SchemaType.UINT64]: "uint64",
11
+ [SchemaType.UINT72]: "uint72",
12
+ [SchemaType.UINT80]: "uint80",
13
+ [SchemaType.UINT88]: "uint88",
14
+ [SchemaType.UINT96]: "uint96",
15
+ [SchemaType.UINT104]: "uint104",
16
+ [SchemaType.UINT112]: "uint112",
17
+ [SchemaType.UINT120]: "uint120",
18
+ [SchemaType.UINT128]: "uint128",
19
+ [SchemaType.UINT136]: "uint136",
20
+ [SchemaType.UINT144]: "uint144",
21
+ [SchemaType.UINT152]: "uint152",
22
+ [SchemaType.UINT160]: "uint160",
23
+ [SchemaType.UINT168]: "uint168",
24
+ [SchemaType.UINT176]: "uint176",
25
+ [SchemaType.UINT184]: "uint184",
26
+ [SchemaType.UINT192]: "uint192",
27
+ [SchemaType.UINT200]: "uint200",
28
+ [SchemaType.UINT208]: "uint208",
29
+ [SchemaType.UINT216]: "uint216",
30
+ [SchemaType.UINT224]: "uint224",
31
+ [SchemaType.UINT232]: "uint232",
32
+ [SchemaType.UINT240]: "uint240",
33
+ [SchemaType.UINT248]: "uint248",
34
+ [SchemaType.UINT256]: "uint256",
35
+ [SchemaType.INT8]: "int8",
36
+ [SchemaType.INT16]: "int16",
37
+ [SchemaType.INT24]: "int24",
38
+ [SchemaType.INT32]: "int32",
39
+ [SchemaType.INT40]: "int40",
40
+ [SchemaType.INT48]: "int48",
41
+ [SchemaType.INT56]: "int56",
42
+ [SchemaType.INT64]: "int64",
43
+ [SchemaType.INT72]: "int72",
44
+ [SchemaType.INT80]: "int80",
45
+ [SchemaType.INT88]: "int88",
46
+ [SchemaType.INT96]: "int96",
47
+ [SchemaType.INT104]: "int104",
48
+ [SchemaType.INT112]: "int112",
49
+ [SchemaType.INT120]: "int120",
50
+ [SchemaType.INT128]: "int128",
51
+ [SchemaType.INT136]: "int136",
52
+ [SchemaType.INT144]: "int144",
53
+ [SchemaType.INT152]: "int152",
54
+ [SchemaType.INT160]: "int160",
55
+ [SchemaType.INT168]: "int168",
56
+ [SchemaType.INT176]: "int176",
57
+ [SchemaType.INT184]: "int184",
58
+ [SchemaType.INT192]: "int192",
59
+ [SchemaType.INT200]: "int200",
60
+ [SchemaType.INT208]: "int208",
61
+ [SchemaType.INT216]: "int216",
62
+ [SchemaType.INT224]: "int224",
63
+ [SchemaType.INT232]: "int232",
64
+ [SchemaType.INT240]: "int240",
65
+ [SchemaType.INT248]: "int248",
66
+ [SchemaType.INT256]: "int256",
67
+ [SchemaType.BYTES1]: "bytes1",
68
+ [SchemaType.BYTES2]: "bytes2",
69
+ [SchemaType.BYTES3]: "bytes3",
70
+ [SchemaType.BYTES4]: "bytes4",
71
+ [SchemaType.BYTES5]: "bytes5",
72
+ [SchemaType.BYTES6]: "bytes6",
73
+ [SchemaType.BYTES7]: "bytes7",
74
+ [SchemaType.BYTES8]: "bytes8",
75
+ [SchemaType.BYTES9]: "bytes9",
76
+ [SchemaType.BYTES10]: "bytes10",
77
+ [SchemaType.BYTES11]: "bytes11",
78
+ [SchemaType.BYTES12]: "bytes12",
79
+ [SchemaType.BYTES13]: "bytes13",
80
+ [SchemaType.BYTES14]: "bytes14",
81
+ [SchemaType.BYTES15]: "bytes15",
82
+ [SchemaType.BYTES16]: "bytes16",
83
+ [SchemaType.BYTES17]: "bytes17",
84
+ [SchemaType.BYTES18]: "bytes18",
85
+ [SchemaType.BYTES19]: "bytes19",
86
+ [SchemaType.BYTES20]: "bytes20",
87
+ [SchemaType.BYTES21]: "bytes21",
88
+ [SchemaType.BYTES22]: "bytes22",
89
+ [SchemaType.BYTES23]: "bytes23",
90
+ [SchemaType.BYTES24]: "bytes24",
91
+ [SchemaType.BYTES25]: "bytes25",
92
+ [SchemaType.BYTES26]: "bytes26",
93
+ [SchemaType.BYTES27]: "bytes27",
94
+ [SchemaType.BYTES28]: "bytes28",
95
+ [SchemaType.BYTES29]: "bytes29",
96
+ [SchemaType.BYTES30]: "bytes30",
97
+ [SchemaType.BYTES31]: "bytes31",
98
+ [SchemaType.BYTES32]: "bytes32",
99
+ [SchemaType.BOOL]: "bool",
100
+ [SchemaType.ADDRESS]: "address",
101
+ [SchemaType.UINT8_ARRAY]: "uint8[]",
102
+ [SchemaType.UINT16_ARRAY]: "uint16[]",
103
+ [SchemaType.UINT24_ARRAY]: "uint24[]",
104
+ [SchemaType.UINT32_ARRAY]: "uint32[]",
105
+ [SchemaType.UINT40_ARRAY]: "uint40[]",
106
+ [SchemaType.UINT48_ARRAY]: "uint48[]",
107
+ [SchemaType.UINT56_ARRAY]: "uint56[]",
108
+ [SchemaType.UINT64_ARRAY]: "uint64[]",
109
+ [SchemaType.UINT72_ARRAY]: "uint72[]",
110
+ [SchemaType.UINT80_ARRAY]: "uint80[]",
111
+ [SchemaType.UINT88_ARRAY]: "uint88[]",
112
+ [SchemaType.UINT96_ARRAY]: "uint96[]",
113
+ [SchemaType.UINT104_ARRAY]: "uint104[]",
114
+ [SchemaType.UINT112_ARRAY]: "uint112[]",
115
+ [SchemaType.UINT120_ARRAY]: "uint120[]",
116
+ [SchemaType.UINT128_ARRAY]: "uint128[]",
117
+ [SchemaType.UINT136_ARRAY]: "uint136[]",
118
+ [SchemaType.UINT144_ARRAY]: "uint144[]",
119
+ [SchemaType.UINT152_ARRAY]: "uint152[]",
120
+ [SchemaType.UINT160_ARRAY]: "uint160[]",
121
+ [SchemaType.UINT168_ARRAY]: "uint168[]",
122
+ [SchemaType.UINT176_ARRAY]: "uint176[]",
123
+ [SchemaType.UINT184_ARRAY]: "uint184[]",
124
+ [SchemaType.UINT192_ARRAY]: "uint192[]",
125
+ [SchemaType.UINT200_ARRAY]: "uint200[]",
126
+ [SchemaType.UINT208_ARRAY]: "uint208[]",
127
+ [SchemaType.UINT216_ARRAY]: "uint216[]",
128
+ [SchemaType.UINT224_ARRAY]: "uint224[]",
129
+ [SchemaType.UINT232_ARRAY]: "uint232[]",
130
+ [SchemaType.UINT240_ARRAY]: "uint240[]",
131
+ [SchemaType.UINT248_ARRAY]: "uint248[]",
132
+ [SchemaType.UINT256_ARRAY]: "uint256[]",
133
+ [SchemaType.INT8_ARRAY]: "int8[]",
134
+ [SchemaType.INT16_ARRAY]: "int16[]",
135
+ [SchemaType.INT24_ARRAY]: "int24[]",
136
+ [SchemaType.INT32_ARRAY]: "int32[]",
137
+ [SchemaType.INT40_ARRAY]: "int40[]",
138
+ [SchemaType.INT48_ARRAY]: "int48[]",
139
+ [SchemaType.INT56_ARRAY]: "int56[]",
140
+ [SchemaType.INT64_ARRAY]: "int64[]",
141
+ [SchemaType.INT72_ARRAY]: "int72[]",
142
+ [SchemaType.INT80_ARRAY]: "int80[]",
143
+ [SchemaType.INT88_ARRAY]: "int88[]",
144
+ [SchemaType.INT96_ARRAY]: "int96[]",
145
+ [SchemaType.INT104_ARRAY]: "int104[]",
146
+ [SchemaType.INT112_ARRAY]: "int112[]",
147
+ [SchemaType.INT120_ARRAY]: "int120[]",
148
+ [SchemaType.INT128_ARRAY]: "int128[]",
149
+ [SchemaType.INT136_ARRAY]: "int136[]",
150
+ [SchemaType.INT144_ARRAY]: "int144[]",
151
+ [SchemaType.INT152_ARRAY]: "int152[]",
152
+ [SchemaType.INT160_ARRAY]: "int160[]",
153
+ [SchemaType.INT168_ARRAY]: "int168[]",
154
+ [SchemaType.INT176_ARRAY]: "int176[]",
155
+ [SchemaType.INT184_ARRAY]: "int184[]",
156
+ [SchemaType.INT192_ARRAY]: "int192[]",
157
+ [SchemaType.INT200_ARRAY]: "int200[]",
158
+ [SchemaType.INT208_ARRAY]: "int208[]",
159
+ [SchemaType.INT216_ARRAY]: "int216[]",
160
+ [SchemaType.INT224_ARRAY]: "int224[]",
161
+ [SchemaType.INT232_ARRAY]: "int232[]",
162
+ [SchemaType.INT240_ARRAY]: "int240[]",
163
+ [SchemaType.INT248_ARRAY]: "int248[]",
164
+ [SchemaType.INT256_ARRAY]: "int256[]",
165
+ [SchemaType.BYTES1_ARRAY]: "bytes1[]",
166
+ [SchemaType.BYTES2_ARRAY]: "bytes2[]",
167
+ [SchemaType.BYTES3_ARRAY]: "bytes3[]",
168
+ [SchemaType.BYTES4_ARRAY]: "bytes4[]",
169
+ [SchemaType.BYTES5_ARRAY]: "bytes5[]",
170
+ [SchemaType.BYTES6_ARRAY]: "bytes6[]",
171
+ [SchemaType.BYTES7_ARRAY]: "bytes7[]",
172
+ [SchemaType.BYTES8_ARRAY]: "bytes8[]",
173
+ [SchemaType.BYTES9_ARRAY]: "bytes9[]",
174
+ [SchemaType.BYTES10_ARRAY]: "bytes10[]",
175
+ [SchemaType.BYTES11_ARRAY]: "bytes11[]",
176
+ [SchemaType.BYTES12_ARRAY]: "bytes12[]",
177
+ [SchemaType.BYTES13_ARRAY]: "bytes13[]",
178
+ [SchemaType.BYTES14_ARRAY]: "bytes14[]",
179
+ [SchemaType.BYTES15_ARRAY]: "bytes15[]",
180
+ [SchemaType.BYTES16_ARRAY]: "bytes16[]",
181
+ [SchemaType.BYTES17_ARRAY]: "bytes17[]",
182
+ [SchemaType.BYTES18_ARRAY]: "bytes18[]",
183
+ [SchemaType.BYTES19_ARRAY]: "bytes19[]",
184
+ [SchemaType.BYTES20_ARRAY]: "bytes20[]",
185
+ [SchemaType.BYTES21_ARRAY]: "bytes21[]",
186
+ [SchemaType.BYTES22_ARRAY]: "bytes22[]",
187
+ [SchemaType.BYTES23_ARRAY]: "bytes23[]",
188
+ [SchemaType.BYTES24_ARRAY]: "bytes24[]",
189
+ [SchemaType.BYTES25_ARRAY]: "bytes25[]",
190
+ [SchemaType.BYTES26_ARRAY]: "bytes26[]",
191
+ [SchemaType.BYTES27_ARRAY]: "bytes27[]",
192
+ [SchemaType.BYTES28_ARRAY]: "bytes28[]",
193
+ [SchemaType.BYTES29_ARRAY]: "bytes29[]",
194
+ [SchemaType.BYTES30_ARRAY]: "bytes30[]",
195
+ [SchemaType.BYTES31_ARRAY]: "bytes31[]",
196
+ [SchemaType.BYTES32_ARRAY]: "bytes32[]",
197
+ [SchemaType.BOOL_ARRAY]: "bool[]",
198
+ [SchemaType.ADDRESS_ARRAY]: "address[]",
199
+ [SchemaType.BYTES]: "bytes",
200
+ [SchemaType.STRING]: "string",
201
+ };
202
+ //# sourceMappingURL=SchemaTypeToAbiType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaTypeToAbiType.js","sourceRoot":"","sources":["../../src/typescript/S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
1
+ import { SchemaType } from "./SchemaType.js";
2
+ export type SchemaTypeToPrimitive = {
3
+ [SchemaType.UINT8]: number;
4
+ [SchemaType.UINT16]: number;
5
+ [SchemaType.UINT24]: number;
6
+ [SchemaType.UINT32]: number;
7
+ [SchemaType.UINT40]: number;
8
+ [SchemaType.UINT48]: number;
9
+ [SchemaType.UINT56]: bigint;
10
+ [SchemaType.UINT64]: bigint;
11
+ [SchemaType.UINT72]: bigint;
12
+ [SchemaType.UINT80]: bigint;
13
+ [SchemaType.UINT88]: bigint;
14
+ [SchemaType.UINT96]: bigint;
15
+ [SchemaType.UINT104]: bigint;
16
+ [SchemaType.UINT112]: bigint;
17
+ [SchemaType.UINT120]: bigint;
18
+ [SchemaType.UINT128]: bigint;
19
+ [SchemaType.UINT136]: bigint;
20
+ [SchemaType.UINT144]: bigint;
21
+ [SchemaType.UINT152]: bigint;
22
+ [SchemaType.UINT160]: bigint;
23
+ [SchemaType.UINT168]: bigint;
24
+ [SchemaType.UINT176]: bigint;
25
+ [SchemaType.UINT184]: bigint;
26
+ [SchemaType.UINT192]: bigint;
27
+ [SchemaType.UINT200]: bigint;
28
+ [SchemaType.UINT208]: bigint;
29
+ [SchemaType.UINT216]: bigint;
30
+ [SchemaType.UINT224]: bigint;
31
+ [SchemaType.UINT232]: bigint;
32
+ [SchemaType.UINT240]: bigint;
33
+ [SchemaType.UINT248]: bigint;
34
+ [SchemaType.UINT256]: bigint;
35
+ [SchemaType.INT8]: number;
36
+ [SchemaType.INT16]: number;
37
+ [SchemaType.INT24]: number;
38
+ [SchemaType.INT32]: number;
39
+ [SchemaType.INT40]: number;
40
+ [SchemaType.INT48]: number;
41
+ [SchemaType.INT56]: bigint;
42
+ [SchemaType.INT64]: bigint;
43
+ [SchemaType.INT72]: bigint;
44
+ [SchemaType.INT80]: bigint;
45
+ [SchemaType.INT88]: bigint;
46
+ [SchemaType.INT96]: bigint;
47
+ [SchemaType.INT104]: bigint;
48
+ [SchemaType.INT112]: bigint;
49
+ [SchemaType.INT120]: bigint;
50
+ [SchemaType.INT128]: bigint;
51
+ [SchemaType.INT136]: bigint;
52
+ [SchemaType.INT144]: bigint;
53
+ [SchemaType.INT152]: bigint;
54
+ [SchemaType.INT160]: bigint;
55
+ [SchemaType.INT168]: bigint;
56
+ [SchemaType.INT176]: bigint;
57
+ [SchemaType.INT184]: bigint;
58
+ [SchemaType.INT192]: bigint;
59
+ [SchemaType.INT200]: bigint;
60
+ [SchemaType.INT208]: bigint;
61
+ [SchemaType.INT216]: bigint;
62
+ [SchemaType.INT224]: bigint;
63
+ [SchemaType.INT232]: bigint;
64
+ [SchemaType.INT240]: bigint;
65
+ [SchemaType.INT248]: bigint;
66
+ [SchemaType.INT256]: bigint;
67
+ [SchemaType.BYTES1]: string;
68
+ [SchemaType.BYTES2]: string;
69
+ [SchemaType.BYTES3]: string;
70
+ [SchemaType.BYTES4]: string;
71
+ [SchemaType.BYTES5]: string;
72
+ [SchemaType.BYTES6]: string;
73
+ [SchemaType.BYTES7]: string;
74
+ [SchemaType.BYTES8]: string;
75
+ [SchemaType.BYTES9]: string;
76
+ [SchemaType.BYTES10]: string;
77
+ [SchemaType.BYTES11]: string;
78
+ [SchemaType.BYTES12]: string;
79
+ [SchemaType.BYTES13]: string;
80
+ [SchemaType.BYTES14]: string;
81
+ [SchemaType.BYTES15]: string;
82
+ [SchemaType.BYTES16]: string;
83
+ [SchemaType.BYTES17]: string;
84
+ [SchemaType.BYTES18]: string;
85
+ [SchemaType.BYTES19]: string;
86
+ [SchemaType.BYTES20]: string;
87
+ [SchemaType.BYTES21]: string;
88
+ [SchemaType.BYTES22]: string;
89
+ [SchemaType.BYTES23]: string;
90
+ [SchemaType.BYTES24]: string;
91
+ [SchemaType.BYTES25]: string;
92
+ [SchemaType.BYTES26]: string;
93
+ [SchemaType.BYTES27]: string;
94
+ [SchemaType.BYTES28]: string;
95
+ [SchemaType.BYTES29]: string;
96
+ [SchemaType.BYTES30]: string;
97
+ [SchemaType.BYTES31]: string;
98
+ [SchemaType.BYTES32]: string;
99
+ [SchemaType.BOOL]: boolean;
100
+ [SchemaType.ADDRESS]: string;
101
+ [SchemaType.UINT8_ARRAY]: number[];
102
+ [SchemaType.UINT16_ARRAY]: number[];
103
+ [SchemaType.UINT24_ARRAY]: number[];
104
+ [SchemaType.UINT32_ARRAY]: number[];
105
+ [SchemaType.UINT40_ARRAY]: number[];
106
+ [SchemaType.UINT48_ARRAY]: number[];
107
+ [SchemaType.UINT56_ARRAY]: bigint[];
108
+ [SchemaType.UINT64_ARRAY]: bigint[];
109
+ [SchemaType.UINT72_ARRAY]: bigint[];
110
+ [SchemaType.UINT80_ARRAY]: bigint[];
111
+ [SchemaType.UINT88_ARRAY]: bigint[];
112
+ [SchemaType.UINT96_ARRAY]: bigint[];
113
+ [SchemaType.UINT104_ARRAY]: bigint[];
114
+ [SchemaType.UINT112_ARRAY]: bigint[];
115
+ [SchemaType.UINT120_ARRAY]: bigint[];
116
+ [SchemaType.UINT128_ARRAY]: bigint[];
117
+ [SchemaType.UINT136_ARRAY]: bigint[];
118
+ [SchemaType.UINT144_ARRAY]: bigint[];
119
+ [SchemaType.UINT152_ARRAY]: bigint[];
120
+ [SchemaType.UINT160_ARRAY]: bigint[];
121
+ [SchemaType.UINT168_ARRAY]: bigint[];
122
+ [SchemaType.UINT176_ARRAY]: bigint[];
123
+ [SchemaType.UINT184_ARRAY]: bigint[];
124
+ [SchemaType.UINT192_ARRAY]: bigint[];
125
+ [SchemaType.UINT200_ARRAY]: bigint[];
126
+ [SchemaType.UINT208_ARRAY]: bigint[];
127
+ [SchemaType.UINT216_ARRAY]: bigint[];
128
+ [SchemaType.UINT224_ARRAY]: bigint[];
129
+ [SchemaType.UINT232_ARRAY]: bigint[];
130
+ [SchemaType.UINT240_ARRAY]: bigint[];
131
+ [SchemaType.UINT248_ARRAY]: bigint[];
132
+ [SchemaType.UINT256_ARRAY]: bigint[];
133
+ [SchemaType.INT8_ARRAY]: number[];
134
+ [SchemaType.INT16_ARRAY]: number[];
135
+ [SchemaType.INT24_ARRAY]: number[];
136
+ [SchemaType.INT32_ARRAY]: number[];
137
+ [SchemaType.INT40_ARRAY]: number[];
138
+ [SchemaType.INT48_ARRAY]: number[];
139
+ [SchemaType.INT56_ARRAY]: bigint[];
140
+ [SchemaType.INT64_ARRAY]: bigint[];
141
+ [SchemaType.INT72_ARRAY]: bigint[];
142
+ [SchemaType.INT80_ARRAY]: bigint[];
143
+ [SchemaType.INT88_ARRAY]: bigint[];
144
+ [SchemaType.INT96_ARRAY]: bigint[];
145
+ [SchemaType.INT104_ARRAY]: bigint[];
146
+ [SchemaType.INT112_ARRAY]: bigint[];
147
+ [SchemaType.INT120_ARRAY]: bigint[];
148
+ [SchemaType.INT128_ARRAY]: bigint[];
149
+ [SchemaType.INT136_ARRAY]: bigint[];
150
+ [SchemaType.INT144_ARRAY]: bigint[];
151
+ [SchemaType.INT152_ARRAY]: bigint[];
152
+ [SchemaType.INT160_ARRAY]: bigint[];
153
+ [SchemaType.INT168_ARRAY]: bigint[];
154
+ [SchemaType.INT176_ARRAY]: bigint[];
155
+ [SchemaType.INT184_ARRAY]: bigint[];
156
+ [SchemaType.INT192_ARRAY]: bigint[];
157
+ [SchemaType.INT200_ARRAY]: bigint[];
158
+ [SchemaType.INT208_ARRAY]: bigint[];
159
+ [SchemaType.INT216_ARRAY]: bigint[];
160
+ [SchemaType.INT224_ARRAY]: bigint[];
161
+ [SchemaType.INT232_ARRAY]: bigint[];
162
+ [SchemaType.INT240_ARRAY]: bigint[];
163
+ [SchemaType.INT248_ARRAY]: bigint[];
164
+ [SchemaType.INT256_ARRAY]: bigint[];
165
+ [SchemaType.BYTES1_ARRAY]: string[];
166
+ [SchemaType.BYTES2_ARRAY]: string[];
167
+ [SchemaType.BYTES3_ARRAY]: string[];
168
+ [SchemaType.BYTES4_ARRAY]: string[];
169
+ [SchemaType.BYTES5_ARRAY]: string[];
170
+ [SchemaType.BYTES6_ARRAY]: string[];
171
+ [SchemaType.BYTES7_ARRAY]: string[];
172
+ [SchemaType.BYTES8_ARRAY]: string[];
173
+ [SchemaType.BYTES9_ARRAY]: string[];
174
+ [SchemaType.BYTES10_ARRAY]: string[];
175
+ [SchemaType.BYTES11_ARRAY]: string[];
176
+ [SchemaType.BYTES12_ARRAY]: string[];
177
+ [SchemaType.BYTES13_ARRAY]: string[];
178
+ [SchemaType.BYTES14_ARRAY]: string[];
179
+ [SchemaType.BYTES15_ARRAY]: string[];
180
+ [SchemaType.BYTES16_ARRAY]: string[];
181
+ [SchemaType.BYTES17_ARRAY]: string[];
182
+ [SchemaType.BYTES18_ARRAY]: string[];
183
+ [SchemaType.BYTES19_ARRAY]: string[];
184
+ [SchemaType.BYTES20_ARRAY]: string[];
185
+ [SchemaType.BYTES21_ARRAY]: string[];
186
+ [SchemaType.BYTES22_ARRAY]: string[];
187
+ [SchemaType.BYTES23_ARRAY]: string[];
188
+ [SchemaType.BYTES24_ARRAY]: string[];
189
+ [SchemaType.BYTES25_ARRAY]: string[];
190
+ [SchemaType.BYTES26_ARRAY]: string[];
191
+ [SchemaType.BYTES27_ARRAY]: string[];
192
+ [SchemaType.BYTES28_ARRAY]: string[];
193
+ [SchemaType.BYTES29_ARRAY]: string[];
194
+ [SchemaType.BYTES30_ARRAY]: string[];
195
+ [SchemaType.BYTES31_ARRAY]: string[];
196
+ [SchemaType.BYTES32_ARRAY]: string[];
197
+ [SchemaType.BOOL_ARRAY]: boolean[];
198
+ [SchemaType.ADDRESS_ARRAY]: string[];
199
+ [SchemaType.BYTES]: string;
200
+ [SchemaType.STRING]: string;
201
+ };
@@ -0,0 +1,2 @@
1
+ import { SchemaType } from "./SchemaType.js";
2
+ //# sourceMappingURL=SchemaTypeToPrimitive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaTypeToPrimitive.js","sourceRoot":"","sources":["../../src/typescript/SchemaTypeToPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { SchemaTypeToAbiType } from "./SchemaTypeToAbiType.js";
2
+ import { StaticSchemaType } from "./StaticSchemaType.js";
3
+ export type StaticAbiType = (typeof SchemaTypeToAbiType)[StaticSchemaType];
4
+ export declare const StaticAbiTypes: StaticAbiType[];
@@ -0,0 +1,5 @@
1
+ import { AbiTypes } from "./AbiTypes.js";
2
+ import { AbiTypeToSchemaType } from "./AbiTypeToSchemaType.js";
3
+ import { getStaticByteLength } from "./getStaticByteLength.js";
4
+ export const StaticAbiTypes = AbiTypes.filter((abiType) => getStaticByteLength(AbiTypeToSchemaType[abiType]) > 0);
5
+ //# sourceMappingURL=StaticAbiTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StaticAbiTypes.js","sourceRoot":"","sources":["../../src/typescript/StaticAbiTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAK/D,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAC3C,CAAC,OAAO,EAAE,EAAE,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAChD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { SchemaType } from "./SchemaType.js";
2
+ import { DynamicSchemaType } from "./DynamicSchemaType.js";
3
+ export type StaticSchemaType = Exclude<SchemaType, DynamicSchemaType>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=StaticSchemaType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StaticSchemaType.js","sourceRoot":"","sources":["../../src/typescript/StaticSchemaType.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { SchemaType } from "./SchemaType.js";
2
+ /**
3
+ * Encode a table schema into a bytes32 hex string
4
+ * Port of `Schema.sol` from `@latticexyz/store`
5
+ * @param schema The schema to encode SchemaType[]
6
+ * @returns The encoded schema as a 32 byte hex string
7
+ */
8
+ export declare function encodeSchema(schema: SchemaType[]): Uint8Array;
@@ -0,0 +1,43 @@
1
+ import { getStaticByteLength } from "./getStaticByteLength.js";
2
+ /**
3
+ * Encode a table schema into a bytes32 hex string
4
+ * Port of `Schema.sol` from `@latticexyz/store`
5
+ * @param schema The schema to encode SchemaType[]
6
+ * @returns The encoded schema as a 32 byte hex string
7
+ */
8
+ export function encodeSchema(schema) {
9
+ if (schema.length > 28)
10
+ throw new Error("Schema can only have up to 28 fields");
11
+ const encodedSchema = new Uint8Array(32);
12
+ let length = 0;
13
+ let staticFields = 0;
14
+ // Compute the length of the schema and the number of static fields
15
+ // and store the schema types in the encoded schema
16
+ let hasDynamicFields = false;
17
+ for (let i = 0; i < schema.length; i++) {
18
+ const staticByteLength = getStaticByteLength(schema[i]);
19
+ // Increase the static field count if the field is static
20
+ if (staticByteLength > 0) {
21
+ // Revert if we have seen a dynamic field before, but now we see a static field
22
+ if (hasDynamicFields)
23
+ throw new Error("Static fields must come before dynamic fields in the schema");
24
+ staticFields++;
25
+ }
26
+ else {
27
+ // Flag that we have seen a dynamic field
28
+ hasDynamicFields = true;
29
+ }
30
+ length += staticByteLength;
31
+ encodedSchema[i + 4] = schema[i];
32
+ }
33
+ // Require max 14 dynamic fields
34
+ const dynamicFields = schema.length - staticFields;
35
+ if (dynamicFields > 14)
36
+ throw new Error("Schema can only have up to 14 dynamic fields");
37
+ // Store total static length, and number of static and dynamic fields
38
+ new DataView(encodedSchema.buffer).setUint16(0, length); // 2 length bytes
39
+ encodedSchema[2] = staticFields; // number of static fields
40
+ encodedSchema[3] = dynamicFields; // number of dynamic fields
41
+ return encodedSchema;
42
+ }
43
+ //# sourceMappingURL=encodeSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encodeSchema.js","sourceRoot":"","sources":["../../src/typ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AC1E,aAAa,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,0BAA0B;IAC3D,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,2BAA2B;IAE7D,OAAO,aAAa,CAAC;AACvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { SchemaType } from "./SchemaType.js";
2
+ export declare function getStaticByteLength(schemaType: SchemaType): number;
@@ -0,0 +1,26 @@
1
+ import { SchemaType } from "./SchemaType.js";
2
+ export function getStaticByteLength(schemaType) {
3
+ const val = schemaType.valueOf();
4
+ if (val < 32) {
5
+ // uint8-256
6
+ return val + 1;
7
+ }
8
+ else if (val < 64) {
9
+ // int8-256, offset by 32
10
+ return val + 1 - 32;
11
+ }
12
+ else if (val < 96) {
13
+ // bytes1-32, offset by 64
14
+ return val + 1 - 64;
15
+ }
16
+ // Other static types
17
+ if (schemaType == SchemaType.BOOL) {
18
+ return 1;
19
+ }
20
+ else if (schemaType == SchemaType.ADDRESS) {
21
+ return 20;
22
+ }
23
+ // Return 0 for all dynamic types
24
+ return 0;
25
+ }
26
+ //# sourceMappingURL=getStaticByteLength.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getStaticByteLength.js","sourceRoot":"","sources":["../../src/typescript/getStaticByteLength.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,UAAU,mBAAmB,CAAC,UAAsB;IACxD,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC;IACjC,IAAI,GAAG,GAAG,EAAE,EAAE;QACZ,YAAY;QACZ,OAAO,GAAG,GAAG,CAAC,CAAC;KAChB;SAAM,IAAI,GAAG,GAAG,EAAE,EAAE;QACnB,yBAAyB;QACzB,OAAO,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;KACrB;SAAM,IAAI,GAAG,GAAG,EAAE,EAAE;QACnB,0BAA0B;QAC1B,OAAO,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;KACrB;IAED,qBAAqB;IACrB,IAAI,UAAU,IAAI,UAAU,CAAC,IAAI,EAAE;QACjC,OAAO,CAAC,CAAC;KACV;SAAM,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO,EAAE;QAC3C,OAAO,EAAE,CAAC;KACX;IAED,iCAAiC;IACjC,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,14 @@
1
+ export type { StaticSchemaType } from "./StaticSchemaType.js";
2
+ export type { DynamicSchemaType } from "./DynamicSchemaType.js";
3
+ export type { ArraySchemaType } from "./ArraySchemaType.js";
4
+ export type { SchemaTypeToPrimitive } from "./SchemaTypeToPrimitive.js";
5
+ export type { AbiType } from "./AbiTypes.js";
6
+ export type { StaticAbiType } from "./StaticAbiTypes.js";
7
+ export { SchemaType } from "./SchemaType.js";
8
+ export { encodeSchema } from "./encodeSchema.js";
9
+ export { getStaticByteLength } from "./getStaticByteLength.js";
10
+ export { SchemaTypeArrayToElement } from "./SchemaTypeArrayToElement.js";
11
+ export { SchemaTypeToAbiType } from "./SchemaTypeToAbiType.js";
12
+ export { AbiTypeToSchemaType } from "./AbiTypeToSchemaType.js";
13
+ export { AbiTypes } from "./AbiTypes.js";
14
+ export { StaticAbiTypes } from "./StaticAbiTypes.js";
@@ -0,0 +1,9 @@
1
+ export { SchemaType } from "./SchemaType.js";
2
+ export { encodeSchema } from "./encodeSchema.js";
3
+ export { getStaticByteLength } from "./getStaticByteLength.js";
4
+ export { SchemaTypeArrayToElement } from "./SchemaTypeArrayToElement.js";
5
+ export { SchemaTypeToAbiType } from "./SchemaTypeToAbiType.js";
6
+ export { AbiTypeToSchemaType } from "./AbiTypeToSchemaType.js";
7
+ export { AbiTypes } from "./AbiTypes.js";
8
+ export { StaticAbiTypes } from "./StaticAbiTypes.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/typescript/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@latticexyz/schema-type",
3
3
  "license": "MIT",
4
- "version": "1.41.0",
4
+ "version": "1.41.1-alpha.0+50af005",
5
5
  "description": "SchemaType enum for various languages",
6
- "main": "src/typescript/SchemaType.ts",
7
- "source": "src/typescript/SchemaType.ts",
6
+ "main": "src/typescript/index.ts",
7
+ "source": "src/typescript/index.ts",
8
8
  "type": "module",
9
9
  "repository": {
10
10
  "type": "git",
@@ -28,5 +28,5 @@
28
28
  "forge-std": "https://github.com/foundry-rs/forge-std.git#b4f121555729b3afb3c5ffccb62ff4b6e2818fd3",
29
29
  "rimraf": "^3.0.2"
30
30
  },
31
- "gitHead": "ecac84146f0288e3a129d1d3dbfaf373db86b1ab"
31
+ "gitHead": "50af0052a8cec84014a64b759f6e72235a6e6869"
32
32
  }
@@ -0,0 +1,6 @@
1
+ import { SchemaTypeToAbiType } from "./SchemaTypeToAbiType.js";
2
+ import { SchemaType } from "./SchemaType.js";
3
+
4
+ export const AbiTypeToSchemaType = Object.fromEntries(
5
+ Object.entries(SchemaTypeToAbiType).map(([schemaType, abiType]) => [abiType, parseInt(schemaType) as SchemaType])
6
+ ) satisfies Record<string, SchemaType>;
@@ -0,0 +1,5 @@
1
+ import { SchemaType } from "./SchemaType.js";
2
+ import { SchemaTypeToAbiType } from "./SchemaTypeToAbiType.js";
3
+
4
+ export type AbiType = (typeof SchemaTypeToAbiType)[SchemaType];
5
+ export const AbiTypes = Object.values(SchemaTypeToAbiType);