@zeroxyz/sdk 0.1.1 → 0.3.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.
@@ -1100,7 +1100,7 @@ var Payments = class {
1100
1100
 
1101
1101
  // package.json
1102
1102
  var package_default = {
1103
- version: "0.1.1"};
1103
+ version: "0.3.0"};
1104
1104
 
1105
1105
  // src/version.ts
1106
1106
  var SDK_VERSION = package_default.version;
@@ -2084,7 +2084,7 @@ var Wallet = class {
2084
2084
 
2085
2085
  // src/options.ts
2086
2086
  var DEFAULT_BASE_URL = "https://api.zero.xyz";
2087
- var DEFAULT_TIMEOUT_MS = 6e4;
2087
+ var DEFAULT_TIMEOUT_MS = 18e4;
2088
2088
  var DEFAULT_MAX_RETRIES = 2;
2089
2089
 
2090
2090
  // src/auth/credentials.ts
@@ -2370,6 +2370,16 @@ var recordErrorFetchRun = async (client, opts, result) => {
2370
2370
  } catch {
2371
2371
  }
2372
2372
  };
2373
+ var recordTimeoutRun = async (client, opts, err, startedAt, capabilityIdRequested) => {
2374
+ const result = errorFetchResult(
2375
+ startedAt,
2376
+ err.message,
2377
+ "timeout",
2378
+ capabilityIdRequested,
2379
+ "network_error"
2380
+ );
2381
+ await recordErrorFetchRun(client, opts, result);
2382
+ };
2373
2383
  var sniffJsonShapeBytes = (buf) => {
2374
2384
  let i = 0;
2375
2385
  if (buf.length >= 3 && buf[0] === 239 && buf[1] === 187 && buf[2] === 191) {
@@ -2414,6 +2424,16 @@ var clientFetch = async (client, url, opts = {}) => {
2414
2424
  try {
2415
2425
  response = await configuredFetch(url, requestInit);
2416
2426
  } catch (err) {
2427
+ if (err instanceof ZeroTimeoutError) {
2428
+ await recordTimeoutRun(
2429
+ client,
2430
+ opts,
2431
+ err,
2432
+ startedAt,
2433
+ capabilityIdRequested
2434
+ );
2435
+ throw err;
2436
+ }
2417
2437
  if (err instanceof ZeroError) throw err;
2418
2438
  const errMessage = err instanceof Error ? err.message : String(err);
2419
2439
  const result2 = errorFetchResult(
@@ -2473,6 +2493,15 @@ var clientFetch = async (client, url, opts = {}) => {
2473
2493
  );
2474
2494
  await recordErrorFetchRun(client, opts, result2);
2475
2495
  return result2;
2496
+ } else if (err instanceof ZeroTimeoutError) {
2497
+ await recordTimeoutRun(
2498
+ client,
2499
+ opts,
2500
+ err,
2501
+ startedAt,
2502
+ capabilityIdRequested
2503
+ );
2504
+ throw err;
2476
2505
  } else {
2477
2506
  throw err;
2478
2507
  }
@@ -2650,8 +2679,15 @@ var searchResultSchema = zod.z.object({
2650
2679
  slug: zod.z.string(),
2651
2680
  name: zod.z.string(),
2652
2681
  canonicalName: zod.z.string().nullable().optional(),
2682
+ brandName: zod.z.string().nullable().optional(),
2653
2683
  description: zod.z.string(),
2654
2684
  whatItDoes: zod.z.string().nullable().optional(),
2685
+ // HTTP verb the capability expects. Surfaced on the search row so a caller
2686
+ // can tell GET from POST without a `capabilities.get()` round-trip — enough
2687
+ // to `fetch()` a no-body GET directly. POST bodies still need `get()` for
2688
+ // the `bodySchema`. Optional (not required) so a response that omits it —
2689
+ // an older API deploy — still parses rather than failing the whole search.
2690
+ method: zod.z.string().optional(),
2655
2691
  url: zod.z.string(),
2656
2692
  urlTemplate: zod.z.string().nullable().optional(),
2657
2693
  cost: zod.z.object({ amount: zod.z.string(), asset: zod.z.string() }),
@@ -3078,5 +3114,5 @@ exports.coerceTempoChainId = coerceTempoChainId;
3078
3114
  exports.createManagedAccount = createManagedAccount;
3079
3115
  exports.paymentHasAnchor = paymentHasAnchor;
3080
3116
  exports.tempoChainLabelFromId = tempoChainLabelFromId;
3081
- //# sourceMappingURL=chunk-XQRINGOJ.cjs.map
3082
- //# sourceMappingURL=chunk-XQRINGOJ.cjs.map
3117
+ //# sourceMappingURL=chunk-LVK77C6A.cjs.map
3118
+ //# sourceMappingURL=chunk-LVK77C6A.cjs.map