@lelantos-org/sdk / x402 / PayableSchemeClient
Interface: PayableSchemeClient
Defined in: @lelantos-org/sdk/dist/x402/mechanism.d.ts:24
A SchemeNetworkClient that can also price an offer without paying it.
@x402/core has no equivalent (its selector picks the first entry). The SDK's selector needs it to skip an offer this wallet cannot satisfy, which only the mechanism can determine.
Extends
Properties
scheme
readonly scheme: string;Defined in: @lelantos-org/sdk/dist/x402/types.d.ts:73
Inherited from
Methods
createPaymentPayload()
createPaymentPayload(
x402Version,
paymentRequirements,
context?
): Promise<PaymentPayloadResult>;Defined in: @lelantos-org/sdk/dist/x402/types.d.ts:74
Parameters
| Parameter | Type |
|---|---|
x402Version | number |
paymentRequirements | PaymentRequirements |
context? | PaymentPayloadContext |
Returns
Promise<PaymentPayloadResult>
Inherited from
SchemeNetworkClient.createPaymentPayload
quote()
quote(paymentRequirements, context?): Promise<PaymentQuote>;Defined in: @lelantos-org/sdk/dist/x402/mechanism.d.ts:41
Price paymentRequirements and judge whether this wallet can pay them, or reject with an X402PaymentError whose reason is unsupported-requirements.
Payability is a point-in-time answer: it reads the wallet as currently synced (an unsynced wallet has nothing to spend, so every offer is refused) and may be stale by the time createPaymentPayload runs.
context is what createPaymentPayload will be given, so a mechanism whose payer depends on the resource (the unshielded one derives a payer address per host) judges the payer it will pay from.
Must not move funds or mutate state: the selector calls this on offers it may discard.
Parameters
| Parameter | Type |
|---|---|
paymentRequirements | PaymentRequirements |
context? | PaymentPayloadContext |
Returns
Promise<PaymentQuote>