From d688a5dc45ea0db26815e751366dacc1b407fb03 Mon Sep 17 00:00:00 2001 From: lizhiyong <1679963578@qq.com> Date: Mon, 15 Jan 2024 13:28:03 +0800 Subject: [PATCH] fix --- app/blob-TX/page.tsx | 1 - client.ts | 5 +++-- tsconfig.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/blob-TX/page.tsx b/app/blob-TX/page.tsx index c5c93ae..0882ce1 100644 --- a/app/blob-TX/page.tsx +++ b/app/blob-TX/page.tsx @@ -87,7 +87,6 @@ const BlobTX = () => { const signer = new ethers.Wallet('PRIVATE KEY', new ethers.providers.JsonRpcProvider('https://rpc.ethda.io')) const blobClient = new BlobClient(signer) const hash = await blobClient.sendTx(blobs, {}, result) - const receipt = await blobClient.getTxReceipt(hash) }) } console.log('hhashhashhashash', hash) diff --git a/client.ts b/client.ts index 649140d..b6aa44a 100644 --- a/client.ts +++ b/client.ts @@ -1,3 +1,4 @@ +'use strict' import { resolve } from 'path' import { constants, ethers } from 'ethers' @@ -26,7 +27,7 @@ export class BlobClient { // loadTrustedSetup(SETUP_FILE_PATH) } - async sanityCheck(tx) { + async sanityCheck(tx: any) { let { chainId, nonce, to, value, data, maxPriorityFeePerGas, maxFeePerGas, gasLimit, maxFeePerBlobGas } = tx if (!chainId) { @@ -106,7 +107,7 @@ export class BlobClient { const message = [nonce, maxFeePerGas, gasLimit, to, value, data, 1001n, 0, 0] const signHash = keccak256(RLP.encode(message)) - const pk = getBytes((this._signer as ethers.Wallet).privateKey) + const pk: any = getBytes((this._signer as ethers.Wallet).privateKey) let { v, r, s } = ecsign(signHash, pk) v = 2n * 1001n + 8n + v console.log(message, nonce, v, Buffer.from(r).toString('hex'), Buffer.from(s).toString('hex')) diff --git a/tsconfig.json b/tsconfig.json index db97baf..c6d5170 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "es2020", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true,