# RpcSchema.from

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`](/api/Provider/from) or [`RpcTransport.fromHttp`](/api/RpcTransport/fromHttp).

## Imports

:::code-group

```ts [Named]
import { RpcSchema } from 'ox'
```

```ts [Entrypoint]
import * as RpcSchema from 'ox/RpcSchema'
```

:::

## Examples

### Using with `Provider.from`

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

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
```

**Source:** [src/core/RpcSchema.ts](https://github.com/wevm/ox/blob/main/src/core/RpcSchema.ts#L307)

## Return Type

`schema`
