diff --git a/.changeset/stale-cooks-reflect.md b/.changeset/stale-cooks-reflect.md new file mode 100644 index 0000000000..3e5fb19dd5 --- /dev/null +++ b/.changeset/stale-cooks-reflect.md @@ -0,0 +1,18 @@ +--- +"@latticexyz/block-logs-stream": patch +"@latticexyz/cli": patch +"@latticexyz/common": patch +"@latticexyz/dev-tools": patch +"@latticexyz/network": patch +"@latticexyz/protocol-parser": patch +"@latticexyz/schema-type": patch +"@latticexyz/std-client": patch +"@latticexyz/store-cache": patch +"@latticexyz/store-sync": patch +"@latticexyz/store": patch +create-mud: patch +--- + +- bump to viem 1.3.0 and abitype 0.9.3 +- move `@wagmi/chains` imports to `viem/chains` +- refine a few types diff --git a/e2e/package.json b/e2e/package.json index 74638aafb8..fa8ea464ac 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -13,5 +13,10 @@ "engines": { "node": "18.x", "pnpm": "8.x" + }, + "pnpm": { + "overrides": { + "abitype": "0.9.3" + } } } diff --git a/e2e/packages/client-vanilla/package.json b/e2e/packages/client-vanilla/package.json index 86ba3621fa..e15e838f95 100644 --- a/e2e/packages/client-vanilla/package.json +++ b/e2e/packages/client-vanilla/package.json @@ -21,7 +21,6 @@ "@latticexyz/std-client": "link:../../../packages/std-client", "@latticexyz/utils": "link:../../../packages/utils", "@latticexyz/world": "link:../../../packages/world", - "@wagmi/chains": "^0.2.22", "async-mutex": "^0.4.0", "contracts": "workspace:*", "ethers": "^5.7.2", @@ -33,7 +32,7 @@ "react": "^18.2.0", "rxjs": "7.5.5", "threads": "^1.7.0", - "viem": "1.1.7" + "viem": "1.3.0" }, "devDependencies": { "rimraf": "^3.0.2", diff --git a/e2e/packages/client-vanilla/src/mud/supportedChains.ts b/e2e/packages/client-vanilla/src/mud/supportedChains.ts index 9a4aabf6c3..5844280c94 100644 --- a/e2e/packages/client-vanilla/src/mud/supportedChains.ts +++ b/e2e/packages/client-vanilla/src/mud/supportedChains.ts @@ -1,5 +1,5 @@ import { MUDChain, latticeTestnet } from "@latticexyz/common/chains"; -import { foundry } from "@wagmi/chains"; +import { foundry } from "viem/chains"; // If you are deploying to chains other than anvil or Lattice testnet, add them here export const supportedChains: MUDChain[] = [foundry, latticeTestnet]; diff --git a/e2e/packages/sync-test/package.json b/e2e/packages/sync-test/package.json index ec866f42ea..447afbbb4a 100644 --- a/e2e/packages/sync-test/package.json +++ b/e2e/packages/sync-test/package.json @@ -18,7 +18,7 @@ "execa": "^7.1.1", "jsdom": "^22.0.0", "typescript": "5.1.6", - "viem": "1.0.6", + "viem": "1.3.0", "vite": "^4.2.1", "vitest": "^0.31.0" } diff --git a/e2e/pnpm-lock.yaml b/e2e/pnpm-lock.yaml index 96a3e9bd98..35b2cc1d81 100644 --- a/e2e/pnpm-lock.yaml +++ b/e2e/pnpm-lock.yaml @@ -4,6 +4,9 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +overrides: + abitype: 0.9.3 + importers: .: @@ -47,9 +50,6 @@ importers: '@latticexyz/world': specifier: link:../../../packages/world version: link:../../../packages/world - '@wagmi/chains': - specifier: ^0.2.22 - version: 0.2.23(typescript@5.1.6) async-mutex: specifier: ^0.4.0 version: 0.4.0 @@ -84,8 +84,8 @@ importers: specifier: ^1.7.0 version: 1.7.0 viem: - specifier: 1.1.7 - version: 1.1.7(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) devDependencies: rimraf: specifier: ^3.0.2 @@ -181,8 +181,8 @@ importers: specifier: 5.1.6 version: 5.1.6 viem: - specifier: 1.0.6 - version: 1.0.6(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) vite: specifier: ^4.2.1 version: 4.3.5(@types/node@20.1.3) @@ -891,30 +891,8 @@ packages: pretty-format: 27.5.1 dev: true - /@wagmi/chains@0.2.23(typescript@5.1.6): - resolution: {integrity: sha512-oIc4ZpUL6bH/HdS7ROPWlFnP5U3XBujO/OiX4csRIezyLjMQ9FNXQRZShhi5ddL0Kj1RDbyVLe9K/QotEm1vig==} - peerDependencies: - typescript: '>=4.9.4' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - typescript: 5.1.6 - dev: false - - /@wagmi/chains@1.1.0(typescript@5.1.6): - resolution: {integrity: sha512-pWZlxBk0Ql8E7DV8DwqlbBpOyUdaG9UDlQPBxJNALuEK1I0tbQ3AVvSDnlsEIt06UPmPo5o27gzs3hwPQ/A+UA==} - peerDependencies: - typescript: '>=5.0.4' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - typescript: 5.1.6 - dev: true - - /@wagmi/chains@1.2.0(typescript@5.1.6): - resolution: {integrity: sha512-dmDRipsE54JfyudOBkuhEexqQWcrZqxn/qiujG8SBzMh/az/AH5xlJSA+j1CPWTx9+QofSMF3B7A4gb6XRmSaQ==} + /@wagmi/chains@1.6.0(typescript@5.1.6): + resolution: {integrity: sha512-5FRlVxse5P4ZaHG3GTvxwVANSmYJas1eQrTBHhjxVtqXoorm0aLmCHbhmN8Xo1yu09PaWKlleEvfE98yH4AgIw==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -922,18 +900,19 @@ packages: optional: true dependencies: typescript: 5.1.6 - dev: false /abab@2.0.6: resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} dev: true - /abitype@0.8.7(typescript@5.1.6): - resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} + /abitype@0.9.3(typescript@5.1.6): + resolution: {integrity: sha512-dz4qCQLurx97FQhnb/EIYTk/ldQ+oafEDUqC0VVIeQS1Q48/YWt/9YNfMmp9SLFqN41ktxny3c8aYxHjmFIB/w==} peerDependencies: typescript: '>=5.0.4' zod: ^3 >=3.19.1 peerDependenciesMeta: + typescript: + optional: true zod: optional: true dependencies: @@ -2218,37 +2197,21 @@ packages: hasBin: true dev: true - /viem@1.0.6(typescript@5.1.6): - resolution: {integrity: sha512-NOVDREj8bWHajuP5Nw6edd0v3auuGWvLHGScmo9OOt1l7g3f1xMQxPA6JlhNmWXzoHjzzxt/5SorBn2DQ6N6Sg==} - dependencies: - '@adraffy/ens-normalize': 1.9.0 - '@noble/curves': 1.0.0 - '@noble/hashes': 1.3.0 - '@scure/bip32': 1.3.0 - '@scure/bip39': 1.2.0 - '@wagmi/chains': 1.1.0(typescript@5.1.6) - abitype: 0.8.7(typescript@5.1.6) - isomorphic-ws: 5.0.0(ws@8.12.0) - ws: 8.12.0 - transitivePeerDependencies: - - bufferutil - - typescript - - utf-8-validate - - zod - dev: true - - /viem@1.1.7(typescript@5.1.6): - resolution: {integrity: sha512-3lBDRS0ejb4Eo9c/S+RBadwIHNK1RS0ffW7HkSt3pMtzl4nis1aF1tHrU6yqI+yCWqAPl36a48qGD4mEhxPuDw==} + /viem@1.3.0(typescript@5.1.6): + resolution: {integrity: sha512-gCtachbNPG9G9D7UNuiqLaLf8IFV15FypBrSpXEFeeEczXxI+Jgi9FTwDS+NJLreVrjBeZXQVj1ITTqKpItw4w==} peerDependencies: typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true dependencies: '@adraffy/ens-normalize': 1.9.0 '@noble/curves': 1.0.0 '@noble/hashes': 1.3.0 '@scure/bip32': 1.3.0 '@scure/bip39': 1.2.0 - '@wagmi/chains': 1.2.0(typescript@5.1.6) - abitype: 0.8.7(typescript@5.1.6) + '@wagmi/chains': 1.6.0(typescript@5.1.6) + abitype: 0.9.3(typescript@5.1.6) isomorphic-ws: 5.0.0(ws@8.12.0) typescript: 5.1.6 ws: 8.12.0 @@ -2256,7 +2219,6 @@ packages: - bufferutil - utf-8-validate - zod - dev: false /vite-node@0.31.4(@types/node@20.1.3): resolution: {integrity: sha512-uzL377GjJtTbuc5KQxVbDu2xfU/x0wVjUtXQR2ihS21q/NK6ROr4oG0rsSkBBddZUVCwzfx22in76/0ZZHXgkQ==} diff --git a/examples/minimal/package.json b/examples/minimal/package.json index 74ea6e37d1..ff556f551e 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -21,5 +21,10 @@ "engines": { "node": "18.x", "pnpm": "8.x" + }, + "pnpm": { + "overrides": { + "abitype": "0.9.3" + } } } diff --git a/examples/minimal/packages/client-phaser/package.json b/examples/minimal/packages/client-phaser/package.json index 9a29cb6edb..af90f2d17e 100644 --- a/examples/minimal/packages/client-phaser/package.json +++ b/examples/minimal/packages/client-phaser/package.json @@ -23,7 +23,6 @@ "@latticexyz/std-client": "link:../../../../packages/std-client", "@latticexyz/utils": "link:../../../../packages/utils", "@latticexyz/world": "link:../../../../packages/world", - "@wagmi/chains": "^0.2.14", "async-mutex": "^0.4.0", "contracts": "workspace:*", "ethers": "^5.7.2", @@ -39,7 +38,7 @@ "styled-components": "^5.3.10", "threads": "^1.7.0", "use-resize-observer": "^9.1.0", - "viem": "1.1.7", + "viem": "1.3.0", "vite": "^4.2.1", "zustand": "^4.3.8" }, diff --git a/examples/minimal/packages/client-phaser/src/mud/supportedChains.ts b/examples/minimal/packages/client-phaser/src/mud/supportedChains.ts index 9a4aabf6c3..5844280c94 100644 --- a/examples/minimal/packages/client-phaser/src/mud/supportedChains.ts +++ b/examples/minimal/packages/client-phaser/src/mud/supportedChains.ts @@ -1,5 +1,5 @@ import { MUDChain, latticeTestnet } from "@latticexyz/common/chains"; -import { foundry } from "@wagmi/chains"; +import { foundry } from "viem/chains"; // If you are deploying to chains other than anvil or Lattice testnet, add them here export const supportedChains: MUDChain[] = [foundry, latticeTestnet]; diff --git a/examples/minimal/packages/client-react/package.json b/examples/minimal/packages/client-react/package.json index b94641a07e..58d7848bf7 100644 --- a/examples/minimal/packages/client-react/package.json +++ b/examples/minimal/packages/client-react/package.json @@ -22,7 +22,6 @@ "@latticexyz/std-client": "link:../../../../packages/std-client", "@latticexyz/utils": "link:../../../../packages/utils", "@latticexyz/world": "link:../../../../packages/world", - "@wagmi/chains": "^0.2.22", "async-mutex": "^0.4.0", "contracts": "workspace:*", "ethers": "^5.7.2", @@ -35,7 +34,7 @@ "react-dom": "^18.2.0", "rxjs": "7.5.5", "threads": "^1.7.0", - "viem": "1.1.7" + "viem": "1.3.0" }, "devDependencies": { "@types/react": "^18.2.6", diff --git a/examples/minimal/packages/client-react/src/mud/supportedChains.ts b/examples/minimal/packages/client-react/src/mud/supportedChains.ts index 9a4aabf6c3..5844280c94 100644 --- a/examples/minimal/packages/client-react/src/mud/supportedChains.ts +++ b/examples/minimal/packages/client-react/src/mud/supportedChains.ts @@ -1,5 +1,5 @@ import { MUDChain, latticeTestnet } from "@latticexyz/common/chains"; -import { foundry } from "@wagmi/chains"; +import { foundry } from "viem/chains"; // If you are deploying to chains other than anvil or Lattice testnet, add them here export const supportedChains: MUDChain[] = [foundry, latticeTestnet]; diff --git a/examples/minimal/packages/client-vanilla/package.json b/examples/minimal/packages/client-vanilla/package.json index 7e7fd374f8..3c4acaa280 100644 --- a/examples/minimal/packages/client-vanilla/package.json +++ b/examples/minimal/packages/client-vanilla/package.json @@ -21,7 +21,6 @@ "@latticexyz/std-client": "link:../../../../packages/std-client", "@latticexyz/utils": "link:../../../../packages/utils", "@latticexyz/world": "link:../../../../packages/world", - "@wagmi/chains": "^0.2.22", "async-mutex": "^0.4.0", "contracts": "workspace:*", "ethers": "^5.7.2", @@ -33,7 +32,7 @@ "react": "^18.2.0", "rxjs": "7.5.5", "threads": "^1.7.0", - "viem": "1.1.7" + "viem": "1.3.0" }, "devDependencies": { "vite": "^4.2.1", diff --git a/examples/minimal/packages/client-vanilla/src/mud/supportedChains.ts b/examples/minimal/packages/client-vanilla/src/mud/supportedChains.ts index 9a4aabf6c3..5844280c94 100644 --- a/examples/minimal/packages/client-vanilla/src/mud/supportedChains.ts +++ b/examples/minimal/packages/client-vanilla/src/mud/supportedChains.ts @@ -1,5 +1,5 @@ import { MUDChain, latticeTestnet } from "@latticexyz/common/chains"; -import { foundry } from "@wagmi/chains"; +import { foundry } from "viem/chains"; // If you are deploying to chains other than anvil or Lattice testnet, add them here export const supportedChains: MUDChain[] = [foundry, latticeTestnet]; diff --git a/examples/minimal/pnpm-lock.yaml b/examples/minimal/pnpm-lock.yaml index 44d33858ed..0a6a8e86bd 100644 --- a/examples/minimal/pnpm-lock.yaml +++ b/examples/minimal/pnpm-lock.yaml @@ -4,6 +4,9 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +overrides: + abitype: 0.9.3 + importers: .: @@ -65,9 +68,6 @@ importers: '@latticexyz/world': specifier: link:../../../../packages/world version: link:../../../../packages/world - '@wagmi/chains': - specifier: ^0.2.14 - version: 0.2.22(typescript@5.1.6) async-mutex: specifier: ^0.4.0 version: 0.4.0 @@ -114,8 +114,8 @@ importers: specifier: ^9.1.0 version: 9.1.0(react-dom@18.2.0)(react@18.2.0) viem: - specifier: 1.1.7 - version: 1.1.7(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) vite: specifier: ^4.2.1 version: 4.2.1 @@ -186,9 +186,6 @@ importers: '@latticexyz/world': specifier: link:../../../../packages/world version: link:../../../../packages/world - '@wagmi/chains': - specifier: ^0.2.22 - version: 0.2.22(typescript@5.1.6) async-mutex: specifier: ^0.4.0 version: 0.4.0 @@ -226,8 +223,8 @@ importers: specifier: ^1.7.0 version: 1.7.0 viem: - specifier: 1.1.7 - version: 1.1.7(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) devDependencies: '@types/react': specifier: ^18.2.6 @@ -286,9 +283,6 @@ importers: '@latticexyz/world': specifier: link:../../../../packages/world version: link:../../../../packages/world - '@wagmi/chains': - specifier: ^0.2.22 - version: 0.2.22(typescript@5.1.6) async-mutex: specifier: ^0.4.0 version: 0.4.0 @@ -323,8 +317,8 @@ importers: specifier: ^1.7.0 version: 1.7.0 viem: - specifier: 1.1.7 - version: 1.1.7(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) devDependencies: vite: specifier: ^4.2.1 @@ -1632,19 +1626,8 @@ packages: - supports-color dev: true - /@wagmi/chains@0.2.22(typescript@5.1.6): - resolution: {integrity: sha512-TdiOzJT6TO1JrztRNjTA5Quz+UmQlbvWFG8N41u9tta0boHA1JCAzGGvU6KuIcOmJfRJkKOUIt67wlbopCpVHg==} - peerDependencies: - typescript: '>=4.9.4' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - typescript: 5.1.6 - dev: false - - /@wagmi/chains@1.2.0(typescript@5.1.6): - resolution: {integrity: sha512-dmDRipsE54JfyudOBkuhEexqQWcrZqxn/qiujG8SBzMh/az/AH5xlJSA+j1CPWTx9+QofSMF3B7A4gb6XRmSaQ==} + /@wagmi/chains@1.6.0(typescript@5.1.6): + resolution: {integrity: sha512-5FRlVxse5P4ZaHG3GTvxwVANSmYJas1eQrTBHhjxVtqXoorm0aLmCHbhmN8Xo1yu09PaWKlleEvfE98yH4AgIw==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -1654,12 +1637,14 @@ packages: typescript: 5.1.6 dev: false - /abitype@0.8.7(typescript@5.1.6): - resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} + /abitype@0.9.3(typescript@5.1.6): + resolution: {integrity: sha512-dz4qCQLurx97FQhnb/EIYTk/ldQ+oafEDUqC0VVIeQS1Q48/YWt/9YNfMmp9SLFqN41ktxny3c8aYxHjmFIB/w==} peerDependencies: typescript: '>=5.0.4' zod: ^3 >=3.19.1 peerDependenciesMeta: + typescript: + optional: true zod: optional: true dependencies: @@ -4242,18 +4227,21 @@ packages: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true - /viem@1.1.7(typescript@5.1.6): - resolution: {integrity: sha512-3lBDRS0ejb4Eo9c/S+RBadwIHNK1RS0ffW7HkSt3pMtzl4nis1aF1tHrU6yqI+yCWqAPl36a48qGD4mEhxPuDw==} + /viem@1.3.0(typescript@5.1.6): + resolution: {integrity: sha512-gCtachbNPG9G9D7UNuiqLaLf8IFV15FypBrSpXEFeeEczXxI+Jgi9FTwDS+NJLreVrjBeZXQVj1ITTqKpItw4w==} peerDependencies: typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true dependencies: '@adraffy/ens-normalize': 1.9.0 '@noble/curves': 1.0.0 '@noble/hashes': 1.3.0 '@scure/bip32': 1.3.0 '@scure/bip39': 1.2.0 - '@wagmi/chains': 1.2.0(typescript@5.1.6) - abitype: 0.8.7(typescript@5.1.6) + '@wagmi/chains': 1.6.0(typescript@5.1.6) + abitype: 0.9.3(typescript@5.1.6) isomorphic-ws: 5.0.0(ws@8.12.0) typescript: 5.1.6 ws: 8.12.0 diff --git a/package.json b/package.json index ce617d7df6..22893d2830 100644 --- a/package.json +++ b/package.json @@ -46,5 +46,10 @@ "engines": { "node": "18.x", "pnpm": "8.x" + }, + "pnpm": { + "overrides": { + "abitype": "0.9.3" + } } } diff --git a/packages/block-logs-stream/package.json b/packages/block-logs-stream/package.json index 15efcc768e..deb40ab42c 100644 --- a/packages/block-logs-stream/package.json +++ b/packages/block-logs-stream/package.json @@ -26,10 +26,10 @@ "@latticexyz/common": "workspace:*", "@latticexyz/config": "workspace:*", "@latticexyz/schema-type": "workspace:*", - "abitype": "0.8.7", + "abitype": "0.9.3", "debug": "^4.3.4", "rxjs": "7.5.5", - "viem": "1.1.7" + "viem": "1.3.0" }, "devDependencies": { "@types/debug": "^4.1.7", diff --git a/packages/common/package.json b/packages/common/package.json index 89f5ff0698..53226c1444 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -58,11 +58,10 @@ "execa": "^7.0.0", "prettier": "^2.8.4", "prettier-plugin-solidity": "^1.1.2", - "viem": "1.1.7" + "viem": "1.3.0" }, "devDependencies": { "@types/node": "^18.15.11", - "@wagmi/chains": "^0.2.22", "tsup": "^6.7.0", "vitest": "0.31.4" }, diff --git a/packages/common/src/chains/types.ts b/packages/common/src/chains/types.ts index 1a2fc7f9aa..643fb780ba 100644 --- a/packages/common/src/chains/types.ts +++ b/packages/common/src/chains/types.ts @@ -1,4 +1,4 @@ -import type { Chain } from "@wagmi/chains"; +import type { Chain } from "viem/chains"; export type MUDChain = Chain & { modeUrl?: string; diff --git a/packages/dev-tools/package.json b/packages/dev-tools/package.json index 66118d3733..d177b2999c 100644 --- a/packages/dev-tools/package.json +++ b/packages/dev-tools/package.json @@ -28,14 +28,14 @@ "@latticexyz/std-client": "workspace:*", "@latticexyz/utils": "workspace:*", "@latticexyz/world": "workspace:*", - "abitype": "0.8.7", + "abitype": "0.9.3", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.11.0", "rxjs": "7.5.5", "tailwind-merge": "^1.12.0", "use-local-storage-state": "^18.3.2", - "viem": "1.1.7", + "viem": "1.3.0", "zustand": "^4.3.7" }, "devDependencies": { diff --git a/packages/dev-tools/src/actions/getTransaction.ts b/packages/dev-tools/src/actions/getTransaction.ts index 7cd66637c9..78523b4c16 100644 --- a/packages/dev-tools/src/actions/getTransaction.ts +++ b/packages/dev-tools/src/actions/getTransaction.ts @@ -1,4 +1,4 @@ -import { Hex, Transaction, PublicClient, Chain } from "viem"; +import { Hex, Transaction, PublicClient, Chain, Transport } from "viem"; // TODO: something about this fails when doing lots of simultaneous requests for transactions // not sure if its viem or failed RPC requests or what, but the promises get stuck/never resolve @@ -8,7 +8,7 @@ import { Hex, Transaction, PublicClient, Chain } from "viem"; type CacheKey = `${number}:${Hex}`; const cache: Record> = {}; -export const getTransaction = (publicClient: PublicClient & { chain: Chain }, hash: Hex) => { +export const getTransaction = (publicClient: PublicClient, hash: Hex) => { const key: CacheKey = `${publicClient.chain.id}:${hash}`; if (!cache[key]) { cache[key] = publicClient.getTransaction({ hash }); diff --git a/packages/dev-tools/src/actions/getTransactionReceipt.ts b/packages/dev-tools/src/actions/getTransactionReceipt.ts index 98cbb9d1c9..cc8708b6fa 100644 --- a/packages/dev-tools/src/actions/getTransactionReceipt.ts +++ b/packages/dev-tools/src/actions/getTransactionReceipt.ts @@ -5,6 +5,7 @@ import { Chain, TransactionNotFoundError, TransactionReceiptNotFoundError, + Transport, } from "viem"; // TODO: use IndexedDB cache for these? @@ -12,7 +13,7 @@ import { type CacheKey = `${number}:${Hex}`; const cache: Record> = {}; -export const getTransactionReceipt = (publicClient: PublicClient & { chain: Chain }, hash: Hex) => { +export const getTransactionReceipt = (publicClient: PublicClient, hash: Hex) => { const key: CacheKey = `${publicClient.chain.id}:${hash}`; if (!cache[key]) { diff --git a/packages/dev-tools/src/actions/getTransactionResult.ts b/packages/dev-tools/src/actions/getTransactionResult.ts index 5fac1ad255..9c535f074f 100644 --- a/packages/dev-tools/src/actions/getTransactionResult.ts +++ b/packages/dev-tools/src/actions/getTransactionResult.ts @@ -1,4 +1,4 @@ -import { Hex, SimulateContractReturnType, PublicClient, Chain, decodeFunctionData } from "viem"; +import { Hex, SimulateContractReturnType, PublicClient, Chain, decodeFunctionData, Transport } from "viem"; import { getTransaction } from "./getTransaction"; import { getTransactionReceipt } from "./getTransactionReceipt"; import { useStore } from "../useStore"; @@ -11,7 +11,7 @@ import { useStore } from "../useStore"; type CacheKey = `${number}:${Hex}`; const cache: Record> = {}; -export const getTransactionResult = (publicClient: PublicClient & { chain: Chain }, hash: Hex) => { +export const getTransactionResult = (publicClient: PublicClient, hash: Hex) => { const key: CacheKey = `${publicClient.chain.id}:${hash}`; if (!cache[key]) { const { worldAbi } = useStore.getState(); diff --git a/packages/dev-tools/src/useStore.ts b/packages/dev-tools/src/useStore.ts index 6ae5c70784..8c8dcc4349 100644 --- a/packages/dev-tools/src/useStore.ts +++ b/packages/dev-tools/src/useStore.ts @@ -6,7 +6,7 @@ import { cacheStore$, worldAddress$, } from "@latticexyz/network/dev"; -import { PublicClient, WalletClient, Hex, Chain } from "viem"; +import { PublicClient, WalletClient, Hex, Chain, Transport } from "viem"; import { Abi } from "abitype"; import { create } from "zustand"; import { worldAbi$ } from "@latticexyz/std-client/dev"; @@ -20,8 +20,8 @@ export const useStore = create<{ storeEvents: StoreEvent[]; transactions: Hex[]; cacheStore: CacheStore | null; - publicClient: (PublicClient & { chain: Chain }) | null; - walletClient: (WalletClient & { chain: Chain }) | null; + publicClient: PublicClient | null; + walletClient: WalletClient | null; blockNumber: bigint | null; worldAbi: Abi; worldAddress: string | null; diff --git a/packages/network/package.json b/packages/network/package.json index 043bcb8d8e..b818ac40b8 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -43,7 +43,6 @@ "@latticexyz/store": "workspace:*", "@latticexyz/utils": "workspace:*", "@latticexyz/world": "workspace:*", - "@wagmi/chains": "^0.2.22", "async-mutex": "^0.3.2", "debug": "^4.3.4", "ethers": "^5.7.2", @@ -52,7 +51,7 @@ "nice-grpc-web": "^2.0.1", "rxjs": "7.5.5", "threads": "^1.7.0", - "viem": "1.1.7" + "viem": "1.3.0" }, "devDependencies": { "@types/debug": "^4.1.7", diff --git a/packages/network/src/createNetwork.ts b/packages/network/src/createNetwork.ts index aaab07af52..ff959b0382 100644 --- a/packages/network/src/createNetwork.ts +++ b/packages/network/src/createNetwork.ts @@ -9,9 +9,9 @@ import { createBlockNumberStream } from "./createBlockNumberStream"; import { Signer, Wallet } from "ethers"; import { computedToStream } from "@latticexyz/utils"; import { privateKeyToAccount } from "viem/accounts"; -import { Address, fallback, webSocket, http, createPublicClient, createWalletClient } from "viem"; +import { Address, fallback, webSocket, http, createPublicClient, createWalletClient, Chain } from "viem"; import * as mudChains from "@latticexyz/common/chains"; -import * as chains from "@wagmi/chains"; +import * as chains from "viem/chains"; import * as devObservables from "./dev/observables"; export type Network = Awaited>; @@ -73,11 +73,14 @@ export async function createNetwork(initialConfig: NetworkConfig) { // Create viem clients try { - const possibleChains = Object.values({ ...mudChains, ...chains }); + const possibleChains = Object.values({ ...mudChains, ...chains }) as Chain[]; if (config.chainConfig) { possibleChains.unshift(config.chainConfig); } const chain = possibleChains.find((c) => c.id === config.chainId); + if (!chain) { + throw new Error(`No chain found for chain ID ${config.chainId}`); + } const publicClient = createPublicClient({ chain, diff --git a/packages/network/src/dev/observables.ts b/packages/network/src/dev/observables.ts index ba424439a7..716f004c9a 100644 --- a/packages/network/src/dev/observables.ts +++ b/packages/network/src/dev/observables.ts @@ -1,5 +1,5 @@ import { BehaviorSubject, Subject } from "rxjs"; -import type { PublicClient, WalletClient, Chain } from "viem"; +import type { PublicClient, WalletClient, Chain, Transport } from "viem"; import type { CacheStore } from "../workers"; import { TableId } from "@latticexyz/common"; import { StoreEvent, EphemeralEvent } from "../v2/common"; @@ -23,13 +23,15 @@ export const storeEvent$ = new Subject<{ export const transactionHash$ = new Subject(); // require chain for now so we can use it downstream -export const publicClient$: BehaviorSubject<(PublicClient & { chain: Chain }) | null> = new BehaviorSubject< - (PublicClient & { chain: Chain }) | null ->(null); +export const publicClient$: BehaviorSubject | null> = new BehaviorSubject | null>(null); // require chain for now so we can use it downstream -export const walletClient$: BehaviorSubject<(WalletClient & { chain: Chain }) | null> = new BehaviorSubject< - (WalletClient & { chain: Chain }) | null ->(null); +export const walletClient$: BehaviorSubject | null> = new BehaviorSubject | null>(null); export const cacheStore$ = new BehaviorSubject(null); diff --git a/packages/protocol-parser/package.json b/packages/protocol-parser/package.json index 8555bea2f2..5f1a1229e3 100644 --- a/packages/protocol-parser/package.json +++ b/packages/protocol-parser/package.json @@ -25,8 +25,8 @@ "dependencies": { "@latticexyz/common": "workspace:*", "@latticexyz/schema-type": "workspace:*", - "abitype": "0.8.7", - "viem": "1.1.7" + "abitype": "0.9.3", + "viem": "1.3.0" }, "devDependencies": { "tsup": "^6.7.0", diff --git a/packages/schema-type/package.json b/packages/schema-type/package.json index 0c528595ec..01be6964ca 100644 --- a/packages/schema-type/package.json +++ b/packages/schema-type/package.json @@ -33,8 +33,8 @@ "test": "vitest typecheck --run && vitest --run && forge test" }, "dependencies": { - "abitype": "0.8.7", - "viem": "1.1.7" + "abitype": "0.9.3", + "viem": "1.3.0" }, "devDependencies": { "@latticexyz/gas-report": "workspace:*", diff --git a/packages/std-client/package.json b/packages/std-client/package.json index d6fe6450ba..d4a85c4fbb 100644 --- a/packages/std-client/package.json +++ b/packages/std-client/package.json @@ -45,12 +45,12 @@ "@latticexyz/store-cache": "workspace:*", "@latticexyz/utils": "workspace:*", "@latticexyz/world": "workspace:*", - "abitype": "0.8.7", + "abitype": "0.9.3", "ethers": "^5.7.2", "mobx": "^6.7.0", "react": "^18.2.0", "rxjs": "7.5.5", - "viem": "1.1.7" + "viem": "1.3.0" }, "devDependencies": { "@types/jest": "^27.4.1", diff --git a/packages/store-cache/package.json b/packages/store-cache/package.json index e9e5f3c54e..68752227eb 100644 --- a/packages/store-cache/package.json +++ b/packages/store-cache/package.json @@ -26,7 +26,7 @@ "@latticexyz/config": "workspace:*", "@latticexyz/schema-type": "workspace:*", "@latticexyz/store": "workspace:*", - "abitype": "0.8.7", + "abitype": "0.9.3", "tuple-database": "^2.2.0" }, "devDependencies": { diff --git a/packages/store-sync/package.json b/packages/store-sync/package.json index 55bb09e4aa..ae203cb6fe 100644 --- a/packages/store-sync/package.json +++ b/packages/store-sync/package.json @@ -31,7 +31,7 @@ "@latticexyz/store-cache": "workspace:*", "@latticexyz/utils": "workspace:*", "debug": "^4.3.4", - "viem": "1.1.7" + "viem": "1.3.0" }, "devDependencies": { "@types/debug": "^4.1.7", diff --git a/packages/store/package.json b/packages/store/package.json index 4a20cd1f88..02907f88b0 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -57,7 +57,7 @@ "@latticexyz/config": "workspace:*", "@latticexyz/gas-report": "workspace:*", "@latticexyz/schema-type": "workspace:*", - "abitype": "0.8.7", + "abitype": "0.9.3", "ethers": "^5.7.2", "zod": "^3.21.4" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58f4c58ef9..1272e60f39 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,9 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +overrides: + abitype: 0.9.3 + importers: .: @@ -60,8 +63,8 @@ importers: specifier: workspace:* version: link:../schema-type abitype: - specifier: 0.8.7 - version: 0.8.7(typescript@5.1.6)(zod@3.21.4) + specifier: 0.9.3 + version: 0.9.3(typescript@5.1.6)(zod@3.21.4) debug: specifier: ^4.3.4 version: 4.3.4(supports-color@8.1.1) @@ -69,8 +72,8 @@ importers: specifier: 7.5.5 version: 7.5.5 viem: - specifier: 1.1.7 - version: 1.1.7(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) devDependencies: '@types/debug': specifier: ^4.1.7 @@ -233,15 +236,12 @@ importers: specifier: ^1.1.2 version: 1.1.2(prettier@2.8.4) viem: - specifier: 1.1.7 - version: 1.1.7(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) devDependencies: '@types/node': specifier: ^18.15.11 version: 18.15.11 - '@wagmi/chains': - specifier: ^0.2.22 - version: 0.2.23(typescript@5.1.6) tsup: specifier: ^6.7.0 version: 6.7.0(postcss@8.4.23)(typescript@5.1.6) @@ -314,8 +314,8 @@ importers: specifier: workspace:* version: link:../world abitype: - specifier: 0.8.7 - version: 0.8.7(typescript@5.1.6)(zod@3.21.4) + specifier: 0.9.3 + version: 0.9.3(typescript@5.1.6)(zod@3.21.4) react: specifier: ^18.2.0 version: 18.2.0 @@ -335,8 +335,8 @@ importers: specifier: ^18.3.2 version: 18.3.2(react-dom@18.2.0)(react@18.2.0) viem: - specifier: 1.1.7 - version: 1.1.7(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) zustand: specifier: ^4.3.7 version: 4.3.7(react@18.2.0) @@ -481,9 +481,6 @@ importers: '@latticexyz/world': specifier: workspace:* version: link:../world - '@wagmi/chains': - specifier: ^0.2.22 - version: 0.2.23(typescript@5.1.6) async-mutex: specifier: ^0.3.2 version: 0.3.2 @@ -509,8 +506,8 @@ importers: specifier: ^1.7.0 version: 1.7.0 viem: - specifier: 1.1.7 - version: 1.1.7(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) devDependencies: '@types/debug': specifier: ^4.1.7 @@ -617,11 +614,11 @@ importers: specifier: workspace:* version: link:../schema-type abitype: - specifier: 0.8.7 - version: 0.8.7(typescript@5.1.6)(zod@3.21.4) + specifier: 0.9.3 + version: 0.9.3(typescript@5.1.6)(zod@3.21.4) viem: - specifier: 1.1.7 - version: 1.1.7(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) devDependencies: tsup: specifier: ^6.7.0 @@ -719,11 +716,11 @@ importers: packages/schema-type: dependencies: abitype: - specifier: 0.8.7 - version: 0.8.7(typescript@5.1.6)(zod@3.21.4) + specifier: 0.9.3 + version: 0.9.3(typescript@5.1.6)(zod@3.21.4) viem: - specifier: 1.1.7 - version: 1.1.7(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) devDependencies: '@latticexyz/gas-report': specifier: workspace:* @@ -855,8 +852,8 @@ importers: specifier: workspace:* version: link:../world abitype: - specifier: 0.8.7 - version: 0.8.7(typescript@5.1.6)(zod@3.21.4) + specifier: 0.9.3 + version: 0.9.3(typescript@5.1.6)(zod@3.21.4) ethers: specifier: ^5.7.2 version: 5.7.2 @@ -870,8 +867,8 @@ importers: specifier: 7.5.5 version: 7.5.5 viem: - specifier: 1.1.7 - version: 1.1.7(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) devDependencies: '@types/jest': specifier: ^27.4.1 @@ -952,8 +949,8 @@ importers: specifier: workspace:* version: link:../schema-type abitype: - specifier: 0.8.7 - version: 0.8.7(typescript@5.1.6)(zod@3.21.4) + specifier: 0.9.3 + version: 0.9.3(typescript@5.1.6)(zod@3.21.4) ethers: specifier: ^5.7.2 version: 5.7.2 @@ -1019,8 +1016,8 @@ importers: specifier: workspace:* version: link:../store abitype: - specifier: 0.8.7 - version: 0.8.7(typescript@5.1.6)(zod@3.21.4) + specifier: 0.9.3 + version: 0.9.3(typescript@5.1.6)(zod@3.21.4) tuple-database: specifier: ^2.2.0 version: 2.2.0 @@ -1059,8 +1056,8 @@ importers: specifier: ^4.3.4 version: 4.3.4(supports-color@8.1.1) viem: - specifier: 1.1.7 - version: 1.1.7(typescript@5.1.6) + specifier: 1.3.0 + version: 1.3.0(typescript@5.1.6) devDependencies: '@types/debug': specifier: ^4.1.7 @@ -3691,18 +3688,8 @@ packages: pretty-format: 27.5.1 dev: true - /@wagmi/chains@0.2.23(typescript@5.1.6): - resolution: {integrity: sha512-oIc4ZpUL6bH/HdS7ROPWlFnP5U3XBujO/OiX4csRIezyLjMQ9FNXQRZShhi5ddL0Kj1RDbyVLe9K/QotEm1vig==} - peerDependencies: - typescript: '>=4.9.4' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - typescript: 5.1.6 - - /@wagmi/chains@1.2.0(typescript@5.1.6): - resolution: {integrity: sha512-dmDRipsE54JfyudOBkuhEexqQWcrZqxn/qiujG8SBzMh/az/AH5xlJSA+j1CPWTx9+QofSMF3B7A4gb6XRmSaQ==} + /@wagmi/chains@1.6.0(typescript@5.1.6): + resolution: {integrity: sha512-5FRlVxse5P4ZaHG3GTvxwVANSmYJas1eQrTBHhjxVtqXoorm0aLmCHbhmN8Xo1yu09PaWKlleEvfE98yH4AgIw==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -3725,12 +3712,14 @@ packages: engines: {node: '>=6', npm: '>=3'} dev: false - /abitype@0.8.7(typescript@5.1.6)(zod@3.21.4): - resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} + /abitype@0.9.3(typescript@5.1.6)(zod@3.21.4): + resolution: {integrity: sha512-dz4qCQLurx97FQhnb/EIYTk/ldQ+oafEDUqC0VVIeQS1Q48/YWt/9YNfMmp9SLFqN41ktxny3c8aYxHjmFIB/w==} peerDependencies: typescript: '>=5.0.4' zod: ^3 >=3.19.1 peerDependenciesMeta: + typescript: + optional: true zod: optional: true dependencies: @@ -10740,18 +10729,21 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /viem@1.1.7(typescript@5.1.6): - resolution: {integrity: sha512-3lBDRS0ejb4Eo9c/S+RBadwIHNK1RS0ffW7HkSt3pMtzl4nis1aF1tHrU6yqI+yCWqAPl36a48qGD4mEhxPuDw==} + /viem@1.3.0(typescript@5.1.6): + resolution: {integrity: sha512-gCtachbNPG9G9D7UNuiqLaLf8IFV15FypBrSpXEFeeEczXxI+Jgi9FTwDS+NJLreVrjBeZXQVj1ITTqKpItw4w==} peerDependencies: typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true dependencies: '@adraffy/ens-normalize': 1.9.0 '@noble/curves': 1.0.0 '@noble/hashes': 1.3.0 '@scure/bip32': 1.3.0 '@scure/bip39': 1.2.0 - '@wagmi/chains': 1.2.0(typescript@5.1.6) - abitype: 0.8.7(typescript@5.1.6)(zod@3.21.4) + '@wagmi/chains': 1.6.0(typescript@5.1.6) + abitype: 0.9.3(typescript@5.1.6)(zod@3.21.4) isomorphic-ws: 5.0.0(ws@8.12.0) typescript: 5.1.6 ws: 8.12.0 diff --git a/templates/phaser/package.json b/templates/phaser/package.json index 949e1a462f..878fb777e7 100644 --- a/templates/phaser/package.json +++ b/templates/phaser/package.json @@ -23,5 +23,10 @@ "engines": { "node": "18.x", "pnpm": "8.x" + }, + "pnpm": { + "overrides": { + "abitype": "0.9.3" + } } } diff --git a/templates/phaser/packages/client/package.json b/templates/phaser/packages/client/package.json index 5449e3671c..e8cbdbdd76 100644 --- a/templates/phaser/packages/client/package.json +++ b/templates/phaser/packages/client/package.json @@ -22,7 +22,6 @@ "@latticexyz/std-client": "link:../../../../packages/std-client", "@latticexyz/utils": "link:../../../../packages/utils", "@latticexyz/world": "link:../../../../packages/world", - "@wagmi/chains": "^0.2.14", "contracts": "workspace:*", "ethers": "^5.7.2", "lodash": "^4.17.21", @@ -31,6 +30,7 @@ "simplex-noise": "^4.0.1", "styled-components": "^5.3.10", "use-resize-observer": "^9.1.0", + "viem": "1.3.0", "zustand": "^4.3.8" }, "devDependencies": { diff --git a/templates/phaser/packages/client/src/mud/supportedChains.ts b/templates/phaser/packages/client/src/mud/supportedChains.ts index 9a4aabf6c3..5844280c94 100644 --- a/templates/phaser/packages/client/src/mud/supportedChains.ts +++ b/templates/phaser/packages/client/src/mud/supportedChains.ts @@ -1,5 +1,5 @@ import { MUDChain, latticeTestnet } from "@latticexyz/common/chains"; -import { foundry } from "@wagmi/chains"; +import { foundry } from "viem/chains"; // If you are deploying to chains other than anvil or Lattice testnet, add them here export const supportedChains: MUDChain[] = [foundry, latticeTestnet]; diff --git a/templates/react/package.json b/templates/react/package.json index c881d45649..91d6df8485 100644 --- a/templates/react/package.json +++ b/templates/react/package.json @@ -23,5 +23,10 @@ "engines": { "node": "18.x", "pnpm": "8.x" + }, + "pnpm": { + "overrides": { + "abitype": "0.9.3" + } } } diff --git a/templates/react/packages/client/package.json b/templates/react/packages/client/package.json index 80dbfff3e7..7c8cd6d815 100644 --- a/templates/react/packages/client/package.json +++ b/templates/react/packages/client/package.json @@ -21,11 +21,11 @@ "@latticexyz/std-client": "link:../../../../packages/std-client", "@latticexyz/utils": "link:../../../../packages/utils", "@latticexyz/world": "link:../../../../packages/world", - "@wagmi/chains": "^0.2.22", "contracts": "workspace:*", "ethers": "^5.7.2", "react": "^18.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.2.0", + "viem": "1.3.0" }, "devDependencies": { "@types/react": "^18.2.6", diff --git a/templates/react/packages/client/src/mud/supportedChains.ts b/templates/react/packages/client/src/mud/supportedChains.ts index 9a4aabf6c3..5844280c94 100644 --- a/templates/react/packages/client/src/mud/supportedChains.ts +++ b/templates/react/packages/client/src/mud/supportedChains.ts @@ -1,5 +1,5 @@ import { MUDChain, latticeTestnet } from "@latticexyz/common/chains"; -import { foundry } from "@wagmi/chains"; +import { foundry } from "viem/chains"; // If you are deploying to chains other than anvil or Lattice testnet, add them here export const supportedChains: MUDChain[] = [foundry, latticeTestnet]; diff --git a/templates/threejs/package.json b/templates/threejs/package.json index 4468366800..877980e684 100644 --- a/templates/threejs/package.json +++ b/templates/threejs/package.json @@ -23,5 +23,10 @@ "engines": { "node": "18.x", "pnpm": "8.x" + }, + "pnpm": { + "overrides": { + "abitype": "0.9.3" + } } } diff --git a/templates/threejs/packages/client/package.json b/templates/threejs/packages/client/package.json index 3be8975d01..9714f0ee97 100644 --- a/templates/threejs/packages/client/package.json +++ b/templates/threejs/packages/client/package.json @@ -22,11 +22,11 @@ "@latticexyz/utils": "link:../../../../packages/utils", "@latticexyz/world": "link:../../../../packages/world", "@react-three/fiber": "^8.12.0", - "@wagmi/chains": "^0.2.22", "contracts": "workspace:*", "ethers": "^5.7.2", "react": "^18.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.2.0", + "viem": "1.3.0" }, "devDependencies": { "@types/react": "^18.2.6", diff --git a/templates/threejs/packages/client/src/mud/supportedChains.ts b/templates/threejs/packages/client/src/mud/supportedChains.ts index 9a4aabf6c3..5844280c94 100644 --- a/templates/threejs/packages/client/src/mud/supportedChains.ts +++ b/templates/threejs/packages/client/src/mud/supportedChains.ts @@ -1,5 +1,5 @@ import { MUDChain, latticeTestnet } from "@latticexyz/common/chains"; -import { foundry } from "@wagmi/chains"; +import { foundry } from "viem/chains"; // If you are deploying to chains other than anvil or Lattice testnet, add them here export const supportedChains: MUDChain[] = [foundry, latticeTestnet]; diff --git a/templates/vanilla/package.json b/templates/vanilla/package.json index 98760174a6..dbc4a05692 100644 --- a/templates/vanilla/package.json +++ b/templates/vanilla/package.json @@ -23,5 +23,10 @@ "engines": { "node": "18.x", "pnpm": "8.x" + }, + "pnpm": { + "overrides": { + "abitype": "0.9.3" + } } } diff --git a/templates/vanilla/packages/client/package.json b/templates/vanilla/packages/client/package.json index 0c9c9c9f2a..9cc566272f 100644 --- a/templates/vanilla/packages/client/package.json +++ b/templates/vanilla/packages/client/package.json @@ -20,9 +20,9 @@ "@latticexyz/std-client": "link:../../../../packages/std-client", "@latticexyz/utils": "link:../../../../packages/utils", "@latticexyz/world": "link:../../../../packages/world", - "@wagmi/chains": "^0.2.22", "contracts": "workspace:*", - "ethers": "^5.7.2" + "ethers": "^5.7.2", + "viem": "1.3.0" }, "devDependencies": { "vite": "^4.2.1", diff --git a/templates/vanilla/packages/client/src/mud/supportedChains.ts b/templates/vanilla/packages/client/src/mud/supportedChains.ts index 9a4aabf6c3..5844280c94 100644 --- a/templates/vanilla/packages/client/src/mud/supportedChains.ts +++ b/templates/vanilla/packages/client/src/mud/supportedChains.ts @@ -1,5 +1,5 @@ import { MUDChain, latticeTestnet } from "@latticexyz/common/chains"; -import { foundry } from "@wagmi/chains"; +import { foundry } from "viem/chains"; // If you are deploying to chains other than anvil or Lattice testnet, add them here export const supportedChains: MUDChain[] = [foundry, latticeTestnet];