@latticexyz/common 2.0.0-next.15 → 2.0.0-next.17

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.
@@ -0,0 +1,2 @@
1
+ import{stringToHex as o,concatHex as t}from"viem";var c={table:"tb",offchainTable:"ot",namespace:"ns",module:"md",system:"sy"};function u(e){let r=c[e.type];return t([o(r,{size:2}),o(e.namespace.slice(0,14),{size:14}),o(e.name.slice(0,16),{size:16})])}import s from"debug";var n=s("mud:common"),m=s("mud:common");n.log=console.debug.bind(console);m.log=console.error.bind(console);export{n as a,c as b,u as c};
2
+ //# sourceMappingURL=chunk-YEN6EYTC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resourceToHex.ts","../src/debug.ts"],"sourcesContent":["import { Hex, stringToHex, concatHex } from \"viem\";\nimport { Resource } from \"./common\";\nimport { ResourceType } from \"./resourceTypes\";\n\n/** @internal */\nexport const resourceTypeIds = {\n // keep these in sync with storeResourceTypes.sol\n table: \"tb\",\n offchainTable: \"ot\",\n // keep these in sync with worldResourceTypes.sol\n namespace: \"ns\",\n module: \"md\",\n system: \"sy\",\n} as const satisfies Record<ResourceType, string>;\n\nexport function resourceToHex(resource: Omit<Resource, \"resourceId\">): Hex {\n const typeId = resourceTypeIds[resource.type];\n return concatHex([\n stringToHex(typeId, { size: 2 }),\n stringToHex(resource.namespace.slice(0, 14), { size: 14 }),\n stringToHex(resource.name.slice(0, 16), { size: 16 }),\n ]);\n}\n","import createDebug from \"debug\";\n\nexport const debug = createDebug(\"mud:common\");\nexport const error = createDebug(\"mud:common\");\n\n// Pipe debug output to stdout instead of stderr\ndebug.log = console.debug.bind(console);\n\n// Pipe error output to stderr\nerror.log = console.error.bind(console);\n"],"mappings":"AAAA,OAAc,eAAAA,EAAa,aAAAC,MAAiB,OAKrC,IAAMC,EAAkB,CAE7B,MAAO,KACP,cAAe,KAEf,UAAW,KACX,OAAQ,KACR,OAAQ,IACV,EAEO,SAASC,EAAcC,EAA6C,CACzE,IAAMC,EAASH,EAAgBE,EAAS,IAAI,EAC5C,OAAOH,EAAU,CACfD,EAAYK,EAAQ,CAAE,KAAM,CAAE,CAAC,EAC/BL,EAAYI,EAAS,UAAU,MAAM,EAAG,EAAE,EAAG,CAAE,KAAM,EAAG,CAAC,EACzDJ,EAAYI,EAAS,KAAK,MAAM,EAAG,EAAE,EAAG,CAAE,KAAM,EAAG,CAAC,CACtD,CAAC,CACH,CCtBA,OAAOE,MAAiB,QAEjB,IAAMC,EAAQD,EAAY,YAAY,EAChCE,EAAQF,EAAY,YAAY,EAG7CC,EAAM,IAAM,QAAQ,MAAM,KAAK,OAAO,EAGtCC,EAAM,IAAM,QAAQ,MAAM,KAAK,OAAO","names":["stringToHex","concatHex","resourceTypeIds","resourceToHex","resource","typeId","createDebug","debug","error"]}
package/dist/codegen.d.ts CHANGED
@@ -16,12 +16,17 @@ type ImportDatum = AbsoluteImportDatum | RelativeImportDatum;
16
16
  interface StaticResourceData {
17
17
  /** Name of the table id constant to render. */
18
18
  tableIdName: string;
19
+ /** Table namespace string */
19
20
  namespace: string;
21
+ /** Table name string */
20
22
  name: string;
23
+ /** Whether the table is offchain only (does not use storage) */
21
24
  offchainOnly: boolean;
22
25
  }
