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.@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.
@eco-incorp/sauce.
buildExecuteInstruction
Function ยท @eco-incorp/sauce/svm, @eco-incorp/sauce/svm/engine
Builds the engine execute instruction. The account list IS the user-account
index space: accounts[i] is user index i (no fixed prefix - interpreter
memory lives in the transactionโs heap frame, not accounts). MSG_SENDER is
the first in-list signer, resolved LAZILY: a signerless list is valid unless
the program reads MSG_SENDER/TX_ORIGIN (NoSigner then). Every transaction
carrying this instruction MUST also carry RequestHeapFrame(262144) - see
buildHeapFramePrepend.
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
cookAndPayFromAccountPinned - the staged direct cook, pinned:
[discriminator | max_execution_fee u64 LE | expected_sha256].
The engine hashes all of the code accountโs data and refuses a mismatch (CodeHashMismatch)
before it validates or pays the fee, then runs the bytes it hashed under the same borrow - so
the program that runs is the program the caller signed for.
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
