# @integraledger/agentic-connectors

> The exports of @integraledger/agentic-connectors.

Source: https://connectors.integraledger.com/reference/api/agentic-connectors

## Interfaces

### AgreementLink

Where the buyer pays the agreement step: the URL to place beside the carriers, its network, and its pairing.

#### Properties

| Property   | Type     |
| ---------- | -------- |
|  `network` | `string` |
|  `pairing` | `string` |
|  `url`     | `string` |

***

### AgreementView

The agreement step's leg of a record.

#### Properties

| Property       | Type                                         |
| -------------- | -------------------------------------------- |
|  `network`     | `string` \| `null`                           |
|  `state`       | `"required"` \| `"settling"` \| `"recorded"` |
|  `transaction` | `string` \| `null`                           |

***

### Carriers

The carrier forms of this hash and link.

#### Properties

| Property                          | Type                |
| --------------------------------- | ------------------- |
|  `lcp`                            | `string`            |
|  `legal_context`                  | `object`            |
| `legal_context.legal_context_url` | `string`            |
| `legal_context.type`              | `"sha256"`          |
| `legal_context.value`             | `` `0x${string}` `` |
|  `legalContext`                   | `object`            |
| `legalContext.legalContextUrl`    | `string`            |
| `legalContext.type`               | `"sha256"`          |
| `legalContext.value`              | `` `0x${string}` `` |

***

### ChannelView

A channel pairing's channel: `until` is the rail's deadline for the channel, or null when the rail gives none.

#### Properties

| Property   | Type               |
| ---------- | ------------------ |
|  `channel` | `string`           |
|  `closed`  | `boolean`          |
|  `network` | `string`           |
|  `until`   | `string` \| `null` |

***

### ClaimDeclined

A pushed payment that landed and then failed the check: reported, never refused. `atrHash` is the hash the payment
is bound to, or null when it is bound to none; `code` is the check's code; `transaction` is the landed transaction.

#### Properties

| Property       | Type                          |
| -------------- | ----------------------------- |
|  `atrHash`     | `` `0x${string}` `` \| `null` |
|  `code`        | `string`                      |
|  `pairing`     | `string`                      |
|  `state`       | `"declined"`                  |
|  `transaction` | `string` \| `null`            |

***

### ClaimRequest

#### Properties

