-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4604639
commit ce12963
Showing
58 changed files
with
452 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# @latticexyz/abi-ts | ||
|
||
## 2.0.0-next.6 | ||
|
||
### Minor Changes | ||
|
||
- [#1403](https://github.com/latticexyz/mud/pull/1403) [`55377ffe`](https://github.com/latticexyz/mud/commit/55377ffe6bfab13e0e834fadc07df4ef75122295) Thanks [@holic](https://github.com/holic)! - Added a new `@latticexyz/abi-ts` package to generate TS type declaration files (`.d.ts`) for each ABI JSON file. This replaces our usage TypeChain everywhere. It's also bundled into `@latticexyz/cli` under the `mud abi-ts` command. | ||
|
||
If you have a MUD project created from an older template, you can replace TypeChain with `abi-ts` by first updating your contracts' `package.json`: | ||
|
||
```diff | ||
-"build": "pnpm run build:mud && pnpm run build:abi && pnpm run build:typechain", | ||
+"build": "pnpm run build:mud && pnpm run build:abi && pnpm run build:abi-ts", | ||
-"build:abi": "forge clean && forge build", | ||
+"build:abi": "rimraf abi && forge build --extra-output-files abi --out abi --skip test script MudTest.sol", | ||
+"build:abi-ts": "mud abi-ts --input 'abi/IWorld.sol/IWorld.abi.json' && prettier --write '**/*.abi.json.d.ts'", | ||
"build:mud": "mud tablegen && mud worldgen", | ||
-"build:typechain": "rimraf types && typechain --target=ethers-v5 out/IWorld.sol/IWorld.json", | ||
``` | ||
|
||
And update your client's `setupNetwork.ts` with: | ||
|
||
```diff | ||
-import { IWorld__factory } from "contracts/types/ethers-contracts/factories/IWorld__factory"; | ||
+import IWorldAbi from "contracts/abi/IWorld.sol/IWorld.abi.json"; | ||
|
||
const worldContract = createContract({ | ||
address: networkConfig.worldAddress as Hex, | ||
- abi: IWorld__factory.abi, | ||
+ abi: IWorldAbi, | ||
``` | ||
|
||
If you previously relied on TypeChain types from `@latticexyz/store` or `@latticexyz/world`, you will either need to migrate to viem or abitype using ABI JSON imports or generate TypeChain types from our exported ABI JSON files. | ||
|
||
```ts | ||
import { getContract } from "viem"; | ||
import IStoreAbi from "@latticexyz/store/abi/IStore.sol/IStore.abi.json"; | ||
|
||
const storeContract = getContract({ | ||
abi: IStoreAbi, | ||
... | ||
}); | ||
|
||
await storeContract.write.setRecord(...); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "create-mud", | ||
"version": "2.0.0-next.5", | ||
"version": "2.0.0-next.6", | ||
"description": "Create a new MUD project", | ||
"license": "MIT", | ||
"author": "Lattice <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# @latticexyz/ecs-browser | ||
|
||
## 2.0.0-next.6 | ||
|
||
## 2.0.0-next.5 | ||
|
||
## 2.0.0-next.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "@latticexyz/ecs-browser", | ||
"version": "2.0.0-next.5", | ||
"version": "2.0.0-next.6", | ||
"private": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Change Log | ||
|
||
## 2.0.0-next.6 | ||
|
||
## 2.0.0-next.5 | ||
|
||
## 2.0.0-next.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.