Skip to content
Integra Protocol
API

@integraledger/lcp/mpp

The exports of @integraledger/lcp/mpp.

Interfaces

GatewaySaltInput

The inputs of usdc's Gateway salt, every one a string.

Properties

PropertyType
amountstring
destinationNetworkstring
destinationRecipientstring
idstring
maxFeestring
realmstring
recipientstring
requestHash`0x${string}`
sourceDepositorstring
sourceNetworkstring
sourceSignerstring

HederaSessionUnsigned

A Hedera session opening for the payer's signer: two calls broadcast in order, and the zero voucher to sign.

Properties

PropertyType
requestobject
request.callsobject[]
request.chainId295 | 296
request.kind"hedera-session-open"
request.voucherHederaVoucherTypedData

Methods

complete()

complete(signed): Refusal | MppCredential

Parameters
ParameterType
signed{ openTx: `0x${string}`; signature: `0x${string}`; }
signed.openTx`0x${string}`
signed.signature`0x${string}`
Returns

Refusal | MppCredential


LandedCredential

A push credential with the landed receipt's logs from the currency.

Extends

Properties

PropertyTypeInherited from
challengeMppChallenge & objectMppCredential.challenge
landedobject-
landed.blockNumberbigint-
landed.logsreadonly EvmLog[]-
landed.transaction`0x${string}`-
payloadobjectMppCredential.payload
source?stringMppCredential.source

MppChallenge

A challenge's auth-params after quoted-string unescaping. request and opaque are base64url-nopad JSON.

Properties

PropertyType
description?string
digest?string
expires?string
header?string
id?string
intentstring
methodstring
opaque?string
realmstring
requeststring

MppChoice

The buyer's inputs to build. No check reads them.

Extended by

Properties

PropertyTypeDescription
challengeMppChallenge & object-
clientId?stringtempo only: the payer's label in the attribution memo.
from`0x${string}`-
nownumber-
spender?`0x${string}`permit2 only: the seller server's submitting address.
tokenDomain?objectauthorization only: the token's EIP-712 name and version.
tokenDomain.namestring-
tokenDomain.versionstring-

MppCredential

Extended by

Properties

PropertyType
challengeMppChallenge & object
payloadobject
source?string

RailSessionChoice

The buyer's inputs to a session opening's build. The deposit and the XRPL channel terms are the funder's.

Properties

PropertyType
challengeMppChallenge & object
depositbigint
fromstring
nownumber
xrpl?object
xrpl.cancelAfter?number
xrpl.feestring
xrpl.lastLedgerSequencenumber
xrpl.publicKeystring
xrpl.sequencenumber
xrpl.settleDelaynumber

SessionChoice

The buyer's inputs to build. No check reads them.

Extends

Properties

PropertyTypeDescriptionInherited from
authorizedSigner?`0x${string}`sessions: default the zero address, which means the payer.-
challengeMppChallenge & object-MppChoice.challenge
clientId?stringtempo only: the payer's label in the attribution memo.MppChoice.clientId
credentialType?"authorization" | "permit2" | "hash"EVM: default the first listed type.-
deposit?bigintsessions: the buyer's deposit; suggestedDeposit is advice.-
from`0x${string}`-MppChoice.from
nownumber-MppChoice.now
spender?`0x${string}`permit2 only: the seller server's submitting address.MppChoice.spender
tokenDomain?objectauthorization only: the token's EIP-712 name and version.MppChoice.tokenDomain
tokenDomain.namestring--
tokenDomain.versionstring--

SessionRef

The settlement read keys of these pairings.

Extends

Properties

PropertyTypeDescriptionInherited from
accessKey?objectThe subscription's access key: its id, the token it spends, and transferDigest({to: recipient}). With account, the read keys of a transfer made under the key for that account.-
accessKey.account?`0x${string}`--
accessKey.keyId`0x${string}`--
accessKey.to`0x${string}`--
accessKey.token`0x${string}`--
bindingLog?{ address: `0x${string}`; topic0: `0x${string}`; value: `0x${string}`; } & ({ index: 2 | 1 | 3; } | { dataWord: number; })The log carrying H or its commitment: in topic index, or in 32-byte data word dataWord.EvmRef.bindingLog
closes?objectThe close of an EVM session: a call to escrow of one of EVM_CLOSE_SELECTORS naming channel.-
closes.channel`0x${string}`--
closes.escrow`0x${string}`--
network`eip155:${string}` | HederaNetwork-EvmRef.network
opened?object--
opened.address`0x${string}`--
opened.chainIdnumber--
opened.channel`0x${string}`--
opened.h`0x${string}`--
opened.version"v1" | "v2"--
search?objectThe log filter that finds the transaction when none is named; absent, only a named transaction is read.EvmRef.search
search.address`0x${string}`--
search.topicsreadonly (`0x${string}` | null)[]--
settleBy?stringDecimal Unix seconds after which the payment can no longer execute.EvmRef.settleBy
transaction?`0x${string}`The transaction the credential presents, where the payer broadcast the opening before the claim.-
transferLog?objectThe token transfer this payment made, identified by the digest of the named fields.EvmRef.transferLog
transferLog.address`0x${string}`--
transferLog.digest`0x${string}`--
transferLog.identityTransferIdentity--
transferLog.topic0`0x${string}`--

SessionWithin

The buyer's inputs to an in-channel payment: the within 402's challenge, echoed as given; the held opening, exactly as signed; the cumulative amount to sign; and the action.

Properties

PropertyType
action"close" | "voucher"
challengeMppChallenge & object
cumulativeAmountbigint
openingMppCredential

SessionWithinUnsigned

One signing request; complete takes its one signature and returns the in-channel credential.

Properties

PropertyType
requestsreadonly WithinSigningRequest[]

Methods

complete()

