createSimulatedTxReceipt
HardKAS SDK / artifacts/src / createSimulatedTxReceipt
Function: createSimulatedTxReceipt()
createSimulatedTxReceipt(
plan,txId,ctx,extra?):object
Defined in: packages/artifacts/src/signed-tx.ts:78
Creates a canonical simulated receipt.
DEF-1c (Wave 1 continuation): the receipt's lineage.parentArtifactId MUST
be an artifact hash (per the lineage contract). Previously, this function
overrode parentArtifactId with preStateHash — a state-machine hash from a
DIFFERENT hash space — which caused every persisted simulator receipt to
declare an unresolvable HardKAS parent. preStateHash and postStateHash
remain first-class execution/state evidence fields on the receipt; they are
never interpreted as artifact IDs.
The extra bag also now accepts schema-owned lifecycle fields (already
declared on TxReceiptSchema — submittedAt, confirmedAt, rpcUrl,
tracePath, sourceSignedId) so callers can populate the single canonical
receipt identity in one construction, rather than building a second wrapper
receipt with its own contentHash. Optional parentArtifact overrides the
lineage predecessor when the caller executed/submitted a signed artifact
rather than a plan (the plan remains referenced via sourceSignedId →
signed.sourcePlanId indirection preserved by the signed artifact).
Parameters
plan
amountSompi?
string = ...
assumptionLevel?
string = ...
assumptionRef?
string = ...
change?
{ address?: string; amountSompi?: string; } = ...
change.address?
string = ...
change.amountSompi?
string = ...
computeBudget?
string = ...
contentHash?
string = ...
createdAt?
string = ...
estimatedFeeSompi?
string = ...
estimatedMass?
string = ...
execution?
{ domain?: "kaspa-l1" | "evm-l2"; mode?: "rpc" | "simulator" | "localnet" | "l2-rpc"; network?: string; } = executionTargetSchema
execution.domain?
"kaspa-l1" | "evm-l2" = ...
execution.mode?
"rpc" | "simulator" | "localnet" | "l2-rpc" = ...
execution.network?
string = ...
from?
{ accountName?: string; address?: string; input?: string; } = AccountRefSchema
from.accountName?
string = ...
from.address?
string = ...
from.input?
string = ...
hardkasVersion?
string = ...
hashVersion?
string | number = ...
inputs?
object[] = ...
lane?
string = ...
lineage?
{ artifactId?: string; lineageId?: string; parentArtifactId?: string; rootArtifactId?: string; sequence?: number; } = ...
lineage.artifactId?
string = ...
lineage.lineageId?
string = ...
lineage.parentArtifactId?
string = ...
lineage.rootArtifactId?
string = ...
lineage.sequence?
number = ...
lineageDepth?
number = ...
metadata?
any = ...
mode?
"rpc" | "simulator" | "localnet" = executionModeSchema
networkId?
"simnet" | "mainnet" | "testnet-10" | "testnet-11" | "testnet-12" | "simnet-1" | "devnet" | "simulated" | "igra" = kaspaNetworkIdSchema
networkProfileRef?
string = ...
outputs?
object[] = ...
parents?
string[] = ...
planId?
string = ...
plannerAuthority?
"KASPA_WASM_GENERATOR" | "SYNTHETIC_SIMULATOR" = ...
plannerAuthorityDetail?
string = ...
policyRef?
string = ...
policyRefs?
string[] = ...
rpcUrl?
string = ...
schema?
"hardkas.txPlan" = ...
schemaVersion?
string = ...
scriptCapabilities?
("p2pk" | "multisig" | "timelock" | "covenant-experimental" | "silverscript-experimental" | "tockata-experimental")[] = ...
scriptMetadata?
{ consensusImpact?: "experimental" | "none"; experimental?: boolean; language?: "native" | "silverscript" | "tockata"; notes?: string[]; version?: string; } = ...
scriptMetadata.consensusImpact?
"experimental" | "none" = ...
scriptMetadata.experimental?
boolean = ...
scriptMetadata.language?
"native" | "silverscript" | "tockata" = ...
scriptMetadata.notes?
string[] = ...
scriptMetadata.version?
string = ...
scriptProfile?
"experimental" | "standard" = ...
storageMass?
string = ...
to?
{ accountName?: string; address?: string; input?: string; } = AccountRefSchema
to.accountName?
string = ...
to.address?
string = ...
to.input?
string = ...
txVersion?
0 | 1 = ...
version?
"1.0.0-alpha" = ...
workflowId?
string = ...
txId
string
ctx
RuntimeContext
extra?
confirmedAt?
string
createdUtxoIds?
string[]
daaScore?
string
dagContext?
{ acceptedTxIds?: string[]; branchId?: string; conflictSet?: object[]; displacedTxIds?: string[]; mode?: "linear" | "dag-light"; nonSelectedContext?: boolean; selectedParent?: string; sink?: string; }
dagContext.acceptedTxIds?
string[] = ...
dagContext.branchId?
string = ...
dagContext.conflictSet?
object[] = ...
dagContext.displacedTxIds?
string[] = ...
dagContext.mode?
"linear" | "dag-light" = ...
dagContext.nonSelectedContext?
boolean = ...
dagContext.selectedParent?
string = ...
dagContext.sink?
string = ...
parentArtifact?
{ contentHash: string; lineage?: any; }
parentArtifact.contentHash
string
parentArtifact.lineage?
any
postStateHash?
string
preStateHash?
string
rpcUrl?
string
sourceSignedId?
string
spentUtxoIds?
string[]
submittedAt?
string
tracePath?
string
Returns
object
amountSompi?
optionalamountSompi?:string
assumptionLevel?
optionalassumptionLevel?:string
changeSompi?
optionalchangeSompi?:string
computeBudget?
optionalcomputeBudget?:string
confirmedAt?
optionalconfirmedAt?:string
contentHash?
optionalcontentHash?:string
createdAt?
optionalcreatedAt?:string
createdUtxoIds?
optionalcreatedUtxoIds?:string[]
daaScore?
optionaldaaScore?:string
dagContext?
optionaldagContext?:object
dagContext.acceptedTxIds?
optionalacceptedTxIds?:string[]
dagContext.branchId?
optionalbranchId?:string
dagContext.conflictSet?
optionalconflictSet?:object[]
dagContext.displacedTxIds?
optionaldisplacedTxIds?:string[]
dagContext.mode?
optionalmode?:"linear"|"dag-light"
dagContext.nonSelectedContext?
optionalnonSelectedContext?:boolean
dagContext.selectedParent?
optionalselectedParent?:string
dagContext.sink?
optionalsink?:string
errors?
optionalerrors?:string[]
execution?
optionalexecution?:object=executionTargetSchema
execution.domain?
optionaldomain?:"kaspa-l1"|"evm-l2"
execution.mode?
optionalmode?:"rpc"|"simulator"|"localnet"|"l2-rpc"
execution.network?
optionalnetwork?:string
feeSompi?
optionalfeeSompi?:string
from?
optionalfrom?:object=AccountRefSchema
from.accountName?
optionalaccountName?:string
from.address?
optionaladdress?:string
from.input?
optionalinput?:string
hardkasVersion?
optionalhardkasVersion?:string
hashVersion?
optionalhashVersion?:string|number
lane?
optionallane?:string
lineage?
optionallineage?:object
lineage.artifactId?
optionalartifactId?:string
lineage.lineageId?
optionallineageId?:string
lineage.parentArtifactId?
optionalparentArtifactId?:string
lineage.rootArtifactId?
optionalrootArtifactId?:string
lineage.sequence?
optionalsequence?:number
lineageDepth?
optionallineageDepth?:number
mass?
optionalmass?:string
metadata?
optionalmetadata?:any
mode?
optionalmode?:"rpc"|"simulator"|"localnet"=executionModeSchema
networkId?
optionalnetworkId?:"simnet"|"mainnet"|"testnet-10"|"testnet-11"|"testnet-12"|"simnet-1"|"devnet"|"simulated"|"igra"=kaspaNetworkIdSchema
parents?
optionalparents?:string[]
postStateHash?
optionalpostStateHash?:string
preStateHash?
optionalpreStateHash?:string
rpcUrl?
optionalrpcUrl?:string
schema?
optionalschema?:"hardkas.txReceipt"
schemaVersion?
optionalschemaVersion?:string
scriptCapabilities?
optionalscriptCapabilities?: ("p2pk"|"multisig"|"timelock"|"covenant-experimental"|"silverscript-experimental"|"tockata-experimental")[]
scriptMetadata?
optionalscriptMetadata?:object
scriptMetadata.consensusImpact?
optionalconsensusImpact?:"experimental"|"none"
scriptMetadata.experimental?
optionalexperimental?:boolean
scriptMetadata.language?
optionallanguage?:"native"|"silverscript"|"tockata"