@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/index.js
CHANGED
|
@@ -79952,7 +79952,7 @@ var TX_NODE_FRAGMENT = `
|
|
|
79952
79952
|
}
|
|
79953
79953
|
`;
|
|
79954
79954
|
var HISTORY_QUERY = `query History($address: SuiAddress!, $last: Int!) {
|
|
79955
|
-
transactions(last: $last, filter: {
|
|
79955
|
+
transactions(last: $last, filter: { affectedAddress: $address }) {
|
|
79956
79956
|
nodes {${TX_NODE_FRAGMENT}}
|
|
79957
79957
|
}
|
|
79958
79958
|
}`;
|
|
@@ -80022,7 +80022,9 @@ function buildRecord(args) {
|
|
|
80022
80022
|
return { digest, action, label, legs, amount, asset, recipient, direction, timestamp: timestampMs, gasCost };
|
|
80023
80023
|
}
|
|
80024
80024
|
init_token_registry();
|
|
80025
|
-
var
|
|
80025
|
+
var RESOLVE_NAME_QUERY = `query ResolveSuins($name: String!) {
|
|
80026
|
+
address(name: $name) { address }
|
|
80027
|
+
}`;
|
|
80026
80028
|
var SUI_ADDRESS_REGEX = /^0x[a-fA-F0-9]{1,64}$/i;
|
|
80027
80029
|
var SUINS_NAME_REGEX = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.sui$/;
|
|
80028
80030
|
var InvalidAddressError = class extends Error {
|
|
@@ -80059,38 +80061,22 @@ async function resolveSuinsViaRpc(rawName, ctx = {}) {
|
|
|
80059
80061
|
if (!SUINS_NAME_REGEX.test(name)) {
|
|
80060
80062
|
throw new InvalidAddressError(rawName);
|
|
80061
80063
|
}
|
|
80062
|
-
const
|
|
80064
|
+
const gql = getSuiGraphQLClient();
|
|
80063
80065
|
let res;
|
|
80064
80066
|
try {
|
|
80065
|
-
res = await
|
|
80066
|
-
|
|
80067
|
-
|
|
80068
|
-
|
|
80069
|
-
jsonrpc: "2.0",
|
|
80070
|
-
id: 1,
|
|
80071
|
-
method: "suix_resolveNameServiceAddress",
|
|
80072
|
-
params: [name]
|
|
80073
|
-
}),
|
|
80074
|
-
signal: ctx.signal ?? AbortSignal.timeout(8e3)
|
|
80067
|
+
res = await gql.query({
|
|
80068
|
+
query: RESOLVE_NAME_QUERY,
|
|
80069
|
+
variables: { name },
|
|
80070
|
+
signal: ctx.signal
|
|
80075
80071
|
});
|
|
80076
80072
|
} catch (err) {
|
|
80077
80073
|
const msg = err instanceof Error ? err.message : String(err);
|
|
80078
80074
|
throw new SuinsRpcError(name, msg);
|
|
80079
80075
|
}
|
|
80080
|
-
if (
|
|
80081
|
-
throw new SuinsRpcError(name,
|
|
80082
|
-
}
|
|
80083
|
-
let body;
|
|
80084
|
-
try {
|
|
80085
|
-
body = await res.json();
|
|
80086
|
-
} catch (err) {
|
|
80087
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
80088
|
-
throw new SuinsRpcError(name, `JSON parse failed: ${msg}`);
|
|
80089
|
-
}
|
|
80090
|
-
if (body.error) {
|
|
80091
|
-
throw new SuinsRpcError(name, body.error.message);
|
|
80076
|
+
if (res.errors?.length) {
|
|
80077
|
+
throw new SuinsRpcError(name, res.errors.map((e) => e.message ?? "unknown error").join("; "));
|
|
80092
80078
|
}
|
|
80093
|
-
return
|
|
80079
|
+
return res.data?.address?.address ?? null;
|
|
80094
80080
|
}
|
|
80095
80081
|
init_errors3();
|
|
80096
80082
|
var DEFAULT_CONFIG_DIR = join$1(homedir(), ".t2000");
|
|
@@ -81103,7 +81089,7 @@ CRITICAL: When the user asks to use any external or paid API, names a provider (
|
|
|
81103
81089
|
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.`;
|
|
81104
81090
|
|
|
81105
81091
|
// src/index.ts
|
|
81106
|
-
var PKG_VERSION = "5.5.
|
|
81092
|
+
var PKG_VERSION = "5.5.1" ;
|
|
81107
81093
|
console.log = (...args) => console.error("[log]", ...args);
|
|
81108
81094
|
console.warn = (...args) => console.error("[warn]", ...args);
|
|
81109
81095
|
async function startMcpServer(opts) {
|