complete(signatures): Refusal | MppCredential

Parameters
ParameterType
signaturesreadonly string[]
Returns

Refusal | MppCredential


SolanaChargeChoice

The buyer's inputs to build. The request's decimals, tokenProgram and recentBlockhash win when present.

Properties

PropertyType
challengeMppChallenge & object
computeUnitLimit?number
computeUnitPrice?bigint
decimals?number
payerstring
recentBlockhash?string
tokenProgram?string

SolanaChargeUnsigned

Properties

PropertyType
requestobject
request.kind"solana-message"
request.messageUint8Array

Methods

complete()

complete(signature): Refusal | MppCredential

The payer's 64-byte Ed25519 signature over message.

Parameters
ParameterType
signatureUint8Array
Returns

Refusal | MppCredential


SolanaSessionUnsigned

The values a Solana channel client composes the open from; complete takes the composed open payload.

Properties

PropertyType
requestobject
request.channelProgramstring
request.kind"solana-session-open"
request.network`solana:${string}`
request.recentBlockhashstring
request.recentSlotbigint
request.saltbigint

Methods

complete()

complete(open): Refusal | MppCredential

Parameters
ParameterType
open{[k: string]: Json; }
Returns

Refusal | MppCredential


StacksChargeChoice

The buyer's inputs to the Stacks build: the chosen challenge and the payer's c32 standard principal.

Properties

PropertyType
challengeMppChallenge & object
fromstring

StellarChargeChoice

The buyer's inputs to build: the buyer's simulated transaction and its ledger and clock readings.

Properties

PropertyType
challengeMppChallenge & object
currentLedgernumber
nownumber
simulatedXdrstring

StellarChargeUnsigned

Properties

PropertyType
requestobject
request.kind"stellar-auth"
request.preimageUint8Array

Methods

complete()

complete(signature): Refusal | MppCredential

The payer's Ed25519 signature over SHA-256 of preimage.

Parameters
ParameterType
signatureUint8Array
Returns

Refusal | MppCredential


StripeSubscriptionReceipt

The Stripe subscription's activation receipt, the Payment-Receipt payload decoded from its base64url JSON (or the MCP transport's receipt object as given). The seller passes it when it reports the opening paid.

Properties

PropertyTypeDescription
externalId?string-
method"stripe"-
referencestringThe Stripe invoice whose payment activated the subscription.
status"success"-
stripeSubscriptionstringThe Stripe subscription ID.
subscriptionIdstringThe seller's own identifier for the subscription.
timestampstring-

VoucherTypedData

Properties

PropertyType
domainobject
domain.chainIdnumber
domain.name"EVM Payment Channel" | "Tempo Stream Channel" | "TIP20 Channel Reserve"
domain.verifyingContract`0x${string}`
domain.version"1"
messageobject
message.channelId`0x${string}`
message.cumulativeAmountbigint
primaryType"Voucher"
typesobject
types.Voucher[{ name: "channelId"; type: "bytes32"; }, { name: "cumulativeAmount"; type: "uint128" | "uint96"; }]

XrplChargeChoice

The buyer's inputs to build: the paying account and the buyer's own reads of fee, sequence and ledger.

Properties

PropertyType
accountstring
challengeMppChallenge & object
feestring
lastLedgerSequencenumber
sequencenumber

XrplChargeUnsigned

Properties

PropertyType
requestobject
request.kind"xrpl-tx"
request.txJsonXrplTxJson

Methods

complete()

complete(signedBlob): Refusal | MppCredential

The wallet's signed blob, hex.

Parameters
ParameterType
signedBlobstring
Returns

Refusal | MppCredential


XrplSessionUnsigned

An XRPL PaymentChannelCreate for the wallet to sign, and the first claim's bytes.

Properties

PropertyType
requestobject
request.claimobject
request.claim.bytesUint8Array
request.claim.channelIdstring
request.claim.dropsbigint
request.kind"xrpl-session-open"
request.txJsonXrplTxJson

Methods

complete()

complete(signed): Promise<Refusal | MppCredential>

Parameters
ParameterType
signed{ claimSignature: string; signedBlob: string; }
signed.claimSignaturestring
signed.signedBlobstring
Returns

Promise<Refusal | MppCredential>

Type Aliases

GatewayPreimage

GatewayPreimage = Pick<GatewaySaltInput, "id" | "realm" | "requestHash" | "recipient">

The salt's inputs a Gateway signing request carries from the chosen challenge.


HederaLandedCredential

HederaLandedCredential = LandedCredential

A Hedera session opening with the landed receipt's logs from the escrow.


MppIntent

MppIntent = "charge" | "session" | "subscription"


MppMethod

MppMethod = "evm" | "tempo" | "solana" | "lightning" | "card" | "stripe" | "usdc" | "nearintents" | "stellar" | "xrpl" | "hedera"


MppPairing

MppPairing = "mpp/charge/evm/permit2" | "mpp/charge/evm/authorization" | "mpp/charge/evm/transaction" | "mpp/charge/evm/hash" | "mpp/charge/tempo/memo" | "mpp/charge/tempo/push" | "mpp/session/evm" | "mpp/session/tempo" | "mpp/subscription/tempo" | "mpp/charge/lightning" | "mpp/session/lightning" | "mpp/charge/hedera" | "mpp/charge/solana" | "mpp/charge/stellar" | "mpp/charge/xrpl" | "mpp/charge/nearintents" | "mpp/session/hedera" | "mpp/session/solana" | "mpp/session/xrpl" | "mpp/charge/card" | "mpp/charge/stripe" | "mpp/subscription/stripe" | "mpp/charge/usdc/evm" | "mpp/charge/usdc/solana" | "mpp/charge/usdc/stacks" | "mpp/charge/usdc/gateway"

