@zeroxyz/sdk 0.1.1 → 0.2.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.
@@ -1098,7 +1098,7 @@ var Payments = class {
1098
1098
 
1099
1099
  // package.json
1100
1100
  var package_default = {
1101
- version: "0.1.1"};
1101
+ version: "0.2.0"};
1102
1102
 
1103
1103
  // src/version.ts
1104
1104
  var SDK_VERSION = package_default.version;
@@ -2082,7 +2082,7 @@ var Wallet = class {
2082
2082
 
2083
2083
  // src/options.ts
2084
2084
  var DEFAULT_BASE_URL = "https://api.zero.xyz";
2085
- var DEFAULT_TIMEOUT_MS = 6e4;
2085
+ var DEFAULT_TIMEOUT_MS = 18e4;
2086
2086
  var DEFAULT_MAX_RETRIES = 2;
2087
2087
 
2088
2088
  // src/auth/credentials.ts
@@ -2368,6 +2368,16 @@ var recordErrorFetchRun = async (client, opts, result) => {
2368
2368
  } catch {
2369
2369
  }
2370
2370
  };
2371
+ var recordTimeoutRun = async (client, opts, err, startedAt, capabilityIdRequested) => {
2372
+ const result = errorFetchResult(
2373
+ startedAt,
2374
+ err.message,
2375
+ "timeout",
2376
+ capabilityIdRequested,
2377
+ "network_error"
2378
+ );
2379
+ await recordErrorFetchRun(client, opts, result);
2380
+ };
2371
2381
  var sniffJsonShapeBytes = (buf) => {
2372
2382
  let i = 0;
2373
2383
  if (buf.length >= 3 && buf[0] === 239 && buf[1] === 187 && buf[2] === 191) {
@@ -2412,6 +2422,16 @@ var clientFetch = async (client, url, opts = {}) => {
2412
2422
  try {
2413
2423
  response = await configuredFetch(url, requestInit);
2414
2424
  } catch (err) {
2425
+ if (err instanceof ZeroTimeoutError) {
2426
+ await recordTimeoutRun(
2427
+ client,
2428
+ opts,
2429
+ err,
2430
+ startedAt,
2431
+ capabilityIdRequested
2432
+ );
2433
+ throw err;
2434
+ }
2415
2435
  if (err instanceof ZeroError) throw err;
2416
2436
  const errMessage = err instanceof Error ? err.message : String(err);
2417
2437
  const result2 = errorFetchResult(
@@ -2471,6 +2491,15 @@ var clientFetch = async (client, url, opts = {}) => {
2471
2491
  );
2472
2492
  await recordErrorFetchRun(client, opts, result2);
2473
2493
  return result2;
2494
+ } else if (err instanceof ZeroTimeoutError) {
2495
+ await recordTimeoutRun(
2496
+ client,
2497
+ opts,
2498
+ err,
2499
+ startedAt,
2500
+ capabilityIdRequested
2501
+ );
2502
+ throw err;
2474
2503
  } else {
2475
2504
  throw err;
2476
2505
  }
@@ -3047,5 +3076,5 @@ var ZeroClient = class _ZeroClient {
3047
3076
  };
3048
3077
 
3049
3078
  export { Auth, 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, Wallet, ZeroApiError, ZeroAuthError, ZeroClient, ZeroConfigurationError, ZeroError, ZeroPaymentError, ZeroSessionCloseFailedError, ZeroTimeoutError, ZeroValidationError, ZeroWalletError, coerceTempoChainId, createManagedAccount, paymentHasAnchor, tempoChainLabelFromId };
3050
- //# sourceMappingURL=chunk-JFORV7AV.js.map
3051
- //# sourceMappingURL=chunk-JFORV7AV.js.map
3079
+ //# sourceMappingURL=chunk-SLXRHGE4.js.map
3080
+ //# sourceMappingURL=chunk-SLXRHGE4.js.map