class
ContractId
extendsKey
An ID type that represents a contract on a Hedera Hashgraph network.
Construct a ContractId
with shard
and realm
being zero.
Construct a ContractId
with all fields explicitly set.
fromBytes
( data
: bytes
): ContractId
Deserialize a ContractId
from its protobuf representation.
fromEvmAddress
( shard
: Uint64
, realm
: Uint64
, evmAddress
: string
): ContractId
Construct a ContractId
from a shard, realm, and evm address.
fromSolidityAddress
( str
: String
): ContractId
Construct a ContractId
a solidity address.
Deprecated: Use fromEvmAddress()
instead.
fromString
( str
: String
): ContractId
Construct a ContractId
from a string. The format of the string could be either just
a number "4" or dot separated numbers "0.0.4".
Serialize the ContractId
into its protobuf representation.
Serialize the ContractId
into a string form which follows {shard}.{realm}.{num}
if evmAddress
is not present
and {shard}.{realm}.{evmAddress}
if evmAddress
is present.
Serialize the ContractId
into its solidity address form.
The evm address of this contract.
Note: This field is only set when fromEvmAddress()
is used. fromSolidityAddress()
does not populate this field
The num of this ID.
The realm of this ID.
The shard of this ID.