Every MPP pairing pairingsOf can name.


MppUnsigned

MppUnsigned = { request: { kind: "eip712"; typedData: Eip3009TypedData | Permit2TypedData; }; complete: Refusal | MppCredential; } | { request: { broadcast: boolean; call: { data: Hex; to: Hex; }; chainId: number; kind: "tempo-call"; validBefore: number; }; complete: Refusal | MppCredential; } | { request: { broadcast: boolean; call: { data: Hex; to: Hex; }; chainId: number; kind: "evm-call"; }; complete: Refusal | MppCredential; }

Union Members

Type Literal

{ request: { kind: "eip712"; typedData: Eip3009TypedData | Permit2TypedData; }; complete: Refusal | MppCredential; }


Type Literal

{ request: { broadcast: boolean; call: { data: Hex; to: Hex; }; chainId: number; kind: "tempo-call"; validBefore: number; }; complete: Refusal | MppCredential; }

NameTypeDescription
requestobjectpush: the buyer's signer broadcasts, and complete takes the transaction hash.
request.broadcastboolean-
request.callobject-
request.call.dataHex-
request.call.toHex-
request.chainIdnumber-
request.kind"tempo-call"-
request.validBeforenumber-
complete()(signedTxOrHash) => Refusal | MppCredential-

Type Literal

{ request: { broadcast: boolean; call: { data: Hex; to: Hex; }; chainId: number; kind: "evm-call"; }; complete: Refusal | MppCredential; }

NameTypeDescription
requestobjectAn EIP-1559 transaction of the call, or its hash once broadcast.
request.broadcastboolean-
request.callobject-
request.call.dataHex-
request.call.toHex-
request.chainIdnumber-
request.kind"evm-call"-
complete()(signedTxOrHash) => Refusal | MppCredential-

RailSessionUnsigned

RailSessionUnsigned = HederaSessionUnsigned | SolanaSessionUnsigned | XrplSessionUnsigned


SessionStatus

SessionStatus = EvmBreadthStatus | { state: "pending"; why: "not-a-close"; }


SessionUnsigned

SessionUnsigned = object

Properties

PropertyType
funding{ kind: "eip712"; typedData: ReceiveTypedData | Permit2TypedData; } | { broadcast: true; calls: object[]; chainId: number; kind: "evm-calls"; } | { broadcast: false; call: { data: Hex; to: Hex; }; chainId: number; kind: "tempo-call"; validBefore: number; }

Methods

complete()

complete(funded, voucherSignature): Refusal | MppCredential

Parameters
ParameterType
funded`0x${string}`
voucherSignature`0x${string}`
Returns

Refusal | MppCredential

voucher()

voucher(funded): Refusal | VoucherTypedData

funded: the funding signature, transaction hash or signed 0x76 transaction.

Parameters
ParameterType
funded`0x${string}`
Returns

Refusal | VoucherTypedData


UsdcUnsigned

UsdcUnsigned = { request: { kind: "eip712"; typedData: Eip3009TypedData; }; complete: Refusal | MppCredential; } | { request: { anchorMode: "onChainOnly"; args: { amount: string; memo: AtrHash; recipient: string; sender: string; }; contract: string; functionName: "transfer"; kind: "stacks-contract-call"; postCondition: "SentEq"; postConditionMode: "deny"; }; complete: Refusal | MppCredential; } | { request: { kind: "gateway-burn-intent"; preimage: GatewayPreimage; }; complete: Refusal | MppCredential; }

What the signer is handed for each usdc profile, and how its answer completes the credential.


WithinSigningRequest

WithinSigningRequest = { kind: "eip712"; typedData: VoucherTypedData | HederaVoucherTypedData; } | { kind: "ed25519-raw"; message: Uint8Array; signer: string; } | { bytes: Uint8Array; channelId: string; drops: bigint; kind: "xrpl-claim"; }

A request to the buyer's signer for an in-channel payment.

Variables

CARRIER

const CARRIER: { readonly [i in MppIntent]: { readonly [m in MppMethod]?: readonly string[] | null } }

The request member a pairing writes H into, by intent and method; null where no request member carries it. usdc carries H in a request member only on its Solana profile (USDC_CARRIER).


chargeCard

const chargeCard: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (_choice, _h) => Promise<Refusal>; carrier: string; claims: boolean; id: "mpp/charge/card"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (c) => MppChallenge; }>


chargeNearIntents

const chargeNearIntents: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (credential) => Promise<`0x${string}` | Refusal>; carrier: "request.externalId"; claims: boolean; id: "mpp/charge/nearintents"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>


chargeSolana

const chargeSolana: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | SolanaChargeUnsigned>; carrier: "request.externalId"; claims: boolean; fetchPresented: (credential, reader) => Promise<Refusal | MppCredential>; id: "mpp/charge/solana"; landedTx: (presented) => string | undefined; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | Omit<SvmRef, "fromSlot">>; status: (ref, reader) => Promise<SvmStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>


chargeStellar

const chargeStellar: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | StellarChargeUnsigned>; carrier: "request.recipient"; claims: boolean; fetchPresented: (credential, reader) => Promise<Refusal | MppCredential>; id: "mpp/charge/stellar"; landedTx: (presented) => string | undefined; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | StellarRef>; status: (ref, reader) => Promise<StellarStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>


chargeStripe

const chargeStripe: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (_choice, _h) => Promise<Refusal>; carrier: string; claims: boolean; id: "mpp/charge/stripe"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (c) => MppChallenge; }>


chargeUsdcEvm

const chargeUsdcEvm: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | UsdcUnsigned>; carrier: null; claims: boolean; id: "mpp/charge/usdc/evm"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | EvmRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>


chargeUsdcGateway

