Open ethereal1m opened 1 year ago
reproduceable in 2.14 version. The following is my package.json
{
"name": "searcher",
"version": "1.0.0",
"description": "searching",
"main": "index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "ethereal",
"license": "unlicensed",
"dependencies": {
"mev-inspect":"2.1.4",
"ethers": "5.7.2"
},
"devDependencies": {
"@types/node": "^18.14.2",
"ts-node": "^10.9.1",
"tslib": "^2.5.0",
"typescript": "^4.9.5"
}
}
Hey! Could you please share a full example for reproduction? Also, could you please try running the examples following the instruction and see if that works?
I am running nvm v19.7.0 with package.json from above. The following is the index.ts script that broke:
import { ethers } from 'ethers';
import { Inspector } from 'mev-inspect';
const key = 'xx-xxxxWPF22xxxJIdDzbDnUxxxx-xxx';
const provider = new ethers.providers.AlchemyProvider(1, key);
const inspector = new Inspector(1, provider);
It fails at "const inspector" statement.
BUMP having the same issue
Was able to import the inspector in a nest js app:
// Here's how you initialize
import { type Inspector } from 'mev-inspect';
let inspector: Inspector | undefined;
async function getInspector(): Promise<Inspector> {
if (typeof inspector !== 'undefined') return inspector;
const mod = await (eval(`import('mev-inspect')`) as Promise<
typeof import('mev-inspect')
>);
return (inspector = new mod.Inspector(1, rpcProvider));
}
// and here's how I am using it in the app:
const mevInspector = await getInspector();
When executing:
const inspector = new Inspector(1, provider);
I got error:
However if I add
"type": "module",
in my package.json, I got error:
I am using nvm version 0.38.0