Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
GalaxySciTech committed Nov 22, 2023
1 parent ded1ccb commit fea6ec0
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/service/zero/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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";

const account = privateKeyToAccount(`0x${process.env.ZERO_WALLET_PK}`);

Expand Down Expand Up @@ -62,18 +63,8 @@ const xdcsubnet = async () => {
};

const getChainId = async (url: string) => {
const res = await fetch(url, {
method: "POST",
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "eth_chainId",
params: [],
}),
headers: { "Content-Type": "application/json" },
});
const json = await res.json();
return Number(json?.result);
const web3 = new Web3(url);
return web3.eth.getChainId();
};

const createParentnetWalletClient = async () => {
Expand Down

0 comments on commit fea6ec0

Please sign in to comment.