const chargeUsdcGateway: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | { request: { kind: "gateway-burn-intent"; preimage: GatewayPreimage; }; complete: Refusal | MppCredential; }>; carrier: null; claims: boolean; id: "mpp/charge/usdc/gateway"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>


chargeUsdcSolana

const chargeUsdcSolana: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | SolanaChargeUnsigned>; carrier: "request.externalId"; claims: boolean; id: "mpp/charge/usdc/solana"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | Omit<SvmRef, "fromSlot">>; status: (ref, reader) => Promise<SvmStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>


chargeUsdcStacks

const chargeUsdcStacks: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | { request: { anchorMode: "onChainOnly"; args: { amount: string; memo: `0x${string}`; recipient: string; sender: string; }; contract: string; functionName: "transfer"; kind: "stacks-contract-call"; postCondition: "SentEq"; postConditionMode: "deny"; }; complete: Refusal | MppCredential; }>; carrier: null; claims: boolean; id: "mpp/charge/usdc/stacks"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | StacksRef>; status: (ref, reader) => Promise<StacksStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>


chargeXrpl

const chargeXrpl: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | XrplChargeUnsigned>; carrier: "request.methodDetails.invoiceId"; claims: boolean; fetchPresented: (credential, reader) => Promise<Refusal | MppCredential>; id: "mpp/charge/xrpl"; landedTx: (presented) => string | undefined; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | Omit<XrplRef, "fromLedger">>; status: (ref, reader) => Promise<XrplStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>


EVM_CLOSE_SELECTORS

const EVM_CLOSE_SELECTORS: readonly ["0x0d65c51d", "0x79d35ded", "0x8e19899e"]

The EVM session escrow's functions that finalize a channel, each taking the channel id as its first argument: close(bytes32,uint128,bytes), closeWithAuthorization(bytes32,uint128,uint256,uint256,bytes,bytes) and withdraw(bytes32).


evmAuthorization

const evmAuthorization: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | MppUnsigned>; claims: boolean; id: "mpp/charge/evm/authorization"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | EvmRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>


evmHash

const evmHash: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (presented) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | MppUnsigned>; claims: boolean; id: "mpp/charge/evm/hash"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (presented) => Promise<Refusal | EvmRef & object>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>


evmPermit2

const evmPermit2: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | MppUnsigned>; claims: boolean; id: "mpp/charge/evm/permit2"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | EvmRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>


evmTransaction

const evmTransaction: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (presented) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | MppUnsigned>; claims: boolean; id: "mpp/charge/evm/transaction"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (presented) => Promise<Refusal | EvmRef & object>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>


const LEGAL_CONTEXT_METADATA_KEY: "legal_context" = "legal_context"

The Stripe metadata key the seller places H under: at most 40 characters, no square brackets.


MPP_BINDINGS

