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

# RpcSchema.from

:::info
`RpcSchema.from` is a re-export of ox's [`RpcSchema.from`](https://oxlib.sh/api/RpcSchema/from). Refer to the ox documentation for the full reference.
:::

Instantiates a statically typed Schema. This is a runtime-noop function, and is purposed to be used as a type-level tag to be used with [`Provider.from`](/docs/utilities/provider/from) or [`RpcTransport.fromHttp`](https://oxlib.sh/api/RpcTransport/fromHttp).

## Imports

```ts
import { RpcSchema } from 'viem/utils'
```

## Examples

### Using with `Provider.from`

```ts twoslash
// @noErrors
import 'ox/window'
import { Provider, RpcSchema } from 'viem/utils'

const schema = RpcSchema.from<
  | RpcSchema.Default
  | {
      Request: {
        method: 'abe_foo'
        params: [id: number]
      }
      ReturnType: string
    }
  | {
      Request: {
        method: 'abe_bar'
        params: [id: string]
      }
      ReturnType: string
    }
>()

const provider = Provider.from(window.ethereum, { schema })

const blockNumber = await provider.request({ method: 'e' })
//                                                    ^|
```

## Definition

```ts
function from<schema>(): schema
```

## Return Type

`schema`
