Skip to main content
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.
The routes namespace compiles a SauceScript program for one chain by name and builds the calls that run it. routes.compileSauceProgram(chain, source, options?) compiles with the chainโ€™s token symbols, protocol namespaces and @sauce/token in scope; routes.encodeEntryArguments(program, values) encodes mainโ€™s run-time arguments; routes.buildSauceEvmCall(params) builds one cook(engine, program) call on a Pot. The chain exports (Base, Solana, โ€ฆ), chain and Token are named exports of the root, and importing the package puts nothing on globalThis.
Generated from the type declarations of @eco-incorp/sauce.

routes.knownTokenSymbols

Function ยท @eco-incorp/sauce Every symbol this registry knows for chain, sorted for stable diagnostics/tests.

routes.registryTokenAddress

Function ยท @eco-incorp/sauce The registryโ€™s own value for symbol on chain, or undefined if unregistered: a tokenโ€™s address on an EVM chain, a mintโ€™s 32-byte key on Solana.

routes.registryTokens

Function ยท @eco-incorp/sauce Every registry token on chain, by symbol, each a frozen RegistryToken: an EVM chainโ€™s tokens, or a Solana clusterโ€™s registered mints. The same objects on every call. Empty for a chain the registry has no row for.

routes.resolveTokenMap

Function ยท @eco-incorp/sauce THE one precedence resolver every token-address consumer goes through: registry rows for chain first (an EVM chainโ€™s tokens, an svm chainโ€™s cluster mints as 32-byte keys), then callerTokens merged PER KEY on top โ€” overriding one symbol (e.g. USDC) never drops an unrelated registry symbol (e.g. WETH) for the same chain. With no callerTokens, the chainโ€™s registry map: the same map on every call.

routes.SVM_TOKEN_REGISTRY

Variable ยท @eco-incorp/sauce Registered SPL mints, per Solana cluster: a program compiled for solana resolves its symbols to mainnet-betaโ€™s, one compiled for solana-devnet to devnetโ€™s and one compiled for solana-testnet to testnetโ€™s.

routes.svmTokenRows

Function ยท @eco-incorp/sauce The registered mints a program compiled for chain resolves its symbols to: none off SVM.

routes.TOKEN_REGISTRY

Variable ยท @eco-incorp/sauce Keyed by canonical EVM chain id (CanonicalChain.id).

routes.RegistryToken

Interface ยท @eco-incorp/sauce One registry token on one chain, as a chain export carries it (Base.USDC): the same row a compiled programโ€™s USDC resolves to on that chain.

routes.StockToken

Interface ยท @eco-incorp/sauce What a stock row carries beyond a tokenโ€™s (stock-tokens.ts).

routes.SvmTokenCluster

Type ยท @eco-incorp/sauce A Solana cluster a mint is registered on. mainnet-beta is the canonical solana chain.

routes.SvmTokenRow

Interface ยท @eco-incorp/sauce

routes.TokenRegistryRow

Interface ยท @eco-incorp/sauce

routes.STOCK_ISSUERS

Variable ยท @eco-incorp/sauce Each issuerโ€™s name, the published list its rows are copied from, and whether its Solana mints charge a transfer fee (Token-2022โ€™s TransferFee, withheld from what the recipient gets), which the evidence holds every mint to.

routes.stockSymbol

Function ยท @eco-incorp/sauce The registry symbol for an issuerโ€™s symbol: the same, with a โ€.โ€ as โ€_โ€.

routes.StockIssuer

Type ยท @eco-incorp/sauce An issuer whose list stock-tokens.generated.ts copies.