import type { GateResponse, VerifiedPaymentResponse, MeAgentProfile, AgentSummary, AgentCaps, AgentCapsPut, CapResetResult, ScopeReadResult, ScopeRuleInput, ScopeMode, PauseResult, AgentApiKeySummary, AgentApiKeyIssued, AgentReceiptList, DeviceStartResponse, DevicePollResponse, PayLinkSchemaResponse, PayLinkValidateResponse, PayLinkCreateBody, PayLinkCreateResponse, PayLinkListResponse, PayLinkDetail, PayLinkRevokeResponse, MerchantPaymentListResponse, SubscriberListResponse, MerchantProfileResponse, MerchantProfileBody, PayLinkInitiateResponse, PayLinkClaimResponse, MeAgentUpdateBody, AgentReceiptItem, AgentWebhookConfig, AgentWebhookConfigBody, AgentWebhookSecretResult, AgentWebhookDeliveryItem, AgentWebhookDeliveriesResponse, SubscriberDetail, SubscriberChargesResponse, SubscriberCancelResponse, ManageLinkResponse, SubscribersRollup, PeriodCapResult, CollectableResponse, CollectRecordResult, PermitSubmitResult, FireDigestResult, PayLinkEventsResponse, PayLinkRollup, PayLinkSummary, PayLinkMetadataBody, LinkGroupAssignResult, Group, GroupCreateBody, GroupUpdateBody, GroupListResponse, OrderListResponse, Order, ShipOrderBody, WebhookConfig, WebhookConfigBody, WebhookSecretResult, WebhookDeliveryItem, WebhookDeliveriesResponse, MeSiteListItem, MeSiteCreateBody, MeSiteCreateResponse, SiteDetail, SitePricingBody, SitePricingResult, SiteGatingBody, SiteGatingResult, RotateTokenResult, SiteTransactionsResponse, CategoryBreakdownResponse, SiteStatsResponse, PublisherGating, PublisherGatingBody, SiteClaimBody, SiteClaimResult, BotCatalogResponse, BotActivityResponse, SiweNonceResponse, MeWalletsListResponse, LinkVerifyResponse, OwnerTransferResult, MerchantApiKeySummary, MerchantApiKeyIssued, InviteCreateBody, InviteCreateResult, InvitesListResponse, InvitePreviewResponse, InviteRedeemResponse, OnboardingEmailResult, OnboardingEmailVerifyResult, AssetUploadResponse, EarningsSummary } from "./types.js"; export interface FetchGateResult { gated: boolean; gate: GateResponse | null; } /** * Check if a URL has a Xenarch gate by making a request and checking for 402. * Returns the parsed gate metadata in the new (post-XEN-179) shape. */ export declare function fetchGate(url: string): Promise; /** * Fetch gate info from the platform API by domain. */ export declare function fetchGateByDomain(apiBase: string, domain: string): Promise; /** * Verify a payment with the Xenarch platform using the on-chain tx_hash. * Stateless: the platform looks up the USDC Transfer event each call. */ export declare function verifyPayment(apiBase: string, gateId: string, txHash: string): Promise; export interface PaymentHistoryItem { url: string; domain: string; amount_usd: string; tx_hash: string; paid_at: string; } /** * Get payment history for a wallet address. */ export declare function getPaymentHistory(apiBase: string, walletAddress: string, options?: { domain?: string; limit?: number; }): Promise; /** Thrown when the SIWE session cookie is missing/expired (HTTP 401). */ export declare class SessionExpiredError extends Error { constructor(message?: string); } export declare function getMeAgent(apiBase: string, token: string): Promise; export declare function getAgentSummary(apiBase: string, token: string, period?: string): Promise; export declare function getAgentCaps(apiBase: string, token: string): Promise; export declare function putAgentCaps(apiBase: string, token: string, caps: AgentCapsPut): Promise; export declare function resetAgentDayCap(apiBase: string, token: string): Promise; export declare function getAgentScope(apiBase: string, token: string): Promise; export declare function putAgentScope(apiBase: string, token: string, defaultMode: ScopeMode, rules: ScopeRuleInput[]): Promise; export declare function setAgentPause(apiBase: string, token: string, paused: boolean): Promise; export declare function listAgentKeys(apiBase: string, token: string): Promise; export declare function createAgentKey(apiBase: string, token: string, label: string | null): Promise; export declare function rotateAgentKey(apiBase: string, token: string, keyId: string): Promise; export declare function revokeAgentKey(apiBase: string, token: string, keyId: string): Promise; export declare function listAgentReceipts(apiBase: string, token: string, query?: string): Promise; /** Begin a browser device-login. No auth — useless until a human approves. */ export declare function deviceStart(apiBase: string): Promise; /** Poll for approval; returns the session token once a human approves. */ export declare function devicePoll(apiBase: string, deviceCode: string): Promise; export declare function meSessionRequest(apiBase: string, sessionToken: string, method: string, path: string, body?: unknown, extraHeaders?: Record): Promise; /** GET /v1/links/schema — public, no auth. The create-body descriptor. */ export declare function getLinkSchema(apiBase: string): Promise; export declare function validateLink(apiBase: string, token: string, params: Record): Promise; export declare function createLink(apiBase: string, token: string, body: PayLinkCreateBody, idempotencyKey: string): Promise; export declare function listLinks(apiBase: string, token: string, query?: string): Promise; export declare function getLinkDetail(apiBase: string, token: string, linkId: string): Promise; export declare function revokeLink(apiBase: string, token: string, linkId: string): Promise; export declare function listMerchantPayments(apiBase: string, token: string, query?: string): Promise; export declare function listSubscribers(apiBase: string, token: string, query?: string): Promise; export declare function getMerchantProfile(apiBase: string, token: string): Promise; export declare function putMerchantProfile(apiBase: string, token: string, body: MerchantProfileBody): Promise; export declare function verifyMerchantDomain(apiBase: string, token: string): Promise; /** POST /v1/links/{id}/initiate — x402 envelope (HTTP 402 on success). */ export declare function initiateLinkPayment(apiBase: string, linkId: string): Promise; export declare function updateMeAgent(apiBase: string, token: string, body: MeAgentUpdateBody): Promise; export declare function getMeAgentReceipt(apiBase: string, token: string, receiptId: string): Promise; export declare function getAgentWebhook(apiBase: string, token: string): Promise; export declare function putAgentWebhook(apiBase: string, token: string, body: AgentWebhookConfigBody): Promise; export declare function rotateAgentWebhookSecret(apiBase: string, token: string): Promise; export declare function testAgentWebhook(apiBase: string, token: string): Promise; export declare function listAgentWebhookDeliveries(apiBase: string, token: string, query?: string): Promise; export declare function retryAgentWebhookDelivery(apiBase: string, token: string, deliveryId: string): Promise; /** * Like {@link meSessionRequest} but returns the raw response body as text — * for endpoints that emit non-JSON (e.g. GET /v1/orders/export.csv). */ export declare function meSessionRequestText(apiBase: string, sessionToken: string, method: string, path: string): Promise; export declare function getSubscriber(apiBase: string, token: string, subscriptionId: string): Promise; export declare function listSubscriberCharges(apiBase: string, token: string, subscriptionId: string, query?: string): Promise; export declare function getSubscribersRollup(apiBase: string, token: string): Promise; /** POST /v1/subscribers/{id}/merchant-cancel — reminder-mode only (409 else). */ export declare function merchantCancelSubscriber(apiBase: string, token: string, subscriptionId: string): Promise; /** POST /v1/subscribers/{id}/suspend — any mode; stops dunning, no on-chain. */ export declare function suspendSubscriber(apiBase: string, token: string, subscriptionId: string): Promise; /** POST /v1/subscribers/{id}/manage-link — mint a short-lived manage URL. */ export declare function mintManageLink(apiBase: string, token: string, subscriptionId: string, ttlSeconds?: number): Promise; /** * POST /v1/subscribers/{id}/period-cap — set/raise the buyer's per-period * budget. Manage-token gated (not SIWE): mint a manage token via * {@link mintManageLink} first, then pass it here. Metered-per-period only. */ export declare function setPeriodCap(apiBase: string, token: string, subscriptionId: string, manageToken: string, newCapUsdc: string): Promise; export declare function listPermitCollectable(apiBase: string, token: string, query?: string): Promise; export declare function listMeteredCollectable(apiBase: string, token: string, query?: string): Promise; /** POST /v1/subscribers/permit/fire-digest — re-fire the collectable digest. */ export declare function firePermitDigest(apiBase: string, token: string): Promise; /** * POST /v1/subscribers/{id}/permit/submit — record the on-chain USDC.permit * submission tx. Idempotent on (subscription_id, tx_hash); audit-trail only. */ export declare function submitPermit(apiBase: string, token: string, subscriptionId: string, txHash: string): Promise; /** * Thrown on HTTP **202** "awaiting confirmations": the tx is mined but not at * the server's required confirmation depth, so NOTHING is booked and the * caller MUST keep polling the same tx (XEN-574). A 2xx that is not success. */ export declare class ClaimAwaitingConfirmationsError extends Error { constructor(); } export declare function collectPermit(apiBase: string, token: string, subscriptionId: string, txHash: string): Promise; export declare function collectMetered(apiBase: string, token: string, subscriptionId: string, txHash: string): Promise; export declare function updateLinkMetadata(apiBase: string, token: string, linkId: string, body: PayLinkMetadataBody): Promise; export declare function listLinkEvents(apiBase: string, token: string, linkId: string, query?: string): Promise; export declare function getLinksRollup(apiBase: string, token: string): Promise; export declare function getLinksSummary(apiBase: string, token: string, query?: string): Promise; export declare function assignLinkGroup(apiBase: string, token: string, linkId: string, groupId: string | null): Promise; export declare function listGroups(apiBase: string, token: string): Promise; export declare function createGroup(apiBase: string, token: string, body: GroupCreateBody): Promise; export declare function updateGroup(apiBase: string, token: string, groupId: string, body: GroupUpdateBody): Promise; export declare function deleteGroup(apiBase: string, token: string, groupId: string): Promise; export declare function listOrders(apiBase: string, token: string, query?: string): Promise; export declare function shipOrder(apiBase: string, token: string, orderId: string, body: ShipOrderBody): Promise; export declare function exportOrdersCsv(apiBase: string, token: string, query?: string): Promise; export declare function getLinkWebhook(apiBase: string, token: string, linkId: string): Promise; export declare function putLinkWebhook(apiBase: string, token: string, linkId: string, body: WebhookConfigBody): Promise; export declare function rotateLinkWebhookSecret(apiBase: string, token: string, linkId: string): Promise; export declare function testLinkWebhook(apiBase: string, token: string, linkId: string): Promise; export declare function listLinkWebhookDeliveries(apiBase: string, token: string, linkId: string, query?: string): Promise; export declare function retryLinkWebhookDelivery(apiBase: string, token: string, linkId: string, deliveryId: string): Promise; export declare function listMeSites(apiBase: string, token: string): Promise; export declare function createMeSite(apiBase: string, token: string, body: MeSiteCreateBody): Promise; export declare function getMeSite(apiBase: string, token: string, siteId: string): Promise; export declare function deleteMeSite(apiBase: string, token: string, siteId: string): Promise; export declare function putSitePricing(apiBase: string, token: string, siteId: string, body: SitePricingBody): Promise; export declare function putSiteGating(apiBase: string, token: string, siteId: string, body: SiteGatingBody): Promise; export declare function rotateSiteToken(apiBase: string, token: string, siteId: string): Promise; export declare function getSiteStats(apiBase: string, token: string, siteId: string, query?: string): Promise; export declare function getSiteTransactions(apiBase: string, token: string, siteId: string, query?: string): Promise; export declare function getSiteCategoryBreakdown(apiBase: string, token: string, siteId: string): Promise; export declare function getPublisherGating(apiBase: string, token: string): Promise; export declare function putPublisherGating(apiBase: string, token: string, body: PublisherGatingBody): Promise; export declare function createSiteClaim(apiBase: string, token: string, body: SiteClaimBody): Promise; export declare function getBotActivity(apiBase: string, token: string, query?: string): Promise; /** GET /v1/bot-catalog — public, no auth. The full bot signature catalog. */ export declare function getBotCatalog(apiBase: string): Promise; export declare function listWallets(apiBase: string, token: string): Promise; /** POST /v1/me/wallets/link/nonce — session-authed SIWE nonce for linking. */ export declare function walletLinkNonce(apiBase: string, token: string): Promise; /** POST /v1/me/wallets/link/verify — attach the newly signed wallet. */ export declare function walletLinkVerify(apiBase: string, token: string, message: string, signature: string, label?: string | null): Promise; export declare function unlinkWallet(apiBase: string, token: string, address: string): Promise; export declare function setWalletLabel(apiBase: string, token: string, address: string, label: string | null): Promise; export declare function transferOwner(apiBase: string, token: string, newOwner: string): Promise; export declare function createMerchantKey(apiBase: string, token: string, label: string | null): Promise; export declare function listMerchantKeys(apiBase: string, token: string): Promise; export declare function rotateMerchantKey(apiBase: string, token: string, keyId: string): Promise; export declare function revokeMerchantKey(apiBase: string, token: string, keyId: string): Promise; export declare function createInvite(apiBase: string, token: string, body: InviteCreateBody): Promise; export declare function listInvites(apiBase: string, token: string): Promise; export declare function revokeInvite(apiBase: string, token: string, inviteId: string): Promise; /** POST /v1/auth/siwe/nonce — public. Server-issued single-use SIWE nonce. */ export declare function siweNonce(apiBase: string): Promise; /** GET /v1/invites/{token} — anonymous join-link preview (404 if dead). */ export declare function previewInvite(apiBase: string, inviteToken: string): Promise; /** POST /v1/invites/redeem — anonymous; the invitee's wallet signs SIWE. */ export declare function redeemInvite(apiBase: string, inviteToken: string, message: string, signature: string): Promise; export declare function setOnboardingEmail(apiBase: string, token: string, email: string): Promise; export declare function verifyOnboardingEmail(apiBase: string, token: string, code: string): Promise; /** * POST /v1/assets — multipart image upload (SIWE session). Callers hand us * raw bytes; MCP tools accept a URL or base64 (no disk paths over MCP). */ export declare function uploadAsset(apiBase: string, token: string, bytes: Uint8Array, filename: string, contentType: string): Promise; export declare function getEarningsSummary(apiBase: string, token: string): Promise; /** POST /v1/links/{id}/claim — record the on-chain tx against the link. */ export declare function claimLinkPayment(apiBase: string, linkId: string, txHash: string): Promise; //# sourceMappingURL=api.d.ts.map