| Property     | Type                                      | Description                          |
| ------------ | ----------------------------------------- | ------------------------------------ |
|  `chosen`    | `Json`                                    | -                                    |
|  `network`   | `string`                                  | -                                    |
|  `pairing`   | `string`                                  | -                                    |
|  `payment`   | `Json`                                    | -                                    |
|  `request?`  | [`RequestCommitment`](#requestcommitment) | -                                    |
|  `resource`  | `string`                                  | -                                    |
|  `settleBy?` | `number`                                  | Unix seconds, at most now + 604 800. |

***

### ClaimResponse

#### Properties

| Property   | Type                |
| ---------- | ------------------- |
|  `atrHash` | `` `0x${string}` `` |
|  `pairing` | `string`            |
|  `proves`  | [`Proves`](#proves) |
|  `state`   | `"settling"`        |

***

### ContentSlot

One content slot: strict RFC 4648 §4 base64 of the slot's exact bytes.

#### Properties

| Property | Type     |
| -------- | -------- |
|  `bytes` | `string` |
|  `slot`  | `string` |

***

### IssueRequest

#### Properties

| Property           | Type                                      | Description                                                   |
| ------------------ | ----------------------------------------- | ------------------------------------------------------------- |
|  `content?`        | [`ContentSlot`](#contentslot)\[]          | 0–56 slots.                                                   |
|  `lifetimeSeconds` | `number`                                  | Integer 1–604 800: the protocol's challenge lifetime.         |
|  `mintRequestId`   | `string`                                  | `^[A-Za-z0-9._:-]{1,128}$`: one state of one checkout.        |
|  `offers`          | [`Offer`](#offer)\[]                      | 1–16, in the order the document will carry them.              |
|  `request?`        | [`RequestCommitment`](#requestcommitment) | Required on an x402 surface.                                  |
|  `resource`        | `string`                                  | The resource id declared through the admin door, 1–512 bytes. |

***

### IssueResponse

#### Properties

| Property         | Type                              | Description                                                  |
| ---------------- | --------------------------------- | ------------------------------------------------------------ |
|  `agreement?`    | [`AgreementLink`](#agreementlink) | Present exactly when the record requires the agreement step. |
|  `atrHash`       | `` `0x${string}` ``               | -                                                            |
|  `carriers`      | [`Carriers`](#carriers)           | -                                                            |
|  `expiresAt`     | `string`                          | -                                                            |
|  `link`          | `string`                          | -                                                            |
|  `mintRequestId` | `string`                          | -                                                            |
|  `pairings`      | `object`\[]                       | -                                                            |

***

### Offer

One payment option, as the challenge will carry it. `pairing` is a pairing id the LCP package registers.

#### Properties

| Property   | Type     |
| ---------- | -------- |
|  `option`  | `Json`   |
|  `pairing` | `string` |

***

### Proves

What a record proves: whether the claim read the hash from the payment, the pairing's pattern, and the evidence it was paid on.

#### Properties

| Property     | Type                                                       | Description                                                                                                                       |
| ------------ | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|  `claimed`   | `boolean`                                                  | -                                                                                                                                 |
|  `pattern`   | `LcpPattern` \| `null`                                     | -                                                                                                                                 |
|  `settledBy` | `"read"` \| `"facilitator"` \| `"seller-report"` \| `null` | A read of the rail, the facilitator's settle answer, or the seller's report on a pairing with nothing to read; null while unpaid. |

***

### RecordView

#### Properties

| Property      | Type                                                                              | Description                                      |
| ------------- | --------------------------------------------------------------------------------- | ------------------------------------------------ |
|  `agreement`  | [`AgreementView`](#agreementview) \| `null`                                       | Null when the record requires no agreement step. |
|  `atrHash`    | `` `0x${string}` ``                                                               | -                                                |
|  `channel`    | [`ChannelView`](#channelview) \| `null`                                           | -                                                |
|  `expiresAt`  | `string`                                                                          | -                                                |
|  `proves`     | [`Proves`](#proves)                                                               | -                                                |
|  `settlement` | \{ `network?`: `string`; `pairing`: `string`; `reference?`: `string`; } \| `null` | -                                                |
|  `state`      | `"closed"` \| `"settling"` \| `"paid"` \| `"issued"`                              | -                                                |

***

### Refusal

#### Properties

| Property         | Type     |
| ---------------- | -------- |
|  `code`          | `string` |
|  `correlationId` | `string` |
|  `sentence`      | `string` |

***

### ReportClosed

A channel pairing's close: the close transaction as `reference`.

#### Properties

| Property     | Type                |
| ------------ | ------------------- |
|  `atrHash`   | `` `0x${string}` `` |
|  `chosen?`   | `Json`              |
|  `network?`  | `string`            |
|  `pairing`   | `string`            |
|  `reference` | `string`            |
|  `state`     | `"closed"`          |

***

### ReportOutcome

A payment's outcome; `reference`: 1–256 characters, no control characters.

#### Properties

| Property      | Type                                      | Description                                                                                                        |
| ------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
|  `atrHash`    | `` `0x${string}` ``                       | -                                                                                                                  |
|  `chosen?`    | `Json`                                    | On a record with no claim: the option the payment paid, as issued, from which its read keys are taken.             |
|  `network?`   | `string`                                  | -                                                                                                                  |
|  `outcome`    | `"declined"` \| `"paid"`                  | -                                                                                                                  |
|  `pairing`    | `string`                                  | -                                                                                                                  |
|  `receipt?`   | `Json`                                    | On a confirm-only channel pairing's paid report: the receipt its opening answered, from which the channel is read. |
|  `reference?` | `string`                                  | -                                                                                                                  |
|  `request?`   | [`RequestCommitment`](#requestcommitment) | With `chosen`, on a surface whose issued options are tied to the request.                                          |

***

### RequestCommitment

The request an x402 challenge answers.

#### Properties

| Property      | Type                |
| ------------- | ------------------- |
|  `bodyDigest` | `` `0x${string}` `` |
|  `method`     | `string`            |
|  `path`       | `string`            |
|  `query`      | `string`            |

***

### Vector

One vector: requests to the door and the answers they must produce.

#### Properties

| Property                            | Type        | Description                                                                                               |
| ----------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------- |
|  `fixed`                            | `object`    | -                                                                                                         |
| `fixed.agreement?`                  | `object`    | The tenant's agreement step: the nominal payment's pairing, network, asset, payee, amount and time bound. |
| `fixed.agreement.amount`            | `string`    | -                                                                                                         |
| `fixed.agreement.asset`             | `string`    | -                                                                                                         |
| `fixed.agreement.extra?`            | `object`    | -                                                                                                         |
| `fixed.agreement.host?`             | `string`    | The tenant host the agreement URL is on; required when `hosts` has more than one.                         |
| `fixed.agreement.maxTimeoutSeconds` | `number`    | -                                                                                                         |
| `fixed.agreement.network`           | `string`    | -                                                                                                         |
| `fixed.agreement.pairing`           | `string`    | -                                                                                                         |
| `fixed.agreement.payTo`             | `string`    | -                                                                                                         |
| `fixed.atrIds`                      | `string`\[] | -                                                                                                         |
| `fixed.clock`                       | `number`    | -                                                                                                         |
| `fixed.credential`                  | `string`    | -                                                                                                         |
| `fixed.credentialDigest`            | `string`    | -                                                                                                         |
| `fixed.hosts?`                      | `string`\[] | The tenant's hosts: an agreement URL is on the agreement's `host`, or on the tenant's only host.          |
| `fixed.resources`                   | `object`\[] | -                                                                                                         |
| `fixed.storageBase`                 | `string`    | -                                                                                                         |
| `fixed.tenant`                      | `string`    | -                                                                                                         |
|  `name`                             | `string`    | -                                                                                                         |
|  `source`                           | `string`    | -                                                                                                         |
|  `steps`                            | `object`\[] | -                                                                                                         |

## Type Aliases

### ReportRequest

> **ReportRequest** = [`ReportOutcome`](#reportoutcome) | [`ReportClosed`](#reportclosed)

## Variables

### OPENAPI\_BYTES

> `const` **OPENAPI\_BYTES**: `Uint8Array`

The bytes of `openapi.json`.

***

### REFUSALS

> `const` **REFUSALS**: `Readonly`\<`Record`\<`string`, `number`>>

The closed refusal table: each code and its status.

***

### VECTORS

> `const` **VECTORS**: `Readonly`\<`Record`\<`string`, [`Vector`](#vector)>>

The vector files, parsed, by name (`CV1` …).
