Archived documentation for
@eco-incorp/sauce@1.0.0. Install this release with npm install --save-exact @eco-incorp/sauce@1.0.0. Links to guides outside this tab open current documentation.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.
@eco-incorp/sauce.
getChain
Function ยท @eco-incorp/sauce/chains, @eco-incorp/sauce
isTestnet
Function ยท @eco-incorp/sauce/chains, @eco-incorp/sauce
Whether chain is a test network, whose coin and tokens have no value.
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.
