@vapi-network/core 0.2.0-dev.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.
@@ -0,0 +1,69 @@
1
+ import { z } from "zod";
2
+ import type { Hex } from "viem";
3
+ declare const keystoreSchema: z.ZodObject<{
4
+ version: z.ZodLiteral<1>;
5
+ address: z.ZodString;
6
+ crypto: z.ZodObject<{
7
+ cipher: z.ZodLiteral<"aes-256-gcm">;
8
+ ciphertext: z.ZodString;
9
+ iv: z.ZodString;
10
+ authTag: z.ZodString;
11
+ kdf: z.ZodLiteral<"scrypt">;
12
+ salt: z.ZodString;
13
+ kdfParams: z.ZodObject<{
14
+ n: z.ZodLiteral<number>;
15
+ r: z.ZodLiteral<8>;
16
+ p: z.ZodLiteral<1>;
17
+ dkLen: z.ZodLiteral<32>;
18
+ }, z.core.$strip>;
19
+ }, z.core.$strip>;
20
+ }, z.core.$strip>;
21
+ export type VapiKeystore = z.infer<typeof keystoreSchema>;
22
+ /** @deprecated Use VapiKeystore. */
23
+ export type AgentCashKeystore = VapiKeystore;
24
+ export declare class KeystoreError extends Error {
25
+ constructor(message: string, options?: ErrorOptions);
26
+ }
27
+ export declare function encryptPrivateKey(privateKey: Hex, passphrase: string): Promise<AgentCashKeystore>;
28
+ export declare function decryptPrivateKey(keystore: VapiKeystore, passphrase: string): Promise<Hex>;
29
+ export declare function createKeystore(passphrase: string, path?: string): Promise<{
30
+ address: import("viem").Address;
31
+ nonceManager?: import("viem").NonceManager | undefined;
32
+ sign: (parameters: {
33
+ hash: import("viem").Hash;
34
+ }) => Promise<Hex>;
35
+ signAuthorization: (parameters: import("viem").AuthorizationRequest) => Promise<import("viem/accounts").SignAuthorizationReturnType>;
36
+ signMessage: ({ message }: {
37
+ message: import("viem").SignableMessage;
38
+ }) => Promise<Hex>;
39
+ signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
40
+ serializer?: serializer | undefined;
41
+ } | undefined) => Promise<Hex>;
42
+ signTypedData: <const typedData extends import("viem").TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
43
+ publicKey: Hex;
44
+ source: "privateKey";
45
+ type: "local";
46
+ }>;
47
+ export declare function unlockKeystore(passphrase: string, path?: string): Promise<{
48
+ address: import("viem").Address;
49
+ nonceManager?: import("viem").NonceManager | undefined;
50
+ sign: (parameters: {
51
+ hash: import("viem").Hash;
52
+ }) => Promise<Hex>;
53
+ signAuthorization: (parameters: import("viem").AuthorizationRequest) => Promise<import("viem/accounts").SignAuthorizationReturnType>;
54
+ signMessage: ({ message }: {
55
+ message: import("viem").SignableMessage;
56
+ }) => Promise<Hex>;
57
+ signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
58
+ serializer?: serializer | undefined;
59
+ } | undefined) => Promise<Hex>;
60
+ signTypedData: <const typedData extends import("viem").TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
61
+ publicKey: Hex;
62
+ source: "privateKey";
63
+ type: "local";
64
+ }>;
65
+ export declare function getKeystorePassphrase(options?: {
66
+ confirm?: boolean;
67
+ }): Promise<string>;
68
+ export {};
69
+ //# sourceMappingURL=keystore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keystore.d.ts","sourceRoot":"","sources":["../src/keystore.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAWhC,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;iBAiBlB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC1D,oCAAoC;AACpC,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAE7C,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD;AAyBD,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,GAAG,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAiC5B;AAED,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAgChG;AAED,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,SAA0B;;;;;;;;;;oTAzFjF,CAAH;kBACc,CAAC;;;;;;GAkHjB;AAED,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,SAA0B;;;;;;;;;;oTArHjF,CAAH;kBACc,CAAC;;;;;;GAmIjB;AAED,wBAAsB,qBAAqB,CAAC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAoB5F"}
@@ -0,0 +1,521 @@
1
+ import { z } from "zod";
2
+ export declare const MARKETPLACE_DISCOVERY_PROTOCOL: "vapi.marketplace.discovery/1";
3
+ export declare const MARKETPLACE_RANKING_VERSION: "marketplace-ranking-v1";
4
+ export declare const MARKETPLACE_KINDS: readonly ["api", "service_offer", "open_request"];
5
+ export declare const MARKETPLACE_EXECUTION_METHODS: readonly ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"];
6
+ export declare const marketplaceExecutionMethodSchema: z.ZodEnum<{
7
+ HEAD: "HEAD";
8
+ GET: "GET";
9
+ POST: "POST";
10
+ PUT: "PUT";
11
+ PATCH: "PATCH";
12
+ DELETE: "DELETE";
13
+ }>;
14
+ export type MarketplaceExecutionMethod = z.infer<typeof marketplaceExecutionMethodSchema>;
15
+ export declare const marketplaceKindSchema: z.ZodEnum<{
16
+ api: "api";
17
+ service_offer: "service_offer";
18
+ open_request: "open_request";
19
+ }>;
20
+ export type MarketplaceKind = z.infer<typeof marketplaceKindSchema>;
21
+ /**
22
+ * The two orthogonal axes that describe an API listing, per
23
+ * `docs/adr/0008-two-axis-call-taxonomy.md`. `executionMode` answers "is vAPI in
24
+ * the request path"; `provenance` answers "where did this come from and what did
25
+ * we vouch for". Neither implies the other, and only `kind: "api"` carries them —
26
+ * Work kinds are first-party by construction and have no execution surface.
27
+ */
28
+ export declare const EXECUTION_MODES: readonly ["direct", "gateway"];
29
+ export declare const executionModeSchema: z.ZodEnum<{
30
+ direct: "direct";
31
+ gateway: "gateway";
32
+ }>;
33
+ export type ExecutionMode = z.infer<typeof executionModeSchema>;
34
+ export declare const PROVENANCES: readonly ["indexed", "self_listed", "partner"];
35
+ export declare const provenanceSchema: z.ZodEnum<{
36
+ partner: "partner";
37
+ indexed: "indexed";
38
+ self_listed: "self_listed";
39
+ }>;
40
+ export type Provenance = z.infer<typeof provenanceSchema>;
41
+ /** Provenances vAPI itself holds a record for, as opposed to mirrored catalog rows. */
42
+ export declare const FIRST_PARTY_PROVENANCES: readonly ["self_listed", "partner"];
43
+ export declare const firstPartyProvenanceSchema: z.ZodEnum<{
44
+ partner: "partner";
45
+ self_listed: "self_listed";
46
+ }>;
47
+ export type FirstPartyProvenance = z.infer<typeof firstPartyProvenanceSchema>;
48
+ export declare const marketplaceBadgeCodeSchema: z.ZodEnum<{
49
+ partner: "partner";
50
+ live_x402: "live_x402";
51
+ payout_wallet_confirmed: "payout_wallet_confirmed";
52
+ vapi_verified: "vapi_verified";
53
+ external_catalog: "external_catalog";
54
+ approved_vendor: "approved_vendor";
55
+ }>;
56
+ export type MarketplaceBadgeCode = z.infer<typeof marketplaceBadgeCodeSchema>;
57
+ export declare const marketplaceBadgeSchema: z.ZodObject<{
58
+ code: z.ZodEnum<{
59
+ partner: "partner";
60
+ live_x402: "live_x402";
61
+ payout_wallet_confirmed: "payout_wallet_confirmed";
62
+ vapi_verified: "vapi_verified";
63
+ external_catalog: "external_catalog";
64
+ approved_vendor: "approved_vendor";
65
+ }>;
66
+ label: z.ZodString;
67
+ }, z.core.$strict>;
68
+ export type MarketplaceBadge = z.infer<typeof marketplaceBadgeSchema>;
69
+ export declare const marketplacePublicFactSchema: z.ZodObject<{
70
+ label: z.ZodString;
71
+ value: z.ZodString;
72
+ }, z.core.$strict>;
73
+ export type MarketplacePublicFact = z.infer<typeof marketplacePublicFactSchema>;
74
+ export declare const apiMarketplaceHitSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
75
+ kind: z.ZodLiteral<"api">;
76
+ provenance: z.ZodEnum<{
77
+ partner: "partner";
78
+ self_listed: "self_listed";
79
+ }>;
80
+ execution: z.ZodObject<{
81
+ mode: z.ZodEnum<{
82
+ direct: "direct";
83
+ gateway: "gateway";
84
+ }>;
85
+ }, z.core.$strict>;
86
+ action: z.ZodObject<{
87
+ type: z.ZodLiteral<"invoke_api">;
88
+ href: z.ZodUnion<readonly [z.ZodString, z.ZodURL]>;
89
+ }, z.core.$strict>;
90
+ ref: z.ZodString;
91
+ card: z.ZodObject<{
92
+ title: z.ZodString;
93
+ summary: z.ZodString;
94
+ byline: z.ZodOptional<z.ZodString>;
95
+ bylineHref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
96
+ badges: z.ZodArray<z.ZodObject<{
97
+ code: z.ZodEnum<{
98
+ partner: "partner";
99
+ live_x402: "live_x402";
100
+ payout_wallet_confirmed: "payout_wallet_confirmed";
101
+ vapi_verified: "vapi_verified";
102
+ external_catalog: "external_catalog";
103
+ approved_vendor: "approved_vendor";
104
+ }>;
105
+ label: z.ZodString;
106
+ }, z.core.$strict>>;
107
+ facts: z.ZodArray<z.ZodObject<{
108
+ label: z.ZodString;
109
+ value: z.ZodString;
110
+ }, z.core.$strict>>;
111
+ }, z.core.$strict>;
112
+ }, z.core.$strict>, z.ZodObject<{
113
+ kind: z.ZodLiteral<"api">;
114
+ provenance: z.ZodLiteral<"indexed">;
115
+ execution: z.ZodObject<{
116
+ mode: z.ZodLiteral<"direct">;
117
+ url: z.ZodURL;
118
+ method: z.ZodNullable<z.ZodEnum<{
119
+ HEAD: "HEAD";
120
+ GET: "GET";
121
+ POST: "POST";
122
+ PUT: "PUT";
123
+ PATCH: "PATCH";
124
+ DELETE: "DELETE";
125
+ }>>;
126
+ network: z.ZodString;
127
+ }, z.core.$strict>;
128
+ action: z.ZodObject<{
129
+ type: z.ZodLiteral<"invoke_api">;
130
+ href: z.ZodUnion<readonly [z.ZodString, z.ZodURL]>;
131
+ }, z.core.$strict>;
132
+ ref: z.ZodString;
133
+ card: z.ZodObject<{
134
+ title: z.ZodString;
135
+ summary: z.ZodString;
136
+ byline: z.ZodOptional<z.ZodString>;
137
+ bylineHref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
138
+ badges: z.ZodArray<z.ZodObject<{
139
+ code: z.ZodEnum<{
140
+ partner: "partner";
141
+ live_x402: "live_x402";
142
+ payout_wallet_confirmed: "payout_wallet_confirmed";
143
+ vapi_verified: "vapi_verified";
144
+ external_catalog: "external_catalog";
145
+ approved_vendor: "approved_vendor";
146
+ }>;
147
+ label: z.ZodString;
148
+ }, z.core.$strict>>;
149
+ facts: z.ZodArray<z.ZodObject<{
150
+ label: z.ZodString;
151
+ value: z.ZodString;
152
+ }, z.core.$strict>>;
153
+ }, z.core.$strict>;
154
+ }, z.core.$strict>], "provenance">;
155
+ export type ApiMarketplaceHit = z.infer<typeof apiMarketplaceHitSchema>;
156
+ export declare const serviceOfferMarketplaceHitSchema: z.ZodObject<{
157
+ kind: z.ZodLiteral<"service_offer">;
158
+ action: z.ZodObject<{
159
+ type: z.ZodLiteral<"start_engagement">;
160
+ href: z.ZodUnion<readonly [z.ZodString, z.ZodURL]>;
161
+ }, z.core.$strict>;
162
+ ref: z.ZodString;
163
+ card: z.ZodObject<{
164
+ title: z.ZodString;
165
+ summary: z.ZodString;
166
+ byline: z.ZodOptional<z.ZodString>;
167
+ bylineHref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
168
+ badges: z.ZodArray<z.ZodObject<{
169
+ code: z.ZodEnum<{
170
+ partner: "partner";
171
+ live_x402: "live_x402";
172
+ payout_wallet_confirmed: "payout_wallet_confirmed";
173
+ vapi_verified: "vapi_verified";
174
+ external_catalog: "external_catalog";
175
+ approved_vendor: "approved_vendor";
176
+ }>;
177
+ label: z.ZodString;
178
+ }, z.core.$strict>>;
179
+ facts: z.ZodArray<z.ZodObject<{
180
+ label: z.ZodString;
181
+ value: z.ZodString;
182
+ }, z.core.$strict>>;
183
+ }, z.core.$strict>;
184
+ }, z.core.$strict>;
185
+ export type ServiceOfferMarketplaceHit = z.infer<typeof serviceOfferMarketplaceHitSchema>;
186
+ export declare const openRequestMarketplaceHitSchema: z.ZodObject<{
187
+ kind: z.ZodLiteral<"open_request">;
188
+ action: z.ZodObject<{
189
+ type: z.ZodLiteral<"propose_to_request">;
190
+ href: z.ZodUnion<readonly [z.ZodString, z.ZodURL]>;
191
+ }, z.core.$strict>;
192
+ ref: z.ZodString;
193
+ card: z.ZodObject<{
194
+ title: z.ZodString;
195
+ summary: z.ZodString;
196
+ byline: z.ZodOptional<z.ZodString>;
197
+ bylineHref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
198
+ badges: z.ZodArray<z.ZodObject<{
199
+ code: z.ZodEnum<{
200
+ partner: "partner";
201
+ live_x402: "live_x402";
202
+ payout_wallet_confirmed: "payout_wallet_confirmed";
203
+ vapi_verified: "vapi_verified";
204
+ external_catalog: "external_catalog";
205
+ approved_vendor: "approved_vendor";
206
+ }>;
207
+ label: z.ZodString;
208
+ }, z.core.$strict>>;
209
+ facts: z.ZodArray<z.ZodObject<{
210
+ label: z.ZodString;
211
+ value: z.ZodString;
212
+ }, z.core.$strict>>;
213
+ }, z.core.$strict>;
214
+ }, z.core.$strict>;
215
+ export type OpenRequestMarketplaceHit = z.infer<typeof openRequestMarketplaceHitSchema>;
216
+ export declare const marketplaceHitSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
217
+ kind: z.ZodLiteral<"api">;
218
+ provenance: z.ZodEnum<{
219
+ partner: "partner";
220
+ self_listed: "self_listed";
221
+ }>;
222
+ execution: z.ZodObject<{
223
+ mode: z.ZodEnum<{
224
+ direct: "direct";
225
+ gateway: "gateway";
226
+ }>;
227
+ }, z.core.$strict>;
228
+ action: z.ZodObject<{
229
+ type: z.ZodLiteral<"invoke_api">;
230
+ href: z.ZodUnion<readonly [z.ZodString, z.ZodURL]>;
231
+ }, z.core.$strict>;
232
+ ref: z.ZodString;
233
+ card: z.ZodObject<{
234
+ title: z.ZodString;
235
+ summary: z.ZodString;
236
+ byline: z.ZodOptional<z.ZodString>;
237
+ bylineHref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
238
+ badges: z.ZodArray<z.ZodObject<{
239
+ code: z.ZodEnum<{
240
+ partner: "partner";
241
+ live_x402: "live_x402";
242
+ payout_wallet_confirmed: "payout_wallet_confirmed";
243
+ vapi_verified: "vapi_verified";
244
+ external_catalog: "external_catalog";
245
+ approved_vendor: "approved_vendor";
246
+ }>;
247
+ label: z.ZodString;
248
+ }, z.core.$strict>>;
249
+ facts: z.ZodArray<z.ZodObject<{
250
+ label: z.ZodString;
251
+ value: z.ZodString;
252
+ }, z.core.$strict>>;
253
+ }, z.core.$strict>;
254
+ }, z.core.$strict>, z.ZodObject<{
255
+ kind: z.ZodLiteral<"api">;
256
+ provenance: z.ZodLiteral<"indexed">;
257
+ execution: z.ZodObject<{
258
+ mode: z.ZodLiteral<"direct">;
259
+ url: z.ZodURL;
260
+ method: z.ZodNullable<z.ZodEnum<{
261
+ HEAD: "HEAD";
262
+ GET: "GET";
263
+ POST: "POST";
264
+ PUT: "PUT";
265
+ PATCH: "PATCH";
266
+ DELETE: "DELETE";
267
+ }>>;
268
+ network: z.ZodString;
269
+ }, z.core.$strict>;
270
+ action: z.ZodObject<{
271
+ type: z.ZodLiteral<"invoke_api">;
272
+ href: z.ZodUnion<readonly [z.ZodString, z.ZodURL]>;
273
+ }, z.core.$strict>;
274
+ ref: z.ZodString;
275
+ card: z.ZodObject<{
276
+ title: z.ZodString;
277
+ summary: z.ZodString;
278
+ byline: z.ZodOptional<z.ZodString>;
279
+ bylineHref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
280
+ badges: z.ZodArray<z.ZodObject<{
281
+ code: z.ZodEnum<{
282
+ partner: "partner";
283
+ live_x402: "live_x402";
284
+ payout_wallet_confirmed: "payout_wallet_confirmed";
285
+ vapi_verified: "vapi_verified";
286
+ external_catalog: "external_catalog";
287
+ approved_vendor: "approved_vendor";
288
+ }>;
289
+ label: z.ZodString;
290
+ }, z.core.$strict>>;
291
+ facts: z.ZodArray<z.ZodObject<{
292
+ label: z.ZodString;
293
+ value: z.ZodString;
294
+ }, z.core.$strict>>;
295
+ }, z.core.$strict>;
296
+ }, z.core.$strict>], "provenance">, z.ZodObject<{
297
+ kind: z.ZodLiteral<"service_offer">;
298
+ action: z.ZodObject<{
299
+ type: z.ZodLiteral<"start_engagement">;
300
+ href: z.ZodUnion<readonly [z.ZodString, z.ZodURL]>;
301
+ }, z.core.$strict>;
302
+ ref: z.ZodString;
303
+ card: z.ZodObject<{
304
+ title: z.ZodString;
305
+ summary: z.ZodString;
306
+ byline: z.ZodOptional<z.ZodString>;
307
+ bylineHref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
308
+ badges: z.ZodArray<z.ZodObject<{
309
+ code: z.ZodEnum<{
310
+ partner: "partner";
311
+ live_x402: "live_x402";
312
+ payout_wallet_confirmed: "payout_wallet_confirmed";
313
+ vapi_verified: "vapi_verified";
314
+ external_catalog: "external_catalog";
315
+ approved_vendor: "approved_vendor";
316
+ }>;
317
+ label: z.ZodString;
318
+ }, z.core.$strict>>;
319
+ facts: z.ZodArray<z.ZodObject<{
320
+ label: z.ZodString;
321
+ value: z.ZodString;
322
+ }, z.core.$strict>>;
323
+ }, z.core.$strict>;
324
+ }, z.core.$strict>, z.ZodObject<{
325
+ kind: z.ZodLiteral<"open_request">;
326
+ action: z.ZodObject<{
327
+ type: z.ZodLiteral<"propose_to_request">;
328
+ href: z.ZodUnion<readonly [z.ZodString, z.ZodURL]>;
329
+ }, z.core.$strict>;
330
+ ref: z.ZodString;
331
+ card: z.ZodObject<{
332
+ title: z.ZodString;
333
+ summary: z.ZodString;
334
+ byline: z.ZodOptional<z.ZodString>;
335
+ bylineHref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
336
+ badges: z.ZodArray<z.ZodObject<{
337
+ code: z.ZodEnum<{
338
+ partner: "partner";
339
+ live_x402: "live_x402";
340
+ payout_wallet_confirmed: "payout_wallet_confirmed";
341
+ vapi_verified: "vapi_verified";
342
+ external_catalog: "external_catalog";
343
+ approved_vendor: "approved_vendor";
344
+ }>;
345
+ label: z.ZodString;
346
+ }, z.core.$strict>>;
347
+ facts: z.ZodArray<z.ZodObject<{
348
+ label: z.ZodString;
349
+ value: z.ZodString;
350
+ }, z.core.$strict>>;
351
+ }, z.core.$strict>;
352
+ }, z.core.$strict>]>;
353
+ export type MarketplaceHit = z.infer<typeof marketplaceHitSchema>;
354
+ export declare const marketplaceDiscoveryInputSchema: z.ZodObject<{
355
+ q: z.ZodOptional<z.ZodString>;
356
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
357
+ api: "api";
358
+ service_offer: "service_offer";
359
+ open_request: "open_request";
360
+ }>>>;
361
+ network: z.ZodOptional<z.ZodString>;
362
+ cursor: z.ZodOptional<z.ZodString>;
363
+ limit: z.ZodOptional<z.ZodNumber>;
364
+ includeUnverified: z.ZodOptional<z.ZodBoolean>;
365
+ }, z.core.$strict>;
366
+ export type MarketplaceDiscoveryInput = z.infer<typeof marketplaceDiscoveryInputSchema>;
367
+ /**
368
+ * True when a hit was mirrored from an external catalog rather than held by
369
+ * vAPI. The one predicate both ranking and presentation need, defined once here
370
+ * so neither has to re-derive it from the union shape.
371
+ */
372
+ export declare function isMirroredHit(hit: MarketplaceHit): boolean;
373
+ export declare const marketplaceDiscoveryPageSchema: z.ZodObject<{
374
+ protocol: z.ZodLiteral<"vapi.marketplace.discovery/1">;
375
+ items: z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
376
+ kind: z.ZodLiteral<"api">;
377
+ provenance: z.ZodEnum<{
378
+ partner: "partner";
379
+ self_listed: "self_listed";
380
+ }>;
381
+ execution: z.ZodObject<{
382
+ mode: z.ZodEnum<{
383
+ direct: "direct";
384
+ gateway: "gateway";
385
+ }>;
386
+ }, z.core.$strict>;
387
+ action: z.ZodObject<{
388
+ type: z.ZodLiteral<"invoke_api">;
389
+ href: z.ZodUnion<readonly [z.ZodString, z.ZodURL]>;
390
+ }, z.core.$strict>;
391
+ ref: z.ZodString;
392
+ card: z.ZodObject<{
393
+ title: z.ZodString;
394
+ summary: z.ZodString;
395
+ byline: z.ZodOptional<z.ZodString>;
396
+ bylineHref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
397
+ badges: z.ZodArray<z.ZodObject<{
398
+ code: z.ZodEnum<{
399
+ partner: "partner";
400
+ live_x402: "live_x402";
401
+ payout_wallet_confirmed: "payout_wallet_confirmed";
402
+ vapi_verified: "vapi_verified";
403
+ external_catalog: "external_catalog";
404
+ approved_vendor: "approved_vendor";
405
+ }>;
406
+ label: z.ZodString;
407
+ }, z.core.$strict>>;
408
+ facts: z.ZodArray<z.ZodObject<{
409
+ label: z.ZodString;
410
+ value: z.ZodString;
411
+ }, z.core.$strict>>;
412
+ }, z.core.$strict>;
413
+ }, z.core.$strict>, z.ZodObject<{
414
+ kind: z.ZodLiteral<"api">;
415
+ provenance: z.ZodLiteral<"indexed">;
416
+ execution: z.ZodObject<{
417
+ mode: z.ZodLiteral<"direct">;
418
+ url: z.ZodURL;
419
+ method: z.ZodNullable<z.ZodEnum<{
420
+ HEAD: "HEAD";
421
+ GET: "GET";
422
+ POST: "POST";
423
+ PUT: "PUT";
424
+ PATCH: "PATCH";
425
+ DELETE: "DELETE";
426
+ }>>;
427
+ network: z.ZodString;
428
+ }, z.core.$strict>;
429
+ action: z.ZodObject<{
430
+ type: z.ZodLiteral<"invoke_api">;
431
+ href: z.ZodUnion<readonly [z.ZodString, z.ZodURL]>;
432
+ }, z.core.$strict>;
433
+ ref: z.ZodString;
434
+ card: z.ZodObject<{
435
+ title: z.ZodString;
436
+ summary: z.ZodString;
437
+ byline: z.ZodOptional<z.ZodString>;
438
+ bylineHref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
439
+ badges: z.ZodArray<z.ZodObject<{
440
+ code: z.ZodEnum<{
441
+ partner: "partner";
442
+ live_x402: "live_x402";
443
+ payout_wallet_confirmed: "payout_wallet_confirmed";
444
+ vapi_verified: "vapi_verified";
445
+ external_catalog: "external_catalog";
446
+ approved_vendor: "approved_vendor";
447
+ }>;
448
+ label: z.ZodString;
449
+ }, z.core.$strict>>;
450
+ facts: z.ZodArray<z.ZodObject<{
451
+ label: z.ZodString;
452
+ value: z.ZodString;
453
+ }, z.core.$strict>>;
454
+ }, z.core.$strict>;
455
+ }, z.core.$strict>], "provenance">, z.ZodObject<{
456
+ kind: z.ZodLiteral<"service_offer">;
457
+ action: z.ZodObject<{
458
+ type: z.ZodLiteral<"start_engagement">;
459
+ href: z.ZodUnion<readonly [z.ZodString, z.ZodURL]>;
460
+ }, z.core.$strict>;
461
+ ref: z.ZodString;
462
+ card: z.ZodObject<{
463
+ title: z.ZodString;
464
+ summary: z.ZodString;
465
+ byline: z.ZodOptional<z.ZodString>;
466
+ bylineHref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
467
+ badges: z.ZodArray<z.ZodObject<{
468
+ code: z.ZodEnum<{
469
+ partner: "partner";
470
+ live_x402: "live_x402";
471
+ payout_wallet_confirmed: "payout_wallet_confirmed";
472
+ vapi_verified: "vapi_verified";
473
+ external_catalog: "external_catalog";
474
+ approved_vendor: "approved_vendor";
475
+ }>;
476
+ label: z.ZodString;
477
+ }, z.core.$strict>>;
478
+ facts: z.ZodArray<z.ZodObject<{
479
+ label: z.ZodString;
480
+ value: z.ZodString;
481
+ }, z.core.$strict>>;
482
+ }, z.core.$strict>;
483
+ }, z.core.$strict>, z.ZodObject<{
484
+ kind: z.ZodLiteral<"open_request">;
485
+ action: z.ZodObject<{
486
+ type: z.ZodLiteral<"propose_to_request">;
487
+ href: z.ZodUnion<readonly [z.ZodString, z.ZodURL]>;
488
+ }, z.core.$strict>;
489
+ ref: z.ZodString;
490
+ card: z.ZodObject<{
491
+ title: z.ZodString;
492
+ summary: z.ZodString;
493
+ byline: z.ZodOptional<z.ZodString>;
494
+ bylineHref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
495
+ badges: z.ZodArray<z.ZodObject<{
496
+ code: z.ZodEnum<{
497
+ partner: "partner";
498
+ live_x402: "live_x402";
499
+ payout_wallet_confirmed: "payout_wallet_confirmed";
500
+ vapi_verified: "vapi_verified";
501
+ external_catalog: "external_catalog";
502
+ approved_vendor: "approved_vendor";
503
+ }>;
504
+ label: z.ZodString;
505
+ }, z.core.$strict>>;
506
+ facts: z.ZodArray<z.ZodObject<{
507
+ label: z.ZodString;
508
+ value: z.ZodString;
509
+ }, z.core.$strict>>;
510
+ }, z.core.$strict>;
511
+ }, z.core.$strict>]>>;
512
+ nextCursor: z.ZodNullable<z.ZodString>;
513
+ unavailableKinds: z.ZodArray<z.ZodEnum<{
514
+ api: "api";
515
+ service_offer: "service_offer";
516
+ open_request: "open_request";
517
+ }>>;
518
+ rankingVersion: z.ZodLiteral<"marketplace-ranking-v1">;
519
+ }, z.core.$strict>;
520
+ export type MarketplaceDiscoveryPage = z.infer<typeof marketplaceDiscoveryPageSchema>;
521
+ //# sourceMappingURL=marketplace-contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketplace-contracts.d.ts","sourceRoot":"","sources":["../src/marketplace-contracts.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,13 @@
1
+ import { type LookupFunction } from "node:net";
2
+ export type LookupFn = (hostname: string) => Promise<string[]>;
3
+ export declare function assertPublicUrl(url: URL, options: {
4
+ allowPrivateNetwork: boolean;
5
+ lookup?: LookupFn;
6
+ timeoutMs?: number;
7
+ }): Promise<void>;
8
+ export declare function createPublicFetch(options: {
9
+ allowPrivateNetwork: boolean;
10
+ lookup?: LookupFn;
11
+ }): typeof fetch;
12
+ export declare function pinnedLookup(lookup: LookupFn): LookupFunction;
13
+ //# sourceMappingURL=net-guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"net-guard.d.ts","sourceRoot":"","sources":["../src/net-guard.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAGrD,MAAM,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAO/D,wBAAsB,eAAe,CACnC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE;IAAE,mBAAmB,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/E,OAAO,CAAC,IAAI,CAAC,CA0Cf;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB,GAAG,OAAO,KAAK,CAmDf;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,GAAG,cAAc,CAoB7D"}
@@ -0,0 +1,49 @@
1
+ import { ARC_TESTNET_CAIP2, BASE_MAINNET_CAIP2 } from "./x402-networks.js";
2
+ import { type Address, type Chain, type HttpTransport, type PublicClient } from "viem";
3
+ import { type LookupFn } from "./net-guard.js";
4
+ export { ARC_TESTNET_CAIP2, BASE_MAINNET_CAIP2 };
5
+ export declare const USDC_DECIMALS = 6;
6
+ export declare const DEFAULT_ARC_GAS_HEADROOM_ATOMIC = 50000n;
7
+ export type NetworkDefinition = {
8
+ chainId: number;
9
+ name: string;
10
+ usdc: Address;
11
+ gasToken: "ETH" | "USDC";
12
+ rpcEnv: string;
13
+ publicRpcUrl?: string;
14
+ };
15
+ export type ConfiguredNetwork = {
16
+ rpcUrl: string;
17
+ usdc: Address;
18
+ };
19
+ export type NetworkTransportOptions = {
20
+ allowPrivateNetwork?: boolean;
21
+ fetch?: typeof fetch;
22
+ lookup?: LookupFn;
23
+ };
24
+ export declare const NETWORKS: {
25
+ readonly "eip155:8453": {
26
+ readonly chainId: 8453;
27
+ readonly name: "Base mainnet";
28
+ readonly usdc: `0x${string}`;
29
+ readonly gasToken: "ETH";
30
+ readonly rpcEnv: "BASE_RPC_URL";
31
+ readonly publicRpcUrl: "https://mainnet.base.org";
32
+ };
33
+ readonly "eip155:5042002": {
34
+ readonly chainId: 5042002;
35
+ readonly name: "Arc testnet";
36
+ readonly usdc: `0x${string}`;
37
+ readonly gasToken: "USDC";
38
+ readonly rpcEnv: "ARC_TESTNET_RPC_URL";
39
+ };
40
+ };
41
+ export declare function parseEip155ChainId(network: string): number;
42
+ export declare function getNetworkDefinition(network: string): NetworkDefinition;
43
+ export declare function requireRpcUrl(network: string, configured: ConfiguredNetwork): string;
44
+ export declare function createChain(network: string, rpcUrl: string): Chain;
45
+ export declare function createNetworkPublicClient(network: string, configured: ConfiguredNetwork, options?: NetworkTransportOptions): PublicClient;
46
+ /** Create a JSON-RPC transport whose default fetch validates and pins destinations. */
47
+ export declare function createNetworkHttpTransport(rpcUrl: string, options?: NetworkTransportOptions): HttpTransport;
48
+ export declare function formatUsdc(amountAtomic: bigint): string;
49
+ //# sourceMappingURL=networks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networks.d.ts","sourceRoot":"","sources":["../src/networks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAEd,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;AACjD,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,+BAA+B,SAAU,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,KAAK,GAAG,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;CAgBiC,CAAC;AAEvD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAU1D;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAavE;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,MAAM,CAapF;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,CAalE;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,iBAAiB,EAC7B,OAAO,GAAE,uBAA4B,GACpC,YAAY,CAMd;AAED,uFAAuF;AACvF,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,uBAA4B,GACpC,aAAa,CAQf;AAED,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEvD"}