@agnt-id/resolve 0.1.1 → 0.1.2

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/client.d.ts CHANGED
@@ -42,6 +42,18 @@ export declare class AgntClient {
42
42
  domains(name: string, options?: {
43
43
  chainId?: string;
44
44
  }): Promise<DomainResult>;
45
+ /**
46
+ * Get x402 payment config for a name, if enabled.
47
+ *
48
+ * @param name - Full name (e.g. "alice.agnt") or label (e.g. "alice")
49
+ * @returns x402 config if enabled, null otherwise
50
+ */
51
+ x402(name: string): Promise<{
52
+ paymentAddress: string;
53
+ pricePerCall: string;
54
+ chainId: number;
55
+ enabled: boolean;
56
+ } | null>;
45
57
  /**
46
58
  * Check if a name is available for registration.
47
59
  */
package/dist/client.js CHANGED
@@ -99,12 +99,26 @@ export class AgntClient {
99
99
  throw new AgntError(res.status, await safeText(res));
100
100
  return res.json();
101
101
  }
102
+ /**
103
+ * Get x402 payment config for a name, if enabled.
104
+ *
105
+ * @param name - Full name (e.g. "alice.agnt") or label (e.g. "alice")
106
+ * @returns x402 config if enabled, null otherwise
107
+ */
108
+ async x402(name) {
109
+ const result = await this.resolve(name);
110
+ if (!result?.records?.x402Config?.enabled)
111
+ return null;
112
+ return result.records.x402Config;
113
+ }
102
114
  /**
103
115
  * Check if a name is available for registration.
104
116
  */
105
117
  async available(name) {
106
118
  const full = ensureSuffix(name);
107
- const res = await this._fetch(`${this.gateway}/v1/agnt/available/${encodeURIComponent(full)}`);
119
+ const url = new URL(`${this.gateway}/v1/agnt/gateway/available/${encodeURIComponent(full)}`);
120
+ url.searchParams.set("chain_id", this.chainId);
121
+ const res = await this._fetch(url.toString());
108
122
  if (!res.ok)
109
123
  throw new AgntError(res.status, await safeText(res));
110
124
  const data = await res.json();
package/dist/types.d.ts CHANGED
@@ -22,8 +22,13 @@ export type AgntRecord = {
22
22
  did?: string;
23
23
  /** Trust model tags */
24
24
  trustModels?: ("reputation" | "crypto-economic" | "tee-attestation" | "social-graph")[];
25
- /** Whether the agent supports x402 payments */
26
- x402Support?: boolean;
25
+ /** x402 payment configuration */
26
+ x402Config?: {
27
+ paymentAddress: string;
28
+ pricePerCall: string;
29
+ chainId: number;
30
+ enabled: boolean;
31
+ };
27
32
  /** CAIP-10 address of reputation registry */
28
33
  reputationRegistry?: string;
29
34
  /** OASF skill slugs */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agnt-id/resolve",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Resolve .agnt names to wallets, agent endpoints, and identity records",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",