# queryGlobalStateByBlockHash

Queries a value from global state at a specific block, identified by hash.

## Import

```ts
import { RpcClient, HttpHandler } from 'casper-js-sdk';
```

## Usage

```ts
const result = await rpcClient.queryGlobalStateByBlockHash(
  'abc123...',
  'hash-contract-abc...',
  ['total_supply']
);

const clValue = CLValueParser.fromJSON(result.storedValue.clValue);
```

## Parameters

### blockHash

- **Type:** `string`

Block hash as a hex string.

### key

- **Type:** `string`

The global state key to query. Formats:
- `hash-{hex}` - contract or package hash
- `account-hash-{hex}` - account
- `uref-{hex}-{octal}` - URef

### path

- **Type:** `string[]`

Storage path to traverse from the key. Use `[]` for the root value.

## Return Value

`Promise<QueryGlobalStateResult>`

```ts
interface QueryGlobalStateResult {
  storedValue: StoredValue;
  blockHeader: BlockHeader;
}
```

## Related

- [`queryLatestGlobalState`](/actions/state/queryLatestGlobalState)
- [`queryGlobalStateByBlockHeight`](/actions/state/queryGlobalStateByBlockHeight)
- [`queryGlobalStateByStateHash`](/actions/state/queryGlobalStateByStateHash)
