@toon-protocol/client-mcp 0.20.2 → 0.20.3
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/{chunk-IAOKAQLA.js → chunk-FDUYHYB2.js} +2 -2
- package/dist/{chunk-IAOKAQLA.js.map → chunk-FDUYHYB2.js.map} +1 -1
- package/dist/{chunk-UPIAVE44.js → chunk-LRHUY3PO.js} +95 -23
- package/dist/chunk-LRHUY3PO.js.map +1 -0
- package/dist/{chunk-WS3GVRQJ.js → chunk-R3KZIPBQ.js} +3 -3
- package/dist/{chunk-WS3GVRQJ.js.map → chunk-R3KZIPBQ.js.map} +1 -1
- package/dist/{chunk-ZKSFO7M3.js → chunk-UITLRZ7O.js} +2 -2
- package/dist/daemon.js +3 -3
- package/dist/index.js +4 -4
- package/dist/mcp.js +3 -3
- package/dist/{node-WPA2UDEH-RCLJ66AU.js → node-WPA2UDEH-HZP3B4FH.js} +3 -3
- package/dist/{node-WPA2UDEH-RCLJ66AU.js.map → node-WPA2UDEH-HZP3B4FH.js.map} +1 -1
- package/package.json +5 -5
- package/dist/chunk-UPIAVE44.js.map +0 -1
- /package/dist/{chunk-ZKSFO7M3.js.map → chunk-UITLRZ7O.js.map} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__require
|
|
4
4
|
} from "./chunk-I7TGLGN6.js";
|
|
5
5
|
|
|
6
|
-
// ../../node_modules/.pnpm/@toon-protocol+sdk@3.1.
|
|
6
|
+
// ../../node_modules/.pnpm/@toon-protocol+sdk@3.1.2_mina-signer@3.1.0_typescript@5.9.3/node_modules/@toon-protocol/sdk/dist/chunk-UP2VWCW5.js
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
9
|
var __require2 = /* @__PURE__ */ ((x) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
@@ -29,4 +29,4 @@ export {
|
|
|
29
29
|
__commonJS,
|
|
30
30
|
__export
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
32
|
+
//# sourceMappingURL=chunk-FDUYHYB2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/@toon-protocol+sdk@3.1.
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/@toon-protocol+sdk@3.1.2_mina-signer@3.1.0_typescript@5.9.3/node_modules/@toon-protocol/sdk/dist/chunk-UP2VWCW5.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, {\n get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b]\n}) : x)(function(x) {\n if (typeof require !== \"undefined\") return require.apply(this, arguments);\n throw Error('Dynamic require of \"' + x + '\" is not supported');\n});\nvar __esm = (fn, res) => function __init() {\n return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;\n};\nvar __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\nexport {\n __require,\n __esm,\n __commonJS,\n __export,\n __toCommonJS\n};\n//# sourceMappingURL=chunk-UP2VWCW5.js.map"],"mappings":";;;;;;AAAA,IAAI,YAAY,OAAO;AAEvB,IAAI,oBAAoB,OAAO;AAE/B,IAAIA,aAA6B,kBAAC,MAAM,OAAO,cAAY,cAAc,YAAU,OAAO,UAAU,cAAc,IAAI,MAAM,GAAG;AAAA,EAC7H,KAAK,CAAC,GAAG,OAAO,OAAO,cAAY,cAAc,YAAU,GAAG,CAAC;AACjE,CAAC,IAAI,GAAG,SAAS,GAAG;AAClB,MAAI,OAAO,cAAY,YAAa,QAAO,UAAQ,MAAM,MAAM,SAAS;AACxE,QAAM,MAAM,yBAAyB,IAAI,oBAAoB;AAC/D,CAAC;AACD,IAAI,QAAQ,CAAC,IAAI,QAAQ,SAAS,SAAS;AACzC,SAAO,OAAO,OAAO,GAAG,GAAG,kBAAkB,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI;AAClE;AACA,IAAI,aAAa,CAAC,IAAI,QAAQ,SAASC,cAAa;AAClD,SAAO,QAAQ,GAAG,GAAG,kBAAkB,EAAE,EAAE,CAAC,CAAC,IAAI,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,GAAG,GAAG,IAAI;AAC7F;AACA,IAAI,WAAW,CAAC,QAAQ,QAAQ;AAC9B,WAAS,QAAQ;AACf,cAAU,QAAQ,MAAM,EAAE,KAAK,IAAI,IAAI,GAAG,YAAY,KAAK,CAAC;AAChE;","names":["__require","__require2"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __cr } from 'module'; const require = __cr(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
__require
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FDUYHYB2.js";
|
|
5
5
|
import {
|
|
6
6
|
HashMD,
|
|
7
7
|
rotlBH as rotlBH2,
|
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
utils
|
|
92
92
|
} from "./chunk-NL7NYWPC.js";
|
|
93
93
|
|
|
94
|
-
// ../../node_modules/.pnpm/@toon-protocol+core@3.1.
|
|
94
|
+
// ../../node_modules/.pnpm/@toon-protocol+core@3.1.2_typescript@5.9.3/node_modules/@toon-protocol/core/dist/chunk-5WT7ISKC.js
|
|
95
95
|
import { encode } from "@toon-format/toon";
|
|
96
96
|
import { decode } from "@toon-format/toon";
|
|
97
97
|
import { decode as decode2 } from "@toon-format/toon";
|
|
@@ -207,7 +207,7 @@ function decodeEventFromToon(data) {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
// ../../node_modules/.pnpm/@toon-protocol+core@3.1.
|
|
210
|
+
// ../../node_modules/.pnpm/@toon-protocol+core@3.1.2_typescript@5.9.3/node_modules/@toon-protocol/core/dist/index.js
|
|
211
211
|
import { finalizeEvent } from "nostr-tools/pure";
|
|
212
212
|
import { finalizeEvent as finalizeEvent2 } from "nostr-tools/pure";
|
|
213
213
|
import { finalizeEvent as finalizeEvent3 } from "nostr-tools/pure";
|
|
@@ -1719,7 +1719,7 @@ function recoverEvmSigner(digest, sig65) {
|
|
|
1719
1719
|
return "0x" + bytesToHex(addrHash.slice(-20)).toLowerCase();
|
|
1720
1720
|
}
|
|
1721
1721
|
|
|
1722
|
-
// ../../node_modules/.pnpm/@toon-protocol+core@3.1.
|
|
1722
|
+
// ../../node_modules/.pnpm/@toon-protocol+core@3.1.2_typescript@5.9.3/node_modules/@toon-protocol/core/dist/index.js
|
|
1723
1723
|
import { SimplePool as SimplePool3 } from "nostr-tools/pool";
|
|
1724
1724
|
import { getPublicKey as getPublicKey3 } from "nostr-tools/pure";
|
|
1725
1725
|
import WebSocket22 from "ws";
|
|
@@ -3407,7 +3407,12 @@ var CHAIN_PRESETS = {
|
|
|
3407
3407
|
"base-sepolia": {
|
|
3408
3408
|
name: "base-sepolia",
|
|
3409
3409
|
chainId: 84532,
|
|
3410
|
-
|
|
3410
|
+
// The old `https://sepolia.base.org` is a stale-read load balancer: reads
|
|
3411
|
+
// work, but openChannel->setTotalDeposit fails with InvalidChannelState
|
|
3412
|
+
// (0xf806e9d9) because a follow-up read lands on a lagging replica. publicnode
|
|
3413
|
+
// is the working devnet/testnet default (source of truth: toon-meta
|
|
3414
|
+
// docs/deployment.md).
|
|
3415
|
+
rpcUrl: "https://base-sepolia-rpc.publicnode.com",
|
|
3411
3416
|
// Post-2026-07-19 public-chain cutover addresses (source of truth: toon-meta
|
|
3412
3417
|
// docs/deployment.md). USDC is a 6-decimal mock with an ungated mint; the
|
|
3413
3418
|
// retired e2e deployment (18-decimal USDC 0xac806…, TokenNetwork 0x47616F4b…,
|
|
@@ -3457,12 +3462,13 @@ var SOLANA_TIER = {
|
|
|
3457
3462
|
var MINA_DEPLOYED_DEVNET = {
|
|
3458
3463
|
graphqlUrl: "https://api.minascan.io/node/devnet/v1/graphql",
|
|
3459
3464
|
network: "devnet",
|
|
3460
|
-
//
|
|
3461
|
-
//
|
|
3462
|
-
//
|
|
3463
|
-
//
|
|
3464
|
-
//
|
|
3465
|
-
zkAppAddress: "
|
|
3465
|
+
// Post-2026-07-19 public-chain cutover (source of truth: toon-meta
|
|
3466
|
+
// docs/deployment.md). This is the CURRENT deployed PaymentChannel zkApp; the
|
|
3467
|
+
// previous address (B62qrH1As4…) is retired and MUST NOT be used. The channels
|
|
3468
|
+
// settle a custom USDC token, so the tokenId is required to read balances /
|
|
3469
|
+
// open channels against the right token.
|
|
3470
|
+
zkAppAddress: "B62qmgPhv2Xo6QVEtwjLja8UZJUtu8yapRFAR6gaoGtbM9zE5hG7Tkf",
|
|
3471
|
+
tokenId: "9497120696276615621907376728658022802954262638363646162765282600447713419198"
|
|
3466
3472
|
};
|
|
3467
3473
|
var MINA_TIER = {
|
|
3468
3474
|
mainnet: {
|
|
@@ -3523,7 +3529,8 @@ function resolveClientNetwork(network) {
|
|
|
3523
3529
|
minaChannel = {
|
|
3524
3530
|
graphqlUrl: mina.graphqlUrl,
|
|
3525
3531
|
zkAppAddress: mina.zkAppAddress,
|
|
3526
|
-
networkId: mina.network === "mainnet" ? "mainnet" : "devnet"
|
|
3532
|
+
networkId: mina.network === "mainnet" ? "mainnet" : "devnet",
|
|
3533
|
+
...mina.tokenId && { tokenId: mina.tokenId }
|
|
3527
3534
|
};
|
|
3528
3535
|
status.mina = "configured";
|
|
3529
3536
|
}
|
|
@@ -7930,7 +7937,7 @@ import { toHex as toHex3 } from "viem";
|
|
|
7930
7937
|
import { readFileSync, writeFileSync, existsSync } from "fs";
|
|
7931
7938
|
import { createPublicClient as createPublicClient2, http as http2, defineChain as defineChain2 } from "viem";
|
|
7932
7939
|
|
|
7933
|
-
// ../../node_modules/.pnpm/@toon-protocol+sdk@3.1.
|
|
7940
|
+
// ../../node_modules/.pnpm/@toon-protocol+sdk@3.1.2_mina-signer@3.1.0_typescript@5.9.3/node_modules/@toon-protocol/sdk/dist/chunk-RAZRWSJF.js
|
|
7934
7941
|
import { getPublicKey as getPublicKey6 } from "nostr-tools/pure";
|
|
7935
7942
|
import { generateSecretKey, getPublicKey as getPublicKey22 } from "nostr-tools/pure";
|
|
7936
7943
|
import { createRumor, createSeal, createWrap } from "nostr-tools/nip59";
|
|
@@ -9554,7 +9561,7 @@ function getRandomValues(buf) {
|
|
|
9554
9561
|
);
|
|
9555
9562
|
}
|
|
9556
9563
|
|
|
9557
|
-
// ../../node_modules/.pnpm/@toon-protocol+sdk@3.1.
|
|
9564
|
+
// ../../node_modules/.pnpm/@toon-protocol+sdk@3.1.2_mina-signer@3.1.0_typescript@5.9.3/node_modules/@toon-protocol/sdk/dist/index.js
|
|
9558
9565
|
var SwapControllerError = class extends ToonError {
|
|
9559
9566
|
constructor(message, cause) {
|
|
9560
9567
|
super(message, "SWAP_CONTROLLER_ERROR", cause);
|
|
@@ -15027,6 +15034,62 @@ async function readMinaBalance(opts) {
|
|
|
15027
15034
|
assetScale: 9
|
|
15028
15035
|
};
|
|
15029
15036
|
}
|
|
15037
|
+
var BASE58_ALPHABET22 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
15038
|
+
function base58encode(bytes) {
|
|
15039
|
+
let num2 = 0n;
|
|
15040
|
+
for (const b of bytes) num2 = num2 * 256n + BigInt(b);
|
|
15041
|
+
let out = "";
|
|
15042
|
+
while (num2 > 0n) {
|
|
15043
|
+
out = BASE58_ALPHABET22[Number(num2 % 58n)] + out;
|
|
15044
|
+
num2 /= 58n;
|
|
15045
|
+
}
|
|
15046
|
+
for (const b of bytes) {
|
|
15047
|
+
if (b === 0) out = "1" + out;
|
|
15048
|
+
else break;
|
|
15049
|
+
}
|
|
15050
|
+
return out;
|
|
15051
|
+
}
|
|
15052
|
+
function minaTokenIdToBase58(tokenId) {
|
|
15053
|
+
if (!/^\d+$/.test(tokenId)) {
|
|
15054
|
+
throw new Error(`Mina tokenId must be a decimal Field string: "${tokenId}"`);
|
|
15055
|
+
}
|
|
15056
|
+
let field = BigInt(tokenId);
|
|
15057
|
+
const le = new Uint8Array(32);
|
|
15058
|
+
for (let i = 0; i < 32; i++) {
|
|
15059
|
+
le[i] = Number(field & 0xffn);
|
|
15060
|
+
field >>= 8n;
|
|
15061
|
+
}
|
|
15062
|
+
const body = new Uint8Array(1 + 32);
|
|
15063
|
+
body[0] = 28;
|
|
15064
|
+
body.set(le, 1);
|
|
15065
|
+
const checksum = sha2562(sha2562(body)).slice(0, 4);
|
|
15066
|
+
const raw = new Uint8Array(body.length + 4);
|
|
15067
|
+
raw.set(body, 0);
|
|
15068
|
+
raw.set(checksum, body.length);
|
|
15069
|
+
return base58encode(raw);
|
|
15070
|
+
}
|
|
15071
|
+
async function readMinaTokenBalance(opts) {
|
|
15072
|
+
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
15073
|
+
const token = minaTokenIdToBase58(opts.tokenId);
|
|
15074
|
+
const query = "query($pk:PublicKey!,$t:TokenId){account(publicKey:$pk,token:$t){balance{total}}}";
|
|
15075
|
+
const res = await fetchImpl(opts.graphqlUrl, {
|
|
15076
|
+
method: "POST",
|
|
15077
|
+
headers: { "content-type": "application/json" },
|
|
15078
|
+
body: JSON.stringify({ query, variables: { pk: opts.owner, t: token } })
|
|
15079
|
+
});
|
|
15080
|
+
if (!res.ok) throw new Error(`Mina GraphQL request failed: HTTP ${res.status}`);
|
|
15081
|
+
const json = await res.json();
|
|
15082
|
+
if (json.errors && json.errors.length > 0) {
|
|
15083
|
+
throw new Error(`Mina GraphQL error: ${json.errors[0]?.message ?? "unknown"}`);
|
|
15084
|
+
}
|
|
15085
|
+
return {
|
|
15086
|
+
chain: "mina",
|
|
15087
|
+
address: opts.owner,
|
|
15088
|
+
amount: String(json.data?.account?.balance?.total ?? "0"),
|
|
15089
|
+
asset: "USDC",
|
|
15090
|
+
assetScale: 9
|
|
15091
|
+
};
|
|
15092
|
+
}
|
|
15030
15093
|
var errText = (e) => e instanceof Error ? e.message : String(e);
|
|
15031
15094
|
function foldNative(out, settled, errors) {
|
|
15032
15095
|
if (settled.status === "fulfilled") out.native = settled.value;
|
|
@@ -15091,24 +15154,28 @@ async function readWalletBalances(sources) {
|
|
|
15091
15154
|
);
|
|
15092
15155
|
}
|
|
15093
15156
|
if (sources.mina) {
|
|
15094
|
-
const { chainKey = "mina", graphqlUrl, owner } = sources.mina;
|
|
15157
|
+
const { chainKey = "mina", graphqlUrl, owner, tokenId } = sources.mina;
|
|
15095
15158
|
tasks.push(
|
|
15096
15159
|
(async () => {
|
|
15097
15160
|
const out = { chain: "mina", chainKey, address: owner, tokens: [] };
|
|
15098
15161
|
const errors = [];
|
|
15099
|
-
const nativeR = await Promise.allSettled([
|
|
15162
|
+
const [nativeR, tokenR] = await Promise.allSettled([
|
|
15163
|
+
readMinaBalance({ graphqlUrl, owner, fetchImpl }),
|
|
15164
|
+
tokenId ? readMinaTokenBalance({ graphqlUrl, owner, tokenId, fetchImpl }) : Promise.resolve(void 0)
|
|
15165
|
+
]);
|
|
15100
15166
|
foldNative(
|
|
15101
15167
|
out,
|
|
15102
|
-
nativeR
|
|
15168
|
+
nativeR.status === "fulfilled" ? {
|
|
15103
15169
|
status: "fulfilled",
|
|
15104
15170
|
value: {
|
|
15105
|
-
symbol: nativeR
|
|
15106
|
-
amount: nativeR
|
|
15107
|
-
decimals: nativeR
|
|
15171
|
+
symbol: nativeR.value.asset,
|
|
15172
|
+
amount: nativeR.value.amount,
|
|
15173
|
+
decimals: nativeR.value.assetScale
|
|
15108
15174
|
}
|
|
15109
|
-
} : nativeR
|
|
15175
|
+
} : nativeR,
|
|
15110
15176
|
errors
|
|
15111
15177
|
);
|
|
15178
|
+
foldToken(out, tokenR, void 0, errors);
|
|
15112
15179
|
finalizeChain(out, errors);
|
|
15113
15180
|
return out;
|
|
15114
15181
|
})()
|
|
@@ -16770,7 +16837,12 @@ var ToonClient = class {
|
|
|
16770
16837
|
if (mina?.graphqlUrl) {
|
|
16771
16838
|
const minaAddress = this.getMinaAddress() ?? (await ensureDerived())?.mina.publicKey;
|
|
16772
16839
|
if (minaAddress) {
|
|
16773
|
-
sources.mina = {
|
|
16840
|
+
sources.mina = {
|
|
16841
|
+
chainKey: "mina",
|
|
16842
|
+
graphqlUrl: mina.graphqlUrl,
|
|
16843
|
+
owner: minaAddress,
|
|
16844
|
+
...mina.tokenId ? { tokenId: mina.tokenId } : {}
|
|
16845
|
+
};
|
|
16774
16846
|
}
|
|
16775
16847
|
}
|
|
16776
16848
|
return readWalletBalances(sources);
|
|
@@ -18102,4 +18174,4 @@ export {
|
|
|
18102
18174
|
@scure/bip32/lib/esm/index.js:
|
|
18103
18175
|
(*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
|
|
18104
18176
|
*/
|
|
18105
|
-
//# sourceMappingURL=chunk-
|
|
18177
|
+
//# sourceMappingURL=chunk-LRHUY3PO.js.map
|