diff --git a/.changeset/tiny-lions-listen.md b/.changeset/tiny-lions-listen.md new file mode 100644 index 0000000000..0c22e706b2 --- /dev/null +++ b/.changeset/tiny-lions-listen.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/faucet": patch +--- + +Updated to use MUD's `sendTransaction`, which does a better of managing nonces for higher volumes of transactions. diff --git a/packages/faucet/package.json b/packages/faucet/package.json index d370d616b4..f13a862f06 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:*", "@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..3d641c39ae 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:* + version: link:../common '@trpc/client': specifier: 10.34.0 version: 10.34.0(@trpc/server@10.34.0)