const MPP_BINDINGS: readonly [Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | MppUnsigned>; claims: boolean; id: "mpp/charge/evm/authorization"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | EvmRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | MppUnsigned>; claims: boolean; id: "mpp/charge/evm/permit2"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | EvmRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (presented) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | MppUnsigned>; claims: boolean; id: "mpp/charge/evm/transaction"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (presented) => Promise<Refusal | EvmRef & object>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (presented) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | MppUnsigned>; claims: boolean; id: "mpp/charge/evm/hash"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (presented) => Promise<Refusal | EvmRef & object>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | MppUnsigned>; claims: boolean; id: "mpp/charge/tempo/memo"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | EvmRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | MppUnsigned>; claims: boolean; fetchPresented: (presented, reader) => Promise<Refusal | LandedCredential>; id: "mpp/charge/tempo/push"; landedTx: (presented) => string | undefined; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | EvmRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | SessionUnsigned>; buildWithin: (w, h) => Promise<Refusal | SessionWithinUnsigned>; channel: Readonly<{ boundWithin: (_presented) => Promise<`0x${string}` | Refusal>; kind: (presented) => "open" | "close" | Refusal | "within"; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (_presented) => number | undefined; }>; claims: true; closeRef: (chosen, channel) => Refusal | SessionRef; id: "mpp/session/evm"; landedTx: (presented) => string | undefined; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | SessionRef>; status: (ref, reader) => Promise<SessionStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | SessionUnsigned>; buildWithin: (w, h) => Promise<Refusal | SessionWithinUnsigned>; channel: Readonly<{ boundWithin: (input) => Promise<`0x${string}` | Refusal>; kind: (presented) => "open" | "close" | Refusal | "within"; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (_presented) => number | undefined; }>; claims: true; closeRef: (chosen, channel) => Refusal | SessionRef; id: "mpp/session/tempo"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | SessionRef>; status: (ref, reader) => Promise<SessionStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | KeyAuthorizationUnsigned>; channel: Readonly<{ boundWithin: (_presented) => Promise<`0x${string}` | Refusal>; kind: (presented) => "open" | "close" | Refusal | "within"; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (presented) => number | undefined; }>; claims: true; closeRef: (chosen, _channel) => Refusal | SessionRef; id: "mpp/subscription/tempo"; keyProves: string; keySearch: (ref, receipt, h) => Refusal | SessionRef; pattern: { buyerSigns: true; canonical: true; forwardIndexable: true; onChain: true; pattern: "native-field"; proves: string; publicProof: true; zeroPartyRecoverable: true; }; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | SessionRef>; status: (ref, reader) => Promise<SessionStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; advertiseBeforeCarrier: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (presented) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | LnMppUnsigned>; carrier: string; claims: boolean; id: "mpp/charge/lightning"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (presented) => Promise<Refusal | LnRef>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (c) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; advertiseBeforeCarrier: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (presented) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | LnMppUnsigned>; carrier: string; channel: Readonly<{ boundWithin: (_presented) => Promise<`0x${string}` | Refusal>; kind: (presented) => "open" | "close" | Refusal | "within"; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (_presented) => number | undefined; }>; claims: boolean; id: "mpp/session/lightning"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (presented) => Promise<Refusal | LnRef>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (c) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (credentialChallenge, request, c) => Promise<Refusal | HederaUnsigned>; carrier: "challenge"; claims: boolean; fetchPresented: (input, reader, defaultNetwork?) => Promise<Refusal | HederaLandedCharge>; id: "mpp/charge/hedera"; landedTx: (presented) => string | undefined; network: (request, defaultNetwork?) => Refusal | HederaNetwork; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | HederaRef>; status: (ref, reader) => Promise<HederaStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | SolanaChargeUnsigned>; carrier: "request.externalId"; claims: boolean; fetchPresented: (credential, reader) => Promise<Refusal | MppCredential>; id: "mpp/charge/solana"; landedTx: (presented) => string | undefined; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | Omit<SvmRef, "fromSlot">>; status: (ref, reader) => Promise<SvmStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | StellarChargeUnsigned>; carrier: "request.recipient"; claims: boolean; fetchPresented: (credential, reader) => Promise<Refusal | MppCredential>; id: "mpp/charge/stellar"; landedTx: (presented) => string | undefined; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | StellarRef>; status: (ref, reader) => Promise<StellarStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | XrplChargeUnsigned>; carrier: "request.methodDetails.invoiceId"; claims: boolean; fetchPresented: (credential, reader) => Promise<Refusal | MppCredential>; id: "mpp/charge/xrpl"; landedTx: (presented) => string | undefined; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | Omit<XrplRef, "fromLedger">>; status: (ref, reader) => Promise<XrplStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (credential) => Promise<`0x${string}` | Refusal>; carrier: "request.externalId"; claims: boolean; id: "mpp/charge/nearintents"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | HederaSessionUnsigned>; buildWithin: (w, h) => Promise<Refusal | SessionWithinUnsigned>; channel: Readonly<{ boundWithin: (_presented) => Promise<`0x${string}` | Refusal>; kind: (p) => Refusal | Kind; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (_p) => number | undefined; }>; claims: true; closeRef: (chosen, channel) => Refusal | Omit<HederaCloseRef, "transaction">; fetchPresented: (presented, reader) => Promise<Refusal | LandedCredential>; id: "mpp/session/hedera"; landedTx: (presented) => string | undefined; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | HederaSessionRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | SolanaSessionUnsigned>; buildWithin: (w, h) => Promise<Refusal | SessionWithinUnsigned>; channel: Readonly<{ boundWithin: (input) => Promise<`0x${string}` | Refusal>; kind: (p) => Refusal | Kind; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (_p) => number | undefined; }>; claims: true; closeRef: (chosen, channel) => Refusal | Omit<SvmCloseRef, "transaction">; id: "mpp/session/solana"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | Omit<SvmRef, "fromSlot">>; status: (ref, reader) => Promise<SvmStatus | SvmCloseStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | XrplSessionUnsigned>; buildWithin: (w, h) => Promise<Refusal | SessionWithinUnsigned>; channel: Readonly<{ boundWithin: (_presented) => Promise<`0x${string}` | Refusal>; kind: (p) => Refusal | Kind; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (presented) => number | undefined; }>; claims: true; closeRef: (chosen, channel) => Refusal | Omit<XrplCloseRef, "transaction">; id: "mpp/session/xrpl"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | Omit<XrplRef, "expect" | "fromLedger">>; status: (ref, reader) => Promise<XrplStatus | XrplCloseStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (_choice, _h) => Promise<Refusal>; carrier: string; claims: boolean; id: "mpp/charge/card"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (c) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (_choice, _h) => Promise<Refusal>; carrier: string; claims: boolean; id: "mpp/charge/stripe"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (c) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (_choice, _h) => Promise<Refusal>; carrier: string; channel: Readonly<{ boundWithin: (_presented) => Promise<`0x${string}` | Refusal>; kind: (_presented) => "open"; ref: (_presented, receipt?) => Promise<Refusal | { channel: string; network: string; }>; until: (_presented) => number | undefined; }>; claims: boolean; id: "mpp/subscription/stripe"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (c) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | UsdcUnsigned>; carrier: null; claims: boolean; id: "mpp/charge/usdc/evm"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | EvmRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | SolanaChargeUnsigned>; carrier: "request.externalId"; claims: boolean; id: "mpp/charge/usdc/solana"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | Omit<SvmRef, "fromSlot">>; status: (ref, reader) => Promise<SvmStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | { request: { anchorMode: "onChainOnly"; args: { amount: string; memo: `0x${string}`; recipient: string; sender: string; }; contract: string; functionName: "transfer"; kind: "stacks-contract-call"; postCondition: "SentEq"; postConditionMode: "deny"; }; complete: Refusal | MppCredential; }>; carrier: null; claims: boolean; id: "mpp/charge/usdc/stacks"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | StacksRef>; status: (ref, reader) => Promise<StacksStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>, Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | { request: { kind: "gateway-burn-intent"; preimage: GatewayPreimage; }; complete: Refusal | MppCredential; }>; carrier: null; claims: boolean; id: "mpp/charge/usdc/gateway"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>]

Every MPP pairing this entry point implements.


sessionEvm

const sessionEvm: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | SessionUnsigned>; buildWithin: (w, h) => Promise<Refusal | SessionWithinUnsigned>; channel: Readonly<{ boundWithin: (_presented) => Promise<`0x${string}` | Refusal>; kind: (presented) => "open" | "close" | Refusal | "within"; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (_presented) => number | undefined; }>; claims: true; closeRef: (chosen, channel) => Refusal | SessionRef; id: "mpp/session/evm"; landedTx: (presented) => string | undefined; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | SessionRef>; status: (ref, reader) => Promise<SessionStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>


