deposit namespace emits deposit programs from protocol templates listed under DepositKey. Compile with baseDirs: [...deposit.DEPOSIT_BASE_DIRS], or COMPOSED_BASE_DIRS for a swap-then-deposit program.
sdk/dist/deposit/source.d.ts.
Generated from the type declarations shipped in
@eco-incorp/sauce 0.99.4. Each entry shows the package authors’ JSDoc and declaration for this SDK version. For runtime compatibility and deployed addresses, see architecture and deployments.deposit.depositCallStatement
Function · sdk/dist/deposit/source.d.ts
One deposit’s full statement block (any "balance" binding line, the approve line if
applicable, then the protocol call) for spec - for splicing into a larger, hand-written
program. varSuffix disambiguates EVERY local this block binds - the depositAmtN balance read
and a template’s own selector const - when several deposits share one program (depositSource
passes the spec’s own index).
deposit.depositImportLines
Function · sdk/dist/deposit/source.d.ts
The import lines a depositSource(specs) program needs: each resolved template’s own
imports, plus IERC20 iff any spec needs an approval or an ERC20 balance/delta read. De-duped by
exact line, in first-seen order (IERC20 first, matching swap’s own ordering convention).
deposit.depositSource
Function · sdk/dist/deposit/source.d.ts
A complete, compilable function main() { ... } program: one deposit statement block per spec,
in the given order, inside ONE function. See sdk/src/deposit/index.ts for the compile →
routes.buildSauceEvmCall seam (identical to swap’s).
deposit.swapThenDepositSource
Function · sdk/dist/deposit/source.d.ts
The E4.1/E4.2 composition seam: one cook = one program (V12Pot.cook takes exactly one) - a
swap-then-deposit is ONE main() with the swap statements followed by the deposit statements, not
two cooks. Mirrors the swapAndSupply recipe’s own shape:
outToken.approve(aavePool, swapDelta); IAavePool.at(aavePool).supply(tokenOut, swapDelta, beneficiary, 0);.
A deposit spec with amount: "delta" is bracketed around the WHOLE swap block: a balance
snapshot (IERC20.balanceOf/ctx.selfBalance(), per the template’s funding kind) is taken before
the swap statements and again after, and the deposit uses post - pre - the exact
swapAndSupply idiom (“never sweep pre-existing tokenOut dust”, since a cook may run in a shared
runtime context). amount: "balance"/a concrete literal are unaffected and just run after the
swap block, per depositCallStatement’s own rules.
Import lines are unioned (not concatenated) - swapImportLines ∪ depositImportLines, de-duped
by exact line, so a program needing IERC20 from both sides emits it exactly once (the compiler
throws Conflicting ABIs registered for two DIFFERENT ABIs bound to the same local name, but is
idempotent for the identical import line repeated).
deposit.DEPOSIT_BASE_DIRS
Variable · sdk/dist/deposit/source.d.ts
baseDirs for compiling a depositSource/depositCallStatement program. Two entries, because
(unlike swap, whose only import is the engine-vendored ISauceRouter) a deposit template’s
import resolves against the SDK’s PROTOCOL registry, which lives in sdk/src/protocols, not
sdk/dist/artifacts:
join(__dirname, "..")- the dist root, resolving./artifacts/IERC20.json(same artifactswap’s"balance"path already uses).join(__dirname, "..", "..", "src")- the SHIPPEDsdk/srctree (the rootpackage.jsonfileslist shipssdk/src/protocolsverbatim - seesdk/src/deposit/index.ts’s packaging note), resolving./protocols/<slug>/<X>ABI.json.
src/), __dirname is sdk/src/deposit, so both entries land on
sdk/src, which already has both trees.
deposit.COMPOSED_BASE_DIRS
Variable · sdk/dist/deposit/source.d.ts
SWAP_BASE_DIRS ∪ DEPOSIT_BASE_DIRS, de-duped - the baseDirs a swapThenDepositSource
program needs.
deposit.DepositSourceOptions
Interface · sdk/dist/deposit/source.d.ts
deposit.SwapThenDepositOptions
Interface · sdk/dist/deposit/source.d.ts
