@latticexyz/world-module-erc20 2.2.13-main-dfc2d6439ee7076cdccbf1a24b7423fb19a7771d → 2.2.13-main-90803770ee72bfd2b9ba9a7990285d1c5866f362
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/internal.d.ts +10 -0
- package/dist/{index.js → internal.js} +2 -2
- package/dist/internal.js.map +1 -0
- package/package.json +10 -10
- package/dist/index.d.ts +0 -15
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -92,7 +92,7 @@ In your MUD config:
|
|
|
92
92
|
|
|
93
93
|
```typescript
|
|
94
94
|
import { defineWorld } from "@latticexyz/world";
|
|
95
|
-
import {
|
|
95
|
+
import { defineERC20Module } from "@latticexyz/world-module-erc20/internal";
|
|
96
96
|
|
|
97
97
|
export default defineWorld({
|
|
98
98
|
namespace: "app",
|
|
@@ -105,7 +105,7 @@ export default defineWorld({
|
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
107
|
modules: [
|
|
108
|
-
|
|
108
|
+
defineERC20Module({
|
|
109
109
|
namespace: "erc20Namespace",
|
|
110
110
|
name: "MyToken",
|
|
111
111
|
symbol: "MTK",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ModuleInput } from '@latticexyz/world/internal';
|
|
2
|
+
|
|
3
|
+
type DefineERC20ModuleInput = {
|
|
4
|
+
namespace: string;
|
|
5
|
+
name: string;
|
|
6
|
+
symbol: string;
|
|
7
|
+
};
|
|
8
|
+
declare function defineERC20Module({ namespace, name, symbol }: DefineERC20ModuleInput): ModuleInput;
|
|
9
|
+
|
|
10
|
+
export { defineERC20Module };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r,b as o}from"./chunk-AU25RBDM.js";import"./chunk-QBDELX7C.js";import"./chunk-SYRP7SJ5.js";function
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import{a as r,b as o}from"./chunk-AU25RBDM.js";import"./chunk-QBDELX7C.js";import"./chunk-SYRP7SJ5.js";function a({namespace:e,name:t,symbol:n}){return{artifactPath:"@latticexyz/world-module-erc20/out/ERC20Module.sol/ERC20Module.json",root:!1,args:[{type:"bytes",value:o([{type:"bytes14"},{type:"string"},{type:"string"}],[r(e,{size:14}),t,n])}]}}export{a as defineERC20Module};
|
|
2
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../ts/defineERC20Module.ts"],"sourcesContent":["import { encodeAbiParameters, stringToHex } from \"viem\";\nimport { ModuleInput } from \"@latticexyz/world/internal\";\n\nexport type DefineERC20ModuleInput = {\n namespace: string;\n name: string;\n symbol: string;\n};\n\nexport function defineERC20Module({ namespace, name, symbol }: DefineERC20ModuleInput): ModuleInput {\n const erc20ModuleArgs = encodeAbiParameters(\n [{ type: \"bytes14\" }, { type: \"string\" }, { type: \"string\" }],\n [stringToHex(namespace, { size: 14 }), name, symbol],\n );\n\n return {\n artifactPath: \"@latticexyz/world-module-erc20/out/ERC20Module.sol/ERC20Module.json\",\n root: false,\n args: [\n {\n type: \"bytes\",\n value: erc20ModuleArgs,\n },\n ],\n };\n}\n"],"mappings":"uGASO,SAASA,EAAkB,CAAE,UAAAC,EAAW,KAAAC,EAAM,OAAAC,CAAO,EAAwC,CAMlG,MAAO,CACL,aAAc,sEACd,KAAM,GACN,KAAM,CACJ,CACE,KAAM,QACN,MAXkBC,EACtB,CAAC,CAAE,KAAM,SAAU,EAAG,CAAE,KAAM,QAAS,EAAG,CAAE,KAAM,QAAS,CAAC,EAC5D,CAACC,EAAYJ,EAAW,CAAE,KAAM,EAAG,CAAC,EAAGC,EAAMC,CAAM,CACrD,CASI,CACF,CACF,CACF","names":["defineERC20Module","namespace","name","symbol","encodeAbiParameters","stringToHex"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@latticexyz/world-module-erc20",
|
|
3
|
-
"version": "2.2.13-main-
|
|
3
|
+
"version": "2.2.13-main-90803770ee72bfd2b9ba9a7990285d1c5866f362",
|
|
4
4
|
"description": "ERC20 world module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"exports": {
|
|
13
|
+
"./internal": "./dist/internal.js",
|
|
13
14
|
"./mud.config": "./dist/mud.config.js",
|
|
14
|
-
".": "./dist/index.js",
|
|
15
15
|
"./out/*": "./out/*"
|
|
16
16
|
},
|
|
17
17
|
"typesVersions": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"mud.config": [
|
|
20
20
|
"./dist/mud.config.d.ts"
|
|
21
21
|
],
|
|
22
|
-
"
|
|
23
|
-
"./dist/
|
|
22
|
+
"internal": [
|
|
23
|
+
"./dist/internal.d.ts"
|
|
24
24
|
]
|
|
25
25
|
}
|
|
26
26
|
},
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"src"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@latticexyz/schema-type": "2.2.13-main-
|
|
34
|
-
"@latticexyz/store": "2.2.13-main-
|
|
35
|
-
"@latticexyz/world": "2.2.13-main-
|
|
33
|
+
"@latticexyz/schema-type": "2.2.13-main-90803770ee72bfd2b9ba9a7990285d1c5866f362",
|
|
34
|
+
"@latticexyz/store": "2.2.13-main-90803770ee72bfd2b9ba9a7990285d1c5866f362",
|
|
35
|
+
"@latticexyz/world": "2.2.13-main-90803770ee72bfd2b9ba9a7990285d1c5866f362"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^18.15.11",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"solhint": "^3.3.7",
|
|
42
42
|
"tsup": "^6.7.0",
|
|
43
43
|
"vitest": "0.34.6",
|
|
44
|
-
"@latticexyz/abi-ts": "2.2.13-main-
|
|
45
|
-
"@latticexyz/
|
|
46
|
-
"@latticexyz/
|
|
44
|
+
"@latticexyz/abi-ts": "2.2.13-main-90803770ee72bfd2b9ba9a7990285d1c5866f362",
|
|
45
|
+
"@latticexyz/cli": "2.2.13-main-90803770ee72bfd2b9ba9a7990285d1c5866f362",
|
|
46
|
+
"@latticexyz/gas-report": "2.2.13-main-90803770ee72bfd2b9ba9a7990285d1c5866f362"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
package/dist/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type DefineERC20ConfigInput = {
|
|
2
|
-
namespace: string;
|
|
3
|
-
name: string;
|
|
4
|
-
symbol: string;
|
|
5
|
-
};
|
|
6
|
-
declare function defineERC20Config({ namespace, name, symbol }: DefineERC20ConfigInput): {
|
|
7
|
-
artifactPath: string;
|
|
8
|
-
root: boolean;
|
|
9
|
-
args: {
|
|
10
|
-
type: string;
|
|
11
|
-
value: `0x${string}`;
|
|
12
|
-
}[];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { DefineERC20ConfigInput, defineERC20Config };
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../ts/exports/index.ts"],"sourcesContent":["import { encodeAbiParameters, stringToHex } from \"viem\";\n\nexport type DefineERC20ConfigInput = {\n namespace: string;\n name: string;\n symbol: string;\n};\n\nexport function defineERC20Config({ namespace, name, symbol }: DefineERC20ConfigInput) {\n const erc20ModuleArgs = encodeAbiParameters(\n [{ type: \"bytes14\" }, { type: \"string\" }, { type: \"string\" }],\n [stringToHex(namespace, { size: 14 }), name, symbol],\n );\n\n return {\n artifactPath: \"@latticexyz/world-module-erc20/out/ERC20Module.sol/ERC20Module.json\",\n root: false,\n args: [\n {\n type: \"bytes\",\n value: erc20ModuleArgs,\n },\n ],\n };\n}\n"],"mappings":"uGAQO,SAASA,EAAkB,CAAE,UAAAC,EAAW,KAAAC,EAAM,OAAAC,CAAO,EAA2B,CAMrF,MAAO,CACL,aAAc,sEACd,KAAM,GACN,KAAM,CACJ,CACE,KAAM,QACN,MAXkBC,EACtB,CAAC,CAAE,KAAM,SAAU,EAAG,CAAE,KAAM,QAAS,EAAG,CAAE,KAAM,QAAS,CAAC,EAC5D,CAACC,EAAYJ,EAAW,CAAE,KAAM,EAAG,CAAC,EAAGC,EAAMC,CAAM,CACrD,CASI,CACF,CACF,CACF","names":["defineERC20Config","namespace","name","symbol","encodeAbiParameters","stringToHex"]}
|