sessionHedera

const sessionHedera: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | HederaSessionUnsigned>; buildWithin: (w, h) => Promise<Refusal | SessionWithinUnsigned>; channel: Readonly<{ boundWithin: (_presented) => Promise<`0x${string}` | Refusal>; kind: (p) => Refusal | Kind; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (_p) => number | undefined; }>; claims: true; closeRef: (chosen, channel) => Refusal | Omit<HederaCloseRef, "transaction">; fetchPresented: (presented, reader) => Promise<Refusal | LandedCredential>; id: "mpp/session/hedera"; landedTx: (presented) => string | undefined; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | HederaSessionRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>


sessionSolana

const sessionSolana: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | SolanaSessionUnsigned>; buildWithin: (w, h) => Promise<Refusal | SessionWithinUnsigned>; channel: Readonly<{ boundWithin: (input) => Promise<`0x${string}` | Refusal>; kind: (p) => Refusal | Kind; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (_p) => number | undefined; }>; claims: true; closeRef: (chosen, channel) => Refusal | Omit<SvmCloseRef, "transaction">; id: "mpp/session/solana"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | Omit<SvmRef, "fromSlot">>; status: (ref, reader) => Promise<SvmStatus | SvmCloseStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>


sessionTempo

const sessionTempo: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | SessionUnsigned>; buildWithin: (w, h) => Promise<Refusal | SessionWithinUnsigned>; channel: Readonly<{ boundWithin: (input) => Promise<`0x${string}` | Refusal>; kind: (presented) => "open" | "close" | Refusal | "within"; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (_presented) => number | undefined; }>; claims: true; closeRef: (chosen, channel) => Refusal | SessionRef; id: "mpp/session/tempo"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | SessionRef>; status: (ref, reader) => Promise<SessionStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>


sessionXrpl

const sessionXrpl: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | XrplSessionUnsigned>; buildWithin: (w, h) => Promise<Refusal | SessionWithinUnsigned>; channel: Readonly<{ boundWithin: (_presented) => Promise<`0x${string}` | Refusal>; kind: (p) => Refusal | Kind; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (presented) => number | undefined; }>; claims: true; closeRef: (chosen, channel) => Refusal | Omit<XrplCloseRef, "transaction">; id: "mpp/session/xrpl"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | Omit<XrplRef, "expect" | "fromLedger">>; status: (ref, reader) => Promise<XrplStatus | XrplCloseStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => MppChallenge; }>


subscriptionStripe

const subscriptionStripe: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (_choice, _h) => Promise<Refusal>; carrier: string; channel: Readonly<{ boundWithin: (_presented) => Promise<`0x${string}` | Refusal>; kind: (_presented) => "open"; ref: (_presented, receipt?) => Promise<Refusal | { channel: string; network: string; }>; until: (_presented) => number | undefined; }>; claims: boolean; id: "mpp/subscription/stripe"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (c) => MppChallenge; }>


subscriptionTempo

const subscriptionTempo: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | KeyAuthorizationUnsigned>; channel: Readonly<{ boundWithin: (_presented) => Promise<`0x${string}` | Refusal>; kind: (presented) => "open" | "close" | Refusal | "within"; ref: (presented) => Promise<Refusal | { channel: string; network: string; }>; until: (presented) => number | undefined; }>; claims: true; closeRef: (chosen, _channel) => Refusal | SessionRef; id: "mpp/subscription/tempo"; keyProves: string; keySearch: (ref, receipt, h) => Refusal | SessionRef; pattern: { buyerSigns: true; canonical: true; forwardIndexable: true; onChain: true; pattern: "native-field"; proves: string; publicProof: true; zeroPartyRecoverable: true; }; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (input) => Promise<Refusal | SessionRef>; status: (ref, reader) => Promise<SessionStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>


tempoMemo

const tempoMemo: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | MppUnsigned>; claims: boolean; id: "mpp/charge/tempo/memo"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | EvmRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>


tempoPush

const tempoPush: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | MppChallenge[]; bound: (input) => Promise<`0x${string}` | Refusal>; build: (choice, h) => Promise<Refusal | MppUnsigned>; claims: boolean; fetchPresented: (presented, reader) => Promise<Refusal | LandedCredential>; id: "mpp/charge/tempo/push"; landedTx: (presented) => string | undefined; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }; reference: (input) => Promise<Refusal | EvmRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (options) => ["mpp", { challenges: MppChallenge[]; }]; unplaced: (option) => Json; }>


USDC_CARRIER

const USDC_CARRIER: object

The request member usdc writes H into, by methodDetails.type; null where no request member carries it.

Index Signature

[profile: string]: readonly string[] | null

Functions

attributionMemo()

attributionMemo(realm, challengeId, clientId?): `0x${string}`

MPP's 32-byte attribution memo: keccak256("mpp")[0..3], 0x01, keccak256(realm)[0..9], keccak256(clientId)[0..9] or ten zero bytes, then keccak256(challengeId)[0..6], each over the string's UTF-8.

Parameters

ParameterType
realmstring
challengeIdstring
clientId?string

Returns

`0x${string}`


challengeBound()

challengeBound(c): Refusal | { h: `0x${string}`; request: {[k: string]: Json; }; }

H from an echoed challenge: its id derives from H in the form its intent and method take, its opaque names H, and its request decodes.

Parameters

ParameterType
cunknown

Returns

Refusal | { h: `0x${string}`; request: {[k: string]: Json; }; }


challengeH()

challengeH(id): `0x${string}` | Refusal

H from an id challengeId wrote, or from the bare base64url of H; anything else is mpp/id-not-ours.

Parameters

ParameterType
idstring

Returns

`0x${string}` | Refusal


challengeHash()

