@x402scan/mcp 0.0.7-beta.2 → 0.0.7-beta.4

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.
@@ -80361,10 +80361,10 @@ var tokenStringToNumber = (amount, decimals = 6) => {
80361
80361
  // src/shared/neverthrow/x402/index.ts
80362
80362
  init_cjs_shims();
80363
80363
 
80364
- // ../../internal/siwx/dist/index.js
80364
+ // ../siwx/dist/index.js
80365
80365
  init_cjs_shims();
80366
80366
 
80367
- // ../../internal/siwx/dist/chunk-Q7X3LYWB.js
80367
+ // ../siwx/dist/chunk-Q7X3LYWB.js
80368
80368
  init_cjs_shims();
80369
80369
 
80370
80370
  // ../../../node_modules/.pnpm/@scure+base@2.0.0/node_modules/@scure/base/index.js
@@ -80520,7 +80520,7 @@ function radix(num) {
80520
80520
  var genBase58 = /* @__NO_SIDE_EFFECTS__ */ (abc) => /* @__PURE__ */ chain(/* @__PURE__ */ radix(58), /* @__PURE__ */ alphabet(abc), /* @__PURE__ */ join2(""));
80521
80521
  var base58 = /* @__PURE__ */ genBase58("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");
80522
80522
 
80523
- // ../../internal/siwx/dist/chunk-Q7X3LYWB.js
80523
+ // ../siwx/dist/chunk-Q7X3LYWB.js
80524
80524
  var import_tweetnacl = __toESM(require_nacl_fast(), 1);
80525
80525
  var import_siwe = __toESM(require_siwe(), 1);
80526
80526
  function extractSolanaChainReference(chainId) {
@@ -80649,7 +80649,7 @@ async function createSIWxPayload(serverExtension, signer) {
80649
80649
  };
80650
80650
  }
80651
80651
 
80652
- // ../../internal/siwx/dist/chunk-YNVCLHEE.js
80652
+ // ../siwx/dist/chunk-YNVCLHEE.js
80653
80653
  init_cjs_shims();
80654
80654
  var SIWxPayloadSchema = external_exports3.object({
80655
80655
  domain: external_exports3.string(),
@@ -80672,7 +80672,7 @@ var SIWxPayloadSchema = external_exports3.object({
80672
80672
  // ../../../node_modules/.pnpm/@x402+core@2.2.0/node_modules/@x402/core/dist/esm/utils/index.mjs
80673
80673
  init_cjs_shims();
80674
80674
 
80675
- // ../../internal/siwx/dist/index.js
80675
+ // ../siwx/dist/index.js
80676
80676
  var DEFAULT_MAX_AGE_MS = 5 * 60 * 1e3;
80677
80677
  function encodeSIWxHeader(payload) {
80678
80678
  return safeBase64Encode(JSON.stringify(payload));
@@ -81168,7 +81168,7 @@ var import_path2 = require("path");
81168
81168
  var import_url = require("url");
81169
81169
  function getVersion() {
81170
81170
  if (true) {
81171
- return "0.0.7-beta.2";
81171
+ return "0.0.7-beta.4";
81172
81172
  }
81173
81173
  const __dirname3 = (0, import_path2.dirname)((0, import_url.fileURLToPath)(importMetaUrl));
81174
81174
  const pkg = JSON.parse(
@@ -0,0 +1,47 @@
1
+ import {
2
+ getBaseUrl,
3
+ safeFetchJson
4
+ } from "./chunk-JXXC6FYE.js";
5
+
6
+ // src/server/lib/version.ts
7
+ import { readFileSync } from "fs";
8
+ import { dirname, join } from "path";
9
+ import { fileURLToPath } from "url";
10
+ function getVersion() {
11
+ if (true) {
12
+ return "0.0.7-beta.4";
13
+ }
14
+ const __dirname2 = dirname(fileURLToPath(import.meta.url));
15
+ const pkg = JSON.parse(
16
+ readFileSync(join(__dirname2, "../../../package.json"), "utf-8")
17
+ );
18
+ return pkg.version;
19
+ }
20
+ var MCP_VERSION = getVersion();
21
+ var DIST_TAG = MCP_VERSION.includes("-beta") ? "beta" : "latest";
22
+
23
+ // src/shared/balance.ts
24
+ var getBalance = async ({
25
+ address,
26
+ flags,
27
+ surface
28
+ }) => {
29
+ const url = `${getBaseUrl(flags.dev)}/api/rpc/balance/${address}`;
30
+ const res = await safeFetchJson(
31
+ surface,
32
+ new Request(url, {
33
+ method: "GET",
34
+ headers: {
35
+ accept: "application/json"
36
+ }
37
+ })
38
+ );
39
+ return res;
40
+ };
41
+
42
+ export {
43
+ getBalance,
44
+ MCP_VERSION,
45
+ DIST_TAG
46
+ };
47
+ //# sourceMappingURL=chunk-2UP5W5MC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/server/lib/version.ts","../../src/shared/balance.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { fileURLToPath } from 'url';\n\ndeclare const __MCP_VERSION__: string | undefined;\n\nfunction getVersion(): string {\n if (typeof __MCP_VERSION__ !== 'undefined') {\n return __MCP_VERSION__;\n }\n // Fallback for dev mode (tsx)\n const __dirname = dirname(fileURLToPath(import.meta.url));\n const pkg = JSON.parse(\n readFileSync(join(__dirname, '../../../package.json'), 'utf-8')\n ) as { version: string };\n return pkg.version;\n}\n\nexport const MCP_VERSION = getVersion();\n\nexport const DIST_TAG = MCP_VERSION.includes('-beta') ? 'beta' : 'latest';\n","import { getBaseUrl } from '@/shared/utils';\nimport { safeFetchJson } from '@/shared/neverthrow/fetch';\n\nimport type { Address } from 'viem';\nimport type { GlobalFlags } from '@/types';\n\ninterface BalanceApiResponse {\n chain: number;\n balance: number;\n}\n\ninterface GetBalanceProps {\n address: Address;\n flags: GlobalFlags;\n surface: string;\n}\n\nexport const getBalance = async ({\n address,\n flags,\n surface,\n}: GetBalanceProps) => {\n const url = `${getBaseUrl(flags.dev)}/api/rpc/balance/${address}`;\n\n const res = await safeFetchJson<BalanceApiResponse>(\n surface,\n new Request(url, {\n method: 'GET',\n headers: {\n accept: 'application/json',\n },\n })\n );\n\n return res;\n};\n"],"mappings":";;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS,YAAY;AAC9B,SAAS,qBAAqB;AAI9B,SAAS,aAAqB;AAC5B,MAAI,MAAwC;AAC1C,WAAO;AAAA,EACT;AAEA,QAAMA,aAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AACxD,QAAM,MAAM,KAAK;AAAA,IACf,aAAa,KAAKA,YAAW,uBAAuB,GAAG,OAAO;AAAA,EAChE;AACA,SAAO,IAAI;AACb;AAEO,IAAM,cAAc,WAAW;AAE/B,IAAM,WAAW,YAAY,SAAS,OAAO,IAAI,SAAS;;;ACH1D,IAAM,aAAa,OAAO;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACrB,QAAM,MAAM,GAAG,WAAW,MAAM,GAAG,CAAC,oBAAoB,OAAO;AAE/D,QAAM,MAAM,MAAM;AAAA,IAChB;AAAA,IACA,IAAI,QAAQ,KAAK;AAAA,MACf,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,QAAQ;AAAA,MACV;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;","names":["__dirname"]}