@t2000/mcp 5.5.0 → 5.5.1

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.
package/dist/bin.js CHANGED
@@ -79953,7 +79953,7 @@ var TX_NODE_FRAGMENT = `
79953
79953
  }
79954
79954
  `;
79955
79955
  var HISTORY_QUERY = `query History($address: SuiAddress!, $last: Int!) {
79956
- transactions(last: $last, filter: { sentAddress: $address }) {
79956
+ transactions(last: $last, filter: { affectedAddress: $address }) {
79957
79957
  nodes {${TX_NODE_FRAGMENT}}
79958
79958
  }
79959
79959
  }`;
@@ -80023,7 +80023,9 @@ function buildRecord(args) {
80023
80023
  return { digest, action, label, legs, amount, asset, recipient, direction, timestamp: timestampMs, gasCost };
80024
80024
  }
80025
80025
  init_token_registry();
80026
- var SUI_MAINNET_URL = "https://fullnode.mainnet.sui.io:443";
80026
+ var RESOLVE_NAME_QUERY = `query ResolveSuins($name: String!) {
80027
+ address(name: $name) { address }
80028
+ }`;
80027
80029
  var SUI_ADDRESS_REGEX = /^0x[a-fA-F0-9]{1,64}$/i;
80028
80030
  var SUINS_NAME_REGEX = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.sui$/;
80029
80031
  var InvalidAddressError = class extends Error {
@@ -80060,38 +80062,22 @@ async function resolveSuinsViaRpc(rawName, ctx = {}) {
80060
80062
  if (!SUINS_NAME_REGEX.test(name)) {
80061
80063
  throw new InvalidAddressError(rawName);
80062
80064
  }
80063
- const url2 = ctx.suiRpcUrl || SUI_MAINNET_URL;
80065
+ const gql = getSuiGraphQLClient();
80064
80066
  let res;
80065
80067
  try {
80066
- res = await fetch(url2, {
80067
- method: "POST",
80068
- headers: { "Content-Type": "application/json" },
80069
- body: JSON.stringify({
80070
- jsonrpc: "2.0",
80071
- id: 1,
80072
- method: "suix_resolveNameServiceAddress",
80073
- params: [name]
80074
- }),
80075
- signal: ctx.signal ?? AbortSignal.timeout(8e3)
80068
+ res = await gql.query({
80069
+ query: RESOLVE_NAME_QUERY,
80070
+ variables: { name },
80071
+ signal: ctx.signal
80076
80072
  });
80077
80073
  } catch (err) {
80078
80074
  const msg = err instanceof Error ? err.message : String(err);
80079
80075
  throw new SuinsRpcError(name, msg);
80080
80076
  }
80081
- if (!res.ok) {
80082
- throw new SuinsRpcError(name, `HTTP ${res.status}`);
80083
- }
80084
- let body;
80085
- try {
80086
- body = await res.json();
80087
- } catch (err) {
80088
- const msg = err instanceof Error ? err.message : String(err);
80089
- throw new SuinsRpcError(name, `JSON parse failed: ${msg}`);
80090
- }
80091
- if (body.error) {
80092
- throw new SuinsRpcError(name, body.error.message);
80077
+ if (res.errors?.length) {
80078
+ throw new SuinsRpcError(name, res.errors.map((e) => e.message ?? "unknown error").join("; "));
80093
80079
  }
80094
- return body.result ?? null;
80080
+ return res.data?.address?.address ?? null;
80095
80081
  }
80096
80082
  init_errors3();
80097
80083
  var DEFAULT_CONFIG_DIR = join$1(homedir(), ".t2000");
@@ -81104,7 +81090,7 @@ CRITICAL: When the user asks to use any external or paid API, names a provider (
81104
81090
  Spending is the user's own USDC and every t2000_pay call is bounded by maxPrice. For larger or multi-step spends, state the estimated cost first and proceed once the user is happy. Use t2000_balance to check funds. The v4 wallet is payments-only; savings / lending live on audric.ai.`;
81105
81091
 
81106
81092
  // src/index.ts
81107
- var PKG_VERSION = "5.5.0" ;
81093
+ var PKG_VERSION = "5.5.1" ;
81108
81094
  console.log = (...args) => console.error("[log]", ...args);
81109
81095
  console.warn = (...args) => console.error("[warn]", ...args);
81110
81096
  async function startMcpServer(opts) {