challengeHash(id, realm): `0x${string}`

keccak256(UTF-8(id) ‖ UTF-8(realm)), lowercase: Solidity's abi.encodePacked(string, string).

Parameters

ParameterType
idstring
realmstring

Returns

`0x${string}`


challengeId()

challengeId(h, index): string | Refusal

base64url, without padding, of H's 32 bytes, then . and the challenge's position (0 to 31).

Parameters

ParameterType
h`0x${string}`
indexnumber

Returns

string | Refusal


checkAttribution()

checkAttribution(memo, realm, challengeId): true | Refusal

Checks a memo's tag, version, server id for realm and nonce for challengeId. The client id is not read.

Parameters

ParameterType
memostring
realmstring
challengeIdstring

Returns

true | Refusal


evmChannelId()

evmChannelId(c): `0x${string}` | Refusal

keccak256(abi.encode(payer, payee, token, salt, authorizedSigner, escrow, chainId)); also Tempo v1's.

Parameters

ParameterType
c{ authorizedSigner: `0x${string}`; chainId: number; escrow: `0x${string}`; payee: `0x${string}`; payer: `0x${string}`; salt: `0x${string}`; token: `0x${string}`; }
c.authorizedSigner`0x${string}`
c.chainIdnumber
c.escrow`0x${string}`
c.payee`0x${string}`
c.payer`0x${string}`
c.salt`0x${string}`
c.token`0x${string}`

Returns

`0x${string}` | Refusal


gatewayAccount()

gatewayAccount(network, word): string | undefined

CAIP-10 of a TransferSpec bytes32 account on network: on eip155:* the last 20 bytes as 0x lowercase hex, the first 12 being zero; on solana:* base58 of the 32 bytes. Anything else is undefined.

Parameters

ParameterType
networkstring
wordunknown

Returns

string | undefined


issuedDigest()

issuedDigest(c): Promise<`0x${string}` | Refusal>

the core's digestJson over the bound members, with request decoded and its carrier member removed, and opaque decoded without the LCP members (omitted when that leaves it empty). A value that does not decode is its string.

Parameters

ParameterType
cMppChallenge

Returns

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


keySearch()

keySearch(ref, receipt, h): Refusal | SessionRef

The read keys of a transfer made under the subscription's access key, from a receipt of the key's registration: the account whose key authorization carried h and registered the key (keyAccount), then accessKey with that account, the token's Transfer to the recipient's digest, and the keychain's AccessKeySpend filter for the account, the key and the token. Refused when ref carries no access key, or the receipt did not register it under h.

Parameters

ParameterType
refSessionRef
receiptEvmReceipt
h`0x${string}`

Returns

Refusal | SessionRef


mppSvmCarrier()

mppSvmCarrier(tx): Refusal | { h: `0x${string}`; memo: string; }

The one top-level Memo instruction (v3 or v4) whose UTF-8 data parses as an LCP string, and its hash. Memo instructions whose data is not an LCP string are not read. None is svm/no-carrier; more than one svm/memo-count.

Parameters

ParameterType
txSvmTx

Returns

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


network()

network(challenge): string | Refusal

The CAIP-2 network an MPP challenge pays on, read from its method, intent and methodDetails as each method defines it, with that method's default where it names one. A method whose challenge names no network is refused.

Parameters

ParameterType
challengeMppChallenge

Returns

string | Refusal


pairingsOf()

pairingsOf(c): Refusal | readonly MppPairing[]

Checks a challenge as issued (no LCP member in opaque) and names its pairings, in the order they are offered.

Parameters

ParameterType
cMppChallenge

Returns

Refusal | readonly MppPairing[]


parseChallenges()

parseChallenges(fieldValues): Refusal | MppChallenge[]

Reads WWW-Authenticate field values by RFC 9110's challenge grammar and keeps the Payment challenges, with quoted-strings unescaped and unknown parameters dropped. At most 8 KiB per value and 32 Payment challenges.

Parameters

ParameterType
fieldValuesreadonly string[]

Returns

Refusal | MppChallenge[]


place()

place(doc, h, link, option, agreementUrl?): Refusal | MppChallenge[]

A copy of doc in which the challenge whose bound members equal option carries the id derived from H and an opaque holding the seller's map plus legalContext, legalContextUrl and, when given, legalContextAgreementUrl. A Tempo subscription challenge's id is the bare base64url of H.

Parameters

ParameterType
docreadonly MppChallenge[]
h`0x${string}`
linkstring
optionMppChallenge
agreementUrl?string

Returns

Refusal | MppChallenge[]


problem()

problem(code): object

The MPP problem type and status for a refusal code.

Parameters

ParameterType
codestring

Returns

object

NameType
status402 | 500
typestring

read()

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

The buyer's reading: the challenges whose opaque carries an LCP hash and an https link and whose id derives from that hash, in document order. agreement is their agreement URL when one is present. A link or agreement URL of at most 2048 characters that parses as an absolute URL with a scheme other than https is mpp/link-not-https, and any other value that is not a link is mpp/legal-context-malformed; with no challenge read, a link of another scheme in any challenge gives mpp/link-not-https, else a malformed link gives mpp/legal-context-malformed.

Parameters

ParameterType
docreadonly MppChallenge[]

Returns

Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { challenges: MppChallenge[]; }; }


sessionResume()

sessionResume(c): Refusal | { channel: string; network: string; } | null

The network and channel a session challenge names for the client to resume, spelled as the pairing's channel.ref spells it: EVM, Tempo and Hedera in methodDetails.channelId (a bytes32, lowercase), Solana in methodDetails.channelId (a base58 address), XRPL in the request's channelId (64 hex characters, upper case). Null when the challenge names no channel; refused for a challenge of no session pairing, or a channel or network that cannot be read.

Parameters

