@zeroxyz/sdk 0.8.0 → 0.10.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/CHANGELOG.md +21 -0
- package/README.md +43 -7
- package/dist/{chunk-NUBD543C.js → chunk-A7WZYQXS.js} +579 -151
- package/dist/chunk-A7WZYQXS.js.map +1 -0
- package/dist/{chunk-72WCE7HE.cjs → chunk-IFVGW4ZN.cjs} +584 -151
- package/dist/chunk-IFVGW4ZN.cjs.map +1 -0
- package/dist/{client-f6vDYSHb.d.cts → client-D_ohktBl.d.cts} +220 -19
- package/dist/{client-f6vDYSHb.d.ts → client-D_ohktBl.d.ts} +220 -19
- package/dist/index.cjs +303 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +109 -3
- package/dist/index.d.ts +109 -3
- package/dist/index.js +232 -2
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +2 -2
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-72WCE7HE.cjs.map +0 -1
- package/dist/chunk-NUBD543C.js.map +0 -1
|
@@ -168,6 +168,7 @@ type UpstreamError = {
|
|
|
168
168
|
message?: string;
|
|
169
169
|
snippetHash: string;
|
|
170
170
|
snippetLength: number;
|
|
171
|
+
fixHint?: string;
|
|
171
172
|
};
|
|
172
173
|
type FetchResult = {
|
|
173
174
|
runId: string | null;
|
|
@@ -282,6 +283,153 @@ declare const sessionExchangeResponseSchema: z.ZodObject<{
|
|
|
282
283
|
}, z.core.$strip>;
|
|
283
284
|
type SessionExchangeResponse = z.infer<typeof sessionExchangeResponseSchema>;
|
|
284
285
|
|
|
286
|
+
type AgentAuthEndpoints = {
|
|
287
|
+
authorizationServer: string;
|
|
288
|
+
identityEndpoint: string;
|
|
289
|
+
claimEndpoint: string | null;
|
|
290
|
+
tokenEndpoint: string;
|
|
291
|
+
};
|
|
292
|
+
declare const identityEnvelopeSchema: z.ZodPipe<z.ZodObject<{
|
|
293
|
+
id: z.ZodString;
|
|
294
|
+
identity: z.ZodObject<{
|
|
295
|
+
assertion: z.ZodString;
|
|
296
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
297
|
+
refresh_token: z.ZodOptional<z.ZodObject<{
|
|
298
|
+
value: z.ZodString;
|
|
299
|
+
}, z.core.$loose>>;
|
|
300
|
+
}, z.core.$loose>;
|
|
301
|
+
claim: z.ZodOptional<z.ZodObject<{
|
|
302
|
+
token: z.ZodOptional<z.ZodString>;
|
|
303
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
304
|
+
}, z.core.$loose>>;
|
|
305
|
+
}, z.core.$loose>, z.ZodTransform<{
|
|
306
|
+
registrationId: string;
|
|
307
|
+
identityAssertion: string;
|
|
308
|
+
assertionExpires: string | null;
|
|
309
|
+
refreshToken: string | null;
|
|
310
|
+
claimToken: string | null;
|
|
311
|
+
claimTokenExpires: string | null;
|
|
312
|
+
}, {
|
|
313
|
+
[x: string]: unknown;
|
|
314
|
+
id: string;
|
|
315
|
+
identity: {
|
|
316
|
+
[x: string]: unknown;
|
|
317
|
+
assertion: string;
|
|
318
|
+
expires_at?: string | undefined;
|
|
319
|
+
refresh_token?: {
|
|
320
|
+
[x: string]: unknown;
|
|
321
|
+
value: string;
|
|
322
|
+
} | undefined;
|
|
323
|
+
};
|
|
324
|
+
claim?: {
|
|
325
|
+
[x: string]: unknown;
|
|
326
|
+
token?: string | undefined;
|
|
327
|
+
expires_at?: string | undefined;
|
|
328
|
+
} | undefined;
|
|
329
|
+
}>>;
|
|
330
|
+
type AgentRegistration = z.infer<typeof identityEnvelopeSchema>;
|
|
331
|
+
declare const agentTokenResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
332
|
+
access_token: z.ZodString;
|
|
333
|
+
}, z.core.$loose>, z.ZodTransform<{
|
|
334
|
+
accessToken: string;
|
|
335
|
+
}, {
|
|
336
|
+
[x: string]: unknown;
|
|
337
|
+
access_token: string;
|
|
338
|
+
}>>;
|
|
339
|
+
type AgentToken = z.infer<typeof agentTokenResponseSchema>;
|
|
340
|
+
declare const startClaimResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
341
|
+
attempt: z.ZodObject<{
|
|
342
|
+
verification_uri: z.ZodString;
|
|
343
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
344
|
+
}, z.core.$loose>;
|
|
345
|
+
}, z.core.$loose>, z.ZodTransform<{
|
|
346
|
+
verificationUri: string;
|
|
347
|
+
expiresAt: string | null;
|
|
348
|
+
}, {
|
|
349
|
+
[x: string]: unknown;
|
|
350
|
+
attempt: {
|
|
351
|
+
[x: string]: unknown;
|
|
352
|
+
verification_uri: string;
|
|
353
|
+
expires_at?: string | undefined;
|
|
354
|
+
};
|
|
355
|
+
}>>;
|
|
356
|
+
type AgentClaimAttempt = z.infer<typeof startClaimResponseSchema>;
|
|
357
|
+
declare const completeClaimResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
358
|
+
identity: z.ZodObject<{
|
|
359
|
+
assertion: z.ZodString;
|
|
360
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
361
|
+
refresh_token: z.ZodOptional<z.ZodObject<{
|
|
362
|
+
value: z.ZodString;
|
|
363
|
+
}, z.core.$loose>>;
|
|
364
|
+
}, z.core.$loose>;
|
|
365
|
+
}, z.core.$loose>, z.ZodTransform<{
|
|
366
|
+
identityAssertion: string;
|
|
367
|
+
assertionExpires: string | null;
|
|
368
|
+
refreshToken: string | null;
|
|
369
|
+
}, {
|
|
370
|
+
[x: string]: unknown;
|
|
371
|
+
identity: {
|
|
372
|
+
[x: string]: unknown;
|
|
373
|
+
assertion: string;
|
|
374
|
+
expires_at?: string | undefined;
|
|
375
|
+
refresh_token?: {
|
|
376
|
+
[x: string]: unknown;
|
|
377
|
+
value: string;
|
|
378
|
+
} | undefined;
|
|
379
|
+
};
|
|
380
|
+
}>>;
|
|
381
|
+
type AgentVerifiedIdentity = z.infer<typeof completeClaimResponseSchema>;
|
|
382
|
+
type CompleteClaimResult = {
|
|
383
|
+
status: "not_confirmed";
|
|
384
|
+
} | {
|
|
385
|
+
status: "invalid_code";
|
|
386
|
+
} | {
|
|
387
|
+
status: "expired";
|
|
388
|
+
code: string;
|
|
389
|
+
} | ({
|
|
390
|
+
status: "ok";
|
|
391
|
+
} & AgentVerifiedIdentity);
|
|
392
|
+
declare const agentZeroSessionSchema: z.ZodObject<{
|
|
393
|
+
accessToken: z.ZodString;
|
|
394
|
+
refreshToken: z.ZodString;
|
|
395
|
+
expiresIn: z.ZodNumber;
|
|
396
|
+
user: z.ZodObject<{
|
|
397
|
+
id: z.ZodString;
|
|
398
|
+
}, z.core.$loose>;
|
|
399
|
+
walletAddress: z.ZodOptional<z.ZodString>;
|
|
400
|
+
}, z.core.$loose>;
|
|
401
|
+
type AgentZeroSession = z.infer<typeof agentZeroSessionSchema>;
|
|
402
|
+
type AgentSignupResult = {
|
|
403
|
+
registration: AgentRegistration;
|
|
404
|
+
session: AgentZeroSession;
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
declare class AuthAgent {
|
|
408
|
+
private readonly client;
|
|
409
|
+
private endpointsPromise;
|
|
410
|
+
constructor(client: ZeroClient);
|
|
411
|
+
signup: () => Promise<AgentSignupResult>;
|
|
412
|
+
register: () => Promise<AgentRegistration>;
|
|
413
|
+
exchangeAssertion: (identityAssertion: string) => Promise<AgentToken>;
|
|
414
|
+
exchangeAtZero: (accessToken: string, opts?: {
|
|
415
|
+
signal?: AbortSignal;
|
|
416
|
+
}) => Promise<AgentZeroSession>;
|
|
417
|
+
startClaim: (input: {
|
|
418
|
+
claimToken: string;
|
|
419
|
+
email: string;
|
|
420
|
+
}) => Promise<AgentClaimAttempt>;
|
|
421
|
+
completeClaim: (input: {
|
|
422
|
+
claimToken: string;
|
|
423
|
+
userCode: string;
|
|
424
|
+
}) => Promise<CompleteClaimResult>;
|
|
425
|
+
endpoints: () => Promise<AgentAuthEndpoints>;
|
|
426
|
+
private discover;
|
|
427
|
+
private getJson;
|
|
428
|
+
private postJson;
|
|
429
|
+
private postForm;
|
|
430
|
+
private post;
|
|
431
|
+
}
|
|
432
|
+
|
|
285
433
|
declare class AuthDevice {
|
|
286
434
|
private readonly client;
|
|
287
435
|
constructor(client: ZeroClient);
|
|
@@ -305,6 +453,7 @@ type SignOptions = {
|
|
|
305
453
|
};
|
|
306
454
|
declare class Auth {
|
|
307
455
|
private readonly client;
|
|
456
|
+
readonly agent: AuthAgent;
|
|
308
457
|
readonly device: AuthDevice;
|
|
309
458
|
constructor(client: ZeroClient);
|
|
310
459
|
me: (opts?: {
|
|
@@ -372,7 +521,9 @@ type CreateBugReportResponse = z.infer<typeof createBugReportResponseSchema>;
|
|
|
372
521
|
declare class BugReports {
|
|
373
522
|
private readonly client;
|
|
374
523
|
constructor(client: ZeroClient);
|
|
375
|
-
create: (input: CreateBugReportInput
|
|
524
|
+
create: (input: CreateBugReportInput & {
|
|
525
|
+
contextSeed?: string;
|
|
526
|
+
}, opts?: {
|
|
376
527
|
signal?: AbortSignal;
|
|
377
528
|
}) => Promise<CreateBugReportResponse>;
|
|
378
529
|
}
|
|
@@ -401,6 +552,17 @@ declare const capabilityResponseSchema: z.ZodObject<{
|
|
|
401
552
|
instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
402
553
|
displayCostAmount: z.ZodString;
|
|
403
554
|
displayCostAsset: z.ZodString;
|
|
555
|
+
priceDynamic: z.ZodOptional<z.ZodBoolean>;
|
|
556
|
+
priceHint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
557
|
+
priceStatus: z.ZodOptional<z.ZodEnum<{
|
|
558
|
+
priced: "priced";
|
|
559
|
+
proven_free: "proven_free";
|
|
560
|
+
free_handshake: "free_handshake";
|
|
561
|
+
unknown_unparsed: "unknown_unparsed";
|
|
562
|
+
unprobed: "unprobed";
|
|
563
|
+
}>>;
|
|
564
|
+
priceSource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
565
|
+
requiresHandshake: z.ZodOptional<z.ZodBoolean>;
|
|
404
566
|
reviewCount: z.ZodNumber;
|
|
405
567
|
rating: z.ZodObject<{
|
|
406
568
|
score: z.ZodString;
|
|
@@ -430,7 +592,37 @@ declare const capabilityResponseSchema: z.ZodObject<{
|
|
|
430
592
|
costAmount: z.ZodString;
|
|
431
593
|
costPer: z.ZodString;
|
|
432
594
|
priority: z.ZodNumber;
|
|
595
|
+
asset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
596
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
597
|
+
depositMicros: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
598
|
+
planRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
599
|
+
}, z.core.$strip>>>;
|
|
600
|
+
sessionDeposit: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
601
|
+
amountUsd: z.ZodString;
|
|
602
|
+
asset: z.ZodString;
|
|
433
603
|
}, z.core.$strip>>>;
|
|
604
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
605
|
+
kind: z.ZodString;
|
|
606
|
+
summary: z.ZodString;
|
|
607
|
+
primary: z.ZodNullable<z.ZodObject<{
|
|
608
|
+
kind: z.ZodString;
|
|
609
|
+
protocol: z.ZodString;
|
|
610
|
+
network: z.ZodNullable<z.ZodString>;
|
|
611
|
+
amountUsd: z.ZodNullable<z.ZodString>;
|
|
612
|
+
per: z.ZodString;
|
|
613
|
+
confidence: z.ZodString;
|
|
614
|
+
depositUsd: z.ZodOptional<z.ZodString>;
|
|
615
|
+
}, z.core.$strip>>;
|
|
616
|
+
accepted: z.ZodArray<z.ZodObject<{
|
|
617
|
+
kind: z.ZodString;
|
|
618
|
+
protocol: z.ZodString;
|
|
619
|
+
network: z.ZodNullable<z.ZodString>;
|
|
620
|
+
amountUsd: z.ZodNullable<z.ZodString>;
|
|
621
|
+
per: z.ZodString;
|
|
622
|
+
confidence: z.ZodString;
|
|
623
|
+
depositUsd: z.ZodOptional<z.ZodString>;
|
|
624
|
+
}, z.core.$strip>>;
|
|
625
|
+
}, z.core.$strip>>;
|
|
434
626
|
availabilityStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
435
627
|
unknown: "unknown";
|
|
436
628
|
healthy: "healthy";
|
|
@@ -635,21 +827,15 @@ declare class Runs {
|
|
|
635
827
|
}) => Promise<BatchReviewResponse>;
|
|
636
828
|
}
|
|
637
829
|
|
|
830
|
+
/** @internal Zero-surface constant — not part of the supported partner contract. */
|
|
831
|
+
declare const USDC_BASE: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913";
|
|
832
|
+
/** @internal Zero-surface constant — not part of the supported partner contract. */
|
|
833
|
+
declare const USDC_TEMPO: "0x20c000000000000000000000b9537d11c60e8b50";
|
|
834
|
+
/** @internal Zero-surface constant — not part of the supported partner contract. */
|
|
835
|
+
declare const USDC_DECIMALS = 6;
|
|
836
|
+
/** @internal Zero-surface constant — not part of the supported partner contract. */
|
|
638
837
|
type BalanceChainId = "base" | "tempo";
|
|
639
838
|
|
|
640
|
-
declare const migrateAuthorizationResponseSchema: z.ZodObject<{
|
|
641
|
-
transactionHash: z.ZodString;
|
|
642
|
-
}, z.core.$strip>;
|
|
643
|
-
type MigrateAuthorization = {
|
|
644
|
-
from: string;
|
|
645
|
-
to: string;
|
|
646
|
-
value: string;
|
|
647
|
-
validAfter: string;
|
|
648
|
-
validBefore: string;
|
|
649
|
-
nonce: string;
|
|
650
|
-
signature: string;
|
|
651
|
-
};
|
|
652
|
-
type MigrateAuthorizationResponse = z.infer<typeof migrateAuthorizationResponseSchema>;
|
|
653
839
|
type BalanceReadError = {
|
|
654
840
|
chain: BalanceChainId;
|
|
655
841
|
message: string;
|
|
@@ -673,7 +859,10 @@ declare class Wallet {
|
|
|
673
859
|
private readonly client;
|
|
674
860
|
private readonly clients;
|
|
675
861
|
constructor(client: ZeroClient);
|
|
676
|
-
get
|
|
862
|
+
private get configuredAddress();
|
|
863
|
+
address: (opts?: {
|
|
864
|
+
signal?: AbortSignal;
|
|
865
|
+
}) => Promise<`0x${string}`>;
|
|
677
866
|
balance: (opts?: BalanceOptions) => Promise<WalletBalance>;
|
|
678
867
|
list: (opts?: {
|
|
679
868
|
signal?: AbortSignal;
|
|
@@ -681,9 +870,6 @@ declare class Wallet {
|
|
|
681
870
|
provision: (opts?: {
|
|
682
871
|
signal?: AbortSignal;
|
|
683
872
|
}) => Promise<UserWalletDto>;
|
|
684
|
-
migrateAuthorization: (authorization: MigrateAuthorization, opts?: {
|
|
685
|
-
signal?: AbortSignal;
|
|
686
|
-
}) => Promise<MigrateAuthorizationResponse>;
|
|
687
873
|
fundingUrl: (opts?: FundingUrlOptions) => Promise<string>;
|
|
688
874
|
private getPublicClient;
|
|
689
875
|
/**
|
|
@@ -750,6 +936,11 @@ declare const searchResultSchema: z.ZodObject<{
|
|
|
750
936
|
amount: z.ZodString;
|
|
751
937
|
asset: z.ZodString;
|
|
752
938
|
}, z.core.$strip>;
|
|
939
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
940
|
+
kind: z.ZodString;
|
|
941
|
+
summary: z.ZodString;
|
|
942
|
+
}, z.core.$strip>>;
|
|
943
|
+
protocol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
753
944
|
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
754
945
|
rating: z.ZodObject<{
|
|
755
946
|
score: z.ZodString;
|
|
@@ -797,6 +988,11 @@ declare const searchResponseSchema: z.ZodObject<{
|
|
|
797
988
|
amount: z.ZodString;
|
|
798
989
|
asset: z.ZodString;
|
|
799
990
|
}, z.core.$strip>;
|
|
991
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
992
|
+
kind: z.ZodString;
|
|
993
|
+
summary: z.ZodString;
|
|
994
|
+
}, z.core.$strip>>;
|
|
995
|
+
protocol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
800
996
|
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
801
997
|
rating: z.ZodObject<{
|
|
802
998
|
score: z.ZodString;
|
|
@@ -912,7 +1108,12 @@ declare class ZeroClient {
|
|
|
912
1108
|
peekManagedAccount: () => LocalAccount | null;
|
|
913
1109
|
search: (query: string, opts?: SearchOptions) => Promise<SearchResponse>;
|
|
914
1110
|
fetch: (url: string, opts?: FetchOptions) => Promise<FetchResult>;
|
|
1111
|
+
ping: (opts?: {
|
|
1112
|
+
maxAttempts?: number;
|
|
1113
|
+
timeoutMs?: number;
|
|
1114
|
+
retryDelayMs?: number;
|
|
1115
|
+
}) => Promise<void>;
|
|
915
1116
|
close: () => Promise<void>;
|
|
916
1117
|
}
|
|
917
1118
|
|
|
918
|
-
export {
|
|
1119
|
+
export { type AgentClaimAttempt as $, type AccountCredentials as A, type BalanceChainId as B, type Credentials as C, TEMPO_TESTNET_CHAIN_ID as D, tempoChainLabelFromId as E, type FetchOptions as F, type BalanceOptions as G, type BalanceReadError as H, type FundingUrlOptions as I, Wallet as J, type ClientOptions as K, DEFAULT_BASE_URL as L, DEFAULT_MAX_RETRIES as M, type NoCredentials as N, type OnSessionRefreshed as O, type PaymentSessionMeta as P, DEFAULT_TIMEOUT_MS as Q, Runs as R, type SessionCredentials as S, TEMPO_CHAIN_ID as T, USDC_BASE as U, type LogEvent as V, type WalletBalance as W, type Logger as X, type LogLevel as Y, ZeroClient as Z, type AgentAuthEndpoints as _, type SessionCredentialsInput as a, type AgentRegistration as a0, type AgentSignupResult as a1, type AgentToken as a2, type AgentVerifiedIdentity as a3, type AgentZeroSession as a4, type CompleteClaimResult as a5, type InternalUserDto as a6, type PublicUserDto as a7, type UserWalletDto as a8, type WelcomeBonusSummary as a9, BUG_REPORT_CATEGORIES as aa, type BugReportCategory as ab, type CreateBugReportInput as ac, type CreateBugReportResponse as ad, type CapabilityResponse as ae, type GetCapabilityOptions as af, type ResolveCapabilityResponse as ag, type DevicePollResult as ah, type DeviceStartResponse as ai, type SessionExchangeResponse as aj, type BatchReviewResponse as ak, type CreateReviewInput as al, type CreateReviewResponse as am, type CreateRunInput as an, type CreateRunResponse as ao, type ListRunsParams as ap, type ListRunsResponse as aq, type RunDetail as ar, type RunListItem as as, type SearchOptions as at, type SearchResponse as au, type SearchResult as av, USDC_DECIMALS as b, USDC_TEMPO as c, type FetchOutcome as d, type FetchResult as e, type UpstreamError as f, type SignMessageInput as g, type SignTransactionInput as h, isShortToken as i, type SignTypedDataInput as j, Auth as k, AuthAgent as l, AuthDevice as m, BugReports as n, Capabilities as o, type PayInput as p, type PaymentChain as q, type PaymentProtocol as r, type PaymentResult as s, type PayResult as t, type SessionReceiptPayload as u, coerceTempoChainId as v, FETCH_SKIP_REASONS as w, FETCH_WARNINGS as x, Payments as y, paymentHasAnchor as z };
|
|
@@ -168,6 +168,7 @@ type UpstreamError = {
|
|
|
168
168
|
message?: string;
|
|
169
169
|
snippetHash: string;
|
|
170
170
|
snippetLength: number;
|
|
171
|
+
fixHint?: string;
|
|
171
172
|
};
|
|
172
173
|
type FetchResult = {
|
|
173
174
|
runId: string | null;
|
|
@@ -282,6 +283,153 @@ declare const sessionExchangeResponseSchema: z.ZodObject<{
|
|
|
282
283
|
}, z.core.$strip>;
|
|
283
284
|
type SessionExchangeResponse = z.infer<typeof sessionExchangeResponseSchema>;
|
|
284
285
|
|
|
286
|
+
type AgentAuthEndpoints = {
|
|
287
|
+
authorizationServer: string;
|
|
288
|
+
identityEndpoint: string;
|
|
289
|
+
claimEndpoint: string | null;
|
|
290
|
+
tokenEndpoint: string;
|
|
291
|
+
};
|
|
292
|
+
declare const identityEnvelopeSchema: z.ZodPipe<z.ZodObject<{
|
|
293
|
+
id: z.ZodString;
|
|
294
|
+
identity: z.ZodObject<{
|
|
295
|
+
assertion: z.ZodString;
|
|
296
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
297
|
+
refresh_token: z.ZodOptional<z.ZodObject<{
|
|
298
|
+
value: z.ZodString;
|
|
299
|
+
}, z.core.$loose>>;
|
|
300
|
+
}, z.core.$loose>;
|
|
301
|
+
claim: z.ZodOptional<z.ZodObject<{
|
|
302
|
+
token: z.ZodOptional<z.ZodString>;
|
|
303
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
304
|
+
}, z.core.$loose>>;
|
|
305
|
+
}, z.core.$loose>, z.ZodTransform<{
|
|
306
|
+
registrationId: string;
|
|
307
|
+
identityAssertion: string;
|
|
308
|
+
assertionExpires: string | null;
|
|
309
|
+
refreshToken: string | null;
|
|
310
|
+
claimToken: string | null;
|
|
311
|
+
claimTokenExpires: string | null;
|
|
312
|
+
}, {
|
|
313
|
+
[x: string]: unknown;
|
|
314
|
+
id: string;
|
|
315
|
+
identity: {
|
|
316
|
+
[x: string]: unknown;
|
|
317
|
+
assertion: string;
|
|
318
|
+
expires_at?: string | undefined;
|
|
319
|
+
refresh_token?: {
|
|
320
|
+
[x: string]: unknown;
|
|
321
|
+
value: string;
|
|
322
|
+
} | undefined;
|
|
323
|
+
};
|
|
324
|
+
claim?: {
|
|
325
|
+
[x: string]: unknown;
|
|
326
|
+
token?: string | undefined;
|
|
327
|
+
expires_at?: string | undefined;
|
|
328
|
+
} | undefined;
|
|
329
|
+
}>>;
|
|
330
|
+
type AgentRegistration = z.infer<typeof identityEnvelopeSchema>;
|
|
331
|
+
declare const agentTokenResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
332
|
+
access_token: z.ZodString;
|
|
333
|
+
}, z.core.$loose>, z.ZodTransform<{
|
|
334
|
+
accessToken: string;
|
|
335
|
+
}, {
|
|
336
|
+
[x: string]: unknown;
|
|
337
|
+
access_token: string;
|
|
338
|
+
}>>;
|
|
339
|
+
type AgentToken = z.infer<typeof agentTokenResponseSchema>;
|
|
340
|
+
declare const startClaimResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
341
|
+
attempt: z.ZodObject<{
|
|
342
|
+
verification_uri: z.ZodString;
|
|
343
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
344
|
+
}, z.core.$loose>;
|
|
345
|
+
}, z.core.$loose>, z.ZodTransform<{
|
|
346
|
+
verificationUri: string;
|
|
347
|
+
expiresAt: string | null;
|
|
348
|
+
}, {
|
|
349
|
+
[x: string]: unknown;
|
|
350
|
+
attempt: {
|
|
351
|
+
[x: string]: unknown;
|
|
352
|
+
verification_uri: string;
|
|
353
|
+
expires_at?: string | undefined;
|
|
354
|
+
};
|
|
355
|
+
}>>;
|
|
356
|
+
type AgentClaimAttempt = z.infer<typeof startClaimResponseSchema>;
|
|
357
|
+
declare const completeClaimResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
358
|
+
identity: z.ZodObject<{
|
|
359
|
+
assertion: z.ZodString;
|
|
360
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
361
|
+
refresh_token: z.ZodOptional<z.ZodObject<{
|
|
362
|
+
value: z.ZodString;
|
|
363
|
+
}, z.core.$loose>>;
|
|
364
|
+
}, z.core.$loose>;
|
|
365
|
+
}, z.core.$loose>, z.ZodTransform<{
|
|
366
|
+
identityAssertion: string;
|
|
367
|
+
assertionExpires: string | null;
|
|
368
|
+
refreshToken: string | null;
|
|
369
|
+
}, {
|
|
370
|
+
[x: string]: unknown;
|
|
371
|
+
identity: {
|
|
372
|
+
[x: string]: unknown;
|
|
373
|
+
assertion: string;
|
|
374
|
+
expires_at?: string | undefined;
|
|
375
|
+
refresh_token?: {
|
|
376
|
+
[x: string]: unknown;
|
|
377
|
+
value: string;
|
|
378
|
+
} | undefined;
|
|
379
|
+
};
|
|
380
|
+
}>>;
|
|
381
|
+
type AgentVerifiedIdentity = z.infer<typeof completeClaimResponseSchema>;
|
|
382
|
+
type CompleteClaimResult = {
|
|
383
|
+
status: "not_confirmed";
|
|
384
|
+
} | {
|
|
385
|
+
status: "invalid_code";
|
|
386
|
+
} | {
|
|
387
|
+
status: "expired";
|
|
388
|
+
code: string;
|
|
389
|
+
} | ({
|
|
390
|
+
status: "ok";
|
|
391
|
+
} & AgentVerifiedIdentity);
|
|
392
|
+
declare const agentZeroSessionSchema: z.ZodObject<{
|
|
393
|
+
accessToken: z.ZodString;
|
|
394
|
+
refreshToken: z.ZodString;
|
|
395
|
+
expiresIn: z.ZodNumber;
|
|
396
|
+
user: z.ZodObject<{
|
|
397
|
+
id: z.ZodString;
|
|
398
|
+
}, z.core.$loose>;
|
|
399
|
+
walletAddress: z.ZodOptional<z.ZodString>;
|
|
400
|
+
}, z.core.$loose>;
|
|
401
|
+
type AgentZeroSession = z.infer<typeof agentZeroSessionSchema>;
|
|
402
|
+
type AgentSignupResult = {
|
|
403
|
+
registration: AgentRegistration;
|
|
404
|
+
session: AgentZeroSession;
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
declare class AuthAgent {
|
|
408
|
+
private readonly client;
|
|
409
|
+
private endpointsPromise;
|
|
410
|
+
constructor(client: ZeroClient);
|
|
411
|
+
signup: () => Promise<AgentSignupResult>;
|
|
412
|
+
register: () => Promise<AgentRegistration>;
|
|
413
|
+
exchangeAssertion: (identityAssertion: string) => Promise<AgentToken>;
|
|
414
|
+
exchangeAtZero: (accessToken: string, opts?: {
|
|
415
|
+
signal?: AbortSignal;
|
|
416
|
+
}) => Promise<AgentZeroSession>;
|
|
417
|
+
startClaim: (input: {
|
|
418
|
+
claimToken: string;
|
|
419
|
+
email: string;
|
|
420
|
+
}) => Promise<AgentClaimAttempt>;
|
|
421
|
+
completeClaim: (input: {
|
|
422
|
+
claimToken: string;
|
|
423
|
+
userCode: string;
|
|
424
|
+
}) => Promise<CompleteClaimResult>;
|
|
425
|
+
endpoints: () => Promise<AgentAuthEndpoints>;
|
|
426
|
+
private discover;
|
|
427
|
+
private getJson;
|
|
428
|
+
private postJson;
|
|
429
|
+
private postForm;
|
|
430
|
+
private post;
|
|
431
|
+
}
|
|
432
|
+
|
|
285
433
|
declare class AuthDevice {
|
|
286
434
|
private readonly client;
|
|
287
435
|
constructor(client: ZeroClient);
|
|
@@ -305,6 +453,7 @@ type SignOptions = {
|
|
|
305
453
|
};
|
|
306
454
|
declare class Auth {
|
|
307
455
|
private readonly client;
|
|
456
|
+
readonly agent: AuthAgent;
|
|
308
457
|
readonly device: AuthDevice;
|
|
309
458
|
constructor(client: ZeroClient);
|
|
310
459
|
me: (opts?: {
|
|
@@ -372,7 +521,9 @@ type CreateBugReportResponse = z.infer<typeof createBugReportResponseSchema>;
|
|
|
372
521
|
declare class BugReports {
|
|
373
522
|
private readonly client;
|
|
374
523
|
constructor(client: ZeroClient);
|
|
375
|
-
create: (input: CreateBugReportInput
|
|
524
|
+
create: (input: CreateBugReportInput & {
|
|
525
|
+
contextSeed?: string;
|
|
526
|
+
}, opts?: {
|
|
376
527
|
signal?: AbortSignal;
|
|
377
528
|
}) => Promise<CreateBugReportResponse>;
|
|
378
529
|
}
|
|
@@ -401,6 +552,17 @@ declare const capabilityResponseSchema: z.ZodObject<{
|
|
|
401
552
|
instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
402
553
|
displayCostAmount: z.ZodString;
|
|
403
554
|
displayCostAsset: z.ZodString;
|
|
555
|
+
priceDynamic: z.ZodOptional<z.ZodBoolean>;
|
|
556
|
+
priceHint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
557
|
+
priceStatus: z.ZodOptional<z.ZodEnum<{
|
|
558
|
+
priced: "priced";
|
|
559
|
+
proven_free: "proven_free";
|
|
560
|
+
free_handshake: "free_handshake";
|
|
561
|
+
unknown_unparsed: "unknown_unparsed";
|
|
562
|
+
unprobed: "unprobed";
|
|
563
|
+
}>>;
|
|
564
|
+
priceSource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
565
|
+
requiresHandshake: z.ZodOptional<z.ZodBoolean>;
|
|
404
566
|
reviewCount: z.ZodNumber;
|
|
405
567
|
rating: z.ZodObject<{
|
|
406
568
|
score: z.ZodString;
|
|
@@ -430,7 +592,37 @@ declare const capabilityResponseSchema: z.ZodObject<{
|
|
|
430
592
|
costAmount: z.ZodString;
|
|
431
593
|
costPer: z.ZodString;
|
|
432
594
|
priority: z.ZodNumber;
|
|
595
|
+
asset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
596
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
597
|
+
depositMicros: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
598
|
+
planRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
599
|
+
}, z.core.$strip>>>;
|
|
600
|
+
sessionDeposit: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
601
|
+
amountUsd: z.ZodString;
|
|
602
|
+
asset: z.ZodString;
|
|
433
603
|
}, z.core.$strip>>>;
|
|
604
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
605
|
+
kind: z.ZodString;
|
|
606
|
+
summary: z.ZodString;
|
|
607
|
+
primary: z.ZodNullable<z.ZodObject<{
|
|
608
|
+
kind: z.ZodString;
|
|
609
|
+
protocol: z.ZodString;
|
|
610
|
+
network: z.ZodNullable<z.ZodString>;
|
|
611
|
+
amountUsd: z.ZodNullable<z.ZodString>;
|
|
612
|
+
per: z.ZodString;
|
|
613
|
+
confidence: z.ZodString;
|
|
614
|
+
depositUsd: z.ZodOptional<z.ZodString>;
|
|
615
|
+
}, z.core.$strip>>;
|
|
616
|
+
accepted: z.ZodArray<z.ZodObject<{
|
|
617
|
+
kind: z.ZodString;
|
|
618
|
+
protocol: z.ZodString;
|
|
619
|
+
network: z.ZodNullable<z.ZodString>;
|
|
620
|
+
amountUsd: z.ZodNullable<z.ZodString>;
|
|
621
|
+
per: z.ZodString;
|
|
622
|
+
confidence: z.ZodString;
|
|
623
|
+
depositUsd: z.ZodOptional<z.ZodString>;
|
|
624
|
+
}, z.core.$strip>>;
|
|
625
|
+
}, z.core.$strip>>;
|
|
434
626
|
availabilityStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
435
627
|
unknown: "unknown";
|
|
436
628
|
healthy: "healthy";
|
|
@@ -635,21 +827,15 @@ declare class Runs {
|
|
|
635
827
|
}) => Promise<BatchReviewResponse>;
|
|
636
828
|
}
|
|
637
829
|
|
|
830
|
+
/** @internal Zero-surface constant — not part of the supported partner contract. */
|
|
831
|
+
declare const USDC_BASE: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913";
|
|
832
|
+
/** @internal Zero-surface constant — not part of the supported partner contract. */
|
|
833
|
+
declare const USDC_TEMPO: "0x20c000000000000000000000b9537d11c60e8b50";
|
|
834
|
+
/** @internal Zero-surface constant — not part of the supported partner contract. */
|
|
835
|
+
declare const USDC_DECIMALS = 6;
|
|
836
|
+
/** @internal Zero-surface constant — not part of the supported partner contract. */
|
|
638
837
|
type BalanceChainId = "base" | "tempo";
|
|
639
838
|
|
|
640
|
-
declare const migrateAuthorizationResponseSchema: z.ZodObject<{
|
|
641
|
-
transactionHash: z.ZodString;
|
|
642
|
-
}, z.core.$strip>;
|
|
643
|
-
type MigrateAuthorization = {
|
|
644
|
-
from: string;
|
|
645
|
-
to: string;
|
|
646
|
-
value: string;
|
|
647
|
-
validAfter: string;
|
|
648
|
-
validBefore: string;
|
|
649
|
-
nonce: string;
|
|
650
|
-
signature: string;
|
|
651
|
-
};
|
|
652
|
-
type MigrateAuthorizationResponse = z.infer<typeof migrateAuthorizationResponseSchema>;
|
|
653
839
|
type BalanceReadError = {
|
|
654
840
|
chain: BalanceChainId;
|
|
655
841
|
message: string;
|
|
@@ -673,7 +859,10 @@ declare class Wallet {
|
|
|
673
859
|
private readonly client;
|
|
674
860
|
private readonly clients;
|
|
675
861
|
constructor(client: ZeroClient);
|
|
676
|
-
get
|
|
862
|
+
private get configuredAddress();
|
|
863
|
+
address: (opts?: {
|
|
864
|
+
signal?: AbortSignal;
|
|
865
|
+
}) => Promise<`0x${string}`>;
|
|
677
866
|
balance: (opts?: BalanceOptions) => Promise<WalletBalance>;
|
|
678
867
|
list: (opts?: {
|
|
679
868
|
signal?: AbortSignal;
|
|
@@ -681,9 +870,6 @@ declare class Wallet {
|
|
|
681
870
|
provision: (opts?: {
|
|
682
871
|
signal?: AbortSignal;
|
|
683
872
|
}) => Promise<UserWalletDto>;
|
|
684
|
-
migrateAuthorization: (authorization: MigrateAuthorization, opts?: {
|
|
685
|
-
signal?: AbortSignal;
|
|
686
|
-
}) => Promise<MigrateAuthorizationResponse>;
|
|
687
873
|
fundingUrl: (opts?: FundingUrlOptions) => Promise<string>;
|
|
688
874
|
private getPublicClient;
|
|
689
875
|
/**
|
|
@@ -750,6 +936,11 @@ declare const searchResultSchema: z.ZodObject<{
|
|
|
750
936
|
amount: z.ZodString;
|
|
751
937
|
asset: z.ZodString;
|
|
752
938
|
}, z.core.$strip>;
|
|
939
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
940
|
+
kind: z.ZodString;
|
|
941
|
+
summary: z.ZodString;
|
|
942
|
+
}, z.core.$strip>>;
|
|
943
|
+
protocol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
753
944
|
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
754
945
|
rating: z.ZodObject<{
|
|
755
946
|
score: z.ZodString;
|
|
@@ -797,6 +988,11 @@ declare const searchResponseSchema: z.ZodObject<{
|
|
|
797
988
|
amount: z.ZodString;
|
|
798
989
|
asset: z.ZodString;
|
|
799
990
|
}, z.core.$strip>;
|
|
991
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
992
|
+
kind: z.ZodString;
|
|
993
|
+
summary: z.ZodString;
|
|
994
|
+
}, z.core.$strip>>;
|
|
995
|
+
protocol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
800
996
|
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
801
997
|
rating: z.ZodObject<{
|
|
802
998
|
score: z.ZodString;
|
|
@@ -912,7 +1108,12 @@ declare class ZeroClient {
|
|
|
912
1108
|
peekManagedAccount: () => LocalAccount | null;
|
|
913
1109
|
search: (query: string, opts?: SearchOptions) => Promise<SearchResponse>;
|
|
914
1110
|
fetch: (url: string, opts?: FetchOptions) => Promise<FetchResult>;
|
|
1111
|
+
ping: (opts?: {
|
|
1112
|
+
maxAttempts?: number;
|
|
1113
|
+
timeoutMs?: number;
|
|
1114
|
+
retryDelayMs?: number;
|
|
1115
|
+
}) => Promise<void>;
|
|
915
1116
|
close: () => Promise<void>;
|
|
916
1117
|
}
|
|
917
1118
|
|
|
918
|
-
export {
|
|
1119
|
+
export { type AgentClaimAttempt as $, type AccountCredentials as A, type BalanceChainId as B, type Credentials as C, TEMPO_TESTNET_CHAIN_ID as D, tempoChainLabelFromId as E, type FetchOptions as F, type BalanceOptions as G, type BalanceReadError as H, type FundingUrlOptions as I, Wallet as J, type ClientOptions as K, DEFAULT_BASE_URL as L, DEFAULT_MAX_RETRIES as M, type NoCredentials as N, type OnSessionRefreshed as O, type PaymentSessionMeta as P, DEFAULT_TIMEOUT_MS as Q, Runs as R, type SessionCredentials as S, TEMPO_CHAIN_ID as T, USDC_BASE as U, type LogEvent as V, type WalletBalance as W, type Logger as X, type LogLevel as Y, ZeroClient as Z, type AgentAuthEndpoints as _, type SessionCredentialsInput as a, type AgentRegistration as a0, type AgentSignupResult as a1, type AgentToken as a2, type AgentVerifiedIdentity as a3, type AgentZeroSession as a4, type CompleteClaimResult as a5, type InternalUserDto as a6, type PublicUserDto as a7, type UserWalletDto as a8, type WelcomeBonusSummary as a9, BUG_REPORT_CATEGORIES as aa, type BugReportCategory as ab, type CreateBugReportInput as ac, type CreateBugReportResponse as ad, type CapabilityResponse as ae, type GetCapabilityOptions as af, type ResolveCapabilityResponse as ag, type DevicePollResult as ah, type DeviceStartResponse as ai, type SessionExchangeResponse as aj, type BatchReviewResponse as ak, type CreateReviewInput as al, type CreateReviewResponse as am, type CreateRunInput as an, type CreateRunResponse as ao, type ListRunsParams as ap, type ListRunsResponse as aq, type RunDetail as ar, type RunListItem as as, type SearchOptions as at, type SearchResponse as au, type SearchResult as av, USDC_DECIMALS as b, USDC_TEMPO as c, type FetchOutcome as d, type FetchResult as e, type UpstreamError as f, type SignMessageInput as g, type SignTransactionInput as h, isShortToken as i, type SignTypedDataInput as j, Auth as k, AuthAgent as l, AuthDevice as m, BugReports as n, Capabilities as o, type PayInput as p, type PaymentChain as q, type PaymentProtocol as r, type PaymentResult as s, type PayResult as t, type SessionReceiptPayload as u, coerceTempoChainId as v, FETCH_SKIP_REASONS as w, FETCH_WARNINGS as x, Payments as y, paymentHasAnchor as z };
|