Skip to content

Repository files navigation

endor.mbt

docs mooncakes.io CI license

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.

demo

documentation

endor.poteto-mahiro.com

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.

Install

moon add poteto0/endor

Then 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.

The command-line tools

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-cli

It generates MoonBit contract presets from JSON ABI documents (endor-cli init, then endor-cli abi). Point it at a compiler artifactsolc --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.

About

An Ethereum SDK for MoonBit. Currently focused on browser wallets via the EIP-1193 provider standard.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages