From d578b6ccd8c76e6ce8f69e12b226cd69275813d9 Mon Sep 17 00:00:00 2001 From: R-Morpheus Date: Fri, 22 Dec 2023 16:39:06 +0300 Subject: [PATCH 1/5] add: common package, mud's sendTransaction --- packages/faucet/bin/faucet-server.ts | 2 +- packages/faucet/package.json | 1 + packages/faucet/src/createAppRouter.ts | 2 +- pnpm-lock.yaml | 3 +++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/faucet/bin/faucet-server.ts b/packages/faucet/bin/faucet-server.ts index dbbd0ac73a..86e8ae99b3 100644 --- a/packages/faucet/bin/faucet-server.ts +++ b/packages/faucet/bin/faucet-server.ts @@ -4,7 +4,7 @@ import fastify from "fastify"; import { fastifyTRPCPlugin } from "@trpc/server/adapters/fastify"; import { http, createClient } from "viem"; import { privateKeyToAccount } from "viem/accounts"; -import { AppRouter, createAppRouter } from "../src/createAppRouter"; +import { AppRouter, createAppRouter } from "../src"; import { parseEnv } from "./parseEnv"; const env = parseEnv(); diff --git a/packages/faucet/package.json b/packages/faucet/package.json index d370d616b4..7761374db6 100644 --- a/packages/faucet/package.json +++ b/packages/faucet/package.json @@ -30,6 +30,7 @@ "dependencies": { "@fastify/compress": "^6.5.0", "@fastify/cors": "^8.3.0", + "@latticexyz/common": "workspace:2.0.0-next.14", "@trpc/client": "10.34.0", "@trpc/server": "10.34.0", "debug": "^4.3.4", diff --git a/packages/faucet/src/createAppRouter.ts b/packages/faucet/src/createAppRouter.ts index 6bbe28000d..c30c417911 100644 --- a/packages/faucet/src/createAppRouter.ts +++ b/packages/faucet/src/createAppRouter.ts @@ -1,7 +1,7 @@ import { z } from "zod"; import { initTRPC } from "@trpc/server"; import { Client, Hex, LocalAccount, formatEther, isHex } from "viem"; -import { sendTransaction } from "viem/actions"; +import { sendTransaction } from "@latticexyz/common"; import { debug } from "./debug"; export type AppContext = { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c1d8f4d4b5..1a9b2d93be 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -431,6 +431,9 @@ importers: '@fastify/cors': specifier: ^8.3.0 version: 8.3.0 + '@latticexyz/common': + specifier: workspace:2.0.0-next.14 + version: link:../common '@trpc/client': specifier: 10.34.0 version: 10.34.0(@trpc/server@10.34.0) From 090e885f49d95696a9fee3f60aa57de68103ada4 Mon Sep 17 00:00:00 2001 From: R-Morpheus Date: Fri, 22 Dec 2023 16:44:33 +0300 Subject: [PATCH 2/5] fix: package.json --- packages/faucet/package.json | 2 +- pnpm-lock.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/faucet/package.json b/packages/faucet/package.json index 7761374db6..f13a862f06 100644 --- a/packages/faucet/package.json +++ b/packages/faucet/package.json @@ -30,7 +30,7 @@ "dependencies": { "@fastify/compress": "^6.5.0", "@fastify/cors": "^8.3.0", - "@latticexyz/common": "workspace:2.0.0-next.14", + "@latticexyz/common": "workspace:*", "@trpc/client": "10.34.0", "@trpc/server": "10.34.0", "debug": "^4.3.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1a9b2d93be..3d641c39ae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -432,7 +432,7 @@ importers: specifier: ^8.3.0 version: 8.3.0 '@latticexyz/common': - specifier: workspace:2.0.0-next.14 + specifier: workspace:* version: link:../common '@trpc/client': specifier: 10.34.0 From 48d4dacb6153a6297a7c6ef5e956c580271672eb Mon Sep 17 00:00:00 2001 From: R-Morpheus Date: Tue, 2 Jan 2024 17:11:02 +0300 Subject: [PATCH 3/5] fix import --- packages/faucet/bin/faucet-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/faucet/bin/faucet-server.ts b/packages/faucet/bin/faucet-server.ts index 86e8ae99b3..dbbd0ac73a 100644 --- a/packages/faucet/bin/faucet-server.ts +++ b/packages/faucet/bin/faucet-server.ts @@ -4,7 +4,7 @@ import fastify from "fastify"; import { fastifyTRPCPlugin } from "@trpc/server/adapters/fastify"; import { http, createClient } from "viem"; import { privateKeyToAccount } from "viem/accounts"; -import { AppRouter, createAppRouter } from "../src"; +import { AppRouter, createAppRouter } from "../src/createAppRouter"; import { parseEnv } from "./parseEnv"; const env = parseEnv(); From f1803709bf0e2b8498747deb5ce4c7e1ccc08f62 Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Tue, 2 Jan 2024 06:25:45 -0800 Subject: [PATCH 4/5] Create tiny-lions-listen.md --- .changeset/tiny-lions-listen.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tiny-lions-listen.md diff --git a/.changeset/tiny-lions-listen.md b/.changeset/tiny-lions-listen.md new file mode 100644 index 0000000000..88f49466e5 --- /dev/null +++ b/.changeset/tiny-lions-listen.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/faucet": minor +--- + +Updated to use MUD's `sendTransaction`, which does a better of managing nonces for higher volumes of transactions. From a78bfa6e845a34046f3ef2c212bb6a86515a771f Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Tue, 2 Jan 2024 06:38:00 -0800 Subject: [PATCH 5/5] Update tiny-lions-listen.md --- .changeset/tiny-lions-listen.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/tiny-lions-listen.md b/.changeset/tiny-lions-listen.md index 88f49466e5..0c22e706b2 100644 --- a/.changeset/tiny-lions-listen.md +++ b/.changeset/tiny-lions-listen.md @@ -1,5 +1,5 @@ --- -"@latticexyz/faucet": minor +"@latticexyz/faucet": patch --- Updated to use MUD's `sendTransaction`, which does a better of managing nonces for higher volumes of transactions.