@toon-protocol/client-mcp 0.30.0 → 0.31.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/{anon-proxy-W3KMM7GU-L5IBCUAX.js → anon-proxy-W3KMM7GU-FN7ZJY7P.js} +2 -1
- package/dist/chunk-F22GNSF6.js +12 -0
- package/dist/{chunk-CH37M2I2.js → chunk-JOGMX4IT.js} +33 -9
- package/dist/chunk-JOGMX4IT.js.map +1 -0
- package/dist/{chunk-TEMKXTNH.js → chunk-MI2IWKHX.js} +18 -8
- package/dist/{chunk-TEMKXTNH.js.map → chunk-MI2IWKHX.js.map} +1 -1
- package/dist/chunk-SECSBCDA.js +1567 -0
- package/dist/chunk-SECSBCDA.js.map +1 -0
- package/dist/daemon.js +3 -2
- package/dist/daemon.js.map +1 -1
- package/dist/{ed25519-OFFWPWRE.js → ed25519-UB2JDJJK.js} +2 -1
- package/dist/{gateway-QOK47RKS-HB65KIKC.js → gateway-QOK47RKS-SEGTXBR3.js} +2 -1
- package/dist/{gateway-QOK47RKS-HB65KIKC.js.map → gateway-QOK47RKS-SEGTXBR3.js.map} +1 -1
- package/dist/{hmac-7WSXTWW4.js → hmac-26UC6YKX.js} +2 -1
- package/dist/hmac-26UC6YKX.js.map +1 -0
- package/dist/index.d.ts +72 -9
- package/dist/index.js +4 -3
- package/dist/mcp.js +3 -2
- package/dist/mcp.js.map +1 -1
- package/dist/{sha512-LMOIUNFJ.js → sha512-WYC446ZM.js} +2 -1
- package/dist/{sha512-LMOIUNFJ.js.map → sha512-WYC446ZM.js.map} +1 -1
- package/dist/{socks5-WTJBYGME-IXWLQDE7.js → socks5-WTJBYGME-6COK4LXW.js} +2 -1
- package/dist/{socks5-WTJBYGME-IXWLQDE7.js.map → socks5-WTJBYGME-6COK4LXW.js.map} +1 -1
- package/package.json +2 -1
- package/dist/chunk-2MY6AQK6.js +0 -667
- package/dist/chunk-2MY6AQK6.js.map +0 -1
- package/dist/chunk-CH37M2I2.js.map +0 -1
- /package/dist/{anon-proxy-W3KMM7GU-L5IBCUAX.js.map → anon-proxy-W3KMM7GU-FN7ZJY7P.js.map} +0 -0
- /package/dist/{ed25519-OFFWPWRE.js.map → chunk-F22GNSF6.js.map} +0 -0
- /package/dist/{hmac-7WSXTWW4.js.map → ed25519-UB2JDJJK.js.map} +0 -0
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
tcpProbe,
|
|
11
11
|
waitForAnonSocks
|
|
12
12
|
} from "./chunk-SKQTKZIH.js";
|
|
13
|
+
import "./chunk-F22GNSF6.js";
|
|
13
14
|
export {
|
|
14
15
|
ANON_ASSETS,
|
|
15
16
|
ANON_VERSION,
|
|
@@ -21,4 +22,4 @@ export {
|
|
|
21
22
|
tcpProbe,
|
|
22
23
|
waitForAnonSocks
|
|
23
24
|
};
|
|
24
|
-
//# sourceMappingURL=anon-proxy-W3KMM7GU-
|
|
25
|
+
//# sourceMappingURL=anon-proxy-W3KMM7GU-FN7ZJY7P.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'module'; const require = __cr(import.meta.url);
|
|
2
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
3
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
4
|
+
}) : x)(function(x) {
|
|
5
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
__require
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=chunk-F22GNSF6.js.map
|
|
@@ -2,7 +2,7 @@ import { createRequire as __cr } from 'module'; const require = __cr(import.meta
|
|
|
2
2
|
import {
|
|
3
3
|
ControlApiError,
|
|
4
4
|
DaemonUnreachableError
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MI2IWKHX.js";
|
|
6
6
|
|
|
7
7
|
// src/mcp-tools.ts
|
|
8
8
|
var TOOL_DEFINITIONS = [
|
|
@@ -106,21 +106,42 @@ var TOOL_DEFINITIONS = [
|
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
108
|
name: "toon_swap",
|
|
109
|
-
description: "Pay a mill peer (asset A) to receive asset B plus a signed target-chain claim. Returns the
|
|
109
|
+
description: "Pay a mill peer (asset A) to receive asset B plus a signed target-chain claim. Builds the NIP-59 gift-wrapped kind:20032 swap rumor and streams it; the source-asset claim is signed against the open apex channel (the mill must be routed via apexChildPeers). Returns the accumulated, decrypted target-chain claim(s) and settlement metadata.",
|
|
110
110
|
inputSchema: {
|
|
111
111
|
type: "object",
|
|
112
112
|
properties: {
|
|
113
113
|
destination: {
|
|
114
114
|
type: "string",
|
|
115
|
-
description: "Mill peer ILP destination."
|
|
115
|
+
description: "Mill peer ILP destination (e.g. g.townhouse.mill)."
|
|
116
116
|
},
|
|
117
|
-
amount: {
|
|
118
|
-
toonData: {
|
|
117
|
+
amount: {
|
|
119
118
|
type: "string",
|
|
120
|
-
description: "
|
|
119
|
+
description: "Total source-asset amount to swap, source micro-units."
|
|
120
|
+
},
|
|
121
|
+
millPubkey: {
|
|
122
|
+
type: "string",
|
|
123
|
+
description: "Mill's 64-char lowercase hex Nostr pubkey (gift-wrap recipient)."
|
|
124
|
+
},
|
|
125
|
+
pair: {
|
|
126
|
+
type: "object",
|
|
127
|
+
description: "The swap pair (from kind:10032 discovery or operator-supplied): { from:{assetCode,assetScale,chain}, to:{...}, rate, minAmount?, maxAmount? }."
|
|
128
|
+
},
|
|
129
|
+
chainRecipient: {
|
|
130
|
+
type: "string",
|
|
131
|
+
description: "Sender's payout address on pair.to.chain (EVM 0x-hex / Solana / Mina base58)."
|
|
132
|
+
},
|
|
133
|
+
packetCount: {
|
|
134
|
+
type: "number",
|
|
135
|
+
description: "Split the swap into N equal packets (default 1)."
|
|
121
136
|
}
|
|
122
137
|
},
|
|
123
|
-
required: [
|
|
138
|
+
required: [
|
|
139
|
+
"destination",
|
|
140
|
+
"amount",
|
|
141
|
+
"millPubkey",
|
|
142
|
+
"pair",
|
|
143
|
+
"chainRecipient"
|
|
144
|
+
],
|
|
124
145
|
additionalProperties: false
|
|
125
146
|
}
|
|
126
147
|
}
|
|
@@ -168,7 +189,10 @@ async function dispatchTool(client, name, args) {
|
|
|
168
189
|
await client.swap({
|
|
169
190
|
destination: String(args["destination"]),
|
|
170
191
|
amount: String(args["amount"]),
|
|
171
|
-
|
|
192
|
+
millPubkey: String(args["millPubkey"]),
|
|
193
|
+
pair: args["pair"],
|
|
194
|
+
chainRecipient: String(args["chainRecipient"]),
|
|
195
|
+
...typeof args["packetCount"] === "number" ? { packetCount: args["packetCount"] } : {}
|
|
172
196
|
})
|
|
173
197
|
);
|
|
174
198
|
default:
|
|
@@ -202,4 +226,4 @@ export {
|
|
|
202
226
|
TOOL_DEFINITIONS,
|
|
203
227
|
dispatchTool
|
|
204
228
|
};
|
|
205
|
-
//# sourceMappingURL=chunk-
|
|
229
|
+
//# sourceMappingURL=chunk-JOGMX4IT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mcp-tools.ts"],"sourcesContent":["/**\n * MCP tool definitions + dispatch. The MCP server is a thin proxy: each tool\n * maps to a `toon-clientd` control-plane call. This module is the testable core\n * (no stdio / SDK transport) so the tool→HTTP mapping and the\n * \"bootstrapping — retry\" handling can be unit-tested directly.\n */\n\nimport { ControlApiError, DaemonUnreachableError } from './control-client.js';\nimport type { ControlClient } from './control-client.js';\nimport type {\n NostrFilter,\n PublishRequest,\n SwapRequest,\n} from './control-api.js';\n\n/** A JSON-Schema-described MCP tool. */\nexport interface ToolDefinition {\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n}\n\n/** MCP tool-call result shape (subset of the SDK's CallToolResult). */\nexport interface ToolResult {\n content: { type: 'text'; text: string }[];\n isError?: boolean;\n}\n\nexport const TOOL_DEFINITIONS: ToolDefinition[] = [\n {\n name: 'toon_status',\n description:\n 'Report TOON client daemon health: bootstrapping/ready state, transport, ' +\n 'relay connection, buffered-event count, and per-chain settlement status.',\n inputSchema: {\n type: 'object',\n properties: {},\n additionalProperties: false,\n },\n },\n {\n name: 'toon_identity',\n description:\n \"Return this client's public identity (Nostr pubkey + EVM/Solana/Mina \" +\n 'addresses). Never returns private keys.',\n inputSchema: {\n type: 'object',\n properties: {},\n additionalProperties: false,\n },\n },\n {\n name: 'toon_publish',\n description:\n 'Pay-to-write: publish a fully-signed Nostr event to the TOON network. ' +\n 'Signs an off-chain payment-channel claim and forwards it over BTP. ' +\n 'Returns the event id, channel id, and the advanced channel nonce.',\n inputSchema: {\n type: 'object',\n properties: {\n event: {\n type: 'object',\n description:\n 'A fully-signed Nostr event (must include id, pubkey, sig, kind, ' +\n 'created_at, tags, content).',\n },\n destination: {\n type: 'string',\n description:\n 'Optional ILP destination override (default: the apex/town).',\n },\n fee: {\n type: 'string',\n description:\n 'Optional fee override in base units (default: daemon config).',\n },\n },\n required: ['event'],\n additionalProperties: false,\n },\n },\n {\n name: 'toon_subscribe',\n description:\n 'Free read: register a persistent town-relay subscription with NIP-01 ' +\n 'filter(s). Returns a subscription id to drain with toon_read.',\n inputSchema: {\n type: 'object',\n properties: {\n filters: {\n description: 'A NIP-01 filter object or an array of OR-ed filters.',\n },\n subId: { type: 'string', description: 'Optional caller-supplied id.' },\n },\n required: ['filters'],\n additionalProperties: false,\n },\n },\n {\n name: 'toon_read',\n description:\n 'Free read: drain buffered events newer than a cursor. Pass back the ' +\n 'returned cursor to fetch only events received since the last read.',\n inputSchema: {\n type: 'object',\n properties: {\n subId: { type: 'string', description: 'Restrict to one subscription.' },\n cursor: {\n type: 'number',\n description: 'Cursor from a prior toon_read.',\n },\n limit: {\n type: 'number',\n description: 'Max events to return (default 200).',\n },\n },\n additionalProperties: false,\n },\n },\n {\n name: 'toon_open_channel',\n description:\n 'Open (or return the existing) payment channel for a destination. ' +\n 'Channels open lazily on first publish; use this to pre-open.',\n inputSchema: {\n type: 'object',\n properties: {\n destination: {\n type: 'string',\n description: 'ILP destination (default: apex).',\n },\n },\n additionalProperties: false,\n },\n },\n {\n name: 'toon_channels',\n description:\n 'List tracked payment channels with their nonce watermark and cumulative ' +\n 'transferred amount.',\n inputSchema: {\n type: 'object',\n properties: {},\n additionalProperties: false,\n },\n },\n {\n name: 'toon_swap',\n description:\n 'Pay a mill peer (asset A) to receive asset B plus a signed target-chain ' +\n 'claim. Builds the NIP-59 gift-wrapped kind:20032 swap rumor and streams ' +\n 'it; the source-asset claim is signed against the open apex channel (the ' +\n 'mill must be routed via apexChildPeers). Returns the accumulated, ' +\n 'decrypted target-chain claim(s) and settlement metadata.',\n inputSchema: {\n type: 'object',\n properties: {\n destination: {\n type: 'string',\n description: 'Mill peer ILP destination (e.g. g.townhouse.mill).',\n },\n amount: {\n type: 'string',\n description: 'Total source-asset amount to swap, source micro-units.',\n },\n millPubkey: {\n type: 'string',\n description:\n \"Mill's 64-char lowercase hex Nostr pubkey (gift-wrap recipient).\",\n },\n pair: {\n type: 'object',\n description:\n 'The swap pair (from kind:10032 discovery or operator-supplied): ' +\n '{ from:{assetCode,assetScale,chain}, to:{...}, rate, minAmount?, maxAmount? }.',\n },\n chainRecipient: {\n type: 'string',\n description:\n \"Sender's payout address on pair.to.chain (EVM 0x-hex / Solana / Mina base58).\",\n },\n packetCount: {\n type: 'number',\n description: 'Split the swap into N equal packets (default 1).',\n },\n },\n required: [\n 'destination',\n 'amount',\n 'millPubkey',\n 'pair',\n 'chainRecipient',\n ],\n additionalProperties: false,\n },\n },\n];\n\n/**\n * Dispatch an MCP tool call to the daemon control plane. Always resolves with a\n * `ToolResult` (errors are encoded as `isError: true` text, not thrown, so the\n * agent sees a readable message). A retryable error (daemon still\n * bootstrapping) yields a clear \"retry shortly\" message.\n */\nexport async function dispatchTool(\n client: ControlClient,\n name: string,\n args: Record<string, unknown>\n): Promise<ToolResult> {\n try {\n switch (name) {\n case 'toon_status':\n return ok(await client.status());\n case 'toon_identity': {\n const s = await client.status();\n return ok({\n identity: s.identity,\n ready: s.ready,\n bootstrapping: s.bootstrapping,\n });\n }\n case 'toon_publish':\n return ok(await client.publish(args as unknown as PublishRequest));\n case 'toon_subscribe':\n return ok(\n await client.subscribe({\n filters: args['filters'] as NostrFilter | NostrFilter[],\n ...(typeof args['subId'] === 'string'\n ? { subId: args['subId'] }\n : {}),\n })\n );\n case 'toon_read':\n return ok(\n await client.events({\n ...(typeof args['subId'] === 'string'\n ? { subId: args['subId'] }\n : {}),\n ...(typeof args['cursor'] === 'number'\n ? { cursor: args['cursor'] }\n : {}),\n ...(typeof args['limit'] === 'number'\n ? { limit: args['limit'] }\n : {}),\n })\n );\n case 'toon_open_channel':\n return ok(\n await client.openChannel(\n typeof args['destination'] === 'string'\n ? { destination: args['destination'] }\n : {}\n )\n );\n case 'toon_channels':\n return ok(await client.channels());\n case 'toon_swap':\n return ok(\n await client.swap({\n destination: String(args['destination']),\n amount: String(args['amount']),\n millPubkey: String(args['millPubkey']),\n pair: args['pair'] as SwapRequest['pair'],\n chainRecipient: String(args['chainRecipient']),\n ...(typeof args['packetCount'] === 'number'\n ? { packetCount: args['packetCount'] }\n : {}),\n })\n );\n default:\n return err(`Unknown tool: ${name}`);\n }\n } catch (e) {\n if (e instanceof ControlApiError && e.retryable) {\n return err(\n `TOON client is still bootstrapping (the anon proxy / BTP session can take ` +\n `30–90s) — retry shortly. (${e.message})`\n );\n }\n if (e instanceof DaemonUnreachableError) {\n return err(\n `TOON client daemon is not reachable at ${e.baseUrl}. It may have failed ` +\n `to start — check ~/.toon-client/daemon.log.`\n );\n }\n if (e instanceof ControlApiError) {\n return err(`${e.message}${e.detail ? `: ${e.detail}` : ''}`);\n }\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\nfunction ok(data: unknown): ToolResult {\n return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };\n}\n\nfunction err(message: string): ToolResult {\n return { content: [{ type: 'text', text: message }], isError: true };\n}\n"],"mappings":";;;;;;;AA4BO,IAAM,mBAAqC;AAAA,EAChD;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAEF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY,CAAC;AAAA,MACb,sBAAsB;AAAA,IACxB;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAEF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY,CAAC;AAAA,MACb,sBAAsB;AAAA,IACxB;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAGF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,OAAO;AAAA,UACL,MAAM;AAAA,UACN,aACE;AAAA,QAEJ;AAAA,QACA,aAAa;AAAA,UACX,MAAM;AAAA,UACN,aACE;AAAA,QACJ;AAAA,QACA,KAAK;AAAA,UACH,MAAM;AAAA,UACN,aACE;AAAA,QACJ;AAAA,MACF;AAAA,MACA,UAAU,CAAC,OAAO;AAAA,MAClB,sBAAsB;AAAA,IACxB;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAEF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,SAAS;AAAA,UACP,aAAa;AAAA,QACf;AAAA,QACA,OAAO,EAAE,MAAM,UAAU,aAAa,+BAA+B;AAAA,MACvE;AAAA,MACA,UAAU,CAAC,SAAS;AAAA,MACpB,sBAAsB;AAAA,IACxB;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAEF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,OAAO,EAAE,MAAM,UAAU,aAAa,gCAAgC;AAAA,QACtE,QAAQ;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,Q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K,gBAAgB,CAAC;AAAA,YAC7C,GAAI,OAAO,KAAK,aAAa,MAAM,WAC/B,EAAE,aAAa,KAAK,aAAa,EAAE,IACnC,CAAC;AAAA,UACP,CAAC;AAAA,QACH;AAAA,MACF;AACE,eAAO,IAAI,iBAAiB,IAAI,EAAE;AAAA,IACtC;AAAA,EACF,SAAS,GAAG;AACV,QAAI,aAAa,mBAAmB,EAAE,WAAW;AAC/C,aAAO;AAAA,QACL,iHAC+B,EAAE,OAAO;AAAA,MAC1C;AAAA,IACF;AACA,QAAI,aAAa,wBAAwB;AACvC,aAAO;AAAA,QACL,0CAA0C,EAAE,OAAO;AAAA,MAErD;AAAA,IACF;AACA,QAAI,aAAa,iBAAiB;AAChC,aAAO,IAAI,GAAG,EAAE,OAAO,GAAG,EAAE,SAAS,KAAK,EAAE,MAAM,KAAK,EAAE,EAAE;AAAA,IAC7D;AACA,WAAO,IAAI,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC,CAAC;AAAA,EACvD;AACF;AAEA,SAAS,GAAG,MAA2B;AACrC,SAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,KAAK,UAAU,MAAM,MAAM,CAAC,EAAE,CAAC,EAAE;AAC5E;AAEA,SAAS,IAAI,SAA6B;AACxC,SAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,QAAQ,CAAC,GAAG,SAAS,KAAK;AACrE;","names":[]}
|
|
@@ -1898,6 +1898,13 @@ function resolveClientNetwork(network) {
|
|
|
1898
1898
|
status
|
|
1899
1899
|
};
|
|
1900
1900
|
}
|
|
1901
|
+
function buildIlpPrepare(params) {
|
|
1902
|
+
return {
|
|
1903
|
+
destination: params.destination,
|
|
1904
|
+
amount: String(params.amount),
|
|
1905
|
+
data: Buffer.from(params.data).toString("base64")
|
|
1906
|
+
};
|
|
1907
|
+
}
|
|
1901
1908
|
|
|
1902
1909
|
// ../client/dist/index.js
|
|
1903
1910
|
import { generateSecretKey, getPublicKey as getPublicKey6 } from "nostr-tools/pure";
|
|
@@ -6611,9 +6618,9 @@ function deriveEvmIdentity(secretKey) {
|
|
|
6611
6618
|
};
|
|
6612
6619
|
}
|
|
6613
6620
|
async function deriveSolanaKey(seed, accountIndex = 0) {
|
|
6614
|
-
const { hmac: hmac2 } = await import("./hmac-
|
|
6615
|
-
const { sha512: sha5122 } = await import("./sha512-
|
|
6616
|
-
const { ed25519: ed255194 } = await import("./ed25519-
|
|
6621
|
+
const { hmac: hmac2 } = await import("./hmac-26UC6YKX.js");
|
|
6622
|
+
const { sha512: sha5122 } = await import("./sha512-WYC446ZM.js");
|
|
6623
|
+
const { ed25519: ed255194 } = await import("./ed25519-UB2JDJJK.js");
|
|
6617
6624
|
const encoder = new TextEncoder();
|
|
6618
6625
|
let I = hmac2(sha5122, encoder.encode("ed25519 seed"), seed);
|
|
6619
6626
|
let key = I.slice(0, 32);
|
|
@@ -8931,8 +8938,8 @@ async function resolveTransport(transport, originalBtpUrl, originalConnectorUrl,
|
|
|
8931
8938
|
const hasExplicitProxy = !!transport && (transport.type === "socks5" || transport.type === "gateway");
|
|
8932
8939
|
const envProxy = process.env["ANYONE_PROXY_URLS"];
|
|
8933
8940
|
if (!hasExplicitProxy && managedProxyOptions?.managedAnonProxy !== false && !envProxy && isAnyoneHost(originalBtpUrl)) {
|
|
8934
|
-
const { startManagedAnonProxy: startManagedAnonProxy2 } = await import("./anon-proxy-W3KMM7GU-
|
|
8935
|
-
const { createSocks5WebSocketFactory, createSocks5Fetch } = await import("./socks5-WTJBYGME-
|
|
8941
|
+
const { startManagedAnonProxy: startManagedAnonProxy2 } = await import("./anon-proxy-W3KMM7GU-FN7ZJY7P.js");
|
|
8942
|
+
const { createSocks5WebSocketFactory, createSocks5Fetch } = await import("./socks5-WTJBYGME-6COK4LXW.js");
|
|
8936
8943
|
const proxy = await startManagedAnonProxy2({
|
|
8937
8944
|
...managedProxyOptions?.managedAnonSocksPort !== void 0 ? { socksPort: managedProxyOptions.managedAnonSocksPort } : {}
|
|
8938
8945
|
});
|
|
@@ -8955,7 +8962,7 @@ async function resolveTransport(transport, originalBtpUrl, originalConnectorUrl,
|
|
|
8955
8962
|
createSocks5WebSocketFactory,
|
|
8956
8963
|
createSocks5Fetch,
|
|
8957
8964
|
probeSocks5Proxy
|
|
8958
|
-
} = await import("./socks5-WTJBYGME-
|
|
8965
|
+
} = await import("./socks5-WTJBYGME-6COK4LXW.js");
|
|
8959
8966
|
await probeSocks5Proxy(transport.socksProxy);
|
|
8960
8967
|
return {
|
|
8961
8968
|
createWebSocket: createSocks5WebSocketFactory(transport.socksProxy),
|
|
@@ -8963,7 +8970,7 @@ async function resolveTransport(transport, originalBtpUrl, originalConnectorUrl,
|
|
|
8963
8970
|
};
|
|
8964
8971
|
}
|
|
8965
8972
|
if (transport.type === "gateway") {
|
|
8966
|
-
const { rewriteUrlsForGateway } = await import("./gateway-QOK47RKS-
|
|
8973
|
+
const { rewriteUrlsForGateway } = await import("./gateway-QOK47RKS-SEGTXBR3.js");
|
|
8967
8974
|
const rewritten = rewriteUrlsForGateway(
|
|
8968
8975
|
transport.gatewayUrl,
|
|
8969
8976
|
originalBtpUrl,
|
|
@@ -10784,7 +10791,10 @@ function delay(ms) {
|
|
|
10784
10791
|
}
|
|
10785
10792
|
|
|
10786
10793
|
export {
|
|
10794
|
+
ToonError,
|
|
10795
|
+
encodeEventToToon,
|
|
10787
10796
|
decodeEventFromToon,
|
|
10797
|
+
buildIlpPrepare,
|
|
10788
10798
|
ToonClient,
|
|
10789
10799
|
configDir,
|
|
10790
10800
|
defaultConfigPath,
|
|
@@ -10821,4 +10831,4 @@ export {
|
|
|
10821
10831
|
@scure/bip32/lib/esm/index.js:
|
|
10822
10832
|
(*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
|
|
10823
10833
|
*/
|
|
10824
|
-
//# sourceMappingURL=chunk-
|
|
10834
|
+
//# sourceMappingURL=chunk-MI2IWKHX.js.map
|