@zeroxyz/sdk 0.9.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 +14 -0
- package/README.md +42 -6
- package/dist/{chunk-T6JT5NV5.js → chunk-A7WZYQXS.js} +529 -150
- package/dist/chunk-A7WZYQXS.js.map +1 -0
- package/dist/{chunk-O7QJMY3Y.cjs → chunk-IFVGW4ZN.cjs} +534 -150
- package/dist/chunk-IFVGW4ZN.cjs.map +1 -0
- package/dist/{client-Du4zQHef.d.cts → client-D_ohktBl.d.cts} +178 -19
- package/dist/{client-Du4zQHef.d.ts → client-D_ohktBl.d.ts} +178 -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-O7QJMY3Y.cjs.map +0 -1
- package/dist/chunk-T6JT5NV5.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
|
}
|
|
@@ -410,6 +561,7 @@ declare const capabilityResponseSchema: z.ZodObject<{
|
|
|
410
561
|
unknown_unparsed: "unknown_unparsed";
|
|
411
562
|
unprobed: "unprobed";
|
|
412
563
|
}>>;
|
|
564
|
+
priceSource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
413
565
|
requiresHandshake: z.ZodOptional<z.ZodBoolean>;
|
|
414
566
|
reviewCount: z.ZodNumber;
|
|
415
567
|
rating: z.ZodObject<{
|
|
@@ -675,21 +827,15 @@ declare class Runs {
|
|
|
675
827
|
}) => Promise<BatchReviewResponse>;
|
|
676
828
|
}
|
|
677
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. */
|
|
678
837
|
type BalanceChainId = "base" | "tempo";
|
|
679
838
|
|
|
680
|
-
declare const migrateAuthorizationResponseSchema: z.ZodObject<{
|
|
681
|
-
transactionHash: z.ZodString;
|
|
682
|
-
}, z.core.$strip>;
|
|
683
|
-
type MigrateAuthorization = {
|
|
684
|
-
from: string;
|
|
685
|
-
to: string;
|
|
686
|
-
value: string;
|
|
687
|
-
validAfter: string;
|
|
688
|
-
validBefore: string;
|
|
689
|
-
nonce: string;
|
|
690
|
-
signature: string;
|
|
691
|
-
};
|
|
692
|
-
type MigrateAuthorizationResponse = z.infer<typeof migrateAuthorizationResponseSchema>;
|
|
693
839
|
type BalanceReadError = {
|
|
694
840
|
chain: BalanceChainId;
|
|
695
841
|
message: string;
|
|
@@ -713,7 +859,10 @@ declare class Wallet {
|
|
|
713
859
|
private readonly client;
|
|
714
860
|
private readonly clients;
|
|
715
861
|
constructor(client: ZeroClient);
|
|
716
|
-
get
|
|
862
|
+
private get configuredAddress();
|
|
863
|
+
address: (opts?: {
|
|
864
|
+
signal?: AbortSignal;
|
|
865
|
+
}) => Promise<`0x${string}`>;
|
|
717
866
|
balance: (opts?: BalanceOptions) => Promise<WalletBalance>;
|
|
718
867
|
list: (opts?: {
|
|
719
868
|
signal?: AbortSignal;
|
|
@@ -721,9 +870,6 @@ declare class Wallet {
|
|
|
721
870
|
provision: (opts?: {
|
|
722
871
|
signal?: AbortSignal;
|
|
723
872
|
}) => Promise<UserWalletDto>;
|
|
724
|
-
migrateAuthorization: (authorization: MigrateAuthorization, opts?: {
|
|
725
|
-
signal?: AbortSignal;
|
|
726
|
-
}) => Promise<MigrateAuthorizationResponse>;
|
|
727
873
|
fundingUrl: (opts?: FundingUrlOptions) => Promise<string>;
|
|
728
874
|
private getPublicClient;
|
|
729
875
|
/**
|
|
@@ -790,6 +936,10 @@ declare const searchResultSchema: z.ZodObject<{
|
|
|
790
936
|
amount: z.ZodString;
|
|
791
937
|
asset: z.ZodString;
|
|
792
938
|
}, z.core.$strip>;
|
|
939
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
940
|
+
kind: z.ZodString;
|
|
941
|
+
summary: z.ZodString;
|
|
942
|
+
}, z.core.$strip>>;
|
|
793
943
|
protocol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
794
944
|
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
795
945
|
rating: z.ZodObject<{
|
|
@@ -838,6 +988,10 @@ declare const searchResponseSchema: z.ZodObject<{
|
|
|
838
988
|
amount: z.ZodString;
|
|
839
989
|
asset: z.ZodString;
|
|
840
990
|
}, z.core.$strip>;
|
|
991
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
992
|
+
kind: z.ZodString;
|
|
993
|
+
summary: z.ZodString;
|
|
994
|
+
}, z.core.$strip>>;
|
|
841
995
|
protocol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
842
996
|
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
843
997
|
rating: z.ZodObject<{
|
|
@@ -954,7 +1108,12 @@ declare class ZeroClient {
|
|
|
954
1108
|
peekManagedAccount: () => LocalAccount | null;
|
|
955
1109
|
search: (query: string, opts?: SearchOptions) => Promise<SearchResponse>;
|
|
956
1110
|
fetch: (url: string, opts?: FetchOptions) => Promise<FetchResult>;
|
|
1111
|
+
ping: (opts?: {
|
|
1112
|
+
maxAttempts?: number;
|
|
1113
|
+
timeoutMs?: number;
|
|
1114
|
+
retryDelayMs?: number;
|
|
1115
|
+
}) => Promise<void>;
|
|
957
1116
|
close: () => Promise<void>;
|
|
958
1117
|
}
|
|
959
1118
|
|
|
960
|
-
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
|
}
|
|
@@ -410,6 +561,7 @@ declare const capabilityResponseSchema: z.ZodObject<{
|
|
|
410
561
|
unknown_unparsed: "unknown_unparsed";
|
|
411
562
|
unprobed: "unprobed";
|
|
412
563
|
}>>;
|
|
564
|
+
priceSource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
413
565
|
requiresHandshake: z.ZodOptional<z.ZodBoolean>;
|
|
414
566
|
reviewCount: z.ZodNumber;
|
|
415
567
|
rating: z.ZodObject<{
|
|
@@ -675,21 +827,15 @@ declare class Runs {
|
|
|
675
827
|
}) => Promise<BatchReviewResponse>;
|
|
676
828
|
}
|
|
677
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. */
|
|
678
837
|
type BalanceChainId = "base" | "tempo";
|
|
679
838
|
|
|
680
|
-
declare const migrateAuthorizationResponseSchema: z.ZodObject<{
|
|
681
|
-
transactionHash: z.ZodString;
|
|
682
|
-
}, z.core.$strip>;
|
|
683
|
-
type MigrateAuthorization = {
|
|
684
|
-
from: string;
|
|
685
|
-
to: string;
|
|
686
|
-
value: string;
|
|
687
|
-
validAfter: string;
|
|
688
|
-
validBefore: string;
|
|
689
|
-
nonce: string;
|
|
690
|
-
signature: string;
|
|
691
|
-
};
|
|
692
|
-
type MigrateAuthorizationResponse = z.infer<typeof migrateAuthorizationResponseSchema>;
|
|
693
839
|
type BalanceReadError = {
|
|
694
840
|
chain: BalanceChainId;
|
|
695
841
|
message: string;
|
|
@@ -713,7 +859,10 @@ declare class Wallet {
|
|
|
713
859
|
private readonly client;
|
|
714
860
|
private readonly clients;
|
|
715
861
|
constructor(client: ZeroClient);
|
|
716
|
-
get
|
|
862
|
+
private get configuredAddress();
|
|
863
|
+
address: (opts?: {
|
|
864
|
+
signal?: AbortSignal;
|
|
865
|
+
}) => Promise<`0x${string}`>;
|
|
717
866
|
balance: (opts?: BalanceOptions) => Promise<WalletBalance>;
|
|
718
867
|
list: (opts?: {
|
|
719
868
|
signal?: AbortSignal;
|
|
@@ -721,9 +870,6 @@ declare class Wallet {
|
|
|
721
870
|
provision: (opts?: {
|
|
722
871
|
signal?: AbortSignal;
|
|
723
872
|
}) => Promise<UserWalletDto>;
|
|
724
|
-
migrateAuthorization: (authorization: MigrateAuthorization, opts?: {
|
|
725
|
-
signal?: AbortSignal;
|
|
726
|
-
}) => Promise<MigrateAuthorizationResponse>;
|
|
727
873
|
fundingUrl: (opts?: FundingUrlOptions) => Promise<string>;
|
|
728
874
|
private getPublicClient;
|
|
729
875
|
/**
|
|
@@ -790,6 +936,10 @@ declare const searchResultSchema: z.ZodObject<{
|
|
|
790
936
|
amount: z.ZodString;
|
|
791
937
|
asset: z.ZodString;
|
|
792
938
|
}, z.core.$strip>;
|
|
939
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
940
|
+
kind: z.ZodString;
|
|
941
|
+
summary: z.ZodString;
|
|
942
|
+
}, z.core.$strip>>;
|
|
793
943
|
protocol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
794
944
|
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
795
945
|
rating: z.ZodObject<{
|
|
@@ -838,6 +988,10 @@ declare const searchResponseSchema: z.ZodObject<{
|
|
|
838
988
|
amount: z.ZodString;
|
|
839
989
|
asset: z.ZodString;
|
|
840
990
|
}, z.core.$strip>;
|
|
991
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
992
|
+
kind: z.ZodString;
|
|
993
|
+
summary: z.ZodString;
|
|
994
|
+
}, z.core.$strip>>;
|
|
841
995
|
protocol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
842
996
|
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
843
997
|
rating: z.ZodObject<{
|
|
@@ -954,7 +1108,12 @@ declare class ZeroClient {
|
|
|
954
1108
|
peekManagedAccount: () => LocalAccount | null;
|
|
955
1109
|
search: (query: string, opts?: SearchOptions) => Promise<SearchResponse>;
|
|
956
1110
|
fetch: (url: string, opts?: FetchOptions) => Promise<FetchResult>;
|
|
1111
|
+
ping: (opts?: {
|
|
1112
|
+
maxAttempts?: number;
|
|
1113
|
+
timeoutMs?: number;
|
|
1114
|
+
retryDelayMs?: number;
|
|
1115
|
+
}) => Promise<void>;
|
|
957
1116
|
close: () => Promise<void>;
|
|
958
1117
|
}
|
|
959
1118
|
|
|
960
|
-
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 };
|