Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
YongZL committed Jan 15, 2024
1 parent 07b96e4 commit d688a5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/blob-TX/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions client.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict'
import { resolve } from 'path'
import { constants, ethers } from 'ethers'

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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'))
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down

0 comments on commit d688a5d

Please sign in to comment.