Skip to content
Integra Protocol
API

@integraledger/lcp/ucp

The exports of @integraledger/lcp/ucp.

Interfaces

UcpBinding

Type Parameters

Type Parameter
Id extends string
O extends Option

Properties

PropertyType
claimsboolean
idId
patternLcpPattern

Methods

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

Parameters
ParameterType
docCheckout
h`0x${string}`
linkstring
offerO
agreementUrl?string
Returns

Refusal | Checkout

bound()

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

Parameters
ParameterType
presentedunknown
Returns

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

build()

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

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

Promise<Refusal | Unsigned>

read()

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

Parameters
ParameterType
docCheckout
Returns

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

tie()

tie(options): ["ucp", { options: readonly O[]; }]

Parameters
ParameterType
optionsreadonly O[]
Returns

["ucp", { options: readonly O[]; }]

unplaced()

unplaced(option): O

Parameters
ParameterType
optionO
Returns

O


UcpOffer

Properties

PropertyType
checkoutCheckout

Unsigned

Properties

PropertyType
checkoutCheckout

Methods

complete()

complete(checkout_mandate): Promise<Refusal | Presented>

Parameters
ParameterType
checkout_mandatestring
Returns

Promise<Refusal | Presented>

Type Aliases

BookingOption

BookingOption = object

A booking session's own id, 1–256 characters.

Properties

PropertyType
bookingstring

Checkout

Checkout = object & object

Type Declaration

NameType
ap2?object & object
idstring
links?Link[]

CheckoutOption

CheckoutOption = object

A checkout's own id, 1–256 characters.

Properties

PropertyType
checkoutstring

Link = object

Properties

PropertyType
title?string
typestring
urlstring

Variables

const AGREEMENT_LINK_TYPE: "legal_context_agreement" = "legal_context_agreement"


ap2Mandate

const ap2Mandate: UcpBinding<"ucp/checkout/ap2-mandate", CheckoutOption>


bookingAp2Mandate

const bookingAp2Mandate: UcpBinding<"ucp/booking/ap2-mandate", BookingOption>


bookingUnsigned

const bookingUnsigned: UcpBinding<"ucp/booking/unsigned", BookingOption>


issuedDigest

const issuedDigest: typeof digestJson = digestJson

The option digest the issuer keeps: SHA-256 over the RFC 8785 form.


const LINK_TYPE: "legal_context" = "legal_context"


unsigned

const unsigned: UcpBinding<"ucp/checkout/unsigned", CheckoutOption>

Functions

legalContextLink(c): Refusal | { h: `0x${string}`; link: string; }

The hash and link of the checkout's one legal_context link. Nothing else of the checkout is read.

Parameters

ParameterType
cCheckout

Returns

Refusal | { h: `0x${string}`; link: string; }


tie()

tie<O>(options): ["ucp", { options: readonly O[]; }]

The binding slot: the checkouts or bookings this ATR was minted for, each by its own id.

Type Parameters

Type Parameter
O extends Option

Parameters

ParameterType
optionsreadonly O[]

Returns

["ucp", { options: readonly O[]; }]

Last updated on

On this page