@aifinpay/mcp 2.0.0-rc.5 → 2.2.0
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/LICENSE +21 -0
- package/README.md +161 -69
- package/bin/aifinpay-mcp.js +115 -67
- package/dist/api.d.ts +2 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +6 -0
- package/dist/api.js.map +1 -0
- package/dist/config.d.ts +17 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +66 -11
- package/dist/config.js.map +1 -1
- package/dist/identity.d.ts +9 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +81 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -1
- package/dist/payment-state.d.ts +35 -0
- package/dist/payment-state.d.ts.map +1 -0
- package/dist/payment-state.js +127 -0
- package/dist/payment-state.js.map +1 -0
- package/dist/safe-fetch.d.ts.map +1 -1
- package/dist/safe-fetch.js +73 -19
- package/dist/safe-fetch.js.map +1 -1
- package/dist/server.d.ts +5 -15
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +127 -38
- package/dist/server.js.map +1 -1
- package/dist/tools/agent-address.d.ts.map +1 -1
- package/dist/tools/agent-address.js +5 -4
- package/dist/tools/agent-address.js.map +1 -1
- package/dist/tools/agent-history.d.ts +58 -0
- package/dist/tools/agent-history.d.ts.map +1 -0
- package/dist/tools/agent-history.js +141 -0
- package/dist/tools/agent-history.js.map +1 -0
- package/dist/tools/agent-quota.d.ts.map +1 -1
- package/dist/tools/agent-quota.js +3 -1
- package/dist/tools/agent-quota.js.map +1 -1
- package/dist/tools/{agent-quote.d.ts → dev-payment-quote.d.ts} +10 -12
- package/dist/tools/dev-payment-quote.d.ts.map +1 -0
- package/dist/tools/dev-payment-quote.js +80 -0
- package/dist/tools/dev-payment-quote.js.map +1 -0
- package/dist/tools/payable-fetch.d.ts +3 -29
- package/dist/tools/payable-fetch.d.ts.map +1 -1
- package/dist/tools/payable-fetch.js +231 -109
- package/dist/tools/payable-fetch.js.map +1 -1
- package/dist/tools/production-control.d.ts +104 -0
- package/dist/tools/production-control.d.ts.map +1 -1
- package/dist/tools/production-control.js +177 -14
- package/dist/tools/production-control.js.map +1 -1
- package/dist/tools/supported-chains.d.ts +38 -0
- package/dist/tools/supported-chains.d.ts.map +1 -0
- package/dist/tools/supported-chains.js +132 -0
- package/dist/tools/supported-chains.js.map +1 -0
- package/package.json +30 -7
- package/skills/SKILL.md +332 -0
- package/smithery.yaml +137 -0
- package/dist/directory.d.ts +0 -55
- package/dist/directory.d.ts.map +0 -1
- package/dist/directory.js +0 -56
- package/dist/directory.js.map +0 -1
- package/dist/tools/agent-call.d.ts +0 -68
- package/dist/tools/agent-call.d.ts.map +0 -1
- package/dist/tools/agent-call.js +0 -129
- package/dist/tools/agent-call.js.map +0 -1
- package/dist/tools/agent-claim-self.d.ts +0 -66
- package/dist/tools/agent-claim-self.d.ts.map +0 -1
- package/dist/tools/agent-claim-self.js +0 -299
- package/dist/tools/agent-claim-self.js.map +0 -1
- package/dist/tools/agent-quote.d.ts.map +0 -1
- package/dist/tools/agent-quote.js +0 -81
- package/dist/tools/agent-quote.js.map +0 -1
- package/dist/tools/pay-with-split.d.ts +0 -93
- package/dist/tools/pay-with-split.d.ts.map +0 -1
- package/dist/tools/pay-with-split.js +0 -138
- package/dist/tools/pay-with-split.js.map +0 -1
package/dist/server.d.ts
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
import { AiFinPayAgent } from "@aifinpay/agent";
|
|
2
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
3
|
import type { McpConfig } from "./config.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
* IMPORTANT: the old agent_call, payable_fetch, pay_with_split, quote_split,
|
|
8
|
-
* agent_claim_self and agent_quote tools are deliberately NOT registered.
|
|
9
|
-
* They depend on @aifinpay/agent 1.x legacy splitter/x402 semantics and must not
|
|
10
|
-
* be available to a model after the 0% AIFP-2 / gross-inclusive AIFP-1 change.
|
|
11
|
-
*
|
|
12
|
-
* This server remains useful before the SDK 2.0 package is published: it can
|
|
13
|
-
* expose the wallet address, resolve Agent Passport identity, read verified
|
|
14
|
-
* v1.3 routes, and construct a non-signing settlement invoice. Signing/moving
|
|
15
|
-
* value returns only after MCP depends on the published v2 executor and its E2E
|
|
16
|
-
* release gate has passed.
|
|
17
|
-
*/
|
|
4
|
+
import { PaymentStateStore } from "./payment-state.js";
|
|
5
|
+
/** Read-only by default. Explicit owner configuration enables the reviewed
|
|
6
|
+
* native Polygon v1.4 payable_fetch path; legacy signing tools stay retired. */
|
|
18
7
|
export declare function createServer(config?: McpConfig): Promise<{
|
|
19
8
|
server: Server<{
|
|
20
9
|
method: string;
|
|
@@ -50,11 +39,12 @@ export declare function createServer(config?: McpConfig): Promise<{
|
|
|
50
39
|
} | undefined;
|
|
51
40
|
} | undefined;
|
|
52
41
|
}>;
|
|
53
|
-
agent: AiFinPayAgent;
|
|
42
|
+
readonly agent: AiFinPayAgent;
|
|
54
43
|
}>;
|
|
55
44
|
export interface ToolContext {
|
|
56
45
|
agent: AiFinPayAgent;
|
|
57
46
|
config: McpConfig;
|
|
47
|
+
paymentState?: PaymentStateStore;
|
|
58
48
|
log: (level: "info" | "warn" | "error", msg: string) => void;
|
|
59
49
|
}
|
|
60
50
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAQnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQ7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AA0BvD;gFACgF;AAChF,wBAAsB,YAAY,CAAC,MAAM,GAAE,SAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4KxD;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9D"}
|
package/dist/server.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { AiFinPayAgent } from "@aifinpay/agent";
|
|
2
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
3
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
import { loadWalletIdentity } from "./identity.js";
|
|
6
|
+
import { agentHistoryTool, runAgentHistory } from "./tools/agent-history.js";
|
|
7
|
+
import { devPaymentQuoteTool, runDevPaymentQuote } from "./tools/dev-payment-quote.js";
|
|
4
8
|
import { agentAddressTool, runAgentAddress } from "./tools/agent-address.js";
|
|
5
9
|
import { agentQuotaTool, runAgentQuota } from "./tools/agent-quota.js";
|
|
6
10
|
import { makeSafeFetch } from "./safe-fetch.js";
|
|
7
|
-
import { loadConfigFromEnv } from "./config.js";
|
|
8
|
-
import {
|
|
11
|
+
import { loadConfigFromEnv, validatePaymentConfig } from "./config.js";
|
|
12
|
+
import { PaymentStateStore } from "./payment-state.js";
|
|
13
|
+
import { payableFetchTool, runPayableFetch } from "./tools/payable-fetch.js";
|
|
14
|
+
import { agentPassportResolveTool, runAgentPassportResolve, settlementRoutesTool, runSettlementRoutes, settlementInvoiceTool, runSettlementInvoice, settlementSolanaTool, runSettlementSolana, settlementCasperTool, runSettlementCasper, } from "./tools/production-control.js";
|
|
15
|
+
import { deploymentInfoTool, runDeploymentInfo } from "./tools/supported-chains.js";
|
|
9
16
|
// Every backend/public request made by this server goes through safeFetch.
|
|
10
17
|
// Public deployments never lift private-network protection; local development
|
|
11
18
|
// may explicitly use AIFINPAY_ALLOW_PRIVATE_FETCH=1.
|
|
@@ -15,42 +22,38 @@ const safeFetch = makeSafeFetch({
|
|
|
15
22
|
// for those names — see safe-fetch.ts for why this is not a proxy switch.
|
|
16
23
|
trustedHosts: loadConfigFromEnv().trustedHosts,
|
|
17
24
|
});
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* IMPORTANT: the old agent_call, payable_fetch, pay_with_split, quote_split,
|
|
22
|
-
* agent_claim_self and agent_quote tools are deliberately NOT registered.
|
|
23
|
-
* They depend on @aifinpay/agent 1.x legacy splitter/x402 semantics and must not
|
|
24
|
-
* be available to a model after the 0% AIFP-2 / gross-inclusive AIFP-1 change.
|
|
25
|
-
*
|
|
26
|
-
* This server remains useful before the SDK 2.0 package is published: it can
|
|
27
|
-
* expose the wallet address, resolve Agent Passport identity, read verified
|
|
28
|
-
* v1.3 routes, and construct a non-signing settlement invoice. Signing/moving
|
|
29
|
-
* value returns only after MCP depends on the published v2 executor and its E2E
|
|
30
|
-
* release gate has passed.
|
|
31
|
-
*/
|
|
25
|
+
/** Read-only by default. Explicit owner configuration enables the reviewed
|
|
26
|
+
* native Polygon v1.4 payable_fetch path; legacy signing tools stay retired. */
|
|
32
27
|
export async function createServer(config = {}) {
|
|
33
28
|
const log = config.logFn ?? defaultLog;
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
let identitySource = "ephemeral";
|
|
30
|
+
async function configuredAgent() {
|
|
31
|
+
const identity = loadWalletIdentity(config);
|
|
32
|
+
if (!identity)
|
|
33
|
+
return null;
|
|
34
|
+
const options = { fetchImpl: safeFetch, baseUrl: config.baseUrl, timeoutMs: config.timeoutMs };
|
|
35
|
+
const loaded = identity.seedHash
|
|
36
|
+
? await AiFinPayAgent.fromSeed(identity.seedHash, options)
|
|
37
|
+
: await AiFinPayAgent.fromSolanaSecret(identity.secretB58, options);
|
|
38
|
+
return { loaded, source: identity.source };
|
|
39
|
+
}
|
|
40
|
+
const configured = await configuredAgent();
|
|
41
|
+
let agent = configured?.loaded ??
|
|
42
|
+
(await AiFinPayAgent.new({
|
|
36
43
|
fetchImpl: safeFetch,
|
|
37
44
|
baseUrl: config.baseUrl,
|
|
38
45
|
timeoutMs: config.timeoutMs,
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
` >> For a persistent wallet, create one from a seed you back up\n` +
|
|
51
|
-
` (AiFinPayAgent.fromSeed / \`aifinpay init\`) and set AIFINPAY_AGENT_SECRET.`);
|
|
52
|
-
return a;
|
|
53
|
-
})();
|
|
46
|
+
}));
|
|
47
|
+
identitySource = configured?.source ?? "ephemeral";
|
|
48
|
+
if (!configured)
|
|
49
|
+
log("warn", "[aifinpay-mcp] EPHEMERAL wallet — DO NOT FUND. Run `npx @aifinpay/mcp init`, then agent_reload in this connection.");
|
|
50
|
+
let paymentState;
|
|
51
|
+
if (config.paymentsEnabled) {
|
|
52
|
+
validatePaymentConfig(config);
|
|
53
|
+
if (!configured)
|
|
54
|
+
throw new Error("Payments require a persistent configured wallet; run init first");
|
|
55
|
+
paymentState = new PaymentStateStore(agent.evmAddress, config.walletHome);
|
|
56
|
+
}
|
|
54
57
|
// Keep the legacy agent budget configured even though this RC exposes no
|
|
55
58
|
// signing tool. It remains an additional defence for downstream/private code
|
|
56
59
|
// and for the subsequent v2 MCP executor integration.
|
|
@@ -61,31 +64,112 @@ export async function createServer(config = {}) {
|
|
|
61
64
|
log("info", `[aifinpay-mcp] production RC safe surface · solana: ${agent.solanaAddress} · evm: ${agent.evmAddress}`);
|
|
62
65
|
const server = new Server({
|
|
63
66
|
name: "@aifinpay/mcp",
|
|
64
|
-
version: "
|
|
65
|
-
}, { capabilities: { tools: {} } });
|
|
67
|
+
version: JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version,
|
|
68
|
+
}, { capabilities: { tools: {}, resources: {} } });
|
|
69
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
70
|
+
resources: [
|
|
71
|
+
{
|
|
72
|
+
uri: "aifinpay://skill",
|
|
73
|
+
name: "AiFinPay skill",
|
|
74
|
+
mimeType: "text/markdown",
|
|
75
|
+
description: "Wallet source priority, payment history routes, reconnect behavior and dev testing limits",
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
}));
|
|
79
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
80
|
+
if (request.params.uri !== "aifinpay://skill")
|
|
81
|
+
throw new Error("Unknown resource");
|
|
82
|
+
return {
|
|
83
|
+
contents: [
|
|
84
|
+
{
|
|
85
|
+
uri: "aifinpay://skill",
|
|
86
|
+
mimeType: "text/markdown",
|
|
87
|
+
text: readFileSync(new URL("../skills/SKILL.md", import.meta.url), "utf8"),
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
};
|
|
91
|
+
});
|
|
66
92
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
67
93
|
tools: [
|
|
68
94
|
agentAddressTool(),
|
|
95
|
+
{
|
|
96
|
+
name: "agent_reload",
|
|
97
|
+
description: "Reload the configured local wallet files after init or a file update, without starting a new conversation. Returns public addresses only. Shell environment changes still require reconnecting the MCP process.",
|
|
98
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
99
|
+
annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false },
|
|
100
|
+
},
|
|
101
|
+
...(paymentState ? [payableFetchTool()] : []),
|
|
69
102
|
agentQuotaTool(),
|
|
103
|
+
agentHistoryTool(),
|
|
104
|
+
...(config.devMode ? [devPaymentQuoteTool()] : []),
|
|
70
105
|
agentPassportResolveTool(),
|
|
71
106
|
settlementRoutesTool(),
|
|
72
107
|
settlementInvoiceTool(),
|
|
108
|
+
settlementSolanaTool(),
|
|
109
|
+
settlementCasperTool(),
|
|
110
|
+
deploymentInfoTool(),
|
|
73
111
|
],
|
|
74
112
|
}));
|
|
75
113
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
76
114
|
const { name, arguments: args } = request.params;
|
|
77
|
-
const ctx = { agent, config, log };
|
|
115
|
+
const ctx = { agent, config, log, paymentState };
|
|
78
116
|
switch (name) {
|
|
117
|
+
case "agent_reload":
|
|
118
|
+
try {
|
|
119
|
+
const replacement = await configuredAgent();
|
|
120
|
+
if (!replacement)
|
|
121
|
+
throw new Error("No persistent wallet configured; run init or configure the project wallet first");
|
|
122
|
+
if (config.maxAmountUsd !== undefined && Number.isFinite(config.maxAmountUsd)) {
|
|
123
|
+
replacement.loaded.setBudget({ per_call_usd: config.maxAmountUsd });
|
|
124
|
+
}
|
|
125
|
+
if (paymentState && replacement.loaded.evmAddress.toLowerCase() !== agent.evmAddress.toLowerCase()) {
|
|
126
|
+
throw new Error("Reconnect to switch payment wallets; pending state must remain associated with its original wallet");
|
|
127
|
+
}
|
|
128
|
+
agent = replacement.loaded;
|
|
129
|
+
identitySource = replacement.source;
|
|
130
|
+
return {
|
|
131
|
+
content: [
|
|
132
|
+
{
|
|
133
|
+
type: "text",
|
|
134
|
+
text: JSON.stringify({
|
|
135
|
+
source: identitySource,
|
|
136
|
+
solana: agent.solanaAddress,
|
|
137
|
+
evm: agent.evmAddress,
|
|
138
|
+
casper: agent.casperAddress,
|
|
139
|
+
reloaded: true,
|
|
140
|
+
}),
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
return {
|
|
147
|
+
isError: true,
|
|
148
|
+
content: [{ type: "text", text: `Wallet reload failed: ${error.message}` }],
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
case "payable_fetch":
|
|
152
|
+
return runPayableFetch(ctx, args ?? {});
|
|
79
153
|
case "agent_address":
|
|
80
154
|
return runAgentAddress(ctx, args ?? {});
|
|
81
155
|
case "agent_quota":
|
|
82
156
|
return runAgentQuota(ctx, args ?? {});
|
|
157
|
+
case "agent_history":
|
|
158
|
+
return runAgentHistory(ctx, args ?? {});
|
|
159
|
+
case "dev_payment_quote":
|
|
160
|
+
return runDevPaymentQuote(ctx, args ?? {});
|
|
83
161
|
case "agent_passport_resolve":
|
|
84
162
|
return runAgentPassportResolve(ctx, args ?? {});
|
|
85
163
|
case "settlement_routes":
|
|
86
164
|
return runSettlementRoutes(ctx, args ?? {});
|
|
87
165
|
case "settlement_invoice":
|
|
88
166
|
return runSettlementInvoice(ctx, args ?? {});
|
|
167
|
+
case "settlement_solana":
|
|
168
|
+
return runSettlementSolana(ctx, args ?? {});
|
|
169
|
+
case "settlement_casper":
|
|
170
|
+
return runSettlementCasper(ctx, args ?? {});
|
|
171
|
+
case "deployment_info":
|
|
172
|
+
return runDeploymentInfo(ctx, args ?? {});
|
|
89
173
|
default:
|
|
90
174
|
return {
|
|
91
175
|
isError: true,
|
|
@@ -93,7 +177,12 @@ export async function createServer(config = {}) {
|
|
|
93
177
|
};
|
|
94
178
|
}
|
|
95
179
|
});
|
|
96
|
-
return {
|
|
180
|
+
return {
|
|
181
|
+
server,
|
|
182
|
+
get agent() {
|
|
183
|
+
return agent;
|
|
184
|
+
},
|
|
185
|
+
};
|
|
97
186
|
}
|
|
98
187
|
function defaultLog(level, msg) {
|
|
99
188
|
process.stderr.write(`[${level}] ${msg}\n`);
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EACL,wBAAw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AE,CAAC,CAAC;YAC9C,KAAK,oBAAoB;gBACvB,OAAO,oBAAoB,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC/C,KAAK,mBAAmB;gBACtB,OAAO,mBAAmB,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC9C,KAAK,mBAAmB;gBACtB,OAAO,mBAAmB,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC9C,KAAK,iBAAiB;gBACpB,OAAO,iBAAiB,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC5C;gBACE,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,IAAI,EAAE,EAAE,CAAC;iBACtE,CAAC;QACN,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,MAAM;QACN,IAAI,KAAK;YACP,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC;AASD,SAAS,UAAU,CAAC,KAAgC,EAAE,GAAW;IAC/D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,IAAI,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-address.d.ts","sourceRoot":"","sources":["../../src/tools/agent-address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"agent-address.d.ts","sourceRoot":"","sources":["../../src/tools/agent-address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8B/B;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;GAWrF"}
|
|
@@ -13,7 +13,10 @@ export function agentAddressTool() {
|
|
|
13
13
|
type: "object",
|
|
14
14
|
properties: {
|
|
15
15
|
solana: { type: "string", description: "Solana base58 address" },
|
|
16
|
-
evm: {
|
|
16
|
+
evm: {
|
|
17
|
+
type: "string",
|
|
18
|
+
description: "EVM address used across EVM networks (Polygon, Base, Arbitrum, Optimism, BNB, Unichain, Avalanche, Robinhood, etc.)",
|
|
19
|
+
},
|
|
17
20
|
casper: {
|
|
18
21
|
type: "string",
|
|
19
22
|
description: "Casper identity derived from the same seed. Read-only in this MCP RC; no payment signing tool is exposed.",
|
|
@@ -32,9 +35,7 @@ export async function runAgentAddress(ctx, _args) {
|
|
|
32
35
|
note: "Read-only address discovery. Payment signing is intentionally absent from this MCP production RC until the final SDK v2 release contains independently trusted deployment pins and paid E2E evidence.",
|
|
33
36
|
};
|
|
34
37
|
return {
|
|
35
|
-
content: [
|
|
36
|
-
{ type: "text", text: JSON.stringify(payload, null, 2) },
|
|
37
|
-
],
|
|
38
|
+
content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
|
|
38
39
|
structuredContent: payload,
|
|
39
40
|
};
|
|
40
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-address.js","sourceRoot":"","sources":["../../src/tools/agent-address.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,2DAA2D;YAC3D,kEAAkE;YAClE,yIAAyI;QAC3I,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK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L,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;QACnE,iBAAiB,EAAE,OAAO;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ToolContext } from "../server.js";
|
|
2
|
+
export declare function agentHistoryTool(): {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: string;
|
|
7
|
+
additionalProperties: boolean;
|
|
8
|
+
properties: {
|
|
9
|
+
address: {
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
passport: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
network: {
|
|
17
|
+
type: string;
|
|
18
|
+
default: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
source: {
|
|
22
|
+
type: string;
|
|
23
|
+
enum: string[];
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
limit: {
|
|
27
|
+
type: string;
|
|
28
|
+
minimum: number;
|
|
29
|
+
maximum: number;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
offset: {
|
|
33
|
+
type: string;
|
|
34
|
+
minimum: number;
|
|
35
|
+
maximum: number;
|
|
36
|
+
default: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
annotations: {
|
|
41
|
+
readOnlyHint: boolean;
|
|
42
|
+
destructiveHint: boolean;
|
|
43
|
+
openWorldHint: boolean;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare function runAgentHistory(ctx: ToolContext, args: Record<string, unknown>): Promise<{
|
|
47
|
+
isError: boolean;
|
|
48
|
+
content: {
|
|
49
|
+
type: string;
|
|
50
|
+
text: string;
|
|
51
|
+
}[];
|
|
52
|
+
} | {
|
|
53
|
+
content: {
|
|
54
|
+
type: string;
|
|
55
|
+
text: string;
|
|
56
|
+
}[];
|
|
57
|
+
}>;
|
|
58
|
+
//# sourceMappingURL=agent-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-history.d.ts","sourceRoot":"","sources":["../../src/tools/agent-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B/B;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;GA2HpF"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { apiUrl } from "../api.js";
|
|
2
|
+
export function agentHistoryTool() {
|
|
3
|
+
return {
|
|
4
|
+
name: "agent_history",
|
|
5
|
+
description: "Read an agent's payment history by EVM address, public passport identifier, or both. Defaults to the current wallet. Transactions are indexed AiFinPay Polygon settlements, not arbitrary wallet transfers. Receipts include retained prepaid batches and test payments. Never pass a seed, private key or API secret as a passport.",
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object",
|
|
8
|
+
additionalProperties: false,
|
|
9
|
+
properties: {
|
|
10
|
+
address: { type: "string" },
|
|
11
|
+
passport: {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: "Public @username, AIFP-… number or aifp_agent_… identifier",
|
|
14
|
+
},
|
|
15
|
+
network: {
|
|
16
|
+
type: "string",
|
|
17
|
+
default: "polygon",
|
|
18
|
+
description: "Exact passport wallet network; indexed transactions currently support polygon only",
|
|
19
|
+
},
|
|
20
|
+
source: { type: "string", enum: ["transactions", "receipts"], default: "transactions" },
|
|
21
|
+
limit: { type: "integer", minimum: 1, maximum: 100, default: 25 },
|
|
22
|
+
offset: { type: "integer", minimum: 0, maximum: 100000, default: 0 },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export async function runAgentHistory(ctx, args) {
|
|
29
|
+
const base = ctx.config.baseUrl || "https://aifinpay.io";
|
|
30
|
+
const source = args.source ?? "transactions", network = args.network ?? "polygon";
|
|
31
|
+
const limit = args.limit ?? 25, offset = args.offset ?? 0;
|
|
32
|
+
const failure = (message) => ({
|
|
33
|
+
isError: true,
|
|
34
|
+
content: [{ type: "text", text: message }],
|
|
35
|
+
});
|
|
36
|
+
if (!Number.isSafeInteger(limit) ||
|
|
37
|
+
Number(limit) < 1 ||
|
|
38
|
+
Number(limit) > 100 ||
|
|
39
|
+
!Number.isSafeInteger(offset) ||
|
|
40
|
+
Number(offset) < 0 ||
|
|
41
|
+
Number(offset) > 100000)
|
|
42
|
+
return failure("Invalid history pagination");
|
|
43
|
+
if (source !== "receipts" && source !== "transactions")
|
|
44
|
+
return failure("Unknown history source");
|
|
45
|
+
async function get(path) {
|
|
46
|
+
const response = await ctx.agent.inner.fetchImpl(apiUrl(base, path), {
|
|
47
|
+
headers: { accept: "application/json" },
|
|
48
|
+
});
|
|
49
|
+
if (!response.ok)
|
|
50
|
+
throw new Error(`HTTP ${response.status} from history/resolver; passport resolution requires a deployed Agent Passport backend`);
|
|
51
|
+
return (await response.json());
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
let address = args.address == null ? undefined : String(args.address);
|
|
55
|
+
if (args.passport) {
|
|
56
|
+
const identifier = String(args.passport).trim();
|
|
57
|
+
if (!/^(@[a-z][a-z0-9_]{2,31}|AIFP-\d{1,18}|aifp_agent_[0-9a-f]{32})$/i.test(identifier)) {
|
|
58
|
+
return failure("passport must be a public @username, AIFP number or aifp_agent_* id; never a secret");
|
|
59
|
+
}
|
|
60
|
+
const resolved = await get(`/api/agent/resolve/${encodeURIComponent(identifier)}`);
|
|
61
|
+
if (resolved?.agent?.status !== "active" || !Array.isArray(resolved.agent.wallets))
|
|
62
|
+
throw new Error("Passport is not active or has no verified wallets");
|
|
63
|
+
const wallets = resolved.agent.wallets.filter((w) => w.network === network && w.chain_family === "evm" && Number(w.verified_at) > 0);
|
|
64
|
+
const wallet = wallets.find((w) => w.is_primary) || wallets[0];
|
|
65
|
+
if (!wallet || typeof wallet.address !== "string")
|
|
66
|
+
throw new Error("Passport has no verified EVM wallet on the requested network");
|
|
67
|
+
if (address && address.toLowerCase() !== wallet.address.toLowerCase())
|
|
68
|
+
throw new Error("Address does not match passport wallet");
|
|
69
|
+
address = wallet.address;
|
|
70
|
+
}
|
|
71
|
+
address ??= ctx.agent.evmAddress;
|
|
72
|
+
if (!/^0x[0-9a-fA-F]{40}$/.test(address))
|
|
73
|
+
return failure("Expected an EVM address");
|
|
74
|
+
const query = new URLSearchParams({ limit: String(limit), offset: String(offset) });
|
|
75
|
+
if (source === "transactions")
|
|
76
|
+
query.set("chain", String(network));
|
|
77
|
+
const body = await get(`/v1/agents/${address.toLowerCase()}/${source}?${query}`);
|
|
78
|
+
if (!Array.isArray(body?.[source]))
|
|
79
|
+
throw new Error("Invalid history response");
|
|
80
|
+
const fields = source === "receipts"
|
|
81
|
+
? [
|
|
82
|
+
"receipt_id",
|
|
83
|
+
"merchant_id",
|
|
84
|
+
"resource",
|
|
85
|
+
"scope",
|
|
86
|
+
"tier",
|
|
87
|
+
"quota",
|
|
88
|
+
"used",
|
|
89
|
+
"remaining",
|
|
90
|
+
"amount",
|
|
91
|
+
"currency",
|
|
92
|
+
"exp",
|
|
93
|
+
"chain",
|
|
94
|
+
"tx_ref",
|
|
95
|
+
"payer",
|
|
96
|
+
"network_mode",
|
|
97
|
+
"settled_at",
|
|
98
|
+
"expires_at",
|
|
99
|
+
"unit_quota",
|
|
100
|
+
"metering_version",
|
|
101
|
+
]
|
|
102
|
+
: [
|
|
103
|
+
"tx_hash",
|
|
104
|
+
"log_index",
|
|
105
|
+
"chain",
|
|
106
|
+
"payment_id",
|
|
107
|
+
"block_number",
|
|
108
|
+
"block_ts",
|
|
109
|
+
"agent_address",
|
|
110
|
+
"merchant_address",
|
|
111
|
+
"token_address",
|
|
112
|
+
"total_amount",
|
|
113
|
+
"merchant_amount",
|
|
114
|
+
"treasury_fee",
|
|
115
|
+
"ip_creator_fee",
|
|
116
|
+
];
|
|
117
|
+
const items = body[source].map((row) => Object.fromEntries(fields.filter((f) => row?.[f] !== undefined).map((f) => [f, row[f]])));
|
|
118
|
+
return {
|
|
119
|
+
content: [
|
|
120
|
+
{
|
|
121
|
+
type: "text",
|
|
122
|
+
text: JSON.stringify({
|
|
123
|
+
address: address.toLowerCase(),
|
|
124
|
+
source,
|
|
125
|
+
items,
|
|
126
|
+
limit,
|
|
127
|
+
offset,
|
|
128
|
+
next_offset: typeof body.next_offset === "number" ? body.next_offset : null,
|
|
129
|
+
coverage: source === "receipts"
|
|
130
|
+
? "Retained receipts only; externally metered quotas may lag"
|
|
131
|
+
: "Indexed AiFinPay Polygon settlements only; excludes arbitrary wallet transfers and may lag the chain",
|
|
132
|
+
}, null, 2),
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
return failure(`History lookup failed: ${error.message}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=agent-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-history.js","sourceRoot":"","sources":["../../src/tools/agent-history.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,sUAAsU;QACxU,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,oBAAoB,EAAE,KAAK;YAC3B,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAA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AAC,CACzF,CAAC;QACF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;wBACE,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE;wBAC9B,MAAM;wBACN,KAAK;wBACL,KAAK;wBACL,MAAM;wBACN,WAAW,EAAE,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI;wBAC3E,QAAQ,EACN,MAAM,KAAK,UAAU;4BACnB,CAAC,CAAC,2DAA2D;4BAC7D,CAAC,CAAC,sGAAsG;qBAC7G,EACD,IAAI,EACJ,CAAC,CACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,OAAO,CAAC,0BAA2B,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-quota.d.ts","sourceRoot":"","sources":["../../src/tools/agent-quota.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"agent-quota.d.ts","sourceRoot":"","sources":["../../src/tools/agent-quota.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;EA0B7B;AAiBD,wBAAsB,aAAa,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;GAqElF"}
|
|
@@ -32,7 +32,9 @@ export async function runAgentQuota(ctx, args) {
|
|
|
32
32
|
const includeExhausted = args.include_exhausted === true;
|
|
33
33
|
let resp;
|
|
34
34
|
try {
|
|
35
|
-
resp = await ctx.agent.inner.fetchImpl(`${base}/v1/agents/${address}/receipts`, {
|
|
35
|
+
resp = await ctx.agent.inner.fetchImpl(`${base}/v1/agents/${address}/receipts`, {
|
|
36
|
+
method: "GET",
|
|
37
|
+
});
|
|
36
38
|
}
|
|
37
39
|
catch (e) {
|
|
38
40
|
const err = e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-quota.js","sourceRoot":"","sources":["../../src/tools/agent-quota.ts"],"names":[],"mappings":"AAuBA,MAAM,YAAY,GAAG,yBAAyB,CAAC;AAE/C,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,wEAAwE;YACxE,qEAAqE;YACrE,oEAAoE;YACpE,uDAAuD;QACzD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,
|
|
1
|
+
{"version":3,"file":"agent-quota.js","sourceRoot":"","sources":["../../src/tools/agent-quota.ts"],"names":[],"mappings":"AAuBA,MAAM,YAAY,GAAG,yBAAyB,CAAC;AAE/C,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,wEAAwE;YACxE,qEAAqE;YACrE,oEAAoE;YACpE,uDAAuD;QACzD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iEAAiE;iBAC/E;gBACD,iBAAiB,EAAE;oBACjB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,KAAK;oBACd,WAAW,EAAE,uEAAuE;iBACrF;aACF;SACF;QACD,0EAA0E;QAC1E,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAA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QACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;KACpD,CAAC;AACJ,CAAC"}
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
import type { ToolContext } from "../server.js";
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function devPaymentQuoteTool(): {
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
5
5
|
inputSchema: {
|
|
6
6
|
type: string;
|
|
7
|
+
additionalProperties: boolean;
|
|
7
8
|
properties: {
|
|
8
|
-
|
|
9
|
+
contract_version: {
|
|
9
10
|
type: string;
|
|
10
|
-
|
|
11
|
+
enum: string[];
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
+
units: {
|
|
13
14
|
type: string;
|
|
14
|
-
|
|
15
|
-
default:
|
|
15
|
+
minimum: number;
|
|
16
|
+
default: number;
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
required: string[];
|
|
19
20
|
};
|
|
20
21
|
annotations: {
|
|
21
22
|
readOnlyHint: boolean;
|
|
22
|
-
openWorldHint: boolean;
|
|
23
23
|
destructiveHint: boolean;
|
|
24
|
-
|
|
25
|
-
outputSchema: {
|
|
26
|
-
type: string;
|
|
24
|
+
openWorldHint: boolean;
|
|
27
25
|
};
|
|
28
26
|
};
|
|
29
|
-
export declare function
|
|
27
|
+
export declare function runDevPaymentQuote(ctx: ToolContext, args: Record<string, unknown>): Promise<{
|
|
30
28
|
isError: boolean;
|
|
31
29
|
content: {
|
|
32
30
|
type: string;
|
|
@@ -38,4 +36,4 @@ export declare function runAgentQuote(ctx: ToolContext, args: Record<string, unk
|
|
|
38
36
|
text: string;
|
|
39
37
|
}[];
|
|
40
38
|
}>;
|
|
41
|
-
//# sourceMappingURL=
|
|
39
|
+
//# sourceMappingURL=dev-payment-quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-payment-quote.d.ts","sourceRoot":"","sources":["../../src/tools/dev-payment-quote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;EAgBlC;AAED,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;GAmEvF"}
|