@t2000/cli 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.
@@ -79959,7 +79959,7 @@ var TX_NODE_FRAGMENT = `
79959
79959
  }
79960
79960
  `;
79961
79961
  var HISTORY_QUERY = `query History($address: SuiAddress!, $last: Int!) {
79962
- transactions(last: $last, filter: { sentAddress: $address }) {
79962
+ transactions(last: $last, filter: { affectedAddress: $address }) {
79963
79963
  nodes {${TX_NODE_FRAGMENT}}
79964
79964
  }
79965
79965
  }`;
@@ -80029,7 +80029,9 @@ function buildRecord(args) {
80029
80029
  return { digest, action, label, legs, amount, asset, recipient, direction, timestamp: timestampMs, gasCost };
80030
80030
  }
80031
80031
  init_token_registry();
80032
- var SUI_MAINNET_URL = "https://fullnode.mainnet.sui.io:443";
80032
+ var RESOLVE_NAME_QUERY = `query ResolveSuins($name: String!) {
80033
+ address(name: $name) { address }
80034
+ }`;
80033
80035
  var SUI_ADDRESS_REGEX = /^0x[a-fA-F0-9]{1,64}$/i;
80034
80036
  var SUINS_NAME_REGEX = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.sui$/;
80035
80037
  var InvalidAddressError = class extends Error {
@@ -80066,38 +80068,22 @@ async function resolveSuinsViaRpc(rawName, ctx = {}) {
80066
80068
  if (!SUINS_NAME_REGEX.test(name)) {
80067
80069
  throw new InvalidAddressError(rawName);
80068
80070
  }
80069
- const url2 = ctx.suiRpcUrl || SUI_MAINNET_URL;
80071
+ const gql = getSuiGraphQLClient();
80070
80072
  let res;
80071
80073
  try {
80072
- res = await fetch(url2, {
80073
- method: "POST",
80074
- headers: { "Content-Type": "application/json" },
80075
- body: JSON.stringify({
80076
- jsonrpc: "2.0",
80077
- id: 1,
80078
- method: "suix_resolveNameServiceAddress",
80079
- params: [name]
80080
- }),
80081
- signal: ctx.signal ?? AbortSignal.timeout(8e3)
80074
+ res = await gql.query({
80075
+ query: RESOLVE_NAME_QUERY,
80076
+ variables: { name },
80077
+ signal: ctx.signal
80082
80078
  });
80083
80079
  } catch (err) {
80084
80080
  const msg = err instanceof Error ? err.message : String(err);
80085
80081
  throw new SuinsRpcError(name, msg);
80086
80082
  }
80087
- if (!res.ok) {
80088
- throw new SuinsRpcError(name, `HTTP ${res.status}`);
80089
- }
80090
- let body;
80091
- try {
80092
- body = await res.json();
80093
- } catch (err) {
80094
- const msg = err instanceof Error ? err.message : String(err);
80095
- throw new SuinsRpcError(name, `JSON parse failed: ${msg}`);
80096
- }
80097
- if (body.error) {
80098
- throw new SuinsRpcError(name, body.error.message);
80083
+ if (res.errors?.length) {
80084
+ throw new SuinsRpcError(name, res.errors.map((e) => e.message ?? "unknown error").join("; "));
80099
80085
  }
80100
- return body.result ?? null;
80086
+ return res.data?.address?.address ?? null;
80101
80087
  }
80102
80088
  init_errors3();
80103
80089
  var DEFAULT_CONFIG_DIR = join$1(homedir(), ".t2000");
@@ -81088,7 +81074,7 @@ Through this wallet you can reach essentially any major external API, billed to
81088
81074
  CRITICAL: When the user asks to use any external or paid API, names a provider (e.g. "via fal.ai", "with ElevenLabs"), or requests a capability one of the services above provides, DO NOT say you cannot reach that service, that it isn't on an allowlist, or that there's no connector \u2014 and do NOT fall back to writing a script for the user to run. You CAN do it directly through this wallet. Use t2000_services to discover the endpoint and request shape, then t2000_pay to execute, then show the user the result (display image/audio URLs returned in the response).
81089
81075
 
81090
81076
  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.`;
81091
- var PKG_VERSION = "5.5.0";
81077
+ var PKG_VERSION = "5.5.1";
81092
81078
  console.log = (...args) => console.error("[log]", ...args);
81093
81079
  console.warn = (...args) => console.error("[warn]", ...args);
81094
81080
  async function startMcpServer(opts) {
@@ -81154,4 +81140,4 @@ mime-types/index.js:
81154
81140
  @scure/bip39/index.js:
81155
81141
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
81156
81142
  */
81157
- //# sourceMappingURL=dist-4JZ33TE5.js.map
81143
+ //# sourceMappingURL=dist-OMYCTHXH.js.map