TxContext
@totemsdk/kissvm / TxContext
Interface: TxContext
Context supplied to the evaluator describing the spend transaction
Properties
block
block:
number
Current block height
blockMilli?
optionalblockMilli?:number
Current block timestamp in milliseconds
inputIndex
inputIndex:
number
Index of the input coin being evaluated
inputs
inputs:
CoinData[]
All input coins
mastBranches?
optionalmastBranches?:Map<string,string>
MAST branch resolution: maps hashHex (lowercase, 0x-prefixed) → scriptText.
The spender reveals the branch they are executing here.
Key = '0x' + sha3_256(UPPER(trim(scriptText)))
outputs
outputs:
OutputData[]
All output coins
prevCoins?
optionalprevCoins?:CoinData[]
Previous input coins for SAMECOINS check. If not provided SAMECOINS returns true (simulation default).
prevState
prevState:
Record<number,string>
Previous state from the spent coin
simulationMode?
optionalsimulationMode?:boolean
When true, SIGNEDBY/CHECKSIG accept signature presence without verifying against a txDigest. Use ONLY for unit-testing script logic. Never set in production or in simulateSpend — those paths always compute a real txDigest and run full WOTS verification.
state
state:
Record<number,string>
Current state (port → encoded string value)
txDigest?
optionaltxDigest?:Uint8Array<ArrayBufferLike>
32-byte transaction digest for signature verification