> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://sdk.railnet.org/api/mcp` to find what you need.

# grantScopedRole

Grants a scoped role on the ExternalAccessControl contract. Requires a `WalletClient`.

## Import

```ts
import { grantScopedRole } from '@railnetorg/railnet-sdk'
```

## Usage

```ts
import { createWalletClient, http } from 'viem'
import { base } from 'viem/chains'
import { grantScopedRole, VEHICLE_STEAM_DEPOSIT } from '@railnetorg/railnet-sdk'

const walletClient = createWalletClient({
  chain: base,
  transport: http(),
})

const hash = await grantScopedRole(walletClient, {
  accessControl: '0x1234...',
  role: VEHICLE_STEAM_DEPOSIT,
  scope: '0x5678...',
  grantee: '0x9012...',
  account: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
})
```

Role constants are available for import:

```ts
import { VEHICLE_STEAM_DEPOSIT, MULTI_VEHICLE_SET_QUEUES } from '@railnetorg/railnet-sdk'
```

## Returns

`Hash`

The transaction hash.

## Parameters

### accessControl

* **Type:** `Address`

The address of the ExternalAccessControl contract.

### role

* **Type:** `Hex`

The role to grant.

### scope

* **Type:** `Address`

The scope (contract address) for the role.

### grantee

* **Type:** `Address`

The address receiving the role.

### account

* **Type:** `Address`

The address of the account executing the transaction.
