# ContractStateProvider

> For the complete documentation index, see [llms.txt](https://docs.midnight.network/llms.txt)

[**@midnight-ntwrk/compact-runtime v0.21.0**](https://docs.midnight.network/api-reference/compact-runtime.md)

***

[@midnight-ntwrk/compact-runtime](https://docs.midnight.network/api-reference/compact-runtime/globals.md) / ContractStateProvider

# Interface: ContractStateProvider

A user-provided fetch of a contract's public state at a block hash, used only for cross-contract call targets. The state returned must be post-block-evaluation; `blockHash` is the `parentBlockHash` from the circuit context.

## Methods[​](#methods "Direct link to Methods")

### getContractState()[​](#getcontractstate "Direct link to getContractState()")

```
getContractState(blockHash, address): Promise<ContractState | undefined>;
```

#### Parameters[​](#parameters "Direct link to Parameters")

##### blockHash[​](#blockhash "Direct link to blockHash")

`string`

##### address[​](#address "Direct link to address")

`string`

#### Returns[​](#returns "Direct link to Returns")

`Promise`<[`ContractState`](https://docs.midnight.network/api-reference/compact-runtime/classes/ContractState.md) | `undefined`>
