@latticexyz/cli 2.0.0-alpha.53 → 2.0.0-alpha.55
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/dist/chunk-TPZUS44H.js +283 -0
- package/dist/mud.js +8 -8
- package/dist/render-ts/index.js +1 -1
- package/package.json +7 -7
- package/src/render-ts/schemaTypesToRecsTypeStrings.ts +136 -136
- package/dist/chunk-7GA2K5A6.js +0 -283
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatAndWriteTypescript,
|
|
3
|
+
resolveAbiOrUserType
|
|
4
|
+
} from "./chunk-5NC2OON2.js";
|
|
5
|
+
|
|
6
|
+
// src/render-ts/schemaTypesToRecsTypeStrings.ts
|
|
7
|
+
var schemaTypesToRecsTypeStrings = {
|
|
8
|
+
[0 /* UINT8 */]: "RecsType.Number",
|
|
9
|
+
[1 /* UINT16 */]: "RecsType.Number",
|
|
10
|
+
[2 /* UINT24 */]: "RecsType.Number",
|
|
11
|
+
[3 /* UINT32 */]: "RecsType.Number",
|
|
12
|
+
[4 /* UINT40 */]: "RecsType.Number",
|
|
13
|
+
[5 /* UINT48 */]: "RecsType.Number",
|
|
14
|
+
[6 /* UINT56 */]: "RecsType.BigInt",
|
|
15
|
+
[7 /* UINT64 */]: "RecsType.BigInt",
|
|
16
|
+
[8 /* UINT72 */]: "RecsType.BigInt",
|
|
17
|
+
[9 /* UINT80 */]: "RecsType.BigInt",
|
|
18
|
+
[10 /* UINT88 */]: "RecsType.BigInt",
|
|
19
|
+
[11 /* UINT96 */]: "RecsType.BigInt",
|
|
20
|
+
[12 /* UINT104 */]: "RecsType.BigInt",
|
|
21
|
+
[13 /* UINT112 */]: "RecsType.BigInt",
|
|
22
|
+
[14 /* UINT120 */]: "RecsType.BigInt",
|
|
23
|
+
[15 /* UINT128 */]: "RecsType.BigInt",
|
|
24
|
+
[16 /* UINT136 */]: "RecsType.BigInt",
|
|
25
|
+
[17 /* UINT144 */]: "RecsType.BigInt",
|
|
26
|
+
[18 /* UINT152 */]: "RecsType.BigInt",
|
|
27
|
+
[19 /* UINT160 */]: "RecsType.BigInt",
|
|
28
|
+
[20 /* UINT168 */]: "RecsType.BigInt",
|
|
29
|
+
[21 /* UINT176 */]: "RecsType.BigInt",
|
|
30
|
+
[22 /* UINT184 */]: "RecsType.BigInt",
|
|
31
|
+
[23 /* UINT192 */]: "RecsType.BigInt",
|
|
32
|
+
[24 /* UINT200 */]: "RecsType.BigInt",
|
|
33
|
+
[25 /* UINT208 */]: "RecsType.BigInt",
|
|
34
|
+
[26 /* UINT216 */]: "RecsType.BigInt",
|
|
35
|
+
[27 /* UINT224 */]: "RecsType.BigInt",
|
|
36
|
+
[28 /* UINT232 */]: "RecsType.BigInt",
|
|
37
|
+
[29 /* UINT240 */]: "RecsType.BigInt",
|
|
38
|
+
[30 /* UINT248 */]: "RecsType.BigInt",
|
|
39
|
+
[31 /* UINT256 */]: "RecsType.BigInt",
|
|
40
|
+
[32 /* INT8 */]: "RecsType.Number",
|
|
41
|
+
[33 /* INT16 */]: "RecsType.Number",
|
|
42
|
+
[34 /* INT24 */]: "RecsType.Number",
|
|
43
|
+
[35 /* INT32 */]: "RecsType.Number",
|
|
44
|
+
[36 /* INT40 */]: "RecsType.Number",
|
|
45
|
+
[37 /* INT48 */]: "RecsType.Number",
|
|
46
|
+
[38 /* INT56 */]: "RecsType.BigInt",
|
|
47
|
+
[39 /* INT64 */]: "RecsType.BigInt",
|
|
48
|
+
[40 /* INT72 */]: "RecsType.BigInt",
|
|
49
|
+
[41 /* INT80 */]: "RecsType.BigInt",
|
|
50
|
+
[42 /* INT88 */]: "RecsType.BigInt",
|
|
51
|
+
[43 /* INT96 */]: "RecsType.BigInt",
|
|
52
|
+
[44 /* INT104 */]: "RecsType.BigInt",
|
|
53
|
+
[45 /* INT112 */]: "RecsType.BigInt",
|
|
54
|
+
[46 /* INT120 */]: "RecsType.BigInt",
|
|
55
|
+
[47 /* INT128 */]: "RecsType.BigInt",
|
|
56
|
+
[48 /* INT136 */]: "RecsType.BigInt",
|
|
57
|
+
[49 /* INT144 */]: "RecsType.BigInt",
|
|
58
|
+
[50 /* INT152 */]: "RecsType.BigInt",
|
|
59
|
+
[51 /* INT160 */]: "RecsType.BigInt",
|
|
60
|
+
[52 /* INT168 */]: "RecsType.BigInt",
|
|
61
|
+
[53 /* INT176 */]: "RecsType.BigInt",
|
|
62
|
+
[54 /* INT184 */]: "RecsType.BigInt",
|
|
63
|
+
[55 /* INT192 */]: "RecsType.BigInt",
|
|
64
|
+
[56 /* INT200 */]: "RecsType.BigInt",
|
|
65
|
+
[57 /* INT208 */]: "RecsType.BigInt",
|
|
66
|
+
[58 /* INT216 */]: "RecsType.BigInt",
|
|
67
|
+
[59 /* INT224 */]: "RecsType.BigInt",
|
|
68
|
+
[60 /* INT232 */]: "RecsType.BigInt",
|
|
69
|
+
[61 /* INT240 */]: "RecsType.BigInt",
|
|
70
|
+
[62 /* INT248 */]: "RecsType.BigInt",
|
|
71
|
+
[63 /* INT256 */]: "RecsType.BigInt",
|
|
72
|
+
[64 /* BYTES1 */]: "RecsType.String",
|
|
73
|
+
[65 /* BYTES2 */]: "RecsType.String",
|
|
74
|
+
[66 /* BYTES3 */]: "RecsType.String",
|
|
75
|
+
[67 /* BYTES4 */]: "RecsType.String",
|
|
76
|
+
[68 /* BYTES5 */]: "RecsType.String",
|
|
77
|
+
[69 /* BYTES6 */]: "RecsType.String",
|
|
78
|
+
[70 /* BYTES7 */]: "RecsType.String",
|
|
79
|
+
[71 /* BYTES8 */]: "RecsType.String",
|
|
80
|
+
[72 /* BYTES9 */]: "RecsType.String",
|
|
81
|
+
[73 /* BYTES10 */]: "RecsType.String",
|
|
82
|
+
[74 /* BYTES11 */]: "RecsType.String",
|
|
83
|
+
[75 /* BYTES12 */]: "RecsType.String",
|
|
84
|
+
[76 /* BYTES13 */]: "RecsType.String",
|
|
85
|
+
[77 /* BYTES14 */]: "RecsType.String",
|
|
86
|
+
[78 /* BYTES15 */]: "RecsType.String",
|
|
87
|
+
[79 /* BYTES16 */]: "RecsType.String",
|
|
88
|
+
[80 /* BYTES17 */]: "RecsType.String",
|
|
89
|
+
[81 /* BYTES18 */]: "RecsType.String",
|
|
90
|
+
[82 /* BYTES19 */]: "RecsType.String",
|
|
91
|
+
[83 /* BYTES20 */]: "RecsType.String",
|
|
92
|
+
[84 /* BYTES21 */]: "RecsType.String",
|
|
93
|
+
[85 /* BYTES22 */]: "RecsType.String",
|
|
94
|
+
[86 /* BYTES23 */]: "RecsType.String",
|
|
95
|
+
[87 /* BYTES24 */]: "RecsType.String",
|
|
96
|
+
[88 /* BYTES25 */]: "RecsType.String",
|
|
97
|
+
[89 /* BYTES26 */]: "RecsType.String",
|
|
98
|
+
[90 /* BYTES27 */]: "RecsType.String",
|
|
99
|
+
[91 /* BYTES28 */]: "RecsType.String",
|
|
100
|
+
[92 /* BYTES29 */]: "RecsType.String",
|
|
101
|
+
[93 /* BYTES30 */]: "RecsType.String",
|
|
102
|
+
[94 /* BYTES31 */]: "RecsType.String",
|
|
103
|
+
[95 /* BYTES32 */]: "RecsType.String",
|
|
104
|
+
[96 /* BOOL */]: "RecsType.Boolean",
|
|
105
|
+
[97 /* ADDRESS */]: "RecsType.String",
|
|
106
|
+
[98 /* UINT8_ARRAY */]: "RecsType.NumberArray",
|
|
107
|
+
[99 /* UINT16_ARRAY */]: "RecsType.NumberArray",
|
|
108
|
+
[100 /* UINT24_ARRAY */]: "RecsType.NumberArray",
|
|
109
|
+
[101 /* UINT32_ARRAY */]: "RecsType.NumberArray",
|
|
110
|
+
[102 /* UINT40_ARRAY */]: "RecsType.NumberArray",
|
|
111
|
+
[103 /* UINT48_ARRAY */]: "RecsType.NumberArray",
|
|
112
|
+
[104 /* UINT56_ARRAY */]: "RecsType.BigIntArray",
|
|
113
|
+
[105 /* UINT64_ARRAY */]: "RecsType.BigIntArray",
|
|
114
|
+
[106 /* UINT72_ARRAY */]: "RecsType.BigIntArray",
|
|
115
|
+
[107 /* UINT80_ARRAY */]: "RecsType.BigIntArray",
|
|
116
|
+
[108 /* UINT88_ARRAY */]: "RecsType.BigIntArray",
|
|
117
|
+
[109 /* UINT96_ARRAY */]: "RecsType.BigIntArray",
|
|
118
|
+
[110 /* UINT104_ARRAY */]: "RecsType.BigIntArray",
|
|
119
|
+
[111 /* UINT112_ARRAY */]: "RecsType.BigIntArray",
|
|
120
|
+
[112 /* UINT120_ARRAY */]: "RecsType.BigIntArray",
|
|
121
|
+
[113 /* UINT128_ARRAY */]: "RecsType.BigIntArray",
|
|
122
|
+
[114 /* UINT136_ARRAY */]: "RecsType.BigIntArray",
|
|
123
|
+
[115 /* UINT144_ARRAY */]: "RecsType.BigIntArray",
|
|
124
|
+
[116 /* UINT152_ARRAY */]: "RecsType.BigIntArray",
|
|
125
|
+
[117 /* UINT160_ARRAY */]: "RecsType.BigIntArray",
|
|
126
|
+
[118 /* UINT168_ARRAY */]: "RecsType.BigIntArray",
|
|
127
|
+
[119 /* UINT176_ARRAY */]: "RecsType.BigIntArray",
|
|
128
|
+
[120 /* UINT184_ARRAY */]: "RecsType.BigIntArray",
|
|
129
|
+
[121 /* UINT192_ARRAY */]: "RecsType.BigIntArray",
|
|
130
|
+
[122 /* UINT200_ARRAY */]: "RecsType.BigIntArray",
|
|
131
|
+
[123 /* UINT208_ARRAY */]: "RecsType.BigIntArray",
|
|
132
|
+
[124 /* UINT216_ARRAY */]: "RecsType.BigIntArray",
|
|
133
|
+
[125 /* UINT224_ARRAY */]: "RecsType.BigIntArray",
|
|
134
|
+
[126 /* UINT232_ARRAY */]: "RecsType.BigIntArray",
|
|
135
|
+
[127 /* UINT240_ARRAY */]: "RecsType.BigIntArray",
|
|
136
|
+
[128 /* UINT248_ARRAY */]: "RecsType.BigIntArray",
|
|
137
|
+
[129 /* UINT256_ARRAY */]: "RecsType.BigIntArray",
|
|
138
|
+
[130 /* INT8_ARRAY */]: "RecsType.NumberArray",
|
|
139
|
+
[131 /* INT16_ARRAY */]: "RecsType.NumberArray",
|
|
140
|
+
[132 /* INT24_ARRAY */]: "RecsType.NumberArray",
|
|
141
|
+
[133 /* INT32_ARRAY */]: "RecsType.NumberArray",
|
|
142
|
+
[134 /* INT40_ARRAY */]: "RecsType.NumberArray",
|
|
143
|
+
[135 /* INT48_ARRAY */]: "RecsType.NumberArray",
|
|
144
|
+
[136 /* INT56_ARRAY */]: "RecsType.BigIntArray",
|
|
145
|
+
[137 /* INT64_ARRAY */]: "RecsType.BigIntArray",
|
|
146
|
+
[138 /* INT72_ARRAY */]: "RecsType.BigIntArray",
|
|
147
|
+
[139 /* INT80_ARRAY */]: "RecsType.BigIntArray",
|
|
148
|
+
[140 /* INT88_ARRAY */]: "RecsType.BigIntArray",
|
|
149
|
+
[141 /* INT96_ARRAY */]: "RecsType.BigIntArray",
|
|
150
|
+
[142 /* INT104_ARRAY */]: "RecsType.BigIntArray",
|
|
151
|
+
[143 /* INT112_ARRAY */]: "RecsType.BigIntArray",
|
|
152
|
+
[144 /* INT120_ARRAY */]: "RecsType.BigIntArray",
|
|
153
|
+
[145 /* INT128_ARRAY */]: "RecsType.BigIntArray",
|
|
154
|
+
[146 /* INT136_ARRAY */]: "RecsType.BigIntArray",
|
|
155
|
+
[147 /* INT144_ARRAY */]: "RecsType.BigIntArray",
|
|
156
|
+
[148 /* INT152_ARRAY */]: "RecsType.BigIntArray",
|
|
157
|
+
[149 /* INT160_ARRAY */]: "RecsType.BigIntArray",
|
|
158
|
+
[150 /* INT168_ARRAY */]: "RecsType.BigIntArray",
|
|
159
|
+
[151 /* INT176_ARRAY */]: "RecsType.BigIntArray",
|
|
160
|
+
[152 /* INT184_ARRAY */]: "RecsType.BigIntArray",
|
|
161
|
+
[153 /* INT192_ARRAY */]: "RecsType.BigIntArray",
|
|
162
|
+
[154 /* INT200_ARRAY */]: "RecsType.BigIntArray",
|
|
163
|
+
[155 /* INT208_ARRAY */]: "RecsType.BigIntArray",
|
|
164
|
+
[156 /* INT216_ARRAY */]: "RecsType.BigIntArray",
|
|
165
|
+
[157 /* INT224_ARRAY */]: "RecsType.BigIntArray",
|
|
166
|
+
[158 /* INT232_ARRAY */]: "RecsType.BigIntArray",
|
|
167
|
+
[159 /* INT240_ARRAY */]: "RecsType.BigIntArray",
|
|
168
|
+
[160 /* INT248_ARRAY */]: "RecsType.BigIntArray",
|
|
169
|
+
[161 /* INT256_ARRAY */]: "RecsType.BigIntArray",
|
|
170
|
+
[162 /* BYTES1_ARRAY */]: "RecsType.BigIntArray",
|
|
171
|
+
[163 /* BYTES2_ARRAY */]: "RecsType.BigIntArray",
|
|
172
|
+
[164 /* BYTES3_ARRAY */]: "RecsType.BigIntArray",
|
|
173
|
+
[165 /* BYTES4_ARRAY */]: "RecsType.BigIntArray",
|
|
174
|
+
[166 /* BYTES5_ARRAY */]: "RecsType.BigIntArray",
|
|
175
|
+
[167 /* BYTES6_ARRAY */]: "RecsType.BigIntArray",
|
|
176
|
+
[168 /* BYTES7_ARRAY */]: "RecsType.BigIntArray",
|
|
177
|
+
[169 /* BYTES8_ARRAY */]: "RecsType.BigIntArray",
|
|
178
|
+
[170 /* BYTES9_ARRAY */]: "RecsType.BigIntArray",
|
|
179
|
+
[171 /* BYTES10_ARRAY */]: "RecsType.BigIntArray",
|
|
180
|
+
[172 /* BYTES11_ARRAY */]: "RecsType.BigIntArray",
|
|
181
|
+
[173 /* BYTES12_ARRAY */]: "RecsType.BigIntArray",
|
|
182
|
+
[174 /* BYTES13_ARRAY */]: "RecsType.BigIntArray",
|
|
183
|
+
[175 /* BYTES14_ARRAY */]: "RecsType.BigIntArray",
|
|
184
|
+
[176 /* BYTES15_ARRAY */]: "RecsType.BigIntArray",
|
|
185
|
+
[177 /* BYTES16_ARRAY */]: "RecsType.BigIntArray",
|
|
186
|
+
[178 /* BYTES17_ARRAY */]: "RecsType.BigIntArray",
|
|
187
|
+
[179 /* BYTES18_ARRAY */]: "RecsType.BigIntArray",
|
|
188
|
+
[180 /* BYTES19_ARRAY */]: "RecsType.BigIntArray",
|
|
189
|
+
[181 /* BYTES20_ARRAY */]: "RecsType.BigIntArray",
|
|
190
|
+
[182 /* BYTES21_ARRAY */]: "RecsType.BigIntArray",
|
|
191
|
+
[183 /* BYTES22_ARRAY */]: "RecsType.BigIntArray",
|
|
192
|
+
[184 /* BYTES23_ARRAY */]: "RecsType.BigIntArray",
|
|
193
|
+
[185 /* BYTES24_ARRAY */]: "RecsType.BigIntArray",
|
|
194
|
+
[186 /* BYTES25_ARRAY */]: "RecsType.BigIntArray",
|
|
195
|
+
[187 /* BYTES26_ARRAY */]: "RecsType.BigIntArray",
|
|
196
|
+
[188 /* BYTES27_ARRAY */]: "RecsType.BigIntArray",
|
|
197
|
+
[189 /* BYTES28_ARRAY */]: "RecsType.BigIntArray",
|
|
198
|
+
[190 /* BYTES29_ARRAY */]: "RecsType.BigIntArray",
|
|
199
|
+
[191 /* BYTES30_ARRAY */]: "RecsType.BigIntArray",
|
|
200
|
+
[192 /* BYTES31_ARRAY */]: "RecsType.BigIntArray",
|
|
201
|
+
[193 /* BYTES32_ARRAY */]: "RecsType.BigIntArray",
|
|
202
|
+
[194 /* BOOL_ARRAY */]: "RecsType.T",
|
|
203
|
+
// no boolean array
|
|
204
|
+
[195 /* ADDRESS_ARRAY */]: "RecsType.StringArray",
|
|
205
|
+
[196 /* BYTES */]: "RecsType.String",
|
|
206
|
+
[197 /* STRING */]: "RecsType.String"
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// src/render-ts/recsV1TableOptions.ts
|
|
210
|
+
function getRecsV1TableOptions(config) {
|
|
211
|
+
const tableOptions = [];
|
|
212
|
+
for (const tableName of Object.keys(config.tables)) {
|
|
213
|
+
const tableData = config.tables[tableName];
|
|
214
|
+
const fields = Object.keys(tableData.schema).map((name) => {
|
|
215
|
+
const abiOrUserType = tableData.schema[name];
|
|
216
|
+
const { schemaType } = resolveAbiOrUserType(abiOrUserType, config);
|
|
217
|
+
const recsTypeString = schemaTypesToRecsTypeStrings[schemaType];
|
|
218
|
+
return {
|
|
219
|
+
recsTypeString,
|
|
220
|
+
name
|
|
221
|
+
};
|
|
222
|
+
});
|
|
223
|
+
if (tableData.tableIdArgument)
|
|
224
|
+
continue;
|
|
225
|
+
const staticResourceData = {
|
|
226
|
+
namespace: config.namespace,
|
|
227
|
+
fileSelector: tableData.fileSelector
|
|
228
|
+
};
|
|
229
|
+
tableOptions.push({
|
|
230
|
+
tableName,
|
|
231
|
+
fields,
|
|
232
|
+
staticResourceData
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
tables: tableOptions
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// src/render-ts/renderRecsV1Tables.ts
|
|
241
|
+
function renderRecsV1Tables(options) {
|
|
242
|
+
const { tables } = options;
|
|
243
|
+
return `/* Autogenerated file. Do not edit manually. */
|
|
244
|
+
|
|
245
|
+
import { TableId } from "@latticexyz/utils";
|
|
246
|
+
import { defineComponent, Type as RecsType, World } from "@latticexyz/recs";
|
|
247
|
+
|
|
248
|
+
export function defineContractComponents(world: World) {
|
|
249
|
+
return {
|
|
250
|
+
${tables.map((table) => `${table.tableName}: ${renderDefineComponent(table)},`).join("")}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
`;
|
|
254
|
+
}
|
|
255
|
+
function renderDefineComponent(table) {
|
|
256
|
+
const { namespace, fileSelector } = table.staticResourceData;
|
|
257
|
+
return `
|
|
258
|
+
(() => {
|
|
259
|
+
const tableId = new TableId("${namespace}", "${fileSelector}");
|
|
260
|
+
return defineComponent(world, {
|
|
261
|
+
${table.fields.map(({ name, recsTypeString }) => `${name}: ${recsTypeString},`).join("")}
|
|
262
|
+
}, {
|
|
263
|
+
metadata: { contractId: tableId.toHexString(), tableId: tableId.toString() },
|
|
264
|
+
});
|
|
265
|
+
})()
|
|
266
|
+
`;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// src/render-ts/tsgen.ts
|
|
270
|
+
import path from "path";
|
|
271
|
+
async function tsgen(config, outDirectory) {
|
|
272
|
+
const fullOutputPath = path.join(outDirectory, `contractComponents.ts`);
|
|
273
|
+
const options = getRecsV1TableOptions(config);
|
|
274
|
+
const output = renderRecsV1Tables(options);
|
|
275
|
+
formatAndWriteTypescript(output, fullOutputPath, "Generated ts definition files");
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export {
|
|
279
|
+
schemaTypesToRecsTypeStrings,
|
|
280
|
+
getRecsV1TableOptions,
|
|
281
|
+
renderRecsV1Tables,
|
|
282
|
+
tsgen
|
|
283
|
+
};
|
package/dist/mud.js
CHANGED
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-MXDV47JM.js";
|
|
39
39
|
import {
|
|
40
40
|
tsgen
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-TPZUS44H.js";
|
|
42
42
|
import {
|
|
43
43
|
formatAndWriteSolidity
|
|
44
44
|
} from "./chunk-5NC2OON2.js";
|
|
@@ -11759,7 +11759,7 @@ import path8 from "path";
|
|
|
11759
11759
|
// package.json
|
|
11760
11760
|
var package_default = {
|
|
11761
11761
|
name: "@latticexyz/cli",
|
|
11762
|
-
version: "2.0.0-alpha.
|
|
11762
|
+
version: "2.0.0-alpha.55+29fefae4",
|
|
11763
11763
|
description: "Command line interface for mud",
|
|
11764
11764
|
main: "dist/index.js",
|
|
11765
11765
|
types: "dist/index.d.ts",
|
|
@@ -11786,7 +11786,7 @@ var package_default = {
|
|
|
11786
11786
|
release: "npm publish --access=public"
|
|
11787
11787
|
},
|
|
11788
11788
|
devDependencies: {
|
|
11789
|
-
"@latticexyz/store": "^2.0.0-alpha.
|
|
11789
|
+
"@latticexyz/store": "^2.0.0-alpha.55+29fefae4",
|
|
11790
11790
|
"@types/ejs": "^3.1.1",
|
|
11791
11791
|
"@types/glob": "^7.2.0",
|
|
11792
11792
|
"@types/node": "^17.0.34",
|
|
@@ -11799,10 +11799,10 @@ var package_default = {
|
|
|
11799
11799
|
dependencies: {
|
|
11800
11800
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
11801
11801
|
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
|
11802
|
-
"@latticexyz/schema-type": "^2.0.0-alpha.
|
|
11803
|
-
"@latticexyz/services": "^2.0.0-alpha.
|
|
11804
|
-
"@latticexyz/solecs": "^2.0.0-alpha.
|
|
11805
|
-
"@latticexyz/std-contracts": "^2.0.0-alpha.
|
|
11802
|
+
"@latticexyz/schema-type": "^2.0.0-alpha.55+29fefae4",
|
|
11803
|
+
"@latticexyz/services": "^2.0.0-alpha.55+29fefae4",
|
|
11804
|
+
"@latticexyz/solecs": "^2.0.0-alpha.55+29fefae4",
|
|
11805
|
+
"@latticexyz/std-contracts": "^2.0.0-alpha.55+29fefae4",
|
|
11806
11806
|
"@solidity-parser/parser": "^0.16.0",
|
|
11807
11807
|
"@typechain/ethers-v5": "^10.1.1",
|
|
11808
11808
|
chalk: "^5.0.1",
|
|
@@ -11829,7 +11829,7 @@ var package_default = {
|
|
|
11829
11829
|
zod: "^3.21.4",
|
|
11830
11830
|
"zod-validation-error": "^1.0.1"
|
|
11831
11831
|
},
|
|
11832
|
-
gitHead: "
|
|
11832
|
+
gitHead: "29fefae43d96b107a66b9fd365b566cb8c466f8b"
|
|
11833
11833
|
};
|
|
11834
11834
|
|
|
11835
11835
|
// src/commands/set-version.ts
|
package/dist/render-ts/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@latticexyz/cli",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.55+29fefae4",
|
|
4
4
|
"description": "Command line interface for mud",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"release": "npm publish --access=public"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@latticexyz/store": "^2.0.0-alpha.
|
|
30
|
+
"@latticexyz/store": "^2.0.0-alpha.55+29fefae4",
|
|
31
31
|
"@types/ejs": "^3.1.1",
|
|
32
32
|
"@types/glob": "^7.2.0",
|
|
33
33
|
"@types/node": "^17.0.34",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
42
42
|
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
|
43
|
-
"@latticexyz/schema-type": "^2.0.0-alpha.
|
|
44
|
-
"@latticexyz/services": "^2.0.0-alpha.
|
|
45
|
-
"@latticexyz/solecs": "^2.0.0-alpha.
|
|
46
|
-
"@latticexyz/std-contracts": "^2.0.0-alpha.
|
|
43
|
+
"@latticexyz/schema-type": "^2.0.0-alpha.55+29fefae4",
|
|
44
|
+
"@latticexyz/services": "^2.0.0-alpha.55+29fefae4",
|
|
45
|
+
"@latticexyz/solecs": "^2.0.0-alpha.55+29fefae4",
|
|
46
|
+
"@latticexyz/std-contracts": "^2.0.0-alpha.55+29fefae4",
|
|
47
47
|
"@solidity-parser/parser": "^0.16.0",
|
|
48
48
|
"@typechain/ethers-v5": "^10.1.1",
|
|
49
49
|
"chalk": "^5.0.1",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"zod": "^3.21.4",
|
|
71
71
|
"zod-validation-error": "^1.0.1"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "29fefae43d96b107a66b9fd365b566cb8c466f8b"
|
|
74
74
|
}
|
|
@@ -7,64 +7,64 @@ export const schemaTypesToRecsTypeStrings: Record<SchemaType, string> = {
|
|
|
7
7
|
[SchemaType.UINT32]: "RecsType.Number",
|
|
8
8
|
[SchemaType.UINT40]: "RecsType.Number",
|
|
9
9
|
[SchemaType.UINT48]: "RecsType.Number",
|
|
10
|
-
[SchemaType.UINT56]: "RecsType.
|
|
11
|
-
[SchemaType.UINT64]: "RecsType.
|
|
12
|
-
[SchemaType.UINT72]: "RecsType.
|
|
13
|
-
[SchemaType.UINT80]: "RecsType.
|
|
14
|
-
[SchemaType.UINT88]: "RecsType.
|
|
15
|
-
[SchemaType.UINT96]: "RecsType.
|
|
16
|
-
[SchemaType.UINT104]: "RecsType.
|
|
17
|
-
[SchemaType.UINT112]: "RecsType.
|
|
18
|
-
[SchemaType.UINT120]: "RecsType.
|
|
19
|
-
[SchemaType.UINT128]: "RecsType.
|
|
20
|
-
[SchemaType.UINT136]: "RecsType.
|
|
21
|
-
[SchemaType.UINT144]: "RecsType.
|
|
22
|
-
[SchemaType.UINT152]: "RecsType.
|
|
23
|
-
[SchemaType.UINT160]: "RecsType.
|
|
24
|
-
[SchemaType.UINT168]: "RecsType.
|
|
25
|
-
[SchemaType.UINT176]: "RecsType.
|
|
26
|
-
[SchemaType.UINT184]: "RecsType.
|
|
27
|
-
[SchemaType.UINT192]: "RecsType.
|
|
28
|
-
[SchemaType.UINT200]: "RecsType.
|
|
29
|
-
[SchemaType.UINT208]: "RecsType.
|
|
30
|
-
[SchemaType.UINT216]: "RecsType.
|
|
31
|
-
[SchemaType.UINT224]: "RecsType.
|
|
32
|
-
[SchemaType.UINT232]: "RecsType.
|
|
33
|
-
[SchemaType.UINT240]: "RecsType.
|
|
34
|
-
[SchemaType.UINT248]: "RecsType.
|
|
35
|
-
[SchemaType.UINT256]: "RecsType.
|
|
10
|
+
[SchemaType.UINT56]: "RecsType.BigInt",
|
|
11
|
+
[SchemaType.UINT64]: "RecsType.BigInt",
|
|
12
|
+
[SchemaType.UINT72]: "RecsType.BigInt",
|
|
13
|
+
[SchemaType.UINT80]: "RecsType.BigInt",
|
|
14
|
+
[SchemaType.UINT88]: "RecsType.BigInt",
|
|
15
|
+
[SchemaType.UINT96]: "RecsType.BigInt",
|
|
16
|
+
[SchemaType.UINT104]: "RecsType.BigInt",
|
|
17
|
+
[SchemaType.UINT112]: "RecsType.BigInt",
|
|
18
|
+
[SchemaType.UINT120]: "RecsType.BigInt",
|
|
19
|
+
[SchemaType.UINT128]: "RecsType.BigInt",
|
|
20
|
+
[SchemaType.UINT136]: "RecsType.BigInt",
|
|
21
|
+
[SchemaType.UINT144]: "RecsType.BigInt",
|
|
22
|
+
[SchemaType.UINT152]: "RecsType.BigInt",
|
|
23
|
+
[SchemaType.UINT160]: "RecsType.BigInt",
|
|
24
|
+
[SchemaType.UINT168]: "RecsType.BigInt",
|
|
25
|
+
[SchemaType.UINT176]: "RecsType.BigInt",
|
|
26
|
+
[SchemaType.UINT184]: "RecsType.BigInt",
|
|
27
|
+
[SchemaType.UINT192]: "RecsType.BigInt",
|
|
28
|
+
[SchemaType.UINT200]: "RecsType.BigInt",
|
|
29
|
+
[SchemaType.UINT208]: "RecsType.BigInt",
|
|
30
|
+
[SchemaType.UINT216]: "RecsType.BigInt",
|
|
31
|
+
[SchemaType.UINT224]: "RecsType.BigInt",
|
|
32
|
+
[SchemaType.UINT232]: "RecsType.BigInt",
|
|
33
|
+
[SchemaType.UINT240]: "RecsType.BigInt",
|
|
34
|
+
[SchemaType.UINT248]: "RecsType.BigInt",
|
|
35
|
+
[SchemaType.UINT256]: "RecsType.BigInt",
|
|
36
36
|
[SchemaType.INT8]: "RecsType.Number",
|
|
37
37
|
[SchemaType.INT16]: "RecsType.Number",
|
|
38
38
|
[SchemaType.INT24]: "RecsType.Number",
|
|
39
39
|
[SchemaType.INT32]: "RecsType.Number",
|
|
40
40
|
[SchemaType.INT40]: "RecsType.Number",
|
|
41
41
|
[SchemaType.INT48]: "RecsType.Number",
|
|
42
|
-
[SchemaType.INT56]: "RecsType.
|
|
43
|
-
[SchemaType.INT64]: "RecsType.
|
|
44
|
-
[SchemaType.INT72]: "RecsType.
|
|
45
|
-
[SchemaType.INT80]: "RecsType.
|
|
46
|
-
[SchemaType.INT88]: "RecsType.
|
|
47
|
-
[SchemaType.INT96]: "RecsType.
|
|
48
|
-
[SchemaType.INT104]: "RecsType.
|
|
49
|
-
[SchemaType.INT112]: "RecsType.
|
|
50
|
-
[SchemaType.INT120]: "RecsType.
|
|
51
|
-
[SchemaType.INT128]: "RecsType.
|
|
52
|
-
[SchemaType.INT136]: "RecsType.
|
|
53
|
-
[SchemaType.INT144]: "RecsType.
|
|
54
|
-
[SchemaType.INT152]: "RecsType.
|
|
55
|
-
[SchemaType.INT160]: "RecsType.
|
|
56
|
-
[SchemaType.INT168]: "RecsType.
|
|
57
|
-
[SchemaType.INT176]: "RecsType.
|
|
58
|
-
[SchemaType.INT184]: "RecsType.
|
|
59
|
-
[SchemaType.INT192]: "RecsType.
|
|
60
|
-
[SchemaType.INT200]: "RecsType.
|
|
61
|
-
[SchemaType.INT208]: "RecsType.
|
|
62
|
-
[SchemaType.INT216]: "RecsType.
|
|
63
|
-
[SchemaType.INT224]: "RecsType.
|
|
64
|
-
[SchemaType.INT232]: "RecsType.
|
|
65
|
-
[SchemaType.INT240]: "RecsType.
|
|
66
|
-
[SchemaType.INT248]: "RecsType.
|
|
67
|
-
[SchemaType.INT256]: "RecsType.
|
|
42
|
+
[SchemaType.INT56]: "RecsType.BigInt",
|
|
43
|
+
[SchemaType.INT64]: "RecsType.BigInt",
|
|
44
|
+
[SchemaType.INT72]: "RecsType.BigInt",
|
|
45
|
+
[SchemaType.INT80]: "RecsType.BigInt",
|
|
46
|
+
[SchemaType.INT88]: "RecsType.BigInt",
|
|
47
|
+
[SchemaType.INT96]: "RecsType.BigInt",
|
|
48
|
+
[SchemaType.INT104]: "RecsType.BigInt",
|
|
49
|
+
[SchemaType.INT112]: "RecsType.BigInt",
|
|
50
|
+
[SchemaType.INT120]: "RecsType.BigInt",
|
|
51
|
+
[SchemaType.INT128]: "RecsType.BigInt",
|
|
52
|
+
[SchemaType.INT136]: "RecsType.BigInt",
|
|
53
|
+
[SchemaType.INT144]: "RecsType.BigInt",
|
|
54
|
+
[SchemaType.INT152]: "RecsType.BigInt",
|
|
55
|
+
[SchemaType.INT160]: "RecsType.BigInt",
|
|
56
|
+
[SchemaType.INT168]: "RecsType.BigInt",
|
|
57
|
+
[SchemaType.INT176]: "RecsType.BigInt",
|
|
58
|
+
[SchemaType.INT184]: "RecsType.BigInt",
|
|
59
|
+
[SchemaType.INT192]: "RecsType.BigInt",
|
|
60
|
+
[SchemaType.INT200]: "RecsType.BigInt",
|
|
61
|
+
[SchemaType.INT208]: "RecsType.BigInt",
|
|
62
|
+
[SchemaType.INT216]: "RecsType.BigInt",
|
|
63
|
+
[SchemaType.INT224]: "RecsType.BigInt",
|
|
64
|
+
[SchemaType.INT232]: "RecsType.BigInt",
|
|
65
|
+
[SchemaType.INT240]: "RecsType.BigInt",
|
|
66
|
+
[SchemaType.INT248]: "RecsType.BigInt",
|
|
67
|
+
[SchemaType.INT256]: "RecsType.BigInt",
|
|
68
68
|
[SchemaType.BYTES1]: "RecsType.String",
|
|
69
69
|
[SchemaType.BYTES2]: "RecsType.String",
|
|
70
70
|
[SchemaType.BYTES3]: "RecsType.String",
|
|
@@ -105,96 +105,96 @@ export const schemaTypesToRecsTypeStrings: Record<SchemaType, string> = {
|
|
|
105
105
|
[SchemaType.UINT32_ARRAY]: "RecsType.NumberArray",
|
|
106
106
|
[SchemaType.UINT40_ARRAY]: "RecsType.NumberArray",
|
|
107
107
|
[SchemaType.UINT48_ARRAY]: "RecsType.NumberArray",
|
|
108
|
-
[SchemaType.UINT56_ARRAY]: "RecsType.
|
|
109
|
-
[SchemaType.UINT64_ARRAY]: "RecsType.
|
|
110
|
-
[SchemaType.UINT72_ARRAY]: "RecsType.
|
|
111
|
-
[SchemaType.UINT80_ARRAY]: "RecsType.
|
|
112
|
-
[SchemaType.UINT88_ARRAY]: "RecsType.
|
|
113
|
-
[SchemaType.UINT96_ARRAY]: "RecsType.
|
|
114
|
-
[SchemaType.UINT104_ARRAY]: "RecsType.
|
|
115
|
-
[SchemaType.UINT112_ARRAY]: "RecsType.
|
|
116
|
-
[SchemaType.UINT120_ARRAY]: "RecsType.
|
|
117
|
-
[SchemaType.UINT128_ARRAY]: "RecsType.
|
|
118
|
-
[SchemaType.UINT136_ARRAY]: "RecsType.
|
|
119
|
-
[SchemaType.UINT144_ARRAY]: "RecsType.
|
|
120
|
-
[SchemaType.UINT152_ARRAY]: "RecsType.
|
|
121
|
-
[SchemaType.UINT160_ARRAY]: "RecsType.
|
|
122
|
-
[SchemaType.UINT168_ARRAY]: "RecsType.
|
|
123
|
-
[SchemaType.UINT176_ARRAY]: "RecsType.
|
|
124
|
-
[SchemaType.UINT184_ARRAY]: "RecsType.
|
|
125
|
-
[SchemaType.UINT192_ARRAY]: "RecsType.
|
|
126
|
-
[SchemaType.UINT200_ARRAY]: "RecsType.
|
|
127
|
-
[SchemaType.UINT208_ARRAY]: "RecsType.
|
|
128
|
-
[SchemaType.UINT216_ARRAY]: "RecsType.
|
|
129
|
-
[SchemaType.UINT224_ARRAY]: "RecsType.
|
|
130
|
-
[SchemaType.UINT232_ARRAY]: "RecsType.
|
|
131
|
-
[SchemaType.UINT240_ARRAY]: "RecsType.
|
|
132
|
-
[SchemaType.UINT248_ARRAY]: "RecsType.
|
|
133
|
-
[SchemaType.UINT256_ARRAY]: "RecsType.
|
|
108
|
+
[SchemaType.UINT56_ARRAY]: "RecsType.BigIntArray",
|
|
109
|
+
[SchemaType.UINT64_ARRAY]: "RecsType.BigIntArray",
|
|
110
|
+
[SchemaType.UINT72_ARRAY]: "RecsType.BigIntArray",
|
|
111
|
+
[SchemaType.UINT80_ARRAY]: "RecsType.BigIntArray",
|
|
112
|
+
[SchemaType.UINT88_ARRAY]: "RecsType.BigIntArray",
|
|
113
|
+
[SchemaType.UINT96_ARRAY]: "RecsType.BigIntArray",
|
|
114
|
+
[SchemaType.UINT104_ARRAY]: "RecsType.BigIntArray",
|
|
115
|
+
[SchemaType.UINT112_ARRAY]: "RecsType.BigIntArray",
|
|
116
|
+
[SchemaType.UINT120_ARRAY]: "RecsType.BigIntArray",
|
|
117
|
+
[SchemaType.UINT128_ARRAY]: "RecsType.BigIntArray",
|
|
118
|
+
[SchemaType.UINT136_ARRAY]: "RecsType.BigIntArray",
|
|
119
|
+
[SchemaType.UINT144_ARRAY]: "RecsType.BigIntArray",
|
|
120
|
+
[SchemaType.UINT152_ARRAY]: "RecsType.BigIntArray",
|
|
121
|
+
[SchemaType.UINT160_ARRAY]: "RecsType.BigIntArray",
|
|
122
|
+
[SchemaType.UINT168_ARRAY]: "RecsType.BigIntArray",
|
|
123
|
+
[SchemaType.UINT176_ARRAY]: "RecsType.BigIntArray",
|
|
124
|
+
[SchemaType.UINT184_ARRAY]: "RecsType.BigIntArray",
|
|
125
|
+
[SchemaType.UINT192_ARRAY]: "RecsType.BigIntArray",
|
|
126
|
+
[SchemaType.UINT200_ARRAY]: "RecsType.BigIntArray",
|
|
127
|
+
[SchemaType.UINT208_ARRAY]: "RecsType.BigIntArray",
|
|
128
|
+
[SchemaType.UINT216_ARRAY]: "RecsType.BigIntArray",
|
|
129
|
+
[SchemaType.UINT224_ARRAY]: "RecsType.BigIntArray",
|
|
130
|
+
[SchemaType.UINT232_ARRAY]: "RecsType.BigIntArray",
|
|
131
|
+
[SchemaType.UINT240_ARRAY]: "RecsType.BigIntArray",
|
|
132
|
+
[SchemaType.UINT248_ARRAY]: "RecsType.BigIntArray",
|
|
133
|
+
[SchemaType.UINT256_ARRAY]: "RecsType.BigIntArray",
|
|
134
134
|
[SchemaType.INT8_ARRAY]: "RecsType.NumberArray",
|
|
135
135
|
[SchemaType.INT16_ARRAY]: "RecsType.NumberArray",
|
|
136
136
|
[SchemaType.INT24_ARRAY]: "RecsType.NumberArray",
|
|
137
137
|
[SchemaType.INT32_ARRAY]: "RecsType.NumberArray",
|
|
138
138
|
[SchemaType.INT40_ARRAY]: "RecsType.NumberArray",
|
|
139
139
|
[SchemaType.INT48_ARRAY]: "RecsType.NumberArray",
|
|
140
|
-
[SchemaType.INT56_ARRAY]: "RecsType.
|
|
141
|
-
[SchemaType.INT64_ARRAY]: "RecsType.
|
|
142
|
-
[SchemaType.INT72_ARRAY]: "RecsType.
|
|
143
|
-
[SchemaType.INT80_ARRAY]: "RecsType.
|
|
144
|
-
[SchemaType.INT88_ARRAY]: "RecsType.
|
|
145
|
-
[SchemaType.INT96_ARRAY]: "RecsType.
|
|
146
|
-
[SchemaType.INT104_ARRAY]: "RecsType.
|
|
147
|
-
[SchemaType.INT112_ARRAY]: "RecsType.
|
|
148
|
-
[SchemaType.INT120_ARRAY]: "RecsType.
|
|
149
|
-
[SchemaType.INT128_ARRAY]: "RecsType.
|
|
150
|
-
[SchemaType.INT136_ARRAY]: "RecsType.
|
|
151
|
-
[SchemaType.INT144_ARRAY]: "RecsType.
|
|
152
|
-
[SchemaType.INT152_ARRAY]: "RecsType.
|
|
153
|
-
[SchemaType.INT160_ARRAY]: "RecsType.
|
|
154
|
-
[SchemaType.INT168_ARRAY]: "RecsType.
|
|
155
|
-
[SchemaType.INT176_ARRAY]: "RecsType.
|
|
156
|
-
[SchemaType.INT184_ARRAY]: "RecsType.
|
|
157
|
-
[SchemaType.INT192_ARRAY]: "RecsType.
|
|
158
|
-
[SchemaType.INT200_ARRAY]: "RecsType.
|
|
159
|
-
[SchemaType.INT208_ARRAY]: "RecsType.
|
|
160
|
-
[SchemaType.INT216_ARRAY]: "RecsType.
|
|
161
|
-
[SchemaType.INT224_ARRAY]: "RecsType.
|
|
162
|
-
[SchemaType.INT232_ARRAY]: "RecsType.
|
|
163
|
-
[SchemaType.INT240_ARRAY]: "RecsType.
|
|
164
|
-
[SchemaType.INT248_ARRAY]: "RecsType.
|
|
165
|
-
[SchemaType.INT256_ARRAY]: "RecsType.
|
|
166
|
-
[SchemaType.BYTES1_ARRAY]: "RecsType.
|
|
167
|
-
[SchemaType.BYTES2_ARRAY]: "RecsType.
|
|
168
|
-
[SchemaType.BYTES3_ARRAY]: "RecsType.
|
|
169
|
-
[SchemaType.BYTES4_ARRAY]: "RecsType.
|
|
170
|
-
[SchemaType.BYTES5_ARRAY]: "RecsType.
|
|
171
|
-
[SchemaType.BYTES6_ARRAY]: "RecsType.
|
|
172
|
-
[SchemaType.BYTES7_ARRAY]: "RecsType.
|
|
173
|
-
[SchemaType.BYTES8_ARRAY]: "RecsType.
|
|
174
|
-
[SchemaType.BYTES9_ARRAY]: "RecsType.
|
|
175
|
-
[SchemaType.BYTES10_ARRAY]: "RecsType.
|
|
176
|
-
[SchemaType.BYTES11_ARRAY]: "RecsType.
|
|
177
|
-
[SchemaType.BYTES12_ARRAY]: "RecsType.
|
|
178
|
-
[SchemaType.BYTES13_ARRAY]: "RecsType.
|
|
179
|
-
[SchemaType.BYTES14_ARRAY]: "RecsType.
|
|
180
|
-
[SchemaType.BYTES15_ARRAY]: "RecsType.
|
|
181
|
-
[SchemaType.BYTES16_ARRAY]: "RecsType.
|
|
182
|
-
[SchemaType.BYTES17_ARRAY]: "RecsType.
|
|
183
|
-
[SchemaType.BYTES18_ARRAY]: "RecsType.
|
|
184
|
-
[SchemaType.BYTES19_ARRAY]: "RecsType.
|
|
185
|
-
[SchemaType.BYTES20_ARRAY]: "RecsType.
|
|
186
|
-
[SchemaType.BYTES21_ARRAY]: "RecsType.
|
|
187
|
-
[SchemaType.BYTES22_ARRAY]: "RecsType.
|
|
188
|
-
[SchemaType.BYTES23_ARRAY]: "RecsType.
|
|
189
|
-
[SchemaType.BYTES24_ARRAY]: "RecsType.
|
|
190
|
-
[SchemaType.BYTES25_ARRAY]: "RecsType.
|
|
191
|
-
[SchemaType.BYTES26_ARRAY]: "RecsType.
|
|
192
|
-
[SchemaType.BYTES27_ARRAY]: "RecsType.
|
|
193
|
-
[SchemaType.BYTES28_ARRAY]: "RecsType.
|
|
194
|
-
[SchemaType.BYTES29_ARRAY]: "RecsType.
|
|
195
|
-
[SchemaType.BYTES30_ARRAY]: "RecsType.
|
|
196
|
-
[SchemaType.BYTES31_ARRAY]: "RecsType.
|
|
197
|
-
[SchemaType.BYTES32_ARRAY]: "RecsType.
|
|
140
|
+
[SchemaType.INT56_ARRAY]: "RecsType.BigIntArray",
|
|
141
|
+
[SchemaType.INT64_ARRAY]: "RecsType.BigIntArray",
|
|
142
|
+
[SchemaType.INT72_ARRAY]: "RecsType.BigIntArray",
|
|
143
|
+
[SchemaType.INT80_ARRAY]: "RecsType.BigIntArray",
|
|
144
|
+
[SchemaType.INT88_ARRAY]: "RecsType.BigIntArray",
|
|
145
|
+
[SchemaType.INT96_ARRAY]: "RecsType.BigIntArray",
|
|
146
|
+
[SchemaType.INT104_ARRAY]: "RecsType.BigIntArray",
|
|
147
|
+
[SchemaType.INT112_ARRAY]: "RecsType.BigIntArray",
|
|
148
|
+
[SchemaType.INT120_ARRAY]: "RecsType.BigIntArray",
|
|
149
|
+
[SchemaType.INT128_ARRAY]: "RecsType.BigIntArray",
|
|
150
|
+
[SchemaType.INT136_ARRAY]: "RecsType.BigIntArray",
|
|
151
|
+
[SchemaType.INT144_ARRAY]: "RecsType.BigIntArray",
|
|
152
|
+
[SchemaType.INT152_ARRAY]: "RecsType.BigIntArray",
|
|
153
|
+
[SchemaType.INT160_ARRAY]: "RecsType.BigIntArray",
|
|
154
|
+
[SchemaType.INT168_ARRAY]: "RecsType.BigIntArray",
|
|
155
|
+
[SchemaType.INT176_ARRAY]: "RecsType.BigIntArray",
|
|
156
|
+
[SchemaType.INT184_ARRAY]: "RecsType.BigIntArray",
|
|
157
|
+
[SchemaType.INT192_ARRAY]: "RecsType.BigIntArray",
|
|
158
|
+
[SchemaType.INT200_ARRAY]: "RecsType.BigIntArray",
|
|
159
|
+
[SchemaType.INT208_ARRAY]: "RecsType.BigIntArray",
|
|
160
|
+
[SchemaType.INT216_ARRAY]: "RecsType.BigIntArray",
|
|
161
|
+
[SchemaType.INT224_ARRAY]: "RecsType.BigIntArray",
|
|
162
|
+
[SchemaType.INT232_ARRAY]: "RecsType.BigIntArray",
|
|
163
|
+
[SchemaType.INT240_ARRAY]: "RecsType.BigIntArray",
|
|
164
|
+
[SchemaType.INT248_ARRAY]: "RecsType.BigIntArray",
|
|
165
|
+
[SchemaType.INT256_ARRAY]: "RecsType.BigIntArray",
|
|
166
|
+
[SchemaType.BYTES1_ARRAY]: "RecsType.BigIntArray",
|
|
167
|
+
[SchemaType.BYTES2_ARRAY]: "RecsType.BigIntArray",
|
|
168
|
+
[SchemaType.BYTES3_ARRAY]: "RecsType.BigIntArray",
|
|
169
|
+
[SchemaType.BYTES4_ARRAY]: "RecsType.BigIntArray",
|
|
170
|
+
[SchemaType.BYTES5_ARRAY]: "RecsType.BigIntArray",
|
|
171
|
+
[SchemaType.BYTES6_ARRAY]: "RecsType.BigIntArray",
|
|
172
|
+
[SchemaType.BYTES7_ARRAY]: "RecsType.BigIntArray",
|
|
173
|
+
[SchemaType.BYTES8_ARRAY]: "RecsType.BigIntArray",
|
|
174
|
+
[SchemaType.BYTES9_ARRAY]: "RecsType.BigIntArray",
|
|
175
|
+
[SchemaType.BYTES10_ARRAY]: "RecsType.BigIntArray",
|
|
176
|
+
[SchemaType.BYTES11_ARRAY]: "RecsType.BigIntArray",
|
|
177
|
+
[SchemaType.BYTES12_ARRAY]: "RecsType.BigIntArray",
|
|
178
|
+
[SchemaType.BYTES13_ARRAY]: "RecsType.BigIntArray",
|
|
179
|
+
[SchemaType.BYTES14_ARRAY]: "RecsType.BigIntArray",
|
|
180
|
+
[SchemaType.BYTES15_ARRAY]: "RecsType.BigIntArray",
|
|
181
|
+
[SchemaType.BYTES16_ARRAY]: "RecsType.BigIntArray",
|
|
182
|
+
[SchemaType.BYTES17_ARRAY]: "RecsType.BigIntArray",
|
|
183
|
+
[SchemaType.BYTES18_ARRAY]: "RecsType.BigIntArray",
|
|
184
|
+
[SchemaType.BYTES19_ARRAY]: "RecsType.BigIntArray",
|
|
185
|
+
[SchemaType.BYTES20_ARRAY]: "RecsType.BigIntArray",
|
|
186
|
+
[SchemaType.BYTES21_ARRAY]: "RecsType.BigIntArray",
|
|
187
|
+
[SchemaType.BYTES22_ARRAY]: "RecsType.BigIntArray",
|
|
188
|
+
[SchemaType.BYTES23_ARRAY]: "RecsType.BigIntArray",
|
|
189
|
+
[SchemaType.BYTES24_ARRAY]: "RecsType.BigIntArray",
|
|
190
|
+
[SchemaType.BYTES25_ARRAY]: "RecsType.BigIntArray",
|
|
191
|
+
[SchemaType.BYTES26_ARRAY]: "RecsType.BigIntArray",
|
|
192
|
+
[SchemaType.BYTES27_ARRAY]: "RecsType.BigIntArray",
|
|
193
|
+
[SchemaType.BYTES28_ARRAY]: "RecsType.BigIntArray",
|
|
194
|
+
[SchemaType.BYTES29_ARRAY]: "RecsType.BigIntArray",
|
|
195
|
+
[SchemaType.BYTES30_ARRAY]: "RecsType.BigIntArray",
|
|
196
|
+
[SchemaType.BYTES31_ARRAY]: "RecsType.BigIntArray",
|
|
197
|
+
[SchemaType.BYTES32_ARRAY]: "RecsType.BigIntArray",
|
|
198
198
|
[SchemaType.BOOL_ARRAY]: "RecsType.T", // no boolean array
|
|
199
199
|
[SchemaType.ADDRESS_ARRAY]: "RecsType.StringArray",
|
|
200
200
|
[SchemaType.BYTES]: "RecsType.String",
|
package/dist/chunk-7GA2K5A6.js
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
formatAndWriteTypescript,
|
|
3
|
-
resolveAbiOrUserType
|
|
4
|
-
} from "./chunk-5NC2OON2.js";
|
|
5
|
-
|
|
6
|
-
// src/render-ts/schemaTypesToRecsTypeStrings.ts
|
|
7
|
-
var schemaTypesToRecsTypeStrings = {
|
|
8
|
-
[0 /* UINT8 */]: "RecsType.Number",
|
|
9
|
-
[1 /* UINT16 */]: "RecsType.Number",
|
|
10
|
-
[2 /* UINT24 */]: "RecsType.Number",
|
|
11
|
-
[3 /* UINT32 */]: "RecsType.Number",
|
|
12
|
-
[4 /* UINT40 */]: "RecsType.Number",
|
|
13
|
-
[5 /* UINT48 */]: "RecsType.Number",
|
|
14
|
-
[6 /* UINT56 */]: "RecsType.Number",
|
|
15
|
-
[7 /* UINT64 */]: "RecsType.Number",
|
|
16
|
-
[8 /* UINT72 */]: "RecsType.Number",
|
|
17
|
-
[9 /* UINT80 */]: "RecsType.Number",
|
|
18
|
-
[10 /* UINT88 */]: "RecsType.Number",
|
|
19
|
-
[11 /* UINT96 */]: "RecsType.Number",
|
|
20
|
-
[12 /* UINT104 */]: "RecsType.Number",
|
|
21
|
-
[13 /* UINT112 */]: "RecsType.Number",
|
|
22
|
-
[14 /* UINT120 */]: "RecsType.Number",
|
|
23
|
-
[15 /* UINT128 */]: "RecsType.Number",
|
|
24
|
-
[16 /* UINT136 */]: "RecsType.Number",
|
|
25
|
-
[17 /* UINT144 */]: "RecsType.Number",
|
|
26
|
-
[18 /* UINT152 */]: "RecsType.Number",
|
|
27
|
-
[19 /* UINT160 */]: "RecsType.Number",
|
|
28
|
-
[20 /* UINT168 */]: "RecsType.Number",
|
|
29
|
-
[21 /* UINT176 */]: "RecsType.Number",
|
|
30
|
-
[22 /* UINT184 */]: "RecsType.Number",
|
|
31
|
-
[23 /* UINT192 */]: "RecsType.Number",
|
|
32
|
-
[24 /* UINT200 */]: "RecsType.Number",
|
|
33
|
-
[25 /* UINT208 */]: "RecsType.Number",
|
|
34
|
-
[26 /* UINT216 */]: "RecsType.Number",
|
|
35
|
-
[27 /* UINT224 */]: "RecsType.Number",
|
|
36
|
-
[28 /* UINT232 */]: "RecsType.Number",
|
|
37
|
-
[29 /* UINT240 */]: "RecsType.Number",
|
|
38
|
-
[30 /* UINT248 */]: "RecsType.Number",
|
|
39
|
-
[31 /* UINT256 */]: "RecsType.Number",
|
|
40
|
-
[32 /* INT8 */]: "RecsType.Number",
|
|
41
|
-
[33 /* INT16 */]: "RecsType.Number",
|
|
42
|
-
[34 /* INT24 */]: "RecsType.Number",
|
|
43
|
-
[35 /* INT32 */]: "RecsType.Number",
|
|
44
|
-
[36 /* INT40 */]: "RecsType.Number",
|
|
45
|
-
[37 /* INT48 */]: "RecsType.Number",
|
|
46
|
-
[38 /* INT56 */]: "RecsType.Number",
|
|
47
|
-
[39 /* INT64 */]: "RecsType.Number",
|
|
48
|
-
[40 /* INT72 */]: "RecsType.Number",
|
|
49
|
-
[41 /* INT80 */]: "RecsType.Number",
|
|
50
|
-
[42 /* INT88 */]: "RecsType.Number",
|
|
51
|
-
[43 /* INT96 */]: "RecsType.Number",
|
|
52
|
-
[44 /* INT104 */]: "RecsType.Number",
|
|
53
|
-
[45 /* INT112 */]: "RecsType.Number",
|
|
54
|
-
[46 /* INT120 */]: "RecsType.Number",
|
|
55
|
-
[47 /* INT128 */]: "RecsType.Number",
|
|
56
|
-
[48 /* INT136 */]: "RecsType.Number",
|
|
57
|
-
[49 /* INT144 */]: "RecsType.Number",
|
|
58
|
-
[50 /* INT152 */]: "RecsType.Number",
|
|
59
|
-
[51 /* INT160 */]: "RecsType.Number",
|
|
60
|
-
[52 /* INT168 */]: "RecsType.Number",
|
|
61
|
-
[53 /* INT176 */]: "RecsType.Number",
|
|
62
|
-
[54 /* INT184 */]: "RecsType.Number",
|
|
63
|
-
[55 /* INT192 */]: "RecsType.Number",
|
|
64
|
-
[56 /* INT200 */]: "RecsType.Number",
|
|
65
|
-
[57 /* INT208 */]: "RecsType.Number",
|
|
66
|
-
[58 /* INT216 */]: "RecsType.Number",
|
|
67
|
-
[59 /* INT224 */]: "RecsType.Number",
|
|
68
|
-
[60 /* INT232 */]: "RecsType.Number",
|
|
69
|
-
[61 /* INT240 */]: "RecsType.Number",
|
|
70
|
-
[62 /* INT248 */]: "RecsType.Number",
|
|
71
|
-
[63 /* INT256 */]: "RecsType.Number",
|
|
72
|
-
[64 /* BYTES1 */]: "RecsType.String",
|
|
73
|
-
[65 /* BYTES2 */]: "RecsType.String",
|
|
74
|
-
[66 /* BYTES3 */]: "RecsType.String",
|
|
75
|
-
[67 /* BYTES4 */]: "RecsType.String",
|
|
76
|
-
[68 /* BYTES5 */]: "RecsType.String",
|
|
77
|
-
[69 /* BYTES6 */]: "RecsType.String",
|
|
78
|
-
[70 /* BYTES7 */]: "RecsType.String",
|
|
79
|
-
[71 /* BYTES8 */]: "RecsType.String",
|
|
80
|
-
[72 /* BYTES9 */]: "RecsType.String",
|
|
81
|
-
[73 /* BYTES10 */]: "RecsType.String",
|
|
82
|
-
[74 /* BYTES11 */]: "RecsType.String",
|
|
83
|
-
[75 /* BYTES12 */]: "RecsType.String",
|
|
84
|
-
[76 /* BYTES13 */]: "RecsType.String",
|
|
85
|
-
[77 /* BYTES14 */]: "RecsType.String",
|
|
86
|
-
[78 /* BYTES15 */]: "RecsType.String",
|
|
87
|
-
[79 /* BYTES16 */]: "RecsType.String",
|
|
88
|
-
[80 /* BYTES17 */]: "RecsType.String",
|
|
89
|
-
[81 /* BYTES18 */]: "RecsType.String",
|
|
90
|
-
[82 /* BYTES19 */]: "RecsType.String",
|
|
91
|
-
[83 /* BYTES20 */]: "RecsType.String",
|
|
92
|
-
[84 /* BYTES21 */]: "RecsType.String",
|
|
93
|
-
[85 /* BYTES22 */]: "RecsType.String",
|
|
94
|
-
[86 /* BYTES23 */]: "RecsType.String",
|
|
95
|
-
[87 /* BYTES24 */]: "RecsType.String",
|
|
96
|
-
[88 /* BYTES25 */]: "RecsType.String",
|
|
97
|
-
[89 /* BYTES26 */]: "RecsType.String",
|
|
98
|
-
[90 /* BYTES27 */]: "RecsType.String",
|
|
99
|
-
[91 /* BYTES28 */]: "RecsType.String",
|
|
100
|
-
[92 /* BYTES29 */]: "RecsType.String",
|
|
101
|
-
[93 /* BYTES30 */]: "RecsType.String",
|
|
102
|
-
[94 /* BYTES31 */]: "RecsType.String",
|
|
103
|
-
[95 /* BYTES32 */]: "RecsType.String",
|
|
104
|
-
[96 /* BOOL */]: "RecsType.Boolean",
|
|
105
|
-
[97 /* ADDRESS */]: "RecsType.String",
|
|
106
|
-
[98 /* UINT8_ARRAY */]: "RecsType.NumberArray",
|
|
107
|
-
[99 /* UINT16_ARRAY */]: "RecsType.NumberArray",
|
|
108
|
-
[100 /* UINT24_ARRAY */]: "RecsType.NumberArray",
|
|
109
|
-
[101 /* UINT32_ARRAY */]: "RecsType.NumberArray",
|
|
110
|
-
[102 /* UINT40_ARRAY */]: "RecsType.NumberArray",
|
|
111
|
-
[103 /* UINT48_ARRAY */]: "RecsType.NumberArray",
|
|
112
|
-
[104 /* UINT56_ARRAY */]: "RecsType.NumberArray",
|
|
113
|
-
[105 /* UINT64_ARRAY */]: "RecsType.NumberArray",
|
|
114
|
-
[106 /* UINT72_ARRAY */]: "RecsType.NumberArray",
|
|
115
|
-
[107 /* UINT80_ARRAY */]: "RecsType.NumberArray",
|
|
116
|
-
[108 /* UINT88_ARRAY */]: "RecsType.NumberArray",
|
|
117
|
-
[109 /* UINT96_ARRAY */]: "RecsType.NumberArray",
|
|
118
|
-
[110 /* UINT104_ARRAY */]: "RecsType.NumberArray",
|
|
119
|
-
[111 /* UINT112_ARRAY */]: "RecsType.NumberArray",
|
|
120
|
-
[112 /* UINT120_ARRAY */]: "RecsType.NumberArray",
|
|
121
|
-
[113 /* UINT128_ARRAY */]: "RecsType.NumberArray",
|
|
122
|
-
[114 /* UINT136_ARRAY */]: "RecsType.NumberArray",
|
|
123
|
-
[115 /* UINT144_ARRAY */]: "RecsType.NumberArray",
|
|
124
|
-
[116 /* UINT152_ARRAY */]: "RecsType.NumberArray",
|
|
125
|
-
[117 /* UINT160_ARRAY */]: "RecsType.NumberArray",
|
|
126
|
-
[118 /* UINT168_ARRAY */]: "RecsType.NumberArray",
|
|
127
|
-
[119 /* UINT176_ARRAY */]: "RecsType.NumberArray",
|
|
128
|
-
[120 /* UINT184_ARRAY */]: "RecsType.NumberArray",
|
|
129
|
-
[121 /* UINT192_ARRAY */]: "RecsType.NumberArray",
|
|
130
|
-
[122 /* UINT200_ARRAY */]: "RecsType.NumberArray",
|
|
131
|
-
[123 /* UINT208_ARRAY */]: "RecsType.NumberArray",
|
|
132
|
-
[124 /* UINT216_ARRAY */]: "RecsType.NumberArray",
|
|
133
|
-
[125 /* UINT224_ARRAY */]: "RecsType.NumberArray",
|
|
134
|
-
[126 /* UINT232_ARRAY */]: "RecsType.NumberArray",
|
|
135
|
-
[127 /* UINT240_ARRAY */]: "RecsType.NumberArray",
|
|
136
|
-
[128 /* UINT248_ARRAY */]: "RecsType.NumberArray",
|
|
137
|
-
[129 /* UINT256_ARRAY */]: "RecsType.NumberArray",
|
|
138
|
-
[130 /* INT8_ARRAY */]: "RecsType.NumberArray",
|
|
139
|
-
[131 /* INT16_ARRAY */]: "RecsType.NumberArray",
|
|
140
|
-
[132 /* INT24_ARRAY */]: "RecsType.NumberArray",
|
|
141
|
-
[133 /* INT32_ARRAY */]: "RecsType.NumberArray",
|
|
142
|
-
[134 /* INT40_ARRAY */]: "RecsType.NumberArray",
|
|
143
|
-
[135 /* INT48_ARRAY */]: "RecsType.NumberArray",
|
|
144
|
-
[136 /* INT56_ARRAY */]: "RecsType.NumberArray",
|
|
145
|
-
[137 /* INT64_ARRAY */]: "RecsType.NumberArray",
|
|
146
|
-
[138 /* INT72_ARRAY */]: "RecsType.NumberArray",
|
|
147
|
-
[139 /* INT80_ARRAY */]: "RecsType.NumberArray",
|
|
148
|
-
[140 /* INT88_ARRAY */]: "RecsType.NumberArray",
|
|
149
|
-
[141 /* INT96_ARRAY */]: "RecsType.NumberArray",
|
|
150
|
-
[142 /* INT104_ARRAY */]: "RecsType.NumberArray",
|
|
151
|
-
[143 /* INT112_ARRAY */]: "RecsType.NumberArray",
|
|
152
|
-
[144 /* INT120_ARRAY */]: "RecsType.NumberArray",
|
|
153
|
-
[145 /* INT128_ARRAY */]: "RecsType.NumberArray",
|
|
154
|
-
[146 /* INT136_ARRAY */]: "RecsType.NumberArray",
|
|
155
|
-
[147 /* INT144_ARRAY */]: "RecsType.NumberArray",
|
|
156
|
-
[148 /* INT152_ARRAY */]: "RecsType.NumberArray",
|
|
157
|
-
[149 /* INT160_ARRAY */]: "RecsType.NumberArray",
|
|
158
|
-
[150 /* INT168_ARRAY */]: "RecsType.NumberArray",
|
|
159
|
-
[151 /* INT176_ARRAY */]: "RecsType.NumberArray",
|
|
160
|
-
[152 /* INT184_ARRAY */]: "RecsType.NumberArray",
|
|
161
|
-
[153 /* INT192_ARRAY */]: "RecsType.NumberArray",
|
|
162
|
-
[154 /* INT200_ARRAY */]: "RecsType.NumberArray",
|
|
163
|
-
[155 /* INT208_ARRAY */]: "RecsType.NumberArray",
|
|
164
|
-
[156 /* INT216_ARRAY */]: "RecsType.NumberArray",
|
|
165
|
-
[157 /* INT224_ARRAY */]: "RecsType.NumberArray",
|
|
166
|
-
[158 /* INT232_ARRAY */]: "RecsType.NumberArray",
|
|
167
|
-
[159 /* INT240_ARRAY */]: "RecsType.NumberArray",
|
|
168
|
-
[160 /* INT248_ARRAY */]: "RecsType.NumberArray",
|
|
169
|
-
[161 /* INT256_ARRAY */]: "RecsType.NumberArray",
|
|
170
|
-
[162 /* BYTES1_ARRAY */]: "RecsType.StringArray",
|
|
171
|
-
[163 /* BYTES2_ARRAY */]: "RecsType.StringArray",
|
|
172
|
-
[164 /* BYTES3_ARRAY */]: "RecsType.StringArray",
|
|
173
|
-
[165 /* BYTES4_ARRAY */]: "RecsType.StringArray",
|
|
174
|
-
[166 /* BYTES5_ARRAY */]: "RecsType.StringArray",
|
|
175
|
-
[167 /* BYTES6_ARRAY */]: "RecsType.StringArray",
|
|
176
|
-
[168 /* BYTES7_ARRAY */]: "RecsType.StringArray",
|
|
177
|
-
[169 /* BYTES8_ARRAY */]: "RecsType.StringArray",
|
|
178
|
-
[170 /* BYTES9_ARRAY */]: "RecsType.StringArray",
|
|
179
|
-
[171 /* BYTES10_ARRAY */]: "RecsType.StringArray",
|
|
180
|
-
[172 /* BYTES11_ARRAY */]: "RecsType.StringArray",
|
|
181
|
-
[173 /* BYTES12_ARRAY */]: "RecsType.StringArray",
|
|
182
|
-
[174 /* BYTES13_ARRAY */]: "RecsType.StringArray",
|
|
183
|
-
[175 /* BYTES14_ARRAY */]: "RecsType.StringArray",
|
|
184
|
-
[176 /* BYTES15_ARRAY */]: "RecsType.StringArray",
|
|
185
|
-
[177 /* BYTES16_ARRAY */]: "RecsType.StringArray",
|
|
186
|
-
[178 /* BYTES17_ARRAY */]: "RecsType.StringArray",
|
|
187
|
-
[179 /* BYTES18_ARRAY */]: "RecsType.StringArray",
|
|
188
|
-
[180 /* BYTES19_ARRAY */]: "RecsType.StringArray",
|
|
189
|
-
[181 /* BYTES20_ARRAY */]: "RecsType.StringArray",
|
|
190
|
-
[182 /* BYTES21_ARRAY */]: "RecsType.StringArray",
|
|
191
|
-
[183 /* BYTES22_ARRAY */]: "RecsType.StringArray",
|
|
192
|
-
[184 /* BYTES23_ARRAY */]: "RecsType.StringArray",
|
|
193
|
-
[185 /* BYTES24_ARRAY */]: "RecsType.StringArray",
|
|
194
|
-
[186 /* BYTES25_ARRAY */]: "RecsType.StringArray",
|
|
195
|
-
[187 /* BYTES26_ARRAY */]: "RecsType.StringArray",
|
|
196
|
-
[188 /* BYTES27_ARRAY */]: "RecsType.StringArray",
|
|
197
|
-
[189 /* BYTES28_ARRAY */]: "RecsType.StringArray",
|
|
198
|
-
[190 /* BYTES29_ARRAY */]: "RecsType.StringArray",
|
|
199
|
-
[191 /* BYTES30_ARRAY */]: "RecsType.StringArray",
|
|
200
|
-
[192 /* BYTES31_ARRAY */]: "RecsType.StringArray",
|
|
201
|
-
[193 /* BYTES32_ARRAY */]: "RecsType.StringArray",
|
|
202
|
-
[194 /* BOOL_ARRAY */]: "RecsType.T",
|
|
203
|
-
// no boolean array
|
|
204
|
-
[195 /* ADDRESS_ARRAY */]: "RecsType.StringArray",
|
|
205
|
-
[196 /* BYTES */]: "RecsType.String",
|
|
206
|
-
[197 /* STRING */]: "RecsType.String"
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
// src/render-ts/recsV1TableOptions.ts
|
|
210
|
-
function getRecsV1TableOptions(config) {
|
|
211
|
-
const tableOptions = [];
|
|
212
|
-
for (const tableName of Object.keys(config.tables)) {
|
|
213
|
-
const tableData = config.tables[tableName];
|
|
214
|
-
const fields = Object.keys(tableData.schema).map((name) => {
|
|
215
|
-
const abiOrUserType = tableData.schema[name];
|
|
216
|
-
const { schemaType } = resolveAbiOrUserType(abiOrUserType, config);
|
|
217
|
-
const recsTypeString = schemaTypesToRecsTypeStrings[schemaType];
|
|
218
|
-
return {
|
|
219
|
-
recsTypeString,
|
|
220
|
-
name
|
|
221
|
-
};
|
|
222
|
-
});
|
|
223
|
-
if (tableData.tableIdArgument)
|
|
224
|
-
continue;
|
|
225
|
-
const staticResourceData = {
|
|
226
|
-
namespace: config.namespace,
|
|
227
|
-
fileSelector: tableData.fileSelector
|
|
228
|
-
};
|
|
229
|
-
tableOptions.push({
|
|
230
|
-
tableName,
|
|
231
|
-
fields,
|
|
232
|
-
staticResourceData
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
return {
|
|
236
|
-
tables: tableOptions
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// src/render-ts/renderRecsV1Tables.ts
|
|
241
|
-
function renderRecsV1Tables(options) {
|
|
242
|
-
const { tables } = options;
|
|
243
|
-
return `/* Autogenerated file. Do not edit manually. */
|
|
244
|
-
|
|
245
|
-
import { TableId } from "@latticexyz/utils";
|
|
246
|
-
import { defineComponent, Type as RecsType, World } from "@latticexyz/recs";
|
|
247
|
-
|
|
248
|
-
export function defineContractComponents(world: World) {
|
|
249
|
-
return {
|
|
250
|
-
${tables.map((table) => `${table.tableName}: ${renderDefineComponent(table)},`).join("")}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
`;
|
|
254
|
-
}
|
|
255
|
-
function renderDefineComponent(table) {
|
|
256
|
-
const { namespace, fileSelector } = table.staticResourceData;
|
|
257
|
-
return `
|
|
258
|
-
(() => {
|
|
259
|
-
const tableId = new TableId("${namespace}", "${fileSelector}");
|
|
260
|
-
return defineComponent(world, {
|
|
261
|
-
${table.fields.map(({ name, recsTypeString }) => `${name}: ${recsTypeString},`).join("")}
|
|
262
|
-
}, {
|
|
263
|
-
metadata: { contractId: tableId.toHexString(), tableId: tableId.toString() },
|
|
264
|
-
});
|
|
265
|
-
})()
|
|
266
|
-
`;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// src/render-ts/tsgen.ts
|
|
270
|
-
import path from "path";
|
|
271
|
-
async function tsgen(config, outDirectory) {
|
|
272
|
-
const fullOutputPath = path.join(outDirectory, `contractComponents.ts`);
|
|
273
|
-
const options = getRecsV1TableOptions(config);
|
|
274
|
-
const output = renderRecsV1Tables(options);
|
|
275
|
-
formatAndWriteTypescript(output, fullOutputPath, "Generated ts definition files");
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
export {
|
|
279
|
-
schemaTypesToRecsTypeStrings,
|
|
280
|
-
getRecsV1TableOptions,
|
|
281
|
-
renderRecsV1Tables,
|
|
282
|
-
tsgen
|
|
283
|
-
};
|