load Contract Info For Contract Id
Loads contract information (Environment Meta, Contract Spec, Contract Meta) for a given contract ID.
This method:
Fetches the contract instance and code using loadContractCodeForContractId
Parses the WASM bytecode to extract contract metadata
The returned information includes:
Environment interface version (protocol version)
Contract specification entries (functions, structs, events, etc.)
Contract metadata (key-value pairs for application/tooling use)
Example
val contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5"
val contractInfo = server.loadContractInfoForContractId(contractId)
contractInfo?.let {
println("Protocol version: ${it.envInterfaceVersion}")
println("Spec entries: ${it.specEntries.size}")
println("Metadata: ${it.metaEntries}")
}Content copied to clipboard
Return
The parsed contract information if found, null if the contract doesn't exist
Parameters
contract Id
The contract address (C... format)
See also
Throws
If the RPC request fails
If the WASM bytecode cannot be parsed
If contractId is not a valid contract address