From 967e5c45abaccfa88a14b8e4aa0624748c767804 Mon Sep 17 00:00:00 2001 From: Galaxy <30950645+GalaxySciTech@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:01:04 +0400 Subject: [PATCH] init pk bug (#32) Update index.ts --- src/service/zero/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/service/zero/index.ts b/src/service/zero/index.ts index 4370ecb..652f374 100644 --- a/src/service/zero/index.ts +++ b/src/service/zero/index.ts @@ -4,15 +4,15 @@ import { http, decodeAbiParameters, } from "viem"; -import { privateKeyToAccount } from "viem/accounts"; +import { privateKeyToAccount, PrivateKeyAccount } from "viem/accounts"; import endpointABI from "../../abi/endpointABI.json"; import cscABI from "../../abi/cscABI.json"; import fetch from "node-fetch"; import { sleep } from "../../utils"; import Web3 from "web3"; -let account: any = null; -if (!process.env.ZERO_WALLET_PK) { +let account: PrivateKeyAccount = null; +if (process.env.ZERO_WALLET_PK) { account = privateKeyToAccount(`0x${process.env.ZERO_WALLET_PK}`); }