An Ethereum SDK for MoonBit. Currently focused on browser wallets via the
EIP-1193 provider standard: it wraps
the provider that extensions such as MetaMask inject as globalThis.ethereum,
and exposes it as typed, async MoonBit functions.
documentation: a cookbook whose every recipe carries a demo you can drive against your own wallet, and a reference for what is wrapped — anything unwrapped is still reachable through
Provider::request.
moon add poteto0/endorThen import the packages you need in your moon.pkg:
import {
"poteto0/endor/provider", // @provider — Provider, typed RPC, errors
"poteto0/endor/provider/browser", // @browser — the injected wallet
"poteto0/endor/ffi/js", // @js — spawn (bridge async to the JS event loop)
}
The domain types are re-exported from the root package, so
"poteto0/endor" gives you @endor.Address, @endor.ChainId, and friends when
you need to spell a type out.
endor-cli is a separate module and a separate install — a binary rather than a
dependency, so nothing it needs ends up in your module's resolution:
moon install poteto0/endor-cli/endor-cliIt generates MoonBit contract presets from JSON ABI documents
(endor-cli init, then endor-cli abi). Point it at a compiler artifact —
solc --combined-json abi,bin, a Foundry or Hardhat one — and the preset gets a
deploy too, with the creation code embedded. Experimental, and not
required to use the SDK — cmd/README.md has the details.
