@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 +13 -27
- package/dist/bin.js.map +1 -1
- package/dist/index.js +13 -27
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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: {
|
|
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
|
|
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
|
|
80065
|
+
const gql = getSuiGraphQLClient();
|
|
80064
80066
|
let res;
|
|
80065
80067
|
try {
|
|
80066
|
-
res = await
|
|
80067
|
-
|
|
80068
|
-
|
|
80069
|
-
|
|
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 (
|
|
80082
|
-
throw new SuinsRpcError(name,
|
|
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
|
|
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.
|
|
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) {
|