Skip to main content

Environment

The environment information is accessed using mainly two APIs:

  • Runtime

Runtime

Following are the runtime specific functions provided by the SDK accessed by Runtime::

APIDescription
fn get_contract_id() -> StringProvides the contract address of the executing contract
fn get_sender() -> StringProvides the sender address. This can be either client Wallet address or contract address in case of cross-contract call
fn call_contract(contract_id: String, method_name: String, method_args: Option<String>) -> anyhow::Result<R>This is used to make a cross-contract call to other contracts. More details are given in next section