@piprail/sdk 1.6.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3912,6 +3912,18 @@ interface ConfirmInfo {
3912
3912
  /** Block number (EVM) or slot (Solana) as a string — numeric-agnostic. */
3913
3913
  height: string;
3914
3914
  }
3915
+ /**
3916
+ * A discovery signer — the bound wallet's address + a message signer. Returned
3917
+ * by {@link ResolvedNetwork.discoverySigner} and used ONLY for discovery
3918
+ * (ownership proofs / SIWX registration), never to move funds. Structurally what
3919
+ * the open-index register helpers consume.
3920
+ */
3921
+ interface DiscoverySigner {
3922
+ /** The wallet's own public address (EVM 0x…), declared in a SIWX challenge. */
3923
+ address: string;
3924
+ /** Sign an arbitrary UTF-8 message (EVM: eip191) — for proofs/SIWX only. */
3925
+ signMessage(message: string): Promise<string>;
3926
+ }
3915
3927
  /**
3916
3928
  * A driver bound to one concrete network — what the gate and client hold. Each
3917
3929
  * method's error behaviour is fixed by the SDK error standard (see ERRORS.md §5):
@@ -3987,6 +3999,19 @@ interface ResolvedNetwork {
3987
3999
  ready: boolean | 'n/a' | 'unknown';
3988
4000
  reason?: RecipientReason;
3989
4001
  }>;
4002
+ /**
4003
+ * OPTIONAL — a DISCOVERY signer for the bound wallet: its public address plus a
4004
+ * message signer, used only for ownership proofs + SIWX index registration,
4005
+ * NEVER the payment path. `signMessage` returns a chain-native signature string
4006
+ * (EVM: 0x eip191 hex, recoverable with `recoverMessageAddress` — exactly how
4007
+ * x402scan verifies origin ownership). Deliberately optional: a family ships it
4008
+ * only once an open index verifies its signatures — EVM today (the 402 Index
4009
+ * register path needs no signature at all). The client's `register()` skips
4010
+ * signature-gated steps for a family that omits it. The first optional contract
4011
+ * method, so it does NOT trigger the "implement in all families" rule for
4012
+ * REQUIRED methods. Returns `null` if the bound wallet can't sign.
4013
+ */
4014
+ discoverySigner?(wallet: WalletHandle): DiscoverySigner | null;
3990
4015
  /** Verify `ref` satisfies `accept`, RPC-only, in-process. */
3991
4016
  verify(ref: string, accept: X402AcceptEntry): Promise<VerifyResult>;
3992
4017
  }
@@ -4002,6 +4027,101 @@ interface PaymentDriver {
4002
4027
  resolve(opts: ResolveOptions): ResolvedNetwork | null;
4003
4028
  }
4004
4029
 
