agentcash 0.6.8 → 0.6.10

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.
Files changed (37) hide show
  1. package/dist/cjs/run-server.cjs +1132 -562
  2. package/dist/esm/{chunk-4CJK6DZP.js → chunk-BRDMMHEQ.js} +2 -2
  3. package/dist/esm/chunk-CU5TC4GQ.js +7 -0
  4. package/dist/esm/{chunk-4I4USKHJ.js.map → chunk-CU5TC4GQ.js.map} +1 -1
  5. package/dist/esm/{install-2JZAAXCD.js → chunk-DREKGGZJ.js} +124 -200
  6. package/dist/esm/chunk-DREKGGZJ.js.map +1 -0
  7. package/dist/esm/chunk-DZNSJ2BA.js +13 -0
  8. package/dist/esm/chunk-DZNSJ2BA.js.map +1 -0
  9. package/dist/esm/{chunk-XIKRF4DZ.js → chunk-HRFGLP6E.js} +3 -3
  10. package/dist/esm/{chunk-H2TTH4HY.js → chunk-ITPKPIJC.js} +3 -3
  11. package/dist/esm/{chunk-KPEJO3KV.js → chunk-JNYAKINU.js} +7 -1
  12. package/dist/esm/chunk-JNYAKINU.js.map +1 -0
  13. package/dist/esm/{chunk-M46HKNGQ.js → chunk-KOMAKKV3.js} +6 -15
  14. package/dist/esm/chunk-KOMAKKV3.js.map +1 -0
  15. package/dist/esm/{chunk-JSOEZ5FI.js → chunk-V4B6FDUP.js} +2 -2
  16. package/dist/esm/{commands-2PBLL76N.js → commands-NXFUKNPZ.js} +434 -19
  17. package/dist/esm/commands-NXFUKNPZ.js.map +1 -0
  18. package/dist/esm/{fund-XFH7M3PI.js → fund-LZWGF5QM.js} +3 -2
  19. package/dist/esm/{fund-XFH7M3PI.js.map → fund-LZWGF5QM.js.map} +1 -1
  20. package/dist/esm/index.js +37 -16
  21. package/dist/esm/index.js.map +1 -1
  22. package/dist/esm/install-U7N5DVC4.js +179 -0
  23. package/dist/esm/install-U7N5DVC4.js.map +1 -0
  24. package/dist/esm/lib.js +2 -2
  25. package/dist/esm/{server-DWVHQ5V6.js → server-UU4Y7IOG.js} +7 -7
  26. package/dist/esm/shared/operations/index.js +4 -4
  27. package/package.json +2 -2
  28. package/dist/esm/chunk-4I4USKHJ.js +0 -7
  29. package/dist/esm/chunk-KPEJO3KV.js.map +0 -1
  30. package/dist/esm/chunk-M46HKNGQ.js.map +0 -1
  31. package/dist/esm/commands-2PBLL76N.js.map +0 -1
  32. package/dist/esm/install-2JZAAXCD.js.map +0 -1
  33. /package/dist/esm/{chunk-4CJK6DZP.js.map → chunk-BRDMMHEQ.js.map} +0 -0
  34. /package/dist/esm/{chunk-XIKRF4DZ.js.map → chunk-HRFGLP6E.js.map} +0 -0
  35. /package/dist/esm/{chunk-H2TTH4HY.js.map → chunk-ITPKPIJC.js.map} +0 -0
  36. /package/dist/esm/{chunk-JSOEZ5FI.js.map → chunk-V4B6FDUP.js.map} +0 -0
  37. /package/dist/esm/{server-DWVHQ5V6.js.map → server-UU4Y7IOG.js.map} +0 -0
