A high-level Ethereum abstraction layer that auto-generates typed contract methods from ABI/artifact files, reducing boilerplate over ethers.js or web3.js. Version 1.0.7 supports both injected wallets (e.g., MetaMask) and JSON RPC providers. It includes a CLI transpiler (ethpst) that pre-processes ABI files and exposes environment-based contract address configuration. Ships TypeScript types. Notable differentiator: generates per-contract methods with IN/OUT naming to handle overloaded functions automatically.
npm install eth-adapterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows setup steps (install, artifacts, ethpst), two ways to connect (wallet/JSON RPC), and calling a generated contract method with error handling.
Call methods with an object: contractMethods.CONTRACT.foo_IN1_OUT1({param: val}) instead of contractMethods.CONTRACT.foo_IN1_OUT1(val).Ensure .env keys follow pattern CONTRACT_ADDRESS_{NAME} where {NAME} matches artifact filename without .json, uppercased.Run npx ethpst before starting dev server. For React, prepend scripts with npx ethpst;.
Prefer ethAdapter.contractMethods over raw ethers calls.
Add ETH_ADAPTER_USE_CJS='TRUE' to .env and re-run ethpst for CJS output.
Ensure artifact JSON is in /artifacts, .env has CONTRACT_ADDRESS_STORAGE=0x..., and run npx ethpst.
Call await ethAdapter.connectToWeb3Wallet() or setJsonRpcProvider() first. Check the generated method signature; ensure parameter object is passed.
Run npm install eth-adapter. For TS, ensure tsconfig.json includes 'node_modules/@types' or 'moduleResolution': 'node'.
Use npx ethpst or install as devDependency and run via npm scripts.