import type { HttpClient } from "../core/http.js"; import type { PaymentRequirement, PaymentReceipt, X402Signer, SecretResponse, OneclawResponse } from "../types.js"; /** * x402 resource — interact with the x402 payment protocol. * * The x402 protocol enables HTTP 402 micropayments: when free-tier * limits are exceeded, the API returns a 402 with payment instructions. * This resource provides methods to inspect, pay, and verify those * payment flows. */ export declare class X402Resource { private readonly http; private readonly signer?; constructor(http: HttpClient, signer?: X402Signer | undefined); /** * Probe a resource path to get its x402 payment requirement * without executing the request. Returns `null` if the resource * does not require payment (free-tier is not exhausted). */ getPaymentRequirement(resourcePath: string): Promise; /** * Sign and submit a payment for a given requirement. * Requires an `X402Signer` to be configured on the client or passed here. * * @returns The payment payload string to attach as `X-PAYMENT` header. */ pay(requirement: PaymentRequirement, signer?: X402Signer): Promise; /** * Verify that a payment receipt is valid by re-requesting the resource * with the payment header and checking for a successful response. */ verifyReceipt(resourcePath: string, receipt: PaymentReceipt): Promise; /** * Convenience method: pay for and then fetch a secret in one call. * Handles the full 402 flow: request → receive 402 → sign payment → * retry with payment header → return decrypted secret. */ withPayment(vaultId: string, key: string, signer?: X402Signer): Promise>; } //# sourceMappingURL=x402.d.ts.map