From 8d2cad931ee13eb30c8c5967e5229cc16c46ec85 Mon Sep 17 00:00:00 2001 From: tash-2s <81064017+tash-2s@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:49:32 -0600 Subject: [PATCH 01/11] upgrade viem to latest (v2) --- e2e/packages/client-vanilla/package.json | 2 +- e2e/packages/sync-test/package.json | 2 +- e2e/packages/test-data/package.json | 2 +- examples/minimal/packages/client-phaser/package.json | 2 +- examples/minimal/packages/client-react/package.json | 2 +- examples/minimal/packages/client-vanilla/package.json | 2 +- examples/multiple-accounts/packages/client/package.json | 2 +- packages/block-logs-stream/package.json | 2 +- packages/cli/package.json | 2 +- packages/common/package.json | 2 +- packages/config/package.json | 2 +- packages/dev-tools/package.json | 2 +- packages/faucet/package.json | 2 +- packages/protocol-parser/package.json | 2 +- packages/schema-type/package.json | 2 +- packages/store-indexer/package.json | 2 +- packages/store-sync/package.json | 2 +- packages/store/package.json | 2 +- packages/world/package.json | 2 +- templates/phaser/packages/client/package.json | 2 +- templates/react-ecs/packages/client/package.json | 2 +- templates/react/packages/client/package.json | 2 +- templates/threejs/packages/client/package.json | 2 +- templates/vanilla/packages/client/package.json | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/e2e/packages/client-vanilla/package.json b/e2e/packages/client-vanilla/package.json index 7b36ac61e1..06208f0eac 100644 --- a/e2e/packages/client-vanilla/package.json +++ b/e2e/packages/client-vanilla/package.json @@ -29,7 +29,7 @@ "react": "^18.2.0", "rxjs": "7.5.5", "threads": "^1.7.0", - "viem": "1.14.0" + "viem": "2.7.11" }, "devDependencies": { "rimraf": "^3.0.2", diff --git a/e2e/packages/sync-test/package.json b/e2e/packages/sync-test/package.json index 7b6a0620fc..a4b7289215 100644 --- a/e2e/packages/sync-test/package.json +++ b/e2e/packages/sync-test/package.json @@ -28,7 +28,7 @@ "happy-dom": "^12.10.3", "postgres": "3.3.5", "typescript": "5.1.6", - "viem": "1.14.0", + "viem": "2.7.11", "vite": "^4.2.1", "vitest": "0.34.6", "zod": "^3.22.2" diff --git a/e2e/packages/test-data/package.json b/e2e/packages/test-data/package.json index 793ecafe78..4e80166d0c 100644 --- a/e2e/packages/test-data/package.json +++ b/e2e/packages/test-data/package.json @@ -17,6 +17,6 @@ "execa": "^7.1.1", "tsx": "^3.12.6", "typescript": "5.1.6", - "viem": "1.14.0" + "viem": "2.7.11" } } diff --git a/examples/minimal/packages/client-phaser/package.json b/examples/minimal/packages/client-phaser/package.json index d6835b6535..a6f656b9ea 100644 --- a/examples/minimal/packages/client-phaser/package.json +++ b/examples/minimal/packages/client-phaser/package.json @@ -35,7 +35,7 @@ "styled-components": "^5.3.10", "threads": "^1.7.0", "use-resize-observer": "^9.1.0", - "viem": "1.14.0", + "viem": "2.7.11", "vite": "^4.2.1", "zustand": "^4.3.8" }, diff --git a/examples/minimal/packages/client-react/package.json b/examples/minimal/packages/client-react/package.json index 4a50f1453f..c1185e9e1c 100644 --- a/examples/minimal/packages/client-react/package.json +++ b/examples/minimal/packages/client-react/package.json @@ -32,7 +32,7 @@ "react-dom": "^18.2.0", "rxjs": "7.5.5", "threads": "^1.7.0", - "viem": "1.14.0" + "viem": "2.7.11" }, "devDependencies": { "@types/react": "18.2.22", diff --git a/examples/minimal/packages/client-vanilla/package.json b/examples/minimal/packages/client-vanilla/package.json index 33c15e3e32..c7646b2af2 100644 --- a/examples/minimal/packages/client-vanilla/package.json +++ b/examples/minimal/packages/client-vanilla/package.json @@ -29,7 +29,7 @@ "react": "^18.2.0", "rxjs": "7.5.5", "threads": "^1.7.0", - "viem": "1.14.0" + "viem": "2.7.11" }, "devDependencies": { "vite": "^4.2.1", diff --git a/examples/multiple-accounts/packages/client/package.json b/examples/multiple-accounts/packages/client/package.json index 54e18b5348..066c4b3b10 100644 --- a/examples/multiple-accounts/packages/client/package.json +++ b/examples/multiple-accounts/packages/client/package.json @@ -23,7 +23,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "rxjs": "7.5.5", - "viem": "1.14.0" + "viem": "2.7.11" }, "devDependencies": { "@types/react": "18.2.22", diff --git a/packages/block-logs-stream/package.json b/packages/block-logs-stream/package.json index 578f9a2c7e..9613c0828b 100644 --- a/packages/block-logs-stream/package.json +++ b/packages/block-logs-stream/package.json @@ -28,7 +28,7 @@ "abitype": "0.9.8", "debug": "^4.3.4", "rxjs": "7.5.5", - "viem": "1.14.0" + "viem": "2.7.11" }, "devDependencies": { "@types/debug": "^4.1.7", diff --git a/packages/cli/package.json b/packages/cli/package.json index ccd00d61ae..96eb3cd295 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -60,7 +60,7 @@ "rxjs": "7.5.5", "throttle-debounce": "^5.0.0", "typescript": "5.1.6", - "viem": "1.14.0", + "viem": "2.7.11", "yargs": "^17.7.1", "zod": "^3.21.4", "zod-validation-error": "^1.3.0" diff --git a/packages/common/package.json b/packages/common/package.json index e59867e710..776ce116a6 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -61,7 +61,7 @@ "p-retry": "^5.1.2", "prettier": "^2.8.4", "prettier-plugin-solidity": "1.1.3", - "viem": "1.14.0" + "viem": "2.7.11" }, "devDependencies": { "@types/debug": "^4.1.7", diff --git a/packages/config/package.json b/packages/config/package.json index db81380a7a..05afc80c66 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -41,7 +41,7 @@ "@latticexyz/schema-type": "workspace:*", "esbuild": "^0.17.15", "find-up": "^6.3.0", - "viem": "1.14.0", + "viem": "2.7.11", "zod": "^3.21.4", "zod-validation-error": "^1.3.0" }, diff --git a/packages/dev-tools/package.json b/packages/dev-tools/package.json index 52ca25b39e..87121ee4cc 100644 --- a/packages/dev-tools/package.json +++ b/packages/dev-tools/package.json @@ -37,7 +37,7 @@ "rxjs": "7.5.5", "tailwind-merge": "^1.12.0", "use-local-storage-state": "^18.3.2", - "viem": "1.14.0", + "viem": "2.7.11", "zustand": "^4.3.7" }, "devDependencies": { diff --git a/packages/faucet/package.json b/packages/faucet/package.json index beb31c37a2..dc9718eb1e 100644 --- a/packages/faucet/package.json +++ b/packages/faucet/package.json @@ -36,7 +36,7 @@ "debug": "^4.3.4", "dotenv": "^16.0.3", "fastify": "^4.21.0", - "viem": "1.14.0", + "viem": "2.7.11", "zod": "^3.21.4" }, "devDependencies": { diff --git a/packages/protocol-parser/package.json b/packages/protocol-parser/package.json index 274a677926..cb959d924d 100644 --- a/packages/protocol-parser/package.json +++ b/packages/protocol-parser/package.json @@ -27,7 +27,7 @@ "@latticexyz/common": "workspace:*", "@latticexyz/schema-type": "workspace:*", "abitype": "0.9.8", - "viem": "1.14.0" + "viem": "2.7.11" }, "devDependencies": { "tsup": "^6.7.0", diff --git a/packages/schema-type/package.json b/packages/schema-type/package.json index dc4d877804..325f829304 100644 --- a/packages/schema-type/package.json +++ b/packages/schema-type/package.json @@ -35,7 +35,7 @@ }, "dependencies": { "abitype": "0.9.8", - "viem": "1.14.0" + "viem": "2.7.11" }, "devDependencies": { "@latticexyz/gas-report": "workspace:*", diff --git a/packages/store-indexer/package.json b/packages/store-indexer/package.json index 8ec5d4e2c3..45e247df00 100644 --- a/packages/store-indexer/package.json +++ b/packages/store-indexer/package.json @@ -62,7 +62,7 @@ "rxjs": "7.5.5", "superjson": "^1.12.4", "trpc-koa-adapter": "^1.1.3", - "viem": "1.14.0", + "viem": "2.7.11", "zod": "^3.21.4" }, "devDependencies": { diff --git a/packages/store-sync/package.json b/packages/store-sync/package.json index 5162e29f9c..daa4e7ec06 100644 --- a/packages/store-sync/package.json +++ b/packages/store-sync/package.json @@ -76,7 +76,7 @@ "rxjs": "7.5.5", "sql.js": "^1.8.0", "superjson": "^1.12.4", - "viem": "1.14.0", + "viem": "2.7.11", "zod": "^3.21.4", "zustand": "^4.3.7" }, diff --git a/packages/store/package.json b/packages/store/package.json index 86aa4b9471..98afdcc910 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -55,7 +55,7 @@ "@latticexyz/config": "workspace:*", "@latticexyz/schema-type": "workspace:*", "abitype": "0.9.8", - "viem": "1.14.0", + "viem": "2.7.11", "zod": "^3.21.4" }, "devDependencies": { diff --git a/packages/world/package.json b/packages/world/package.json index 5d2424c0af..4bd51bd335 100644 --- a/packages/world/package.json +++ b/packages/world/package.json @@ -51,7 +51,7 @@ "@latticexyz/schema-type": "workspace:*", "@latticexyz/store": "workspace:*", "abitype": "0.9.8", - "viem": "1.14.0", + "viem": "2.7.11", "zod": "^3.21.4" }, "devDependencies": { diff --git a/templates/phaser/packages/client/package.json b/templates/phaser/packages/client/package.json index 31b7f3b1ea..a63e70fe23 100644 --- a/templates/phaser/packages/client/package.json +++ b/templates/phaser/packages/client/package.json @@ -29,7 +29,7 @@ "simplex-noise": "^4.0.1", "styled-components": "^5.3.10", "use-resize-observer": "^9.1.0", - "viem": "1.14.0", + "viem": "2.7.11", "zustand": "^4.3.8" }, "devDependencies": { diff --git a/templates/react-ecs/packages/client/package.json b/templates/react-ecs/packages/client/package.json index 952996ffa1..71ca104508 100644 --- a/templates/react-ecs/packages/client/package.json +++ b/templates/react-ecs/packages/client/package.json @@ -24,7 +24,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "rxjs": "7.5.5", - "viem": "1.14.0" + "viem": "2.7.11" }, "devDependencies": { "@types/react": "18.2.22", diff --git a/templates/react/packages/client/package.json b/templates/react/packages/client/package.json index 54e18b5348..066c4b3b10 100644 --- a/templates/react/packages/client/package.json +++ b/templates/react/packages/client/package.json @@ -23,7 +23,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "rxjs": "7.5.5", - "viem": "1.14.0" + "viem": "2.7.11" }, "devDependencies": { "@types/react": "18.2.22", diff --git a/templates/threejs/packages/client/package.json b/templates/threejs/packages/client/package.json index f1cae3e0de..a1c14c57d7 100644 --- a/templates/threejs/packages/client/package.json +++ b/templates/threejs/packages/client/package.json @@ -25,7 +25,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "rxjs": "7.5.5", - "viem": "1.14.0" + "viem": "2.7.11" }, "devDependencies": { "@types/react": "18.2.22", diff --git a/templates/vanilla/packages/client/package.json b/templates/vanilla/packages/client/package.json index 289fb9f1da..e6869817b9 100644 --- a/templates/vanilla/packages/client/package.json +++ b/templates/vanilla/packages/client/package.json @@ -21,7 +21,7 @@ "@latticexyz/world": "link:../../../../packages/world", "contracts": "workspace:*", "rxjs": "7.5.5", - "viem": "1.14.0" + "viem": "2.7.11" }, "devDependencies": { "@types/react-dom": "18.2.7", From 1cc4f8d9837418921680d084e63a49acd85c269a Mon Sep 17 00:00:00 2001 From: tash-2s <81064017+tash-2s@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:52:07 -0600 Subject: [PATCH 02/11] pnpm install --- e2e/pnpm-lock.yaml | 56 ++++++++------- examples/minimal/pnpm-lock.yaml | 49 +++++-------- examples/multiple-accounts/pnpm-lock.yaml | 37 +++++----- pnpm-lock.yaml | 88 ++++++++++++----------- 4 files changed, 114 insertions(+), 116 deletions(-) diff --git a/e2e/pnpm-lock.yaml b/e2e/pnpm-lock.yaml index 343f8419b6..bea8ee92ce 100644 --- a/e2e/pnpm-lock.yaml +++ b/e2e/pnpm-lock.yaml @@ -72,8 +72,8 @@ importers: specifier: ^1.7.0 version: 1.7.0 viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.22.2) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.22.2) devDependencies: rimraf: specifier: ^3.0.2 @@ -181,8 +181,8 @@ importers: specifier: 5.1.6 version: 5.1.6 viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.22.2) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.22.2) vite: specifier: ^4.2.1 version: 4.3.5(@types/node@20.1.3) @@ -220,13 +220,13 @@ importers: specifier: 5.1.6 version: 5.1.6 viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.22.2) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.22.2) packages: - /@adraffy/ens-normalize@1.9.4: - resolution: {integrity: sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw==} + /@adraffy/ens-normalize@1.10.0: + resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} /@esbuild-kit/cjs-loader@2.4.2: resolution: {integrity: sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg==} @@ -748,9 +748,6 @@ packages: resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} dev: false - /@scure/base@1.1.1: - resolution: {integrity: sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==} - /@scure/base@1.1.3: resolution: {integrity: sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==} @@ -765,7 +762,7 @@ packages: resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} dependencies: '@noble/hashes': 1.3.2 - '@scure/base': 1.1.1 + '@scure/base': 1.1.3 /@sinclair/typebox@0.27.8: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} @@ -788,11 +785,6 @@ packages: /@types/node@20.1.3: resolution: {integrity: sha512-NP2yfZpgmf2eDRPmgGq+fjGjSwFgYbihA8/gK+ey23qT9RkxsgNTZvGOEpXgzIGqesTYkElELLgtKoMQTys5vA==} - /@types/ws@8.5.5: - resolution: {integrity: sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==} - dependencies: - '@types/node': 20.1.3 - /@viem/anvil@0.0.6: resolution: {integrity: sha512-OjKR/+FVwzuygXYFqP8MBal1SXG8bT2gbZwqqB0XuLw81LNBBvmE/Repm6+5kkBh4IUj0PhYdrqOsnayS14Gtg==} dependencies: @@ -857,6 +849,21 @@ packages: dependencies: typescript: 5.1.6 zod: 3.22.2 + dev: true + + /abitype@1.0.0(typescript@5.1.6)(zod@3.22.2): + resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.22.0 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + dependencies: + typescript: 5.1.6 + zod: 3.22.2 /abort-controller-x@0.4.1: resolution: {integrity: sha512-lJ2ssrl3FoTK3cX/g15lRCkXFWKiwRTRtBjfwounO2EM/Q65rI/MEZsfsch1juWU2pH2aLSaq0HGowlDP/imrw==} @@ -1319,8 +1326,8 @@ packages: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true - /isomorphic-ws@5.0.0(ws@8.13.0): - resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} + /isows@1.0.3(ws@8.13.0): + resolution: {integrity: sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==} peerDependencies: ws: '*' dependencies: @@ -1770,22 +1777,21 @@ packages: resolution: {integrity: sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==} dev: true - /viem@1.14.0(typescript@5.1.6)(zod@3.22.2): - resolution: {integrity: sha512-4d+4/H3lnbkSAbrpQ15i1nBA7hne06joLFy3L3m0ZpMc+g+Zr3D4nuSTyeiqbHAYs9m2P9Kjap0HlyGkehasgg==} + /viem@2.7.11(typescript@5.1.6)(zod@3.22.2): + resolution: {integrity: sha512-qlEPF9YOgPVqjTyom73TVAekAYrIe68megO07u55p7pKWgLt0i9KD6Mrmiw7pd7oHh86vIppcygwQMDNGX1YAw==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: typescript: optional: true dependencies: - '@adraffy/ens-normalize': 1.9.4 + '@adraffy/ens-normalize': 1.10.0 '@noble/curves': 1.2.0 '@noble/hashes': 1.3.2 '@scure/bip32': 1.3.2 '@scure/bip39': 1.2.1 - '@types/ws': 8.5.5 - abitype: 0.9.8(typescript@5.1.6)(zod@3.22.2) - isomorphic-ws: 5.0.0(ws@8.13.0) + abitype: 1.0.0(typescript@5.1.6)(zod@3.22.2) + isows: 1.0.3(ws@8.13.0) typescript: 5.1.6 ws: 8.13.0 transitivePeerDependencies: diff --git a/examples/minimal/pnpm-lock.yaml b/examples/minimal/pnpm-lock.yaml index d05669c462..d3cad80e81 100644 --- a/examples/minimal/pnpm-lock.yaml +++ b/examples/minimal/pnpm-lock.yaml @@ -105,8 +105,8 @@ importers: specifier: ^9.1.0 version: 9.1.0(react-dom@18.2.0)(react@18.2.0) viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6) vite: specifier: ^4.2.1 version: 4.2.1 @@ -208,8 +208,8 @@ importers: specifier: ^1.7.0 version: 1.7.0 viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6) devDependencies: '@types/react': specifier: 18.2.22 @@ -293,8 +293,8 @@ importers: specifier: ^1.7.0 version: 1.7.0 viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6) devDependencies: vite: specifier: ^4.2.1 @@ -396,8 +396,8 @@ importers: packages: - /@adraffy/ens-normalize@1.9.4: - resolution: {integrity: sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw==} + /@adraffy/ens-normalize@1.10.0: + resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} dev: false /@ampproject/remapping@2.2.1: @@ -1007,10 +1007,6 @@ packages: resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} dev: false - /@scure/base@1.1.1: - resolution: {integrity: sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==} - dev: false - /@scure/base@1.1.3: resolution: {integrity: sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==} dev: false @@ -1027,7 +1023,7 @@ packages: resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} dependencies: '@noble/hashes': 1.3.2 - '@scure/base': 1.1.1 + '@scure/base': 1.1.3 dev: false /@solidity-parser/parser@0.16.0: @@ -1108,12 +1104,6 @@ packages: csstype: 3.1.2 dev: true - /@types/ws@8.5.5: - resolution: {integrity: sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==} - dependencies: - '@types/node': 18.15.11 - dev: false - /@typescript-eslint/eslint-plugin@5.46.1(@typescript-eslint/parser@5.46.1)(eslint@8.29.0)(typescript@5.1.6): resolution: {integrity: sha512-YpzNv3aayRBwjs4J3oz65eVLXc9xx0PDbIRisHj+dYhvBn02MjYOD96P8YGiWEIFBrojaUjxvkaUpakD82phsA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1259,11 +1249,11 @@ packages: - supports-color dev: true - /abitype@0.9.8(typescript@5.1.6): - resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} + /abitype@1.0.0(typescript@5.1.6): + resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} peerDependencies: typescript: '>=5.0.4' - zod: ^3 >=3.19.1 + zod: ^3 >=3.22.0 peerDependenciesMeta: typescript: optional: true @@ -2442,8 +2432,8 @@ packages: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true - /isomorphic-ws@5.0.0(ws@8.13.0): - resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} + /isows@1.0.3(ws@8.13.0): + resolution: {integrity: sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==} peerDependencies: ws: '*' dependencies: @@ -3546,22 +3536,21 @@ packages: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true - /viem@1.14.0(typescript@5.1.6): - resolution: {integrity: sha512-4d+4/H3lnbkSAbrpQ15i1nBA7hne06joLFy3L3m0ZpMc+g+Zr3D4nuSTyeiqbHAYs9m2P9Kjap0HlyGkehasgg==} + /viem@2.7.11(typescript@5.1.6): + resolution: {integrity: sha512-qlEPF9YOgPVqjTyom73TVAekAYrIe68megO07u55p7pKWgLt0i9KD6Mrmiw7pd7oHh86vIppcygwQMDNGX1YAw==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: typescript: optional: true dependencies: - '@adraffy/ens-normalize': 1.9.4 + '@adraffy/ens-normalize': 1.10.0 '@noble/curves': 1.2.0 '@noble/hashes': 1.3.2 '@scure/bip32': 1.3.2 '@scure/bip39': 1.2.1 - '@types/ws': 8.5.5 - abitype: 0.9.8(typescript@5.1.6) - isomorphic-ws: 5.0.0(ws@8.13.0) + abitype: 1.0.0(typescript@5.1.6) + isows: 1.0.3(ws@8.13.0) typescript: 5.1.6 ws: 8.13.0 transitivePeerDependencies: diff --git a/examples/multiple-accounts/pnpm-lock.yaml b/examples/multiple-accounts/pnpm-lock.yaml index 929ab649e5..5a0d2cb970 100644 --- a/examples/multiple-accounts/pnpm-lock.yaml +++ b/examples/multiple-accounts/pnpm-lock.yaml @@ -75,8 +75,8 @@ importers: specifier: 7.5.5 version: 7.5.5 viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6) devDependencies: '@types/react': specifier: 18.2.22 @@ -150,8 +150,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /@adraffy/ens-normalize@1.9.4: - resolution: {integrity: sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw==} + /@adraffy/ens-normalize@1.10.0: + resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} dev: false /@ampproject/remapping@2.2.1: @@ -718,6 +718,7 @@ packages: resolution: {integrity: sha512-X36s5CXMrrJOs2lQCdDF68apW4Rfx9ixYMawlepwmE4Anezv/AV2LSpKD1Ub8DAc+urp5bk0BGZ6NtmBitfnsg==} dependencies: undici-types: 5.26.5 + dev: true /@types/prettier@2.7.2: resolution: {integrity: sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==} @@ -749,12 +750,6 @@ packages: resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} dev: true - /@types/ws@8.5.10: - resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} - dependencies: - '@types/node': 18.19.6 - dev: false - /@typescript-eslint/eslint-plugin@5.46.1(@typescript-eslint/parser@5.46.1)(eslint@8.29.0)(typescript@5.1.6): resolution: {integrity: sha512-YpzNv3aayRBwjs4J3oz65eVLXc9xx0PDbIRisHj+dYhvBn02MjYOD96P8YGiWEIFBrojaUjxvkaUpakD82phsA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -900,11 +895,11 @@ packages: - supports-color dev: true - /abitype@0.9.8(typescript@5.1.6): - resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} + /abitype@1.0.0(typescript@5.1.6): + resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} peerDependencies: typescript: '>=5.0.4' - zod: ^3 >=3.19.1 + zod: ^3 >=3.22.0 peerDependenciesMeta: typescript: optional: true @@ -1950,8 +1945,8 @@ packages: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true - /isomorphic-ws@5.0.0(ws@8.13.0): - resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} + /isows@1.0.3(ws@8.13.0): + resolution: {integrity: sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==} peerDependencies: ws: '*' dependencies: @@ -2743,6 +2738,7 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true /update-browserslist-db@1.0.13(browserslist@4.22.2): resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} @@ -2761,22 +2757,21 @@ packages: punycode: 2.3.1 dev: true - /viem@1.14.0(typescript@5.1.6): - resolution: {integrity: sha512-4d+4/H3lnbkSAbrpQ15i1nBA7hne06joLFy3L3m0ZpMc+g+Zr3D4nuSTyeiqbHAYs9m2P9Kjap0HlyGkehasgg==} + /viem@2.7.11(typescript@5.1.6): + resolution: {integrity: sha512-qlEPF9YOgPVqjTyom73TVAekAYrIe68megO07u55p7pKWgLt0i9KD6Mrmiw7pd7oHh86vIppcygwQMDNGX1YAw==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: typescript: optional: true dependencies: - '@adraffy/ens-normalize': 1.9.4 + '@adraffy/ens-normalize': 1.10.0 '@noble/curves': 1.2.0 '@noble/hashes': 1.3.2 '@scure/bip32': 1.3.2 '@scure/bip39': 1.2.1 - '@types/ws': 8.5.10 - abitype: 0.9.8(typescript@5.1.6) - isomorphic-ws: 5.0.0(ws@8.13.0) + abitype: 1.0.0(typescript@5.1.6) + isows: 1.0.3(ws@8.13.0) typescript: 5.1.6 ws: 8.13.0 transitivePeerDependencies: diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 629d967201..3cd29722cf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -106,8 +106,8 @@ importers: specifier: 7.5.5 version: 7.5.5 viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.21.4) devDependencies: '@types/debug': specifier: ^4.1.7 @@ -212,8 +212,8 @@ importers: specifier: 5.1.6 version: 5.1.6 viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.21.4) yargs: specifier: ^17.7.1 version: 17.7.1 @@ -288,8 +288,8 @@ importers: specifier: 1.1.3 version: 1.1.3(prettier@2.8.4) viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.21.4) devDependencies: '@types/debug': specifier: ^4.1.7 @@ -319,8 +319,8 @@ importers: specifier: ^6.3.0 version: 6.3.0 viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.21.4) zod: specifier: ^3.21.4 version: 3.21.4 @@ -390,8 +390,8 @@ importers: specifier: ^18.3.2 version: 18.3.2(react-dom@18.2.0)(react@18.2.0) viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.21.4) zustand: specifier: ^4.3.7 version: 4.3.7(react@18.2.0) @@ -450,8 +450,8 @@ importers: specifier: ^4.21.0 version: 4.21.0 viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.21.4) zod: specifier: ^3.21.4 version: 3.21.4 @@ -597,8 +597,8 @@ importers: specifier: 0.9.8 version: 0.9.8(typescript@5.1.6)(zod@3.21.4) viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.21.4) devDependencies: tsup: specifier: ^6.7.0 @@ -699,8 +699,8 @@ importers: specifier: 0.9.8 version: 0.9.8(typescript@5.1.6)(zod@3.21.4) viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.21.4) devDependencies: '@latticexyz/gas-report': specifier: workspace:* @@ -780,8 +780,8 @@ importers: specifier: 0.9.8 version: 0.9.8(typescript@5.1.6)(zod@3.21.4) viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.21.4) zod: specifier: ^3.21.4 version: 3.21.4 @@ -897,8 +897,8 @@ importers: specifier: ^1.1.3 version: 1.1.3(@trpc/server@10.34.0)(koa@2.14.2) viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.21.4) zod: specifier: ^3.21.4 version: 3.21.4 @@ -991,8 +991,8 @@ importers: specifier: ^1.12.4 version: 1.12.4 viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.21.4) zod: specifier: ^3.21.4 version: 3.21.4 @@ -1056,8 +1056,8 @@ importers: specifier: 0.9.8 version: 0.9.8(typescript@5.1.6)(zod@3.21.4) viem: - specifier: 1.14.0 - version: 1.14.0(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.11 + version: 2.7.11(typescript@5.1.6)(zod@3.21.4) zod: specifier: ^3.21.4 version: 3.21.4 @@ -1171,8 +1171,8 @@ importers: packages: - /@adraffy/ens-normalize@1.9.4: - resolution: {integrity: sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw==} + /@adraffy/ens-normalize@1.10.0: + resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} dev: false /@alloc/quick-lru@5.2.0: @@ -3743,12 +3743,6 @@ packages: '@types/node': 18.15.11 dev: true - /@types/ws@8.5.6: - resolution: {integrity: sha512-8B5EO9jLVCy+B58PLHvLDuOD8DRVMgQzq8d55SjLCOn9kqGyqOvy27exVaTio1q1nX5zLu8/6N0n2ThSxOM6tg==} - dependencies: - '@types/node': 18.15.11 - dev: false - /@types/yargs-interactive@2.1.3: resolution: {integrity: sha512-bYB8ah0JPR6/lpHlxUzeHsrb3RK5OW7N8Hnth2nefnr6zQ5KFoDQ6wM5x58dTLEDYrwikFy3EPTf/O0HKLNaIg==} dependencies: @@ -3997,6 +3991,21 @@ packages: zod: 3.21.4 dev: false + /abitype@1.0.0(typescript@5.1.6)(zod@3.21.4): + resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.22.0 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + dependencies: + typescript: 5.1.6 + zod: 3.21.4 + dev: false + /abort-controller-x@0.4.1: resolution: {integrity: sha512-lJ2ssrl3FoTK3cX/g15lRCkXFWKiwRTRtBjfwounO2EM/Q65rI/MEZsfsch1juWU2pH2aLSaq0HGowlDP/imrw==} dev: false @@ -7675,8 +7684,8 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - /isomorphic-ws@5.0.0(ws@8.13.0): - resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} + /isows@1.0.3(ws@8.13.0): + resolution: {integrity: sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==} peerDependencies: ws: '*' dependencies: @@ -11907,22 +11916,21 @@ packages: engines: {node: '>= 0.8'} dev: false - /viem@1.14.0(typescript@5.1.6)(zod@3.21.4): - resolution: {integrity: sha512-4d+4/H3lnbkSAbrpQ15i1nBA7hne06joLFy3L3m0ZpMc+g+Zr3D4nuSTyeiqbHAYs9m2P9Kjap0HlyGkehasgg==} + /viem@2.7.11(typescript@5.1.6)(zod@3.21.4): + resolution: {integrity: sha512-qlEPF9YOgPVqjTyom73TVAekAYrIe68megO07u55p7pKWgLt0i9KD6Mrmiw7pd7oHh86vIppcygwQMDNGX1YAw==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: typescript: optional: true dependencies: - '@adraffy/ens-normalize': 1.9.4 + '@adraffy/ens-normalize': 1.10.0 '@noble/curves': 1.2.0 '@noble/hashes': 1.3.2 '@scure/bip32': 1.3.2 '@scure/bip39': 1.2.1 - '@types/ws': 8.5.6 - abitype: 0.9.8(typescript@5.1.6)(zod@3.21.4) - isomorphic-ws: 5.0.0(ws@8.13.0) + abitype: 1.0.0(typescript@5.1.6)(zod@3.21.4) + isows: 1.0.3(ws@8.13.0) typescript: 5.1.6 ws: 8.13.0 transitivePeerDependencies: From 106fa225d362972e1d1b858d687038e0b52737f6 Mon Sep 17 00:00:00 2001 From: tash-2s <81064017+tash-2s@users.noreply.github.com> Date: Tue, 20 Feb 2024 17:01:38 -0600 Subject: [PATCH 03/11] upgrade abitype --- e2e/packages/sync-test/package.json | 2 +- e2e/pnpm-lock.yaml | 19 ++------------ packages/block-logs-stream/package.json | 2 +- packages/protocol-parser/package.json | 2 +- packages/schema-type/package.json | 2 +- packages/store/package.json | 2 +- packages/world/package.json | 2 +- pnpm-lock.yaml | 35 +++++++------------------ 8 files changed, 18 insertions(+), 48 deletions(-) diff --git a/e2e/packages/sync-test/package.json b/e2e/packages/sync-test/package.json index a4b7289215..a6eed38e98 100644 --- a/e2e/packages/sync-test/package.json +++ b/e2e/packages/sync-test/package.json @@ -20,7 +20,7 @@ "@latticexyz/store-sync": "link:../../../packages/store-sync", "@latticexyz/utils": "link:../../../packages/utils", "@viem/anvil": "^0.0.6", - "abitype": "0.9.8", + "abitype": "1.0.0", "chalk": "^5.2.0", "dotenv": "^16.0.3", "drizzle-orm": "^0.28.5", diff --git a/e2e/pnpm-lock.yaml b/e2e/pnpm-lock.yaml index bea8ee92ce..bbc8cdfa0f 100644 --- a/e2e/pnpm-lock.yaml +++ b/e2e/pnpm-lock.yaml @@ -157,8 +157,8 @@ importers: specifier: ^0.0.6 version: 0.0.6 abitype: - specifier: 0.9.8 - version: 0.9.8(typescript@5.1.6)(zod@3.22.2) + specifier: 1.0.0 + version: 1.0.0(typescript@5.1.6)(zod@3.22.2) chalk: specifier: ^5.2.0 version: 5.2.0 @@ -836,21 +836,6 @@ packages: pretty-format: 29.7.0 dev: true - /abitype@0.9.8(typescript@5.1.6)(zod@3.22.2): - resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} - peerDependencies: - typescript: '>=5.0.4' - zod: ^3 >=3.19.1 - peerDependenciesMeta: - typescript: - optional: true - zod: - optional: true - dependencies: - typescript: 5.1.6 - zod: 3.22.2 - dev: true - /abitype@1.0.0(typescript@5.1.6)(zod@3.22.2): resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} peerDependencies: diff --git a/packages/block-logs-stream/package.json b/packages/block-logs-stream/package.json index 9613c0828b..7f4a7f4824 100644 --- a/packages/block-logs-stream/package.json +++ b/packages/block-logs-stream/package.json @@ -25,7 +25,7 @@ }, "dependencies": { "@latticexyz/common": "workspace:*", - "abitype": "0.9.8", + "abitype": "1.0.0", "debug": "^4.3.4", "rxjs": "7.5.5", "viem": "2.7.11" diff --git a/packages/protocol-parser/package.json b/packages/protocol-parser/package.json index cb959d924d..8ba09ff3e5 100644 --- a/packages/protocol-parser/package.json +++ b/packages/protocol-parser/package.json @@ -26,7 +26,7 @@ "dependencies": { "@latticexyz/common": "workspace:*", "@latticexyz/schema-type": "workspace:*", - "abitype": "0.9.8", + "abitype": "1.0.0", "viem": "2.7.11" }, "devDependencies": { diff --git a/packages/schema-type/package.json b/packages/schema-type/package.json index 325f829304..f72e3e776a 100644 --- a/packages/schema-type/package.json +++ b/packages/schema-type/package.json @@ -34,7 +34,7 @@ "test:ci": "pnpm run test" }, "dependencies": { - "abitype": "0.9.8", + "abitype": "1.0.0", "viem": "2.7.11" }, "devDependencies": { diff --git a/packages/store/package.json b/packages/store/package.json index 98afdcc910..48303ad14e 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -54,7 +54,7 @@ "@latticexyz/common": "workspace:*", "@latticexyz/config": "workspace:*", "@latticexyz/schema-type": "workspace:*", - "abitype": "0.9.8", + "abitype": "1.0.0", "viem": "2.7.11", "zod": "^3.21.4" }, diff --git a/packages/world/package.json b/packages/world/package.json index 4bd51bd335..c8eabb3467 100644 --- a/packages/world/package.json +++ b/packages/world/package.json @@ -50,7 +50,7 @@ "@latticexyz/config": "workspace:*", "@latticexyz/schema-type": "workspace:*", "@latticexyz/store": "workspace:*", - "abitype": "0.9.8", + "abitype": "1.0.0", "viem": "2.7.11", "zod": "^3.21.4" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3cd29722cf..b12eeeb58b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -97,8 +97,8 @@ importers: specifier: workspace:* version: link:../common abitype: - specifier: 0.9.8 - version: 0.9.8(typescript@5.1.6)(zod@3.21.4) + specifier: 1.0.0 + version: 1.0.0(typescript@5.1.6)(zod@3.21.4) debug: specifier: ^4.3.4 version: 4.3.4(supports-color@8.1.1) @@ -594,8 +594,8 @@ importers: specifier: workspace:* version: link:../schema-type abitype: - specifier: 0.9.8 - version: 0.9.8(typescript@5.1.6)(zod@3.21.4) + specifier: 1.0.0 + version: 1.0.0(typescript@5.1.6)(zod@3.21.4) viem: specifier: 2.7.11 version: 2.7.11(typescript@5.1.6)(zod@3.21.4) @@ -696,8 +696,8 @@ importers: packages/schema-type: dependencies: abitype: - specifier: 0.9.8 - version: 0.9.8(typescript@5.1.6)(zod@3.21.4) + specifier: 1.0.0 + version: 1.0.0(typescript@5.1.6)(zod@3.21.4) viem: specifier: 2.7.11 version: 2.7.11(typescript@5.1.6)(zod@3.21.4) @@ -777,8 +777,8 @@ importers: specifier: workspace:* version: link:../schema-type abitype: - specifier: 0.9.8 - version: 0.9.8(typescript@5.1.6)(zod@3.21.4) + specifier: 1.0.0 + version: 1.0.0(typescript@5.1.6)(zod@3.21.4) viem: specifier: 2.7.11 version: 2.7.11(typescript@5.1.6)(zod@3.21.4) @@ -1053,8 +1053,8 @@ importers: specifier: workspace:* version: link:../store abitype: - specifier: 0.9.8 - version: 0.9.8(typescript@5.1.6)(zod@3.21.4) + specifier: 1.0.0 + version: 1.0.0(typescript@5.1.6)(zod@3.21.4) viem: specifier: 2.7.11 version: 2.7.11(typescript@5.1.6)(zod@3.21.4) @@ -3976,21 +3976,6 @@ packages: engines: {node: '>=6', npm: '>=3'} dev: false - /abitype@0.9.8(typescript@5.1.6)(zod@3.21.4): - resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} - peerDependencies: - typescript: '>=5.0.4' - zod: ^3 >=3.19.1 - peerDependenciesMeta: - typescript: - optional: true - zod: - optional: true - dependencies: - typescript: 5.1.6 - zod: 3.21.4 - dev: false - /abitype@1.0.0(typescript@5.1.6)(zod@3.21.4): resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} peerDependencies: From ec2ee1067e773fd431c22d5bfd2e4bdfed36e4b2 Mon Sep 17 00:00:00 2001 From: tash-2s <81064017+tash-2s@users.noreply.github.com> Date: Tue, 20 Feb 2024 14:20:41 -0600 Subject: [PATCH 04/11] wip: test passes but should be wrong --- packages/block-logs-stream/tsconfig.json | 1 + packages/cli/src/deploy/ensureWorldFactory.ts | 10 ++-- packages/common/src/chains/latticeTestnet.ts | 1 - packages/common/src/getContract.ts | 51 +++++++++++++++---- packages/common/src/sendTransaction.ts | 9 ++-- packages/common/src/writeContract.ts | 25 +++++---- packages/dev-tools/tsconfig.json | 1 + packages/protocol-parser/tsconfig.json | 1 + packages/schema-type/tsconfig.json | 1 + packages/world/ts/encodeSystemCall.ts | 28 ++++++---- packages/world/ts/encodeSystemCallFrom.ts | 30 +++++++++-- packages/world/ts/encodeSystemCalls.ts | 16 ++++-- packages/world/ts/encodeSystemCallsFrom.ts | 14 +++-- 13 files changed, 132 insertions(+), 56 deletions(-) diff --git a/packages/block-logs-stream/tsconfig.json b/packages/block-logs-stream/tsconfig.json index e590f0c026..376992556d 100644 --- a/packages/block-logs-stream/tsconfig.json +++ b/packages/block-logs-stream/tsconfig.json @@ -9,6 +9,7 @@ "isolatedModules": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, + "skipLibCheck": true, "strict": true } } diff --git a/packages/cli/src/deploy/ensureWorldFactory.ts b/packages/cli/src/deploy/ensureWorldFactory.ts index 3d27fb0988..1f2913a801 100644 --- a/packages/cli/src/deploy/ensureWorldFactory.ts +++ b/packages/cli/src/deploy/ensureWorldFactory.ts @@ -6,7 +6,7 @@ import initModuleBuild from "@latticexyz/world/out/InitModule.sol/InitModule.jso import initModuleAbi from "@latticexyz/world/out/InitModule.sol/InitModule.abi.json" assert { type: "json" }; import worldFactoryBuild from "@latticexyz/world/out/WorldFactory.sol/WorldFactory.json" assert { type: "json" }; import worldFactoryAbi from "@latticexyz/world/out/WorldFactory.sol/WorldFactory.abi.json" assert { type: "json" }; -import { Client, Transport, Chain, Account, Hex, getCreate2Address, encodeDeployData, size } from "viem"; +import { Client, Transport, Chain, Account, Hex, getCreate2Address, encodeDeployData, size, Abi } from "viem"; import { deployer } from "./ensureDeployer"; import { salt } from "./common"; import { ensureContractsDeployed } from "./ensureContractsDeployed"; @@ -17,7 +17,7 @@ export const accessManagementSystemDeployedBytecodeSize = size( ); export const accessManagementSystemBytecode = encodeDeployData({ bytecode: accessManagementSystemBuild.bytecode.object as Hex, - abi: [], + abi: [] as Abi, }); export const accessManagementSystem = getCreate2Address({ from: deployer, @@ -30,7 +30,7 @@ export const balanceTransferSystemDeployedBytecodeSize = size( ); export const balanceTransferSystemBytecode = encodeDeployData({ bytecode: balanceTransferSystemBuild.bytecode.object as Hex, - abi: [], + abi: [] as Abi, }); export const balanceTransferSystem = getCreate2Address({ from: deployer, @@ -41,14 +41,14 @@ export const balanceTransferSystem = getCreate2Address({ export const batchCallSystemDeployedBytecodeSize = size(batchCallSystemBuild.deployedBytecode.object as Hex); export const batchCallSystemBytecode = encodeDeployData({ bytecode: batchCallSystemBuild.bytecode.object as Hex, - abi: [], + abi: [] as Abi, }); export const batchCallSystem = getCreate2Address({ from: deployer, bytecode: batchCallSystemBytecode, salt }); export const registrationDeployedBytecodeSize = size(registrationSystemBuild.deployedBytecode.object as Hex); export const registrationBytecode = encodeDeployData({ bytecode: registrationSystemBuild.bytecode.object as Hex, - abi: [], + abi: [] as Abi, }); export const registration = getCreate2Address({ from: deployer, diff --git a/packages/common/src/chains/latticeTestnet.ts b/packages/common/src/chains/latticeTestnet.ts index 11761b7013..ff30540a33 100644 --- a/packages/common/src/chains/latticeTestnet.ts +++ b/packages/common/src/chains/latticeTestnet.ts @@ -3,7 +3,6 @@ import type { MUDChain } from "./types"; export const latticeTestnet = { name: "Lattice Testnet", id: 4242, - network: "lattice-testnet", nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" }, rpcUrls: { default: { diff --git a/packages/common/src/getContract.ts b/packages/common/src/getContract.ts index ac809e7139..12cd162955 100644 --- a/packages/common/src/getContract.ts +++ b/packages/common/src/getContract.ts @@ -3,13 +3,13 @@ import { Account, Address, Chain, - GetContractParameters, GetContractReturnType, Hex, PublicClient, Transport, WalletClient, WriteContractParameters, + Client, getContract as viem_getContract, } from "viem"; import { UnionOmit } from "./type-utils/common"; @@ -33,6 +33,21 @@ export type ContractWrite = { result: Promise; }; +// Copied from https://github.com/wevm/viem/blob/viem%402.7.11/src/actions/getContract.ts#L71-L83 +type KeyedClient< + TTransport extends Transport = Transport, + TChain extends Chain | undefined = Chain | undefined, + TAccount extends Account | undefined = Account | undefined +> = + | { + public?: Client; + wallet: Client; + } + | { + public: Client; + wallet?: Client; + }; + export type GetContractOptions< TTransport extends Transport, TAddress extends Address, @@ -41,7 +56,11 @@ export type GetContractOptions< TAccount extends Account, TPublicClient extends PublicClient, TWalletClient extends WalletClient -> = Required> & { +> = { + abi: TAbi; + address: TAddress; + publicClient: TPublicClient; + walletClient: TWalletClient; onWrite?: (write: ContractWrite) => void; }; @@ -54,7 +73,8 @@ export function getContract< TChain extends Chain, TAccount extends Account, TPublicClient extends PublicClient, - TWalletClient extends WalletClient + TWalletClient extends WalletClient, + TClient extends KeyedClient >({ abi, address, @@ -69,13 +89,22 @@ export function getContract< TAccount, TPublicClient, TWalletClient ->): GetContractReturnType { - const contract = viem_getContract({ +>): GetContractReturnType { + const contract = viem_getContract< + TTransport, + TAddress, + TAbi, + { public: TPublicClient; wallet: TWalletClient }, + TChain, + TAccount + >({ abi, address, - publicClient, - walletClient, - }) as unknown as GetContractReturnType; + client: { + public: publicClient, + wallet: walletClient, + }, + }) as unknown as GetContractReturnType & { write: unknown }; if (contract.write) { // Replace write calls with our own. Implemented ~the same as viem, but adds better handling of nonces (via queue + retries). @@ -98,11 +127,11 @@ export function getContract< args, ...options, onWrite, - } as unknown as WriteContractParameters; + } as unknown as WriteContractParameters; const result = writeContract(walletClient, request); const id = `${walletClient.chain.id}:${walletClient.account.address}:${nextWriteId++}`; - onWrite?.({ id, request: request as WriteContractParameters, result }); + onWrite?.({ id, request, result }); return result; }; @@ -111,5 +140,5 @@ export function getContract< ); } - return contract as unknown as GetContractReturnType; + return contract as unknown as GetContractReturnType; } diff --git a/packages/common/src/sendTransaction.ts b/packages/common/src/sendTransaction.ts index 6f89df20ce..dce025bff2 100644 --- a/packages/common/src/sendTransaction.ts +++ b/packages/common/src/sendTransaction.ts @@ -5,7 +5,7 @@ import { Client, SendTransactionParameters, Transport, - WriteContractReturnType, + SendTransactionReturnType, } from "viem"; import { call, sendTransaction as viem_sendTransaction } from "viem/actions"; import pRetry from "p-retry"; @@ -20,11 +20,11 @@ const debug = parentDebug.extend("sendTransaction"); export async function sendTransaction< TChain extends Chain | undefined, TAccount extends Account | undefined, - TChainOverride extends Chain | undefined + TChainOverride extends Chain | undefined = undefined >( client: Client, request: SendTransactionParameters -): Promise { +): Promise { const rawAccount = request.account ?? client.account; if (!rawAccount) { // TODO: replace with viem AccountNotFoundError once its exported @@ -68,7 +68,8 @@ export async function sendTransaction< const nonce = nonceManager.nextNonce(); debug("sending tx with nonce", nonce, "to", preparedRequest.to); - return await viem_sendTransaction(client, { nonce, ...preparedRequest }); + const parameters: SendTransactionParameters = { nonce, ...preparedRequest }; + return await viem_sendTransaction(client, parameters); }, { retries: 3, diff --git a/packages/common/src/writeContract.ts b/packages/common/src/writeContract.ts index 07a0dd0964..973ecfb8bb 100644 --- a/packages/common/src/writeContract.ts +++ b/packages/common/src/writeContract.ts @@ -7,6 +7,8 @@ import { Transport, WriteContractParameters, WriteContractReturnType, + ContractFunctionName, + ContractFunctionArgs, } from "viem"; import { simulateContract, writeContract as viem_writeContract } from "viem/actions"; import pRetry from "p-retry"; @@ -19,14 +21,15 @@ const debug = parentDebug.extend("writeContract"); // TODO: migrate away from this approach once we can hook into viem's nonce management: https://github.com/wagmi-dev/viem/discussions/1230 export async function writeContract< - TChain extends Chain | undefined, - TAccount extends Account | undefined, - TAbi extends Abi | readonly unknown[], - TFunctionName extends string, - TChainOverride extends Chain | undefined + chain extends Chain | undefined, + account extends Account | undefined, + abi extends Abi | readonly unknown[], + functionName extends ContractFunctionName, + args extends ContractFunctionArgs, + chainOverride extends Chain | undefined >( - client: Client, - request: WriteContractParameters + client: Client, + request: WriteContractParameters ): Promise { const rawAccount = request.account ?? client.account; if (!rawAccount) { @@ -42,7 +45,7 @@ export async function writeContract< }); async function prepareWrite(): Promise< - WriteContractParameters + WriteContractParameters > { if (request.gas) { debug("gas provided, skipping simulate", request.functionName, request.address); @@ -50,13 +53,13 @@ export async function writeContract< } debug("simulating", request.functionName, "at", request.address); - const result = await simulateContract(client, { + const result = await simulateContract(client, { ...request, blockTag: "pending", account, - } as unknown as SimulateContractParameters); + } as unknown as SimulateContractParameters); - return result.request as unknown as WriteContractParameters; + return result.request as unknown as WriteContractParameters; } const preparedWrite = await prepareWrite(); diff --git a/packages/dev-tools/tsconfig.json b/packages/dev-tools/tsconfig.json index e453e13efb..ef4ccc40de 100644 --- a/packages/dev-tools/tsconfig.json +++ b/packages/dev-tools/tsconfig.json @@ -9,6 +9,7 @@ "isolatedModules": true, "esModuleInterop": true, "jsx": "react-jsx", + "skipLibCheck": true, "jsxImportSource": "react" }, "include": ["src"] diff --git a/packages/protocol-parser/tsconfig.json b/packages/protocol-parser/tsconfig.json index e590f0c026..376992556d 100644 --- a/packages/protocol-parser/tsconfig.json +++ b/packages/protocol-parser/tsconfig.json @@ -9,6 +9,7 @@ "isolatedModules": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, + "skipLibCheck": true, "strict": true } } diff --git a/packages/schema-type/tsconfig.json b/packages/schema-type/tsconfig.json index 6bf6ff0ab6..413bf5de38 100644 --- a/packages/schema-type/tsconfig.json +++ b/packages/schema-type/tsconfig.json @@ -10,6 +10,7 @@ "isolatedModules": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, + "skipLibCheck": true, "strict": true } } diff --git a/packages/world/ts/encodeSystemCall.ts b/packages/world/ts/encodeSystemCall.ts index 20d5fb53d2..47bc4fb954 100644 --- a/packages/world/ts/encodeSystemCall.ts +++ b/packages/world/ts/encodeSystemCall.ts @@ -1,30 +1,40 @@ import { Abi, EncodeFunctionDataParameters, - ContractFunctionConfig, - GetFunctionArgs, + ContractFunctionParameters, Hex, encodeFunctionData, + AbiStateMutability, + ContractFunctionName, } from "viem"; import IWorldCallAbi from "../out/IWorldKernel.sol/IWorldCall.abi.json"; -export type SystemCall = Pick< - ContractFunctionConfig, - "abi" | "functionName" | "args" -> & { +export type SystemCall< + abi extends Abi, + mutability extends AbiStateMutability = AbiStateMutability, + functionName extends ContractFunctionName = ContractFunctionName +> = Pick, "abi" | "functionName" | "args"> & { readonly systemId: Hex; }; /** Encode a system call to be passed as arguments into `World.call` */ -export function encodeSystemCall({ +export function encodeSystemCall< + abi extends Abi, + mutability extends AbiStateMutability = AbiStateMutability, + functionName extends ContractFunctionName = ContractFunctionName +>({ abi, systemId, functionName, args, -}: SystemCall): GetFunctionArgs["args"] { +}: SystemCall): ContractFunctionParameters< + typeof IWorldCallAbi, + "nonpayable", + "call" +>["args"] { return [ systemId, - encodeFunctionData({ + encodeFunctionData({ abi, functionName, args, diff --git a/packages/world/ts/encodeSystemCallFrom.ts b/packages/world/ts/encodeSystemCallFrom.ts index 1688b8e0be..7e5273444b 100644 --- a/packages/world/ts/encodeSystemCallFrom.ts +++ b/packages/world/ts/encodeSystemCallFrom.ts @@ -1,23 +1,43 @@ -import { Abi, EncodeFunctionDataParameters, GetFunctionArgs, encodeFunctionData, Address } from "viem"; +import { + Abi, + EncodeFunctionDataParameters, + ContractFunctionName, + encodeFunctionData, + Address, + AbiStateMutability, + ContractFunctionParameters, +} from "viem"; import IWorldCallAbi from "../out/IWorldKernel.sol/IWorldCall.abi.json"; import { SystemCall } from "./encodeSystemCall"; -export type SystemCallFrom = SystemCall & { +export type SystemCallFrom< + abi extends Abi, + mutability extends AbiStateMutability = AbiStateMutability, + functionName extends ContractFunctionName = ContractFunctionName +> = SystemCall & { readonly from: Address; }; /** Encode a system call to be passed as arguments into `World.callFrom` */ -export function encodeSystemCallFrom({ +export function encodeSystemCallFrom< + abi extends Abi, + mutability extends AbiStateMutability = AbiStateMutability, + functionName extends ContractFunctionName = ContractFunctionName +>({ abi, from, systemId, functionName, args, -}: SystemCallFrom): GetFunctionArgs["args"] { +}: SystemCallFrom): ContractFunctionParameters< + typeof IWorldCallAbi, + "nonpayable", + "callFrom" +>["args"] { return [ from, systemId, - encodeFunctionData({ + encodeFunctionData({ abi, functionName, args, diff --git a/packages/world/ts/encodeSystemCalls.ts b/packages/world/ts/encodeSystemCalls.ts index 6336822e0b..49998593a1 100644 --- a/packages/world/ts/encodeSystemCalls.ts +++ b/packages/world/ts/encodeSystemCalls.ts @@ -1,11 +1,17 @@ -import { Abi, GetFunctionArgs } from "viem"; +import { Abi, AbiStateMutability, ContractFunctionName, ContractFunctionParameters } from "viem"; import IWorldCallAbi from "../out/IWorldKernel.sol/IWorldCall.abi.json"; import { SystemCall, encodeSystemCall } from "./encodeSystemCall"; /** Encode system calls to be passed as arguments into `World.batchCall` */ -export function encodeSystemCalls( +export function encodeSystemCalls< + abi extends Abi, + mutability extends AbiStateMutability = AbiStateMutability, + functionName extends ContractFunctionName = ContractFunctionName +>( abi: abi, - systemCalls: readonly Omit, "abi">[] -): GetFunctionArgs["args"][] { - return systemCalls.map((systemCall) => encodeSystemCall({ ...systemCall, abi } as SystemCall)); + systemCalls: readonly Omit, "abi">[] +): ContractFunctionParameters["args"][] { + return systemCalls.map((systemCall) => + encodeSystemCall({ ...systemCall, abi } as SystemCall) + ); } diff --git a/packages/world/ts/encodeSystemCallsFrom.ts b/packages/world/ts/encodeSystemCallsFrom.ts index e63cc43bd0..c9254dc007 100644 --- a/packages/world/ts/encodeSystemCallsFrom.ts +++ b/packages/world/ts/encodeSystemCallsFrom.ts @@ -1,14 +1,18 @@ -import { Abi, Address, GetFunctionArgs } from "viem"; +import { Abi, Address, AbiStateMutability, ContractFunctionName, ContractFunctionParameters } from "viem"; import IWorldCallAbi from "../out/IWorldKernel.sol/IWorldCall.abi.json"; import { SystemCallFrom, encodeSystemCallFrom } from "./encodeSystemCallFrom"; /** Encode system calls to be passed as arguments into `World.batchCallFrom` */ -export function encodeSystemCallsFrom( +export function encodeSystemCallsFrom< + abi extends Abi, + mutability extends AbiStateMutability = AbiStateMutability, + functionName extends ContractFunctionName = ContractFunctionName +>( abi: abi, from: Address, - systemCalls: readonly Omit, "abi" | "from">[] -): GetFunctionArgs["args"][] { + systemCalls: readonly Omit, "abi" | "from">[] +): ContractFunctionParameters["args"][] { return systemCalls.map((systemCall) => - encodeSystemCallFrom({ ...systemCall, abi, from } as SystemCallFrom) + encodeSystemCallFrom({ ...systemCall, abi, from } as SystemCallFrom) ); } From ff11b79fe3f1fdb077492d41a288dea6ec268daa Mon Sep 17 00:00:00 2001 From: tash-2s <81064017+tash-2s@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:50:45 -0600 Subject: [PATCH 05/11] refactor --- packages/common/src/getContract.ts | 32 ++++---------------------- packages/common/src/sendTransaction.ts | 2 +- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/packages/common/src/getContract.ts b/packages/common/src/getContract.ts index 12cd162955..0aa96e2c0f 100644 --- a/packages/common/src/getContract.ts +++ b/packages/common/src/getContract.ts @@ -9,7 +9,6 @@ import { Transport, WalletClient, WriteContractParameters, - Client, getContract as viem_getContract, } from "viem"; import { UnionOmit } from "./type-utils/common"; @@ -33,21 +32,6 @@ export type ContractWrite = { result: Promise; }; -// Copied from https://github.com/wevm/viem/blob/viem%402.7.11/src/actions/getContract.ts#L71-L83 -type KeyedClient< - TTransport extends Transport = Transport, - TChain extends Chain | undefined = Chain | undefined, - TAccount extends Account | undefined = Account | undefined -> = - | { - public?: Client; - wallet: Client; - } - | { - public: Client; - wallet?: Client; - }; - export type GetContractOptions< TTransport extends Transport, TAddress extends Address, @@ -73,8 +57,7 @@ export function getContract< TChain extends Chain, TAccount extends Account, TPublicClient extends PublicClient, - TWalletClient extends WalletClient, - TClient extends KeyedClient + TWalletClient extends WalletClient >({ abi, address, @@ -90,21 +73,16 @@ export function getContract< TPublicClient, TWalletClient >): GetContractReturnType { - const contract = viem_getContract< - TTransport, - TAddress, - TAbi, - { public: TPublicClient; wallet: TWalletClient }, - TChain, - TAccount - >({ + const contract = viem_getContract({ abi, address, client: { public: publicClient, wallet: walletClient, }, - }) as unknown as GetContractReturnType & { write: unknown }; + }) as unknown as GetContractReturnType & { + write: unknown; + }; if (contract.write) { // Replace write calls with our own. Implemented ~the same as viem, but adds better handling of nonces (via queue + retries). diff --git a/packages/common/src/sendTransaction.ts b/packages/common/src/sendTransaction.ts index dce025bff2..9e64497825 100644 --- a/packages/common/src/sendTransaction.ts +++ b/packages/common/src/sendTransaction.ts @@ -20,7 +20,7 @@ const debug = parentDebug.extend("sendTransaction"); export async function sendTransaction< TChain extends Chain | undefined, TAccount extends Account | undefined, - TChainOverride extends Chain | undefined = undefined + TChainOverride extends Chain | undefined >( client: Client, request: SendTransactionParameters From 8b9d9ce54f6a93c7c7138466d717b629828aaae1 Mon Sep 17 00:00:00 2001 From: tash-2s <81064017+tash-2s@users.noreply.github.com> Date: Wed, 21 Feb 2024 19:57:51 -0600 Subject: [PATCH 06/11] fix encodeSystemCall issue --- packages/world/ts/encodeSystemCall.ts | 38 +++++++--------------- packages/world/ts/encodeSystemCallFrom.ts | 38 +++++++--------------- packages/world/ts/encodeSystemCalls.ts | 17 ++++------ packages/world/ts/encodeSystemCallsFrom.ts | 15 ++++----- 4 files changed, 36 insertions(+), 72 deletions(-) diff --git a/packages/world/ts/encodeSystemCall.ts b/packages/world/ts/encodeSystemCall.ts index 47bc4fb954..8bc0c8587d 100644 --- a/packages/world/ts/encodeSystemCall.ts +++ b/packages/world/ts/encodeSystemCall.ts @@ -1,43 +1,29 @@ -import { - Abi, - EncodeFunctionDataParameters, - ContractFunctionParameters, - Hex, - encodeFunctionData, - AbiStateMutability, - ContractFunctionName, -} from "viem"; +import { Abi, EncodeFunctionDataParameters, Hex, encodeFunctionData, type ContractFunctionName } from "viem"; +import type { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype"; import IWorldCallAbi from "../out/IWorldKernel.sol/IWorldCall.abi.json"; -export type SystemCall< - abi extends Abi, - mutability extends AbiStateMutability = AbiStateMutability, - functionName extends ContractFunctionName = ContractFunctionName -> = Pick, "abi" | "functionName" | "args"> & { +export type SystemCall> = EncodeFunctionDataParameters< + abi, + functionName +> & { readonly systemId: Hex; }; /** Encode a system call to be passed as arguments into `World.call` */ -export function encodeSystemCall< - abi extends Abi, - mutability extends AbiStateMutability = AbiStateMutability, - functionName extends ContractFunctionName = ContractFunctionName ->({ +export function encodeSystemCall>({ abi, systemId, functionName, args, -}: SystemCall): ContractFunctionParameters< - typeof IWorldCallAbi, - "nonpayable", - "call" ->["args"] { +}: SystemCall): AbiParametersToPrimitiveTypes< + ExtractAbiFunction["inputs"] +> { return [ systemId, - encodeFunctionData({ + encodeFunctionData({ abi, functionName, args, - } as unknown as EncodeFunctionDataParameters), + } as unknown as EncodeFunctionDataParameters), ]; } diff --git a/packages/world/ts/encodeSystemCallFrom.ts b/packages/world/ts/encodeSystemCallFrom.ts index 7e5273444b..c4d902e289 100644 --- a/packages/world/ts/encodeSystemCallFrom.ts +++ b/packages/world/ts/encodeSystemCallFrom.ts @@ -1,46 +1,32 @@ -import { - Abi, - EncodeFunctionDataParameters, - ContractFunctionName, - encodeFunctionData, - Address, - AbiStateMutability, - ContractFunctionParameters, -} from "viem"; +import { Abi, EncodeFunctionDataParameters, encodeFunctionData, Address, type ContractFunctionName } from "viem"; +import type { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype"; import IWorldCallAbi from "../out/IWorldKernel.sol/IWorldCall.abi.json"; import { SystemCall } from "./encodeSystemCall"; -export type SystemCallFrom< - abi extends Abi, - mutability extends AbiStateMutability = AbiStateMutability, - functionName extends ContractFunctionName = ContractFunctionName -> = SystemCall & { +export type SystemCallFrom> = SystemCall< + abi, + functionName +> & { readonly from: Address; }; /** Encode a system call to be passed as arguments into `World.callFrom` */ -export function encodeSystemCallFrom< - abi extends Abi, - mutability extends AbiStateMutability = AbiStateMutability, - functionName extends ContractFunctionName = ContractFunctionName ->({ +export function encodeSystemCallFrom>({ abi, from, systemId, functionName, args, -}: SystemCallFrom): ContractFunctionParameters< - typeof IWorldCallAbi, - "nonpayable", - "callFrom" ->["args"] { +}: SystemCallFrom): AbiParametersToPrimitiveTypes< + ExtractAbiFunction["inputs"] +> { return [ from, systemId, - encodeFunctionData({ + encodeFunctionData({ abi, functionName, args, - } as unknown as EncodeFunctionDataParameters), + } as unknown as EncodeFunctionDataParameters), ]; } diff --git a/packages/world/ts/encodeSystemCalls.ts b/packages/world/ts/encodeSystemCalls.ts index 49998593a1..fe027924da 100644 --- a/packages/world/ts/encodeSystemCalls.ts +++ b/packages/world/ts/encodeSystemCalls.ts @@ -1,17 +1,12 @@ -import { Abi, AbiStateMutability, ContractFunctionName, ContractFunctionParameters } from "viem"; +import { Abi, type ContractFunctionName } from "viem"; import IWorldCallAbi from "../out/IWorldKernel.sol/IWorldCall.abi.json"; import { SystemCall, encodeSystemCall } from "./encodeSystemCall"; +import type { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype"; /** Encode system calls to be passed as arguments into `World.batchCall` */ -export function encodeSystemCalls< - abi extends Abi, - mutability extends AbiStateMutability = AbiStateMutability, - functionName extends ContractFunctionName = ContractFunctionName ->( +export function encodeSystemCalls>( abi: abi, - systemCalls: readonly Omit, "abi">[] -): ContractFunctionParameters["args"][] { - return systemCalls.map((systemCall) => - encodeSystemCall({ ...systemCall, abi } as SystemCall) - ); + systemCalls: readonly Omit, "abi">[] +): AbiParametersToPrimitiveTypes["inputs"]>[] { + return systemCalls.map((systemCall) => encodeSystemCall({ ...systemCall, abi } as SystemCall)); } diff --git a/packages/world/ts/encodeSystemCallsFrom.ts b/packages/world/ts/encodeSystemCallsFrom.ts index c9254dc007..f5c9bf548e 100644 --- a/packages/world/ts/encodeSystemCallsFrom.ts +++ b/packages/world/ts/encodeSystemCallsFrom.ts @@ -1,18 +1,15 @@ -import { Abi, Address, AbiStateMutability, ContractFunctionName, ContractFunctionParameters } from "viem"; +import { Abi, Address, type ContractFunctionName } from "viem"; import IWorldCallAbi from "../out/IWorldKernel.sol/IWorldCall.abi.json"; import { SystemCallFrom, encodeSystemCallFrom } from "./encodeSystemCallFrom"; +import type { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype"; /** Encode system calls to be passed as arguments into `World.batchCallFrom` */ -export function encodeSystemCallsFrom< - abi extends Abi, - mutability extends AbiStateMutability = AbiStateMutability, - functionName extends ContractFunctionName = ContractFunctionName ->( +export function encodeSystemCallsFrom>( abi: abi, from: Address, - systemCalls: readonly Omit, "abi" | "from">[] -): ContractFunctionParameters["args"][] { + systemCalls: readonly Omit, "abi" | "from">[] +): AbiParametersToPrimitiveTypes["inputs"]>[] { return systemCalls.map((systemCall) => - encodeSystemCallFrom({ ...systemCall, abi, from } as SystemCallFrom) + encodeSystemCallFrom({ ...systemCall, abi, from } as SystemCallFrom) ); } From 7574d7a28d5734aa4c56d82f52cc48ebd2001b4e Mon Sep 17 00:00:00 2001 From: tash-2s <81064017+tash-2s@users.noreply.github.com> Date: Wed, 21 Feb 2024 23:03:28 -0600 Subject: [PATCH 07/11] viem: 2.7.11 => 2.7.12 --- e2e/packages/client-vanilla/package.json | 2 +- e2e/packages/sync-test/package.json | 2 +- e2e/packages/test-data/package.json | 2 +- e2e/pnpm-lock.yaml | 16 +++--- .../packages/client-phaser/package.json | 2 +- .../packages/client-react/package.json | 2 +- .../packages/client-vanilla/package.json | 2 +- examples/minimal/pnpm-lock.yaml | 16 +++--- .../packages/client/package.json | 2 +- examples/multiple-accounts/pnpm-lock.yaml | 8 +-- packages/block-logs-stream/package.json | 2 +- packages/cli/package.json | 2 +- packages/common/package.json | 2 +- packages/config/package.json | 2 +- packages/dev-tools/package.json | 2 +- packages/faucet/package.json | 2 +- packages/protocol-parser/package.json | 2 +- packages/schema-type/package.json | 2 +- packages/store-indexer/package.json | 2 +- packages/store-sync/package.json | 2 +- packages/store/package.json | 2 +- packages/world/package.json | 2 +- pnpm-lock.yaml | 52 +++++++++---------- templates/phaser/packages/client/package.json | 2 +- .../react-ecs/packages/client/package.json | 2 +- templates/react/packages/client/package.json | 2 +- .../threejs/packages/client/package.json | 2 +- .../vanilla/packages/client/package.json | 2 +- 28 files changed, 70 insertions(+), 70 deletions(-) diff --git a/e2e/packages/client-vanilla/package.json b/e2e/packages/client-vanilla/package.json index 06208f0eac..89bf99c5ec 100644 --- a/e2e/packages/client-vanilla/package.json +++ b/e2e/packages/client-vanilla/package.json @@ -29,7 +29,7 @@ "react": "^18.2.0", "rxjs": "7.5.5", "threads": "^1.7.0", - "viem": "2.7.11" + "viem": "2.7.12" }, "devDependencies": { "rimraf": "^3.0.2", diff --git a/e2e/packages/sync-test/package.json b/e2e/packages/sync-test/package.json index a6eed38e98..b7478f5864 100644 --- a/e2e/packages/sync-test/package.json +++ b/e2e/packages/sync-test/package.json @@ -28,7 +28,7 @@ "happy-dom": "^12.10.3", "postgres": "3.3.5", "typescript": "5.1.6", - "viem": "2.7.11", + "viem": "2.7.12", "vite": "^4.2.1", "vitest": "0.34.6", "zod": "^3.22.2" diff --git a/e2e/packages/test-data/package.json b/e2e/packages/test-data/package.json index 4e80166d0c..a4492a284f 100644 --- a/e2e/packages/test-data/package.json +++ b/e2e/packages/test-data/package.json @@ -17,6 +17,6 @@ "execa": "^7.1.1", "tsx": "^3.12.6", "typescript": "5.1.6", - "viem": "2.7.11" + "viem": "2.7.12" } } diff --git a/e2e/pnpm-lock.yaml b/e2e/pnpm-lock.yaml index bbc8cdfa0f..5f0ff0d145 100644 --- a/e2e/pnpm-lock.yaml +++ b/e2e/pnpm-lock.yaml @@ -72,8 +72,8 @@ importers: specifier: ^1.7.0 version: 1.7.0 viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.22.2) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.22.2) devDependencies: rimraf: specifier: ^3.0.2 @@ -181,8 +181,8 @@ importers: specifier: 5.1.6 version: 5.1.6 viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.22.2) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.22.2) vite: specifier: ^4.2.1 version: 4.3.5(@types/node@20.1.3) @@ -220,8 +220,8 @@ importers: specifier: 5.1.6 version: 5.1.6 viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.22.2) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.22.2) packages: @@ -1762,8 +1762,8 @@ packages: resolution: {integrity: sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==} dev: true - /viem@2.7.11(typescript@5.1.6)(zod@3.22.2): - resolution: {integrity: sha512-qlEPF9YOgPVqjTyom73TVAekAYrIe68megO07u55p7pKWgLt0i9KD6Mrmiw7pd7oHh86vIppcygwQMDNGX1YAw==} + /viem@2.7.12(typescript@5.1.6)(zod@3.22.2): + resolution: {integrity: sha512-NbV+Bycw0I4X8y6A04mgJ6+Imt7xXwflgnqisR3JXoJRNc77YSaQCscFN/dmwGLESTkgegJvi+j4nZY32GTpwQ==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: diff --git a/examples/minimal/packages/client-phaser/package.json b/examples/minimal/packages/client-phaser/package.json index a6f656b9ea..16644ea096 100644 --- a/examples/minimal/packages/client-phaser/package.json +++ b/examples/minimal/packages/client-phaser/package.json @@ -35,7 +35,7 @@ "styled-components": "^5.3.10", "threads": "^1.7.0", "use-resize-observer": "^9.1.0", - "viem": "2.7.11", + "viem": "2.7.12", "vite": "^4.2.1", "zustand": "^4.3.8" }, diff --git a/examples/minimal/packages/client-react/package.json b/examples/minimal/packages/client-react/package.json index c1185e9e1c..9473eb0f9e 100644 --- a/examples/minimal/packages/client-react/package.json +++ b/examples/minimal/packages/client-react/package.json @@ -32,7 +32,7 @@ "react-dom": "^18.2.0", "rxjs": "7.5.5", "threads": "^1.7.0", - "viem": "2.7.11" + "viem": "2.7.12" }, "devDependencies": { "@types/react": "18.2.22", diff --git a/examples/minimal/packages/client-vanilla/package.json b/examples/minimal/packages/client-vanilla/package.json index c7646b2af2..a4566f54da 100644 --- a/examples/minimal/packages/client-vanilla/package.json +++ b/examples/minimal/packages/client-vanilla/package.json @@ -29,7 +29,7 @@ "react": "^18.2.0", "rxjs": "7.5.5", "threads": "^1.7.0", - "viem": "2.7.11" + "viem": "2.7.12" }, "devDependencies": { "vite": "^4.2.1", diff --git a/examples/minimal/pnpm-lock.yaml b/examples/minimal/pnpm-lock.yaml index d3cad80e81..932aaf3a72 100644 --- a/examples/minimal/pnpm-lock.yaml +++ b/examples/minimal/pnpm-lock.yaml @@ -105,8 +105,8 @@ importers: specifier: ^9.1.0 version: 9.1.0(react-dom@18.2.0)(react@18.2.0) viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6) vite: specifier: ^4.2.1 version: 4.2.1 @@ -208,8 +208,8 @@ importers: specifier: ^1.7.0 version: 1.7.0 viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6) devDependencies: '@types/react': specifier: 18.2.22 @@ -293,8 +293,8 @@ importers: specifier: ^1.7.0 version: 1.7.0 viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6) devDependencies: vite: specifier: ^4.2.1 @@ -3536,8 +3536,8 @@ packages: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true - /viem@2.7.11(typescript@5.1.6): - resolution: {integrity: sha512-qlEPF9YOgPVqjTyom73TVAekAYrIe68megO07u55p7pKWgLt0i9KD6Mrmiw7pd7oHh86vIppcygwQMDNGX1YAw==} + /viem@2.7.12(typescript@5.1.6): + resolution: {integrity: sha512-NbV+Bycw0I4X8y6A04mgJ6+Imt7xXwflgnqisR3JXoJRNc77YSaQCscFN/dmwGLESTkgegJvi+j4nZY32GTpwQ==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: diff --git a/examples/multiple-accounts/packages/client/package.json b/examples/multiple-accounts/packages/client/package.json index 066c4b3b10..bcd7943147 100644 --- a/examples/multiple-accounts/packages/client/package.json +++ b/examples/multiple-accounts/packages/client/package.json @@ -23,7 +23,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "rxjs": "7.5.5", - "viem": "2.7.11" + "viem": "2.7.12" }, "devDependencies": { "@types/react": "18.2.22", diff --git a/examples/multiple-accounts/pnpm-lock.yaml b/examples/multiple-accounts/pnpm-lock.yaml index 5a0d2cb970..7015942044 100644 --- a/examples/multiple-accounts/pnpm-lock.yaml +++ b/examples/multiple-accounts/pnpm-lock.yaml @@ -75,8 +75,8 @@ importers: specifier: 7.5.5 version: 7.5.5 viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6) devDependencies: '@types/react': specifier: 18.2.22 @@ -2757,8 +2757,8 @@ packages: punycode: 2.3.1 dev: true - /viem@2.7.11(typescript@5.1.6): - resolution: {integrity: sha512-qlEPF9YOgPVqjTyom73TVAekAYrIe68megO07u55p7pKWgLt0i9KD6Mrmiw7pd7oHh86vIppcygwQMDNGX1YAw==} + /viem@2.7.12(typescript@5.1.6): + resolution: {integrity: sha512-NbV+Bycw0I4X8y6A04mgJ6+Imt7xXwflgnqisR3JXoJRNc77YSaQCscFN/dmwGLESTkgegJvi+j4nZY32GTpwQ==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: diff --git a/packages/block-logs-stream/package.json b/packages/block-logs-stream/package.json index 7f4a7f4824..f2986ec88e 100644 --- a/packages/block-logs-stream/package.json +++ b/packages/block-logs-stream/package.json @@ -28,7 +28,7 @@ "abitype": "1.0.0", "debug": "^4.3.4", "rxjs": "7.5.5", - "viem": "2.7.11" + "viem": "2.7.12" }, "devDependencies": { "@types/debug": "^4.1.7", diff --git a/packages/cli/package.json b/packages/cli/package.json index 96eb3cd295..2c429e3b87 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -60,7 +60,7 @@ "rxjs": "7.5.5", "throttle-debounce": "^5.0.0", "typescript": "5.1.6", - "viem": "2.7.11", + "viem": "2.7.12", "yargs": "^17.7.1", "zod": "^3.21.4", "zod-validation-error": "^1.3.0" diff --git a/packages/common/package.json b/packages/common/package.json index 776ce116a6..216270c946 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -61,7 +61,7 @@ "p-retry": "^5.1.2", "prettier": "^2.8.4", "prettier-plugin-solidity": "1.1.3", - "viem": "2.7.11" + "viem": "2.7.12" }, "devDependencies": { "@types/debug": "^4.1.7", diff --git a/packages/config/package.json b/packages/config/package.json index 05afc80c66..2619576b50 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -41,7 +41,7 @@ "@latticexyz/schema-type": "workspace:*", "esbuild": "^0.17.15", "find-up": "^6.3.0", - "viem": "2.7.11", + "viem": "2.7.12", "zod": "^3.21.4", "zod-validation-error": "^1.3.0" }, diff --git a/packages/dev-tools/package.json b/packages/dev-tools/package.json index 87121ee4cc..b5ef1db8b4 100644 --- a/packages/dev-tools/package.json +++ b/packages/dev-tools/package.json @@ -37,7 +37,7 @@ "rxjs": "7.5.5", "tailwind-merge": "^1.12.0", "use-local-storage-state": "^18.3.2", - "viem": "2.7.11", + "viem": "2.7.12", "zustand": "^4.3.7" }, "devDependencies": { diff --git a/packages/faucet/package.json b/packages/faucet/package.json index dc9718eb1e..c4a455a39d 100644 --- a/packages/faucet/package.json +++ b/packages/faucet/package.json @@ -36,7 +36,7 @@ "debug": "^4.3.4", "dotenv": "^16.0.3", "fastify": "^4.21.0", - "viem": "2.7.11", + "viem": "2.7.12", "zod": "^3.21.4" }, "devDependencies": { diff --git a/packages/protocol-parser/package.json b/packages/protocol-parser/package.json index 8ba09ff3e5..08ca13b9d8 100644 --- a/packages/protocol-parser/package.json +++ b/packages/protocol-parser/package.json @@ -27,7 +27,7 @@ "@latticexyz/common": "workspace:*", "@latticexyz/schema-type": "workspace:*", "abitype": "1.0.0", - "viem": "2.7.11" + "viem": "2.7.12" }, "devDependencies": { "tsup": "^6.7.0", diff --git a/packages/schema-type/package.json b/packages/schema-type/package.json index f72e3e776a..caedfb79e0 100644 --- a/packages/schema-type/package.json +++ b/packages/schema-type/package.json @@ -35,7 +35,7 @@ }, "dependencies": { "abitype": "1.0.0", - "viem": "2.7.11" + "viem": "2.7.12" }, "devDependencies": { "@latticexyz/gas-report": "workspace:*", diff --git a/packages/store-indexer/package.json b/packages/store-indexer/package.json index 45e247df00..e8b79608f9 100644 --- a/packages/store-indexer/package.json +++ b/packages/store-indexer/package.json @@ -62,7 +62,7 @@ "rxjs": "7.5.5", "superjson": "^1.12.4", "trpc-koa-adapter": "^1.1.3", - "viem": "2.7.11", + "viem": "2.7.12", "zod": "^3.21.4" }, "devDependencies": { diff --git a/packages/store-sync/package.json b/packages/store-sync/package.json index daa4e7ec06..b6ce955f59 100644 --- a/packages/store-sync/package.json +++ b/packages/store-sync/package.json @@ -76,7 +76,7 @@ "rxjs": "7.5.5", "sql.js": "^1.8.0", "superjson": "^1.12.4", - "viem": "2.7.11", + "viem": "2.7.12", "zod": "^3.21.4", "zustand": "^4.3.7" }, diff --git a/packages/store/package.json b/packages/store/package.json index 48303ad14e..cef5a69075 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -55,7 +55,7 @@ "@latticexyz/config": "workspace:*", "@latticexyz/schema-type": "workspace:*", "abitype": "1.0.0", - "viem": "2.7.11", + "viem": "2.7.12", "zod": "^3.21.4" }, "devDependencies": { diff --git a/packages/world/package.json b/packages/world/package.json index c8eabb3467..dd3d3369e9 100644 --- a/packages/world/package.json +++ b/packages/world/package.json @@ -51,7 +51,7 @@ "@latticexyz/schema-type": "workspace:*", "@latticexyz/store": "workspace:*", "abitype": "1.0.0", - "viem": "2.7.11", + "viem": "2.7.12", "zod": "^3.21.4" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b12eeeb58b..ccb001cd7d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -106,8 +106,8 @@ importers: specifier: 7.5.5 version: 7.5.5 viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.21.4) devDependencies: '@types/debug': specifier: ^4.1.7 @@ -212,8 +212,8 @@ importers: specifier: 5.1.6 version: 5.1.6 viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.21.4) yargs: specifier: ^17.7.1 version: 17.7.1 @@ -288,8 +288,8 @@ importers: specifier: 1.1.3 version: 1.1.3(prettier@2.8.4) viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.21.4) devDependencies: '@types/debug': specifier: ^4.1.7 @@ -319,8 +319,8 @@ importers: specifier: ^6.3.0 version: 6.3.0 viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.21.4) zod: specifier: ^3.21.4 version: 3.21.4 @@ -390,8 +390,8 @@ importers: specifier: ^18.3.2 version: 18.3.2(react-dom@18.2.0)(react@18.2.0) viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.21.4) zustand: specifier: ^4.3.7 version: 4.3.7(react@18.2.0) @@ -450,8 +450,8 @@ importers: specifier: ^4.21.0 version: 4.21.0 viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.21.4) zod: specifier: ^3.21.4 version: 3.21.4 @@ -597,8 +597,8 @@ importers: specifier: 1.0.0 version: 1.0.0(typescript@5.1.6)(zod@3.21.4) viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.21.4) devDependencies: tsup: specifier: ^6.7.0 @@ -699,8 +699,8 @@ importers: specifier: 1.0.0 version: 1.0.0(typescript@5.1.6)(zod@3.21.4) viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.21.4) devDependencies: '@latticexyz/gas-report': specifier: workspace:* @@ -780,8 +780,8 @@ importers: specifier: 1.0.0 version: 1.0.0(typescript@5.1.6)(zod@3.21.4) viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.21.4) zod: specifier: ^3.21.4 version: 3.21.4 @@ -897,8 +897,8 @@ importers: specifier: ^1.1.3 version: 1.1.3(@trpc/server@10.34.0)(koa@2.14.2) viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.21.4) zod: specifier: ^3.21.4 version: 3.21.4 @@ -991,8 +991,8 @@ importers: specifier: ^1.12.4 version: 1.12.4 viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.21.4) zod: specifier: ^3.21.4 version: 3.21.4 @@ -1056,8 +1056,8 @@ importers: specifier: 1.0.0 version: 1.0.0(typescript@5.1.6)(zod@3.21.4) viem: - specifier: 2.7.11 - version: 2.7.11(typescript@5.1.6)(zod@3.21.4) + specifier: 2.7.12 + version: 2.7.12(typescript@5.1.6)(zod@3.21.4) zod: specifier: ^3.21.4 version: 3.21.4 @@ -11901,8 +11901,8 @@ packages: engines: {node: '>= 0.8'} dev: false - /viem@2.7.11(typescript@5.1.6)(zod@3.21.4): - resolution: {integrity: sha512-qlEPF9YOgPVqjTyom73TVAekAYrIe68megO07u55p7pKWgLt0i9KD6Mrmiw7pd7oHh86vIppcygwQMDNGX1YAw==} + /viem@2.7.12(typescript@5.1.6)(zod@3.21.4): + resolution: {integrity: sha512-NbV+Bycw0I4X8y6A04mgJ6+Imt7xXwflgnqisR3JXoJRNc77YSaQCscFN/dmwGLESTkgegJvi+j4nZY32GTpwQ==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: diff --git a/templates/phaser/packages/client/package.json b/templates/phaser/packages/client/package.json index a63e70fe23..53c4f827d8 100644 --- a/templates/phaser/packages/client/package.json +++ b/templates/phaser/packages/client/package.json @@ -29,7 +29,7 @@ "simplex-noise": "^4.0.1", "styled-components": "^5.3.10", "use-resize-observer": "^9.1.0", - "viem": "2.7.11", + "viem": "2.7.12", "zustand": "^4.3.8" }, "devDependencies": { diff --git a/templates/react-ecs/packages/client/package.json b/templates/react-ecs/packages/client/package.json index 71ca104508..d5943713ef 100644 --- a/templates/react-ecs/packages/client/package.json +++ b/templates/react-ecs/packages/client/package.json @@ -24,7 +24,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "rxjs": "7.5.5", - "viem": "2.7.11" + "viem": "2.7.12" }, "devDependencies": { "@types/react": "18.2.22", diff --git a/templates/react/packages/client/package.json b/templates/react/packages/client/package.json index 066c4b3b10..bcd7943147 100644 --- a/templates/react/packages/client/package.json +++ b/templates/react/packages/client/package.json @@ -23,7 +23,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "rxjs": "7.5.5", - "viem": "2.7.11" + "viem": "2.7.12" }, "devDependencies": { "@types/react": "18.2.22", diff --git a/templates/threejs/packages/client/package.json b/templates/threejs/packages/client/package.json index a1c14c57d7..272a46de64 100644 --- a/templates/threejs/packages/client/package.json +++ b/templates/threejs/packages/client/package.json @@ -25,7 +25,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "rxjs": "7.5.5", - "viem": "2.7.11" + "viem": "2.7.12" }, "devDependencies": { "@types/react": "18.2.22", diff --git a/templates/vanilla/packages/client/package.json b/templates/vanilla/packages/client/package.json index e6869817b9..b691535615 100644 --- a/templates/vanilla/packages/client/package.json +++ b/templates/vanilla/packages/client/package.json @@ -21,7 +21,7 @@ "@latticexyz/world": "link:../../../../packages/world", "contracts": "workspace:*", "rxjs": "7.5.5", - "viem": "2.7.11" + "viem": "2.7.12" }, "devDependencies": { "@types/react-dom": "18.2.7", From a435b970b3585d1a6e1aa9b6535a0c1ffea03ae6 Mon Sep 17 00:00:00 2001 From: tash-2s <81064017+tash-2s@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:53:32 -0600 Subject: [PATCH 08/11] update mud_getContract args to match with viem_getContract --- .../client-vanilla/src/mud/setupNetwork.ts | 3 +-- e2e/packages/test-data/generate-test-data.ts | 3 +-- e2e/packages/test-data/generateLogs.ts | 3 +-- .../client-phaser/src/mud/setupNetwork.ts | 3 +-- .../client-react/src/mud/setupNetwork.ts | 3 +-- .../client-vanilla/src/mud/setupNetwork.ts | 3 +-- .../packages/client/src/App.tsx | 3 +-- .../packages/client/src/mud/setupNetwork.ts | 3 +-- packages/common/src/getContract.ts | 17 ++++++++++------- .../packages/client/src/mud/setupNetwork.ts | 3 +-- .../packages/client/src/mud/setupNetwork.ts | 3 +-- .../packages/client/src/mud/setupNetwork.ts | 3 +-- .../packages/client/src/mud/setupNetwork.ts | 3 +-- .../packages/client/src/mud/setupNetwork.ts | 3 +-- 14 files changed, 23 insertions(+), 33 deletions(-) diff --git a/e2e/packages/client-vanilla/src/mud/setupNetwork.ts b/e2e/packages/client-vanilla/src/mud/setupNetwork.ts index 34e93b7bdc..8b6fdea78e 100644 --- a/e2e/packages/client-vanilla/src/mud/setupNetwork.ts +++ b/e2e/packages/client-vanilla/src/mud/setupNetwork.ts @@ -29,8 +29,7 @@ export async function setupNetwork() { const worldContract = getContract({ address: networkConfig.worldAddress as Hex, abi: IWorldAbi, - publicClient, - walletClient: burnerWalletClient, + client: { public: publicClient, wallet: burnerWalletClient }, }); const { components, latestBlock$, storedBlockLogs$, waitForTransaction } = await syncToRecs({ diff --git a/e2e/packages/test-data/generate-test-data.ts b/e2e/packages/test-data/generate-test-data.ts index 8f4eb545ac..1ab36199de 100644 --- a/e2e/packages/test-data/generate-test-data.ts +++ b/e2e/packages/test-data/generate-test-data.ts @@ -65,8 +65,7 @@ const walletClient = createWalletClient({ const worldContract = getContract({ address: worldAddress, abi: IWorldAbi, - publicClient, - walletClient, + client: { public: publicClient, wallet: walletClient }, }); console.log("calling set"); diff --git a/e2e/packages/test-data/generateLogs.ts b/e2e/packages/test-data/generateLogs.ts index 81cc81f8fb..36dff18f32 100644 --- a/e2e/packages/test-data/generateLogs.ts +++ b/e2e/packages/test-data/generateLogs.ts @@ -51,8 +51,7 @@ export async function generateLogs(numRecords: number, rpc: string) { const worldContract = getContract({ address: worldAddress, abi: IWorldAbi, - publicClient, - walletClient, + client: { public: publicClient, wallet: walletClient }, }); console.log("calling setNumber"); diff --git a/examples/minimal/packages/client-phaser/src/mud/setupNetwork.ts b/examples/minimal/packages/client-phaser/src/mud/setupNetwork.ts index 6c8e716ef3..e8348e953b 100644 --- a/examples/minimal/packages/client-phaser/src/mud/setupNetwork.ts +++ b/examples/minimal/packages/client-phaser/src/mud/setupNetwork.ts @@ -31,8 +31,7 @@ export async function setupNetwork() { const worldContract = getContract({ address: networkConfig.worldAddress as Hex, abi: IWorldAbi, - publicClient, - walletClient: burnerWalletClient, + client: { public: publicClient, wallet: burnerWalletClient }, onWrite: (write) => write$.next(write), }); diff --git a/examples/minimal/packages/client-react/src/mud/setupNetwork.ts b/examples/minimal/packages/client-react/src/mud/setupNetwork.ts index 96f6a3f17c..9a27f78768 100644 --- a/examples/minimal/packages/client-react/src/mud/setupNetwork.ts +++ b/examples/minimal/packages/client-react/src/mud/setupNetwork.ts @@ -32,8 +32,7 @@ export async function setupNetwork() { const worldContract = getContract({ address: networkConfig.worldAddress as Hex, abi: IWorldAbi, - publicClient, - walletClient: burnerWalletClient, + client: { public: publicClient, wallet: burnerWalletClient }, onWrite: (write) => write$.next(write), }); diff --git a/examples/minimal/packages/client-vanilla/src/mud/setupNetwork.ts b/examples/minimal/packages/client-vanilla/src/mud/setupNetwork.ts index 4574062b9d..2260624657 100644 --- a/examples/minimal/packages/client-vanilla/src/mud/setupNetwork.ts +++ b/examples/minimal/packages/client-vanilla/src/mud/setupNetwork.ts @@ -30,8 +30,7 @@ export async function setupNetwork() { const worldContract = getContract({ address: networkConfig.worldAddress as Hex, abi: IWorldAbi, - publicClient, - walletClient: burnerWalletClient, + client: { public: publicClient, wallet: burnerWalletClient }, onWrite: (write) => write$.next(write), }); diff --git a/examples/multiple-accounts/packages/client/src/App.tsx b/examples/multiple-accounts/packages/client/src/App.tsx index 7a2119cd7b..d4ad3d21bf 100644 --- a/examples/multiple-accounts/packages/client/src/App.tsx +++ b/examples/multiple-accounts/packages/client/src/App.tsx @@ -31,8 +31,7 @@ const makeWorldContract = () => { world: getContract({ address: networkConfig.worldAddress as Hex, abi: IWorldAbi, - publicClient: publicClient, - walletClient: client, + client: { public: publicClient, wallet: client }, }), client, }; diff --git a/examples/multiple-accounts/packages/client/src/mud/setupNetwork.ts b/examples/multiple-accounts/packages/client/src/mud/setupNetwork.ts index 5cd26c31b1..f401de4702 100644 --- a/examples/multiple-accounts/packages/client/src/mud/setupNetwork.ts +++ b/examples/multiple-accounts/packages/client/src/mud/setupNetwork.ts @@ -60,8 +60,7 @@ export async function setupNetwork() { const worldContract = getContract({ address: networkConfig.worldAddress as Hex, abi: IWorldAbi, - publicClient, - walletClient: burnerWalletClient, + client: { public: publicClient, wallet: burnerWalletClient }, onWrite: (write) => write$.next(write), }); diff --git a/packages/common/src/getContract.ts b/packages/common/src/getContract.ts index 0aa96e2c0f..439730035a 100644 --- a/packages/common/src/getContract.ts +++ b/packages/common/src/getContract.ts @@ -3,6 +3,7 @@ import { Account, Address, Chain, + GetContractParameters, GetContractReturnType, Hex, PublicClient, @@ -40,11 +41,14 @@ export type GetContractOptions< TAccount extends Account, TPublicClient extends PublicClient, TWalletClient extends WalletClient -> = { - abi: TAbi; - address: TAddress; - publicClient: TPublicClient; - walletClient: TWalletClient; +> = GetContractParameters< + TTransport, + TChain, + TAccount, + TAbi, + { public: TPublicClient; wallet: TWalletClient }, + TAddress +> & { onWrite?: (write: ContractWrite) => void; }; @@ -61,8 +65,7 @@ export function getContract< >({ abi, address, - publicClient, - walletClient, + client: { public: publicClient, wallet: walletClient }, onWrite, }: GetContractOptions< TTransport, diff --git a/templates/phaser/packages/client/src/mud/setupNetwork.ts b/templates/phaser/packages/client/src/mud/setupNetwork.ts index 10bc9163d5..573f059d38 100644 --- a/templates/phaser/packages/client/src/mud/setupNetwork.ts +++ b/templates/phaser/packages/client/src/mud/setupNetwork.ts @@ -61,8 +61,7 @@ export async function setupNetwork() { const worldContract = getContract({ address: networkConfig.worldAddress as Hex, abi: IWorldAbi, - publicClient, - walletClient: burnerWalletClient, + client: { public: publicClient, wallet: burnerWalletClient }, onWrite: (write) => write$.next(write), }); diff --git a/templates/react-ecs/packages/client/src/mud/setupNetwork.ts b/templates/react-ecs/packages/client/src/mud/setupNetwork.ts index 7aa0031c4d..60dfc7bdda 100644 --- a/templates/react-ecs/packages/client/src/mud/setupNetwork.ts +++ b/templates/react-ecs/packages/client/src/mud/setupNetwork.ts @@ -63,8 +63,7 @@ export async function setupNetwork() { const worldContract = getContract({ address: networkConfig.worldAddress as Hex, abi: IWorldAbi, - publicClient, - walletClient: burnerWalletClient, + client: { public: publicClient, wallet: burnerWalletClient }, onWrite: (write) => write$.next(write), }); diff --git a/templates/react/packages/client/src/mud/setupNetwork.ts b/templates/react/packages/client/src/mud/setupNetwork.ts index 5cd26c31b1..f401de4702 100644 --- a/templates/react/packages/client/src/mud/setupNetwork.ts +++ b/templates/react/packages/client/src/mud/setupNetwork.ts @@ -60,8 +60,7 @@ export async function setupNetwork() { const worldContract = getContract({ address: networkConfig.worldAddress as Hex, abi: IWorldAbi, - publicClient, - walletClient: burnerWalletClient, + client: { public: publicClient, wallet: burnerWalletClient }, onWrite: (write) => write$.next(write), }); diff --git a/templates/threejs/packages/client/src/mud/setupNetwork.ts b/templates/threejs/packages/client/src/mud/setupNetwork.ts index a454f87352..20a639ceca 100644 --- a/templates/threejs/packages/client/src/mud/setupNetwork.ts +++ b/templates/threejs/packages/client/src/mud/setupNetwork.ts @@ -61,8 +61,7 @@ export async function setupNetwork() { const worldContract = getContract({ address: networkConfig.worldAddress as Hex, abi: IWorldAbi, - publicClient, - walletClient: burnerWalletClient, + client: { public: publicClient, wallet: burnerWalletClient }, onWrite: (write) => write$.next(write), }); diff --git a/templates/vanilla/packages/client/src/mud/setupNetwork.ts b/templates/vanilla/packages/client/src/mud/setupNetwork.ts index 7aa0031c4d..60dfc7bdda 100644 --- a/templates/vanilla/packages/client/src/mud/setupNetwork.ts +++ b/templates/vanilla/packages/client/src/mud/setupNetwork.ts @@ -63,8 +63,7 @@ export async function setupNetwork() { const worldContract = getContract({ address: networkConfig.worldAddress as Hex, abi: IWorldAbi, - publicClient, - walletClient: burnerWalletClient, + client: { public: publicClient, wallet: burnerWalletClient }, onWrite: (write) => write$.next(write), }); From 63eb5eebc316861f8552e446141497f14b7fe5e8 Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Thu, 22 Feb 2024 11:25:09 -0800 Subject: [PATCH 09/11] Create twelve-gorillas-learn.md --- .changeset/twelve-gorillas-learn.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .changeset/twelve-gorillas-learn.md diff --git a/.changeset/twelve-gorillas-learn.md b/.changeset/twelve-gorillas-learn.md new file mode 100644 index 0000000000..08b306c8d2 --- /dev/null +++ b/.changeset/twelve-gorillas-learn.md @@ -0,0 +1,22 @@ +--- +"@latticexyz/block-logs-stream": minor +"@latticexyz/cli": minor +"@latticexyz/common": minor +"@latticexyz/config": minor +"@latticexyz/dev-tools": minor +"create-mud": minor +--- + +Upgraded all packages and templates to viem v2.7.12 and abitype v1.0.0. + +Some viem APIs have changed and we've updated `getContract` to reflect those changes and keep it aligned with viem. It's one small code change: + +```diff + const worldContract = getContract({ + address: worldAddress, + abi: IWorldAbi, +- publicClient, +- walletClient, ++ client: { public: publicClient, wallet: walletClient }, + }); +``` From 39c49d30313e2ae39484abb33acf98a97e6d9555 Mon Sep 17 00:00:00 2001 From: tash-2s <81064017+tash-2s@users.noreply.github.com> Date: Thu, 22 Feb 2024 14:35:47 -0600 Subject: [PATCH 10/11] detail types --- packages/common/src/getContract.ts | 12 ++++++++++-- packages/world/ts/encodeSystemCall.ts | 4 ++-- packages/world/ts/encodeSystemCallFrom.ts | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/common/src/getContract.ts b/packages/common/src/getContract.ts index 439730035a..a845359dd8 100644 --- a/packages/common/src/getContract.ts +++ b/packages/common/src/getContract.ts @@ -10,6 +10,8 @@ import { Transport, WalletClient, WriteContractParameters, + type ContractFunctionName, + type ContractFunctionArgs, getContract as viem_getContract, } from "viem"; import { UnionOmit } from "./type-utils/common"; @@ -108,11 +110,17 @@ export function getContract< args, ...options, onWrite, - } as unknown as WriteContractParameters; + } as unknown as WriteContractParameters< + TAbi, + ContractFunctionName, + ContractFunctionArgs, + TChain, + TAccount + >; const result = writeContract(walletClient, request); const id = `${walletClient.chain.id}:${walletClient.account.address}:${nextWriteId++}`; - onWrite?.({ id, request, result }); + onWrite?.({ id, request: request as WriteContractParameters, result }); return result; }; diff --git a/packages/world/ts/encodeSystemCall.ts b/packages/world/ts/encodeSystemCall.ts index 8bc0c8587d..a6a36e735b 100644 --- a/packages/world/ts/encodeSystemCall.ts +++ b/packages/world/ts/encodeSystemCall.ts @@ -20,10 +20,10 @@ export function encodeSystemCall { return [ systemId, - encodeFunctionData({ + encodeFunctionData({ abi, functionName, args, - } as unknown as EncodeFunctionDataParameters), + } as unknown as EncodeFunctionDataParameters), ]; } diff --git a/packages/world/ts/encodeSystemCallFrom.ts b/packages/world/ts/encodeSystemCallFrom.ts index c4d902e289..691675684e 100644 --- a/packages/world/ts/encodeSystemCallFrom.ts +++ b/packages/world/ts/encodeSystemCallFrom.ts @@ -23,10 +23,10 @@ export function encodeSystemCallFrom({ abi, functionName, args, - } as unknown as EncodeFunctionDataParameters), + } as unknown as EncodeFunctionDataParameters), ]; } From 39af8bb2f74ed84d7b136a4f060eadd375bbcf8c Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Fri, 23 Feb 2024 04:39:17 -0800 Subject: [PATCH 11/11] Update twelve-gorillas-learn.md --- .changeset/twelve-gorillas-learn.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.changeset/twelve-gorillas-learn.md b/.changeset/twelve-gorillas-learn.md index 08b306c8d2..156b854945 100644 --- a/.changeset/twelve-gorillas-learn.md +++ b/.changeset/twelve-gorillas-learn.md @@ -4,6 +4,13 @@ "@latticexyz/common": minor "@latticexyz/config": minor "@latticexyz/dev-tools": minor +"@latticexyz/faucet": minor +"@latticexyz/protocol-parser": minor +"@latticexyz/schema-type": minor +"@latticexyz/store-indexer": minor +"@latticexyz/store-sync": minor +"@latticexyz/store": minor +"@latticexyz/world": minor "create-mud": minor ---