@zeroxyz/sdk 0.11.0 → 0.13.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 +19 -0
- package/README.md +17 -4
- package/dist/{chunk-HKF4TRC6.cjs → chunk-2A2ZZ5XR.cjs} +173 -46
- package/dist/chunk-2A2ZZ5XR.cjs.map +1 -0
- package/dist/{chunk-T77VVLOM.js → chunk-CYB4Y3ID.js} +173 -46
- package/dist/chunk-CYB4Y3ID.js.map +1 -0
- package/dist/{client-DKbrAo9Z.d.cts → client-C23Vw9bv.d.cts} +31 -3
- package/dist/{client-DKbrAo9Z.d.ts → client-C23Vw9bv.d.ts} +31 -3
- package/dist/index.cjs +44 -44
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +2 -2
- 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 +1 -1
- package/dist/chunk-HKF4TRC6.cjs.map +0 -1
- package/dist/chunk-T77VVLOM.js.map +0 -1
|
@@ -49,6 +49,7 @@ type PayInput = {
|
|
|
49
49
|
body?: string | Uint8Array;
|
|
50
50
|
maxPay?: string;
|
|
51
51
|
account?: LocalAccount;
|
|
52
|
+
walletAddress?: string;
|
|
52
53
|
signal?: AbortSignal;
|
|
53
54
|
timeoutMs?: number;
|
|
54
55
|
displayCostAmount?: string;
|
|
@@ -148,6 +149,7 @@ type FetchOptions = {
|
|
|
148
149
|
searchId?: string;
|
|
149
150
|
fetchOrigin?: "from_search" | "direct_slug" | "direct_url";
|
|
150
151
|
account?: LocalAccount;
|
|
152
|
+
walletAddress?: string;
|
|
151
153
|
signal?: AbortSignal;
|
|
152
154
|
timeoutMs?: number;
|
|
153
155
|
requestSchema?: Record<string, unknown>;
|
|
@@ -199,6 +201,7 @@ declare const userWalletDtoSchema: z.ZodObject<{
|
|
|
199
201
|
privy_embedded: "privy_embedded";
|
|
200
202
|
}>;
|
|
201
203
|
isPrimary: z.ZodBoolean;
|
|
204
|
+
nickname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
202
205
|
linkedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>>;
|
|
203
206
|
importedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>>;
|
|
204
207
|
delegationGranted: z.ZodBoolean;
|
|
@@ -223,6 +226,7 @@ declare const internalUserDtoSchema: z.ZodObject<{
|
|
|
223
226
|
privy_embedded: "privy_embedded";
|
|
224
227
|
}>;
|
|
225
228
|
isPrimary: z.ZodBoolean;
|
|
229
|
+
nickname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
226
230
|
linkedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>>;
|
|
227
231
|
importedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>>;
|
|
228
232
|
delegationGranted: z.ZodBoolean;
|
|
@@ -452,6 +456,7 @@ type SignTransactionInput = {
|
|
|
452
456
|
};
|
|
453
457
|
type SignOptions = {
|
|
454
458
|
expectedAddress?: string;
|
|
459
|
+
walletAddress?: string;
|
|
455
460
|
};
|
|
456
461
|
declare class Auth {
|
|
457
462
|
private readonly client;
|
|
@@ -545,6 +550,7 @@ declare const capabilityResponseSchema: z.ZodObject<{
|
|
|
545
550
|
request: z.ZodUnknown;
|
|
546
551
|
response: z.ZodUnknown;
|
|
547
552
|
}, z.core.$strip>>;
|
|
553
|
+
exampleRequest: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
548
554
|
tags: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
549
555
|
exampleAgentPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
550
556
|
whatItDoes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -793,6 +799,7 @@ type CreateRunInput = {
|
|
|
793
799
|
requestSchema?: Record<string, unknown>;
|
|
794
800
|
responseSchema?: Record<string, unknown>;
|
|
795
801
|
fetchOrigin?: "from_search" | "direct_slug" | "direct_url";
|
|
802
|
+
walletAddress?: string;
|
|
796
803
|
};
|
|
797
804
|
type CreateReviewInput = {
|
|
798
805
|
runId: string;
|
|
@@ -807,6 +814,7 @@ type ListRunsParams = {
|
|
|
807
814
|
unreviewed?: boolean;
|
|
808
815
|
limit?: number;
|
|
809
816
|
cursor?: string;
|
|
817
|
+
walletAddress?: string | string[];
|
|
810
818
|
};
|
|
811
819
|
|
|
812
820
|
declare class Runs {
|
|
@@ -860,6 +868,16 @@ type FundingUrlOptions = {
|
|
|
860
868
|
type ImportWalletOptions = {
|
|
861
869
|
privateKey: string;
|
|
862
870
|
makePrimary?: boolean;
|
|
871
|
+
nickname?: string;
|
|
872
|
+
signal?: AbortSignal;
|
|
873
|
+
};
|
|
874
|
+
type SetNicknameOptions = {
|
|
875
|
+
walletAddress: string;
|
|
876
|
+
nickname: string | null;
|
|
877
|
+
signal?: AbortSignal;
|
|
878
|
+
};
|
|
879
|
+
type DelegationOptions = {
|
|
880
|
+
walletAddress?: string;
|
|
863
881
|
signal?: AbortSignal;
|
|
864
882
|
};
|
|
865
883
|
type SetPrimaryWalletOptions = {
|
|
@@ -885,6 +903,9 @@ declare class Wallet {
|
|
|
885
903
|
provision: (opts?: {
|
|
886
904
|
signal?: AbortSignal;
|
|
887
905
|
}) => Promise<UserWalletDto>;
|
|
906
|
+
reauthorizeDelegation: (opts?: DelegationOptions) => Promise<UserWalletDto>;
|
|
907
|
+
revokeDelegation: (opts?: DelegationOptions) => Promise<UserWalletDto>;
|
|
908
|
+
setNickname: (opts: SetNicknameOptions) => Promise<UserWalletDto>;
|
|
888
909
|
import: (opts: ImportWalletOptions) => Promise<UserWalletDto>;
|
|
889
910
|
setPrimary: (opts: SetPrimaryWalletOptions) => Promise<UserWalletDto>;
|
|
890
911
|
remove: (opts: RemoveWalletOptions) => Promise<void>;
|
|
@@ -1067,6 +1088,7 @@ declare class ZeroClient {
|
|
|
1067
1088
|
private managedAccountInFlight;
|
|
1068
1089
|
private managedAccountAC;
|
|
1069
1090
|
private managedAccountGen;
|
|
1091
|
+
private readonly managedAccountByAddress;
|
|
1070
1092
|
private withAccountCache;
|
|
1071
1093
|
readonly auth: Auth;
|
|
1072
1094
|
readonly bugReports: BugReports;
|
|
@@ -1117,8 +1139,14 @@ declare class ZeroClient {
|
|
|
1117
1139
|
* eviction the cache grows for the base client's lifetime.
|
|
1118
1140
|
*/
|
|
1119
1141
|
clearAccountCache: (account?: LocalAccount) => void;
|
|
1120
|
-
/**
|
|
1121
|
-
|
|
1142
|
+
/**
|
|
1143
|
+
* @internal — used by payments.pay() in session mode. Cached, dedupes
|
|
1144
|
+
* concurrent lookups. Pass `walletAddress` to sign as a specific profile
|
|
1145
|
+
* wallet instead of the primary; explicit wallets are cached per address
|
|
1146
|
+
* and their sign requests carry the address so intent and signer agree.
|
|
1147
|
+
*/
|
|
1148
|
+
resolveManagedAccount: (signal?: AbortSignal, walletAddress?: string) => Promise<LocalAccount>;
|
|
1149
|
+
private resolveManagedAccountByAddress;
|
|
1122
1150
|
private raceWithSignal;
|
|
1123
1151
|
/** Drop the cached managed-signing account and abort any in-flight /me lookup. */
|
|
1124
1152
|
clearManagedAccount: () => void;
|
|
@@ -1134,4 +1162,4 @@ declare class ZeroClient {
|
|
|
1134
1162
|
close: () => Promise<void>;
|
|
1135
1163
|
}
|
|
1136
1164
|
|
|
1137
|
-
export {
|
|
1165
|
+
export { DEFAULT_TIMEOUT_MS 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 DelegationOptions as I, type FundingUrlOptions as J, type ImportWalletOptions as K, type RemoveWalletOptions as L, type SetNicknameOptions as M, type NoCredentials as N, type OnSessionRefreshed as O, type PaymentSessionMeta as P, type SetPrimaryWalletOptions as Q, Runs as R, type SessionCredentials as S, TEMPO_CHAIN_ID as T, USDC_BASE as U, Wallet as V, type WalletBalance as W, type ClientOptions as X, DEFAULT_BASE_URL as Y, ZeroClient as Z, DEFAULT_MAX_RETRIES as _, type SessionCredentialsInput as a, type LogEvent as a0, type Logger as a1, type LogLevel as a2, type AgentAuthEndpoints as a3, type AgentClaimAttempt as a4, type AgentRegistration as a5, type AgentSignupResult as a6, type AgentToken as a7, type AgentVerifiedIdentity as a8, type AgentZeroSession as a9, type SearchResult as aA, type CompleteClaimResult as aa, type InternalUserDto as ab, type PublicUserDto as ac, type UserWalletDto as ad, type WelcomeBonusSummary as ae, BUG_REPORT_CATEGORIES as af, type BugReportCategory as ag, type CreateBugReportInput as ah, type CreateBugReportResponse as ai, type CapabilityResponse as aj, type GetCapabilityOptions as ak, type ResolveCapabilityResponse as al, type DevicePollResult as am, type DeviceStartResponse as an, type SessionExchangeResponse as ao, type BatchReviewResponse as ap, type CreateReviewInput as aq, type CreateReviewResponse as ar, type CreateRunInput as as, type CreateRunResponse as at, type ListRunsParams as au, type ListRunsResponse as av, type RunDetail as aw, type RunListItem as ax, type SearchOptions as ay, type SearchResponse as az, 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 };
|
|
@@ -49,6 +49,7 @@ type PayInput = {
|
|
|
49
49
|
body?: string | Uint8Array;
|
|
50
50
|
maxPay?: string;
|
|
51
51
|
account?: LocalAccount;
|
|
52
|
+
walletAddress?: string;
|
|
52
53
|
signal?: AbortSignal;
|
|
53
54
|
timeoutMs?: number;
|
|
54
55
|
displayCostAmount?: string;
|
|
@@ -148,6 +149,7 @@ type FetchOptions = {
|
|
|
148
149
|
searchId?: string;
|
|
149
150
|
fetchOrigin?: "from_search" | "direct_slug" | "direct_url";
|
|
150
151
|
account?: LocalAccount;
|
|
152
|
+
walletAddress?: string;
|
|
151
153
|
signal?: AbortSignal;
|
|
152
154
|
timeoutMs?: number;
|
|
153
155
|
requestSchema?: Record<string, unknown>;
|
|
@@ -199,6 +201,7 @@ declare const userWalletDtoSchema: z.ZodObject<{
|
|
|
199
201
|
privy_embedded: "privy_embedded";
|
|
200
202
|
}>;
|
|
201
203
|
isPrimary: z.ZodBoolean;
|
|
204
|
+
nickname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
202
205
|
linkedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>>;
|
|
203
206
|
importedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>>;
|
|
204
207
|
delegationGranted: z.ZodBoolean;
|
|
@@ -223,6 +226,7 @@ declare const internalUserDtoSchema: z.ZodObject<{
|
|
|
223
226
|
privy_embedded: "privy_embedded";
|
|
224
227
|
}>;
|
|
225
228
|
isPrimary: z.ZodBoolean;
|
|
229
|
+
nickname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
226
230
|
linkedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>>;
|
|
227
231
|
importedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>>;
|
|
228
232
|
delegationGranted: z.ZodBoolean;
|
|
@@ -452,6 +456,7 @@ type SignTransactionInput = {
|
|
|
452
456
|
};
|
|
453
457
|
type SignOptions = {
|
|
454
458
|
expectedAddress?: string;
|
|
459
|
+
walletAddress?: string;
|
|
455
460
|
};
|
|
456
461
|
declare class Auth {
|
|
457
462
|
private readonly client;
|
|
@@ -545,6 +550,7 @@ declare const capabilityResponseSchema: z.ZodObject<{
|
|
|
545
550
|
request: z.ZodUnknown;
|
|
546
551
|
response: z.ZodUnknown;
|
|
547
552
|
}, z.core.$strip>>;
|
|
553
|
+
exampleRequest: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
548
554
|
tags: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
549
555
|
exampleAgentPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
550
556
|
whatItDoes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -793,6 +799,7 @@ type CreateRunInput = {
|
|
|
793
799
|
requestSchema?: Record<string, unknown>;
|
|
794
800
|
responseSchema?: Record<string, unknown>;
|
|
795
801
|
fetchOrigin?: "from_search" | "direct_slug" | "direct_url";
|
|
802
|
+
walletAddress?: string;
|
|
796
803
|
};
|
|
797
804
|
type CreateReviewInput = {
|
|
798
805
|
runId: string;
|
|
@@ -807,6 +814,7 @@ type ListRunsParams = {
|
|
|
807
814
|
unreviewed?: boolean;
|
|
808
815
|
limit?: number;
|
|
809
816
|
cursor?: string;
|
|
817
|
+
walletAddress?: string | string[];
|
|
810
818
|
};
|
|
811
819
|
|
|
812
820
|
declare class Runs {
|
|
@@ -860,6 +868,16 @@ type FundingUrlOptions = {
|
|
|
860
868
|
type ImportWalletOptions = {
|
|
861
869
|
privateKey: string;
|
|
862
870
|
makePrimary?: boolean;
|
|
871
|
+
nickname?: string;
|
|
872
|
+
signal?: AbortSignal;
|
|
873
|
+
};
|
|
874
|
+
type SetNicknameOptions = {
|
|
875
|
+
walletAddress: string;
|
|
876
|
+
nickname: string | null;
|
|
877
|
+
signal?: AbortSignal;
|
|
878
|
+
};
|
|
879
|
+
type DelegationOptions = {
|
|
880
|
+
walletAddress?: string;
|
|
863
881
|
signal?: AbortSignal;
|
|
864
882
|
};
|
|
865
883
|
type SetPrimaryWalletOptions = {
|
|
@@ -885,6 +903,9 @@ declare class Wallet {
|
|
|
885
903
|
provision: (opts?: {
|
|
886
904
|
signal?: AbortSignal;
|
|
887
905
|
}) => Promise<UserWalletDto>;
|
|
906
|
+
reauthorizeDelegation: (opts?: DelegationOptions) => Promise<UserWalletDto>;
|
|
907
|
+
revokeDelegation: (opts?: DelegationOptions) => Promise<UserWalletDto>;
|
|
908
|
+
setNickname: (opts: SetNicknameOptions) => Promise<UserWalletDto>;
|
|
888
909
|
import: (opts: ImportWalletOptions) => Promise<UserWalletDto>;
|
|
889
910
|
setPrimary: (opts: SetPrimaryWalletOptions) => Promise<UserWalletDto>;
|
|
890
911
|
remove: (opts: RemoveWalletOptions) => Promise<void>;
|
|
@@ -1067,6 +1088,7 @@ declare class ZeroClient {
|
|
|
1067
1088
|
private managedAccountInFlight;
|
|
1068
1089
|
private managedAccountAC;
|
|
1069
1090
|
private managedAccountGen;
|
|
1091
|
+
private readonly managedAccountByAddress;
|
|
1070
1092
|
private withAccountCache;
|
|
1071
1093
|
readonly auth: Auth;
|
|
1072
1094
|
readonly bugReports: BugReports;
|
|
@@ -1117,8 +1139,14 @@ declare class ZeroClient {
|
|
|
1117
1139
|
* eviction the cache grows for the base client's lifetime.
|
|
1118
1140
|
*/
|
|
1119
1141
|
clearAccountCache: (account?: LocalAccount) => void;
|
|
1120
|
-
/**
|
|
1121
|
-
|
|
1142
|
+
/**
|
|
1143
|
+
* @internal — used by payments.pay() in session mode. Cached, dedupes
|
|
1144
|
+
* concurrent lookups. Pass `walletAddress` to sign as a specific profile
|
|
1145
|
+
* wallet instead of the primary; explicit wallets are cached per address
|
|
1146
|
+
* and their sign requests carry the address so intent and signer agree.
|
|
1147
|
+
*/
|
|
1148
|
+
resolveManagedAccount: (signal?: AbortSignal, walletAddress?: string) => Promise<LocalAccount>;
|
|
1149
|
+
private resolveManagedAccountByAddress;
|
|
1122
1150
|
private raceWithSignal;
|
|
1123
1151
|
/** Drop the cached managed-signing account and abort any in-flight /me lookup. */
|
|
1124
1152
|
clearManagedAccount: () => void;
|
|
@@ -1134,4 +1162,4 @@ declare class ZeroClient {
|
|
|
1134
1162
|
close: () => Promise<void>;
|
|
1135
1163
|
}
|
|
1136
1164
|
|
|
1137
|
-
export {
|
|
1165
|
+
export { DEFAULT_TIMEOUT_MS 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 DelegationOptions as I, type FundingUrlOptions as J, type ImportWalletOptions as K, type RemoveWalletOptions as L, type SetNicknameOptions as M, type NoCredentials as N, type OnSessionRefreshed as O, type PaymentSessionMeta as P, type SetPrimaryWalletOptions as Q, Runs as R, type SessionCredentials as S, TEMPO_CHAIN_ID as T, USDC_BASE as U, Wallet as V, type WalletBalance as W, type ClientOptions as X, DEFAULT_BASE_URL as Y, ZeroClient as Z, DEFAULT_MAX_RETRIES as _, type SessionCredentialsInput as a, type LogEvent as a0, type Logger as a1, type LogLevel as a2, type AgentAuthEndpoints as a3, type AgentClaimAttempt as a4, type AgentRegistration as a5, type AgentSignupResult as a6, type AgentToken as a7, type AgentVerifiedIdentity as a8, type AgentZeroSession as a9, type SearchResult as aA, type CompleteClaimResult as aa, type InternalUserDto as ab, type PublicUserDto as ac, type UserWalletDto as ad, type WelcomeBonusSummary as ae, BUG_REPORT_CATEGORIES as af, type BugReportCategory as ag, type CreateBugReportInput as ah, type CreateBugReportResponse as ai, type CapabilityResponse as aj, type GetCapabilityOptions as ak, type ResolveCapabilityResponse as al, type DevicePollResult as am, type DeviceStartResponse as an, type SessionExchangeResponse as ao, type BatchReviewResponse as ap, type CreateReviewInput as aq, type CreateReviewResponse as ar, type CreateRunInput as as, type CreateRunResponse as at, type ListRunsParams as au, type ListRunsResponse as av, type RunDetail as aw, type RunListItem as ax, type SearchOptions as ay, type SearchResponse as az, 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 };
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk2A2ZZ5XR_cjs = require('./chunk-2A2ZZ5XR.cjs');
|
|
4
4
|
|
|
5
5
|
// src/status.ts
|
|
6
6
|
var AVAILABILITY_BADGES = {
|
|
@@ -208,7 +208,7 @@ var coerceToType = (value, type) => {
|
|
|
208
208
|
};
|
|
209
209
|
var MAX_SCHEMA_DEPTH = 5;
|
|
210
210
|
var sampleValueFor = (fieldName, propSchema, depth = 0) => {
|
|
211
|
-
const node =
|
|
211
|
+
const node = chunk2A2ZZ5XR_cjs.asSchemaNode(propSchema);
|
|
212
212
|
const type = schemaType(node);
|
|
213
213
|
const enumFirst = Array.isArray(node?.enum) && node.enum.length > 0 ? node.enum[0] : void 0;
|
|
214
214
|
const fixed = node?.const ?? node?.example ?? node?.default ?? enumFirst;
|
|
@@ -216,7 +216,7 @@ var sampleValueFor = (fieldName, propSchema, depth = 0) => {
|
|
|
216
216
|
return coerceToType(fixed, type);
|
|
217
217
|
}
|
|
218
218
|
if (node && depth < MAX_SCHEMA_DEPTH) {
|
|
219
|
-
const props =
|
|
219
|
+
const props = chunk2A2ZZ5XR_cjs.asSchemaNode(node.properties);
|
|
220
220
|
if (props && (type === "object" || type === void 0)) {
|
|
221
221
|
const obj = {};
|
|
222
222
|
for (const [k, sub] of Object.entries(props)) {
|
|
@@ -225,7 +225,7 @@ var sampleValueFor = (fieldName, propSchema, depth = 0) => {
|
|
|
225
225
|
return obj;
|
|
226
226
|
}
|
|
227
227
|
if (type === "array") {
|
|
228
|
-
const items =
|
|
228
|
+
const items = chunk2A2ZZ5XR_cjs.asSchemaNode(node.items);
|
|
229
229
|
return items ? [sampleValueFor(fieldName, items, depth + 1)] : [];
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -254,163 +254,163 @@ var urlMatchesTemplate = (url, template) => {
|
|
|
254
254
|
|
|
255
255
|
Object.defineProperty(exports, "Auth", {
|
|
256
256
|
enumerable: true,
|
|
257
|
-
get: function () { return
|
|
257
|
+
get: function () { return chunk2A2ZZ5XR_cjs.Auth; }
|
|
258
258
|
});
|
|
259
259
|
Object.defineProperty(exports, "AuthAgent", {
|
|
260
260
|
enumerable: true,
|
|
261
|
-
get: function () { return
|
|
261
|
+
get: function () { return chunk2A2ZZ5XR_cjs.AuthAgent; }
|
|
262
262
|
});
|
|
263
263
|
Object.defineProperty(exports, "AuthDevice", {
|
|
264
264
|
enumerable: true,
|
|
265
|
-
get: function () { return
|
|
265
|
+
get: function () { return chunk2A2ZZ5XR_cjs.AuthDevice; }
|
|
266
266
|
});
|
|
267
267
|
Object.defineProperty(exports, "BUG_REPORT_CATEGORIES", {
|
|
268
268
|
enumerable: true,
|
|
269
|
-
get: function () { return
|
|
269
|
+
get: function () { return chunk2A2ZZ5XR_cjs.BUG_REPORT_CATEGORIES; }
|
|
270
270
|
});
|
|
271
271
|
Object.defineProperty(exports, "BugReports", {
|
|
272
272
|
enumerable: true,
|
|
273
|
-
get: function () { return
|
|
273
|
+
get: function () { return chunk2A2ZZ5XR_cjs.BugReports; }
|
|
274
274
|
});
|
|
275
275
|
Object.defineProperty(exports, "Capabilities", {
|
|
276
276
|
enumerable: true,
|
|
277
|
-
get: function () { return
|
|
277
|
+
get: function () { return chunk2A2ZZ5XR_cjs.Capabilities; }
|
|
278
278
|
});
|
|
279
279
|
Object.defineProperty(exports, "DEFAULT_BASE_URL", {
|
|
280
280
|
enumerable: true,
|
|
281
|
-
get: function () { return
|
|
281
|
+
get: function () { return chunk2A2ZZ5XR_cjs.DEFAULT_BASE_URL; }
|
|
282
282
|
});
|
|
283
283
|
Object.defineProperty(exports, "DEFAULT_MAX_RETRIES", {
|
|
284
284
|
enumerable: true,
|
|
285
|
-
get: function () { return
|
|
285
|
+
get: function () { return chunk2A2ZZ5XR_cjs.DEFAULT_MAX_RETRIES; }
|
|
286
286
|
});
|
|
287
287
|
Object.defineProperty(exports, "DEFAULT_TIMEOUT_MS", {
|
|
288
288
|
enumerable: true,
|
|
289
|
-
get: function () { return
|
|
289
|
+
get: function () { return chunk2A2ZZ5XR_cjs.DEFAULT_TIMEOUT_MS; }
|
|
290
290
|
});
|
|
291
291
|
Object.defineProperty(exports, "FETCH_SKIP_REASONS", {
|
|
292
292
|
enumerable: true,
|
|
293
|
-
get: function () { return
|
|
293
|
+
get: function () { return chunk2A2ZZ5XR_cjs.FETCH_SKIP_REASONS; }
|
|
294
294
|
});
|
|
295
295
|
Object.defineProperty(exports, "FETCH_WARNINGS", {
|
|
296
296
|
enumerable: true,
|
|
297
|
-
get: function () { return
|
|
297
|
+
get: function () { return chunk2A2ZZ5XR_cjs.FETCH_WARNINGS; }
|
|
298
298
|
});
|
|
299
299
|
Object.defineProperty(exports, "Payments", {
|
|
300
300
|
enumerable: true,
|
|
301
|
-
get: function () { return
|
|
301
|
+
get: function () { return chunk2A2ZZ5XR_cjs.Payments; }
|
|
302
302
|
});
|
|
303
303
|
Object.defineProperty(exports, "Runs", {
|
|
304
304
|
enumerable: true,
|
|
305
|
-
get: function () { return
|
|
305
|
+
get: function () { return chunk2A2ZZ5XR_cjs.Runs; }
|
|
306
306
|
});
|
|
307
307
|
Object.defineProperty(exports, "SDK_VERSION", {
|
|
308
308
|
enumerable: true,
|
|
309
|
-
get: function () { return
|
|
309
|
+
get: function () { return chunk2A2ZZ5XR_cjs.SDK_VERSION; }
|
|
310
310
|
});
|
|
311
311
|
Object.defineProperty(exports, "TEMPO_CHAIN_ID", {
|
|
312
312
|
enumerable: true,
|
|
313
|
-
get: function () { return
|
|
313
|
+
get: function () { return chunk2A2ZZ5XR_cjs.TEMPO_CHAIN_ID; }
|
|
314
314
|
});
|
|
315
315
|
Object.defineProperty(exports, "TEMPO_TESTNET_CHAIN_ID", {
|
|
316
316
|
enumerable: true,
|
|
317
|
-
get: function () { return
|
|
317
|
+
get: function () { return chunk2A2ZZ5XR_cjs.TEMPO_TESTNET_CHAIN_ID; }
|
|
318
318
|
});
|
|
319
319
|
Object.defineProperty(exports, "USDC_BASE", {
|
|
320
320
|
enumerable: true,
|
|
321
|
-
get: function () { return
|
|
321
|
+
get: function () { return chunk2A2ZZ5XR_cjs.USDC_BASE; }
|
|
322
322
|
});
|
|
323
323
|
Object.defineProperty(exports, "USDC_DECIMALS", {
|
|
324
324
|
enumerable: true,
|
|
325
|
-
get: function () { return
|
|
325
|
+
get: function () { return chunk2A2ZZ5XR_cjs.USDC_DECIMALS; }
|
|
326
326
|
});
|
|
327
327
|
Object.defineProperty(exports, "USDC_TEMPO", {
|
|
328
328
|
enumerable: true,
|
|
329
|
-
get: function () { return
|
|
329
|
+
get: function () { return chunk2A2ZZ5XR_cjs.USDC_TEMPO; }
|
|
330
330
|
});
|
|
331
331
|
Object.defineProperty(exports, "Wallet", {
|
|
332
332
|
enumerable: true,
|
|
333
|
-
get: function () { return
|
|
333
|
+
get: function () { return chunk2A2ZZ5XR_cjs.Wallet; }
|
|
334
334
|
});
|
|
335
335
|
Object.defineProperty(exports, "ZeroAgentAuthError", {
|
|
336
336
|
enumerable: true,
|
|
337
|
-
get: function () { return
|
|
337
|
+
get: function () { return chunk2A2ZZ5XR_cjs.ZeroAgentAuthError; }
|
|
338
338
|
});
|
|
339
339
|
Object.defineProperty(exports, "ZeroApiError", {
|
|
340
340
|
enumerable: true,
|
|
341
|
-
get: function () { return
|
|
341
|
+
get: function () { return chunk2A2ZZ5XR_cjs.ZeroApiError; }
|
|
342
342
|
});
|
|
343
343
|
Object.defineProperty(exports, "ZeroAuthError", {
|
|
344
344
|
enumerable: true,
|
|
345
|
-
get: function () { return
|
|
345
|
+
get: function () { return chunk2A2ZZ5XR_cjs.ZeroAuthError; }
|
|
346
346
|
});
|
|
347
347
|
Object.defineProperty(exports, "ZeroClient", {
|
|
348
348
|
enumerable: true,
|
|
349
|
-
get: function () { return
|
|
349
|
+
get: function () { return chunk2A2ZZ5XR_cjs.ZeroClient; }
|
|
350
350
|
});
|
|
351
351
|
Object.defineProperty(exports, "ZeroConfigurationError", {
|
|
352
352
|
enumerable: true,
|
|
353
|
-
get: function () { return
|
|
353
|
+
get: function () { return chunk2A2ZZ5XR_cjs.ZeroConfigurationError; }
|
|
354
354
|
});
|
|
355
355
|
Object.defineProperty(exports, "ZeroError", {
|
|
356
356
|
enumerable: true,
|
|
357
|
-
get: function () { return
|
|
357
|
+
get: function () { return chunk2A2ZZ5XR_cjs.ZeroError; }
|
|
358
358
|
});
|
|
359
359
|
Object.defineProperty(exports, "ZeroPaymentError", {
|
|
360
360
|
enumerable: true,
|
|
361
|
-
get: function () { return
|
|
361
|
+
get: function () { return chunk2A2ZZ5XR_cjs.ZeroPaymentError; }
|
|
362
362
|
});
|
|
363
363
|
Object.defineProperty(exports, "ZeroSessionCloseFailedError", {
|
|
364
364
|
enumerable: true,
|
|
365
|
-
get: function () { return
|
|
365
|
+
get: function () { return chunk2A2ZZ5XR_cjs.ZeroSessionCloseFailedError; }
|
|
366
366
|
});
|
|
367
367
|
Object.defineProperty(exports, "ZeroTimeoutError", {
|
|
368
368
|
enumerable: true,
|
|
369
|
-
get: function () { return
|
|
369
|
+
get: function () { return chunk2A2ZZ5XR_cjs.ZeroTimeoutError; }
|
|
370
370
|
});
|
|
371
371
|
Object.defineProperty(exports, "ZeroValidationError", {
|
|
372
372
|
enumerable: true,
|
|
373
|
-
get: function () { return
|
|
373
|
+
get: function () { return chunk2A2ZZ5XR_cjs.ZeroValidationError; }
|
|
374
374
|
});
|
|
375
375
|
Object.defineProperty(exports, "ZeroWalletError", {
|
|
376
376
|
enumerable: true,
|
|
377
|
-
get: function () { return
|
|
377
|
+
get: function () { return chunk2A2ZZ5XR_cjs.ZeroWalletError; }
|
|
378
378
|
});
|
|
379
379
|
Object.defineProperty(exports, "asSchemaNode", {
|
|
380
380
|
enumerable: true,
|
|
381
|
-
get: function () { return
|
|
381
|
+
get: function () { return chunk2A2ZZ5XR_cjs.asSchemaNode; }
|
|
382
382
|
});
|
|
383
383
|
Object.defineProperty(exports, "coerceTempoChainId", {
|
|
384
384
|
enumerable: true,
|
|
385
|
-
get: function () { return
|
|
385
|
+
get: function () { return chunk2A2ZZ5XR_cjs.coerceTempoChainId; }
|
|
386
386
|
});
|
|
387
387
|
Object.defineProperty(exports, "createManagedAccount", {
|
|
388
388
|
enumerable: true,
|
|
389
|
-
get: function () { return
|
|
389
|
+
get: function () { return chunk2A2ZZ5XR_cjs.createManagedAccount; }
|
|
390
390
|
});
|
|
391
391
|
Object.defineProperty(exports, "extractInputEnvelope", {
|
|
392
392
|
enumerable: true,
|
|
393
|
-
get: function () { return
|
|
393
|
+
get: function () { return chunk2A2ZZ5XR_cjs.extractInputEnvelope; }
|
|
394
394
|
});
|
|
395
395
|
Object.defineProperty(exports, "isShortToken", {
|
|
396
396
|
enumerable: true,
|
|
397
|
-
get: function () { return
|
|
397
|
+
get: function () { return chunk2A2ZZ5XR_cjs.isShortToken; }
|
|
398
398
|
});
|
|
399
399
|
Object.defineProperty(exports, "normalizeTransportEnvelopeRequest", {
|
|
400
400
|
enumerable: true,
|
|
401
|
-
get: function () { return
|
|
401
|
+
get: function () { return chunk2A2ZZ5XR_cjs.normalizeTransportEnvelopeRequest; }
|
|
402
402
|
});
|
|
403
403
|
Object.defineProperty(exports, "paymentHasAnchor", {
|
|
404
404
|
enumerable: true,
|
|
405
|
-
get: function () { return
|
|
405
|
+
get: function () { return chunk2A2ZZ5XR_cjs.paymentHasAnchor; }
|
|
406
406
|
});
|
|
407
407
|
Object.defineProperty(exports, "tempoChainLabelFromId", {
|
|
408
408
|
enumerable: true,
|
|
409
|
-
get: function () { return
|
|
409
|
+
get: function () { return chunk2A2ZZ5XR_cjs.tempoChainLabelFromId; }
|
|
410
410
|
});
|
|
411
411
|
Object.defineProperty(exports, "unwrapTransportEnvelope", {
|
|
412
412
|
enumerable: true,
|
|
413
|
-
get: function () { return
|
|
413
|
+
get: function () { return chunk2A2ZZ5XR_cjs.unwrapTransportEnvelope; }
|
|
414
414
|
});
|
|
415
415
|
exports.AVAILABILITY_BADGES = AVAILABILITY_BADGES;
|
|
416
416
|
exports.centsToDollars = centsToDollars;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { Z as ZeroClient, P as PaymentSessionMeta } from './client-
|
|
2
|
-
export { A as AccountCredentials,
|
|
1
|
+
import { Z as ZeroClient, P as PaymentSessionMeta } from './client-C23Vw9bv.cjs';
|
|
2
|
+
export { A as AccountCredentials, a3 as AgentAuthEndpoints, a4 as AgentClaimAttempt, a5 as AgentRegistration, a6 as AgentSignupResult, a7 as AgentToken, a8 as AgentVerifiedIdentity, a9 as AgentZeroSession, k as Auth, l as AuthAgent, m as AuthDevice, af as BUG_REPORT_CATEGORIES, B as BalanceChainId, G as BalanceOptions, H as BalanceReadError, ap as BatchReviewResponse, ag as BugReportCategory, n as BugReports, o as Capabilities, aj as CapabilityResponse, X as ClientOptions, aa as CompleteClaimResult, ah as CreateBugReportInput, ai as CreateBugReportResponse, aq as CreateReviewInput, ar as CreateReviewResponse, as as CreateRunInput, at as CreateRunResponse, C as Credentials, Y as DEFAULT_BASE_URL, _ as DEFAULT_MAX_RETRIES, $ as DEFAULT_TIMEOUT_MS, I as DelegationOptions, am as DevicePollResult, an as DeviceStartResponse, w as FETCH_SKIP_REASONS, x as FETCH_WARNINGS, F as FetchOptions, d as FetchOutcome, e as FetchResult, J as FundingUrlOptions, ak as GetCapabilityOptions, K as ImportWalletOptions, ab as InternalUserDto, au as ListRunsParams, av as ListRunsResponse, a0 as LogEvent, a2 as LogLevel, a1 as Logger, N as NoCredentials, O as OnSessionRefreshed, p as PayInput, t as PayResult, q as PaymentChain, r as PaymentProtocol, s as PaymentResult, y as Payments, ac as PublicUserDto, L as RemoveWalletOptions, al as ResolveCapabilityResponse, aw as RunDetail, ax as RunListItem, R as Runs, ay as SearchOptions, az as SearchResponse, aA as SearchResult, S as SessionCredentials, a as SessionCredentialsInput, ao as SessionExchangeResponse, u as SessionReceiptPayload, M as SetNicknameOptions, Q as SetPrimaryWalletOptions, g as SignMessageInput, h as SignTransactionInput, j as SignTypedDataInput, T as TEMPO_CHAIN_ID, D as TEMPO_TESTNET_CHAIN_ID, U as USDC_BASE, b as USDC_DECIMALS, c as USDC_TEMPO, f as UpstreamError, ad as UserWalletDto, V as Wallet, W as WalletBalance, ae as WelcomeBonusSummary, v as coerceTempoChainId, i as isShortToken, z as paymentHasAnchor, E as tempoChainLabelFromId } from './client-C23Vw9bv.cjs';
|
|
3
3
|
import { Address, LocalAccount } from 'viem';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
|
-
declare const createManagedAccount: (client: ZeroClient, address: Address
|
|
6
|
+
declare const createManagedAccount: (client: ZeroClient, address: Address, opts?: {
|
|
7
|
+
explicitWallet?: boolean;
|
|
8
|
+
}) => LocalAccount;
|
|
7
9
|
|
|
8
10
|
type ZeroErrorCode = "api_error" | "auth_error" | "auth_session_expired" | "auth_no_credentials" | "payment_error" | "payment_session_close_failed" | "insufficient_funds" | "wallet_error" | "validation_error" | "timeout_error" | "configuration_error";
|
|
9
11
|
type ZeroErrorOptions = {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { Z as ZeroClient, P as PaymentSessionMeta } from './client-
|
|
2
|
-
export { A as AccountCredentials,
|
|
1
|
+
import { Z as ZeroClient, P as PaymentSessionMeta } from './client-C23Vw9bv.js';
|
|
2
|
+
export { A as AccountCredentials, a3 as AgentAuthEndpoints, a4 as AgentClaimAttempt, a5 as AgentRegistration, a6 as AgentSignupResult, a7 as AgentToken, a8 as AgentVerifiedIdentity, a9 as AgentZeroSession, k as Auth, l as AuthAgent, m as AuthDevice, af as BUG_REPORT_CATEGORIES, B as BalanceChainId, G as BalanceOptions, H as BalanceReadError, ap as BatchReviewResponse, ag as BugReportCategory, n as BugReports, o as Capabilities, aj as CapabilityResponse, X as ClientOptions, aa as CompleteClaimResult, ah as CreateBugReportInput, ai as CreateBugReportResponse, aq as CreateReviewInput, ar as CreateReviewResponse, as as CreateRunInput, at as CreateRunResponse, C as Credentials, Y as DEFAULT_BASE_URL, _ as DEFAULT_MAX_RETRIES, $ as DEFAULT_TIMEOUT_MS, I as DelegationOptions, am as DevicePollResult, an as DeviceStartResponse, w as FETCH_SKIP_REASONS, x as FETCH_WARNINGS, F as FetchOptions, d as FetchOutcome, e as FetchResult, J as FundingUrlOptions, ak as GetCapabilityOptions, K as ImportWalletOptions, ab as InternalUserDto, au as ListRunsParams, av as ListRunsResponse, a0 as LogEvent, a2 as LogLevel, a1 as Logger, N as NoCredentials, O as OnSessionRefreshed, p as PayInput, t as PayResult, q as PaymentChain, r as PaymentProtocol, s as PaymentResult, y as Payments, ac as PublicUserDto, L as RemoveWalletOptions, al as ResolveCapabilityResponse, aw as RunDetail, ax as RunListItem, R as Runs, ay as SearchOptions, az as SearchResponse, aA as SearchResult, S as SessionCredentials, a as SessionCredentialsInput, ao as SessionExchangeResponse, u as SessionReceiptPayload, M as SetNicknameOptions, Q as SetPrimaryWalletOptions, g as SignMessageInput, h as SignTransactionInput, j as SignTypedDataInput, T as TEMPO_CHAIN_ID, D as TEMPO_TESTNET_CHAIN_ID, U as USDC_BASE, b as USDC_DECIMALS, c as USDC_TEMPO, f as UpstreamError, ad as UserWalletDto, V as Wallet, W as WalletBalance, ae as WelcomeBonusSummary, v as coerceTempoChainId, i as isShortToken, z as paymentHasAnchor, E as tempoChainLabelFromId } from './client-C23Vw9bv.js';
|
|
3
3
|
import { Address, LocalAccount } from 'viem';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
|
-
declare const createManagedAccount: (client: ZeroClient, address: Address
|
|
6
|
+
declare const createManagedAccount: (client: ZeroClient, address: Address, opts?: {
|
|
7
|
+
explicitWallet?: boolean;
|
|
8
|
+
}) => LocalAccount;
|
|
7
9
|
|
|
8
10
|
type ZeroErrorCode = "api_error" | "auth_error" | "auth_session_expired" | "auth_no_credentials" | "payment_error" | "payment_session_close_failed" | "insufficient_funds" | "wallet_error" | "validation_error" | "timeout_error" | "configuration_error";
|
|
9
11
|
type ZeroErrorOptions = {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { asSchemaNode } from './chunk-
|
|
2
|
-
export { Auth, AuthAgent, AuthDevice, BUG_REPORT_CATEGORIES, BugReports, Capabilities, DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT_MS, FETCH_SKIP_REASONS, FETCH_WARNINGS, Payments, Runs, SDK_VERSION, TEMPO_CHAIN_ID, TEMPO_TESTNET_CHAIN_ID, USDC_BASE, USDC_DECIMALS, USDC_TEMPO, Wallet, ZeroAgentAuthError, ZeroApiError, ZeroAuthError, ZeroClient, ZeroConfigurationError, ZeroError, ZeroPaymentError, ZeroSessionCloseFailedError, ZeroTimeoutError, ZeroValidationError, ZeroWalletError, asSchemaNode, coerceTempoChainId, createManagedAccount, extractInputEnvelope, isShortToken, normalizeTransportEnvelopeRequest, paymentHasAnchor, tempoChainLabelFromId, unwrapTransportEnvelope } from './chunk-
|
|
1
|
+
import { asSchemaNode } from './chunk-CYB4Y3ID.js';
|
|
2
|
+
export { Auth, AuthAgent, AuthDevice, BUG_REPORT_CATEGORIES, BugReports, Capabilities, DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT_MS, FETCH_SKIP_REASONS, FETCH_WARNINGS, Payments, Runs, SDK_VERSION, TEMPO_CHAIN_ID, TEMPO_TESTNET_CHAIN_ID, USDC_BASE, USDC_DECIMALS, USDC_TEMPO, Wallet, ZeroAgentAuthError, ZeroApiError, ZeroAuthError, ZeroClient, ZeroConfigurationError, ZeroError, ZeroPaymentError, ZeroSessionCloseFailedError, ZeroTimeoutError, ZeroValidationError, ZeroWalletError, asSchemaNode, coerceTempoChainId, createManagedAccount, extractInputEnvelope, isShortToken, normalizeTransportEnvelopeRequest, paymentHasAnchor, tempoChainLabelFromId, unwrapTransportEnvelope } from './chunk-CYB4Y3ID.js';
|
|
3
3
|
|
|
4
4
|
// src/status.ts
|
|
5
5
|
var AVAILABILITY_BADGES = {
|
package/dist/testing.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk2A2ZZ5XR_cjs = require('./chunk-2A2ZZ5XR.cjs');
|
|
4
4
|
|
|
5
5
|
// src/testing/index.ts
|
|
6
6
|
var FALLBACK_HANDLER = (request) => {
|
|
@@ -34,7 +34,7 @@ var respondJson = (body, init) => new Response(JSON.stringify(body), {
|
|
|
34
34
|
});
|
|
35
35
|
var createTestClient = (opts = {}) => {
|
|
36
36
|
const { routes, ...rest } = opts;
|
|
37
|
-
return new
|
|
37
|
+
return new chunk2A2ZZ5XR_cjs.ZeroClient({
|
|
38
38
|
...rest,
|
|
39
39
|
baseUrl: rest.baseUrl ?? "http://test.zero.local",
|
|
40
40
|
// Tests should fail fast, not retry-and-mask flakiness.
|
package/dist/testing.d.cts
CHANGED
package/dist/testing.d.ts
CHANGED
package/dist/testing.js
CHANGED