Skip to content

Commit

Permalink
feat(config): replace ethers with viem (#1782)
Browse files Browse the repository at this point in the history
holic authored Oct 30, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9ad2704 commit 6a091d9
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
@@ -40,8 +40,8 @@
"@latticexyz/common": "workspace:*",
"@latticexyz/schema-type": "workspace:*",
"esbuild": "^0.17.15",
"ethers": "^5.7.2",
"find-up": "^6.3.0",
"viem": "1.14.0",
"zod": "^3.21.4",
"zod-validation-error": "^1.3.0"
},
4 changes: 2 additions & 2 deletions packages/config/src/library/validation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { utils } from "ethers";
import { ZodIssueCode, RefinementCtx } from "zod";
import { isAddress } from "viem";

export const STORE_NAME_MAX_LENGTH = 16;
export const STORE_NAMESPACE_MAX_LENGTH = 14;
@@ -120,7 +120,7 @@ export const validateBaseRoute = _factoryForValidateRoute(false, false);
export const validateSingleLevelRoute = _factoryForValidateRoute(true, true);

export function validateEthereumAddress(address: string, ctx: RefinementCtx) {
if (!utils.isAddress(address)) {
if (!isAddress(address)) {
ctx.addIssue({
code: ZodIssueCode.custom,
message: `Address must be a valid Ethereum address`,
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a091d9

Please sign in to comment.