Releases: shazow/whatsabi
Releases · shazow/whatsabi
v0.11.0
Summary
Our ABI loaders learned about contract metadata with ABILoader.getContract(address): Promise<ContractResult>
, thanks to @SonOfMosiah!
const loader = new whatsabi.loaders.SourcifyABILoader();
// Previously: const abi = await loader.loadABI(address);
const { abi, name, evmVersion, compilerVersion, runs, ok } = await loader.getContract(address);
if (!ok) throw new Error("contract not found");
...
What's Changed
- README, .env.example: Add env example by @shazow in #79
- feat: getContract by @SonOfMosiah in #77
- loaders: getContract returns non-nullable ContractResult by @shazow in #81
- Release v0.11.0 by @shazow in #82
Full Changelog: v0.10.1...v0.11.0
v0.10.1
Summary
loaders.defaultsWithApiKeys
is nowloaders.defaultsWithEnv
, supporting more overrides:SOURCIFY_CHAIN_ID
,ETHERSCAN_BASE_URL
,ETHERSCAN_API_KEY
(thanks @SonOfMosiah).
Example:
const result = await whatsabi.autoload(address, {
provider: provider,
... whatsabi.loaders.defaultsWithEnv({
SOURCIFY_CHAIN_ID: 42161,
ETHERSCAN_BASE_URL: "https://api.arbiscan.io/api",
ETHERSCAN_API_KEY: "MYSECRETAPIKEY",
}),
});
What's Changed
- Add a baseURL param to defaultsWithAPIKeys by @SonOfMosiah in #73
- loaders.defaultsWithEnv by @shazow in #74
- Switch to tsx, pnpm update by @shazow in #75
New Contributors
- @SonOfMosiah made their first contribution in #73
Full Changelog: v0.10.0...v0.10.1
v0.10.0
Summary
[Update: Useloaders.defaultsWithAPIKeys(env)
loaders.defaultsWithEnv
in v0.10.1]: New helper for initializing default loaders with your own API keys (and more):const env = { ETHERSCAN_API_KEY: "<YOUR KEY>" }; // or process.env const r = await whatsabi.autoload(address, { provider, ...whatsabi.loaders.defaultsWithEnv(env), });
proxies.DiamondProxy
now knows how to load all registered facets withproxy.facets(provider, address)
orproxy.selectors(provider, address)
. Shoutout to @banteg for helping figure this out.selectorsFromBytecode
will now return as soon as the jump table is processed, for faster performance when just extracting selectors.- Shoutout to @cdump for making and sharing a benchmarking suite (#66), this prompted several improvements to whatsabi (false positives should be fixed, and performance improved). Also check out evmole, the bytecode-based parameter type guessing is very impressive!
What's Changed
- Fix syntax issues in the code in the 'usage' section of README by @Autosaida in #64
- DiamondProxy: Load internal facets and selectors by @shazow in #65
- disasm: Fix false positive selectors when looking for ISZERO selectors by @shazow in #68
examples/benchmark-selectors.ts
: Add benchmark example, improve selector loading performance when bypassing full parsing by @shazow in #71
New Contributors
- @Autosaida made their first contribution in #64
Full Changelog: v0.9.1...v0.10.0
v0.9.1
v0.9.0
What's Changed
- loaders: add
chainId
to sourcify loader by @jxom in #60 - autoload: Fix EOA handling for viem #61
- disasm: Include empty "name" fields in inputs/outputs of ABI results, to be more spec compliant #61
New Contributors
Full Changelog: v0.8.6...v0.9.0
v0.8.6
v0.8.5
What's Changed
- Mainly packaging changes. Trying to get the ESM and CJS builds to work in more environments. Sorry for the release spam.
Full Changelog: v0.8.2...v0.8.5
v0.8.2
What's Changed
autoload
: Include empty name keys when name is unknown (as per spec). 😑- Updated
examples/*.ts
code to latest WhatsABI and Ethers v6
Full Changelog: v0.8.0...v0.8.2
v0.8.1
v0.8.0
What's Changed
- 🤗 More provider-agnostic, tested with Ethers.js (v5 and v6) and Viem. (#48)
- 🤏 Reduced bundle size to 12 KB ❗ (#48)
- ⚒️ Changed build process to include esm+commonjs+types in the package, please open an issue if there are environments where WhatsABI is not importing properly.
Full Changelog: v0.7.0...v0.8.0