4030
+ /** The open directories PipRail can read from / write to. */
4031
+ type DiscoverySource = 'bazaar' | '402index' | 'x402scan';
4032
+ /** One payment option as an index reports it — looser than a live `accepts[]`
4033
+ * entry (indexes are cross-scheme: `exact` is the norm, `onchain-proof` is ours). */
4034
+ interface DiscoveredRail {
4035
+ scheme: string;
4036
+ network: string;
4037
+ asset?: string;
4038
+ amount?: string;
4039
+ payTo?: string;
4040
+ symbol?: string;
4041
+ }
4042
+ /** A resource as returned by an open index, normalized to one shape. */
4043
+ interface DiscoveredResource {
4044
+ /** The gated resource URL (what an agent then quotes/pays). */
4045
+ resource: string;
4046
+ /** Which open index surfaced it. */
4047
+ source: DiscoverySource;
4048
+ name?: string;
4049
+ description?: string;
4050
+ category?: string;
4051
+ /** Advertised price in USD, when the index reports one (402 Index). */
4052
+ priceUsd?: number;
4053
+ /** The payment options the index advertises (best-effort, cross-scheme). */
4054
+ rails: DiscoveredRail[];
4055
+ }
4056
+ /** The result of trying to list a resource on one open index. */
4057
+ interface RegisterOutcome {
4058
+ source: DiscoverySource;
4059
+ ok: boolean;
4060
+ /** HTTP status, when a request was made. */
4061
+ status?: number;
4062
+ /** Human note — success summary or the reason it didn't list. */
4063
+ detail?: string;
4064
+ /** A link to the listing, when the index returns one. */
4065
+ listingUrl?: string;
4066
+ }
4067
+ interface SearchOpenIndexesOptions {
4068
+ /** Free-text query (filtered client-side against name/description/resource). */
4069
+ query?: string;
4070
+ /** Which indexes to read. Default `['bazaar', '402index']` (both free). */
4071
+ sources?: DiscoverySource[];
4072
+ /** Max results per source before dedupe. Default 20. */
4073
+ limit?: number;
4074
+ signal?: AbortSignal;
4075
+ }
4076
+ /** What a merchant submits to register one resource on the open indexes. */
4077
+ interface RegisterInput {
4078
+ url: string;
4079
+ name?: string;
4080
+ description?: string;
4081
+ priceUsd?: number;
4082
+ /** Payment asset symbol, e.g. 'USDC' (402 Index metadata). */
4083
+ asset?: string;
4084
+ /** Payment network slug, e.g. 'base' (402 Index metadata). */
4085
+ network?: string;
4086
+ /** HTTP method the resource answers on. Default 'GET'. */
4087
+ method?: string;
4088
+ /**
4089
+ * Opt-in (default off): add a `via: '@piprail/sdk'` tag to the listing payload. It's the
4090
+ * MERCHANT's listing on a third-party index, so we never tag it by default; and it's
4091
+ * **best-effort** — an index may ignore an unrecognised field. The reliable, always-on
4092
+ * attribution is the `User-Agent` on the request + the `x-generator` stamp in your
4093
+ * emitted `/openapi.json`. Off by default keeps your listing clean and can't be seen as spam.
4094
+ */
4095
+ attribution?: boolean;
4096
+ }
4097
+ /** Normalize an index's network field to CAIP-2 when we recognise the slug;
4098
+ * pass a value that's already CAIP-2 (`namespace:reference`) through unchanged.
4099
+ * An unknown slug returns unchanged (no `:`), which the client treats as
4100
+ * "unresolved — don't hide it" rather than a confident mismatch. */
4101
+ declare function normalizeNetwork(network: string): string;
4102
+ /**
4103
+ * Search the open indexes for payable resources, in parallel, and merge them
4104
+ * (deduped by resource URL — the first source in `sources` wins). NEVER throws:
4105
+ * any index that errors, times out, or changes shape contributes `[]`.
4106
+ */
4107
+ declare function searchOpenIndexes(opts?: SearchOpenIndexesOptions): Promise<DiscoveredResource[]>;
4108
+ /**
4109
+ * Register a resource on **402 Index** — the primary, friction-free path: a
4110
+ * single POST, no auth, no signature, no payment. Searchable within seconds.
4111
+ * Returns a structured outcome; never throws for an HTTP/transport problem.
4112
+ */
4113
+ declare function register402Index(input: RegisterInput): Promise<RegisterOutcome>;
4114
+ /**
4115
+ * Register on **x402scan** via SIWX (Sign-In-With-X): POST the URL, sign the
4116
+ * EIP-4361 challenge with the merchant's own key, resend with the
4117
+ * `SIGN-IN-WITH-X` header. Facilitator-free, but **Base/Solana-only** and EVM
4118
+ * signing today. EXPERIMENTAL — the open SIWX handshake is a moving convention;
4119
+ * validate against x402scan before relying on it. Never throws.
4120
+ */
4121
+ declare function registerX402Scan(input: {
4122
+ url: string;
4123
+ }, signer: DiscoverySigner): Promise<RegisterOutcome>;
4124
+
4005
4125
  interface PaymentPolicy {
4006
4126
  /** Per-payment ceiling, human-readable (e.g. '0.10'). Compared using the
4007
4127
  * token's TRUE decimals, so a server can't understate the price. */
@@ -4315,6 +4435,56 @@ interface PipRailClientOptions {
4315
4435
  /** Logger hook. Default no-op. */
4316
4436
  onEvent?: (event: PipRailEvent) => void;
4317
4437
  }
4438
+ /** Options for {@link PipRailClient.discover}. */
4439
+ interface DiscoverOptions {
4440
+ /** Free-text query, matched against name/description/resource. */
4441
+ query?: string;
4442
+ /**
4443
+ * Which network's resources to return: a CAIP-2 id (or a chain slug like
4444
+ * `'base'` — normalized to CAIP-2 before matching), `'self'` (the client's
4445
+ * bound chain — the default, so results are payable by THIS client), or
4446
+ * `'any'` (every chain — the agent filters later).
4447
+ */
4448
+ network?: Caip2 | 'self' | 'any' | (string & {});
4449
+ /**
4450
+ * Coarse pre-filter: drop results whose advertised USD price exceeds this.
4451
+ * Results with no advertised price pass through — use `quote()` for the exact
4452
+ * figure before paying.
4453
+ */
4454
+ maxPrice?: number;
4455
+ /** Which open indexes to read. Default `['bazaar', '402index']` (both free). */
4456
+ sources?: DiscoverySource[];
4457
+ /** Max results per source before merge. Default 20. */
4458
+ limit?: number;
4459
+ }
4460
+ /** Options for {@link PipRailClient.register}. */
4461
+ interface RegisterOptions {
4462
+ /** Display name for the listing (defaults to the URL's host). */
4463
+ name?: string;
4464
+ description?: string;
4465
+ /** Advertised price in USD (metadata only). */
4466
+ priceUsd?: number;
4467
+ /** Payment asset symbol, e.g. `'USDC'` (metadata). */
4468
+ asset?: string;
4469
+ /** Payment network slug, e.g. `'base'` (defaults to the client's `chain` when it's a slug). */
4470
+ network?: string;
4471
+ /** HTTP method the resource answers on. Default 'GET'. */
4472
+ method?: string;
4473
+ /**
4474
+ * Which open indexes to list on. Default `['402index']` — no auth, no
4475
+ * signature. Add `'x402scan'` for the SIWX path (needs an EVM `discoverySigner`
4476
+ * and a Base/Solana rail). `'bazaar'` can't be written to (facilitator-only).
4477
+ */
4478
+ targets?: DiscoverySource[];
4479
+ /**
4480
+ * Opt-in (default off): tag the listing as built with PipRail (`via: '@piprail/sdk'`).
4481
+ * It's a third-party listing, so we never tag it by default — and it's best-effort (the
4482
+ * index may ignore the field). The always-on, reliable attribution is the request
4483
+ * `User-Agent` + the `x-generator` stamp in your emitted `/openapi.json` (see
4484
+ * `buildOpenApi`). Leave off unless you specifically want the listing tagged.
4485
+ */
4486
+ attribution?: boolean;
4487
+ }
4318
4488
  declare class PipRailClient {
4319
4489
  private readonly opts;
4320
4490
  private readonly maxRetries;
@@ -4390,6 +4560,38 @@ declare class PipRailClient {
4390
4560
  * resource is trivially "affordable"). No funds move.
4391
4561
  */
4392
4562
  canAfford(url: string, init?: RequestInit): Promise<boolean>;
4563
+ /**
4564
+ * Find payable resources on the OPEN x402 indexes — WITHOUT paying. Reads the
4565
+ * free indexes (CDP Bazaar + 402 Index by default), merges + dedupes them, and
4566
+ * by default returns only resources payable on THIS client's chain
4567
+ * (`network: 'self'`). Each result carries its advertised `rails[]`; feed a
4568
+ * chosen `resource` straight into `quote()` → `planPayment()` → `fetch()`.
4569
+ *
4570
+ * Nothing PipRail-hosted: these are third-party open directories. Never throws
4571
+ * for a read problem — an index that's down or changed simply contributes
4572
+ * nothing. Honest caveat: index results are cross-scheme (mostly the
4573
+ * mainstream `exact` scheme); `fetch()` pays only `onchain-proof` rails
4574
+ * directly (pay `exact` resources with the experimental `drivers/evm/exact.ts`).
4575
+ */
4576
+ discover(opts?: DiscoverOptions): Promise<DiscoveredResource[]>;
4577
+ /**
4578
+ * List a resource you run on the OPEN x402 registries, so agents can find it.
4579
+ * Default target is **402 Index** — one POST, no auth, no signature, no payment
4580
+ * (searchable within seconds). Add `'x402scan'` to also register via SIWX (one
4581
+ * wallet signature; EVM + a Base/Solana rail). Returns one {@link RegisterOutcome}
4582
+ * per target — a target the chain can't satisfy comes back `{ ok:false, detail }`,
4583
+ * never a throw. An explicit, developer-invoked action; it moves no funds, and
4584
+ * nothing is PipRail-hosted — you're listing on third-party open directories.
4585
+ */
4586
+ register(url: string, opts?: RegisterOptions): Promise<RegisterOutcome[]>;
4587
+ /**
4588
+ * The discovery signer for the bound wallet (its address + a message signer),
4589
+ * or `null` if the chain family doesn't support it (EVM does today). For
4590
+ * discovery only — ownership proofs (sign the bare origin string and pass it to
4591
+ * `buildOpenApi({ ownershipProofs })`) and SIWX registration. Never signs a
4592
+ * payment.
4593
+ */
4594
+ discoverySigner(): Promise<DiscoverySigner | null>;
4393
4595
  /**
4394
4596
  * Lower-level: drive any HTTP method through the 402 flow.
4395
4597
  *
@@ -4434,6 +4636,25 @@ declare class PipRailClient {
4434
4636
  */
4435
4637
  declare function planAcross(clients: PipRailClient[], url: string, init?: RequestInit): Promise<PaymentPlan | null>;
4436
4638
 
4639
+ /**
4640
+ * MCP-style tool annotations — optional, advisory hints that let an MCP client or
4641
+ * agent reason about a tool's *nature* (is it safe to call freely? does it move
4642
+ * value?). They mirror the MCP spec's `ToolAnnotations`. NOTE: hints only — a
4643
+ * client must never make a security decision solely on these; the spend policy is
4644
+ * the real boundary.
4645
+ */
4646
+ interface ToolAnnotations {
4647
+ /** Human-friendly title for the tool. */
4648
+ title?: string;
4649
+ /** True when the tool only READS — no state change, no funds moved. */
4650
+ readOnlyHint?: boolean;
4651
+ /** True when the tool may move value or do something not easily undone (only meaningful when not read-only). */
4652
+ destructiveHint?: boolean;
4653
+ /** True when calling repeatedly with the same args has no additional effect. */
4654
+ idempotentHint?: boolean;
4655
+ /** True when the tool reaches the open world — external indexes, chains, or arbitrary URLs. */
4656
+ openWorldHint?: boolean;
4657
+ }
4437
4658
  /** A framework-agnostic tool definition an agent runtime can register. */
4438
4659
  interface AgentTool {
4439
4660
  /** Unique tool name (snake_case, namespaced `piprail_…`). */
@@ -4442,21 +4663,181 @@ interface AgentTool {
4442
4663
  description: string;
4443
4664
  /** JSON Schema (draft-07 object) describing the arguments. */
4444
4665
  parameters: Record<string, unknown>;
4666
+ /** Advisory MCP-style hints about the tool's nature (read-only, value-moving, …). */
4667
+ annotations?: ToolAnnotations;
4445
4668
  /** Execute the tool. Returns a JSON-serialisable result. */
4446
4669
  invoke: (args: Record<string, unknown>) => Promise<unknown>;
4447
4670
  }
4448
4671
  /**
4449
- * Three tools wrapping a configured {@link PipRailClient}:
4672
+ * Five tools wrapping a configured {@link PipRailClient}:
4673
+ * - `piprail_discover(query?)` — FIND payable resources on the open x402
4674
+ * indexes, WITHOUT paying (the phone book — solves "what can I buy?").
4450
4675
  * - `piprail_quote_payment(url)` — price a gated URL WITHOUT paying.
4451
4676
  * - `piprail_plan_payment(url)` — check you CAN pay (balance + gas + recipient
4452
4677
  * readiness) across every rail the URL offers, WITHOUT paying.
4453
4678
  * - `piprail_pay_request(url, method?, body?)` — pay if needed and return the result.
4679
+ * - `piprail_register(url, …)` — LIST a resource you run on the open indexes so
4680
+ * other agents can find it (402 Index, no signature).
4454
4681
  *
4455
4682
  * A policy/approval refusal comes back as a structured `{ declined: true, reason }`
4456
4683
  * (not a thrown error), so the model can reason about it instead of crashing.
4457
4684
  */
4458
4685
  declare function paymentTools(client: PipRailClient): AgentTool[];
4459
4686
 
4687
+ /**
4688
+ * Discovery — make a gated resource FINDABLE, by emitting the open-standard
4689
+ * artifacts a crawler/index reads. PURE: this file turns the config a gate
4690
+ * already has into static metadata; it does NO network I/O and imports NO chain
4691
+ * library (protocol layer — STANDARDS §1). The runtime side (registering with /
4692
+ * searching the open indexes) lives in `indexes.ts` + the client.
4693
+ *
4694
+ * Three artifacts, three open conventions (see `.claude/research/x402-discovery.md`):
4695
+ * - OpenAPI-first `/openapi.json` (`x-payment-info` per op) — the live convention
4696
+ * the open indexes parse today (x402scan via `@agentcash/discovery`).
4697
+ * - `/.well-known/x402` origin file — x402scan's legacy bulk-register format.
4698
+ * - `_x402` DNS TXT line — the (experimental) DNS pointer draft.
4699
+ *
4700
+ * A merchant serves the emitted file on THEIR OWN origin (a static asset — no
4701
+ * backend). Nothing is PipRail-hosted. All opt-in; the pay path is untouched.
4702
+ *
4703
+ * Honesty note (held everywhere): there is no single ratified discovery
4704
+ * standard — OpenAPI-first is an emerging multi-vendor convention. Emit it, but
4705
+ * treat it as a moving target. And PipRail's own rails use `scheme:
4706
+ * 'onchain-proof'`; a merchant who also wants to be USEFULLY listed on the open
4707
+ * indexes should additionally offer a standard `exact` USDC rail on Base/Solana.
4708
+ */
4709
+
4710
+ /**
4711
+ * The static (nonce-free) shape of one payment option — the discoverable part of
4712
+ * an `X402AcceptEntry`. A live challenge adds a single-use `nonce`; discovery
4713
+ * metadata is long-lived, so it carries none. Produced by `gate.describe()`,
4714
+ * consumed by every emitter below.
4715
+ */
4716
+ interface PaymentRail {
4717
+ scheme: 'onchain-proof';
4718
+ network: Caip2;
4719
+ asset: AssetId;
4720
+ payTo: AddressId;
4721
+ /** Amount in the token's base units (already scaled by decimals). */
4722
+ amount: string;
4723
+ /** Human-readable amount, e.g. "0.05". */
4724
+ amountFormatted: string;
4725
+ decimals: number;
4726
+ symbol?: string;
4727
+ maxTimeoutSeconds: number;
4728
+ }
4729
+ /** One discoverable resource: its URL, how to call it, and how to pay it. */
4730
+ interface ResourceDescription {
4731
+ /** The full URL of the gated resource. */
4732
+ url: string;
4733
+ /** HTTP method the resource answers on. Default 'GET'. */
4734
+ method?: string;
4735
+ /** Human description (shown to agents browsing an index). */
4736
+ description?: string;
4737
+ /** The payment options the gate offers (its resolved `accepts`, nonce-free). */
4738
+ accepts: PaymentRail[];
4739
+ }
4740
+ /** Shared input for the emitters that describe a whole origin. */
4741
+ interface ManifestInput {
4742
+ /** The origin the merchant controls, e.g. 'https://api.example.com' (no path). */
4743
+ origin: string;
4744
+ /** The discoverable resources at that origin. */
4745
+ resources: ResourceDescription[];
4746
+ /**
4747
+ * Optional ownership proofs — each a signature of the BARE ORIGIN STRING by a
4748
+ * `payTo` key (EVM: eip191 hex). A trust badge on indexes that verify it
4749
+ * (x402scan: `recoverMessageAddress(origin, sig) === payTo`); never required to
4750
+ * be listed. Produce one with the driver's `signMessage(wallet, origin)`.
4751
+ */
4752
+ ownershipProofs?: string[];
4753
+ /** OpenAPI `info.title`. Default 'PipRail x402 resources'. */
4754
+ title?: string;
4755
+ /** OpenAPI `info.version`. Default '1.0.0'. */
4756
+ version?: string;
4757
+ /**
4758
+ * Stamp the doc with a `x-generator: "@piprail/sdk"` attribution — a standard,
4759
+ * unobtrusive "built with" marker (à la Swagger/Hugo) that rides along wherever
4760
+ * an index crawls your `/openapi.json`, so the tech spreads as you get found.
4761
+ * Default **true**; set `false` to omit it entirely. It's metadata only — it
4762
+ * changes nothing about how the resource is paid or listed.
4763
+ */
4764
+ attribution?: boolean;
4765
+ }
4766
+ /** What `x-generator` stamps when attribution is on — see {@link ManifestInput.attribution}. */
4767
+ declare const GENERATOR = "@piprail/sdk \u00B7 https://piprail.com";
4768
+ /** A minimal, valid OpenAPI 3.1 document carrying `x-payment-info` per paid op. */
4769
+ interface OpenApiDocument {
4770
+ openapi: '3.1.0';
4771
+ info: {
4772
+ title: string;
4773
+ version: string;
4774
+ };
4775
+ servers: {
4776
+ url: string;
4777
+ }[];
4778
+ paths: Record<string, Record<string, OpenApiOperation>>;
4779
+ /** "Built with @piprail/sdk" attribution (unless `attribution: false`). */
4780
+ 'x-generator'?: string;
4781
+ /** Provenance block the open indexes read (x402scan / agentcash). */
4782
+ 'x-agentcash-provenance'?: {
4783
+ ownershipProofs: string[];
4784
+ };
4785
+ }
4786
+ interface OpenApiOperation {
4787
+ summary?: string;
4788
+ responses: Record<string, {
4789
+ description: string;
4790
+ }>;
4791
+ /** The discovery payload an x402 index reads: the rails for this operation. */
4792
+ 'x-payment-info': {
4793
+ x402Version: 2;
4794
+ accepts: PaymentRail[];
4795
+ /** Bazaar-style input schema marker so a strict index doesn't "skip" the op. */
4796
+ bazaar: {
4797
+ discoverable: true;
4798
+ };
4799
+ };
4800
+ }
4801
+ /** x402scan's legacy origin file (`/.well-known/x402`). */
4802
+ interface WellKnownX402 {
4803
+ version: 1;
4804
+ resources: string[];
4805
+ ownershipProofs?: string[];
4806
+ }
4807
+ /** The `_x402` DNS TXT pointer record (experimental draft). */
4808
+ interface X402DnsRecord {
4809
+ name: string;
4810
+ type: 'TXT';
4811
+ value: string;
4812
+ }
4813
+ /**
4814
+ * Build a `/openapi.json` document — the OpenAPI-first discovery doc the live
4815
+ * open indexes parse. One path per resource (grouped by pathname, keyed by
4816
+ * method), each paid operation carrying `x-payment-info` with the resource's
4817
+ * rails. Ownership proofs (if any) ride at `x-agentcash-provenance`.
4818
+ *
4819
+ * The merchant serves the result at `https://<origin>/openapi.json`. Pure — no
4820
+ * network, no chain library, fully deterministic.
4821
+ */
4822
+ declare function buildOpenApi(input: ManifestInput): OpenApiDocument;
4823
+ /**
4824
+ * Build the `/.well-known/x402` origin file (x402scan's legacy bulk-register
4825
+ * format): the list of discoverable resource URLs + optional ownership proofs.
4826
+ * `/openapi.json` is the primary doc; this is a compatibility breadcrumb.
4827
+ */
4828
+ declare function buildWellKnownX402(input: ManifestInput): WellKnownX402;
4829
+ /**
4830
+ * Build the `_x402` DNS TXT record (experimental draft) that POINTS at a
4831
+ * discovery doc. `host` is the exact host the agent talks to (no inheritance);
4832
+ * `discoveryUrl` is the HTTPS manifest (typically `https://<origin>/openapi.json`).
4833
+ * Returns the record name + value to paste into the zone — PipRail never touches DNS.
4834
+ */
4835
+ declare function buildX402DnsTxt(input: {
4836
+ host: string;
4837
+ discoveryUrl: string;
4838
+ descriptor?: string;
4839
+ }): X402DnsRecord;
4840
+
4460
4841
  /**
4461
4842
  * The accept side: gate any endpoint behind a payment with one function.
4462
4843
  *
@@ -4584,6 +4965,15 @@ interface PaymentGate {
4584
4965
  }>;
4585
4966
  /** Verify an incoming `payment-signature` header value. */
4586
4967
  verify(paymentSignature: string | string[] | undefined): Promise<VerifyPaymentResult>;
4968
+ /**
4969
+ * Describe this gate's payment options as static, nonce-free discovery
4970
+ * metadata — feed it to the emitters in `discovery.ts` (`buildOpenApi` /
4971
+ * `buildWellKnownX402`) to make the resource findable. Reuses the same
4972
+ * resolved options the challenge is built from (so a `0x…` payTo / decimals
4973
+ * are already correct); unlike `challenge()`, it mints no nonce, because
4974
+ * discovery metadata is long-lived. Read-only — moves nothing on-chain.
4975
+ */
4976
+ describe(resourceUrl?: string): Promise<ResourceDescription>;
4587
4977
  }
4588
4978
  /**
4589
4979
  * Framework-agnostic core. Build one gate per gated resource and reuse it
@@ -4927,4 +5317,4 @@ declare function encodeXPaymentHeader(input: {
4927
5317
  x402Version?: number;
4928
5318
  }): string;
4929
5319
 
4930
- export { type AcceptOption, type AddressId, type AgentTool, type AlgorandToken, type AptosToken, type AssetId, type BuildExactParams, CHAINS, type Caip2, type ChainFamily, type ChainInput, type ChainName, type ChainPreset, type ChainSelector, type ConfirmInfo, ConfirmationTimeoutError, type CostEstimate, EIP3009_TYPES, EXACT_NETWORK_SLUGS, type EvmToken, type ExactAccept, type ExactAuthorization, type ExpressLikeMiddleware, type ExpressLikeNext, type ExpressLikeRequest, type ExpressLikeResponse, InsufficientFundsError, InvalidEnvelopeError, MaxRetriesExceededError, MissingDriverError, type NearToken, NoCompatibleAcceptError, NonReplayableBodyError, type PayBlocker, type PayOption, type PayWarning, PaymentDeclinedError, type PaymentDriver, type PaymentGate, type PaymentIntent, type PaymentPlan, type PaymentPolicy, PaymentTimeoutError, PipRailClient, type PipRailClientOptions, type PipRailCostQuote, PipRailError, type PipRailEvent, type PipRailQuote, type PolicyDecision, RecipientNotReadyError, type RecipientReason, type RequirePaymentOptions, type ResolveOptions, type ResolvedChain, type ResolvedNetwork, type ResolvedToken, type SolanaToken, type SpendAssetTotal, type SpendRecord, type SpendSummary, type StellarToken, type SuiToken, type TokenInfo, type TokenInput, type TonToken, type TronToken, UnknownTokenError, UnsupportedNetworkError, type VerifyErrorCode, type VerifyPaymentResult, type VerifyResult, type WalletBalance, type WalletHandle, type WalletInput, WrongChainError, WrongFamilyError, type X402AcceptEntry, type X402Challenge, type X402InvalidBody, type X402PaymentSignature, type X402Receipt, type X402ResourceObject, type XrplToken, buildChallengeHeader, buildExactAuthorization, buildReceiptHeader, buildSignatureHeader, chainIdForExactNetwork, createPaymentGate, encodeXPaymentHeader, evaluatePolicy, parseChallenge, parseExactRequirements, parseReceipt, parseSignatureHeader, paymentTools, pickAccept, planAcross, registerDriver, requirePayment, resolveChain, toInsufficientFundsError, toInvalidBody };
5320
+ export { type AcceptOption, type AddressId, type AgentTool, type AlgorandToken, type AptosToken, type AssetId, type BuildExactParams, CHAINS, type Caip2, type ChainFamily, type ChainInput, type ChainName, type ChainPreset, type ChainSelector, type ConfirmInfo, ConfirmationTimeoutError, type CostEstimate, type DiscoverOptions, type DiscoveredRail, type DiscoveredResource, type DiscoverySigner, type DiscoverySource, EIP3009_TYPES, EXACT_NETWORK_SLUGS, type EvmToken, type ExactAccept, type ExactAuthorization, type ExpressLikeMiddleware, type ExpressLikeNext, type ExpressLikeRequest, type ExpressLikeResponse, GENERATOR, InsufficientFundsError, InvalidEnvelopeError, type ManifestInput, MaxRetriesExceededError, MissingDriverError, type NearToken, NoCompatibleAcceptError, NonReplayableBodyError, type OpenApiDocument, type OpenApiOperation, type PayBlocker, type PayOption, type PayWarning, PaymentDeclinedError, type PaymentDriver, type PaymentGate, type PaymentIntent, type PaymentPlan, type PaymentPolicy, type PaymentRail, PaymentTimeoutError, PipRailClient, type PipRailClientOptions, type PipRailCostQuote, PipRailError, type PipRailEvent, type PipRailQuote, type PolicyDecision, RecipientNotReadyError, type RecipientReason, type RegisterInput, type RegisterOptions, type RegisterOutcome, type RequirePaymentOptions, type ResolveOptions, type ResolvedChain, type ResolvedNetwork, type ResolvedToken, type ResourceDescription, type SearchOpenIndexesOptions, type SolanaToken, type SpendAssetTotal, type SpendRecord, type SpendSummary, type StellarToken, type SuiToken, type TokenInfo, type TokenInput, type TonToken, type ToolAnnotations, type TronToken, UnknownTokenError, UnsupportedNetworkError, type VerifyErrorCode, type VerifyPaymentResult, type VerifyResult, type WalletBalance, type WalletHandle, type WalletInput, type WellKnownX402, WrongChainError, WrongFamilyError, type X402AcceptEntry, type X402Challenge, type X402DnsRecord, type X402InvalidBody, type X402PaymentSignature, type X402Receipt, type X402ResourceObject, type XrplToken, buildChallengeHeader, buildExactAuthorization, buildOpenApi, buildReceiptHeader, buildSignatureHeader, buildWellKnownX402, buildX402DnsTxt, chainIdForExactNetwork, createPaymentGate, encodeXPaymentHeader, evaluatePolicy, normalizeNetwork, parseChallenge, parseExactRequirements, parseReceipt, parseSignatureHeader, paymentTools, pickAccept, planAcross, register402Index, registerDriver, registerX402Scan, requirePayment, resolveChain, searchOpenIndexes, toInsufficientFundsError, toInvalidBody };