Skip to content
Integra Protocol
API

@integraledger/lcp/acp

The exports of @integraledger/lcp/acp.

Interfaces

AcpBinding

Type Parameters

Type Parameter
Id extends string

Properties

PropertyType
claimsboolean
idId
patternLcpPattern
tie(options) => ["acp", { options: readonly HandlerOption[]; }]

Methods

advertise(doc, h, link, offer, agreementUrl?): Refusal | Session

Parameters
ParameterType
docSession
h`0x${string}`
linkstring
offerHandlerOption
agreementUrl?string
Returns

Refusal | Session

bound()

bound(presented): Promise<`0x${string}` | Refusal>

Parameters
ParameterType
presentedunknown
Returns

Promise<`0x${string}` | Refusal>

build()

build(choice, h): Promise<Refusal | Unsigned>

Parameters
ParameterType
choiceAcpChoice
h`0x${string}`
Returns

Promise<Refusal | Unsigned>

read()

read(doc): Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { session: Session; }; }

Parameters
ParameterType
docSession
Returns

Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { session: Session; }; }

unplaced()

unplaced(option): HandlerOption

Parameters
ParameterType
optionHandlerOption
Returns

HandlerOption


AcpChoice

The buyer's own values for the allowance, and the session it pays.

Properties

PropertyType
currencystring
expires_atstring
max_amountnumber
merchant_idstring
sessionSession

Unsigned

Properties

PropertyType
allowanceAllowance

Methods

complete()

complete(request): Refusal | Presented

Parameters
ParameterType
requestPresented
Returns

Refusal | Presented

Type Aliases

Allowance

Allowance = object

ACP's Allowance: six members, closed.

Properties

PropertyType
checkout_session_idstring
currencystring
expires_atstring
max_amountnumber
merchant_idstring
reason"one_time"

HandlerOption

HandlerOption = object

The kind of payment handler a session offers: ACP's own requires_delegate_payment flag.

Properties

PropertyType
requires_delegate_paymentboolean

Presented

Presented = object & object

The delegate_payment request as the agent signs it.

Type Declaration

NameType
allowanceAllowance

Session

Session = object & object

A CheckoutSession. Every member other than id and metadata.legal_context is carried untouched.

Type Declaration

NameType
id?string
metadata?object

Variables

delegated

const delegated: AcpBinding<"acp/checkout/delegated">


issuedDigest

const issuedDigest: typeof digestJson = digestJson

SHA-256 over the RFC 8785 form of an issued handler option.


METADATA_KEY

const METADATA_KEY: "legal_context" = "legal_context"


undelegated

const undelegated: AcpBinding<"acp/checkout/undelegated">

Functions

tie()

tie(options): ["acp", { options: readonly HandlerOption[]; }]

The binding slot: one option per kind of payment handler the session offers, and nothing from the checkout.

Parameters

ParameterType
optionsreadonly HandlerOption[]

Returns

["acp", { options: readonly HandlerOption[]; }]

Last updated on

On this page