@@ -3016,7 +3016,7 @@ var require_compile = __commonJS({
3016
3016
  const schOrFunc = root.refs[ref];
3017
3017
  if (schOrFunc)
3018
3018
  return schOrFunc;
3019
- let _sch = resolve.call(this, root, ref);
3019
+ let _sch = resolve2.call(this, root, ref);
3020
3020
  if (_sch === void 0) {
3021
3021
  const schema = (_a2 = root.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref];
3022
3022
  const { schemaId } = this.opts;
@@ -3043,7 +3043,7 @@ var require_compile = __commonJS({
3043
3043
  function sameSchemaEnv(s1, s2) {
3044
3044
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
3045
3045
  }
3046
- function resolve(root, ref) {
3046
+ function resolve2(root, ref) {
3047
3047
  let sch;
3048
3048
  while (typeof (sch = this.refs[ref]) == "string")
3049
3049
  ref = sch;
@@ -3621,7 +3621,7 @@ var require_fast_uri = __commonJS({
3621
3621
  }
3622
3622
  return uri;
3623
3623
  }
3624
- function resolve(baseURI, relativeURI, options) {
3624
+ function resolve2(baseURI, relativeURI, options) {
3625
3625
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
3626
3626
  const resolved = resolveComponent(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true);
3627
3627
  schemelessOptions.skipEscape = true;
@@ -3848,7 +3848,7 @@ var require_fast_uri = __commonJS({
3848
3848
  var fastUri = {
3849
3849
  SCHEMES,
3850
3850
  normalize,
3851
- resolve,
3851
+ resolve: resolve2,
3852
3852
  resolveComponent,
3853
3853
  equal,
3854
3854
  serialize: serialize9,
@@ -4014,19 +4014,19 @@ var require_core = __commonJS({
4014
4014
  this.addKeyword("$async");
4015
4015
  }
4016
4016
  _addDefaultMetaSchema() {
4017
- const { $data, meta: meta4, schemaId } = this.opts;
4017
+ const { $data, meta: meta5, schemaId } = this.opts;
4018
4018
  let _dataRefSchema = $dataRefSchema;
4019
4019
  if (schemaId === "id") {
4020
4020
  _dataRefSchema = { ...$dataRefSchema };
4021
4021
  _dataRefSchema.id = _dataRefSchema.$id;
4022
4022
  delete _dataRefSchema.$id;
4023
4023
  }
4024
- if (meta4 && $data)
4024
+ if (meta5 && $data)
4025
4025
  this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);
4026
4026
  }
4027
4027
  defaultMeta() {
4028
- const { meta: meta4, schemaId } = this.opts;
4029
- return this.opts.defaultMeta = typeof meta4 == "object" ? meta4[schemaId] || meta4 : void 0;
4028
+ const { meta: meta5, schemaId } = this.opts;
4029
+ return this.opts.defaultMeta = typeof meta5 == "object" ? meta5[schemaId] || meta5 : void 0;
4030
4030
  }
4031
4031
  validate(schemaKeyRef, data) {
4032
4032
  let v;
@@ -4046,12 +4046,12 @@ var require_core = __commonJS({
4046
4046
  const sch = this._addSchema(schema, _meta);
4047
4047
  return sch.validate || this._compileSchemaEnv(sch);
4048
4048
  }
4049
- compileAsync(schema, meta4) {
4049
+ compileAsync(schema, meta5) {
4050
4050
  if (typeof this.opts.loadSchema != "function") {
4051
4051
  throw new Error("options.loadSchema should be a function");
4052
4052
  }
4053
4053
  const { loadSchema } = this.opts;
4054
- return runCompileAsync.call(this, schema, meta4);
4054
+ return runCompileAsync.call(this, schema, meta5);
4055
4055
  async function runCompileAsync(_schema, _meta) {
4056
4056
  await loadMetaSchema.call(this, _schema.$schema);
4057
4057
  const sch = this._addSchema(_schema, _meta);
@@ -4083,7 +4083,7 @@ var require_core = __commonJS({
4083
4083
  if (!this.refs[ref])
4084
4084
  await loadMetaSchema.call(this, _schema.$schema);
4085
4085
  if (!this.refs[ref])
4086
- this.addSchema(_schema, ref, meta4);
4086
+ this.addSchema(_schema, ref, meta5);
4087
4087
  }
4088
4088
  async function _loadSchema(ref) {
4089
4089
  const p = this._loading[ref];
@@ -4300,7 +4300,7 @@ var require_core = __commonJS({
4300
4300
  }
4301
4301
  }
4302
4302
  }
4303
- _addSchema(schema, meta4, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
4303
+ _addSchema(schema, meta5, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
4304
4304
  let id;
4305
4305
  const { schemaId } = this.opts;
4306
4306
  if (typeof schema == "object") {
@@ -4316,7 +4316,7 @@ var require_core = __commonJS({
4316
4316
  return sch;
4317
4317
  baseId = (0, resolve_1.normalizeId)(id || baseId);
4318
4318
  const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
4319
- sch = new compile_1.SchemaEnv({ schema, schemaId, meta: meta4, baseId, localRefs });
4319
+ sch = new compile_1.SchemaEnv({ schema, schemaId, meta: meta5, baseId, localRefs });
4320
4320
  this._cache.set(sch.schema, sch);
4321
4321
  if (addSchema && !baseId.startsWith("#")) {
4322
4322
  if (baseId)
@@ -8018,12 +8018,12 @@ var init_lru = __esm({
8018
8018
  });
8019
8019
 
8020
8020
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/address/getAddress.js
8021
- function checksumAddress(address_, chainId) {
8022
- if (checksumAddressCache.has(`${address_}.${chainId}`))
8023
- return checksumAddressCache.get(`${address_}.${chainId}`);
8024
- const hexAddress = chainId ? `${chainId}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
8021
+ function checksumAddress(address_, chainId2) {
8022
+ if (checksumAddressCache.has(`${address_}.${chainId2}`))
8023
+ return checksumAddressCache.get(`${address_}.${chainId2}`);
8024
+ const hexAddress = chainId2 ? `${chainId2}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
8025
8025
  const hash8 = keccak256(stringToBytes(hexAddress), "bytes");
8026
- const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split("");
8026
+ const address = (chainId2 ? hexAddress.substring(`${chainId2}0x`.length) : hexAddress).split("");
8027
8027
  for (let i = 0; i < 40; i += 2) {
8028
8028
  if (hash8[i >> 1] >> 4 >= 8 && address[i]) {
8029
8029
  address[i] = address[i].toUpperCase();
@@ -8033,13 +8033,13 @@ function checksumAddress(address_, chainId) {
8033
8033
  }
8034
8034
  }
8035
8035
  const result = `0x${address.join("")}`;
8036
- checksumAddressCache.set(`${address_}.${chainId}`, result);
8036
+ checksumAddressCache.set(`${address_}.${chainId2}`, result);
8037
8037
  return result;
8038
8038
  }
8039
- function getAddress(address, chainId) {
8039
+ function getAddress(address, chainId2) {
8040
8040
  if (!isAddress(address, { strict: false }))
8041
8041
  throw new InvalidAddressError({ address });
8042
- return checksumAddress(address, chainId);
8042
+ return checksumAddress(address, chainId2);
8043
8043
  }
8044
8044
  var checksumAddressCache;
8045
8045
  var init_getAddress = __esm({
@@ -11512,9 +11512,9 @@ var require_dynamicAnchor = __commonJS({
11512
11512
  exports2.dynamicAnchor = dynamicAnchor;
11513
11513
  function _getValidate(cxt) {
11514
11514
  const { schemaEnv, schema, self: self2 } = cxt.it;
11515
- const { root, baseId, localRefs, meta: meta4 } = schemaEnv.root;
11515
+ const { root, baseId, localRefs, meta: meta5 } = schemaEnv.root;
11516
11516
  const { schemaId } = self2.opts;
11517
- const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta: meta4 });
11517
+ const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta: meta5 });
11518
11518
  compile_1.compileSchema.call(self2, sch);
11519
11519
  return (0, ref_1.getValidate)(cxt, sch);
11520
11520
  }
@@ -12276,8 +12276,8 @@ var require__ = __commonJS({
12276
12276
  }
12277
12277
  _addDefaultMetaSchema() {
12278
12278
  super._addDefaultMetaSchema();
12279
- const { $data, meta: meta4 } = this.opts;
12280
- if (!meta4)
12279
+ const { $data, meta: meta5 } = this.opts;
12280
+ if (!meta5)
12281
12281
  return;
12282
12282
  json_schema_2020_12_1.default.call(this, $data);
12283
12283
  this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
@@ -24597,14 +24597,14 @@ HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
24597
24597
  return ret;
24598
24598
  };
24599
24599
  parser.ast.callbacks.version = version7;
24600
- const chainId = function(state, chars, phraseIndex, phraseLength, data) {
24600
+ const chainId2 = function(state, chars, phraseIndex, phraseLength, data) {
24601
24601
  const ret = id.SEM_OK;
24602
24602
  if (state === id.SEM_PRE) {
24603
24603
  data.chainId = (0, utils_1.parseIntegerNumber)(node_exports_1.default.utils.charsToString(chars, phraseIndex, phraseLength));
24604
24604
  }
24605
24605
  return ret;
24606
24606
  };
24607
- parser.ast.callbacks["chain-id"] = chainId;
24607
+ parser.ast.callbacks["chain-id"] = chainId2;
24608
24608
  const nonce2 = function(state, chars, phraseIndex, phraseLength, data) {
24609
24609
  const ret = id.SEM_OK;
24610
24610
  if (state === id.SEM_PRE) {
@@ -24937,11 +24937,11 @@ function __metadata(metadataKey, metadataValue) {
24937
24937
  }
24938
24938
  function __awaiter2(thisArg, _arguments, P, generator) {
24939
24939
  function adopt(value) {
24940
- return value instanceof P ? value : new P(function(resolve) {
24941
- resolve(value);
24940
+ return value instanceof P ? value : new P(function(resolve2) {
24941
+ resolve2(value);
24942
24942
  });
24943
24943
  }
24944
- return new (P || (P = Promise))(function(resolve, reject) {
24944
+ return new (P || (P = Promise))(function(resolve2, reject) {
24945
24945
  function fulfilled(value) {
24946
24946
  try {
24947
24947
  step(generator.next(value));
@@ -24957,7 +24957,7 @@ function __awaiter2(thisArg, _arguments, P, generator) {
24957
24957
  }
24958
24958
  }
24959
24959
  function step(result) {
24960
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
24960
+ result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
24961
24961
  }
24962
24962
  step((generator = generator.apply(thisArg, _arguments || [])).next());
24963
24963
  });
@@ -25148,14 +25148,14 @@ function __asyncValues2(o) {
25148
25148
  }, i);
25149
25149
  function verb(n) {
25150
25150
  i[n] = o[n] && function(v) {
25151
- return new Promise(function(resolve, reject) {
25152
- v = o[n](v), settle(resolve, reject, v.done, v.value);
25151
+ return new Promise(function(resolve2, reject) {
25152
+ v = o[n](v), settle(resolve2, reject, v.done, v.value);
25153
25153
  });
25154
25154
  };
25155
25155
  }
25156
- function settle(resolve, reject, d, v) {
25156
+ function settle(resolve2, reject, d, v) {
25157
25157
  Promise.resolve(v).then(function(v2) {
25158
- resolve({ value: v2, done: d });
25158
+ resolve2({ value: v2, done: d });
25159
25159
  }, reject);
25160
25160
  }
25161
25161
  }
@@ -26199,7 +26199,7 @@ var require_geturl = __commonJS({
26199
26199
  request.write(Buffer.from(body));
26200
26200
  }
26201
26201
  request.end();
26202
- return new Promise((resolve, reject) => {
26202
+ return new Promise((resolve2, reject) => {
26203
26203
  if (signal) {
26204
26204
  signal.addListener(() => {
26205
26205
  if (abort) {
@@ -26245,7 +26245,7 @@ var require_geturl = __commonJS({
26245
26245
  if (headers2["content-encoding"] === "gzip" && body2) {
26246
26246
  body2 = (0, data_js_1.getBytes)((0, zlib_1.gunzipSync)(body2));
26247
26247
  }
26248
- resolve({ statusCode, statusMessage, headers: headers2, body: body2 });
26248
+ resolve2({ statusCode, statusMessage, headers: headers2, body: body2 });
26249
26249
  } catch (error48) {
26250
26250
  reject((0, errors_js_1.makeError)("bad response data", "SERVER_ERROR", {
26251
26251
  request: req,
@@ -27076,7 +27076,7 @@ var require_fetch = __commonJS({
27076
27076
  }));
27077
27077
  }
27078
27078
  function wait2(delay) {
27079
- return new Promise((resolve) => setTimeout(resolve, delay));
27079
+ return new Promise((resolve2) => setTimeout(resolve2, delay));
27080
27080
  }
27081
27081
  }
27082
27082
  });
@@ -32269,8 +32269,8 @@ var require_signature = __commonJS({
32269
32269
  * //_result:
32270
32270
  *
32271
32271
  */
32272
- static getChainIdV(chainId, v) {
32273
- return (0, index_js_2.getBigInt)(chainId) * BN_2 + BigInt(35 + v - 27);
32272
+ static getChainIdV(chainId2, v) {
32273
+ return (0, index_js_2.getBigInt)(chainId2) * BN_2 + BigInt(35 + v - 27);
32274
32274
  }
32275
32275
  /**
32276
32276
  * Compute the normalized legacy transaction ``v`` from a ``yParirty``,
@@ -34399,12 +34399,12 @@ var require_transaction = __commonJS({
34399
34399
  if (r === BN_0 && s === BN_0) {
34400
34400
  tx.chainId = v;
34401
34401
  } else {
34402
- let chainId = (v - BN_35) / BN_2;
34403
- if (chainId < BN_0) {
34404
- chainId = BN_0;
34402
+ let chainId2 = (v - BN_35) / BN_2;
34403
+ if (chainId2 < BN_0) {
34404
+ chainId2 = BN_0;
34405
34405
  }
34406
- tx.chainId = chainId;
34407
- (0, index_js_3.assertArgument)(chainId !== BN_0 || (v === BN_27 || v === BN_28), "non-canonical legacy v", "v", fields[6]);
34406
+ tx.chainId = chainId2;
34407
+ (0, index_js_3.assertArgument)(chainId2 !== BN_0 || (v === BN_27 || v === BN_28), "non-canonical legacy v", "v", fields[6]);
34408
34408
  tx.signature = index_js_2.Signature.from({
34409
34409
  r: (0, index_js_3.zeroPadValue)(fields[7], 32),
34410
34410
  s: (0, index_js_3.zeroPadValue)(fields[8], 32),
@@ -34422,27 +34422,27 @@ var require_transaction = __commonJS({
34422
34422
  formatNumber(tx.value, "value"),
34423
34423
  tx.data
34424
34424
  ];
34425
- let chainId = BN_0;
34425
+ let chainId2 = BN_0;
34426
34426
  if (tx.chainId != BN_0) {
34427
- chainId = (0, index_js_3.getBigInt)(tx.chainId, "tx.chainId");
34428
- (0, index_js_3.assertArgument)(!sig || sig.networkV == null || sig.legacyChainId === chainId, "tx.chainId/sig.v mismatch", "sig", sig);
34427
+ chainId2 = (0, index_js_3.getBigInt)(tx.chainId, "tx.chainId");
34428
+ (0, index_js_3.assertArgument)(!sig || sig.networkV == null || sig.legacyChainId === chainId2, "tx.chainId/sig.v mismatch", "sig", sig);
34429
34429
  } else if (tx.signature) {
34430
34430
  const legacy = tx.signature.legacyChainId;
34431
34431
  if (legacy != null) {
34432
- chainId = legacy;
34432
+ chainId2 = legacy;
34433
34433
  }
34434
34434
  }
34435
34435
  if (!sig) {
34436
- if (chainId !== BN_0) {
34437
- fields.push((0, index_js_3.toBeArray)(chainId));
34436
+ if (chainId2 !== BN_0) {
34437
+ fields.push((0, index_js_3.toBeArray)(chainId2));
34438
34438
  fields.push("0x");
34439
34439
  fields.push("0x");
34440
34440
  }
34441
34441
  return (0, index_js_3.encodeRlp)(fields);
34442
34442
  }
34443
34443
  let v = BigInt(27 + sig.yParity);
34444
- if (chainId !== BN_0) {
34445
- v = index_js_2.Signature.getChainIdV(chainId, sig.v);
34444
+ if (chainId2 !== BN_0) {
34445
+ v = index_js_2.Signature.getChainIdV(chainId2, sig.v);
34446
34446
  } else if (BigInt(sig.v) !== v) {
34447
34447
  (0, index_js_3.assertArgument)(false, "tx.chainId/sig.v mismatch", "sig", sig);
34448
34448
  }
@@ -36172,28 +36172,28 @@ var require_dist2 = __commonJS({
36172
36172
  };
36173
36173
  offset += input.length + 1;
36174
36174
  try {
36175
- let tokens = info.tokens = tokens_from_str(input, nf, ef);
36176
- let token_count = tokens.length;
36175
+ let tokens2 = info.tokens = tokens_from_str(input, nf, ef);
36176
+ let token_count = tokens2.length;
36177
36177
  let type4;
36178
36178
  if (!token_count) {
36179
36179
  throw new Error(`empty label`);
36180
36180
  }
36181
- let norm = info.output = tokens.flat();
36181
+ let norm = info.output = tokens2.flat();
36182
36182
  check_leading_underscore(norm);
36183
- let emoji4 = info.emoji = token_count > 1 || tokens[0].is_emoji;
36183
+ let emoji4 = info.emoji = token_count > 1 || tokens2[0].is_emoji;
36184
36184
  if (!emoji4 && norm.every((cp) => cp < 128)) {
36185
36185
  check_label_extension(norm);
36186
36186
  type4 = "ASCII";
36187
36187
  } else {
36188
- let chars = tokens.flatMap((x) => x.is_emoji ? [] : x);
36188
+ let chars = tokens2.flatMap((x) => x.is_emoji ? [] : x);
36189
36189
  if (!chars.length) {
36190
36190
  type4 = "Emoji";
36191
36191
  } else {
36192
36192
  if (CM.has(norm[0])) throw error_placement("leading combining mark");
36193
36193
  for (let i = 1; i < token_count; i++) {
36194
- let cps = tokens[i];
36194
+ let cps = tokens2[i];
36195
36195
  if (!cps.is_emoji && CM.has(cps[0])) {
36196
- throw error_placement(`emoji + combining mark: "${str_from_cps(tokens[i - 1])} + ${safe_str_from_cps([cps[0]])}"`);
36196
+ throw error_placement(`emoji + combining mark: "${str_from_cps(tokens2[i - 1])} + ${safe_str_from_cps([cps[0]])}"`);
36197
36197
  }
36198
36198
  }
36199
36199
  check_fenced(norm);
@@ -36362,11 +36362,11 @@ var require_dist2 = __commonJS({
36362
36362
  init();
36363
36363
  let input = explode_cp(name).reverse();
36364
36364
  let eaten = [];
36365
- let tokens = [];
36365
+ let tokens2 = [];
36366
36366
  while (input.length) {
36367
36367
  let emoji4 = consume_emoji_reversed(input, eaten);
36368
36368
  if (emoji4) {
36369
- tokens.push({
36369
+ tokens2.push({
36370
36370
  type: TY_EMOJI,
36371
36371
  emoji: emoji4.slice(),
36372
36372
  // copy emoji
@@ -36377,29 +36377,29 @@ var require_dist2 = __commonJS({
36377
36377
  } else {
36378
36378
  let cp = input.pop();
36379
36379
  if (cp == STOP) {
36380
- tokens.push({ type: TY_STOP, cp });
36380
+ tokens2.push({ type: TY_STOP, cp });
36381
36381
  } else if (VALID.has(cp)) {
36382
- tokens.push({ type: TY_VALID, cps: [cp] });
36382
+ tokens2.push({ type: TY_VALID, cps: [cp] });
36383
36383
  } else if (IGNORED.has(cp)) {
36384
- tokens.push({ type: TY_IGNORED, cp });
36384
+ tokens2.push({ type: TY_IGNORED, cp });
36385
36385
  } else {
36386
36386
  let cps = MAPPED.get(cp);
36387
36387
  if (cps) {
36388
- tokens.push({ type: TY_MAPPED, cp, cps: cps.slice() });
36388
+ tokens2.push({ type: TY_MAPPED, cp, cps: cps.slice() });
36389
36389
  } else {
36390
- tokens.push({ type: TY_DISALLOWED, cp });
36390
+ tokens2.push({ type: TY_DISALLOWED, cp });
36391
36391
  }
36392
36392
  }
36393
36393
  }
36394
36394
  }
36395
36395
  if (nf) {
36396
- for (let i = 0, start = -1; i < tokens.length; i++) {
36397
- let token = tokens[i];
36396
+ for (let i = 0, start = -1; i < tokens2.length; i++) {
36397
+ let token = tokens2[i];
36398
36398
  if (is_valid_or_mapped(token.type)) {
36399
36399
  if (requires_check(token.cps)) {
36400
36400
  let end = i + 1;
36401
- for (let pos = end; pos < tokens.length; pos++) {
36402
- let { type: type4, cps: cps2 } = tokens[pos];
36401
+ for (let pos = end; pos < tokens2.length; pos++) {
36402
+ let { type: type4, cps: cps2 } = tokens2[pos];
36403
36403
  if (is_valid_or_mapped(type4)) {
36404
36404
  if (!requires_check(cps2)) break;
36405
36405
  end = pos + 1;
@@ -36408,11 +36408,11 @@ var require_dist2 = __commonJS({
36408
36408
  }
36409
36409
  }
36410
36410
  if (start < 0) start = i;
36411
- let slice5 = tokens.slice(start, end);
36411
+ let slice5 = tokens2.slice(start, end);
36412
36412
  let cps0 = slice5.flatMap((x) => is_valid_or_mapped(x.type) ? x.cps : []);
36413
36413
  let cps = nfc(cps0);
36414
36414
  if (compare_arrays(cps, cps0)) {
36415
- tokens.splice(start, end - start, {
36415
+ tokens2.splice(start, end - start, {
36416
36416
  type: TY_NFC,
36417
36417
  input: cps0,
36418
36418
  // there are 3 states: tokens0 ==(process)=> input ==(nfc)=> tokens/cps
@@ -36433,7 +36433,7 @@ var require_dist2 = __commonJS({
36433
36433
  }
36434
36434
  }
36435
36435
  }
36436
- return collapse_valid_tokens(tokens);
36436
+ return collapse_valid_tokens(tokens2);
36437
36437
  }
36438
36438
  function is_valid_or_mapped(type4) {
36439
36439
  return type4 == TY_VALID || type4 == TY_MAPPED;
@@ -36441,15 +36441,15 @@ var require_dist2 = __commonJS({
36441
36441
  function requires_check(cps) {
36442
36442
  return cps.some((cp) => NFC_CHECK.has(cp));
36443
36443
  }
36444
- function collapse_valid_tokens(tokens) {
36445
- for (let i = 0; i < tokens.length; i++) {
36446
- if (tokens[i].type == TY_VALID) {
36444
+ function collapse_valid_tokens(tokens2) {
36445
+ for (let i = 0; i < tokens2.length; i++) {
36446
+ if (tokens2[i].type == TY_VALID) {
36447
36447
  let j = i + 1;
36448
- while (j < tokens.length && tokens[j].type == TY_VALID) j++;
36449
- tokens.splice(i, j - i, { type: TY_VALID, cps: tokens.slice(i, j).flatMap((x) => x.cps) });
36448
+ while (j < tokens2.length && tokens2[j].type == TY_VALID) j++;
36449
+ tokens2.splice(i, j - i, { type: TY_VALID, cps: tokens2.slice(i, j).flatMap((x) => x.cps) });
36450
36450
  }
36451
36451
  }
36452
- return tokens;
36452
+ return tokens2;
36453
36453
  }
36454
36454
  exports2.ens_beautify = ens_beautify;
36455
36455
  exports2.ens_emoji = ens_emoji;
@@ -37252,9 +37252,9 @@ var require_fragments = __commonJS({
37252
37252
  get length() {
37253
37253
  return this.#tokens.length - this.#offset;
37254
37254
  }
37255
- constructor(tokens) {
37255
+ constructor(tokens2) {
37256
37256
  this.#offset = 0;
37257
- this.#tokens = tokens.slice();
37257
+ this.#tokens = tokens2.slice();
37258
37258
  }
37259
37259
  clone() {
37260
37260
  return new _TokenString(this.#tokens);
@@ -37339,16 +37339,16 @@ var require_fragments = __commonJS({
37339
37339
  return result;
37340
37340
  }
37341
37341
  toString() {
37342
- const tokens = [];
37342
+ const tokens2 = [];
37343
37343
  for (let i = this.#offset; i < this.#tokens.length; i++) {
37344
37344
  const token = this.#tokens[i];
37345
- tokens.push(`${token.type}:${token.text}`);
37345
+ tokens2.push(`${token.type}:${token.text}`);
37346
37346
  }
37347
- return `<TokenString ${tokens.join(" ")}>`;
37347
+ return `<TokenString ${tokens2.join(" ")}>`;
37348
37348
  }
37349
37349
  };
37350
37350
  function lex(text) {
37351
- const tokens = [];
37351
+ const tokens2 = [];
37352
37352
  const throwError = (message) => {
37353
37353
  const token = offset < text.length ? JSON.stringify(text[offset]) : "$EOI";
37354
37354
  throw new Error(`invalid token ${token} at ${offset}: ${message}`);
@@ -37364,41 +37364,41 @@ var require_fragments = __commonJS({
37364
37364
  cur = text.substring(offset);
37365
37365
  }
37366
37366
  const token = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: "", text: "", offset, value: -1 };
37367
- tokens.push(token);
37367
+ tokens2.push(token);
37368
37368
  let type4 = SimpleTokens[cur[0]] || "";
37369
37369
  if (type4) {
37370
37370
  token.type = type4;
37371
37371
  token.text = cur[0];
37372
37372
  offset++;
37373
37373
  if (type4 === "OPEN_PAREN") {
37374
- brackets.push(tokens.length - 1);
37375
- commas.push(tokens.length - 1);
37374
+ brackets.push(tokens2.length - 1);
37375
+ commas.push(tokens2.length - 1);
37376
37376
  } else if (type4 == "CLOSE_PAREN") {
37377
37377
  if (brackets.length === 0) {
37378
37378
  throwError("no matching open bracket");
37379
37379
  }
37380
37380
  token.match = brackets.pop();
37381
- tokens[token.match].match = tokens.length - 1;
37381
+ tokens2[token.match].match = tokens2.length - 1;
37382
37382
  token.depth--;
37383
37383
  token.linkBack = commas.pop();
37384
- tokens[token.linkBack].linkNext = tokens.length - 1;
37384
+ tokens2[token.linkBack].linkNext = tokens2.length - 1;
37385
37385
  } else if (type4 === "COMMA") {
37386
37386
  token.linkBack = commas.pop();
37387
- tokens[token.linkBack].linkNext = tokens.length - 1;
37388
- commas.push(tokens.length - 1);
37387
+ tokens2[token.linkBack].linkNext = tokens2.length - 1;
37388
+ commas.push(tokens2.length - 1);
37389
37389
  } else if (type4 === "OPEN_BRACKET") {
37390
37390
  token.type = "BRACKET";
37391
37391
  } else if (type4 === "CLOSE_BRACKET") {
37392
- let suffix = tokens.pop().text;
37393
- if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") {
37394
- const value = tokens.pop().text;
37392
+ let suffix = tokens2.pop().text;
37393
+ if (tokens2.length > 0 && tokens2[tokens2.length - 1].type === "NUMBER") {
37394
+ const value = tokens2.pop().text;
37395
37395
  suffix = value + suffix;
37396
- tokens[tokens.length - 1].value = (0, index_js_1.getNumber)(value);
37396
+ tokens2[tokens2.length - 1].value = (0, index_js_1.getNumber)(value);
37397
37397
  }
37398
- if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") {
37398
+ if (tokens2.length === 0 || tokens2[tokens2.length - 1].type !== "BRACKET") {
37399
37399
  throw new Error("missing opening bracket");
37400
37400
  }
37401
- tokens[tokens.length - 1].text += suffix;
37401
+ tokens2[tokens2.length - 1].text += suffix;
37402
37402
  }
37403
37403
  continue;
37404
37404
  }
@@ -37426,7 +37426,7 @@ var require_fragments = __commonJS({
37426
37426
  }
37427
37427
  throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);
37428
37428
  }
37429
- return new TokenString(tokens.map((t) => Object.freeze(t)));
37429
+ return new TokenString(tokens2.map((t) => Object.freeze(t)));
37430
37430
  }
37431
37431
  function allowSingle(set3, allowed) {
37432
37432
  let included = [];
@@ -37439,23 +37439,23 @@ var require_fragments = __commonJS({
37439
37439
  throw new Error(`conflicting types: ${included.join(", ")}`);
37440
37440
  }
37441
37441
  }
37442
- function consumeName(type4, tokens) {
37443
- if (tokens.peekKeyword(KwTypes)) {
37444
- const keyword = tokens.pop().text;
37442
+ function consumeName(type4, tokens2) {
37443
+ if (tokens2.peekKeyword(KwTypes)) {
37444
+ const keyword = tokens2.pop().text;
37445
37445
  if (keyword !== type4) {
37446
37446
  throw new Error(`expected ${type4}, got ${keyword}`);
37447
37447
  }
37448
37448
  }
37449
- return tokens.popType("ID");
37449
+ return tokens2.popType("ID");
37450
37450
  }
37451
- function consumeKeywords(tokens, allowed) {
37451
+ function consumeKeywords(tokens2, allowed) {
37452
37452
  const keywords = /* @__PURE__ */ new Set();
37453
37453
  while (true) {
37454
- const keyword = tokens.peekType("KEYWORD");
37454
+ const keyword = tokens2.peekType("KEYWORD");
37455
37455
  if (keyword == null || allowed && !allowed.has(keyword)) {
37456
37456
  break;
37457
37457
  }
37458
- tokens.pop();
37458
+ tokens2.pop();
37459
37459
  if (keywords.has(keyword)) {
37460
37460
  throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);
37461
37461
  }
@@ -37463,8 +37463,8 @@ var require_fragments = __commonJS({
37463
37463
  }
37464
37464
  return Object.freeze(keywords);
37465
37465
  }
37466
- function consumeMutability(tokens) {
37467
- let modifiers2 = consumeKeywords(tokens, KwVisib);
37466
+ function consumeMutability(tokens2) {
37467
+ let modifiers2 = consumeKeywords(tokens2, KwVisib);
37468
37468
  allowSingle(modifiers2, setify("constant payable nonpayable".split(" ")));
37469
37469
  allowSingle(modifiers2, setify("pure view payable nonpayable".split(" ")));
37470
37470
  if (modifiers2.has("view")) {
@@ -37484,22 +37484,22 @@ var require_fragments = __commonJS({
37484
37484
  }
37485
37485
  return "nonpayable";
37486
37486
  }
37487
- function consumeParams(tokens, allowIndexed) {
37488
- return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));
37487
+ function consumeParams(tokens2, allowIndexed) {
37488
+ return tokens2.popParams().map((t) => ParamType.from(t, allowIndexed));
37489
37489
  }
37490
- function consumeGas(tokens) {
37491
- if (tokens.peekType("AT")) {
37492
- tokens.pop();
37493
- if (tokens.peekType("NUMBER")) {
37494
- return (0, index_js_1.getBigInt)(tokens.pop().text);
37490
+ function consumeGas(tokens2) {
37491
+ if (tokens2.peekType("AT")) {
37492
+ tokens2.pop();
37493
+ if (tokens2.peekType("NUMBER")) {
37494
+ return (0, index_js_1.getBigInt)(tokens2.pop().text);
37495
37495
  }
37496
37496
  throw new Error("invalid gas");
37497
37497
  }
37498
37498
  return null;
37499
37499
  }
37500
- function consumeEoi(tokens) {
37501
- if (tokens.length) {
37502
- throw new Error(`unexpected tokens at offset ${tokens.offset}: ${tokens.toString()}`);
37500
+ function consumeEoi(tokens2) {
37501
+ if (tokens2.length) {
37502
+ throw new Error(`unexpected tokens at offset ${tokens2.offset}: ${tokens2.toString()}`);
37503
37503
  }
37504
37504
  }
37505
37505
  var regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/);
@@ -40953,7 +40953,7 @@ var require_provider = __commonJS({
40953
40953
  return null;
40954
40954
  }
40955
40955
  }
40956
- const waiter = new Promise((resolve, reject) => {
40956
+ const waiter = new Promise((resolve2, reject) => {
40957
40957
  const cancellers = [];
40958
40958
  const cancel2 = () => {
40959
40959
  cancellers.forEach((c) => c());
@@ -40974,7 +40974,7 @@ var require_provider = __commonJS({
40974
40974
  if (await receipt2.confirmations() >= confirms) {
40975
40975
  cancel2();
40976
40976
  try {
40977
- resolve(checkReceipt(receipt2));
40977
+ resolve2(checkReceipt(receipt2));
40978
40978
  } catch (error48) {
40979
40979
  reject(error48);
40980
40980
  }
@@ -41925,12 +41925,12 @@ var require_contract = __commonJS({
41925
41925
  }
41926
41926
  const provider = getProvider(this.runner);
41927
41927
  (0, index_js_3.assert)(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" });
41928
- return new Promise((resolve, reject) => {
41928
+ return new Promise((resolve2, reject) => {
41929
41929
  const checkCode = async () => {
41930
41930
  try {
41931
41931
  const code2 = await this.getDeployedCode();
41932
41932
  if (code2 != null) {
41933
- return resolve(this);
41933
+ return resolve2(this);
41934
41934
  }
41935
41935
  provider.once("block", checkCode);
41936
41936
  } catch (error48) {
@@ -43031,9 +43031,9 @@ var require_format3 = __commonJS({
43031
43031
  result.signature = index_js_2.Signature.from(value);
43032
43032
  }
43033
43033
  if (result.chainId == null) {
43034
- const chainId = result.signature.legacyChainId;
43035
- if (chainId != null) {
43036
- result.chainId = chainId;
43034
+ const chainId2 = result.signature.legacyChainId;
43035
+ if (chainId2 != null) {
43036
+ result.chainId = chainId2;
43037
43037
  }
43038
43038
  }
43039
43039
  if (result.blockHash && (0, index_js_4.getBigInt)(result.blockHash) === BN_0) {
@@ -43244,9 +43244,9 @@ var require_network = __commonJS({
43244
43244
  /**
43245
43245
  * Creates a new **Network** for %%name%% and %%chainId%%.
43246
43246
  */
43247
- constructor(name, chainId) {
43247
+ constructor(name, chainId2) {
43248
43248
  this.#name = name;
43249
- this.#chainId = (0, index_js_2.getBigInt)(chainId);
43249
+ this.#chainId = (0, index_js_2.getBigInt)(chainId2);
43250
43250
  this.#plugins = /* @__PURE__ */ new Map();
43251
43251
  }
43252
43252
  /**
@@ -43490,9 +43490,9 @@ var require_network = __commonJS({
43490
43490
  return;
43491
43491
  }
43492
43492
  injected = true;
43493
- function registerEth(name, chainId, options) {
43493
+ function registerEth(name, chainId2, options) {
43494
43494
  const func = function() {
43495
- const network = new Network(name, chainId);
43495
+ const network = new Network(name, chainId2);
43496
43496
  if (options.ensNetwork != null) {
43497
43497
  network.attachPlugin(new plugins_network_js_1.EnsPlugin(null, options.ensNetwork));
43498
43498
  }
@@ -43503,7 +43503,7 @@ var require_network = __commonJS({
43503
43503
  return network;
43504
43504
  };
43505
43505
  Network.register(name, func);
43506
- Network.register(chainId, func);
43506
+ Network.register(chainId2, func);
43507
43507
  if (options.altNames) {
43508
43508
  options.altNames.forEach((name2) => {
43509
43509
  Network.register(name2, func);
@@ -44254,7 +44254,7 @@ var require_abstract_provider = __commonJS({
44254
44254
  return t.toLowerCase();
44255
44255
  });
44256
44256
  const blockHash = "blockHash" in filter ? filter.blockHash : void 0;
44257
- const resolve = (_address, fromBlock2, toBlock2) => {
44257
+ const resolve2 = (_address, fromBlock2, toBlock2) => {
44258
44258
  let address2 = void 0;
44259
44259
  switch (_address.length) {
44260
44260
  case 0:
@@ -44309,10 +44309,10 @@ var require_abstract_provider = __commonJS({
44309
44309
  }
44310
44310
  if (address.filter((a) => typeof a !== "string").length || fromBlock != null && typeof fromBlock !== "string" || toBlock != null && typeof toBlock !== "string") {
44311
44311
  return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => {
44312
- return resolve(result[0], result[1], result[2]);
44312
+ return resolve2(result[0], result[1], result[2]);
44313
44313
  });
44314
44314
  }
44315
- return resolve(address, fromBlock, toBlock);
44315
+ return resolve2(address, fromBlock, toBlock);
44316
44316
  }
44317
44317
  /**
44318
44318
  * Returns or resolves to a transaction for %%request%%, resolving
@@ -44627,7 +44627,7 @@ var require_abstract_provider = __commonJS({
44627
44627
  return params.map((p) => this._wrapLog(p, network));
44628
44628
  }
44629
44629
  // ENS
44630
- _getProvider(chainId) {
44630
+ _getProvider(chainId2) {
44631
44631
  (0, index_js_6.assert)(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", {
44632
44632
  operation: "_getProvider()"
44633
44633
  });
@@ -44686,14 +44686,14 @@ var require_abstract_provider = __commonJS({
44686
44686
  if (confirms === 0) {
44687
44687
  return this.getTransactionReceipt(hash8);
44688
44688
  }
44689
- return new Promise(async (resolve, reject) => {
44689
+ return new Promise(async (resolve2, reject) => {
44690
44690
  let timer = null;
44691
44691
  const listener = (async (blockNumber) => {
44692
44692
  try {
44693
44693
  const receipt = await this.getTransactionReceipt(hash8);
44694
44694
  if (receipt != null) {
44695
44695
  if (blockNumber - receipt.blockNumber + 1 >= confirms) {
44696
- resolve(receipt);
44696
+ resolve2(receipt);
44697
44697
  if (timer) {
44698
44698
  clearTimeout(timer);
44699
44699
  timer = null;
@@ -45242,8 +45242,8 @@ var require_abstract_signer = __commonJS({
45242
45242
  }
45243
45243
  const network = await this.provider.getNetwork();
45244
45244
  if (pop.chainId != null) {
45245
- const chainId = (0, index_js_3.getBigInt)(pop.chainId);
45246
- (0, index_js_3.assertArgument)(chainId === network.chainId, "transaction chainId mismatch", "tx.chainId", tx.chainId);
45245
+ const chainId2 = (0, index_js_3.getBigInt)(pop.chainId);
45246
+ (0, index_js_3.assertArgument)(chainId2 === network.chainId, "transaction chainId mismatch", "tx.chainId", tx.chainId);
45247
45247
  } else {
45248
45248
  pop.chainId = network.chainId;
45249
45249
  }
@@ -45607,8 +45607,8 @@ var require_provider_jsonrpc = __commonJS({
45607
45607
  throw new Error(`should not happen: ${value} (${typeof value})`);
45608
45608
  }
45609
45609
  function stall(duration4) {
45610
- return new Promise((resolve) => {
45611
- setTimeout(resolve, duration4);
45610
+ return new Promise((resolve2) => {
45611
+ setTimeout(resolve2, duration4);
45612
45612
  });
45613
45613
  }
45614
45614
  function getLowerCase(value) {
@@ -45683,14 +45683,14 @@ var require_provider_jsonrpc = __commonJS({
45683
45683
  async sendTransaction(tx) {
45684
45684
  const blockNumber = await this.provider.getBlockNumber();
45685
45685
  const hash8 = await this.sendUncheckedTransaction(tx);
45686
- return await new Promise((resolve, reject) => {
45686
+ return await new Promise((resolve2, reject) => {
45687
45687
  const timeouts = [1e3, 100];
45688
45688
  let invalids = 0;
45689
45689
  const checkTx = async () => {
45690
45690
  try {
45691
45691
  const tx2 = await this.provider.getTransaction(hash8);
45692
45692
  if (tx2 != null) {
45693
- resolve(tx2.replaceableTransaction(blockNumber));
45693
+ resolve2(tx2.replaceableTransaction(blockNumber));
45694
45694
  return;
45695
45695
  }
45696
45696
  } catch (error48) {
@@ -45808,7 +45808,7 @@ var require_provider_jsonrpc = __commonJS({
45808
45808
  try {
45809
45809
  const result = await this._send(payload);
45810
45810
  this.emit("debug", { action: "receiveRpcResult", result });
45811
- for (const { resolve, reject, payload: payload2 } of batch) {
45811
+ for (const { resolve: resolve2, reject, payload: payload2 } of batch) {
45812
45812
  if (this.destroyed) {
45813
45813
  reject((0, index_js_5.makeError)("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload2.method }));
45814
45814
  continue;
@@ -45827,7 +45827,7 @@ var require_provider_jsonrpc = __commonJS({
45827
45827
  reject(this.getRpcError(payload2, resp));
45828
45828
  continue;
45829
45829
  }
45830
- resolve(resp.result);
45830
+ resolve2(resp.result);
45831
45831
  }
45832
45832
  } catch (error48) {
45833
45833
  this.emit("debug", { action: "receiveRpcError", error: error48 });
@@ -45848,11 +45848,11 @@ var require_provider_jsonrpc = __commonJS({
45848
45848
  this.#network = null;
45849
45849
  this.#pendingDetectNetwork = null;
45850
45850
  {
45851
- let resolve = null;
45851
+ let resolve2 = null;
45852
45852
  const promise3 = new Promise((_resolve) => {
45853
- resolve = _resolve;
45853
+ resolve2 = _resolve;
45854
45854
  });
45855
- this.#notReady = { promise: promise3, resolve };
45855
+ this.#notReady = { promise: promise3, resolve: resolve2 };
45856
45856
  }
45857
45857
  const staticNetwork = this._getOption("staticNetwork");
45858
45858
  if (typeof staticNetwork === "boolean") {
@@ -46265,9 +46265,9 @@ var require_provider_jsonrpc = __commonJS({
46265
46265
  return Promise.reject((0, index_js_5.makeError)("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: method }));
46266
46266
  }
46267
46267
  const id = this.#nextId++;
46268
- const promise3 = new Promise((resolve, reject) => {
46268
+ const promise3 = new Promise((resolve2, reject) => {
46269
46269
  this.#payloads.push({
46270
- resolve,
46270
+ resolve: resolve2,
46271
46271
  reject,
46272
46272
  payload: { method, params, id, jsonrpc: "2.0" }
46273
46273
  });
@@ -46522,12 +46522,12 @@ var require_provider_ankr = __commonJS({
46522
46522
  super(request, network, options);
46523
46523
  (0, index_js_1.defineProperties)(this, { apiKey });
46524
46524
  }
46525
- _getProvider(chainId) {
46525
+ _getProvider(chainId2) {
46526
46526
  try {
46527
- return new _AnkrProvider(chainId, this.apiKey);
46527
+ return new _AnkrProvider(chainId2, this.apiKey);
46528
46528
  } catch (error48) {
46529
46529
  }
46530
- return super._getProvider(chainId);
46530
+ return super._getProvider(chainId2);
46531
46531
  }
46532
46532
  /**
46533
46533
  * Returns a prepared request for connecting to %%network%% with
@@ -46624,12 +46624,12 @@ var require_provider_alchemy = __commonJS({
46624
46624
  super(request, network, { staticNetwork: network });
46625
46625
  (0, index_js_1.defineProperties)(this, { apiKey });
46626
46626
  }
46627
- _getProvider(chainId) {
46627
+ _getProvider(chainId2) {
46628
46628
  try {
46629
- return new _AlchemyProvider(chainId, this.apiKey);
46629
+ return new _AlchemyProvider(chainId2, this.apiKey);
46630
46630
  } catch (error48) {
46631
46631
  }
46632
- return super._getProvider(chainId);
46632
+ return super._getProvider(chainId2);
46633
46633
  }
46634
46634
  async _perform(req) {
46635
46635
  if (req.method === "getTransactionResult") {
@@ -46742,12 +46742,12 @@ var require_provider_chainstack = __commonJS({
46742
46742
  super(request, network, { staticNetwork: network });
46743
46743
  (0, index_js_1.defineProperties)(this, { apiKey });
46744
46744
  }
46745
- _getProvider(chainId) {
46745
+ _getProvider(chainId2) {
46746
46746
  try {
46747
- return new _ChainstackProvider(chainId, this.apiKey);
46747
+ return new _ChainstackProvider(chainId2, this.apiKey);
46748
46748
  } catch (error48) {
46749
46749
  }
46750
- return super._getProvider(chainId);
46750
+ return super._getProvider(chainId2);
46751
46751
  }
46752
46752
  isCommunityResource() {
46753
46753
  return this.apiKey === getApiKey(this._network.name);
@@ -47394,9 +47394,9 @@ var require_node_gyp_build = __commonJS({
47394
47394
  var debug = getFirst(path2.join(dir, "build/Debug"), matchBuild);
47395
47395
  if (debug) return debug;
47396
47396
  }
47397
- var prebuild = resolve(dir);
47397
+ var prebuild = resolve2(dir);
47398
47398
  if (prebuild) return prebuild;
47399
- var nearby = resolve(path2.dirname(process.execPath));
47399
+ var nearby = resolve2(path2.dirname(process.execPath));
47400
47400
  if (nearby) return nearby;
47401
47401
  var target = [
47402
47402
  "platform=" + platform2,
@@ -47412,7 +47412,7 @@ var require_node_gyp_build = __commonJS({
47412
47412
  // eslint-disable-line
47413
47413
  ].filter(Boolean).join(" ");
47414
47414
  throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
47415
- function resolve(dir2) {
47415
+ function resolve2(dir2) {
47416
47416
  var tuples = readdirSync2(path2.join(dir2, "prebuilds")).map(parseTuple);
47417
47417
  var tuple3 = tuples.filter(matchTuple(platform2, arch2)).sort(compareTuples)[0];
47418
47418
  if (!tuple3) return;
@@ -51348,8 +51348,8 @@ var require_provider_socket = __commonJS({
51348
51348
  }
51349
51349
  async _send(payload) {
51350
51350
  (0, index_js_1.assertArgument)(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload);
51351
- const promise3 = new Promise((resolve, reject) => {
51352
- this.#callbacks.set(payload.id, { payload, resolve, reject });
51351
+ const promise3 = new Promise((resolve2, reject) => {
51352
+ this.#callbacks.set(payload.id, { payload, resolve: resolve2, reject });
51353
51353
  });
51354
51354
  await this._waitUntilReady();
51355
51355
  await this._write(JSON.stringify(payload));
@@ -51599,12 +51599,12 @@ var require_provider_infura = __commonJS({
51599
51599
  super(request, network, { staticNetwork: network });
51600
51600
  (0, index_js_1.defineProperties)(this, { projectId, projectSecret });
51601
51601
  }
51602
- _getProvider(chainId) {
51602
+ _getProvider(chainId2) {
51603
51603
  try {
51604
- return new _InfuraProvider(chainId, this.projectId, this.projectSecret);
51604
+ return new _InfuraProvider(chainId2, this.projectId, this.projectSecret);
51605
51605
  } catch (error48) {
51606
51606
  }
51607
- return super._getProvider(chainId);
51607
+ return super._getProvider(chainId2);
51608
51608
  }
51609
51609
  isCommunityResource() {
51610
51610
  return this.projectId === defaultProjectId;
@@ -51717,12 +51717,12 @@ var require_provider_quicknode = __commonJS({
51717
51717
  super(request, network, { staticNetwork: network });
51718
51718
  (0, index_js_1.defineProperties)(this, { token });
51719
51719
  }
51720
- _getProvider(chainId) {
51720
+ _getProvider(chainId2) {
51721
51721
  try {
51722
- return new _QuickNodeProvider(chainId, this.token);
51722
+ return new _QuickNodeProvider(chainId2, this.token);
51723
51723
  } catch (error48) {
51724
51724
  }
51725
- return super._getProvider(chainId);
51725
+ return super._getProvider(chainId2);
51726
51726
  }
51727
51727
  isCommunityResource() {
51728
51728
  return this.token === defaultToken;
@@ -51771,8 +51771,8 @@ var require_provider_fallback = __commonJS({
51771
51771
  }
51772
51772
  }
51773
51773
  function stall(duration4) {
51774
- return new Promise((resolve) => {
51775
- setTimeout(resolve, duration4);
51774
+ return new Promise((resolve2) => {
51775
+ setTimeout(resolve2, duration4);
51776
51776
  });
51777
51777
  }
51778
51778
  function getTime() {
@@ -52133,15 +52133,15 @@ var require_provider_fallback = __commonJS({
52133
52133
  });
52134
52134
  this.#initialSyncPromise = initialSync = (async () => {
52135
52135
  await Promise.all(promises);
52136
- let chainId = null;
52136
+ let chainId2 = null;
52137
52137
  for (const config2 of this.#configs) {
52138
52138
  if (config2._lastFatalError) {
52139
52139
  continue;
52140
52140
  }
52141
52141
  const network = config2._network;
52142
- if (chainId == null) {
52143
- chainId = network.chainId;
52144
- } else if (network.chainId !== chainId) {
52142
+ if (chainId2 == null) {
52143
+ chainId2 = network.chainId;
52144
+ } else if (network.chainId !== chainId2) {
52145
52145
  (0, index_js_1.assert)(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", {
52146
52146
  operation: "new FallbackProvider"
52147
52147
  });
@@ -52646,7 +52646,7 @@ var require_provider_browser = __commonJS({
52646
52646
  if (timeout === 0) {
52647
52647
  return null;
52648
52648
  }
52649
- return await new Promise((resolve, reject) => {
52649
+ return await new Promise((resolve2, reject) => {
52650
52650
  let found = [];
52651
52651
  const addProvider = (event) => {
52652
52652
  found.push(event.detail);
@@ -52660,9 +52660,9 @@ var require_provider_browser = __commonJS({
52660
52660
  if (options && options.filter) {
52661
52661
  const filtered = options.filter(found.map((i) => Object.assign({}, i.info)));
52662
52662
  if (filtered == null) {
52663
- resolve(null);
52663
+ resolve2(null);
52664
52664
  } else if (filtered instanceof _BrowserProvider) {
52665
- resolve(filtered);
52665
+ resolve2(filtered);
52666
52666
  } else {
52667
52667
  let match = null;
52668
52668
  if (filtered.uuid) {
@@ -52671,7 +52671,7 @@ var require_provider_browser = __commonJS({
52671
52671
  }
52672
52672
  if (match) {
52673
52673
  const { provider, info } = match;
52674
- resolve(new _BrowserProvider(provider, void 0, {
52674
+ resolve2(new _BrowserProvider(provider, void 0, {
52675
52675
  providerInfo: info
52676
52676
  }));
52677
52677
  } else {
@@ -52682,12 +52682,12 @@ var require_provider_browser = __commonJS({
52682
52682
  }
52683
52683
  } else {
52684
52684
  const { provider, info } = found[0];
52685
- resolve(new _BrowserProvider(provider, void 0, {
52685
+ resolve2(new _BrowserProvider(provider, void 0, {
52686
52686
  providerInfo: info
52687
52687
  }));
52688
52688
  }
52689
52689
  } else {
52690
- resolve(null);
52690
+ resolve2(null);
52691
52691
  }
52692
52692
  context2.removeEventListener("eip6963:announceProvider", addProvider);
52693
52693
  };
@@ -52760,12 +52760,12 @@ var require_provider_blockscout = __commonJS({
52760
52760
  super(request, network, { staticNetwork: network });
52761
52761
  (0, index_js_1.defineProperties)(this, { apiKey });
52762
52762
  }
52763
- _getProvider(chainId) {
52763
+ _getProvider(chainId2) {
52764
52764
  try {
52765
- return new _BlockscoutProvider(chainId, this.apiKey);
52765
+ return new _BlockscoutProvider(chainId2, this.apiKey);
52766
52766
  } catch (error48) {
52767
52767
  }
52768
- return super._getProvider(chainId);
52768
+ return super._getProvider(chainId2);
52769
52769
  }
52770
52770
  isCommunityResource() {
52771
52771
  return this.apiKey === null;
@@ -52876,12 +52876,12 @@ var require_provider_pocket = __commonJS({
52876
52876
  super(request, network, options);
52877
52877
  (0, index_js_1.defineProperties)(this, { applicationId, applicationSecret });
52878
52878
  }
52879
- _getProvider(chainId) {
52879
+ _getProvider(chainId2) {
52880
52880
  try {
52881
- return new _PocketProvider(chainId, this.applicationId, this.applicationSecret);
52881
+ return new _PocketProvider(chainId2, this.applicationId, this.applicationSecret);
52882
52882
  } catch (error48) {
52883
52883
  }
52884
- return super._getProvider(chainId);
52884
+ return super._getProvider(chainId2);
52885
52885
  }
52886
52886
  /**
52887
52887
  * Returns a prepared request for connecting to %%network%% with
@@ -54469,9 +54469,9 @@ var require_json_keystore = __commonJS({
54469
54469
  }
54470
54470
  exports2.decryptKeystoreJsonSync = decryptKeystoreJsonSync;
54471
54471
  function stall(duration4) {
54472
- return new Promise((resolve) => {
54472
+ return new Promise((resolve2) => {
54473
54473
  setTimeout(() => {
54474
- resolve();
54474
+ resolve2();
54475
54475
  }, duration4);
54476
54476
  });
54477
54477
  }
@@ -55109,9 +55109,9 @@ var require_wallet = __commonJS({
55109
55109
  var json_keystore_js_1 = require_json_keystore();
55110
55110
  var mnemonic_js_1 = require_mnemonic();
55111
55111
  function stall(duration4) {
55112
- return new Promise((resolve) => {
55112
+ return new Promise((resolve2) => {
55113
55113
  setTimeout(() => {
55114
- resolve();
55114
+ resolve2();
55115
55115
  }, duration4);
55116
55116
  });
55117
55117
  }
@@ -57245,11 +57245,11 @@ var require_utils8 = __commonJS({
57245
57245
  init_cjs_shims();
57246
57246
  var __awaiter3 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
57247
57247
  function adopt(value) {
57248
- return value instanceof P ? value : new P(function(resolve) {
57249
- resolve(value);
57248
+ return value instanceof P ? value : new P(function(resolve2) {
57249
+ resolve2(value);
57250
57250
  });
57251
57251
  }
57252
- return new (P || (P = Promise))(function(resolve, reject) {
57252
+ return new (P || (P = Promise))(function(resolve2, reject) {
57253
57253
  function fulfilled(value) {
57254
57254
  try {
57255
57255
  step(generator.next(value));
@@ -57265,7 +57265,7 @@ var require_utils8 = __commonJS({
57265
57265
  }
57266
57266
  }
57267
57267
  function step(result) {
57268
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
57268
+ result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
57269
57269
  }
57270
57270
  step((generator = generator.apply(thisArg, _arguments || [])).next());
57271
57271
  });
@@ -57355,11 +57355,11 @@ var require_client = __commonJS({
57355
57355
  };
57356
57356
  var __awaiter3 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
57357
57357
  function adopt(value) {
57358
- return value instanceof P ? value : new P(function(resolve) {
57359
- resolve(value);
57358
+ return value instanceof P ? value : new P(function(resolve2) {
57359
+ resolve2(value);
57360
57360
  });
57361
57361
  }
57362
- return new (P || (P = Promise))(function(resolve, reject) {
57362
+ return new (P || (P = Promise))(function(resolve2, reject) {
57363
57363
  function fulfilled(value) {
57364
57364
  try {
57365
57365
  step(generator.next(value));
@@ -57375,7 +57375,7 @@ var require_client = __commonJS({
57375
57375
  }
57376
57376
  }
57377
57377
  function step(result) {
57378
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
57378
+ result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
57379
57379
  }
57380
57380
  step((generator = generator.apply(thisArg, _arguments || [])).next());
57381
57381
  });
@@ -57515,11 +57515,11 @@ var require_client = __commonJS({
57515
57515
  */
57516
57516
  verify(params, opts = { suppressExceptions: false }) {
57517
57517
  return __awaiter3(this, void 0, void 0, function* () {
57518
- return new Promise((resolve, reject) => {
57518
+ return new Promise((resolve2, reject) => {
57519
57519
  var _a2, _b, _c;
57520
57520
  const fail = (result) => {
57521
57521
  if (opts.suppressExceptions) {
57522
- return resolve(result);
57522
+ return resolve2(result);
57523
57523
  } else {
57524
57524
  return reject(result);
57525
57525
  }
@@ -57600,7 +57600,7 @@ var require_client = __commonJS({
57600
57600
  console.error(e);
57601
57601
  }
57602
57602
  if (addr === this.address) {
57603
- return resolve({
57603
+ return resolve2({
57604
57604
  success: true,
57605
57605
  data: this
57606
57606
  });
@@ -57630,13 +57630,13 @@ var require_client = __commonJS({
57630
57630
  ]).then(([EIP1271Response, fallbackResponse]) => {
57631
57631
  if (fallbackResponse) {
57632
57632
  if (fallbackResponse.success) {
57633
- return resolve(fallbackResponse);
57633
+ return resolve2(fallbackResponse);
57634
57634
  } else {
57635
57635
  fail(fallbackResponse);
57636
57636
  }
57637
57637
  } else {
57638
57638
  if (EIP1271Response.success) {
57639
- return resolve(EIP1271Response);
57639
+ return resolve2(EIP1271Response);
57640
57640
  } else {
57641
57641
  fail(EIP1271Response);
57642
57642
  }
@@ -60658,12 +60658,12 @@ var init_lru2 = __esm({
60658
60658
  });
60659
60659
 
60660
60660
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/address/getAddress.js
60661
- function checksumAddress2(address_, chainId) {
60662
- if (checksumAddressCache2.has(`${address_}.${chainId}`))
60663
- return checksumAddressCache2.get(`${address_}.${chainId}`);
60664
- const hexAddress = chainId ? `${chainId}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
60661
+ function checksumAddress2(address_, chainId2) {
60662
+ if (checksumAddressCache2.has(`${address_}.${chainId2}`))
60663
+ return checksumAddressCache2.get(`${address_}.${chainId2}`);
60664
+ const hexAddress = chainId2 ? `${chainId2}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
60665
60665
  const hash8 = keccak2563(stringToBytes2(hexAddress), "bytes");
60666
- const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split("");
60666
+ const address = (chainId2 ? hexAddress.substring(`${chainId2}0x`.length) : hexAddress).split("");
60667
60667
  for (let i = 0; i < 40; i += 2) {
60668
60668
  if (hash8[i >> 1] >> 4 >= 8 && address[i]) {
60669
60669
  address[i] = address[i].toUpperCase();
@@ -60673,13 +60673,13 @@ function checksumAddress2(address_, chainId) {
60673
60673
  }
60674
60674
  }
60675
60675
  const result = `0x${address.join("")}`;
60676
- checksumAddressCache2.set(`${address_}.${chainId}`, result);
60676
+ checksumAddressCache2.set(`${address_}.${chainId2}`, result);
60677
60677
  return result;
60678
60678
  }
60679
- function getAddress2(address, chainId) {
60679
+ function getAddress2(address, chainId2) {
60680
60680
  if (!isAddress2(address, { strict: false }))
60681
60681
  throw new InvalidAddressError3({ address });
60682
- return checksumAddress2(address, chainId);
60682
+ return checksumAddress2(address, chainId2);
60683
60683
  }
60684
60684
  var checksumAddressCache2;
60685
60685
  var init_getAddress2 = __esm({
@@ -63926,8 +63926,8 @@ var init_chain = __esm({
63926
63926
  }
63927
63927
  };
63928
63928
  InvalidChainIdError2 = class extends BaseError4 {
63929
- constructor({ chainId }) {
63930
- super(typeof chainId === "number" ? `Chain ID "${chainId}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
63929
+ constructor({ chainId: chainId2 }) {
63930
+ super(typeof chainId2 === "number" ? `Chain ID "${chainId2}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
63931
63931
  }
63932
63932
  };
63933
63933
  }
@@ -64012,13 +64012,13 @@ var init_getCallError = __esm({
64012
64012
 
64013
64013
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/promise/withResolvers.js
64014
64014
  function withResolvers() {
64015
- let resolve = () => void 0;
64015
+ let resolve2 = () => void 0;
64016
64016
  let reject = () => void 0;
64017
64017
  const promise3 = new Promise((resolve_, reject_) => {
64018
- resolve = resolve_;
64018
+ resolve2 = resolve_;
64019
64019
  reject = reject_;
64020
64020
  });
64021
- return { promise: promise3, resolve, reject };
64021
+ return { promise: promise3, resolve: resolve2, reject };
64022
64022
  }
64023
64023
  var init_withResolvers = __esm({
64024
64024
  "../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/promise/withResolvers.js"() {
@@ -64039,8 +64039,8 @@ function createBatchScheduler({ fn, id, shouldSplitBatch, wait: wait2 = 0, sort
64039
64039
  if (sort && Array.isArray(data))
64040
64040
  data.sort(sort);
64041
64041
  for (let i = 0; i < scheduler.length; i++) {
64042
- const { resolve } = scheduler[i];
64043
- resolve?.([data[i], data]);
64042
+ const { resolve: resolve2 } = scheduler[i];
64043
+ resolve2?.([data[i], data]);
64044
64044
  }
64045
64045
  }).catch((err3) => {
64046
64046
  for (let i = 0; i < scheduler.length; i++) {
@@ -64056,16 +64056,16 @@ function createBatchScheduler({ fn, id, shouldSplitBatch, wait: wait2 = 0, sort
64056
64056
  return {
64057
64057
  flush,
64058
64058
  async schedule(args) {
64059
- const { promise: promise3, resolve, reject } = withResolvers();
64059
+ const { promise: promise3, resolve: resolve2, reject } = withResolvers();
64060
64060
  const split2 = shouldSplitBatch?.([...getBatchedArgs(), args]);
64061
64061
  if (split2)
64062
64062
  exec();
64063
64063
  const hasActiveScheduler = getScheduler().length > 0;
64064
64064
  if (hasActiveScheduler) {
64065
- setScheduler({ args, resolve, reject });
64065
+ setScheduler({ args, resolve: resolve2, reject });
64066
64066
  return promise3;
64067
64067
  }
64068
- setScheduler({ args, resolve, reject });
64068
+ setScheduler({ args, resolve: resolve2, reject });
64069
64069
  setTimeout(exec, wait2);
64070
64070
  return promise3;
64071
64071
  }
@@ -64774,11 +64774,11 @@ var createNeverThrowError = (message, result, config2 = defaultErrorConfig) => {
64774
64774
  };
64775
64775
  function __awaiter(thisArg, _arguments, P, generator) {
64776
64776
  function adopt(value) {
64777
- return value instanceof P ? value : new P(function(resolve) {
64778
- resolve(value);
64777
+ return value instanceof P ? value : new P(function(resolve2) {
64778
+ resolve2(value);
64779
64779
  });
64780
64780
  }
64781
- return new (P || (P = Promise))(function(resolve, reject) {
64781
+ return new (P || (P = Promise))(function(resolve2, reject) {
64782
64782
  function fulfilled(value) {
64783
64783
  try {
64784
64784
  step(generator.next(value));
@@ -64794,7 +64794,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
64794
64794
  }
64795
64795
  }
64796
64796
  function step(result) {
64797
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
64797
+ result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
64798
64798
  }
64799
64799
  step((generator = generator.apply(thisArg, _arguments || [])).next());
64800
64800
  });
@@ -64875,14 +64875,14 @@ function __asyncValues(o) {
64875
64875
  }, i);
64876
64876
  function verb(n) {
64877
64877
  i[n] = o[n] && function(v) {
64878
- return new Promise(function(resolve, reject) {
64879
- v = o[n](v), settle(resolve, reject, v.done, v.value);
64878
+ return new Promise(function(resolve2, reject) {
64879
+ v = o[n](v), settle(resolve2, reject, v.done, v.value);
64880
64880
  });
64881
64881
  };
64882
64882
  }
64883
- function settle(resolve, reject, d, v) {
64883
+ function settle(resolve2, reject, d, v) {
64884
64884
  Promise.resolve(v).then(function(v2) {
64885
- resolve({ value: v2, done: d });
64885
+ resolve2({ value: v2, done: d });
64886
64886
  }, reject);
64887
64887
  }
64888
64888
  }
@@ -79180,10 +79180,10 @@ var $ZodRegistry = class {
79180
79180
  this._idmap = /* @__PURE__ */ new Map();
79181
79181
  }
79182
79182
  add(schema, ..._meta) {
79183
- const meta4 = _meta[0];
79184
- this._map.set(schema, meta4);
79185
- if (meta4 && typeof meta4 === "object" && "id" in meta4) {
79186
- this._idmap.set(meta4.id, schema);
79183
+ const meta5 = _meta[0];
79184
+ this._map.set(schema, meta5);
79185
+ if (meta5 && typeof meta5 === "object" && "id" in meta5) {
79186
+ this._idmap.set(meta5.id, schema);
79187
79187
  }
79188
79188
  return this;
79189
79189
  }
@@ -79193,9 +79193,9 @@ var $ZodRegistry = class {
79193
79193
  return this;
79194
79194
  }
79195
79195
  remove(schema) {
79196
- const meta4 = this._map.get(schema);
79197
- if (meta4 && typeof meta4 === "object" && "id" in meta4) {
79198
- this._idmap.delete(meta4.id);
79196
+ const meta5 = this._map.get(schema);
79197
+ if (meta5 && typeof meta5 === "object" && "id" in meta5) {
79198
+ this._idmap.delete(meta5.id);
79199
79199
  }
79200
79200
  this._map.delete(schema);
79201
79201
  return this;
@@ -80324,9 +80324,9 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
80324
80324
  ctx.seen.get(parent).isParent = true;
80325
80325
  }
80326
80326
  }
80327
- const meta4 = ctx.metadataRegistry.get(schema);
80328
- if (meta4)
80329
- Object.assign(result.schema, meta4);
80327
+ const meta5 = ctx.metadataRegistry.get(schema);
80328
+ if (meta5)
80329
+ Object.assign(result.schema, meta5);
80330
80330
  if (ctx.io === "input" && isTransforming(schema)) {
80331
80331
  delete result.schema.examples;
80332
80332
  delete result.schema.default;
@@ -81272,8 +81272,8 @@ var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
81272
81272
  inst.with = inst.check;
81273
81273
  inst.clone = (_def, params) => clone(inst, _def, params);
81274
81274
  inst.brand = () => inst;
81275
- inst.register = ((reg, meta4) => {
81276
- reg.add(inst, meta4);
81275
+ inst.register = ((reg, meta5) => {
81276
+ reg.add(inst, meta5);
81277
81277
  return inst;
81278
81278
  });
81279
81279
  inst.apply = (fn) => fn(inst);
@@ -82930,8 +82930,8 @@ var ZodType2 = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
82930
82930
  inst.with = inst.check;
82931
82931
  inst.clone = (def2, params) => clone(inst, def2, params);
82932
82932
  inst.brand = () => inst;
82933
- inst.register = ((reg, meta4) => {
82934
- reg.add(inst, meta4);
82933
+ inst.register = ((reg, meta5) => {
82934
+ reg.add(inst, meta5);
82935
82935
  return inst;
82936
82936
  });
82937
82937
  inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
@@ -87914,7 +87914,7 @@ var Protocol = class {
87914
87914
  return;
87915
87915
  }
87916
87916
  const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
87917
- await new Promise((resolve) => setTimeout(resolve, pollInterval));
87917
+ await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
87918
87918
  options?.signal?.throwIfAborted();
87919
87919
  }
87920
87920
  } catch (error48) {
@@ -87931,7 +87931,7 @@ var Protocol = class {
87931
87931
  */
87932
87932
  request(request, resultSchema, options) {
87933
87933
  const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
87934
- return new Promise((resolve, reject) => {
87934
+ return new Promise((resolve2, reject) => {
87935
87935
  const earlyReject = (error48) => {
87936
87936
  reject(error48);
87937
87937
  };
@@ -88009,7 +88009,7 @@ var Protocol = class {
88009
88009
  if (!parseResult.success) {
88010
88010
  reject(parseResult.error);
88011
88011
  } else {
88012
- resolve(parseResult.data);
88012
+ resolve2(parseResult.data);
88013
88013
  }
88014
88014
  } catch (error48) {
88015
88015
  reject(error48);
@@ -88270,12 +88270,12 @@ var Protocol = class {
88270
88270
  }
88271
88271
  } catch {
88272
88272
  }
88273
- return new Promise((resolve, reject) => {
88273
+ return new Promise((resolve2, reject) => {
88274
88274
  if (signal.aborted) {
88275
88275
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
88276
88276
  return;
88277
88277
  }
88278
- const timeoutId = setTimeout(resolve, interval);
88278
+ const timeoutId = setTimeout(resolve2, interval);
88279
88279
  signal.addEventListener("abort", () => {
88280
88280
  clearTimeout(timeoutId);
88281
88281
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
@@ -89074,8 +89074,8 @@ function isCompletable(schema) {
89074
89074
  return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
89075
89075
  }
89076
89076
  function getCompleter(schema) {
89077
- const meta4 = schema[COMPLETABLE_SYMBOL];
89078
- return meta4?.complete;
89077
+ const meta5 = schema[COMPLETABLE_SYMBOL];
89078
+ return meta5?.complete;
89079
89079
  }
89080
89080
  var McpZodTypeKind;
89081
89081
  (function(McpZodTypeKind2) {
@@ -89388,7 +89388,7 @@ var McpServer = class {
89388
89388
  let task = createTaskResult.task;
89389
89389
  const pollInterval = task.pollInterval ?? 5e3;
89390
89390
  while (task.status !== "completed" && task.status !== "failed" && task.status !== "cancelled") {
89391
- await new Promise((resolve) => setTimeout(resolve, pollInterval));
89391
+ await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
89392
89392
  const updatedTask = await extra.taskStore.getTask(taskId);
89393
89393
  if (!updatedTask) {
89394
89394
  throw new McpError(ErrorCode.InternalError, `Task ${taskId} not found during polling`);
@@ -90033,12 +90033,12 @@ var StdioServerTransport = class {
90033
90033
  this.onclose?.();
90034
90034
  }
90035
90035
  send(message) {
90036
- return new Promise((resolve) => {
90036
+ return new Promise((resolve2) => {
90037
90037
  const json3 = serializeMessage(message);
90038
90038
  if (this._stdout.write(json3)) {
90039
- resolve();
90039
+ resolve2();
90040
90040
  } else {
90041
- this._stdout.once("drain", resolve);
90041
+ this._stdout.once("drain", resolve2);
90042
90042
  }
90043
90043
  });
90044
90044
  }
@@ -90768,11 +90768,11 @@ var x402ExactPermit2ProxyAddress = "0x402085c248EeA27D92E8b30b2C58ed07f9E20001";
90768
90768
  function getEvmChainId(network) {
90769
90769
  if (network.startsWith("eip155:")) {
90770
90770
  const idStr = network.split(":")[1];
90771
- const chainId = parseInt(idStr, 10);
90772
- if (isNaN(chainId)) {
90771
+ const chainId2 = parseInt(idStr, 10);
90772
+ if (isNaN(chainId2)) {
90773
90773
  throw new Error(`Invalid CAIP-2 chain ID: ${network}`);
90774
90774
  }
90775
- return chainId;
90775
+ return chainId2;
90776
90776
  }
90777
90777
  throw new Error(`Unsupported network format: ${network} (expected eip155:CHAIN_ID)`);
90778
90778
  }
@@ -95115,8 +95115,8 @@ var SIWxPayloadSchema = external_exports4.object({
95115
95115
  signatureScheme: external_exports4.enum(["eip191", "eip1271", "eip6492", "siws"]).optional(),
95116
95116
  signature: external_exports4.string()
95117
95117
  });
95118
- function extractSolanaChainReference(chainId) {
95119
- const [, reference] = chainId.split(":");
95118
+ function extractSolanaChainReference(chainId2) {
95119
+ const [, reference] = chainId2.split(":");
95120
95120
  return reference;
95121
95121
  }
95122
95122
  function formatSIWSMessage(info, address) {
@@ -95156,10 +95156,10 @@ function encodeBase58(bytes) {
95156
95156
  return base58.encode(bytes);
95157
95157
  }
95158
95158
  var DEFAULT_MAX_AGE_MS = 5 * 60 * 1e3;
95159
- function extractEVMChainId(chainId) {
95160
- const match = /^eip155:(\d+)$/.exec(chainId);
95159
+ function extractEVMChainId(chainId2) {
95160
+ const match = /^eip155:(\d+)$/.exec(chainId2);
95161
95161
  if (!match) {
95162
- throw new Error(`Invalid EVM chainId format: ${chainId}. Expected eip155:<number>`);
95162
+ throw new Error(`Invalid EVM chainId format: ${chainId2}. Expected eip155:<number>`);
95163
95163
  }
95164
95164
  return parseInt(match[1], 10);
95165
95165
  }
@@ -95293,7 +95293,7 @@ async function createEIP3009Payload(signer, x402Version2, paymentRequirements) {
95293
95293
  };
95294
95294
  }
95295
95295
  async function signEIP3009Authorization(signer, authorization, requirements) {
95296
- const chainId = getEvmChainId(requirements.network);
95296
+ const chainId2 = getEvmChainId(requirements.network);
95297
95297
  if (!requirements.extra?.name || !requirements.extra?.version) {
95298
95298
  throw new Error(
95299
95299
  `EIP-712 domain parameters (name, version) are required in payment requirements for asset ${requirements.asset}`
@@ -95303,7 +95303,7 @@ async function signEIP3009Authorization(signer, authorization, requirements) {
95303
95303
  const domain2 = {
95304
95304
  name,
95305
95305
  version: version7,
95306
- chainId,
95306
+ chainId: chainId2,
95307
95307
  verifyingContract: getAddress(requirements.asset)
95308
95308
  };
95309
95309
  const message = {
@@ -95356,10 +95356,10 @@ async function createPermit2Payload(signer, x402Version2, paymentRequirements) {
95356
95356
  };
95357
95357
  }
95358
95358
  async function signPermit2Authorization(signer, permit2Authorization, requirements) {
95359
- const chainId = getEvmChainId(requirements.network);
95359
+ const chainId2 = getEvmChainId(requirements.network);
95360
95360
  const domain2 = {
95361
95361
  name: "Permit2",
95362
- chainId,
95362
+ chainId: chainId2,
95363
95363
  verifyingContract: PERMIT2_ADDRESS
95364
95364
  };
95365
95365
  const message = {
@@ -95382,7 +95382,7 @@ async function signPermit2Authorization(signer, permit2Authorization, requiremen
95382
95382
  message
95383
95383
  });
95384
95384
  }
95385
- async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion, chainId, deadline, permittedAmount) {
95385
+ async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion, chainId2, deadline, permittedAmount) {
95386
95386
  const owner = signer.address;
95387
95387
  const spender = getAddress(PERMIT2_ADDRESS);
95388
95388
  const nonce2 = await signer.readContract({
@@ -95394,7 +95394,7 @@ async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion,
95394
95394
  const domain2 = {
95395
95395
  name: tokenName,
95396
95396
  version: tokenVersion,
95397
- chainId,
95397
+ chainId: chainId2,
95398
95398
  verifyingContract: tokenAddress
95399
95399
  };
95400
95400
  const approvalAmount = BigInt(permittedAmount);
@@ -95422,7 +95422,7 @@ async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion,
95422
95422
  version: "1"
95423
95423
  };
95424
95424
  }
95425
- async function signErc20ApprovalTransaction(signer, tokenAddress, chainId) {
95425
+ async function signErc20ApprovalTransaction(signer, tokenAddress, chainId2) {
95426
95426
  const from25 = signer.address;
95427
95427
  const spender = getAddress(PERMIT2_ADDRESS);
95428
95428
  const data = encodeFunctionData({
@@ -95448,7 +95448,7 @@ async function signErc20ApprovalTransaction(signer, tokenAddress, chainId) {
95448
95448
  gas: ERC20_APPROVE_GAS_LIMIT,
95449
95449
  maxFeePerGas,
95450
95450
  maxPriorityFeePerGas,
95451
- chainId
95451
+ chainId: chainId2
95452
95452
  });
95453
95453
  return {
95454
95454
  from: from25,
@@ -95534,7 +95534,7 @@ var ExactEvmScheme = class {
95534
95534
  if (!tokenName || !tokenVersion) {
95535
95535
  return void 0;
95536
95536
  }
95537
- const chainId = getEvmChainId(requirements.network);
95537
+ const chainId2 = getEvmChainId(requirements.network);
95538
95538
  const tokenAddress = getAddress(requirements.asset);
95539
95539
  try {
95540
95540
  const allowance = await this.signer.readContract({
@@ -95555,7 +95555,7 @@ var ExactEvmScheme = class {
95555
95555
  tokenAddress,
95556
95556
  tokenName,
95557
95557
  tokenVersion,
95558
- chainId,
95558
+ chainId2,
95559
95559
  deadline,
95560
95560
  requirements.amount
95561
95561
  );
@@ -95589,7 +95589,7 @@ var ExactEvmScheme = class {
95589
95589
  if (!this.signer.signTransaction || !this.signer.getTransactionCount) {
95590
95590
  return void 0;
95591
95591
  }
95592
- const chainId = getEvmChainId(requirements.network);
95592
+ const chainId2 = getEvmChainId(requirements.network);
95593
95593
  const tokenAddress = getAddress(requirements.asset);
95594
95594
  try {
95595
95595
  const allowance = await this.signer.readContract({
@@ -95603,7 +95603,7 @@ var ExactEvmScheme = class {
95603
95603
  }
95604
95604
  } catch {
95605
95605
  }
95606
- const info = await signErc20ApprovalTransaction(this.signer, tokenAddress, chainId);
95606
+ const info = await signErc20ApprovalTransaction(this.signer, tokenAddress, chainId2);
95607
95607
  return {
95608
95608
  [ERC20_APPROVAL_GAS_SPONSORING.key]: { info }
95609
95609
  };
@@ -95644,19 +95644,13 @@ function toClientEvmSigner(signer, publicClient) {
95644
95644
  return result;
95645
95645
  }
95646
95646
 
95647
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/client/index.js
95647
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/client/index.js
95648
95648
  init_cjs_shims();
95649
95649
 
95650
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/Expires.js
95651
- init_cjs_shims();
95652
- function minutes(n) {
95653
- return new Date(Date.now() + n * 60 * 1e3).toISOString();
95654
- }
95655
-
95656
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/client/Methods.js
95650
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/client/Methods.js
95657
95651
  init_cjs_shims();
95658
95652
 
95659
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/Credential.js
95653
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/Credential.js
95660
95654
  init_cjs_shims();
95661
95655
 
95662
95656
  // ../../../node_modules/.pnpm/ox@0.12.4_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/index.js
@@ -97770,11 +97764,11 @@ function from11(authorization, options = {}) {
97770
97764
  return { ...authorization, ...options.signature };
97771
97765
  }
97772
97766
  function fromRpc2(authorization) {
97773
- const { address, chainId, nonce: nonce2 } = authorization;
97767
+ const { address, chainId: chainId2, nonce: nonce2 } = authorization;
97774
97768
  const signature2 = extract(authorization);
97775
97769
  return {
97776
97770
  address,
97777
- chainId: Number(chainId),
97771
+ chainId: Number(chainId2),
97778
97772
  nonce: BigInt(nonce2),
97779
97773
  ...signature2
97780
97774
  };
@@ -97794,10 +97788,10 @@ function hash4(authorization, options = {}) {
97794
97788
  } : authorization))));
97795
97789
  }
97796
97790
  function toRpc2(authorization) {
97797
- const { address, chainId, nonce: nonce2, ...signature2 } = authorization;
97791
+ const { address, chainId: chainId2, nonce: nonce2, ...signature2 } = authorization;
97798
97792
  return {
97799
97793
  address,
97800
- chainId: fromNumber(chainId),
97794
+ chainId: fromNumber(chainId2),
97801
97795
  nonce: fromNumber(nonce2),
97802
97796
  ...toRpc(signature2)
97803
97797
  };
@@ -97806,10 +97800,10 @@ function toRpcList(authorizationList) {
97806
97800
  return authorizationList.map(toRpc2);
97807
97801
  }
97808
97802
  function toTuple2(authorization) {
97809
- const { address, chainId, nonce: nonce2 } = authorization;
97803
+ const { address, chainId: chainId2, nonce: nonce2 } = authorization;
97810
97804
  const signature2 = extract(authorization);
97811
97805
  return [
97812
- chainId ? fromNumber(chainId) : "0x",
97806
+ chainId2 ? fromNumber(chainId2) : "0x",
97813
97807
  address,
97814
97808
  nonce2 ? fromNumber(nonce2) : "0x",
97815
97809
  ...signature2 ? toTuple(signature2) : []
@@ -98159,8 +98153,8 @@ var FeeCapTooHighError = class extends BaseError3 {
98159
98153
  }
98160
98154
  };
98161
98155
  var InvalidChainIdError = class extends BaseError3 {
98162
- constructor({ chainId }) {
98163
- super(typeof chainId !== "undefined" ? `Chain ID "${chainId}" is invalid.` : "Chain ID is invalid.");
98156
+ constructor({ chainId: chainId2 }) {
98157
+ super(typeof chainId2 !== "undefined" ? `Chain ID "${chainId2}" is invalid.` : "Chain ID is invalid.");
98164
98158
  Object.defineProperty(this, "name", {
98165
98159
  enumerable: true,
98166
98160
  configurable: true,
@@ -98261,7 +98255,7 @@ function verify3(options) {
98261
98255
  // ../../../node_modules/.pnpm/ox@0.12.4_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/index.js
98262
98256
  init_Withdrawal();
98263
98257
 
98264
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/Challenge.js
98258
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/Challenge.js
98265
98259
  var Challenge_exports = {};
98266
98260
  __export(Challenge_exports, {
98267
98261
  Schema: () => Schema,
@@ -98270,12 +98264,24 @@ __export(Challenge_exports, {
98270
98264
  fromHeaders: () => fromHeaders,
98271
98265
  fromMethod: () => fromMethod2,
98272
98266
  fromResponse: () => fromResponse,
98267
+ meta: () => meta4,
98273
98268
  serialize: () => serialize2,
98274
98269
  verify: () => verify4
98275
98270
  });
98276
98271
  init_cjs_shims();
98277
98272
 
98278
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/PaymentRequest.js
98273
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/internal/constantTimeEqual.js
98274
+ init_cjs_shims();
98275
+ function constantTimeEqual(a, b) {
98276
+ const hashA = Hash_exports.sha256(Hex_exports.fromString(a));
98277
+ const hashB = Hash_exports.sha256(Hex_exports.fromString(b));
98278
+ let result = 0;
98279
+ for (let i = 0; i < hashA.length; i++)
98280
+ result |= hashA.charCodeAt(i) ^ hashB.charCodeAt(i);
98281
+ return result === 0;
98282
+ }
98283
+
98284
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/PaymentRequest.js
98279
98285
  init_cjs_shims();
98280
98286
  function deserialize(encoded) {
98281
98287
  const json3 = Base64_exports.toString(encoded);
@@ -98289,13 +98295,13 @@ function serialize(request) {
98289
98295
  return Base64_exports.fromString(json3, { pad: false, url: true });
98290
98296
  }
98291
98297
 
98292
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/zod.js
98298
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/zod.js
98293
98299
  init_cjs_shims();
98294
98300
 
98295
98301
  // ../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/mini/index.js
98296
98302
  init_cjs_shims();
98297
98303
 
98298
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/zod.js
98304
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/zod.js
98299
98305
  function amount() {
98300
98306
  return external_exports2.string().check(external_exports2.regex(/^\d+(\.\d+)?$/, "Invalid amount"));
98301
98307
  }
@@ -98309,7 +98315,7 @@ function signature() {
98309
98315
  return external_exports2.string().check(external_exports2.regex(/^0x[0-9a-fA-F]+$/, "Invalid signature"));
98310
98316
  }
98311
98317
 
98312
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/Challenge.js
98318
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/Challenge.js
98313
98319
  var Schema = object({
98314
98320
  /** Optional human-readable description of the payment. */
98315
98321
  description: optional(string2()),
@@ -98323,6 +98329,8 @@ var Schema = object({
98323
98329
  intent: string2(),
98324
98330
  /** Payment method (e.g., "tempo", "stripe"). */
98325
98331
  method: string2(),
98332
+ /** Optional server-defined correlation data. Flat string-to-string map; clients MUST NOT modify. */
98333
+ opaque: optional(record(string2(), string2())),
98326
98334
  /** Server realm (e.g., hostname). */
98327
98335
  realm: string2(),
98328
98336
  /** Method-specific request data. */
@@ -98330,9 +98338,9 @@ var Schema = object({
98330
98338
  });
98331
98339
  function from12(parameters, options) {
98332
98340
  void options;
98333
- const { description, digest, method: methodName, intent, realm, request, secretKey } = parameters;
98334
- const expires = parameters.expires ?? request.expires;
98335
- const id = secretKey ? computeId({ ...parameters, expires }, { secretKey }) : parameters.id;
98341
+ const { description, digest, meta: meta5, method: methodName, intent, realm, request, secretKey } = parameters;
98342
+ const expires = parameters.expires;
98343
+ const id = secretKey ? computeId({ ...parameters, expires, ...meta5 && { opaque: meta5 } }, { secretKey }) : parameters.id;
98336
98344
  return Schema.parse({
98337
98345
  id,
98338
98346
  realm,
@@ -98341,12 +98349,13 @@ function from12(parameters, options) {
98341
98349
  request,
98342
98350
  ...description && { description },
98343
98351
  ...digest && { digest },
98344
- ...expires && { expires }
98352
+ ...expires && { expires },
98353
+ ...meta5 && { opaque: meta5 }
98345
98354
  });
98346
98355
  }
98347
98356
  function fromMethod2(method, parameters) {
98348
98357
  const { name: methodName, intent } = method;
98349
- const { description, digest, expires, id, realm, secretKey } = parameters;
98358
+ const { description, digest, expires, id, meta: meta5, realm, secretKey } = parameters;
98350
98359
  const request = fromMethod(method, parameters.request);
98351
98360
  return from12({
98352
98361
  ...id ? { id } : { secretKey },
@@ -98356,7 +98365,8 @@ function fromMethod2(method, parameters) {
98356
98365
  request,
98357
98366
  description,
98358
98367
  digest,
98359
- expires
98368
+ expires,
98369
+ meta: meta5
98360
98370
  });
98361
98371
  }
98362
98372
  function serialize2(challenge2) {
@@ -98373,31 +98383,122 @@ function serialize2(challenge2) {
98373
98383
  parts.push(`digest="${challenge2.digest}"`);
98374
98384
  if (challenge2.expires !== void 0)
98375
98385
  parts.push(`expires="${challenge2.expires}"`);
98386
+ if (challenge2.opaque !== void 0)
98387
+ parts.push(`opaque="${serialize(challenge2.opaque)}"`);
98376
98388
  return `Payment ${parts.join(", ")}`;
98377
98389
  }
98378
98390
  function deserialize2(value, options) {
98379
- const prefixMatch = value.match(/^Payment\s+(.+)$/i);
98380
- if (!prefixMatch?.[1])
98391
+ const params = extractPaymentAuthParams(value);
98392
+ if (!params)
98381
98393
  throw new Error("Missing Payment scheme.");
98382
- const params = prefixMatch[1];
98383
- const result = {};
98384
- for (const match of params.matchAll(/(\w+)="([^"]+)"/g)) {
98385
- const key = match[1];
98386
- const value2 = match[2];
98387
- if (key && value2) {
98388
- if (key in result)
98389
- throw new Error(`Duplicate parameter: ${key}`);
98390
- result[key] = value2;
98391
- }
98392
- }
98393
- const { request, ...rest } = result;
98394
+ const result = parseAuthParams(params);
98395
+ const { request, opaque, ...rest } = result;
98394
98396
  if (!request)
98395
98397
  throw new Error("Missing request parameter.");
98398
+ if (rest.method && !/^[a-z][a-z0-9:_-]*$/.test(rest.method))
98399
+ throw new Error(`Invalid method: "${rest.method}". Must be lowercase per spec.`);
98396
98400
  return from12({
98397
98401
  ...rest,
98398
- request: deserialize(request)
98402
+ request: deserialize(request),
98403
+ ...opaque && { meta: deserialize(opaque) }
98399
98404
  }, options);
98400
98405
  }
98406
+ function extractPaymentAuthParams(header) {
98407
+ const token = "Payment";
98408
+ let inQuotes = false;
98409
+ let escaped = false;
98410
+ for (let i = 0; i < header.length; i++) {
98411
+ const char = header[i];
98412
+ if (inQuotes) {
98413
+ if (escaped)
98414
+ escaped = false;
98415
+ else if (char === "\\")
98416
+ escaped = true;
98417
+ else if (char === '"')
98418
+ inQuotes = false;
98419
+ continue;
98420
+ }
98421
+ if (char === '"') {
98422
+ inQuotes = true;
98423
+ continue;
98424
+ }
98425
+ if (!startsWithSchemeToken(header, i, token))
98426
+ continue;
98427
+ const prefix = header.slice(0, i);
98428
+ if (prefix.trim() && !prefix.trimEnd().endsWith(","))
98429
+ continue;
98430
+ let paramsStart = i + token.length;
98431
+ while (paramsStart < header.length && /\s/.test(header[paramsStart] ?? ""))
98432
+ paramsStart++;
98433
+ return header.slice(paramsStart);
98434
+ }
98435
+ return null;
98436
+ }
98437
+ function parseAuthParams(input) {
98438
+ const result = {};
98439
+ let i = 0;
98440
+ while (i < input.length) {
98441
+ while (i < input.length && /[\s,]/.test(input[i] ?? ""))
98442
+ i++;
98443
+ if (i >= input.length)
98444
+ break;
98445
+ const keyStart = i;
98446
+ while (i < input.length && /[A-Za-z0-9_-]/.test(input[i] ?? ""))
98447
+ i++;
98448
+ const key = input.slice(keyStart, i);
98449
+ if (!key)
98450
+ throw new Error("Malformed auth-param.");
98451
+ while (i < input.length && /\s/.test(input[i] ?? ""))
98452
+ i++;
98453
+ if (input[i] !== "=")
98454
+ break;
98455
+ i++;
98456
+ while (i < input.length && /\s/.test(input[i] ?? ""))
98457
+ i++;
98458
+ const [value, nextIndex] = readAuthParamValue(input, i);
98459
+ i = nextIndex;
98460
+ if (key in result)
98461
+ throw new Error(`Duplicate parameter: ${key}`);
98462
+ result[key] = value;
98463
+ }
98464
+ return result;
98465
+ }
98466
+ function readAuthParamValue(input, start) {
98467
+ if (input[start] === '"')
98468
+ return readQuotedAuthParamValue(input, start + 1);
98469
+ let i = start;
98470
+ while (i < input.length && input[i] !== ",")
98471
+ i++;
98472
+ return [input.slice(start, i).trim(), i];
98473
+ }
98474
+ function readQuotedAuthParamValue(input, start) {
98475
+ let i = start;
98476
+ let value = "";
98477
+ let escaped = false;
98478
+ while (i < input.length) {
98479
+ const char = input[i];
98480
+ i++;
98481
+ if (escaped) {
98482
+ value += char;
98483
+ escaped = false;
98484
+ continue;
98485
+ }
98486
+ if (char === "\\") {
98487
+ escaped = true;
98488
+ continue;
98489
+ }
98490
+ if (char === '"')
98491
+ return [value, i];
98492
+ value += char;
98493
+ }
98494
+ throw new Error("Unterminated quoted-string.");
98495
+ }
98496
+ function startsWithSchemeToken(value, index2, token) {
98497
+ if (!value.slice(index2).toLowerCase().startsWith(token.toLowerCase()))
98498
+ return false;
98499
+ const next = value[index2 + token.length];
98500
+ return Boolean(next && /\s/.test(next));
98501
+ }
98401
98502
  function fromHeaders(headers, options) {
98402
98503
  const header = headers.get("WWW-Authenticate");
98403
98504
  if (!header)
@@ -98413,6 +98514,9 @@ function verify4(challenge2, options) {
98413
98514
  const expectedId = computeId(challenge2, options);
98414
98515
  return constantTimeEqual(challenge2.id, expectedId);
98415
98516
  }
98517
+ function meta4(challenge2) {
98518
+ return challenge2.opaque;
98519
+ }
98416
98520
  function computeId(challenge2, options) {
98417
98521
  const input = [
98418
98522
  challenge2.realm,
@@ -98420,23 +98524,16 @@ function computeId(challenge2, options) {
98420
98524
  challenge2.intent,
98421
98525
  serialize(challenge2.request),
98422
98526
  challenge2.expires ?? "",
98423
- challenge2.digest ?? ""
98527
+ challenge2.digest ?? "",
98528
+ challenge2.opaque ? serialize(challenge2.opaque) : ""
98424
98529
  ].join("|");
98425
98530
  const key = Bytes_exports.fromString(options.secretKey);
98426
98531
  const data = Bytes_exports.fromString(input);
98427
98532
  const mac4 = Hash_exports.hmac256(key, data, { as: "Bytes" });
98428
98533
  return Base64_exports.fromBytes(mac4, { url: true, pad: false });
98429
98534
  }
98430
- function constantTimeEqual(a, b) {
98431
- if (a.length !== b.length)
98432
- return false;
98433
- let result = 0;
98434
- for (let i = 0; i < a.length; i++)
98435
- result |= a.charCodeAt(i) ^ b.charCodeAt(i);
98436
- return result === 0;
98437
- }
98438
98535
 
98439
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/Credential.js
98536
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/Credential.js
98440
98537
  function serialize3(credential) {
98441
98538
  const wire = {
98442
98539
  challenge: {
@@ -98451,7 +98548,7 @@ function serialize3(credential) {
98451
98548
  return `Payment ${encoded}`;
98452
98549
  }
98453
98550
 
98454
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/Method.js
98551
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/Method.js
98455
98552
  init_cjs_shims();
98456
98553
  function from13(method) {
98457
98554
  return method;
@@ -98792,12 +98889,12 @@ function getSizeOfLength2(length) {
98792
98889
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/authorization/hashAuthorization.js
98793
98890
  init_keccak2562();
98794
98891
  function hashAuthorization(parameters) {
98795
- const { chainId, nonce: nonce2, to: to2 } = parameters;
98892
+ const { chainId: chainId2, nonce: nonce2, to: to2 } = parameters;
98796
98893
  const address = parameters.contractAddress ?? parameters.address;
98797
98894
  const hash8 = keccak2563(concatHex2([
98798
98895
  "0x05",
98799
98896
  toRlp([
98800
- chainId ? numberToHex2(chainId) : "0x",
98897
+ chainId2 ? numberToHex2(chainId2) : "0x",
98801
98898
  address,
98802
98899
  nonce2 ? numberToHex2(nonce2) : "0x"
98803
98900
  ])
@@ -99444,10 +99541,10 @@ async function fillTransaction(client, parameters) {
99444
99541
  if (typeof nonce_ !== "undefined")
99445
99542
  return nonce_;
99446
99543
  const account_ = parseAccount(account);
99447
- const chainId = chain2 ? chain2.id : await getAction(client, getChainId, "getChainId")({});
99544
+ const chainId2 = chain2 ? chain2.id : await getAction(client, getChainId, "getChainId")({});
99448
99545
  return await nonceManager2.consume({
99449
99546
  address: account_.address,
99450
- chainId,
99547
+ chainId: chainId2,
99451
99548
  client
99452
99549
  });
99453
99550
  })();
@@ -99564,25 +99661,25 @@ async function prepareTransactionRequest(client, args) {
99564
99661
  };
99565
99662
  return void 0;
99566
99663
  })();
99567
- let chainId;
99664
+ let chainId2;
99568
99665
  async function getChainId2() {
99569
- if (chainId)
99570
- return chainId;
99666
+ if (chainId2)
99667
+ return chainId2;
99571
99668
  if (typeof request.chainId !== "undefined")
99572
99669
  return request.chainId;
99573
99670
  if (chain2)
99574
99671
  return chain2.id;
99575
99672
  const chainId_ = await getAction(client, getChainId, "getChainId")({});
99576
- chainId = chainId_;
99577
- return chainId;
99673
+ chainId2 = chainId_;
99674
+ return chainId2;
99578
99675
  }
99579
99676
  const account = account_ ? parseAccount(account_) : account_;
99580
99677
  let nonce2 = request.nonce;
99581
99678
  if (parameters.includes("nonce") && typeof nonce2 === "undefined" && account && nonceManager2) {
99582
- const chainId2 = await getChainId2();
99679
+ const chainId3 = await getChainId2();
99583
99680
  nonce2 = await nonceManager2.consume({
99584
99681
  address: account.address,
99585
- chainId: chainId2,
99682
+ chainId: chainId3,
99586
99683
  client
99587
99684
  });
99588
99685
  }
@@ -99611,13 +99708,13 @@ async function prepareTransactionRequest(client, args) {
99611
99708
  return false;
99612
99709
  })();
99613
99710
  const fillResult = attemptFill ? await getAction(client, fillTransaction, "fillTransaction")({ ...request, nonce: nonce2 }).then((result) => {
99614
- const { chainId: chainId2, from: from25, gas: gas2, gasPrice, nonce: nonce3, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, type: type5, ...rest } = result.transaction;
99711
+ const { chainId: chainId3, from: from25, gas: gas2, gasPrice, nonce: nonce3, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, type: type5, ...rest } = result.transaction;
99615
99712
  supportsFillTransaction.set(client.uid, true);
99616
99713
  return {
99617
99714
  ...request,
99618
99715
  ...from25 ? { from: from25 } : {},
99619
99716
  ...type5 ? { type: type5 } : {},
99620
- ...typeof chainId2 !== "undefined" ? { chainId: chainId2 } : {},
99717
+ ...typeof chainId3 !== "undefined" ? { chainId: chainId3 } : {},
99621
99718
  ...typeof gas2 !== "undefined" ? { gas: gas2 } : {},
99622
99719
  ...typeof gasPrice !== "undefined" ? { gasPrice } : {},
99623
99720
  ...typeof nonce3 !== "undefined" ? { nonce: nonce3 } : {},
@@ -100653,12 +100750,12 @@ async function sendTransaction(client, parameters) {
100653
100750
  return void 0;
100654
100751
  })();
100655
100752
  if (account?.type === "json-rpc" || account === null) {
100656
- let chainId;
100753
+ let chainId2;
100657
100754
  if (chain2 !== null) {
100658
- chainId = await getAction(client, getChainId, "getChainId")({});
100755
+ chainId2 = await getAction(client, getChainId, "getChainId")({});
100659
100756
  if (assertChainId)
100660
100757
  assertCurrentChain({
100661
- currentChainId: chainId,
100758
+ currentChainId: chainId2,
100662
100759
  chain: chain2
100663
100760
  });
100664
100761
  }
@@ -100671,7 +100768,7 @@ async function sendTransaction(client, parameters) {
100671
100768
  account,
100672
100769
  authorizationList,
100673
100770
  blobs,
100674
- chainId,
100771
+ chainId: chainId2,
100675
100772
  data: data ? concat4([data, dataSuffix ?? "0x"]) : data,
100676
100773
  gas,
100677
100774
  gasPrice,
@@ -100803,10 +100900,35 @@ async function writeContract(client, parameters) {
100803
100900
  writeContract2.internal = internal;
100804
100901
  })(writeContract || (writeContract = {}));
100805
100902
 
100903
+ // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/actions/wallet/waitForCallsStatus.js
100904
+ init_cjs_shims();
100905
+ init_base2();
100906
+
100907
+ // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/calls.js
100908
+ init_cjs_shims();
100909
+ init_base2();
100910
+ var BundleFailedError = class extends BaseError4 {
100911
+ constructor(result) {
100912
+ super(`Call bundle failed with status: ${result.statusCode}`, {
100913
+ name: "BundleFailedError"
100914
+ });
100915
+ Object.defineProperty(this, "result", {
100916
+ enumerable: true,
100917
+ configurable: true,
100918
+ writable: true,
100919
+ value: void 0
100920
+ });
100921
+ this.result = result;
100922
+ }
100923
+ };
100924
+
100925
+ // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/actions/wallet/waitForCallsStatus.js
100926
+ init_withResolvers();
100927
+
100806
100928
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/promise/withRetry.js
100807
100929
  init_cjs_shims();
100808
100930
  function withRetry(fn, { delay: delay_ = 100, retryCount = 2, shouldRetry: shouldRetry2 = () => true } = {}) {
100809
- return new Promise((resolve, reject) => {
100931
+ return new Promise((resolve2, reject) => {
100810
100932
  const attemptRetry = async ({ count = 0 } = {}) => {
100811
100933
  const retry = async ({ error: error48 }) => {
100812
100934
  const delay = typeof delay_ === "function" ? delay_({ count, error: error48 }) : delay_;
@@ -100816,7 +100938,7 @@ function withRetry(fn, { delay: delay_ = 100, retryCount = 2, shouldRetry: shoul
100816
100938
  };
100817
100939
  try {
100818
100940
  const data = await fn();
100819
- resolve(data);
100941
+ resolve2(data);
100820
100942
  } catch (err3) {
100821
100943
  if (count < retryCount && await shouldRetry2({ count, error: err3 }))
100822
100944
  return retry({ error: err3 });
@@ -100827,6 +100949,15 @@ function withRetry(fn, { delay: delay_ = 100, retryCount = 2, shouldRetry: shoul
100827
100949
  });
100828
100950
  }
100829
100951
 
100952
+ // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/actions/wallet/waitForCallsStatus.js
100953
+ init_stringify();
100954
+
100955
+ // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/actions/wallet/getCallsStatus.js
100956
+ init_cjs_shims();
100957
+ init_slice2();
100958
+ init_trim();
100959
+ init_fromHex2();
100960
+
100830
100961
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/formatters/transactionReceipt.js
100831
100962
  init_cjs_shims();
100832
100963
  init_fromHex2();
@@ -100857,6 +100988,249 @@ function formatTransactionReceipt(transactionReceipt, _) {
100857
100988
  }
100858
100989
  var defineTransactionReceipt = /* @__PURE__ */ defineFormatter("transactionReceipt", formatTransactionReceipt);
100859
100990
 
100991
+ // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/actions/wallet/sendCalls.js
100992
+ init_cjs_shims();
100993
+ init_parseAccount();
100994
+ init_base2();
100995
+ init_rpc();
100996
+ init_encodeFunctionData2();
100997
+ init_concat2();
100998
+ init_fromHex2();
100999
+ init_toHex2();
101000
+ var fallbackMagicIdentifier = "0x5792579257925792579257925792579257925792579257925792579257925792";
101001
+ var fallbackTransactionErrorMagicIdentifier = numberToHex2(0, {
101002
+ size: 32
101003
+ });
101004
+ async function sendCalls(client, parameters) {
101005
+ const { account: account_ = client.account, chain: chain2 = client.chain, experimental_fallback, experimental_fallbackDelay = 32, forceAtomic = false, id, version: version7 = "2.0.0" } = parameters;
101006
+ const account = account_ ? parseAccount(account_) : null;
101007
+ let capabilities = parameters.capabilities;
101008
+ if (client.dataSuffix && !parameters.capabilities?.dataSuffix) {
101009
+ if (typeof client.dataSuffix === "string")
101010
+ capabilities = {
101011
+ ...parameters.capabilities,
101012
+ dataSuffix: { value: client.dataSuffix, optional: true }
101013
+ };
101014
+ else
101015
+ capabilities = {
101016
+ ...parameters.capabilities,
101017
+ dataSuffix: {
101018
+ value: client.dataSuffix.value,
101019
+ ...client.dataSuffix.required ? {} : { optional: true }
101020
+ }
101021
+ };
101022
+ }
101023
+ const calls = parameters.calls.map((call_) => {
101024
+ const call2 = call_;
101025
+ const data = call2.abi ? encodeFunctionData2({
101026
+ abi: call2.abi,
101027
+ functionName: call2.functionName,
101028
+ args: call2.args
101029
+ }) : call2.data;
101030
+ return {
101031
+ data: call2.dataSuffix && data ? concat4([data, call2.dataSuffix]) : data,
101032
+ to: call2.to,
101033
+ value: call2.value ? numberToHex2(call2.value) : void 0
101034
+ };
101035
+ });
101036
+ try {
101037
+ const response = await client.request({
101038
+ method: "wallet_sendCalls",
101039
+ params: [
101040
+ {
101041
+ atomicRequired: forceAtomic,
101042
+ calls,
101043
+ capabilities,
101044
+ chainId: numberToHex2(chain2.id),
101045
+ from: account?.address,
101046
+ id,
101047
+ version: version7
101048
+ }
101049
+ ]
101050
+ }, { retryCount: 0 });
101051
+ if (typeof response === "string")
101052
+ return { id: response };
101053
+ return response;
101054
+ } catch (err3) {
101055
+ const error48 = err3;
101056
+ if (experimental_fallback && (error48.name === "MethodNotFoundRpcError" || error48.name === "MethodNotSupportedRpcError" || error48.name === "UnknownRpcError" || error48.details.toLowerCase().includes("does not exist / is not available") || error48.details.toLowerCase().includes("missing or invalid. request()") || error48.details.toLowerCase().includes("did not match any variant of untagged enum") || error48.details.toLowerCase().includes("account upgraded to unsupported contract") || error48.details.toLowerCase().includes("eip-7702 not supported") || error48.details.toLowerCase().includes("unsupported wc_ method") || // magic.link
101057
+ error48.details.toLowerCase().includes("feature toggled misconfigured") || // Trust Wallet
101058
+ error48.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))) {
101059
+ if (capabilities) {
101060
+ const hasNonOptionalCapability = Object.values(capabilities).some((capability) => !capability.optional);
101061
+ if (hasNonOptionalCapability) {
101062
+ const message = "non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";
101063
+ throw new UnsupportedNonOptionalCapabilityError(new BaseError4(message, {
101064
+ details: message
101065
+ }));
101066
+ }
101067
+ }
101068
+ if (forceAtomic && calls.length > 1) {
101069
+ const message = "`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";
101070
+ throw new AtomicityNotSupportedError(new BaseError4(message, {
101071
+ details: message
101072
+ }));
101073
+ }
101074
+ const promises = [];
101075
+ for (const call2 of calls) {
101076
+ const promise3 = sendTransaction(client, {
101077
+ account,
101078
+ chain: chain2,
101079
+ data: call2.data,
101080
+ to: call2.to,
101081
+ value: call2.value ? hexToBigInt(call2.value) : void 0
101082
+ });
101083
+ promises.push(promise3);
101084
+ if (experimental_fallbackDelay > 0)
101085
+ await new Promise((resolve2) => setTimeout(resolve2, experimental_fallbackDelay));
101086
+ }
101087
+ const results = await Promise.allSettled(promises);
101088
+ if (results.every((r) => r.status === "rejected"))
101089
+ throw results[0].reason;
101090
+ const hashes = results.map((result) => {
101091
+ if (result.status === "fulfilled")
101092
+ return result.value;
101093
+ return fallbackTransactionErrorMagicIdentifier;
101094
+ });
101095
+ return {
101096
+ id: concat4([
101097
+ ...hashes,
101098
+ numberToHex2(chain2.id, { size: 32 }),
101099
+ fallbackMagicIdentifier
101100
+ ])
101101
+ };
101102
+ }
101103
+ throw getTransactionError(err3, {
101104
+ ...parameters,
101105
+ account,
101106
+ chain: parameters.chain
101107
+ });
101108
+ }
101109
+ }
101110
+
101111
+ // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/actions/wallet/getCallsStatus.js
101112
+ async function getCallsStatus(client, parameters) {
101113
+ async function getStatus(id) {
101114
+ const isTransactions = id.endsWith(fallbackMagicIdentifier.slice(2));
101115
+ if (isTransactions) {
101116
+ const chainId3 = trim3(sliceHex2(id, -64, -32));
101117
+ const hashes = sliceHex2(id, 0, -64).slice(2).match(/.{1,64}/g);
101118
+ const receipts2 = await Promise.all(hashes.map((hash8) => fallbackTransactionErrorMagicIdentifier.slice(2) !== hash8 ? client.request({
101119
+ method: "eth_getTransactionReceipt",
101120
+ params: [`0x${hash8}`]
101121
+ }, { dedupe: true }) : void 0));
101122
+ const status2 = (() => {
101123
+ if (receipts2.some((r) => r === null))
101124
+ return 100;
101125
+ if (receipts2.every((r) => r?.status === "0x1"))
101126
+ return 200;
101127
+ if (receipts2.every((r) => r?.status === "0x0"))
101128
+ return 500;
101129
+ return 600;
101130
+ })();
101131
+ return {
101132
+ atomic: false,
101133
+ chainId: hexToNumber2(chainId3),
101134
+ receipts: receipts2.filter(Boolean),
101135
+ status: status2,
101136
+ version: "2.0.0"
101137
+ };
101138
+ }
101139
+ return client.request({
101140
+ method: "wallet_getCallsStatus",
101141
+ params: [id]
101142
+ });
101143
+ }
101144
+ const { atomic = false, chainId: chainId2, receipts, version: version7 = "2.0.0", ...response } = await getStatus(parameters.id);
101145
+ const [status, statusCode] = (() => {
101146
+ const statusCode2 = response.status;
101147
+ if (statusCode2 >= 100 && statusCode2 < 200)
101148
+ return ["pending", statusCode2];
101149
+ if (statusCode2 >= 200 && statusCode2 < 300)
101150
+ return ["success", statusCode2];
101151
+ if (statusCode2 >= 300 && statusCode2 < 700)
101152
+ return ["failure", statusCode2];
101153
+ if (statusCode2 === "CONFIRMED")
101154
+ return ["success", 200];
101155
+ if (statusCode2 === "PENDING")
101156
+ return ["pending", 100];
101157
+ return [void 0, statusCode2];
101158
+ })();
101159
+ return {
101160
+ ...response,
101161
+ atomic,
101162
+ // @ts-expect-error: for backwards compatibility
101163
+ chainId: chainId2 ? hexToNumber2(chainId2) : void 0,
101164
+ receipts: receipts?.map((receipt) => ({
101165
+ ...receipt,
101166
+ blockNumber: hexToBigInt(receipt.blockNumber),
101167
+ gasUsed: hexToBigInt(receipt.gasUsed),
101168
+ status: receiptStatuses[receipt.status]
101169
+ })) ?? [],
101170
+ statusCode,
101171
+ status,
101172
+ version: version7
101173
+ };
101174
+ }
101175
+
101176
+ // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/actions/wallet/waitForCallsStatus.js
101177
+ async function waitForCallsStatus(client, parameters) {
101178
+ const {
101179
+ id,
101180
+ pollingInterval = client.pollingInterval,
101181
+ status = ({ statusCode }) => statusCode === 200 || statusCode >= 300,
101182
+ retryCount = 4,
101183
+ retryDelay = ({ count }) => ~~(1 << count) * 200,
101184
+ // exponential backoff
101185
+ timeout = 6e4,
101186
+ throwOnFailure = false
101187
+ } = parameters;
101188
+ const observerId = stringify2(["waitForCallsStatus", client.uid, id]);
101189
+ const { promise: promise3, resolve: resolve2, reject } = withResolvers();
101190
+ let timer;
101191
+ const unobserve = observe(observerId, { resolve: resolve2, reject }, (emit) => {
101192
+ const unpoll = poll(async () => {
101193
+ const done = (fn) => {
101194
+ clearTimeout(timer);
101195
+ unpoll();
101196
+ fn();
101197
+ unobserve();
101198
+ };
101199
+ try {
101200
+ const result = await withRetry(async () => {
101201
+ const result2 = await getAction(client, getCallsStatus, "getCallsStatus")({ id });
101202
+ if (throwOnFailure && result2.status === "failure")
101203
+ throw new BundleFailedError(result2);
101204
+ return result2;
101205
+ }, {
101206
+ retryCount,
101207
+ delay: retryDelay
101208
+ });
101209
+ if (!status(result))
101210
+ return;
101211
+ done(() => emit.resolve(result));
101212
+ } catch (error48) {
101213
+ done(() => emit.reject(error48));
101214
+ }
101215
+ }, {
101216
+ interval: pollingInterval,
101217
+ emitOnBegin: true
101218
+ });
101219
+ return unpoll;
101220
+ });
101221
+ timer = timeout ? setTimeout(() => {
101222
+ unobserve();
101223
+ clearTimeout(timer);
101224
+ reject(new WaitForCallsStatusTimeoutError({ id }));
101225
+ }, timeout) : void 0;
101226
+ return await promise3;
101227
+ }
101228
+ var WaitForCallsStatusTimeoutError = class extends BaseError4 {
101229
+ constructor({ id }) {
101230
+ super(`Timed out while waiting for call bundle with id "${id}" to be confirmed.`, { name: "WaitForCallsStatusTimeoutError" });
101231
+ }
101232
+ };
101233
+
100860
101234
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/clients/createClient.js
100861
101235
  init_cjs_shims();
100862
101236
  init_parseAccount();
@@ -101169,13 +101543,13 @@ async function isImageUri(uri) {
101169
101543
  }
101170
101544
  if (!Object.hasOwn(globalThis, "Image"))
101171
101545
  return false;
101172
- return new Promise((resolve) => {
101546
+ return new Promise((resolve2) => {
101173
101547
  const img = new Image();
101174
101548
  img.onload = () => {
101175
- resolve(true);
101549
+ resolve2(true);
101176
101550
  };
101177
101551
  img.onerror = () => {
101178
- resolve(false);
101552
+ resolve2(false);
101179
101553
  };
101180
101554
  img.src = uri;
101181
101555
  });
@@ -101741,7 +102115,7 @@ var Eip712DomainNotFoundError = class extends BaseError4 {
101741
102115
  async function getEip712Domain(client, parameters) {
101742
102116
  const { address, factory, factoryData } = parameters;
101743
102117
  try {
101744
- const [fields, name, version7, chainId, verifyingContract, salt, extensions] = await getAction(client, readContract, "readContract")({
102118
+ const [fields, name, version7, chainId2, verifyingContract, salt, extensions] = await getAction(client, readContract, "readContract")({
101745
102119
  abi,
101746
102120
  address,
101747
102121
  functionName: "eip712Domain",
@@ -101752,7 +102126,7 @@ async function getEip712Domain(client, parameters) {
101752
102126
  domain: {
101753
102127
  name,
101754
102128
  version: version7,
101755
- chainId: Number(chainId),
102129
+ chainId: Number(chainId2),
101756
102130
  verifyingContract,
101757
102131
  salt
101758
102132
  },
@@ -101869,12 +102243,12 @@ function assertTransactionEIP7702(transaction) {
101869
102243
  const { authorizationList } = transaction;
101870
102244
  if (authorizationList) {
101871
102245
  for (const authorization of authorizationList) {
101872
- const { chainId } = authorization;
102246
+ const { chainId: chainId2 } = authorization;
101873
102247
  const address = authorization.address;
101874
102248
  if (!isAddress2(address))
101875
102249
  throw new InvalidAddressError3({ address });
101876
- if (chainId < 0)
101877
- throw new InvalidChainIdError2({ chainId });
102250
+ if (chainId2 < 0)
102251
+ throw new InvalidChainIdError2({ chainId: chainId2 });
101878
102252
  }
101879
102253
  }
101880
102254
  assertTransactionEIP1559(transaction);
@@ -101899,9 +102273,9 @@ function assertTransactionEIP4844(transaction) {
101899
102273
  assertTransactionEIP1559(transaction);
101900
102274
  }
101901
102275
  function assertTransactionEIP1559(transaction) {
101902
- const { chainId, maxPriorityFeePerGas, maxFeePerGas, to: to2 } = transaction;
101903
- if (chainId <= 0)
101904
- throw new InvalidChainIdError2({ chainId });
102276
+ const { chainId: chainId2, maxPriorityFeePerGas, maxFeePerGas, to: to2 } = transaction;
102277
+ if (chainId2 <= 0)
102278
+ throw new InvalidChainIdError2({ chainId: chainId2 });
101905
102279
  if (to2 && !isAddress2(to2))
101906
102280
  throw new InvalidAddressError3({ address: to2 });
101907
102281
  if (maxFeePerGas && maxFeePerGas > maxUint2563)
@@ -101910,9 +102284,9 @@ function assertTransactionEIP1559(transaction) {
101910
102284
  throw new TipAboveFeeCapError2({ maxFeePerGas, maxPriorityFeePerGas });
101911
102285
  }
101912
102286
  function assertTransactionEIP2930(transaction) {
101913
- const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to: to2 } = transaction;
101914
- if (chainId <= 0)
101915
- throw new InvalidChainIdError2({ chainId });
102287
+ const { chainId: chainId2, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to: to2 } = transaction;
102288
+ if (chainId2 <= 0)
102289
+ throw new InvalidChainIdError2({ chainId: chainId2 });
101916
102290
  if (to2 && !isAddress2(to2))
101917
102291
  throw new InvalidAddressError3({ address: to2 });
101918
102292
  if (maxPriorityFeePerGas || maxFeePerGas)
@@ -101921,11 +102295,11 @@ function assertTransactionEIP2930(transaction) {
101921
102295
  throw new FeeCapTooHighError2({ maxFeePerGas: gasPrice });
101922
102296
  }
101923
102297
  function assertTransactionLegacy(transaction) {
101924
- const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to: to2 } = transaction;
102298
+ const { chainId: chainId2, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to: to2 } = transaction;
101925
102299
  if (to2 && !isAddress2(to2))
101926
102300
  throw new InvalidAddressError3({ address: to2 });
101927
- if (typeof chainId !== "undefined" && chainId <= 0)
101928
- throw new InvalidChainIdError2({ chainId });
102301
+ if (typeof chainId2 !== "undefined" && chainId2 <= 0)
102302
+ throw new InvalidChainIdError2({ chainId: chainId2 });
101929
102303
  if (maxPriorityFeePerGas || maxFeePerGas)
101930
102304
  throw new BaseError4("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
101931
102305
  if (gasPrice && gasPrice > maxUint2563)
@@ -101970,14 +102344,14 @@ function serializeTransaction(transaction, signature2) {
101970
102344
  return serializeTransactionLegacy(transaction, signature2);
101971
102345
  }
101972
102346
  function serializeTransactionEIP7702(transaction, signature2) {
101973
- const { authorizationList, chainId, gas, nonce: nonce2, to: to2, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
102347
+ const { authorizationList, chainId: chainId2, gas, nonce: nonce2, to: to2, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
101974
102348
  assertTransactionEIP7702(transaction);
101975
102349
  const serializedAccessList = serializeAccessList(accessList);
101976
102350
  const serializedAuthorizationList = serializeAuthorizationList(authorizationList);
101977
102351
  return concatHex2([
101978
102352
  "0x04",
101979
102353
  toRlp([
101980
- numberToHex2(chainId),
102354
+ numberToHex2(chainId2),
101981
102355
  nonce2 ? numberToHex2(nonce2) : "0x",
101982
102356
  maxPriorityFeePerGas ? numberToHex2(maxPriorityFeePerGas) : "0x",
101983
102357
  maxFeePerGas ? numberToHex2(maxFeePerGas) : "0x",
@@ -101992,7 +102366,7 @@ function serializeTransactionEIP7702(transaction, signature2) {
101992
102366
  ]);
101993
102367
  }
101994
102368
  function serializeTransactionEIP4844(transaction, signature2) {
101995
- const { chainId, gas, nonce: nonce2, to: to2, value, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
102369
+ const { chainId: chainId2, gas, nonce: nonce2, to: to2, value, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
101996
102370
  assertTransactionEIP4844(transaction);
101997
102371
  let blobVersionedHashes = transaction.blobVersionedHashes;
101998
102372
  let sidecars = transaction.sidecars;
@@ -102014,7 +102388,7 @@ function serializeTransactionEIP4844(transaction, signature2) {
102014
102388
  }
102015
102389
  const serializedAccessList = serializeAccessList(accessList);
102016
102390
  const serializedTransaction = [
102017
- numberToHex2(chainId),
102391
+ numberToHex2(chainId2),
102018
102392
  nonce2 ? numberToHex2(nonce2) : "0x",
102019
102393
  maxPriorityFeePerGas ? numberToHex2(maxPriorityFeePerGas) : "0x",
102020
102394
  maxFeePerGas ? numberToHex2(maxFeePerGas) : "0x",
@@ -102049,11 +102423,11 @@ function serializeTransactionEIP4844(transaction, signature2) {
102049
102423
  ]);
102050
102424
  }
102051
102425
  function serializeTransactionEIP1559(transaction, signature2) {
102052
- const { chainId, gas, nonce: nonce2, to: to2, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
102426
+ const { chainId: chainId2, gas, nonce: nonce2, to: to2, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
102053
102427
  assertTransactionEIP1559(transaction);
102054
102428
  const serializedAccessList = serializeAccessList(accessList);
102055
102429
  const serializedTransaction = [
102056
- numberToHex2(chainId),
102430
+ numberToHex2(chainId2),
102057
102431
  nonce2 ? numberToHex2(nonce2) : "0x",
102058
102432
  maxPriorityFeePerGas ? numberToHex2(maxPriorityFeePerGas) : "0x",
102059
102433
  maxFeePerGas ? numberToHex2(maxFeePerGas) : "0x",
@@ -102070,11 +102444,11 @@ function serializeTransactionEIP1559(transaction, signature2) {
102070
102444
  ]);
102071
102445
  }
102072
102446
  function serializeTransactionEIP2930(transaction, signature2) {
102073
- const { chainId, gas, data, nonce: nonce2, to: to2, value, accessList, gasPrice } = transaction;
102447
+ const { chainId: chainId2, gas, data, nonce: nonce2, to: to2, value, accessList, gasPrice } = transaction;
102074
102448
  assertTransactionEIP2930(transaction);
102075
102449
  const serializedAccessList = serializeAccessList(accessList);
102076
102450
  const serializedTransaction = [
102077
- numberToHex2(chainId),
102451
+ numberToHex2(chainId2),
102078
102452
  nonce2 ? numberToHex2(nonce2) : "0x",
102079
102453
  gasPrice ? numberToHex2(gasPrice) : "0x",
102080
102454
  gas ? numberToHex2(gas) : "0x",
@@ -102090,7 +102464,7 @@ function serializeTransactionEIP2930(transaction, signature2) {
102090
102464
  ]);
102091
102465
  }
102092
102466
  function serializeTransactionLegacy(transaction, signature2) {
102093
- const { chainId = 0, gas, data, nonce: nonce2, to: to2, value, gasPrice } = transaction;
102467
+ const { chainId: chainId2 = 0, gas, data, nonce: nonce2, to: to2, value, gasPrice } = transaction;
102094
102468
  assertTransactionLegacy(transaction);
102095
102469
  let serializedTransaction = [
102096
102470
  nonce2 ? numberToHex2(nonce2) : "0x",
@@ -102108,8 +102482,8 @@ function serializeTransactionLegacy(transaction, signature2) {
102108
102482
  return signature2.v;
102109
102483
  return 27n + (signature2.v === 35n ? 0n : 1n);
102110
102484
  }
102111
- if (chainId > 0)
102112
- return BigInt(chainId * 2) + BigInt(35n + signature2.v - 27n);
102485
+ if (chainId2 > 0)
102486
+ return BigInt(chainId2 * 2) + BigInt(35n + signature2.v - 27n);
102113
102487
  const v2 = 27n + (signature2.v === 27n ? 0n : 1n);
102114
102488
  if (signature2.v !== v2)
102115
102489
  throw new InvalidLegacyVError({ v: signature2.v });
@@ -102123,10 +102497,10 @@ function serializeTransactionLegacy(transaction, signature2) {
102123
102497
  r === "0x00" ? "0x" : r,
102124
102498
  s === "0x00" ? "0x" : s
102125
102499
  ];
102126
- } else if (chainId > 0) {
102500
+ } else if (chainId2 > 0) {
102127
102501
  serializedTransaction = [
102128
102502
  ...serializedTransaction,
102129
- numberToHex2(chainId),
102503
+ numberToHex2(chainId2),
102130
102504
  "0x",
102131
102505
  "0x"
102132
102506
  ];
@@ -102162,10 +102536,10 @@ function serializeAuthorizationList(authorizationList) {
102162
102536
  return [];
102163
102537
  const serializedAuthorizationList = [];
102164
102538
  for (const authorization of authorizationList) {
102165
- const { chainId, nonce: nonce2, ...signature2 } = authorization;
102539
+ const { chainId: chainId2, nonce: nonce2, ...signature2 } = authorization;
102166
102540
  const contractAddress = authorization.address;
102167
102541
  serializedAuthorizationList.push([
102168
- chainId ? toHex7(chainId) : "0x",
102542
+ chainId2 ? toHex7(chainId2) : "0x",
102169
102543
  contractAddress,
102170
102544
  nonce2 ? toHex7(nonce2) : "0x",
102171
102545
  ...toYParitySignatureArray({}, signature2)
@@ -102402,7 +102776,7 @@ init_request();
102402
102776
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/promise/withTimeout.js
102403
102777
  init_cjs_shims();
102404
102778
  function withTimeout(fn, { errorInstance = new Error("timed out"), timeout, signal }) {
102405
- return new Promise((resolve, reject) => {
102779
+ return new Promise((resolve2, reject) => {
102406
102780
  ;
102407
102781
  (async () => {
102408
102782
  let timeoutId;
@@ -102417,7 +102791,7 @@ function withTimeout(fn, { errorInstance = new Error("timed out"), timeout, sign
102417
102791
  }
102418
102792
  }, timeout);
102419
102793
  }
102420
- resolve(await fn({ signal: controller?.signal || null }));
102794
+ resolve2(await fn({ signal: controller?.signal || null }));
102421
102795
  } catch (err3) {
102422
102796
  if (err3?.name === "AbortError")
102423
102797
  reject(errorInstance);
@@ -103980,13 +104354,13 @@ async function waitForTransactionReceipt(client, parameters) {
103980
104354
  let retrying = false;
103981
104355
  let _unobserve;
103982
104356
  let _unwatch;
103983
- const { promise: promise3, resolve, reject } = withResolvers();
104357
+ const { promise: promise3, resolve: resolve2, reject } = withResolvers();
103984
104358
  const timer = timeout ? setTimeout(() => {
103985
104359
  _unwatch?.();
103986
104360
  _unobserve?.();
103987
104361
  reject(new WaitForTransactionReceiptTimeoutError({ hash: hash8 }));
103988
104362
  }, timeout) : void 0;
103989
- _unobserve = observe(observerId, { onReplaced, resolve, reject }, async (emit) => {
104363
+ _unobserve = observe(observerId, { onReplaced, resolve: resolve2, reject }, async (emit) => {
103990
104364
  receipt = await getAction(client, getTransactionReceipt, "getTransactionReceipt")({ hash: hash8 }).catch(() => void 0);
103991
104365
  if (receipt && confirmations <= 1) {
103992
104366
  clearTimeout(timer);
@@ -104459,12 +104833,12 @@ init_cjs_shims();
104459
104833
  init_cjs_shims();
104460
104834
  function parseSiweMessage(message) {
104461
104835
  const { scheme, statement, ...prefix } = message.match(prefixRegex)?.groups ?? {};
104462
- const { chainId, expirationTime, issuedAt, notBefore, requestId, ...suffix } = message.match(suffixRegex)?.groups ?? {};
104836
+ const { chainId: chainId2, expirationTime, issuedAt, notBefore, requestId, ...suffix } = message.match(suffixRegex)?.groups ?? {};
104463
104837
  const resources = message.split("Resources:")[1]?.split("\n- ").slice(1);
104464
104838
  return {
104465
104839
  ...prefix,
104466
104840
  ...suffix,
104467
- ...chainId ? { chainId: Number(chainId) } : {},
104841
+ ...chainId2 ? { chainId: Number(chainId2) } : {},
104468
104842
  ...expirationTime ? { expirationTime: new Date(expirationTime) } : {},
104469
104843
  ...issuedAt ? { issuedAt: new Date(issuedAt) } : {},
104470
104844
  ...notBefore ? { notBefore: new Date(notBefore) } : {},
@@ -104621,6 +104995,20 @@ function createPublicClient(parameters) {
104621
104995
  return client.extend(publicActions);
104622
104996
  }
104623
104997
 
104998
+ // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/actions/wallet/sendCallsSync.js
104999
+ init_cjs_shims();
105000
+ async function sendCallsSync(client, parameters) {
105001
+ const { chain: chain2 = client.chain } = parameters;
105002
+ const timeout = parameters.timeout ?? Math.max((chain2?.blockTime ?? 0) * 3, 5e3);
105003
+ const result = await getAction(client, sendCalls, "sendCalls")(parameters);
105004
+ const status = await getAction(client, waitForCallsStatus, "waitForCallsStatus")({
105005
+ ...parameters,
105006
+ id: result.id,
105007
+ timeout
105008
+ });
105009
+ return status;
105010
+ }
105011
+
104624
105012
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/actions/wallet/sendTransactionSync.js
104625
105013
  init_cjs_shims();
104626
105014
  init_parseAccount();
@@ -104656,12 +105044,12 @@ async function sendTransactionSync(client, parameters) {
104656
105044
  return void 0;
104657
105045
  })();
104658
105046
  if (account?.type === "json-rpc" || account === null) {
104659
- let chainId;
105047
+ let chainId2;
104660
105048
  if (chain2 !== null) {
104661
- chainId = await getAction(client, getChainId, "getChainId")({});
105049
+ chainId2 = await getAction(client, getChainId, "getChainId")({});
104662
105050
  if (assertChainId)
104663
105051
  assertCurrentChain({
104664
- currentChainId: chainId,
105052
+ currentChainId: chainId2,
104665
105053
  chain: chain2
104666
105054
  });
104667
105055
  }
@@ -104674,7 +105062,7 @@ async function sendTransactionSync(client, parameters) {
104674
105062
  account,
104675
105063
  authorizationList,
104676
105064
  blobs,
104677
- chainId,
105065
+ chainId: chainId2,
104678
105066
  data: data ? concat4([data, dataSuffix ?? "0x"]) : data,
104679
105067
  gas,
104680
105068
  gasPrice,
@@ -104798,10 +105186,10 @@ async function signTransaction(client, parameters) {
104798
105186
  account,
104799
105187
  ...parameters
104800
105188
  });
104801
- const chainId = await getAction(client, getChainId, "getChainId")({});
105189
+ const chainId2 = await getAction(client, getChainId, "getChainId")({});
104802
105190
  if (chain2 !== null)
104803
105191
  assertCurrentChain({
104804
- currentChainId: chainId,
105192
+ currentChainId: chainId2,
104805
105193
  chain: chain2
104806
105194
  });
104807
105195
  const formatters2 = chain2?.formatters || client.chain?.formatters;
@@ -104809,7 +105197,7 @@ async function signTransaction(client, parameters) {
104809
105197
  if (account.signTransaction)
104810
105198
  return account.signTransaction({
104811
105199
  ...transaction,
104812
- chainId
105200
+ chainId: chainId2
104813
105201
  }, { serializer: client.chain?.serializers?.transaction });
104814
105202
  return await client.request({
104815
105203
  method: "eth_signTransaction",
@@ -104819,7 +105207,7 @@ async function signTransaction(client, parameters) {
104819
105207
  ...transaction,
104820
105208
  account
104821
105209
  }, "signTransaction"),
104822
- chainId: numberToHex2(chainId),
105210
+ chainId: numberToHex2(chainId2),
104823
105211
  from: account.address
104824
105212
  }
104825
105213
  ]
@@ -104958,13 +105346,14 @@ function http(url3, config2 = {}) {
104958
105346
  init_encodeFunctionData2();
104959
105347
  init_getAbiItem2();
104960
105348
  init_getAddress2();
105349
+ init_isAddressEqual();
104961
105350
  init_toFunctionSelector2();
104962
105351
  init_formatUnits();
104963
105352
 
104964
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/client/index.js
105353
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/client/index.js
104965
105354
  init_cjs_shims();
104966
105355
 
104967
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/client/Charge.js
105356
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/client/Charge.js
104968
105357
  init_cjs_shims();
104969
105358
 
104970
105359
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/actions/index.js
@@ -105620,11 +106009,11 @@ function from17(authorization, options = {}) {
105620
106009
  return authorization;
105621
106010
  }
105622
106011
  function fromRpc6(authorization) {
105623
- const { address, chainId, nonce: nonce2 } = authorization;
106012
+ const { address, chainId: chainId2, nonce: nonce2 } = authorization;
105624
106013
  const signature2 = fromRpc5(authorization.signature);
105625
106014
  return {
105626
106015
  address,
105627
- chainId: Number(chainId),
106016
+ chainId: Number(chainId2),
105628
106017
  nonce: BigInt(nonce2),
105629
106018
  signature: signature2
105630
106019
  };
@@ -105633,10 +106022,10 @@ function fromRpcList2(authorizationList) {
105633
106022
  return authorizationList.map((x) => fromRpc6(x));
105634
106023
  }
105635
106024
  function fromTuple2(tuple3) {
105636
- const [chainId, address, nonce2, signatureSerialized] = tuple3;
106025
+ const [chainId2, address, nonce2, signatureSerialized] = tuple3;
105637
106026
  const args = {
105638
106027
  address,
105639
- chainId: chainId === "0x" ? 0 : Number(chainId),
106028
+ chainId: chainId2 === "0x" ? 0 : Number(chainId2),
105640
106029
  nonce: nonce2 === "0x" ? 0n : BigInt(nonce2)
105641
106030
  };
105642
106031
  if (signatureSerialized)
@@ -105650,10 +106039,10 @@ function fromTupleList2(tupleList) {
105650
106039
  return list2;
105651
106040
  }
105652
106041
  function toRpc8(authorization) {
105653
- const { address, chainId, nonce: nonce2, signature: signature2 } = authorization;
106042
+ const { address, chainId: chainId2, nonce: nonce2, signature: signature2 } = authorization;
105654
106043
  return {
105655
106044
  address,
105656
- chainId: fromNumber(chainId),
106045
+ chainId: fromNumber(chainId2),
105657
106046
  nonce: fromNumber(nonce2),
105658
106047
  signature: toRpc7(signature2)
105659
106048
  };
@@ -105662,10 +106051,10 @@ function toRpcList2(authorizationList) {
105662
106051
  return authorizationList.map((x) => toRpc8(x));
105663
106052
  }
105664
106053
  function toTuple3(authorization) {
105665
- const { address, chainId, nonce: nonce2 } = authorization;
106054
+ const { address, chainId: chainId2, nonce: nonce2 } = authorization;
105666
106055
  const signature2 = authorization.signature ? serialize4(authorization.signature) : void 0;
105667
106056
  return [
105668
- chainId ? fromNumber(chainId) : "0x",
106057
+ chainId2 ? fromNumber(chainId2) : "0x",
105669
106058
  address,
105670
106059
  nonce2 ? fromNumber(nonce2) : "0x",
105671
106060
  ...signature2 ? [signature2] : []
@@ -105694,11 +106083,11 @@ function from18(authorization, options = {}) {
105694
106083
  return authorization;
105695
106084
  }
105696
106085
  function fromRpc7(authorization) {
105697
- const { chainId = "0x0", keyId, expiry = 0, limits, keyType } = authorization;
106086
+ const { chainId: chainId2 = "0x0", keyId, expiry = 0, limits, keyType } = authorization;
105698
106087
  const signature2 = fromRpc5(authorization.signature);
105699
106088
  return {
105700
106089
  address: keyId,
105701
- chainId: chainId === "0x" ? 0n : toBigInt(chainId),
106090
+ chainId: chainId2 === "0x" ? 0n : toBigInt(chainId2),
105702
106091
  expiry: Number(expiry),
105703
106092
  limits: limits?.map((limit) => ({
105704
106093
  token: limit.token,
@@ -105710,7 +106099,7 @@ function fromRpc7(authorization) {
105710
106099
  }
105711
106100
  function fromTuple3(tuple3) {
105712
106101
  const [authorization, signatureSerialized] = tuple3;
105713
- const [chainId, keyType_hex, keyId, expiry, limits] = authorization;
106102
+ const [chainId2, keyType_hex, keyId, expiry, limits] = authorization;
105714
106103
  const keyType = (() => {
105715
106104
  switch (keyType_hex) {
105716
106105
  case "0x":
@@ -105728,7 +106117,7 @@ function fromTuple3(tuple3) {
105728
106117
  address: keyId,
105729
106118
  expiry: typeof expiry !== "undefined" ? hexToNumber3(expiry) : void 0,
105730
106119
  type: keyType,
105731
- ...chainId !== "0x" ? { chainId: toBigInt(chainId) } : {},
106120
+ ...chainId2 !== "0x" ? { chainId: toBigInt(chainId2) } : {},
105732
106121
  ...typeof expiry !== "undefined" ? { expiry: hexToNumber3(expiry) } : {},
105733
106122
  ...typeof limits !== "undefined" ? {
105734
106123
  limits: limits.map(([token, limit]) => ({
@@ -105742,9 +106131,9 @@ function fromTuple3(tuple3) {
105742
106131
  return from18(args);
105743
106132
  }
105744
106133
  function toRpc9(authorization) {
105745
- const { address, chainId = 0n, expiry, limits, type: type4, signature: signature2 } = authorization;
106134
+ const { address, chainId: chainId2 = 0n, expiry, limits, type: type4, signature: signature2 } = authorization;
105746
106135
  return {
105747
- chainId: chainId === 0n ? "0x" : fromNumber(chainId),
106136
+ chainId: chainId2 === 0n ? "0x" : fromNumber(chainId2),
105748
106137
  expiry: typeof expiry === "number" ? fromNumber(expiry) : null,
105749
106138
  limits: limits?.map(({ token, limit }) => ({
105750
106139
  token,
@@ -105756,7 +106145,7 @@ function toRpc9(authorization) {
105756
106145
  };
105757
106146
  }
105758
106147
  function toTuple4(authorization) {
105759
- const { address, chainId = 0n, expiry, limits } = authorization;
106148
+ const { address, chainId: chainId2 = 0n, expiry, limits } = authorization;
105760
106149
  const signature2 = authorization.signature ? serialize4(authorization.signature) : void 0;
105761
106150
  const type4 = (() => {
105762
106151
  switch (authorization.type) {
@@ -105771,7 +106160,7 @@ function toTuple4(authorization) {
105771
106160
  }
105772
106161
  })();
105773
106162
  const authorizationTuple = [
105774
- bigintToHex(chainId),
106163
+ bigintToHex(chainId2),
105775
106164
  type4,
105776
106165
  address,
105777
106166
  typeof expiry === "number" ? numberToHex3(expiry) : void 0,
@@ -106022,7 +106411,7 @@ var feePayerMagic = "0x78";
106022
106411
  var serializedType = "0x76";
106023
106412
  var type = "tempo";
106024
106413
  function assert10(envelope) {
106025
- const { calls, chainId, maxFeePerGas, maxPriorityFeePerGas, validBefore, validAfter } = envelope;
106414
+ const { calls, chainId: chainId2, maxFeePerGas, maxPriorityFeePerGas, validBefore, validAfter } = envelope;
106026
106415
  if (!calls || calls.length === 0)
106027
106416
  throw new CallsEmptyError();
106028
106417
  if (typeof validBefore === "number" && typeof validAfter === "number" && validBefore <= validAfter) {
@@ -106036,8 +106425,8 @@ function assert10(envelope) {
106036
106425
  if (call2.to)
106037
106426
  assert5(call2.to, { strict: false });
106038
106427
  }
106039
- if (chainId <= 0)
106040
- throw new InvalidChainIdError({ chainId });
106428
+ if (chainId2 <= 0)
106429
+ throw new InvalidChainIdError({ chainId: chainId2 });
106041
106430
  if (maxFeePerGas && BigInt(maxFeePerGas) > 2n ** 256n - 1n)
106042
106431
  throw new FeeCapTooHighError({
106043
106432
  feeCap: maxFeePerGas
@@ -106050,14 +106439,14 @@ function assert10(envelope) {
106050
106439
  }
106051
106440
  function deserialize4(serialized) {
106052
106441
  const transactionArray = toHex4(slice2(serialized, 1));
106053
- const [chainId, maxPriorityFeePerGas, maxFeePerGas, gas, calls, accessList, nonceKey, nonce2, validBefore, validAfter, feeToken, feePayerSignatureOrSender, authorizationList, keyAuthorizationOrSignature, maybeSignature] = transactionArray;
106442
+ const [chainId2, maxPriorityFeePerGas, maxFeePerGas, gas, calls, accessList, nonceKey, nonce2, validBefore, validAfter, feeToken, feePayerSignatureOrSender, authorizationList, keyAuthorizationOrSignature, maybeSignature] = transactionArray;
106054
106443
  const keyAuthorization = Array.isArray(keyAuthorizationOrSignature) ? keyAuthorizationOrSignature : void 0;
106055
106444
  const signature2 = keyAuthorization ? maybeSignature : keyAuthorizationOrSignature;
106056
106445
  if (!(transactionArray.length === 13 || transactionArray.length === 14 || transactionArray.length === 15))
106057
106446
  throw new InvalidSerializedError({
106058
106447
  attributes: {
106059
106448
  authorizationList,
106060
- chainId,
106449
+ chainId: chainId2,
106061
106450
  maxPriorityFeePerGas,
106062
106451
  maxFeePerGas,
106063
106452
  gas,
@@ -106078,7 +106467,7 @@ function deserialize4(serialized) {
106078
106467
  type
106079
106468
  });
106080
106469
  let transaction = {
106081
- chainId: Number(chainId),
106470
+ chainId: Number(chainId2),
106082
106471
  type
106083
106472
  };
106084
106473
  if (validate(gas) && gas !== "0x")
@@ -106160,7 +106549,7 @@ function from21(envelope, options = {}) {
106160
106549
  };
106161
106550
  }
106162
106551
  function serialize6(envelope, options = {}) {
106163
- const { accessList, authorizationList, calls, chainId, feeToken, gas, keyAuthorization, nonce: nonce2, nonceKey, maxFeePerGas, maxPriorityFeePerGas, validBefore, validAfter } = envelope;
106552
+ const { accessList, authorizationList, calls, chainId: chainId2, feeToken, gas, keyAuthorization, nonce: nonce2, nonceKey, maxFeePerGas, maxPriorityFeePerGas, validBefore, validAfter } = envelope;
106164
106553
  assert10(envelope);
106165
106554
  const accessTupleList = toTupleList(accessList);
106166
106555
  const signature2 = options.signature || envelope.signature;
@@ -106193,7 +106582,7 @@ function serialize6(envelope, options = {}) {
106193
106582
  return toTuple(feePayerSignature);
106194
106583
  })();
106195
106584
  const serialized = [
106196
- fromNumber(chainId),
106585
+ fromNumber(chainId2),
106197
106586
  maxPriorityFeePerGas ? fromNumber(maxPriorityFeePerGas) : "0x",
106198
106587
  maxFeePerGas ? fromNumber(maxFeePerGas) : "0x",
106199
106588
  gas ? fromNumber(gas) : "0x",
@@ -106324,7 +106713,7 @@ async function serializeTempo(transaction, sig) {
106324
106713
  });
106325
106714
  return void 0;
106326
106715
  })();
106327
- const { chainId, feePayer, feePayerSignature, nonce: nonce2, ...rest } = transaction;
106716
+ const { chainId: chainId2, feePayer, feePayerSignature, nonce: nonce2, ...rest } = transaction;
106328
106717
  const transaction_ox = {
106329
106718
  ...rest,
106330
106719
  calls: rest.calls?.length ? rest.calls : [
@@ -106334,7 +106723,7 @@ async function serializeTempo(transaction, sig) {
106334
106723
  data: rest.data
106335
106724
  }
106336
106725
  ],
106337
- chainId: Number(chainId),
106726
+ chainId: Number(chainId2),
106338
106727
  feePayerSignature: feePayerSignature ? {
106339
106728
  r: BigInt(feePayerSignature.r),
106340
106729
  s: BigInt(feePayerSignature.s),
@@ -108160,7 +108549,21 @@ var validator = [
108160
108549
  ];
108161
108550
 
108162
108551
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/tempo/Addresses.js
108552
+ var Addresses_exports = {};
108553
+ __export(Addresses_exports, {
108554
+ accountImplementation: () => accountImplementation,
108555
+ accountRegistrar: () => accountRegistrar,
108556
+ feeManager: () => feeManager2,
108557
+ nonceManager: () => nonceManager,
108558
+ pathUsd: () => pathUsd,
108559
+ stablecoinDex: () => stablecoinDex2,
108560
+ tip20Factory: () => tip20Factory2,
108561
+ tip403Registry: () => tip403Registry2,
108562
+ validator: () => validator2
108563
+ });
108163
108564
  init_cjs_shims();
108565
+ var accountImplementation = "0x7702c00000000000000000000000000000000000";
108566
+ var accountRegistrar = "0x7702ac0000000000000000000000000000000000";
108164
108567
  var feeManager2 = "0xfeec000000000000000000000000000000000000";
108165
108568
  var nonceManager = "0x4e4F4E4345000000000000000000000000000000";
108166
108569
  var pathUsd = "0x20c0000000000000000000000000000000000000";
@@ -110172,14 +110575,14 @@ async function create3(client, parameters) {
110172
110575
  }
110173
110576
  create5.inner = inner;
110174
110577
  function call2(args) {
110175
- const { name, symbol: symbol3, currency, quoteToken = pathUsd, admin, salt = random2(32) } = args;
110578
+ const { name, symbol: symbol3, currency: currency2, quoteToken = pathUsd, admin, salt = random2(32) } = args;
110176
110579
  return defineCall({
110177
110580
  address: tip20Factory2,
110178
110581
  abi: tip20Factory,
110179
110582
  args: [
110180
110583
  name,
110181
110584
  symbol3,
110182
- currency,
110585
+ currency2,
110183
110586
  TokenId_exports.toAddress(quoteToken),
110184
110587
  admin,
110185
110588
  salt
@@ -110295,10 +110698,10 @@ async function getMetadata(client, parameters) {
110295
110698
  ],
110296
110699
  allowFailure: false,
110297
110700
  deployless: true
110298
- }).then(([currency, decimals2, name, symbol3, totalSupply]) => ({
110701
+ }).then(([currency2, decimals2, name, symbol3, totalSupply]) => ({
110299
110702
  name,
110300
110703
  symbol: symbol3,
110301
- currency,
110704
+ currency: currency2,
110302
110705
  decimals: decimals2,
110303
110706
  totalSupply
110304
110707
  }));
@@ -110353,10 +110756,10 @@ async function getMetadata(client, parameters) {
110353
110756
  ],
110354
110757
  allowFailure: false,
110355
110758
  deployless: true
110356
- }).then(([currency, decimals2, quoteToken, name, paused, supplyCap, symbol3, totalSupply, transferPolicyId]) => ({
110759
+ }).then(([currency2, decimals2, quoteToken, name, paused, supplyCap, symbol3, totalSupply, transferPolicyId]) => ({
110357
110760
  name,
110358
110761
  symbol: symbol3,
110359
- currency,
110762
+ currency: currency2,
110360
110763
  decimals: decimals2,
110361
110764
  quoteToken,
110362
110765
  totalSupply,
@@ -111385,7 +111788,7 @@ async function updateSync(client, parameters) {
111385
111788
  return { receipt };
111386
111789
  }
111387
111790
 
111388
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/viem/Account.js
111791
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/viem/Account.js
111389
111792
  init_cjs_shims();
111390
111793
 
111391
111794
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/accounts/index.js
@@ -111460,17 +111863,17 @@ async function sign({ hash: hash8, privateKey, to: to2 = "object" }) {
111460
111863
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/accounts/utils/signAuthorization.js
111461
111864
  init_cjs_shims();
111462
111865
  async function signAuthorization(parameters) {
111463
- const { chainId, nonce: nonce2, privateKey, to: to2 = "object" } = parameters;
111866
+ const { chainId: chainId2, nonce: nonce2, privateKey, to: to2 = "object" } = parameters;
111464
111867
  const address = parameters.contractAddress ?? parameters.address;
111465
111868
  const signature2 = await sign({
111466
- hash: hashAuthorization({ address, chainId, nonce: nonce2 }),
111869
+ hash: hashAuthorization({ address, chainId: chainId2, nonce: nonce2 }),
111467
111870
  privateKey,
111468
111871
  to: to2
111469
111872
  });
111470
111873
  if (to2 === "object")
111471
111874
  return {
111472
111875
  address,
111473
- chainId,
111876
+ chainId: chainId2,
111474
111877
  nonce: nonce2,
111475
111878
  ...signature2
111476
111879
  };
@@ -111548,7 +111951,7 @@ function privateKeyToAccount(privateKey, options = {}) {
111548
111951
  // ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/accounts/index.js
111549
111952
  init_parseAccount();
111550
111953
 
111551
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/viem/Account.js
111954
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/viem/Account.js
111552
111955
  function getResolver(parameters = {}) {
111553
111956
  const { account: defaultAccount } = parameters;
111554
111957
  return (client, { account: override } = {}) => {
@@ -111562,16 +111965,16 @@ function getResolver(parameters = {}) {
111562
111965
  };
111563
111966
  }
111564
111967
 
111565
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/viem/Client.js
111968
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/viem/Client.js
111566
111969
  init_cjs_shims();
111567
111970
  function getResolver2(parameters) {
111568
111971
  const { chain: chain2, getClient, rpcUrl: rpcUrl2 } = parameters;
111569
111972
  if (getClient)
111570
111973
  return getClient;
111571
- return ({ chainId }) => {
111974
+ return ({ chainId: chainId2 }) => {
111572
111975
  if (!rpcUrl2)
111573
111976
  throw new Error("No `rpcUrl` provided.");
111574
- const resolvedChainId = chainId || Number(Object.keys(rpcUrl2)[0]);
111977
+ const resolvedChainId = chainId2 || Number(Object.keys(rpcUrl2)[0]);
111575
111978
  const url3 = rpcUrl2[resolvedChainId];
111576
111979
  if (!url3)
111577
111980
  throw new Error(`No \`rpcUrl\` configured for \`chainId\` (${resolvedChainId}).`);
@@ -111582,7 +111985,7 @@ function getResolver2(parameters) {
111582
111985
  };
111583
111986
  }
111584
111987
 
111585
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/Attribution.js
111988
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/Attribution.js
111586
111989
  init_cjs_shims();
111587
111990
  var tag = Hex_exports.slice(Hash_exports.keccak256(Bytes_exports.fromString("mpp"), { as: "Hex" }), 0, 4);
111588
111991
  var version6 = 1;
@@ -111603,19 +112006,108 @@ function encode6(parameters) {
111603
112006
  return Hex_exports.fromBytes(buf);
111604
112007
  }
111605
112008
 
111606
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/internal/defaults.js
112009
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/internal/auto-swap.js
111607
112010
  init_cjs_shims();
111608
- var rpcUrl = {
111609
- 4217: "https://rpc.tempo.xyz",
111610
- 42431: "https://rpc.moderato.tempo.xyz"
112011
+
112012
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/internal/defaults.js
112013
+ init_cjs_shims();
112014
+ var chainId = {
112015
+ mainnet: 4217,
112016
+ testnet: 42431
111611
112017
  };
111612
- var escrowContract = {
111613
- 4217: "0x0901aED692C755b870F9605E56BAA66C35BEfF69",
111614
- 42431: "0x542831e3E4Ace07559b7C8787395f4Fb99F70787"
112018
+ var tokens = {
112019
+ /** USDC (USDC.e) token address. */
112020
+ usdc: "0x20C000000000000000000000b9537d11c60E8b50",
112021
+ /** pathUSD token address. */
112022
+ pathUsd: "0x20c0000000000000000000000000000000000000"
112023
+ };
112024
+ var currency = {
112025
+ [chainId.mainnet]: tokens.usdc,
112026
+ [chainId.testnet]: tokens.pathUsd
111615
112027
  };
111616
112028
  var decimals = 6;
112029
+ var escrowContract = {
112030
+ [chainId.mainnet]: "0x0901aED692C755b870F9605E56BAA66C35BEfF69",
112031
+ [chainId.testnet]: "0x542831e3E4Ace07559b7C8787395f4Fb99F70787"
112032
+ };
112033
+ var rpcUrl = {
112034
+ [chainId.mainnet]: "https://rpc.tempo.xyz",
112035
+ [chainId.testnet]: "https://rpc.moderato.tempo.xyz"
112036
+ };
111617
112037
 
111618
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/Methods.js
112038
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/internal/auto-swap.js
112039
+ var bps = 10000n;
112040
+ var defaultCurrencies = [
112041
+ tokens.pathUsd,
112042
+ tokens.usdc
112043
+ ];
112044
+ async function findCalls(client, parameters) {
112045
+ const { account, amountOut, tokenOut, tokenIn, slippage } = parameters;
112046
+ const candidates = tokenIn.filter((t) => !isAddressEqual(t, tokenOut));
112047
+ const balanceResults = await Promise.allSettled([
112048
+ readContract(client, actions_exports.token.getBalance.call({ account, token: tokenOut })),
112049
+ ...candidates.map((t) => readContract(client, actions_exports.token.getBalance.call({ account, token: t })))
112050
+ ]);
112051
+ const targetBalance = balanceResults[0];
112052
+ if (targetBalance.status === "fulfilled" && targetBalance.value >= amountOut)
112053
+ return void 0;
112054
+ for (let i = 0; i < candidates.length; i++) {
112055
+ const result = balanceResults[i + 1];
112056
+ if (result.status !== "fulfilled")
112057
+ continue;
112058
+ const balance = result.value;
112059
+ if (balance <= 0n)
112060
+ continue;
112061
+ const tokenIn2 = candidates[i];
112062
+ try {
112063
+ const quotedAmountIn = await actions_exports.dex.getBuyQuote(client, {
112064
+ tokenIn: tokenIn2,
112065
+ tokenOut,
112066
+ amountOut
112067
+ });
112068
+ if (balance >= quotedAmountIn) {
112069
+ const maxAmountIn = quotedAmountIn + quotedAmountIn * BigInt(Math.round(slippage * 100)) / bps;
112070
+ return [
112071
+ actions_exports.token.approve.call({
112072
+ token: tokenIn2,
112073
+ spender: Addresses_exports.stablecoinDex,
112074
+ amount: maxAmountIn
112075
+ }),
112076
+ actions_exports.dex.buy.call({
112077
+ tokenIn: tokenIn2,
112078
+ tokenOut,
112079
+ amountOut,
112080
+ maxAmountIn
112081
+ })
112082
+ ];
112083
+ }
112084
+ } catch {
112085
+ }
112086
+ }
112087
+ throw new InsufficientFundsError2({ currency: tokenOut });
112088
+ }
112089
+ function resolve(value, defaultCurrencies2) {
112090
+ if (!value)
112091
+ return false;
112092
+ if (value === true)
112093
+ return { tokenIn: defaultCurrencies2, slippage: 1 };
112094
+ const tokenIn = value.tokenIn ? [
112095
+ ...value.tokenIn,
112096
+ ...defaultCurrencies2.filter((d) => !value.tokenIn.some((c) => isAddressEqual(c, d)))
112097
+ ] : defaultCurrencies2;
112098
+ return {
112099
+ tokenIn,
112100
+ slippage: value.slippage ?? 1
112101
+ };
112102
+ }
112103
+ var InsufficientFundsError2 = class extends Error {
112104
+ constructor({ currency: currency2 }) {
112105
+ super(`Insufficient funds: no balance in ${currency2} and no viable swap route from fallback currencies.`);
112106
+ this.name = "InsufficientFundsError";
112107
+ }
112108
+ };
112109
+
112110
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/Methods.js
111619
112111
  init_cjs_shims();
111620
112112
  var charge = from13({
111621
112113
  name: "tempo",
@@ -111633,17 +112125,16 @@ var charge = from13({
111633
112125
  currency: string2(),
111634
112126
  decimals: number2(),
111635
112127
  description: optional(string2()),
111636
- expires: _default2(datetime4(), () => minutes(5)),
111637
112128
  externalId: optional(string2()),
111638
112129
  feePayer: optional(pipe(union([boolean2(), custom()]), transform((v) => typeof v === "object" ? true : v))),
111639
112130
  memo: optional(hash5()),
111640
112131
  recipient: optional(string2())
111641
- }), transform(({ amount: amount2, chainId, decimals: decimals2, feePayer, memo, ...rest }) => ({
112132
+ }), transform(({ amount: amount2, chainId: chainId2, decimals: decimals2, feePayer, memo, ...rest }) => ({
111642
112133
  ...rest,
111643
112134
  amount: parseUnits(amount2, decimals2).toString(),
111644
- ...chainId !== void 0 || feePayer !== void 0 || memo !== void 0 ? {
112135
+ ...chainId2 !== void 0 || feePayer !== void 0 || memo !== void 0 ? {
111645
112136
  methodDetails: {
111646
- ...chainId !== void 0 && { chainId },
112137
+ ...chainId2 !== void 0 && { chainId: chainId2 },
111647
112138
  ...feePayer !== void 0 && { feePayer },
111648
112139
  ...memo !== void 0 && { memo }
111649
112140
  }
@@ -111699,7 +112190,7 @@ var session = from13({
111699
112190
  recipient: optional(string2()),
111700
112191
  suggestedDeposit: optional(amount()),
111701
112192
  unitType: string2()
111702
- }), transform(({ amount: amount2, chainId, channelId, decimals: decimals2, escrowContract: escrowContract2, feePayer, minVoucherDelta, suggestedDeposit, ...rest }) => ({
112193
+ }), transform(({ amount: amount2, chainId: chainId2, channelId, decimals: decimals2, escrowContract: escrowContract2, feePayer, minVoucherDelta, suggestedDeposit, ...rest }) => ({
111703
112194
  ...rest,
111704
112195
  amount: parseUnits(amount2, decimals2).toString(),
111705
112196
  ...suggestedDeposit ? {
@@ -111708,15 +112199,17 @@ var session = from13({
111708
112199
  methodDetails: {
111709
112200
  escrowContract: escrowContract2,
111710
112201
  ...channelId !== void 0 && { channelId },
111711
- ...minVoucherDelta !== void 0 && { minVoucherDelta },
111712
- ...chainId !== void 0 && { chainId },
112202
+ ...minVoucherDelta !== void 0 && {
112203
+ minVoucherDelta: parseUnits(minVoucherDelta, decimals2).toString()
112204
+ },
112205
+ ...chainId2 !== void 0 && { chainId: chainId2 },
111713
112206
  ...feePayer !== void 0 && { feePayer }
111714
112207
  }
111715
112208
  })))
111716
112209
  }
111717
112210
  });
111718
112211
 
111719
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/client/Charge.js
112212
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/client/Charge.js
111720
112213
  function charge2(parameters = {}) {
111721
112214
  const { clientId } = parameters;
111722
112215
  const getClient = getResolver2({
@@ -111727,53 +112220,82 @@ function charge2(parameters = {}) {
111727
112220
  const getAccount = getResolver({ account: parameters.account });
111728
112221
  return toClient(charge, {
111729
112222
  context: object({
111730
- account: optional(custom())
112223
+ account: optional(custom()),
112224
+ autoSwap: optional(custom()),
112225
+ mode: optional(_enum2(["push", "pull"]))
111731
112226
  }),
111732
112227
  async createCredential({ challenge: challenge2, context: context2 }) {
111733
- const chainId = challenge2.request.methodDetails?.chainId;
111734
- const client = await getClient({ chainId });
112228
+ const chainId2 = challenge2.request.methodDetails?.chainId;
112229
+ const client = await getClient({ chainId: chainId2 });
111735
112230
  const account = getAccount(client, context2);
112231
+ const mode = context2?.mode ?? parameters.mode ?? (account.type === "json-rpc" ? "push" : "pull");
111736
112232
  const { request } = challenge2;
111737
- const { amount: amount2, currency, recipient, methodDetails } = request;
112233
+ const { amount: amount2, methodDetails } = request;
112234
+ const currency2 = request.currency;
112235
+ const recipient = request.recipient;
111738
112236
  const memo = methodDetails?.memo ? methodDetails.memo : encode6({ serverId: challenge2.realm, clientId });
112237
+ const transferCall = actions_exports.token.transfer.call({
112238
+ amount: BigInt(amount2),
112239
+ memo,
112240
+ to: recipient,
112241
+ token: currency2
112242
+ });
112243
+ const autoSwap = resolve(context2?.autoSwap ?? parameters.autoSwap, defaultCurrencies);
112244
+ const swapCalls = autoSwap ? await findCalls(client, {
112245
+ account: account.address,
112246
+ amountOut: BigInt(amount2),
112247
+ tokenOut: currency2,
112248
+ tokenIn: autoSwap.tokenIn,
112249
+ slippage: autoSwap.slippage
112250
+ }) : void 0;
112251
+ const calls = [...swapCalls ?? [], transferCall];
112252
+ if (mode === "push") {
112253
+ const { receipts } = await sendCallsSync(client, {
112254
+ account,
112255
+ calls,
112256
+ experimental_fallback: true
112257
+ });
112258
+ const hash8 = receipts?.[0]?.transactionHash;
112259
+ if (!hash8)
112260
+ throw new Error("No transaction receipt returned.");
112261
+ return serialize3({
112262
+ challenge: challenge2,
112263
+ payload: { hash: hash8, type: "hash" },
112264
+ source: `did:pkh:eip155:${chainId2}:${account.address}`
112265
+ });
112266
+ }
111739
112267
  const prepared = await prepareTransactionRequest(client, {
111740
112268
  account,
111741
- calls: [
111742
- actions_exports.token.transfer.call({
111743
- amount: BigInt(amount2),
111744
- memo,
111745
- to: recipient,
111746
- token: currency
111747
- })
111748
- ],
111749
- ...methodDetails?.feePayer && { feePayer: true }
112269
+ calls,
112270
+ ...methodDetails?.feePayer && { feePayer: true },
112271
+ nonceKey: "expiring"
111750
112272
  });
111751
112273
  prepared.gas = prepared.gas + 5000n;
111752
112274
  const signature2 = await signTransaction(client, prepared);
111753
112275
  return serialize3({
111754
112276
  challenge: challenge2,
111755
112277
  payload: { signature: signature2, type: "transaction" },
111756
- source: `did:pkh:eip155:${chainId}:${account.address}`
112278
+ source: `did:pkh:eip155:${chainId2}:${account.address}`
111757
112279
  });
111758
112280
  }
111759
112281
  });
111760
112282
  }
111761
112283
 
111762
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/client/Methods.js
112284
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/client/Methods.js
111763
112285
  init_cjs_shims();
111764
112286
 
111765
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/client/Session.js
112287
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/client/Session.js
111766
112288
  init_cjs_shims();
111767
112289
 
111768
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/session/Voucher.js
112290
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/session/Voucher.js
111769
112291
  init_cjs_shims();
111770
112292
  var DOMAIN_NAME = "Tempo Stream Channel";
111771
112293
  var DOMAIN_VERSION = "1";
111772
- function getVoucherDomain(escrowContract2, chainId) {
112294
+ function getVoucherDomain(escrowContract2, chainId2) {
111773
112295
  return {
111774
112296
  name: DOMAIN_NAME,
111775
112297
  version: DOMAIN_VERSION,
111776
- chainId,
112298
+ chainId: chainId2,
111777
112299
  verifyingContract: escrowContract2
111778
112300
  };
111779
112301
  }
@@ -111783,10 +112305,10 @@ var voucherTypes = {
111783
112305
  { name: "cumulativeAmount", type: "uint128" }
111784
112306
  ]
111785
112307
  };
111786
- async function signVoucher(client, account, message, escrowContract2, chainId, authorizedSigner) {
112308
+ async function signVoucher(client, account, message, escrowContract2, chainId2, authorizedSigner) {
111787
112309
  const signature2 = await signTypedData(client, {
111788
112310
  account,
111789
- domain: getVoucherDomain(escrowContract2, chainId),
112311
+ domain: getVoucherDomain(escrowContract2, chainId2),
111790
112312
  types: voucherTypes,
111791
112313
  primaryType: "Voucher",
111792
112314
  message: {
@@ -111805,13 +112327,13 @@ async function signVoucher(client, account, message, escrowContract2, chainId, a
111805
112327
  return signature2;
111806
112328
  }
111807
112329
 
111808
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/client/ChannelOps.js
112330
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/client/ChannelOps.js
111809
112331
  init_cjs_shims();
111810
112332
 
111811
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/session/Chain.js
112333
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/session/Chain.js
111812
112334
  init_cjs_shims();
111813
112335
 
111814
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/session/escrow.abi.js
112336
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/session/escrow.abi.js
111815
112337
  init_cjs_shims();
111816
112338
  var escrowAbi = [
111817
112339
  {
@@ -112573,7 +113095,7 @@ var escrowAbi = [
112573
113095
  }
112574
113096
  ];
112575
113097
 
112576
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/session/Chain.js
113098
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/session/Chain.js
112577
113099
  var UINT128_MAX = 2n ** 128n - 1n;
112578
113100
  async function getOnChainChannel(client, escrowContract2, channelId) {
112579
113101
  return readContract(client, {
@@ -112586,7 +113108,7 @@ async function getOnChainChannel(client, escrowContract2, channelId) {
112586
113108
  var escrowOpenSelector = /* @__PURE__ */ toFunctionSelector2(getAbiItem2({ abi: escrowAbi, name: "open" }));
112587
113109
  var escrowTopUpSelector = /* @__PURE__ */ toFunctionSelector2(getAbiItem2({ abi: escrowAbi, name: "topUp" }));
112588
113110
 
112589
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/session/Channel.js
113111
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/session/Channel.js
112590
113112
  init_cjs_shims();
112591
113113
  function computeId2(parameters) {
112592
113114
  const encoded = AbiParameters_exports.encode(AbiParameters_exports.from([
@@ -112609,23 +113131,23 @@ function computeId2(parameters) {
112609
113131
  return Hash_exports.keccak256(encoded);
112610
113132
  }
112611
113133
 
112612
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/client/ChannelOps.js
112613
- function resolveEscrow(challenge2, chainId, escrowContractOverride) {
113134
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/client/ChannelOps.js
113135
+ function resolveEscrow(challenge2, chainId2, escrowContractOverride) {
112614
113136
  const challengeEscrow = challenge2.request.methodDetails?.escrowContract;
112615
- const escrow = challengeEscrow ?? escrowContractOverride ?? escrowContract[chainId];
113137
+ const escrow = challengeEscrow ?? escrowContractOverride ?? escrowContract[chainId2];
112616
113138
  if (!escrow)
112617
113139
  throw new Error("No `escrowContract` available. Provide it in parameters or ensure the server challenge includes it.");
112618
113140
  return escrow;
112619
113141
  }
112620
- function serializeCredential(challenge2, payload, chainId, account) {
113142
+ function serializeCredential(challenge2, payload, chainId2, account) {
112621
113143
  return serialize3({
112622
113144
  challenge: challenge2,
112623
113145
  payload,
112624
- source: `did:pkh:eip155:${chainId}:${account.address}`
113146
+ source: `did:pkh:eip155:${chainId2}:${account.address}`
112625
113147
  });
112626
113148
  }
112627
- async function createVoucherPayload(client, account, channelId, cumulativeAmount, escrowContract2, chainId, authorizedSigner) {
112628
- const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount }, escrowContract2, chainId, authorizedSigner);
113149
+ async function createVoucherPayload(client, account, channelId, cumulativeAmount, escrowContract2, chainId2, authorizedSigner) {
113150
+ const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount }, escrowContract2, chainId2, authorizedSigner);
112629
113151
  return {
112630
113152
  action: "voucher",
112631
113153
  channelId,
@@ -112634,17 +113156,17 @@ async function createVoucherPayload(client, account, channelId, cumulativeAmount
112634
113156
  };
112635
113157
  }
112636
113158
  async function createOpenPayload(client, account, options) {
112637
- const { escrowContract: escrowContract2, payee, currency, deposit, initialAmount, chainId, feePayer } = options;
113159
+ const { escrowContract: escrowContract2, payee, currency: currency2, deposit, initialAmount, chainId: chainId2, feePayer } = options;
112638
113160
  const authorizedSigner = options.authorizedSigner ?? account.address;
112639
113161
  const salt = Hex_exports.random(32);
112640
113162
  const channelId = computeId2({
112641
113163
  authorizedSigner,
112642
- chainId,
113164
+ chainId: chainId2,
112643
113165
  escrowContract: escrowContract2,
112644
113166
  payee,
112645
113167
  payer: account.address,
112646
113168
  salt,
112647
- token: currency
113169
+ token: currency2
112648
113170
  });
112649
113171
  const approveData = encodeFunctionData2({
112650
113172
  abi: Abis_exports.tip20,
@@ -112654,26 +113176,26 @@ async function createOpenPayload(client, account, options) {
112654
113176
  const openData = encodeFunctionData2({
112655
113177
  abi: escrowAbi,
112656
113178
  functionName: "open",
112657
- args: [payee, currency, deposit, salt, authorizedSigner]
113179
+ args: [payee, currency2, deposit, salt, authorizedSigner]
112658
113180
  });
112659
113181
  const prepared = await prepareTransactionRequest(client, {
112660
113182
  account,
112661
113183
  calls: [
112662
- { to: currency, data: approveData },
113184
+ { to: currency2, data: approveData },
112663
113185
  { to: escrowContract2, data: openData }
112664
113186
  ],
112665
113187
  ...feePayer && { feePayer: true }
112666
113188
  });
112667
113189
  prepared.gas = prepared.gas + 5000n;
112668
113190
  const transaction = await signTransaction(client, prepared);
112669
- const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount: initialAmount }, escrowContract2, chainId, options.authorizedSigner);
113191
+ const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount: initialAmount }, escrowContract2, chainId2, options.authorizedSigner);
112670
113192
  return {
112671
113193
  entry: {
112672
113194
  channelId,
112673
113195
  salt,
112674
113196
  cumulativeAmount: initialAmount,
112675
113197
  escrowContract: escrowContract2,
112676
- chainId,
113198
+ chainId: chainId2,
112677
113199
  opened: true
112678
113200
  },
112679
113201
  payload: {
@@ -112687,7 +113209,7 @@ async function createOpenPayload(client, account, options) {
112687
113209
  }
112688
113210
  };
112689
113211
  }
112690
- async function tryRecoverChannel(client, escrowContract2, channelId, chainId) {
113212
+ async function tryRecoverChannel(client, escrowContract2, channelId, chainId2) {
112691
113213
  try {
112692
113214
  const onChain = await getOnChainChannel(client, escrowContract2, channelId);
112693
113215
  if (onChain.deposit > 0n && !onChain.finalized) {
@@ -112696,7 +113218,7 @@ async function tryRecoverChannel(client, escrowContract2, channelId, chainId) {
112696
113218
  salt: "0x",
112697
113219
  cumulativeAmount: onChain.settled,
112698
113220
  escrowContract: escrowContract2,
112699
- chainId,
113221
+ chainId: chainId2,
112700
113222
  opened: true
112701
113223
  };
112702
113224
  }
@@ -112705,7 +113227,7 @@ async function tryRecoverChannel(client, escrowContract2, channelId, chainId) {
112705
113227
  return void 0;
112706
113228
  }
112707
113229
 
112708
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/client/Session.js
113230
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/client/Session.js
112709
113231
  var sessionContextSchema = object({
112710
113232
  account: optional(custom()),
112711
113233
  action: optional(_enum2(["open", "topUp", "voucher", "close"])),
@@ -112734,24 +113256,24 @@ function session2(parameters = {}) {
112734
113256
  function notifyUpdate(entry) {
112735
113257
  parameters.onChannelUpdate?.(entry);
112736
113258
  }
112737
- function channelKey(payee, currency, escrow) {
112738
- return `${payee.toLowerCase()}:${currency.toLowerCase()}:${escrow.toLowerCase()}`;
113259
+ function channelKey(payee, currency2, escrow) {
113260
+ return `${payee.toLowerCase()}:${currency2.toLowerCase()}:${escrow.toLowerCase()}`;
112739
113261
  }
112740
- function resolveEscrowCached(challenge2, chainId, channelId) {
113262
+ function resolveEscrowCached(challenge2, chainId2, channelId) {
112741
113263
  if (channelId) {
112742
113264
  const cached2 = escrowContractMap.get(channelId);
112743
113265
  if (cached2)
112744
113266
  return cached2;
112745
113267
  }
112746
- return resolveEscrow(challenge2, chainId, parameters.escrowContract);
113268
+ return resolveEscrow(challenge2, chainId2, parameters.escrowContract);
112747
113269
  }
112748
113270
  async function autoManageCredential(challenge2, account, context2) {
112749
113271
  const md = challenge2.request.methodDetails;
112750
- const chainId = md?.chainId ?? 0;
112751
- const client = await getClient({ chainId });
112752
- const escrowContract2 = resolveEscrowCached(challenge2, chainId);
113272
+ const chainId2 = md?.chainId ?? 0;
113273
+ const client = await getClient({ chainId: chainId2 });
113274
+ const escrowContract2 = resolveEscrowCached(challenge2, chainId2);
112753
113275
  const payee = challenge2.request.recipient;
112754
- const currency = challenge2.request.currency;
113276
+ const currency2 = challenge2.request.currency;
112755
113277
  const amount2 = BigInt(challenge2.request.amount);
112756
113278
  const suggestedDepositRaw = challenge2.request.suggestedDeposit;
112757
113279
  const suggestedDeposit = suggestedDepositRaw ? BigInt(suggestedDepositRaw) : void 0;
@@ -112769,12 +113291,12 @@ function session2(parameters = {}) {
112769
113291
  throw new Error("No deposit amount available. Set `deposit`, `maxDeposit`, or ensure the server challenge includes `suggestedDeposit`.");
112770
113292
  })();
112771
113293
  const authorizedSigner = getAuthorizedSigner(account);
112772
- const key = channelKey(payee, currency, escrowContract2);
113294
+ const key = channelKey(payee, currency2, escrowContract2);
112773
113295
  let entry = channels.get(key);
112774
113296
  if (!entry) {
112775
113297
  const suggestedChannelId = context2?.channelId ?? md?.channelId;
112776
113298
  if (suggestedChannelId) {
112777
- const recovered = await tryRecoverChannel(client, escrowContract2, suggestedChannelId, chainId);
113299
+ const recovered = await tryRecoverChannel(client, escrowContract2, suggestedChannelId, chainId2);
112778
113300
  if (recovered) {
112779
113301
  const contextCumulative = context2?.cumulativeAmountRaw ? BigInt(context2.cumulativeAmountRaw) : context2?.cumulativeAmount ? parseUnits(context2.cumulativeAmount, decimals2) : void 0;
112780
113302
  if (contextCumulative !== void 0)
@@ -112792,17 +113314,17 @@ function session2(parameters = {}) {
112792
113314
  let payload;
112793
113315
  if (entry?.opened) {
112794
113316
  entry.cumulativeAmount += amount2;
112795
- payload = await createVoucherPayload(client, account, entry.channelId, entry.cumulativeAmount, escrowContract2, chainId, authorizedSigner);
113317
+ payload = await createVoucherPayload(client, account, entry.channelId, entry.cumulativeAmount, escrowContract2, chainId2, authorizedSigner);
112796
113318
  notifyUpdate(entry);
112797
113319
  } else {
112798
113320
  const result = await createOpenPayload(client, account, {
112799
113321
  authorizedSigner,
112800
113322
  escrowContract: escrowContract2,
112801
113323
  payee,
112802
- currency,
113324
+ currency: currency2,
112803
113325
  deposit,
112804
113326
  initialAmount: amount2,
112805
- chainId,
113327
+ chainId: chainId2,
112806
113328
  feePayer: md?.feePayer
112807
113329
  });
112808
113330
  channels.set(key, result.entry);
@@ -112811,19 +113333,19 @@ function session2(parameters = {}) {
112811
113333
  payload = result.payload;
112812
113334
  notifyUpdate(result.entry);
112813
113335
  }
112814
- return serializeCredential(challenge2, payload, chainId, account);
113336
+ return serializeCredential(challenge2, payload, chainId2, account);
112815
113337
  }
112816
113338
  async function manualCredential(challenge2, account, context2) {
112817
113339
  const md = challenge2.request.methodDetails;
112818
- const chainId = md?.chainId ?? 0;
112819
- const client = await getClient({ chainId });
113340
+ const chainId2 = md?.chainId ?? 0;
113341
+ const client = await getClient({ chainId: chainId2 });
112820
113342
  const action = context2.action;
112821
113343
  const { channelId: channelIdRaw, transaction, authorizedSigner: contextAuthorizedSigner } = context2;
112822
113344
  const authorizedSigner = contextAuthorizedSigner ?? getAuthorizedSigner(account);
112823
113345
  const channelId = channelIdRaw;
112824
113346
  const cumulativeAmount = context2.cumulativeAmountRaw ? BigInt(context2.cumulativeAmountRaw) : context2.cumulativeAmount ? parseUnits(context2.cumulativeAmount, decimals2) : void 0;
112825
113347
  const resolvedAdditionalDeposit = context2.additionalDepositRaw ? BigInt(context2.additionalDepositRaw) : context2.additionalDeposit ? parseUnits(context2.additionalDeposit, decimals2) : void 0;
112826
- const escrowContract2 = resolveEscrowCached(challenge2, chainId, channelId);
113348
+ const escrowContract2 = resolveEscrowCached(challenge2, chainId2, channelId);
112827
113349
  escrowContractMap.set(channelId, escrowContract2);
112828
113350
  let payload;
112829
113351
  switch (action) {
@@ -112832,7 +113354,7 @@ function session2(parameters = {}) {
112832
113354
  throw new Error("transaction required for open action");
112833
113355
  if (cumulativeAmount === void 0)
112834
113356
  throw new Error("cumulativeAmount required for open action");
112835
- const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount }, escrowContract2, chainId, authorizedSigner);
113357
+ const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount }, escrowContract2, chainId2, authorizedSigner);
112836
113358
  payload = {
112837
113359
  action: "open",
112838
113360
  type: "transaction",
@@ -112860,7 +113382,7 @@ function session2(parameters = {}) {
112860
113382
  case "voucher": {
112861
113383
  if (cumulativeAmount === void 0)
112862
113384
  throw new Error("cumulativeAmount required for voucher action");
112863
- payload = await createVoucherPayload(client, account, channelId, cumulativeAmount, escrowContract2, chainId, authorizedSigner);
113385
+ payload = await createVoucherPayload(client, account, channelId, cumulativeAmount, escrowContract2, chainId2, authorizedSigner);
112864
113386
  const key = channelIdToKey.get(channelId);
112865
113387
  if (key) {
112866
113388
  const entry = channels.get(key);
@@ -112874,7 +113396,7 @@ function session2(parameters = {}) {
112874
113396
  case "close": {
112875
113397
  if (cumulativeAmount === void 0)
112876
113398
  throw new Error("cumulativeAmount required for close action");
112877
- const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount }, escrowContract2, chainId, authorizedSigner);
113399
+ const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount }, escrowContract2, chainId2, authorizedSigner);
112878
113400
  payload = {
112879
113401
  action: "close",
112880
113402
  channelId,
@@ -112893,13 +113415,13 @@ function session2(parameters = {}) {
112893
113415
  break;
112894
113416
  }
112895
113417
  }
112896
- return serializeCredential(challenge2, payload, chainId, account);
113418
+ return serializeCredential(challenge2, payload, chainId2, account);
112897
113419
  }
112898
113420
  return toClient(session, {
112899
113421
  context: sessionContextSchema,
112900
113422
  async createCredential({ challenge: challenge2, context: context2 }) {
112901
- const chainId = challenge2.request.methodDetails?.chainId ?? 0;
112902
- const client = await getClient({ chainId });
113423
+ const chainId2 = challenge2.request.methodDetails?.chainId ?? 0;
113424
+ const client = await getClient({ chainId: chainId2 });
112903
113425
  const account = getAccount(client, context2);
112904
113426
  if (!context2?.action && (parameters.deposit !== void 0 || maxDeposit !== void 0))
112905
113427
  return autoManageCredential(challenge2, account, context2);
@@ -112910,19 +113432,22 @@ function session2(parameters = {}) {
112910
113432
  });
112911
113433
  }
112912
113434
 
112913
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/client/SessionManager.js
113435
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/client/SessionManager.js
112914
113436
  init_cjs_shims();
112915
113437
 
112916
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/client/internal/Fetch.js
113438
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/client/internal/Fetch.js
112917
113439
  init_cjs_shims();
113440
+ var MPPX_FETCH_WRAPPER = /* @__PURE__ */ Symbol.for("mppx.fetch.wrapper");
112918
113441
  var originalFetch;
112919
113442
  function from22(config2) {
112920
113443
  const { fetch: fetch2 = globalThis.fetch, methods, onChallenge } = config2;
112921
- return async (input, init) => {
112922
- const { context: context2, ...fetchInit } = init ?? {};
112923
- const response = await fetch2(input, fetchInit);
113444
+ const baseFetch = unwrapFetch(fetch2);
113445
+ const wrappedFetch = async (input, init) => {
113446
+ const response = await baseFetch(input, init);
112924
113447
  if (response.status !== 402)
112925
113448
  return response;
113449
+ const context2 = init?.context;
113450
+ const { context: _, ...fetchInit } = init ?? {};
112926
113451
  const challenge2 = fromResponse(response);
112927
113452
  const mi = methods.find((m) => m.name === challenge2.method && m.intent === challenge2.intent);
112928
113453
  if (!mi)
@@ -112931,38 +113456,83 @@ function from22(config2) {
112931
113456
  createCredential: async (overrideContext) => resolveCredential(challenge2, mi, overrideContext ?? context2)
112932
113457
  }) : void 0;
112933
113458
  const credential = onChallengeCredential ?? await resolveCredential(challenge2, mi, context2);
112934
- return fetch2(input, {
113459
+ validateCredentialHeaderValue(credential);
113460
+ return baseFetch(input, {
112935
113461
  ...fetchInit,
112936
- headers: {
112937
- ...fetchInit.headers,
112938
- Authorization: credential
112939
- }
113462
+ headers: withAuthorizationHeader(fetchInit.headers, credential)
112940
113463
  });
112941
113464
  };
113465
+ wrappedFetch[MPPX_FETCH_WRAPPER] = baseFetch;
113466
+ return wrappedFetch;
112942
113467
  }
112943
113468
  function polyfill(config2) {
112944
- originalFetch = globalThis.fetch;
112945
- globalThis.fetch = from22(config2);
113469
+ const descriptor = Object.getOwnPropertyDescriptor(globalThis, "fetch");
113470
+ if (!descriptor || !descriptor.writable && !descriptor.set) {
113471
+ throw new Error("globalThis.fetch is not writable");
113472
+ }
113473
+ if (!originalFetch)
113474
+ originalFetch = globalThis.fetch;
113475
+ globalThis.fetch = from22({ ...config2, fetch: globalThis.fetch });
112946
113476
  }
112947
113477
  function restore() {
112948
- if (originalFetch) {
113478
+ if (originalFetch && isWrappedFetch(globalThis.fetch)) {
112949
113479
  globalThis.fetch = originalFetch;
112950
113480
  originalFetch = void 0;
112951
113481
  }
112952
113482
  }
113483
+ function normalizeHeaders(headers) {
113484
+ if (!headers)
113485
+ return {};
113486
+ if (headers instanceof Headers) {
113487
+ const result = {};
113488
+ headers.forEach((value, key) => {
113489
+ result[key] = value;
113490
+ });
113491
+ return result;
113492
+ }
113493
+ if (Array.isArray(headers))
113494
+ return Object.fromEntries(headers);
113495
+ return headers;
113496
+ }
113497
+ function withAuthorizationHeader(headers, credential) {
113498
+ const normalized = normalizeHeaders(headers);
113499
+ for (const key of Object.keys(normalized)) {
113500
+ if (key.toLowerCase() === "authorization")
113501
+ delete normalized[key];
113502
+ }
113503
+ normalized.Authorization = credential;
113504
+ return normalized;
113505
+ }
113506
+ function unwrapFetch(fetch2) {
113507
+ let current = fetch2;
113508
+ while (current[MPPX_FETCH_WRAPPER]) {
113509
+ current = current[MPPX_FETCH_WRAPPER];
113510
+ }
113511
+ return current;
113512
+ }
113513
+ function isWrappedFetch(fetch2) {
113514
+ return Boolean(fetch2[MPPX_FETCH_WRAPPER]);
113515
+ }
113516
+ function validateCredentialHeaderValue(credential) {
113517
+ if (!credential.trim())
113518
+ throw new Error("Credential header value must be non-empty");
113519
+ if (credential.includes("\r") || credential.includes("\n")) {
113520
+ throw new Error("Credential header value contains illegal newline characters");
113521
+ }
113522
+ }
112953
113523
  async function resolveCredential(challenge2, mi, context2) {
112954
113524
  const parsedContext = mi.context && context2 !== void 0 ? mi.context.parse(context2) : void 0;
112955
113525
  return mi.createCredential(parsedContext !== void 0 ? { challenge: challenge2, context: parsedContext } : { challenge: challenge2 });
112956
113526
  }
112957
113527
 
112958
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/session/Receipt.js
113528
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/session/Receipt.js
112959
113529
  init_cjs_shims();
112960
113530
  function deserializeSessionReceipt(encoded) {
112961
113531
  const json3 = Base64_exports.toString(encoded);
112962
113532
  return JSON.parse(json3);
112963
113533
  }
112964
113534
 
112965
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/session/Sse.js
113535
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/session/Sse.js
112966
113536
  init_cjs_shims();
112967
113537
  function parseEvent(raw) {
112968
113538
  let eventType = "message";
@@ -112991,7 +113561,7 @@ function parseEvent(raw) {
112991
113561
  }
112992
113562
  }
112993
113563
 
112994
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/client/SessionManager.js
113564
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/client/SessionManager.js
112995
113565
  function sessionManager(parameters) {
112996
113566
  const fetchFn = parameters.fetch ?? globalThis.fetch;
112997
113567
  let channel = null;
@@ -113166,7 +113736,7 @@ function sessionManager(parameters) {
113166
113736
  return self2;
113167
113737
  }
113168
113738
 
113169
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/tempo/client/Methods.js
113739
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/client/Methods.js
113170
113740
  function tempo2(parameters = {}) {
113171
113741
  return [charge2(parameters), session2(parameters)];
113172
113742
  }
@@ -113175,7 +113745,7 @@ function tempo2(parameters = {}) {
113175
113745
  tempo3.session = sessionManager;
113176
113746
  })(tempo2 || (tempo2 = {}));
113177
113747
 
113178
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/client/Mppx.js
113748
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/client/Mppx.js
113179
113749
  var Mppx_exports = {};
113180
113750
  __export(Mppx_exports, {
113181
113751
  create: () => create4,
@@ -113183,7 +113753,7 @@ __export(Mppx_exports, {
113183
113753
  });
113184
113754
  init_cjs_shims();
113185
113755
 
113186
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/client/Transport.js
113756
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/client/Transport.js
113187
113757
  init_cjs_shims();
113188
113758
  function from23(transport) {
113189
113759
  return transport;
@@ -113205,7 +113775,7 @@ function http2() {
113205
113775
  });
113206
113776
  }
113207
113777
 
113208
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/client/Mppx.js
113778
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/client/Mppx.js
113209
113779
  function create4(config2) {
113210
113780
  const { onChallenge, polyfill: polyfill2 = true, transport = http2() } = config2;
113211
113781
  const methods = config2.methods.flat();
@@ -113243,7 +113813,7 @@ var import_path2 = require("path");
113243
113813
  var import_url = require("url");
113244
113814
  function getVersion2() {
113245
113815
  if (true) {
113246
- return "0.6.8";
113816
+ return "0.6.10";
113247
113817
  }
113248
113818
  const __dirname3 = (0, import_path2.dirname)((0, import_url.fileURLToPath)(importMetaUrl));
113249
113819
  const pkg = JSON.parse(
@@ -113406,7 +113976,7 @@ var TEMPO_TOKEN_ADDRESS = "0x20c0000000000000000000000000000000000000";
113406
113976
 
113407
113977
  // src/shared/mpp-enabled.ts
113408
113978
  init_cjs_shims();
113409
- var isMppEnabled = () => "0.6.8".includes("-mpp");
113979
+ var isMppEnabled = () => "0.6.10".includes("-mpp");
113410
113980
 
113411
113981
  // src/shared/operations/fetch-with-payment.ts
113412
113982
  init_cjs_shims();
@@ -113473,10 +114043,10 @@ var safeCreateSIWxPayload = (surface2, serverInfo, signer) => {
113473
114043
  // src/shared/neverthrow/mpp/index.ts
113474
114044
  init_cjs_shims();
113475
114045
 
113476
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/index.js
114046
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/index.js
113477
114047
  init_cjs_shims();
113478
114048
 
113479
- // ../../../node_modules/.pnpm/mppx@0.3.4_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_typesc_35267a5c5eeb13056e8574ba797574c2/node_modules/mppx/dist/Receipt.js
114049
+ // ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/Receipt.js
113480
114050
  var Receipt_exports = {};
113481
114051
  __export(Receipt_exports, {
113482
114052
  Schema: () => Schema2,
@@ -114107,19 +114677,19 @@ var baseOpen = async (options) => {
114107
114677
  }
114108
114678
  const subprocess = import_node_child_process7.default.spawn(command, cliArguments, childProcessOptions);
114109
114679
  if (options.wait) {
114110
- return new Promise((resolve, reject) => {
114680
+ return new Promise((resolve2, reject) => {
114111
114681
  subprocess.once("error", reject);
114112
114682
  subprocess.once("close", (exitCode) => {
114113
114683
  if (!options.allowNonzeroExitCode && exitCode !== 0) {
114114
114684
  reject(new Error(`Exited with code ${exitCode}`));
114115
114685
  return;
114116
114686
  }
114117
- resolve(subprocess);
114687
+ resolve2(subprocess);
114118
114688
  });
114119
114689
  });
114120
114690
  }
114121
114691
  if (isFallbackAttempt) {
114122
- return new Promise((resolve, reject) => {
114692
+ return new Promise((resolve2, reject) => {
114123
114693
  subprocess.once("error", reject);
114124
114694
  subprocess.once("spawn", () => {
114125
114695
  subprocess.once("close", (exitCode) => {
@@ -114129,17 +114699,17 @@ var baseOpen = async (options) => {
114129
114699
  return;
114130
114700
  }
114131
114701
  subprocess.unref();
114132
- resolve(subprocess);
114702
+ resolve2(subprocess);
114133
114703
  });
114134
114704
  });
114135
114705
  });
114136
114706
  }
114137
114707
  subprocess.unref();
114138
- return new Promise((resolve, reject) => {
114708
+ return new Promise((resolve2, reject) => {
114139
114709
  subprocess.once("error", reject);
114140
114710
  subprocess.once("spawn", () => {
114141
114711
  subprocess.off("error", reject);
114142
- resolve(subprocess);
114712
+ resolve2(subprocess);
114143
114713
  });
114144
114714
  });
114145
114715
  };
@@ -114356,15 +114926,15 @@ async function pickByBalance(surface2, response, options) {
114356
114926
  let mppBalance = 0;
114357
114927
  const challengeResult = safeGetMppChallenge(surface2, response);
114358
114928
  if (challengeResult.isOk()) {
114359
- const currency = challengeResult.value.request.currency;
114929
+ const currency2 = challengeResult.value.request.currency;
114360
114930
  const decimals2 = challengeResult.value.request.decimals ?? 6;
114361
- if (currency) {
114931
+ if (currency2) {
114362
114932
  const tempoResult = await resultFromPromise(
114363
114933
  "tempo",
114364
114934
  surface2,
114365
114935
  getTempoBalance({
114366
114936
  address: account.address,
114367
- tokenAddress: currency
114937
+ tokenAddress: currency2
114368
114938
  }),
114369
114939
  () => ({
114370
114940
  cause: "tempo_balance",
@@ -114479,8 +115049,8 @@ async function handleMppPayment(surface2, response, clonedRequest, options) {
114479
115049
  const challenge2 = challengeResult.value;
114480
115050
  const amount2 = challenge2.request.amount;
114481
115051
  const decimals2 = challenge2.request.decimals ?? 6;
114482
- const currency = challenge2.request.currency;
114483
- if (beforePayment && amount2 && currency) {
115052
+ const currency2 = challenge2.request.currency;
115053
+ if (beforePayment && amount2 && currency2) {
114484
115054
  const numericAmount = Number(formatUnits(BigInt(amount2), decimals2));
114485
115055
  const hookResult = await resultFromPromise(
114486
115056
  "mpp",
@@ -114488,7 +115058,7 @@ async function handleMppPayment(surface2, response, clonedRequest, options) {
114488
115058
  beforePayment({
114489
115059
  protocol: "mpp",
114490
115060
  amount: numericAmount,
114491
- currency,
115061
+ currency: currency2,
114492
115062
  network: `tempo:${challenge2.method}`
114493
115063
  }),
114494
115064
  (e) => ({
@@ -115531,15 +116101,15 @@ async function probeMethod({
115531
116101
  }
115532
116102
  if (isMppEnabled() && protocols.includes("mpp")) {
115533
116103
  for (const challenge2 of parseMppChallenges(response)) {
115534
- const currency = challenge2.request.currency;
116104
+ const currency2 = challenge2.request.currency;
115535
116105
  const amount2 = challenge2.request.amount;
115536
116106
  const decimals2 = challenge2.request.decimals ?? 6;
115537
116107
  const recipient = challenge2.request.recipient;
115538
116108
  const methodDetails = challenge2.request.methodDetails;
115539
- const chainId = methodDetails?.chainId ?? TEMPO_DEFAULT_CHAIN_ID;
115540
- const network = `tempo:${String(chainId)}`;
116109
+ const chainId2 = methodDetails?.chainId ?? TEMPO_DEFAULT_CHAIN_ID;
116110
+ const network = `tempo:${String(chainId2)}`;
115541
116111
  const description = challenge2.description ?? schema?.summary;
115542
- if (amount2 && currency) {
116112
+ if (amount2 && currency2) {
115543
116113
  paymentOptions.push({
115544
116114
  protocol: "mpp",
115545
116115
  paymentMethod: challenge2.method,
@@ -115547,7 +116117,7 @@ async function probeMethod({
115547
116117
  realm: challenge2.realm,
115548
116118
  price: tokenStringToNumber(amount2, decimals2),
115549
116119
  network,
115550
- asset: currency,
116120
+ asset: currency2,
115551
116121
  ...recipient ? { recipient } : {},
115552
116122
  ...description ? { description } : {}
115553
116123
  });
@@ -116596,7 +117166,7 @@ var import_path3 = require("path");
116596
117166
  var import_url2 = require("url");
116597
117167
  function getVersion3() {
116598
117168
  if (true) {
116599
- return "0.6.8";
117169
+ return "0.6.10";
116600
117170
  }
116601
117171
  const __dirname3 = (0, import_path3.dirname)((0, import_url2.fileURLToPath)(importMetaUrl));
116602
117172
  const pkg = JSON.parse(