23
26
  interface RenderType {
27
+ /** Fully-qualified name of the user-defined type (may include a library name as prefix) */
24
28
  typeId: string;
29
+ /** Fully-qualified name of the user-defined type (may include a library name as prefix), followed by location (none/memory/storage) */
25
30
  typeWithLocation: string;
26
31
  /** The name of the enum element in SchemaType to use for schema registration (e.g. "UINT256_ARRAY") */
27
32
  enumName: string;
@@ -60,7 +65,10 @@ interface RenderEnum {
60
65
  memberNames: string[];
61
66
  }
62
67
 
63
- declare const renderedSolidityHeader = "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.21;\n\n/* Autogenerated file. Do not edit manually. */";
68
+ /**
69
+ * Common header for all codegenerated solidity files
70
+ */
71
+ declare const renderedSolidityHeader = "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.24;\n\n/* Autogenerated file. Do not edit manually. */";
64
72
  /**
65
73
  * Renders a list of lines
66
74
  */
@@ -69,16 +77,24 @@ declare function renderList<T>(list: T[], renderItem: (item: T, index: number) =
69
77
  * Renders a comma-separated list of arguments for solidity functions, ignoring empty and undefined ones
70
78
  */
71
79
  declare function renderArguments(args: (string | undefined)[]): string;
72
- declare function renderCommonData({ staticResourceData, keyTuple, }: {
73
- staticResourceData?: StaticResourceData;
74
- keyTuple: RenderKeyTuple[];
75
- }): {
76
- _tableId: string;
80
+ interface RenderedCommonData {
81
+ /** `_tableId` variable prefixed with its type (empty string if absent) */
77
82
  _typedTableId: string;
78
- _keyArgs: string;
83
+ /** Comma-separated table key names prefixed with their types (empty string if 0 keys) */
79
84
  _typedKeyArgs: string;
85
+ /** Definition and initialization of the dynamic `_keyTuple` bytes32 array */
80
86
  _keyTupleDefinition: string;
81
- };
87
+ }
88
+ /**
89
+ * Renders some solidity statements commonly used within table libraries
90
+ * @param param0.staticResourceData static data about the table library
91
+ * @param param0.keyTuple key tuple of the table library
92
+ * @returns Rendered statement strings
93
+ */
94
+ declare function renderCommonData({ staticResourceData, keyTuple, }: {
95
+ staticResourceData?: StaticResourceData;
96
+ keyTuple: RenderKeyTuple[];
97
+ }): RenderedCommonData;
82
98
  /** For 2 paths which are relative to a common root, create a relative import path from one to another */
83
99
  declare function solidityRelativeImportPath(fromPath: string, usedInPath: string): string;
84
100
  /**
@@ -96,18 +112,61 @@ declare function renderRelativeImports(imports: RelativeImportDatum[]): string;
96
112
  * Identical symbols from different paths are NOT handled, they should be checked before rendering.
97
113
  */
98
114
  declare function renderAbsoluteImports(imports: AbsoluteImportDatum[]): string;
99
- declare function renderWithStore(storeArgument: boolean, callback: (_typedStore: string | undefined, _store: string, _commentSuffix: string, _untypedStore: string | undefined, _methodPrefix: string, _internal?: boolean) => string): string;
115
+ interface RenderWithStoreCallbackData {
116
+ /** `_store` variable prefixed with its type (undefined if library name) */
117
+ _typedStore: string | undefined;
118
+ /** `_store` variable (undefined if library name) */
119
+ _store: string;
120
+ /** Empty string if storeArgument is false, otherwise `" (using the specified store)"` */
121
+ _commentSuffix: string;
122
+ /** Prefix to differentiate different kinds of store usage within methods */
123
+ _methodNamePrefix: string;
124
+ /** Whether FieldLayout variable should be passed to store methods */
125
+ _useExplicitFieldLayout?: boolean;
126
+ }
127
+ /**
128
+ * Renders several versions of the callback's result, which access Store in different ways
129
+ * @param storeArgument whether to render a version with `IStore _store` as an argument
130
+ * @param callback renderer for a method which uses store
131
+ * @returns Concatenated results of all callback calls
132
+ */
133
+ declare function renderWithStore(storeArgument: boolean, callback: (data: RenderWithStoreCallbackData) => string): string;
134
+ /**
135
+ * Renders several versions of the callback's result, which have different method name suffixes
136
+ * @param withSuffixlessFieldMethods whether to render methods with an empty suffix
137
+ * @param fieldName name of the field which the methods access, used for a suffix
138
+ * @param callback renderer for a method to be suffixed
139
+ * @returns Concatenated results of all callback calls
140
+ */
100
141
  declare function renderWithFieldSuffix(withSuffixlessFieldMethods: boolean, fieldName: string, callback: (_methodNameSuffix: string) => string): string;
101
- declare function renderTableId({ namespace, name, offchainOnly, tableIdName }: StaticResourceData): {
102
- hardcodedTableId: string;
103
- tableIdDefinition: string;
104
- };
105
- declare function renderValueTypeToBytes32(name: string, { typeUnwrap, internalTypeId }: RenderType): string;
142
+ /**
143
+ * Renders `_tableId` variable definition and initialization, and its alias which uses the provided `tableIdName`.
144
+ * @param param0 static resource data needed to construct the table id
145
+ */
146
+ declare function renderTableId({ namespace, name, offchainOnly, tableIdName, }: Pick<StaticResourceData, "namespace" | "name" | "offchainOnly" | "tableIdName">): string;
147
+ /**
148
+ * Renders solidity typecasts to get from the given type to `bytes32`
149
+ * @param name variable name to be typecasted
150
+ * @param param1 type data
151
+ */
152
+ declare function renderValueTypeToBytes32(name: string, { typeUnwrap, internalTypeId }: Pick<RenderType, "typeUnwrap" | "internalTypeId">): string;
153
+ /**
154
+ * Whether the storage representation of the given solidity type is left aligned
155
+ */
106
156
  declare function isLeftAligned(field: Pick<RenderType, "internalTypeId">): boolean;
157
+ /**
158
+ * The number of padding bits in the storage representation of a right-aligned solidity type
159
+ */
107
160
  declare function getLeftPaddingBits(field: Pick<RenderType, "internalTypeId" | "staticByteLength">): number;
108
161
 
162
+ /**
163
+ * Render a list of enum data as solidity enum definitions
164
+ */
109
165
  declare function renderEnums(enums: RenderEnum[]): string;
110
166
 
167
+ /**
168
+ * Renders the necessary helper functions to typecast to/from the types of given fields and keys
169
+ */
111
170
  declare function renderTypeHelpers(options: {
112
171
  fields: RenderField[];
113
172
  keyTuple: RenderKeyTuple[];
@@ -143,29 +202,66 @@ declare function contractToInterface(data: string, contractName: string): {
143
202
  };
144
203
 
145
204
  interface SolidityUserDefinedType {
205
+ /** Fully-qualified name of the user-defined type (may include a library name as prefix) */
146
206
  typeId: string;
207
+ /** Name of the wrapped primitive type */
147
208
  internalTypeId: string;
209
+ /** Symbol which must be imported to use the type (either the type name, or the library name where the type is defined) */
148
210
  importSymbol: string;
211
+ /** Path to the solidity file which contains the user type */
149
212
  fromPath: string;
213
+ /** Whether `fromPath` is relative */
150
214
  isRelativePath: boolean;
151
215
  }
152
216
  /**
153
217
  * Parse the solidity data to extract user-defined type information.
154
218
  * @param data contents of a solidity file with the user types declarations
155
219
  * @param userTypeNames names of the user types to extract
220
+ * @param fromPath path to the solidity file from which the user types are extracted
221
+ * @returns record of type names mapped to the extracted type information
156
222
  */
157
223
  declare function extractUserTypes(data: string, userTypeNames: string[], fromPath: string): Record<string, SolidityUserDefinedType>;
158
224
 
225
+ /**
226
+ * Formats solidity code using prettier
227
+ * @param content solidity code
228
+ * @param prettierConfigPath optional path to a prettier config
229
+ * @returns formatted solidity code
230
+ */
159
231
  declare function formatSolidity(content: string, prettierConfigPath?: string): Promise<string>;
232
+ /**
233
+ * Formats typescript code using prettier
234
+ * @param content typescript code
235
+ * @returns formatted typescript code
236
+ */
160
237
  declare function formatTypescript(content: string): Promise<string>;
161
238
 
239
+ /**
240
+ * Formats solidity code using prettier and write it to a file
241
+ * @param output solidity code
242
+ * @param fullOutputPath full path to the output file
243
+ * @param logPrefix prefix for debug logs
244
+ */
162
245
  declare function formatAndWriteSolidity(output: string, fullOutputPath: string, logPrefix: string): Promise<void>;
246
+ /**
247
+ * Formats typescript code using prettier and write it to a file
248
+ * @param output typescript code
249
+ * @param fullOutputPath full path to the output file
250
+ * @param logPrefix prefix for debug logs
251
+ */
163
252
  declare function formatAndWriteTypescript(output: string, fullOutputPath: string, logPrefix: string): Promise<void>;
164
253
 
165
254
  type UserType = {
166
255
  filePath: string;
167
256
  internalType: SchemaAbiType;
168
257
  };
258
+ /**
259
+ * Load the user type files and extract type information from them.
260
+ * @param userTypes record of user type data mapped by type names
261
+ * @param outputBaseDirectory base path to the output directory
262
+ * @param remappings solc remappings
263
+ * @returns record of the user type information mapped by type names
264
+ */
169
265
  declare function loadAndExtractUserTypes(userTypes: Record<string, UserType>, outputBaseDirectory: string, remappings: [string, string][]): Record<string, SolidityUserDefinedType>;
170
266
 
171
267
  /**
package/dist/codegen.js CHANGED
@@ -1,31 +1,22 @@
1
- import{a as m}from"./chunk-TCWGPC6G.js";import{a as p}from"./chunk-UPQEB2HW.js";import X from"path";import{parse as j,visit as b}from"@solidity-parser/parser";function ne(r,t){let n=j(r),i=!1,s=[],o=[],a=[];if(b(n,{ContractDefinition({name:y}){y===t&&(i=!0)},FunctionDefinition({name:y,visibility:T,parameters:c,stateMutability:R,returnParameters:g,isConstructor:F,isFallback:k,isReceiveEther:L},l){if(l!==void 0&&l.type==="ContractDefinition"&&l.name===t)try{if(F||k||L)return;if(T==="default")throw new p("Visibility is not specified");if(T==="external"||T==="public"){o.push({name:y===null?"":y,parameters:c.map(f),stateMutability:R||"",returnParameters:g===null?[]:g.map(f)});for(let{typeName:I}of c.concat(g??[])){let W=d(I);s=s.concat(N(n,W))}}}catch(I){throw I instanceof p&&(I.message=`Function "${y}" in contract "${t}": ${I.message}`),I}},CustomErrorDefinition({name:y,parameters:T}){a.push({name:y===null?"":y,parameters:T.map(f)});for(let c of T){let R=d(c.typeName);s=s.concat(N(n,R))}}}),!i)throw new p(`Contract not found: ${t}`);return{functions:o,errors:a,symbolImports:s}}function f({name:r,typeName:t,storageLocation:n}){let i="",{name:s,stateMutability:o}=_(t);return i+=s,o!==null&&(i+=` ${o}`),n!==null&&(i+=` ${n}`),r!==null&&(i+=` ${r}`),i}function _(r){if(r===null)return{name:"",stateMutability:null};if(r.type==="ElementaryTypeName")return{name:r.name,stateMutability:r.stateMutability};if(r.type==="UserDefinedTypeName")return{name:r.namePath,stateMutability:null};if(r.type==="ArrayTypeName"){let t="";r.length?.type==="NumberLiteral"?t=r.length.number:r.length?.type==="Identifier"&&(t=r.length.name);let{name:n,stateMutability:i}=_(r.baseTypeName);return{name:`${n}[${t}]`,stateMutability:i}}else throw new p(`Invalid typeName.type ${r.type}`)}function d(r){if(r?.type==="UserDefinedTypeName")return[r.namePath.split(".")[0]];if(r?.type==="ArrayTypeName"){let t=d(r.baseTypeName);if(r.length?.type==="Identifier"){let n=r.length.name;t.push(n.split(".")[0])}return t}else return[]}function N(r,t){let n=[];for(let i of t){let s;if(b(r,{ImportDirective({path:o,symbolAliases:a}){if(a)for(let y of a){let T=y[1]||y[0];if(i===T){s={symbol:y[0],path:o};return}}}}),s)n.push(s);else throw new p(`Symbol "${i}" has no explicit import`)}return n}import{parse as O,visit as H}from"@solidity-parser/parser";function h(r,t,n){let i=O(r),s=n.at(0)===".",o={};return H(i,{TypeDefinition({name:a,definition:y},T){if(y.name.includes("fixed"))throw new p("Fixed point numbers are not supported by MUD");if(t.includes(a)){if(a in o)throw new p(`File has multiple user types with the same name: ${a}`);T?.type==="ContractDefinition"?o[a]={typeId:`${T.name}.${a}`,internalTypeId:y.name,importSymbol:T.name,fromPath:n,isRelativePath:s}:o[a]={typeId:a,internalTypeId:y.name,importSymbol:a,fromPath:n,isRelativePath:s}}}}),o}import B from"prettier";import K from"prettier-plugin-solidity";async function U(r,t){let n;t&&(n=await B.resolveConfig(t));try{return B.format(r,{plugins:[K],parser:"solidity-parse",printWidth:120,semi:!0,tabWidth:2,useTabs:!1,bracketSpacing:!0,...n})}catch(i){let s;return i instanceof Error?s=i.message:s=i,console.log(`Error during output formatting: ${s}`),r}}async function E(r){return B.format(r,{parser:"typescript"})}import{mkdir as x,writeFile as $}from"fs/promises";import{dirname as w}from"path";var A=m.extend("codegen"),V=m.extend("codegen");A.log=console.debug.bind(console);V.log=console.error.bind(console);async function le(r,t,n){let i=await U(r);await x(w(t),{recursive:!0}),await $(t,i),A(`${n}: ${t}`)}async function me(r,t,n){let i=await E(r);await x(w(t),{recursive:!0}),await $(t,i),A(`${n}: ${t}`)}import{readFileSync as v}from"fs";import z from"path";function be(r,t,n){let i={};for(let[o,{filePath:a}]of Object.entries(r))a in i||(i[a]=[]),i[a].push(o);let s={};for(let[o,a]of Object.entries(i)){let{filePath:y,data:T}=G(t,o,n),c=h(T,a,y);for(let[R,g]of Object.entries(c))if(g.internalTypeId!==r[R].internalType)throw new p(`User type "${R}" has internal type "${g.internalTypeId}" but config specifies "${r[R].internalType}"`);s=Object.assign(s,c)}return s}function G(r,t,n){if(t.at(0)===".")return{filePath:"./"+z.relative(r,t),data:v(t,"utf8")};{let i=t;for(let[s,o]of n)if(i.includes(s)){i=i.replace(s,o);break}return{filePath:t,data:v(i,"utf8")}}}function Y(r){return r.replace(/\\/g,"/")}var D=`// SPDX-License-Identifier: MIT
2
- pragma solidity >=0.8.21;
1
+ import{a as u,c as Y}from"./chunk-YEN6EYTC.js";import{a as p}from"./chunk-UPQEB2HW.js";import X from"path";import{parse as _,visit as f}from"@solidity-parser/parser";function ie(t,r){let n=_(t),i=j(_(t),r),s=[],o=[],a=[];if(!i)throw new p(`Contract not found: ${r}`);return f(i,{FunctionDefinition({name:y,visibility:T,parameters:c,stateMutability:R,returnParameters:g,isConstructor:L,isFallback:k,isReceiveEther:W}){try{if(L||k||W)return;if(T==="default")throw new p("Visibility is not specified");if(T==="external"||T==="public"){o.push({name:y===null?"":y,parameters:c.map(m),stateMutability:R||"",returnParameters:g===null?[]:g.map(m)});for(let{typeName:I}of c.concat(g??[])){let O=l(I);s=s.concat(b(n,O))}}}catch(I){throw I instanceof p&&(I.message=`Function "${y}" in contract "${r}": ${I.message}`),I}},CustomErrorDefinition({name:y,parameters:T}){a.push({name:y,parameters:T.map(m)});for(let c of T){let R=l(c.typeName);s=s.concat(b(n,R))}}}),{functions:o,errors:a,symbolImports:s}}function j(t,r){let n;return f(t,{ContractDefinition(i){i.name===r&&(n=i)}}),n}function m({name:t,typeName:r,storageLocation:n}){let i="",{name:s,stateMutability:o}=h(r);return i+=s,o!==null&&(i+=` ${o}`),n!==null&&(i+=` ${n}`),t!==null&&(i+=` ${t}`),i}function h(t){if(t===null)return{name:"",stateMutability:null};if(t.type==="ElementaryTypeName")return{name:t.name,stateMutability:t.stateMutability};if(t.type==="UserDefinedTypeName")return{name:t.namePath,stateMutability:null};if(t.type==="ArrayTypeName"){let r="";t.length?.type==="NumberLiteral"?r=t.length.number:t.length?.type==="Identifier"&&(r=t.length.name);let{name:n,stateMutability:i}=h(t.baseTypeName);return{name:`${n}[${r}]`,stateMutability:i}}else throw new p(`Invalid typeName.type ${t.type}`)}function l(t){if(t?.type==="UserDefinedTypeName")return[t.namePath.split(".")[0]];if(t?.type==="ArrayTypeName"){let r=l(t.baseTypeName);if(t.length?.type==="Identifier"){let n=t.length.name;r.push(n.split(".")[0])}return r}else return[]}function b(t,r){let n=[];for(let i of r){let s;if(f(t,{ImportDirective({path:o,symbolAliases:a}){if(a)for(let y of a){let T=y[1]||y[0];if(i===T){s={symbol:y[0],path:o};return}}}}),s)n.push(s);else throw new p(`Symbol "${i}" has no explicit import`)}return n}import{parse as H,visit as K}from"@solidity-parser/parser";function U(t,r,n){let i=H(t),s=n.at(0)===".",o={};return K(i,{TypeDefinition({name:a,definition:y},T){if(y.name.includes("fixed"))throw new p("Fixed point numbers are not supported by MUD");if(r.includes(a)){if(a in o)throw new p(`File has multiple user types with the same name: ${a}`);T?.type==="ContractDefinition"?o[a]={typeId:`${T.name}.${a}`,internalTypeId:y.name,importSymbol:T.name,fromPath:n,isRelativePath:s}:o[a]={typeId:a,internalTypeId:y.name,importSymbol:a,fromPath:n,isRelativePath:s}}}}),o}import d from"prettier";import V from"prettier-plugin-solidity";async function E(t,r){let n;r&&(n=await d.resolveConfig(r));try{return d.format(t,{plugins:[V],parser:"solidity-parse",printWidth:120,semi:!0,tabWidth:2,useTabs:!1,bracketSpacing:!0,...n})}catch(i){let s;return i instanceof Error?s=i.message:s=i,console.log(`Error during output formatting: ${s}`),t}}async function x(t){return d.format(t,{parser:"typescript"})}import{mkdir as $,writeFile as w}from"fs/promises";import{dirname as v}from"path";var A=u.extend("codegen"),z=u.extend("codegen");A.log=console.debug.bind(console);z.log=console.error.bind(console);async function le(t,r,n){let i=await E(t);await $(v(r),{recursive:!0}),await w(r,i),A(`${n}: ${r}`)}async function fe(t,r,n){let i=await x(t);await $(v(r),{recursive:!0}),await w(r,i),A(`${n}: ${r}`)}import{readFileSync as D}from"fs";import J from"path";function be(t,r,n){let i={};for(let[o,{filePath:a}]of Object.entries(t))a in i||(i[a]=[]),i[a].push(o);let s={};for(let[o,a]of Object.entries(i)){let{filePath:y,data:T}=G(r,o,n),c=U(T,a,y);for(let[R,g]of Object.entries(c))if(g.internalTypeId!==t[R].internalType)throw new p(`User type "${R}" has internal type "${g.internalTypeId}" but config specifies "${t[R].internalType}"`);s={...s,...c}}return s}function G(t,r,n){if(r.at(0)===".")return{filePath:"./"+J.relative(t,r),data:D(r,"utf8")};{let i=r;for(let[s,o]of n)if(i.includes(s)){i=i.replace(s,o);break}return{filePath:r,data:D(i,"utf8")}}}function B(t){return t.replace(/\\/g,"/")}var P=`// SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.24;
3
3
 
4
- /* Autogenerated file. Do not edit manually. */`;function S(r,t){return M("",r,t)}function u(r){let t=r.filter(n=>n!==void 0&&n!=="");return M(",",t,n=>n)}function Me({staticResourceData:r,keyTuple:t}){let n=r?"":"_tableId",i=r?"":"ResourceId _tableId",s=u(t.map(({name:y})=>y)),o=u(t.map(({name:y,typeWithLocation:T})=>`${T} ${y}`)),a=`
5
- bytes32[] memory _keyTuple = new bytes32[](${t.length});
6
- ${S(t,(y,T)=>`_keyTuple[${T}] = ${q(y.name,y)};`)}
7
- `;return{_tableId:n,_typedTableId:i,_keyArgs:s,_typedKeyArgs:o,_keyTupleDefinition:a}}function P(r,t){return Y("./"+X.relative("./"+t,"./"+r))}function Fe(r){return C(r.map(t=>"path"in t?t:{symbol:t.symbol,path:P(t.fromPath,t.usedInPath)}))}function ke(r){return C(r.map(({symbol:t,fromPath:n,usedInPath:i})=>({symbol:t,path:P(n,i)})))}function C(r){let t=new Map;for(let{symbol:i,path:s}of r)t.has(s)||t.set(s,new Set),t.get(s)?.add(i);let n=[];for(let[i,s]of t){let o=[...s].join(", ");n.push(`import { ${o} } from "${Y(i)}";`)}return n.join(`
8
- `)}function Le(r,t){let n="";return n+=t(void 0,"StoreSwitch","",void 0,""),n+=t(void 0,"StoreCore","",void 0,"_",!0),r&&(n+=`
9
- `+t("IStore _store","_store"," (using the specified store)","_store","")),n}function We(r,t,n){let i=`${t[0].toUpperCase()}${t.slice(1)}`,s="";return s+=n(i),r&&(s+=`
10
- `+n("")),s}function je({namespace:r,name:t,offchainOnly:n,tableIdName:i}){let s=`
11
- ResourceId.wrap(
12
- bytes32(
13
- abi.encodePacked(
14
- ${n?"RESOURCE_OFFCHAIN_TABLE":"RESOURCE_TABLE"},
15
- bytes14("${r}"),
16
- bytes16("${t}")
17
- )
18
- )
19
- )
20
- `,o=`
21
- ResourceId constant _tableId = ${s};
4
+ /* Autogenerated file. Do not edit manually. */`;function S(t,r){return M("",t,r)}function N(t){let r=t.filter(n=>n!==void 0&&n!=="");return M(",",r,n=>n)}function Le({staticResourceData:t,keyTuple:r}){let n=t?"":"ResourceId _tableId",i=N(r.map(({name:o,typeWithLocation:a})=>`${a} ${o}`)),s=`
5
+ bytes32[] memory _keyTuple = new bytes32[](${r.length});
6
+ ${S(r,(o,a)=>`_keyTuple[${a}] = ${q(o.name,o)};`)}
7
+ `;return{_typedTableId:n,_typedKeyArgs:i,_keyTupleDefinition:s}}function C(t,r){return B("./"+X.relative("./"+r,"./"+t))}function ke(t){return F(t.map(r=>"path"in r?r:{symbol:r.symbol,path:C(r.fromPath,r.usedInPath)}))}function We(t){return F(t.map(({symbol:r,fromPath:n,usedInPath:i})=>({symbol:r,path:C(n,i)})))}function F(t){let r=new Map;for(let{symbol:i,path:s}of t)r.has(s)||r.set(s,new Set),r.get(s)?.add(i);let n=[];for(let[i,s]of r){let o=[...s].join(", ");n.push(`import { ${o} } from "${B(i)}";`)}return n.join(`
8
+ `)}function Oe(t,r){let n="";return n+=r({_typedStore:void 0,_store:"StoreSwitch",_commentSuffix:"",_methodNamePrefix:""}),n+=r({_typedStore:void 0,_store:"StoreCore",_commentSuffix:"",_methodNamePrefix:"_",_useExplicitFieldLayout:!0}),t&&(n+=`
9
+ `+r({_typedStore:"IStore _store",_store:"_store",_commentSuffix:" (using the specified store)",_methodNamePrefix:""})),n}function je(t,r,n){let i=`${r[0].toUpperCase()}${r.slice(1)}`,s="";return s+=n(i),t&&(s+=`
10
+ `+n("")),s}function He({namespace:t,name:r,offchainOnly:n,tableIdName:i}){return`
11
+ // Hex below is the result of \`WorldResourceIdLib.encode({ namespace: ${JSON.stringify(t)}, name: ${JSON.stringify(r)}, typeId: ${n?"RESOURCE_OFFCHAIN_TABLE":"RESOURCE_TABLE"} });\`
12
+ ResourceId constant _tableId = ResourceId.wrap(${Y({type:n?"offchainTable":"table",namespace:t,name:r})});
22
13
  ResourceId constant ${i} = _tableId;
23
- `;return{hardcodedTableId:s,tableIdDefinition:o}}function q(r,{typeUnwrap:t,internalTypeId:n}){let i=t.length?`${t}(${r})`:r;if(n==="bytes32")return i;if(n.match(/^bytes\d{1,2}$/))return`bytes32(${i})`;if(n.match(/^uint\d{1,3}$/))return`bytes32(uint256(${i}))`;if(n.match(/^int\d{1,3}$/))return`bytes32(uint256(int256(${i})))`;if(n==="address")return`bytes32(uint256(uint160(${i})))`;if(n==="bool")return`_boolToBytes32(${i})`;throw new Error(`Unknown value type id ${n}`)}function J(r){return r.internalTypeId.match(/^bytes\d{1,2}$/)!==null}function Oe(r){return J(r)?0:256-r.staticByteLength*8}function M(r,t,n){return t.map((i,s)=>n(i,s)+(s===t.length-1?"":r)).join(`
24
- `)}function Ve(r){let t=D;return t+=S(r,({name:n,memberNames:i})=>`
14
+ `}function q(t,{typeUnwrap:r,internalTypeId:n}){let i=r.length?`${r}(${t})`:t;if(n==="bytes32")return i;if(/^bytes\d{1,2}$/.test(n))return`bytes32(${i})`;if(/^uint\d{1,3}$/.test(n))return`bytes32(uint256(${i}))`;if(/^int\d{1,3}$/.test(n))return`bytes32(uint256(int256(${i})))`;if(n==="address")return`bytes32(uint256(uint160(${i})))`;if(n==="bool")return`_boolToBytes32(${i})`;throw new Error(`Unknown value type id ${n}`)}function Q(t){return/^bytes\d{1,2}$/.test(t.internalTypeId)}function Ke(t){return Q(t)?0:256-t.staticByteLength*8}function M(t,r,n){return r.map((i,s)=>n(i,s)+(s===r.length-1?"":t)).join(`
15
+ `)}function Je(t){let r=P;return r+=S(t,({name:n,memberNames:i})=>`
25
16
  enum ${n} {
26
- ${u(i)}
17
+ ${N(i)}
27
18
  }
28
- `),t}function Ge(r){let{fields:t,keyTuple:n}=r,i="";for(let s of Q([...t,...n]))i+=s;return t.some(({internalTypeId:s})=>s.match("bool"))&&(i+=`
19
+ `),r}function Xe(t){let{fields:r,keyTuple:n}=t,i="";for(let s of Z([...r,...n]))i+=s;return r.some(({internalTypeId:s})=>s.match("bool"))&&(i+=`
29
20
  /**
30
21
  * @notice Cast a value to a bool.
31
22
  * @dev Boolean values are encoded as uint8 (1 = true, 0 = false), but Solidity doesn't allow casting between uint8 and bool.
@@ -47,7 +38,7 @@ pragma solidity >=0.8.21;
47
38
  result := value
48
39
  }
49
40
  }
50
- `),i}function Q(r){let t=new Map,n=new Map;for(let{typeWrappingData:i,typeWrap:s,typeUnwrap:o,internalTypeId:a}of r){if(!i)continue;let{kind:y}=i;if(y==="staticArray"){let{elementType:T,staticLength:c}=i;t.set(s,Z(s,T,c,a)),n.set(o,ee(o,T,c,a))}}return[...t.values(),...n.values()]}function Z(r,t,n,i){return`
41
+ `),i}function Z(t){let r=new Map,n=new Map;for(let{typeWrappingData:i,typeWrap:s,typeUnwrap:o,internalTypeId:a}of t){if(!i)continue;let{kind:y}=i;if(y==="staticArray"){let{elementType:T,staticLength:c}=i;r.set(s,ee(s,T,c,a)),n.set(o,te(o,T,c,a))}}return[...r.values(),...n.values()]}function ee(t,r,n,i){return`
51
42
  /**
52
43
  * @notice Cast a dynamic array to a static array.
53
44
  * @dev In memory static arrays are just dynamic arrays without the 32 length bytes,
@@ -57,10 +48,10 @@ pragma solidity >=0.8.21;
57
48
  * @param _value The dynamic array to cast.
58
49
  * @return _result The static array.
59
50
  */
60
- function ${r}(
51
+ function ${t}(
61
52
  ${i} memory _value
62
53
  ) pure returns (
63
- ${t}[${n}] memory _result
54
+ ${r}[${n}] memory _result
64
55
  ) {
65
56
  if (_value.length < ${n}) {
66
57
  // return an uninitialized array if the length is smaller than the fixed length to avoid memory corruption
@@ -73,15 +64,15 @@ pragma solidity >=0.8.21;
73
64
  }
74
65
  }
75
66
  }
76
- `}function ee(r,t,n,i){let s=n*32;return`
67
+ `}function te(t,r,n,i){let s=n*32;return`
77
68
  /**
78
69
  * @notice Copy a static array to a dynamic array.
79
70
  * @dev Static arrays don't have a length prefix, so this function copies the memory from the static array to a new dynamic array.
80
71
  * @param _value The static array to copy.
81
72
  * @return _result The dynamic array.
82
73
  */
83
- function ${r}(
84
- ${t}[${n}] memory _value
74
+ function ${t}(
75
+ ${r}[${n}] memory _value
85
76
  ) pure returns (
86
77
  ${i} memory _result
87
78
  ) {
@@ -94,5 +85,5 @@ pragma solidity >=0.8.21;
94
85
  }
95
86
  Memory.copy(fromPointer, toPointer, ${s});
96
87
  }
97
- `}import{SchemaType as e}from"@latticexyz/schema-type/deprecated";var rt={[e.UINT8]:"RecsType.Number",[e.UINT16]:"RecsType.Number",[e.UINT24]:"RecsType.Number",[e.UINT32]:"RecsType.Number",[e.UINT40]:"RecsType.Number",[e.UINT48]:"RecsType.Number",[e.UINT56]:"RecsType.BigInt",[e.UINT64]:"RecsType.BigInt",[e.UINT72]:"RecsType.BigInt",[e.UINT80]:"RecsType.BigInt",[e.UINT88]:"RecsType.BigInt",[e.UINT96]:"RecsType.BigInt",[e.UINT104]:"RecsType.BigInt",[e.UINT112]:"RecsType.BigInt",[e.UINT120]:"RecsType.BigInt",[e.UINT128]:"RecsType.BigInt",[e.UINT136]:"RecsType.BigInt",[e.UINT144]:"RecsType.BigInt",[e.UINT152]:"RecsType.BigInt",[e.UINT160]:"RecsType.BigInt",[e.UINT168]:"RecsType.BigInt",[e.UINT176]:"RecsType.BigInt",[e.UINT184]:"RecsType.BigInt",[e.UINT192]:"RecsType.BigInt",[e.UINT200]:"RecsType.BigInt",[e.UINT208]:"RecsType.BigInt",[e.UINT216]:"RecsType.BigInt",[e.UINT224]:"RecsType.BigInt",[e.UINT232]:"RecsType.BigInt",[e.UINT240]:"RecsType.BigInt",[e.UINT248]:"RecsType.BigInt",[e.UINT256]:"RecsType.BigInt",[e.INT8]:"RecsType.Number",[e.INT16]:"RecsType.Number",[e.INT24]:"RecsType.Number",[e.INT32]:"RecsType.Number",[e.INT40]:"RecsType.Number",[e.INT48]:"RecsType.Number",[e.INT56]:"RecsType.BigInt",[e.INT64]:"RecsType.BigInt",[e.INT72]:"RecsType.BigInt",[e.INT80]:"RecsType.BigInt",[e.INT88]:"RecsType.BigInt",[e.INT96]:"RecsType.BigInt",[e.INT104]:"RecsType.BigInt",[e.INT112]:"RecsType.BigInt",[e.INT120]:"RecsType.BigInt",[e.INT128]:"RecsType.BigInt",[e.INT136]:"RecsType.BigInt",[e.INT144]:"RecsType.BigInt",[e.INT152]:"RecsType.BigInt",[e.INT160]:"RecsType.BigInt",[e.INT168]:"RecsType.BigInt",[e.INT176]:"RecsType.BigInt",[e.INT184]:"RecsType.BigInt",[e.INT192]:"RecsType.BigInt",[e.INT200]:"RecsType.BigInt",[e.INT208]:"RecsType.BigInt",[e.INT216]:"RecsType.BigInt",[e.INT224]:"RecsType.BigInt",[e.INT232]:"RecsType.BigInt",[e.INT240]:"RecsType.BigInt",[e.INT248]:"RecsType.BigInt",[e.INT256]:"RecsType.BigInt",[e.BYTES1]:"RecsType.String",[e.BYTES2]:"RecsType.String",[e.BYTES3]:"RecsType.String",[e.BYTES4]:"RecsType.String",[e.BYTES5]:"RecsType.String",[e.BYTES6]:"RecsType.String",[e.BYTES7]:"RecsType.String",[e.BYTES8]:"RecsType.String",[e.BYTES9]:"RecsType.String",[e.BYTES10]:"RecsType.String",[e.BYTES11]:"RecsType.String",[e.BYTES12]:"RecsType.String",[e.BYTES13]:"RecsType.String",[e.BYTES14]:"RecsType.String",[e.BYTES15]:"RecsType.String",[e.BYTES16]:"RecsType.String",[e.BYTES17]:"RecsType.String",[e.BYTES18]:"RecsType.String",[e.BYTES19]:"RecsType.String",[e.BYTES20]:"RecsType.String",[e.BYTES21]:"RecsType.String",[e.BYTES22]:"RecsType.String",[e.BYTES23]:"RecsType.String",[e.BYTES24]:"RecsType.String",[e.BYTES25]:"RecsType.String",[e.BYTES26]:"RecsType.String",[e.BYTES27]:"RecsType.String",[e.BYTES28]:"RecsType.String",[e.BYTES29]:"RecsType.String",[e.BYTES30]:"RecsType.String",[e.BYTES31]:"RecsType.String",[e.BYTES32]:"RecsType.String",[e.BOOL]:"RecsType.Boolean",[e.ADDRESS]:"RecsType.String",[e.UINT8_ARRAY]:"RecsType.NumberArray",[e.UINT16_ARRAY]:"RecsType.NumberArray",[e.UINT24_ARRAY]:"RecsType.NumberArray",[e.UINT32_ARRAY]:"RecsType.NumberArray",[e.UINT40_ARRAY]:"RecsType.NumberArray",[e.UINT48_ARRAY]:"RecsType.NumberArray",[e.UINT56_ARRAY]:"RecsType.BigIntArray",[e.UINT64_ARRAY]:"RecsType.BigIntArray",[e.UINT72_ARRAY]:"RecsType.BigIntArray",[e.UINT80_ARRAY]:"RecsType.BigIntArray",[e.UINT88_ARRAY]:"RecsType.BigIntArray",[e.UINT96_ARRAY]:"RecsType.BigIntArray",[e.UINT104_ARRAY]:"RecsType.BigIntArray",[e.UINT112_ARRAY]:"RecsType.BigIntArray",[e.UINT120_ARRAY]:"RecsType.BigIntArray",[e.UINT128_ARRAY]:"RecsType.BigIntArray",[e.UINT136_ARRAY]:"RecsType.BigIntArray",[e.UINT144_ARRAY]:"RecsType.BigIntArray",[e.UINT152_ARRAY]:"RecsType.BigIntArray",[e.UINT160_ARRAY]:"RecsType.BigIntArray",[e.UINT168_ARRAY]:"RecsType.BigIntArray",[e.UINT176_ARRAY]:"RecsType.BigIntArray",[e.UINT184_ARRAY]:"RecsType.BigIntArray",[e.UINT192_ARRAY]:"RecsType.BigIntArray",[e.UINT200_ARRAY]:"RecsType.BigIntArray",[e.UINT208_ARRAY]:"RecsType.BigIntArray",[e.UINT216_ARRAY]:"RecsType.BigIntArray",[e.UINT224_ARRAY]:"RecsType.BigIntArray",[e.UINT232_ARRAY]:"RecsType.BigIntArray",[e.UINT240_ARRAY]:"RecsType.BigIntArray",[e.UINT248_ARRAY]:"RecsType.BigIntArray",[e.UINT256_ARRAY]:"RecsType.BigIntArray",[e.INT8_ARRAY]:"RecsType.NumberArray",[e.INT16_ARRAY]:"RecsType.NumberArray",[e.INT24_ARRAY]:"RecsType.NumberArray",[e.INT32_ARRAY]:"RecsType.NumberArray",[e.INT40_ARRAY]:"RecsType.NumberArray",[e.INT48_ARRAY]:"RecsType.NumberArray",[e.INT56_ARRAY]:"RecsType.BigIntArray",[e.INT64_ARRAY]:"RecsType.BigIntArray",[e.INT72_ARRAY]:"RecsType.BigIntArray",[e.INT80_ARRAY]:"RecsType.BigIntArray",[e.INT88_ARRAY]:"RecsType.BigIntArray",[e.INT96_ARRAY]:"RecsType.BigIntArray",[e.INT104_ARRAY]:"RecsType.BigIntArray",[e.INT112_ARRAY]:"RecsType.BigIntArray",[e.INT120_ARRAY]:"RecsType.BigIntArray",[e.INT128_ARRAY]:"RecsType.BigIntArray",[e.INT136_ARRAY]:"RecsType.BigIntArray",[e.INT144_ARRAY]:"RecsType.BigIntArray",[e.INT152_ARRAY]:"RecsType.BigIntArray",[e.INT160_ARRAY]:"RecsType.BigIntArray",[e.INT168_ARRAY]:"RecsType.BigIntArray",[e.INT176_ARRAY]:"RecsType.BigIntArray",[e.INT184_ARRAY]:"RecsType.BigIntArray",[e.INT192_ARRAY]:"RecsType.BigIntArray",[e.INT200_ARRAY]:"RecsType.BigIntArray",[e.INT208_ARRAY]:"RecsType.BigIntArray",[e.INT216_ARRAY]:"RecsType.BigIntArray",[e.INT224_ARRAY]:"RecsType.BigIntArray",[e.INT232_ARRAY]:"RecsType.BigIntArray",[e.INT240_ARRAY]:"RecsType.BigIntArray",[e.INT248_ARRAY]:"RecsType.BigIntArray",[e.INT256_ARRAY]:"RecsType.BigIntArray",[e.BYTES1_ARRAY]:"RecsType.BigIntArray",[e.BYTES2_ARRAY]:"RecsType.BigIntArray",[e.BYTES3_ARRAY]:"RecsType.BigIntArray",[e.BYTES4_ARRAY]:"RecsType.BigIntArray",[e.BYTES5_ARRAY]:"RecsType.BigIntArray",[e.BYTES6_ARRAY]:"RecsType.BigIntArray",[e.BYTES7_ARRAY]:"RecsType.BigIntArray",[e.BYTES8_ARRAY]:"RecsType.BigIntArray",[e.BYTES9_ARRAY]:"RecsType.BigIntArray",[e.BYTES10_ARRAY]:"RecsType.BigIntArray",[e.BYTES11_ARRAY]:"RecsType.BigIntArray",[e.BYTES12_ARRAY]:"RecsType.BigIntArray",[e.BYTES13_ARRAY]:"RecsType.BigIntArray",[e.BYTES14_ARRAY]:"RecsType.BigIntArray",[e.BYTES15_ARRAY]:"RecsType.BigIntArray",[e.BYTES16_ARRAY]:"RecsType.BigIntArray",[e.BYTES17_ARRAY]:"RecsType.BigIntArray",[e.BYTES18_ARRAY]:"RecsType.BigIntArray",[e.BYTES19_ARRAY]:"RecsType.BigIntArray",[e.BYTES20_ARRAY]:"RecsType.BigIntArray",[e.BYTES21_ARRAY]:"RecsType.BigIntArray",[e.BYTES22_ARRAY]:"RecsType.BigIntArray",[e.BYTES23_ARRAY]:"RecsType.BigIntArray",[e.BYTES24_ARRAY]:"RecsType.BigIntArray",[e.BYTES25_ARRAY]:"RecsType.BigIntArray",[e.BYTES26_ARRAY]:"RecsType.BigIntArray",[e.BYTES27_ARRAY]:"RecsType.BigIntArray",[e.BYTES28_ARRAY]:"RecsType.BigIntArray",[e.BYTES29_ARRAY]:"RecsType.BigIntArray",[e.BYTES30_ARRAY]:"RecsType.BigIntArray",[e.BYTES31_ARRAY]:"RecsType.BigIntArray",[e.BYTES32_ARRAY]:"RecsType.BigIntArray",[e.BOOL_ARRAY]:"RecsType.T",[e.ADDRESS_ARRAY]:"RecsType.StringArray",[e.BYTES]:"RecsType.String",[e.STRING]:"RecsType.String"};export{ne as contractToInterface,h as extractUserTypes,le as formatAndWriteSolidity,me as formatAndWriteTypescript,U as formatSolidity,E as formatTypescript,Oe as getLeftPaddingBits,J as isLeftAligned,be as loadAndExtractUserTypes,Y as posixPath,C as renderAbsoluteImports,u as renderArguments,Me as renderCommonData,Ve as renderEnums,Fe as renderImports,S as renderList,ke as renderRelativeImports,je as renderTableId,Ge as renderTypeHelpers,q as renderValueTypeToBytes32,We as renderWithFieldSuffix,Le as renderWithStore,D as renderedSolidityHeader,rt as schemaTypesToRecsTypeStrings,P as solidityRelativeImportPath};
88
+ `}import{SchemaType as e}from"@latticexyz/schema-type/deprecated";var it={[e.UINT8]:"RecsType.Number",[e.UINT16]:"RecsType.Number",[e.UINT24]:"RecsType.Number",[e.UINT32]:"RecsType.Number",[e.UINT40]:"RecsType.Number",[e.UINT48]:"RecsType.Number",[e.UINT56]:"RecsType.BigInt",[e.UINT64]:"RecsType.BigInt",[e.UINT72]:"RecsType.BigInt",[e.UINT80]:"RecsType.BigInt",[e.UINT88]:"RecsType.BigInt",[e.UINT96]:"RecsType.BigInt",[e.UINT104]:"RecsType.BigInt",[e.UINT112]:"RecsType.BigInt",[e.UINT120]:"RecsType.BigInt",[e.UINT128]:"RecsType.BigInt",[e.UINT136]:"RecsType.BigInt",[e.UINT144]:"RecsType.BigInt",[e.UINT152]:"RecsType.BigInt",[e.UINT160]:"RecsType.BigInt",[e.UINT168]:"RecsType.BigInt",[e.UINT176]:"RecsType.BigInt",[e.UINT184]:"RecsType.BigInt",[e.UINT192]:"RecsType.BigInt",[e.UINT200]:"RecsType.BigInt",[e.UINT208]:"RecsType.BigInt",[e.UINT216]:"RecsType.BigInt",[e.UINT224]:"RecsType.BigInt",[e.UINT232]:"RecsType.BigInt",[e.UINT240]:"RecsType.BigInt",[e.UINT248]:"RecsType.BigInt",[e.UINT256]:"RecsType.BigInt",[e.INT8]:"RecsType.Number",[e.INT16]:"RecsType.Number",[e.INT24]:"RecsType.Number",[e.INT32]:"RecsType.Number",[e.INT40]:"RecsType.Number",[e.INT48]:"RecsType.Number",[e.INT56]:"RecsType.BigInt",[e.INT64]:"RecsType.BigInt",[e.INT72]:"RecsType.BigInt",[e.INT80]:"RecsType.BigInt",[e.INT88]:"RecsType.BigInt",[e.INT96]:"RecsType.BigInt",[e.INT104]:"RecsType.BigInt",[e.INT112]:"RecsType.BigInt",[e.INT120]:"RecsType.BigInt",[e.INT128]:"RecsType.BigInt",[e.INT136]:"RecsType.BigInt",[e.INT144]:"RecsType.BigInt",[e.INT152]:"RecsType.BigInt",[e.INT160]:"RecsType.BigInt",[e.INT168]:"RecsType.BigInt",[e.INT176]:"RecsType.BigInt",[e.INT184]:"RecsType.BigInt",[e.INT192]:"RecsType.BigInt",[e.INT200]:"RecsType.BigInt",[e.INT208]:"RecsType.BigInt",[e.INT216]:"RecsType.BigInt",[e.INT224]:"RecsType.BigInt",[e.INT232]:"RecsType.BigInt",[e.INT240]:"RecsType.BigInt",[e.INT248]:"RecsType.BigInt",[e.INT256]:"RecsType.BigInt",[e.BYTES1]:"RecsType.String",[e.BYTES2]:"RecsType.String",[e.BYTES3]:"RecsType.String",[e.BYTES4]:"RecsType.String",[e.BYTES5]:"RecsType.String",[e.BYTES6]:"RecsType.String",[e.BYTES7]:"RecsType.String",[e.BYTES8]:"RecsType.String",[e.BYTES9]:"RecsType.String",[e.BYTES10]:"RecsType.String",[e.BYTES11]:"RecsType.String",[e.BYTES12]:"RecsType.String",[e.BYTES13]:"RecsType.String",[e.BYTES14]:"RecsType.String",[e.BYTES15]:"RecsType.String",[e.BYTES16]:"RecsType.String",[e.BYTES17]:"RecsType.String",[e.BYTES18]:"RecsType.String",[e.BYTES19]:"RecsType.String",[e.BYTES20]:"RecsType.String",[e.BYTES21]:"RecsType.String",[e.BYTES22]:"RecsType.String",[e.BYTES23]:"RecsType.String",[e.BYTES24]:"RecsType.String",[e.BYTES25]:"RecsType.String",[e.BYTES26]:"RecsType.String",[e.BYTES27]:"RecsType.String",[e.BYTES28]:"RecsType.String",[e.BYTES29]:"RecsType.String",[e.BYTES30]:"RecsType.String",[e.BYTES31]:"RecsType.String",[e.BYTES32]:"RecsType.String",[e.BOOL]:"RecsType.Boolean",[e.ADDRESS]:"RecsType.String",[e.UINT8_ARRAY]:"RecsType.NumberArray",[e.UINT16_ARRAY]:"RecsType.NumberArray",[e.UINT24_ARRAY]:"RecsType.NumberArray",[e.UINT32_ARRAY]:"RecsType.NumberArray",[e.UINT40_ARRAY]:"RecsType.NumberArray",[e.UINT48_ARRAY]:"RecsType.NumberArray",[e.UINT56_ARRAY]:"RecsType.BigIntArray",[e.UINT64_ARRAY]:"RecsType.BigIntArray",[e.UINT72_ARRAY]:"RecsType.BigIntArray",[e.UINT80_ARRAY]:"RecsType.BigIntArray",[e.UINT88_ARRAY]:"RecsType.BigIntArray",[e.UINT96_ARRAY]:"RecsType.BigIntArray",[e.UINT104_ARRAY]:"RecsType.BigIntArray",[e.UINT112_ARRAY]:"RecsType.BigIntArray",[e.UINT120_ARRAY]:"RecsType.BigIntArray",[e.UINT128_ARRAY]:"RecsType.BigIntArray",[e.UINT136_ARRAY]:"RecsType.BigIntArray",[e.UINT144_ARRAY]:"RecsType.BigIntArray",[e.UINT152_ARRAY]:"RecsType.BigIntArray",[e.UINT160_ARRAY]:"RecsType.BigIntArray",[e.UINT168_ARRAY]:"RecsType.BigIntArray",[e.UINT176_ARRAY]:"RecsType.BigIntArray",[e.UINT184_ARRAY]:"RecsType.BigIntArray",[e.UINT192_ARRAY]:"RecsType.BigIntArray",[e.UINT200_ARRAY]:"RecsType.BigIntArray",[e.UINT208_ARRAY]:"RecsType.BigIntArray",[e.UINT216_ARRAY]:"RecsType.BigIntArray",[e.UINT224_ARRAY]:"RecsType.BigIntArray",[e.UINT232_ARRAY]:"RecsType.BigIntArray",[e.UINT240_ARRAY]:"RecsType.BigIntArray",[e.UINT248_ARRAY]:"RecsType.BigIntArray",[e.UINT256_ARRAY]:"RecsType.BigIntArray",[e.INT8_ARRAY]:"RecsType.NumberArray",[e.INT16_ARRAY]:"RecsType.NumberArray",[e.INT24_ARRAY]:"RecsType.NumberArray",[e.INT32_ARRAY]:"RecsType.NumberArray",[e.INT40_ARRAY]:"RecsType.NumberArray",[e.INT48_ARRAY]:"RecsType.NumberArray",[e.INT56_ARRAY]:"RecsType.BigIntArray",[e.INT64_ARRAY]:"RecsType.BigIntArray",[e.INT72_ARRAY]:"RecsType.BigIntArray",[e.INT80_ARRAY]:"RecsType.BigIntArray",[e.INT88_ARRAY]:"RecsType.BigIntArray",[e.INT96_ARRAY]:"RecsType.BigIntArray",[e.INT104_ARRAY]:"RecsType.BigIntArray",[e.INT112_ARRAY]:"RecsType.BigIntArray",[e.INT120_ARRAY]:"RecsType.BigIntArray",[e.INT128_ARRAY]:"RecsType.BigIntArray",[e.INT136_ARRAY]:"RecsType.BigIntArray",[e.INT144_ARRAY]:"RecsType.BigIntArray",[e.INT152_ARRAY]:"RecsType.BigIntArray",[e.INT160_ARRAY]:"RecsType.BigIntArray",[e.INT168_ARRAY]:"RecsType.BigIntArray",[e.INT176_ARRAY]:"RecsType.BigIntArray",[e.INT184_ARRAY]:"RecsType.BigIntArray",[e.INT192_ARRAY]:"RecsType.BigIntArray",[e.INT200_ARRAY]:"RecsType.BigIntArray",[e.INT208_ARRAY]:"RecsType.BigIntArray",[e.INT216_ARRAY]:"RecsType.BigIntArray",[e.INT224_ARRAY]:"RecsType.BigIntArray",[e.INT232_ARRAY]:"RecsType.BigIntArray",[e.INT240_ARRAY]:"RecsType.BigIntArray",[e.INT248_ARRAY]:"RecsType.BigIntArray",[e.INT256_ARRAY]:"RecsType.BigIntArray",[e.BYTES1_ARRAY]:"RecsType.BigIntArray",[e.BYTES2_ARRAY]:"RecsType.BigIntArray",[e.BYTES3_ARRAY]:"RecsType.BigIntArray",[e.BYTES4_ARRAY]:"RecsType.BigIntArray",[e.BYTES5_ARRAY]:"RecsType.BigIntArray",[e.BYTES6_ARRAY]:"RecsType.BigIntArray",[e.BYTES7_ARRAY]:"RecsType.BigIntArray",[e.BYTES8_ARRAY]:"RecsType.BigIntArray",[e.BYTES9_ARRAY]:"RecsType.BigIntArray",[e.BYTES10_ARRAY]:"RecsType.BigIntArray",[e.BYTES11_ARRAY]:"RecsType.BigIntArray",[e.BYTES12_ARRAY]:"RecsType.BigIntArray",[e.BYTES13_ARRAY]:"RecsType.BigIntArray",[e.BYTES14_ARRAY]:"RecsType.BigIntArray",[e.BYTES15_ARRAY]:"RecsType.BigIntArray",[e.BYTES16_ARRAY]:"RecsType.BigIntArray",[e.BYTES17_ARRAY]:"RecsType.BigIntArray",[e.BYTES18_ARRAY]:"RecsType.BigIntArray",[e.BYTES19_ARRAY]:"RecsType.BigIntArray",[e.BYTES20_ARRAY]:"RecsType.BigIntArray",[e.BYTES21_ARRAY]:"RecsType.BigIntArray",[e.BYTES22_ARRAY]:"RecsType.BigIntArray",[e.BYTES23_ARRAY]:"RecsType.BigIntArray",[e.BYTES24_ARRAY]:"RecsType.BigIntArray",[e.BYTES25_ARRAY]:"RecsType.BigIntArray",[e.BYTES26_ARRAY]:"RecsType.BigIntArray",[e.BYTES27_ARRAY]:"RecsType.BigIntArray",[e.BYTES28_ARRAY]:"RecsType.BigIntArray",[e.BYTES29_ARRAY]:"RecsType.BigIntArray",[e.BYTES30_ARRAY]:"RecsType.BigIntArray",[e.BYTES31_ARRAY]:"RecsType.BigIntArray",[e.BYTES32_ARRAY]:"RecsType.BigIntArray",[e.BOOL_ARRAY]:"RecsType.T",[e.ADDRESS_ARRAY]:"RecsType.StringArray",[e.BYTES]:"RecsType.String",[e.STRING]:"RecsType.String"};export{ie as contractToInterface,U as extractUserTypes,le as formatAndWriteSolidity,fe as formatAndWriteTypescript,E as formatSolidity,x as formatTypescript,Ke as getLeftPaddingBits,Q as isLeftAligned,be as loadAndExtractUserTypes,B as posixPath,F as renderAbsoluteImports,N as renderArguments,Le as renderCommonData,Je as renderEnums,ke as renderImports,S as renderList,We as renderRelativeImports,He as renderTableId,Xe as renderTypeHelpers,q as renderValueTypeToBytes32,je as renderWithFieldSuffix,Oe as renderWithStore,P as renderedSolidityHeader,it as schemaTypesToRecsTypeStrings,C as solidityRelativeImportPath};
98
89
  //# sourceMappingURL=codegen.js.map