@toon-protocol/client-mcp 0.10.8 → 0.10.9

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.
@@ -12551,7 +12551,7 @@ var ControlClient = class _ControlClient {
12551
12551
  return this.request("GET", "/channels");
12552
12552
  }
12553
12553
  balances() {
12554
- return this.request("GET", "/balances");
12554
+ return this.request("GET", "/balances", void 0, { timeoutMs: 12e3 });
12555
12555
  }
12556
12556
  depositToChannel(body) {
12557
12557
  return this.request("POST", "/channels/deposit", body);
@@ -12599,12 +12599,12 @@ var ControlClient = class _ControlClient {
12599
12599
  static isIdempotent(method) {
12600
12600
  return method === "GET" || method === "DELETE";
12601
12601
  }
12602
- async request(method, path, body) {
12602
+ async request(method, path, body, opts) {
12603
12603
  const attempts = _ControlClient.isIdempotent(method) ? 3 : 1;
12604
12604
  let lastErr;
12605
12605
  for (let attempt = 1; attempt <= attempts; attempt++) {
12606
12606
  try {
12607
- return await this.attemptOnce(method, path, body);
12607
+ return await this.attemptOnce(method, path, body, opts?.timeoutMs);
12608
12608
  } catch (err) {
12609
12609
  lastErr = err;
12610
12610
  if (attempt < attempts && err instanceof DaemonUnreachableError) {
@@ -12616,10 +12616,10 @@ var ControlClient = class _ControlClient {
12616
12616
  }
12617
12617
  throw lastErr;
12618
12618
  }
12619
- async attemptOnce(method, path, body) {
12619
+ async attemptOnce(method, path, body, timeoutMs = this.timeoutMs) {
12620
12620
  const url = `${this.baseUrl}${path}`;
12621
12621
  const controller = new AbortController();
12622
- const timer = setTimeout(() => controller.abort(), this.timeoutMs);
12622
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
12623
12623
  let res;
12624
12624
  try {
12625
12625
  res = await this.fetchImpl(url, {
@@ -12631,7 +12631,7 @@ var ControlClient = class _ControlClient {
12631
12631
  } catch (err) {
12632
12632
  if (controller.signal.aborted) {
12633
12633
  throw new ControlApiError(
12634
- `control request ${method} ${path} timed out after ${this.timeoutMs}ms`,
12634
+ `control request ${method} ${path} timed out after ${timeoutMs}ms`,
12635
12635
  504,
12636
12636
  true
12637
12637
  );
@@ -12801,4 +12801,4 @@ export {
12801
12801
  @scure/bip32/lib/esm/index.js:
12802
12802
  (*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
12803
12803
  */
12804
- //# sourceMappingURL=chunk-3ZBC2HUB.js.map
12804
+ //# sourceMappingURL=chunk-UHITXU5V.js.map