ParameterType
cMppChallenge

Returns

Refusal | { channel: string; network: string; } | null


sessionStatus()

sessionStatus(ref, reader): Promise<SessionStatus>

evmStatus on the named logs, then, where ref.opened is present, one ChannelOpened log from opened.address naming the channel: on v2 its data word 3 (the salt) is h; on v1 the channel id recomputed from the event with salt h is the channel. Where ref.closes is present, the succeeded transaction must be a call to that escrow whose calldata starts with one of EVM_CLOSE_SELECTORS and whose first argument is that channel, else pending not-a-close. Where ref.accessKey.account is present, the succeeded receipt must also hold the account keychain's AccessKeySpend log naming that account, key and token, else failed binding-log-not-found. At most four calls.

Parameters

ParameterType
refSessionRef & object
readerEvmReader

Returns

Promise<SessionStatus>


tie()

tie(options): ["mpp", { challenges: MppChallenge[]; }]

The binding slot: the distinct challenges among options, each with exactly MPP's bound members, as issued.

Parameters

ParameterType
optionsreadonly MppChallenge[]

Returns

["mpp", { challenges: MppChallenge[]; }]


transferPresent()

transferPresent(ref, reader): Promise<EvmBreadthStatus>

evmStatus on the reported transaction with no named log; settled also requires one log from ref.asset with three topics and topics[0] = Transfer, else failed transfer-not-found. At most three calls.

Parameters

ParameterType
refEvmRef & object
readerEvmReader

Returns

Promise<EvmBreadthStatus>


usdcGatewaySalt()

usdcGatewaySalt(i): `0x${string}` | Refusal

usdc's Gateway salt: keccak256 of the JCS of the inputs with method "usdc", intent "charge", type "gateway".

Parameters

ParameterType
iGatewaySaltInput

Returns

`0x${string}` | Refusal


usdcNonce()

usdcNonce(id, realm, requestHash): `0x${string}` | Refusal

usdc's EIP-3009 nonce: keccak256 of the JCS of {id, method: "usdc", realm, intent: "charge", requestHash}, with requestHash written as 0x and 64 lowercase hex.

Parameters

ParameterType
idstring
realmstring
requestHash`0x${string}`

Returns

`0x${string}` | Refusal


usdcRequestHash()

usdcRequestHash(requestParam): Promise<`0x${string}` | Refusal>

keccak256 of the challenge's request parameter's decoded bytes, as 0x and lowercase hex. The bytes must be the RFC 8785 form of their own parse, else mpp/request-not-jcs; they are hashed as received.

Parameters

ParameterType
requestParamstring

Returns

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

References

chargeHedera

Re-exports chargeHedera


pairingsOfPlaced

Re-exports pairingsOfPlaced


ReceiveTypedData

Re-exports ReceiveTypedData

Last updated on

On this page

InterfacesGatewaySaltInputPropertiesHederaSessionUnsignedPropertiesMethodscomplete()ParametersReturnsLandedCredentialExtendsPropertiesMppChallengePropertiesMppChoiceExtended byPropertiesMppCredentialExtended byPropertiesRailSessionChoicePropertiesSessionChoiceExtendsPropertiesSessionRefExtendsPropertiesSessionWithinPropertiesSessionWithinUnsignedPropertiesMethodscomplete()ParametersReturnsSolanaChargeChoicePropertiesSolanaChargeUnsignedPropertiesMethodscomplete()ParametersReturnsSolanaSessionUnsignedPropertiesMethodscomplete()ParametersReturnsStacksChargeChoicePropertiesStellarChargeChoicePropertiesStellarChargeUnsignedPropertiesMethodscomplete()ParametersReturnsStripeSubscriptionReceiptPropertiesVoucherTypedDataPropertiesXrplChargeChoicePropertiesXrplChargeUnsignedPropertiesMethodscomplete()ParametersReturnsXrplSessionUnsignedPropertiesMethodscomplete()ParametersReturnsType AliasesGatewayPreimageHederaLandedCredentialMppIntentMppMethodMppPairingMppUnsignedUnion MembersType LiteralType LiteralType LiteralRailSessionUnsignedSessionStatusSessionUnsignedPropertiesMethodscomplete()ParametersReturnsvoucher()ParametersReturnsUsdcUnsignedWithinSigningRequestVariablesCARRIERchargeCardchargeNearIntentschargeSolanachargeStellarchargeStripechargeUsdcEvmchargeUsdcGatewaychargeUsdcSolanachargeUsdcStackschargeXrplEVM_CLOSE_SELECTORSevmAuthorizationevmHashevmPermit2evmTransactionLEGAL_CONTEXT_METADATA_KEYMPP_BINDINGSsessionEvmsessionHederasessionSolanasessionTemposessionXrplsubscriptionStripesubscriptionTempotempoMemotempoPushUSDC_CARRIERIndex SignatureFunctionsattributionMemo()ParametersReturnschallengeBound()ParametersReturnschallengeH()ParametersReturnschallengeHash()ParametersReturnschallengeId()ParametersReturnscheckAttribution()ParametersReturnsevmChannelId()ParametersReturnsgatewayAccount()ParametersReturnsissuedDigest()ParametersReturnskeySearch()ParametersReturnsmppSvmCarrier()ParametersReturnsnetwork()ParametersReturnspairingsOf()ParametersReturnsparseChallenges()ParametersReturnsplace()ParametersReturnsproblem()ParametersReturnsread()ParametersReturnssessionResume()ParametersReturnssessionStatus()ParametersReturnstie()ParametersReturnstransferPresent()ParametersReturnsusdcGatewaySalt()ParametersReturnsusdcNonce()ParametersReturnsusdcRequestHash()ParametersReturnsReferenceschargeHederapairingsOfPlacedReceiveTypedData