# CircuitContextOptions

> 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) / CircuitContextOptions

# Type Alias: CircuitContextOptions\<PS>

```
type CircuitContextOptions<PS> = {

  circuitId: CircuitId;

  coinPublicKeyOrZswapState:   | CoinPublicKey

     | EncodedCoinPublicKey

     | ZswapLocalState

     | EncodedZswapLocalState;

  contractAddress: ContractAddress;

  contractState:   | ContractState

     | StateValue

     | ChargedState;

  costModel?: CostModel;

  crossContract?: CrossContractInputs;

  gasLimit?: RunningCost;

  parentBlockHash?: string;

  privateState: PS;

  time?: number;

};
```

The inputs to [createCircuitContext](https://docs.midnight.network/api-reference/compact-runtime/functions/createCircuitContext.md).

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

### PS[​](#ps "Direct link to PS")

`PS` = `any`

## Properties[​](#properties "Direct link to Properties")

### circuitId[​](#circuitid "Direct link to circuitId")

```
readonly circuitId: CircuitId;
```

The name of the circuit being executed.

***

### coinPublicKeyOrZswapState[​](#coinpublickeyorzswapstate "Direct link to coinPublicKeyOrZswapState")

```
readonly coinPublicKeyOrZswapState: 

  | CoinPublicKey

  | EncodedCoinPublicKey

  | ZswapLocalState

  | EncodedZswapLocalState;
```

The initial Zswap local state, for tracking shielded coin transfers.

***

### contractAddress[​](#contractaddress "Direct link to contractAddress")

```
readonly contractAddress: ContractAddress;
```

The address of the contract defining the circuit being executed.

***

### contractState[​](#contractstate "Direct link to contractState")

```
readonly contractState: 

  | ContractState

  | StateValue

  | ChargedState;
```

The ledger state to execute against — most often a snapshot fetched from the chain.

***

### costModel?[​](#costmodel "Direct link to costModel?")

```
readonly optional costModel: CostModel;
```

The model capturing how much ledger operations cost.

***

### crossContract?[​](#crosscontract "Direct link to crossContract?")

```
readonly optional crossContract: CrossContractInputs;
```

Present exactly when this execution may make cross-contract calls.

***

### gasLimit?[​](#gaslimit "Direct link to gasLimit?")

```
readonly optional gasLimit: RunningCost;
```

The maximum gas this contract should consume.

***

### parentBlockHash?[​](#parentblockhash "Direct link to parentBlockHash?")

```
readonly optional parentBlockHash: string;
```

The hash of the block this transaction is built on. Reaches the VM's block context, and pins the block a cross-contract callee's state is fetched at.

***

### privateState[​](#privatestate "Direct link to privateState")

```
readonly privateState: PS;
```

The witness / private state — most often a snapshot from local storage.

***

### time?[​](#time "Direct link to time?")

```
readonly optional time: number;
```

The current time, for the block-time kernel operations. Defaults to now.
