loadContractCodeForWasmId

Loads the contract code entry (including WASM bytecode) for a given WASM ID.

This method fetches the contract code from the ledger by its hash (WASM ID). The WASM ID is typically obtained from the transaction response after uploading a contract.

Example

val wasmId = "abc123..."  // Hex-encoded hash
val codeEntry = server.loadContractCodeForWasmId(wasmId)
codeEntry?.let {
println("Contract code size: ${it.code.dataValue.size} bytes")
}

Return

The contract code entry if found, null otherwise

Parameters

wasmId

The contract WASM ID as a hex-encoded hash string

See also

Throws

If the RPC request fails

If wasmId is not a valid hex string