loadContractCodeForContractId

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

This method:

  1. Fetches the contract instance to get the WASM hash

  2. Fetches the contract code using the WASM hash

Example

val contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5"
val codeEntry = server.loadContractCodeForContractId(contractId)
codeEntry?.let {
println("Contract code size: ${it.code.dataValue.size} bytes")
}

Return

The contract code entry if found, null otherwise

Parameters

contractId

The contract address (C... format)

See also

Throws

If the RPC request fails

If contractId is not a valid contract address