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.
@eco-incorp/sauce/svm is the Solana side: the client (createSauceSvmClient), clusters, PDAs, account resolution against the compilerโ€™s account manifest, Kitchen and engine instructions, transactions and sending, token accounts, and compute planning for @sauce/routerโ€™s Solana venues. @eco-incorp/sauce/svm/engine exports the engineโ€™s wire format and instruction builders, @eco-incorp/sauce/svm/verify verifies settle programs and engine CPI data, and @eco-incorp/sauce/svm/engine-artifacts (Node only) returns file paths to the packaged engine and Kitchen binaries.
Generated from the type declarations of @eco-incorp/sauce.

buildExecuteInstruction

Function ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine Builds the engine execute instruction. The supplied account list defines the programโ€™s account indices. The first signer supplies the caller context (ctx.msgSender()); a list with no signer fails only if the program reads it. Include buildHeapFramePrepend() exactly once in the transaction.

buildExecuteFromAccountInstruction

Function ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine executeFromAccount: account 0 is the code, the callerโ€™s tail follows at its natural indices, and the program is that accountโ€™s data verbatim. No payload beyond the discriminator. The pre-release engine took [flags][pin][offset,len][args] so a caller could pin the staged bytes at execute time; the released engine has no such grammar and the pin moved to the kitchen - buildCookFromAccountInstructionโ€™s pin refuses unless the staged bytes hash to it. Needs RequestHeapFrame, like execute - see buildHeapFramePrepend.

assertNoExecutePin

Function ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine Rejects a would-be execute-time content pin, naming where the enforceable one lives. Lives here because the reason is this moduleโ€™s: executeFromAccount above emits the discriminator and nothing else, so a pin handed to a caller of it has no destination. The surfaces that used to accept one - StagedBufferRef.expectedSha256, SimulateStagedOpts.expectedSha256 - forwarded it and dropped it while documenting it as engine-verified, which is the failure this converts into a loud one.

buildCookAndPayInstruction

Function ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine cookAndPay - the engine called directly, bytecode inline, paying the Kitchenโ€™s execution fee itself: [discriminator | max_execution_fee u64 LE | bytecode]. No Kitchen, so no Pot: nothing signs for one, and the program acts with the signatures the transaction gave its tail - the wallet that signs is the authority a token transfer names. In exchange the programโ€™s own CPIs start one level higher on the invoke stack than under a Kitchen cook, which CPIs the engine. Needs the same RequestHeapFrame as every cook - see buildHeapFramePrepend.

buildCookAndPayFromAccountInstruction

Function ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine cookAndPayFromAccount - the staged direct cook: [discriminator | max_execution_fee u64 LE], the program being the code accountโ€™s data. Unpinned. The engine checks nothing about the code account - not its owner, not a finalized flag, not a digest - and runs it with the tailโ€™s signatures. Whoever can change those bytes before the transaction lands chooses what the signerโ€™s authority is used for. Prefer buildCookAndPayFromAccountPinnedInstruction unless the account is one only the signer controls.

buildCookAndPayFromAccountPinnedInstruction

Function ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine Builds cookAndPayFromAccountPinned, the pinned staged direct cook: [discriminator | max_execution_fee u64 LE | expected_sha256]. It verifies the code accountโ€™s SHA-256 digest before charging the fee and executes exactly those bytes. A mismatch fails with CodeHashMismatch.

ExecuteInstructionInput

Interface ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine

ExecuteFromAccountInstructionInput

Interface ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine

DirectCookPayment

Interface ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine What a direct cook pays with - the three accounts the engine reads LAST and strips before the program sees its tail, so bytecode indices and MSG_SENDER keep their meanings.

CookAndPayInput

Interface ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine

CookAndPayFromAccountInput

Interface ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine

CookAndPayFromAccountPinnedInput

Interface ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine