# @integraledger/lcp/x402-batch-settlement

> The exports of @integraledger/lcp/x402-batch-settlement.

Source: https://lcp.integraledger.com/reference/api/x402-batch-settlement

## Interfaces

### BatchEvmOpen

#### Extends

* [`X402Choice`](https://lcp.integraledger.com/reference/api/x402#x402choice)

#### Properties

| Property           | Type                                                             | Inherited from                                                                                     |
| ------------------ | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|  `accepted`        | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402#paymentrequirements) | [`X402Choice`](https://lcp.integraledger.com/reference/api/x402#x402choice).[`accepted`](https://lcp.integraledger.com/reference/api/x402#property-accepted) |
|  `authSalt`        | `` `0x${string}` ``                                              | -                                                                                                  |
|  `deposit`         | `bigint`                                                         | -                                                                                                  |
|  `from`            | `` `0x${string}` ``                                              | [`X402Choice`](https://lcp.integraledger.com/reference/api/x402#x402choice).[`from`](https://lcp.integraledger.com/reference/api/x402#property-from)         |
|  `now`             | `number`                                                         | [`X402Choice`](https://lcp.integraledger.com/reference/api/x402#x402choice).[`now`](https://lcp.integraledger.com/reference/api/x402#property-now)           |
|  `payerAuthorizer` | `` `0x${string}` ``                                              | -                                                                                                  |
|  `required`        | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402#paymentrequired)         | [`X402Choice`](https://lcp.integraledger.com/reference/api/x402#x402choice).[`required`](https://lcp.integraledger.com/reference/api/x402#property-required) |

***

### BatchPaymentPayload

#### Properties

| Property       | Type                                                             |
| -------------- | ---------------------------------------------------------------- |
|  `accepted`    | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402#paymentrequirements) |
|  `extensions?` | `object`                                                         |
|  `payload`     | `object`                                                         |
| `payload.type` | `string`                                                         |
|  `resource?`   | `object`                                                         |
| `resource.url` | `string`                                                         |
|  `x402Version` | `2`                                                              |

***

### BatchSvmOpen

#### Properties

| Property             | Type                                                             |
| -------------------- | ---------------------------------------------------------------- |
|  `accepted`          | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402#paymentrequirements) |
|  `computeUnitLimit?` | `number`                                                         |
|  `computeUnitPrice?` | `bigint`                                                         |
|  `deposit`           | `bigint`                                                         |
|  `openSlot`          | `bigint`                                                         |
|  `payer`             | `string`                                                         |
|  `payerAuthorizer`   | `string`                                                         |
|  `recentBlockhash`   | `string`                                                         |
|  `required`          | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402#paymentrequired)         |
|  `salt`              | `bigint`                                                         |
|  `tokenProgram`      | `string`                                                         |

***

### BatchUnsigned

Several signing requests, signed in order. `complete` takes one signature per request: `0x` hex for `eip712`,
base58 for `solana-message` and `ed25519-raw`.

#### Properties

| Property    | Type                                            |
| ----------- | ----------------------------------------------- |
|  `requests` | readonly [`SigningRequest`](#signingrequest)\[] |

#### Methods

##### complete()

> **complete**(`signatures`): [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`BatchPaymentPayload`](#batchpaymentpayload)

###### Parameters

| Parameter    | Type                 |
| ------------ | -------------------- |
| `signatures` | readonly `string`\[] |

###### Returns

[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`BatchPaymentPayload`](#batchpaymentpayload)

***

### BatchWithin

#### Properties

| Property              | Type                                                             | Description                                                                                                        |
| --------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
|  `accepted`           | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402#paymentrequirements) | -                                                                                                                  |
|  `channelConfig`      | [`Json`](https://lcp.integraledger.com/reference/api#json)                                    | Exactly as sent at the opening.                                                                                    |
|  `computeUnitLimit?`  | `number`                                                         | SVM refund: the Compute Budget values, 200 000 units and 1 microlamport when absent.                               |
|  `computeUnitPrice?`  | `bigint`                                                         | -                                                                                                                  |
|  `maxClaimableAmount` | `bigint`                                                         | -                                                                                                                  |
|  `recentBlockhash?`   | `string`                                                         | SVM refund: the blockhash to use when the option carries no `extra.recentBlockhash`.                               |
|  `refund?`            | `object`                                                         | A refund. EVM: its amount, absent for a full refund. SVM: `{}`, a full refund whose `request_close` is built here. |
| `refund.amount?`      | `bigint`                                                         | -                                                                                                                  |
|  `required`           | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402#paymentrequired)         | -                                                                                                                  |

***

### ChannelConfig

#### Properties

| Property              | Type                | Description             |
| --------------------- | ------------------- | ----------------------- |
|  `payer`              | `` `0x${string}` `` | -                       |
|  `payerAuthorizer`    | `` `0x${string}` `` | -                       |
|  `receiver`           | `` `0x${string}` `` | -                       |
|  `receiverAuthorizer` | `` `0x${string}` `` | -                       |
|  `salt`               | `` `0x${string}` `` | `0x` and 64 hex digits. |
|  `token`              | `` `0x${string}` `` | -                       |
|  `withdrawDelay`      | `number`            | -                       |

***

### ChannelMembers

#### Properties

| Property              | Type                                                                                              |
| --------------------- | ------------------------------------------------------------------------------------------------- |
|  `channel`            | `object`                                                                                          |
| `channel.boundWithin` | `Promise`\<`` `0x${string}` `` \| [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)>                            |
| `channel.kind`        | `"open"` \| `"close"` \| [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) \| `"within"`                        |
| `channel.ref`         | `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) \| \{ `channel`: `string`; `network`: `string`; }> |
| `channel.until`       | `number` \| `undefined`                                                                           |

***

### CloudflarePaymentPayload

The request's payment document: the option's amount and asset, with the challenge's `extensions` echoed.

#### Properties

| Property         | Type                                                             |
| ---------------- | ---------------------------------------------------------------- |
|  `accepted`      | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402#paymentrequirements) |
|  `extensions`    | `object`                                                         |
|  `payload`       | `object`                                                         |
| `payload.amount` | `string`                                                         |
| `payload.asset`  | `string`                                                         |
|  `x402Version`   | `2`                                                              |

***

### Eip712Request

An EIP-712 request for the buyer's signer; numbers in `message` are decimal strings.

#### Properties

| Property                   | Type                |
| -------------------------- | ------------------- |
|  `domain`                  | `object`            |
| `domain.chainId`           | `number`            |
| `domain.name`              | `string`            |
| `domain.verifyingContract` | `` `0x${string}` `` |
| `domain.version?`          | `string`            |
|  `message`                 | `object`            |
|  `primaryType`             | `string`            |
|  `types`                   | `object`            |

## Type Aliases

### BatchPairingId

> **BatchPairingId** = *typeof* `EVM_ID` | *typeof* `SVM_ID` | *typeof* `CF_ID`

***

### SigningRequest

> **SigningRequest** = \{ `kind`: `"eip712"`; `typedData`: [`Eip712Request`](#eip712request) | [`ReceiveTypedData`](https://lcp.integraledger.com/reference/api/evm#receivetypeddata) | [`Permit2TypedData`](https://lcp.integraledger.com/reference/api/evm#permit2typeddata); } | \{ `kind`: `"solana-message"`; `message`: `Uint8Array`; } | \{ `kind`: `"ed25519-raw"`; `message`: `Uint8Array`; `signer`: `string`; }

A request to the buyer's signer.

## Variables

### BATCH\_SETTLEMENT

> `const` **BATCH\_SETTLEMENT**: `"0x4020074e9dF2ce1deE5A9C1b5c3f541D02a10003"`

***

### batchCloudflare

> `const` **batchCloudflare**: `Readonly`\<\{ `advertise`: [`X402Advertise`](https://lcp.integraledger.com/reference/api/x402#x402advertise); `bound`: (`presented`) => `Promise`\<`` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)>; `build`: (`c`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`CloudflarePaymentPayload`](#cloudflarepaymentpayload)>; `claims`: `boolean`; `id`: `"x402/batch-settlement/cloudflare"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`X402Read`](https://lcp.integraledger.com/reference/api/x402#x402read); `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402#paymentrequirements)\[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402#requestcommitment); }]; `unplaced`: (`option`) => [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402#paymentrequirements); }>

***

### batchEvm

> `const` **batchEvm**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402#paymentrequired); `bound`: (`presented`) => `Promise`\<`` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)>; `build`: (`c`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`BatchUnsigned`](#batchunsigned)>; `buildWithin`: (`w`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`BatchUnsigned`](#batchunsigned)>; `channel`: `Readonly`\<\{ `boundWithin`: (`presented`) => `Promise`\<`` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)>; `kind`: (`p`) => `"open"` | `"close"` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | `"within"`; `ref`: (`p`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | \{ `channel`: `string`; `network`: `string`; }>; `until`: (`_p`) => `number` | `undefined`; }>; `claims`: `boolean`; `id`: `"x402/batch-settlement/eip155"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`X402Read`](https://lcp.integraledger.com/reference/api/x402#x402read); `recover`: (`ref`, `reader`) => `Promise`\<`` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)>; `reference`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`EvmRef`](https://lcp.integraledger.com/reference/api/evm#evmref)>; `status`: (`ref`, `reader`) => `Promise`\<[`EvmBreadthStatus`](https://lcp.integraledger.com/reference/api/evm#evmbreadthstatus)>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402#paymentrequirements)\[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402#requestcommitment); }]; `unplaced`: (`option`) => [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402#paymentrequirements); }>

***

### batchSvm

> `const` **batchSvm**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402#paymentrequired); `bound`: (`presented`) => `Promise`\<`` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)>; `build`: (`c`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`BatchUnsigned`](#batchunsigned)>; `buildWithin`: (`w`, `_h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`BatchUnsigned`](#batchunsigned)>; `carrier`: `"extra.memo"`; `channel`: `Readonly`\<\{ `boundWithin`: (`_p`) => `Promise`\<`` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)>; `kind`: (`p`) => `"open"` | `"close"` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | `"within"`; `ref`: (`p`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | \{ `channel`: `string`; `network`: `string`; }>; `until`: (`_p`) => `number` | `undefined`; }>; `claims`: `boolean`; `id`: `"x402/batch-settlement/solana"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`X402Read`](https://lcp.integraledger.com/reference/api/x402#x402read); `recover`: (`ref`, `reader`) => `Promise`\<`` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)>; `reference`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | `Omit`\<[`SvmRef`](https://lcp.integraledger.com/reference/api/svm#svmref), `"fromSlot"`>>; `status`: (`ref`, `reader`) => `Promise`\<[`ChannelStatus`](https://lcp.integraledger.com/reference/api/svm#channelstatus)>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402#paymentrequirements)\[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402#requestcommitment); }]; `unplaced`: (`option`) => [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402#paymentrequirements); }>

***

### CHANNEL\_CONFIG\_TYPEHASH

> `const` **CHANNEL\_CONFIG\_TYPEHASH**: `"0x1c9a06ceab9b0ebbd3301dc56c9111bb6d9af421356dc9ccb3b7084c755db308"`

***

### CHANNEL\_CREATED\_TOPIC

> `const` **CHANNEL\_CREATED\_TOPIC**: `"0x69d8248d5566bdb2ebc4d218970710d8378a2ff9b709a999e052b71970f808fa"`

***

### DEPOSITED\_TOPIC

> `const` **DEPOSITED\_TOPIC**: `"0x6c2a09353b5e75e70d0b9778b80a413809bb235d46c211811c474b3346791d89"`

***

### ERC3009\_DEPOSIT\_COLLECTOR

> `const` **ERC3009\_DEPOSIT\_COLLECTOR**: `"0x4020806089470a89826cB9fB1f4059150b550004"`

***

### PERMIT2\_DEPOSIT\_COLLECTOR

> `const` **PERMIT2\_DEPOSIT\_COLLECTOR**: `"0x4020425FAf3B746C082C2f942b4E5159887B0005"`

***

### VOUCHER\_TYPEHASH

> `const` **VOUCHER\_TYPEHASH**: `"0x1e1bd6ff84c3e0d9029a292b212e039c0ca97ec497c55191a4a5874294609a69"`

## Functions

### batchChannelCreated()

> **batchChannelCreated**(`log`, `chainId`): [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | \{ `channelId`: `` `0x${string}` ``; `config`: [`ChannelConfig`](#channelconfig); }

The config and id of a `ChannelCreated(channelId, config)` log, the id recomputed from the 7-word data.

#### Parameters

| Parameter | Type                                  |
| --------- | ------------------------------------- |
| `log`     | [`EvmLog`](https://lcp.integraledger.com/reference/api/evm#evmlog) |
| `chainId` | `number`                              |

#### Returns

[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | \{ `channelId`: `` `0x${string}` ``; `config`: [`ChannelConfig`](#channelconfig); }

***

### batchChannelId()

> **batchChannelId**(`chainId`, `c`): `` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)

The channel id: the EIP-712 digest of the configuration under the `x402 Batch Settlement` domain.

#### Parameters

| Parameter | Type                              |
| --------- | --------------------------------- |
| `chainId` | `number`                          |
| `c`       | [`ChannelConfig`](#channelconfig) |

#### Returns

`` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)

***

### erc3009DepositNonce()

> **erc3009DepositNonce**(`channelId`, `authSalt`): `` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)

The ERC-3009 deposit's nonce: keccak256(abi.encode(bytes32 channelId, uint256 authSalt)).

#### Parameters

| Parameter   | Type                |
| ----------- | ------------------- |
| `channelId` | `` `0x${string}` `` |
| `authSalt`  | `` `0x${string}` `` |

#### Returns

`` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)

***

### pairingOf()

> **pairingOf**(`option`): [`BatchPairingId`](#batchpairingid) | `undefined`

The batch-settlement pairing an option names, or undefined.

#### Parameters

| Parameter | Type                                                             |
| --------- | ---------------------------------------------------------------- |
| `option`  | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402#paymentrequirements) |

#### Returns

[`BatchPairingId`](#batchpairingid) | `undefined`
