> ## Documentation Index
> Fetch the complete documentation index at: https://docs.faremeter.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Facilitator Types

> Type definitions for facilitator handlers and requirements

# facilitator

## Interfaces

### FacilitatorHandler

Defined in: [packages/types/src/facilitator.ts:27](https://github.com/faremeter/faremeter/blob/main/packages/types/src/facilitator.ts#L27)

Handler interface implemented by payment scheme facilitators.

Each method returns null when the request doesn't match the handler's
payment scheme, allowing multiple handlers to be composed.

#### Properties

##### capabilities?

> `optional` **capabilities**: [`HandlerCapabilities`](types.src.Namespace.pricing#handlercapabilities)

Defined in: [packages/types/src/facilitator.ts:29](https://github.com/faremeter/faremeter/blob/main/packages/types/src/facilitator.ts#L29)

Declares what this handler can settle. Required for in-process usage.

##### getRequirements()

> **getRequirements**: (`args`) => `Promise`\<`object`\[]>

Defined in: [packages/types/src/facilitator.ts:41](https://github.com/faremeter/faremeter/blob/main/packages/types/src/facilitator.ts#L41)

Filters and enriches payment requirements this handler can process

###### Parameters

###### args

[`GetRequirementsArgs`](#getrequirementsargs)

###### Returns

`Promise`\<`object`\[]>

##### getSigners()?

> `optional` **getSigners**: () => `Promise`\<`Record`\<`string`, `string`\[]>>

Defined in: [packages/types/src/facilitator.ts:55](https://github.com/faremeter/faremeter/blob/main/packages/types/src/facilitator.ts#L55)

Returns signer addresses organized by network (optional)

###### Returns

`Promise`\<`Record`\<`string`, `string`\[]>>

##### getSupported()?

> `optional` **getSupported**: () => `Promise`\<\{ `extra?`: `object`; `network`: `string`; `scheme`: `string`; `x402Version`: `2`; }>\[]

Defined in: [packages/types/src/facilitator.ts:39](https://github.com/faremeter/faremeter/blob/main/packages/types/src/facilitator.ts#L39)

Returns the payment schemes this handler supports

###### Returns

`Promise`\<\{ `extra?`: `object`; `network`: `string`; `scheme`: `string`; `x402Version`: `2`; }>\[]

##### handleSettle()

> **handleSettle**: (`requirements`, `payment`) => `Promise`\<`null` | \{ `errorReason?`: `string`; `extensions?`: `object`; `network`: `string`; `payer?`: `string`; `success`: `boolean`; `transaction`: `string`; }>

Defined in: [packages/types/src/facilitator.ts:50](https://github.com/faremeter/faremeter/blob/main/packages/types/src/facilitator.ts#L50)

Settles a payment by executing the on-chain transaction

###### Parameters

###### requirements

###### amount

`string` = `"string.numeric"`

###### asset

`string` = `"string"`

###### extra?

`object` = `"object"`

###### maxTimeoutSeconds

`number` = `"number.integer"`

###### network

`string` = `"string"`

###### payTo

`string` = `"string"`

###### scheme

`string` = `"string"`

###### payment

###### accepted

\{ `amount`: `string`; `asset`: `string`; `extra?`: `object`; `maxTimeoutSeconds`: `number`; `network`: `string`; `payTo`: `string`; `scheme`: `string`; } = `x402PaymentRequirements`

###### accepted.amount

`string` = `"string.numeric"`

###### accepted.asset

`string` = `"string"`

###### accepted.extra?

`object` = `"object"`

###### accepted.maxTimeoutSeconds

`number` = `"number.integer"`

###### accepted.network

`string` = `"string"`

###### accepted.payTo

`string` = `"string"`

###### accepted.scheme

`string` = `"string"`

###### extensions?

`object` = `"object"`

###### payload

`object` = `"object"`

###### resource?

\{ `description?`: `string`; `mimeType?`: `string`; `url`: `string`; } = `x402ResourceInfo`

###### resource.description?

`string` = `"string"`

###### resource.mimeType?

`string` = `"string"`

###### resource.url

`string` = `"string"`

###### x402Version

`2` = `"2"`

###### Returns

`Promise`\<`null` | \{ `errorReason?`: `string`; `extensions?`: `object`; `network`: `string`; `payer?`: `string`; `success`: `boolean`; `transaction`: `string`; }>

##### handleVerify()?

> `optional` **handleVerify**: (`requirements`, `payment`) => `Promise`\<`null` | \{ `invalidReason?`: `string`; `isValid`: `boolean`; `payer?`: `string`; }>

Defined in: [packages/types/src/facilitator.ts:45](https://github.com/faremeter/faremeter/blob/main/packages/types/src/facilitator.ts#L45)

Verifies a payment without settling it (optional)

###### Parameters

###### requirements

###### amount

`string` = `"string.numeric"`

###### asset

`string` = `"string"`

###### extra?

`object` = `"object"`

###### maxTimeoutSeconds

`number` = `"number.integer"`

###### network

`string` = `"string"`

###### payTo

`string` = `"string"`

###### scheme

`string` = `"string"`

###### payment

###### accepted

\{ `amount`: `string`; `asset`: `string`; `extra?`: `object`; `maxTimeoutSeconds`: `number`; `network`: `string`; `payTo`: `string`; `scheme`: `string`; } = `x402PaymentRequirements`

###### accepted.amount

`string` = `"string.numeric"`

###### accepted.asset

`string` = `"string"`

###### accepted.extra?

`object` = `"object"`

###### accepted.maxTimeoutSeconds

`number` = `"number.integer"`

###### accepted.network

`string` = `"string"`

###### accepted.payTo

`string` = `"string"`

###### accepted.scheme

`string` = `"string"`

###### extensions?

`object` = `"object"`

###### payload

`object` = `"object"`

###### resource?

\{ `description?`: `string`; `mimeType?`: `string`; `url`: `string`; } = `x402ResourceInfo`

###### resource.description?

`string` = `"string"`

###### resource.mimeType?

`string` = `"string"`

###### resource.url

`string` = `"string"`

###### x402Version

`2` = `"2"`

###### Returns

`Promise`\<`null` | \{ `invalidReason?`: `string`; `isValid`: `boolean`; `payer?`: `string`; }>

##### schemes?

> `optional` **schemes**: `string`\[]

Defined in: [packages/types/src/facilitator.ts:37](https://github.com/faremeter/faremeter/blob/main/packages/types/src/facilitator.ts#L37)

x402 schemes this handler can settle. Required for in-process
resolution; handlers without it are skipped by the middleware's
dispatch path. Distinct from [getSupported](#getsupported), which exists for
the facilitator `/supported` HTTP route and may fan out to remote
backends with per-kind timeouts.

***

### GetRequirementsArgs

Defined in: [packages/types/src/facilitator.ts:14](https://github.com/faremeter/faremeter/blob/main/packages/types/src/facilitator.ts#L14)

Arguments passed to the facilitator's getRequirements method.

#### Properties

##### accepts

> **accepts**: `object`\[]

Defined in: [packages/types/src/facilitator.ts:16](https://github.com/faremeter/faremeter/blob/main/packages/types/src/facilitator.ts#L16)

Payment requirements the server is willing to accept

###### amount

> **amount**: `string` = `"string.numeric"`

###### asset

> **asset**: `string` = `"string"`

###### extra?

> `optional` **extra**: `object` = `"object"`

###### maxTimeoutSeconds

> **maxTimeoutSeconds**: `number` = `"number.integer"`

###### network

> **network**: `string` = `"string"`

###### payTo

> **payTo**: `string` = `"string"`

###### scheme

> **scheme**: `string` = `"string"`

##### resource?

> `optional` **resource**: `object`

Defined in: [packages/types/src/facilitator.ts:18](https://github.com/faremeter/faremeter/blob/main/packages/types/src/facilitator.ts#L18)

Optional resource information for the protected content

###### description?

> `optional` **description**: `string` = `"string"`

###### mimeType?

> `optional` **mimeType**: `string` = `"string"`

###### url

> **url**: `string` = `"string"`
