Skip to main content
Archived documentation for @eco-incorp/sauce@0.99.16. Install this release with npm install --save-exact @eco-incorp/sauce@0.99.16. Links to guides outside this tab open current documentation.
Two registries. CANONICAL_CHAINS holds every chain a program can name, EVM chains and Solana, and is read by requireChain, resolveChain and the slug, id and alias lookups. The chains record, read by getChain, holds native-currency and explorer metadata for most EVM chains. The same exports come from the root and from @eco-incorp/sauce/chains.
Generated from the type declarations of @eco-incorp/sauce.

getChain

Function ยท @eco-incorp/sauce/chains, @eco-incorp/sauce

nativeCoinSymbol

Function ยท @eco-incorp/sauce/chains, @eco-incorp/sauce The symbol of chainโ€™s native coin - ETH, SOL, AVAX, โ€ฆ - as chains records it, or for a canonical chain it does not carry, as the table above does. A program reads a holderโ€™s balance of the coin as <holder>.balance (pot.balance); <holder>.<symbol> is refused, naming it, unless the symbol is also a token the chain registers (Arcโ€™s USDC), which it then reads.

getAllChainIds

Function ยท @eco-incorp/sauce/chains, @eco-incorp/sauce

nativeErc20

Function ยท @eco-incorp/sauce/chains, @eco-incorp/sauce The ERC-20 that IS chainIdโ€™s native coin, or undefined on a chain whose native coin is separate from every token (ETH, POL, โ€ฆ). Where it is defined the chain has no canonical wrapped native (nothing needs wrapping), and the native balance and the token balance are one balance on two decimal scales - see NativeErc20.

nativeToErc20Amount

Function ยท @eco-incorp/sauce/chains, @eco-incorp/sauce Converts a native amount (wei) on chainId to its native ERC-20โ€™s units, rounding down the way balanceOf reads it: on Arc, floor(wei / 1e12), so any amount below 1e12 wei reads as 0. Throws on a chain whose native coin is not an ERC-20.

chains

Variable ยท @eco-incorp/sauce/chains, @eco-incorp/sauce All supported EVM chains. No RPC endpoints: callers bring their own.