Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.01 KB

ContractBytecodeQuery.md

File metadata and controls

53 lines (37 loc) · 1.01 KB

class ContractByteCodeQuery extends Query < bytes >

Retrieve the latest state of a bytecode.

** Java **

var bytecode = new ContractByteCodeQuery()
    .setNodeAccountIds(Collections.singletonList(response.nodeId))
    .setContractId(contractId)
    .execute(client);

** JavaScript **

const bytecode = await new ContractByteCodeQuery()
    .setNodeAccountIds([response.nodeId])
    .setContractId(contract)
    .setQueryPayment(new Hbar(2))
    .execute(client);

** Go **

bytecode, err := hedera.NewContractBytecodeQuery().
    SetNodeAccountIDs([]AccountID{resp.NodeID}).
    SetContractID(contractID).
    SetQueryPayment(NewHbar(2)).
    Execute(client)
if err != nil {
    println(err.Error())
}

Constructor

constructor()

Properties

contractId : ContractId

This is the contract ID which bytecode will be queried for.