# Context (env)

> NeuroWASM context host functions — caller identity, block height, balances and historical stake for flash-stake-resistant voting — and the planned context functions.

Source: https://docs.nro.world/neurowasm/context

Authoritative identity and chain context. **Never** take caller / height / stake from user JSON.

## `get_caller` <Badge type="tip" text="live" />

```text
get_caller(out_ptr, out_max) → i32
```

Immediate caller (EVM `msg.sender`): TX signer at root; parent contract for nested `call_contract`. Empty outside real TX context.

**Analogs:** CosmWasm `info.sender`, NEAR `predecessor_account_id`.

## `get_self_addr` <Badge type="info" text="planned" />

This contract’s `.app` address (`current_account`).

## `get_signer` <Badge type="info" text="planned" />

Root TX signer (differs from caller under nested CPI).

## `get_block_height` <Badge type="tip" text="live" />

```text
get_block_height() → i64
```

Host height for this TX (`0` outside TX context). For timelocks / voting periods.

## `get_block_time` <Badge type="info" text="planned" />

Unix timestamp (ms/ns — named const). Deterministic per block.

## `get_shard_id` <Badge type="info" text="planned" />

Shard id for this execution.

## `get_attached_deposit` <Badge type="info" text="planned" />

uNRO attached by predecessor.

## `get_balance` <Badge type="tip" text="live" />

```text
get_balance(addr_ptr, addr_len) → i64
```

Native balance (uNRO) from host snapshot (includes in-call transfer simulation). `-1` on error.

## `gas_remaining` <Badge type="info" text="planned" />

Remaining fuel for this call.

## `get_stake` <Badge type="tip" text="live" />

```text
get_stake(addr_ptr, addr_len) → i64
```

Current self-stake (uNRO). Host may preload `stake:{addr}`.

## `get_stake_at` <Badge type="tip" text="live" />

```text
get_stake_at(addr_ptr, addr_len, height: i64) → i64
```

Historical self-stake at-or-before `height` (flash-stake resistant voting). `0` if no history / dispatcher.
