@fiber-pay/agent 0.1.0-rc.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/README.md +145 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1526 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-tools.d.ts +842 -0
- package/dist/mcp-tools.js +443 -0
- package/dist/mcp-tools.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,842 @@
|
|
|
1
|
+
import * as _fiber_pay_sdk from '@fiber-pay/sdk';
|
|
2
|
+
import { PolicyCheckResult, SecurityPolicy, HexString, InvoiceVerificationResult, PaymentProof, PaymentProofSummary, LiquidityReport } from '@fiber-pay/sdk';
|
|
3
|
+
import { DownloadProgress } from '@fiber-pay/node';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Standard result format for all operations
|
|
7
|
+
* Designed to be easily parsed by AI agents
|
|
8
|
+
*/
|
|
9
|
+
interface AgentResult<T = unknown> {
|
|
10
|
+
success: boolean;
|
|
11
|
+
data?: T;
|
|
12
|
+
error?: {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
15
|
+
recoverable: boolean;
|
|
16
|
+
suggestion?: string;
|
|
17
|
+
};
|
|
18
|
+
metadata?: {
|
|
19
|
+
timestamp: number;
|
|
20
|
+
policyCheck?: PolicyCheckResult;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Balance information in human-readable format
|
|
25
|
+
*/
|
|
26
|
+
interface BalanceInfo {
|
|
27
|
+
/** Total balance across all channels (in CKB) */
|
|
28
|
+
totalCkb: number;
|
|
29
|
+
/** Available to send (in CKB) */
|
|
30
|
+
availableToSend: number;
|
|
31
|
+
/** Available to receive (in CKB) */
|
|
32
|
+
availableToReceive: number;
|
|
33
|
+
/** Number of active channels */
|
|
34
|
+
channelCount: number;
|
|
35
|
+
/** Remaining spending allowance this period (in CKB) */
|
|
36
|
+
spendingAllowance: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Payment result with tracking info
|
|
40
|
+
*/
|
|
41
|
+
interface PaymentResult {
|
|
42
|
+
/** Payment hash for tracking */
|
|
43
|
+
paymentHash: string;
|
|
44
|
+
/** Status of the payment */
|
|
45
|
+
status: 'pending' | 'success' | 'failed';
|
|
46
|
+
/** Amount sent (in CKB) */
|
|
47
|
+
amountCkb: number;
|
|
48
|
+
/** Fee paid (in CKB) */
|
|
49
|
+
feeCkb: number;
|
|
50
|
+
/** Error message if failed */
|
|
51
|
+
failureReason?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Invoice result
|
|
55
|
+
*/
|
|
56
|
+
interface InvoiceResult {
|
|
57
|
+
/** Invoice string to share with payer */
|
|
58
|
+
invoice: string;
|
|
59
|
+
/** Payment hash for tracking */
|
|
60
|
+
paymentHash: string;
|
|
61
|
+
/** Amount to receive (in CKB) */
|
|
62
|
+
amountCkb: number;
|
|
63
|
+
/** Expiry time (ISO string) */
|
|
64
|
+
expiresAt: string;
|
|
65
|
+
/** Status */
|
|
66
|
+
status: 'open' | 'accepted' | 'settled' | 'cancelled';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Hold invoice result (for escrow / conditional payments)
|
|
70
|
+
*/
|
|
71
|
+
interface HoldInvoiceResult {
|
|
72
|
+
/** Invoice string to share with payer */
|
|
73
|
+
invoice: string;
|
|
74
|
+
/** Payment hash for tracking */
|
|
75
|
+
paymentHash: string;
|
|
76
|
+
/** Amount to receive (in CKB) */
|
|
77
|
+
amountCkb: number;
|
|
78
|
+
/** Expiry time (ISO string) */
|
|
79
|
+
expiresAt: string;
|
|
80
|
+
/** Status — starts as 'open', becomes 'accepted' when payer sends */
|
|
81
|
+
status: 'open' | 'accepted' | 'settled' | 'cancelled';
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Channel summary
|
|
85
|
+
*/
|
|
86
|
+
interface ChannelSummary {
|
|
87
|
+
/** Channel ID */
|
|
88
|
+
id: string;
|
|
89
|
+
/** Peer node ID */
|
|
90
|
+
peerId: string;
|
|
91
|
+
/** Local balance (in CKB) */
|
|
92
|
+
localBalanceCkb: number;
|
|
93
|
+
/** Remote balance (in CKB) */
|
|
94
|
+
remoteBalanceCkb: number;
|
|
95
|
+
/** Channel state */
|
|
96
|
+
state: string;
|
|
97
|
+
/** Is public channel */
|
|
98
|
+
isPublic: boolean;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Verification result for invoices
|
|
102
|
+
*/
|
|
103
|
+
type InvoiceValidationResult = InvoiceVerificationResult;
|
|
104
|
+
/**
|
|
105
|
+
* Liquidity analysis result
|
|
106
|
+
*/
|
|
107
|
+
type LiquidityAnalysisResult = LiquidityReport;
|
|
108
|
+
interface FiberPayConfig {
|
|
109
|
+
/** Path to the fnn binary (optional - will auto-download if not provided) */
|
|
110
|
+
binaryPath?: string;
|
|
111
|
+
/** Base directory for all data */
|
|
112
|
+
dataDir: string;
|
|
113
|
+
/** Path to the config file (optional - will use built-in testnet config if not provided) */
|
|
114
|
+
configFilePath?: string;
|
|
115
|
+
/** Security policy */
|
|
116
|
+
policy?: SecurityPolicy;
|
|
117
|
+
/** Key encryption password (recommended: set via FIBER_KEY_PASSWORD env var) */
|
|
118
|
+
keyPassword?: string;
|
|
119
|
+
/** CKB RPC URL */
|
|
120
|
+
ckbRpcUrl?: string;
|
|
121
|
+
/** Chain: mainnet or testnet */
|
|
122
|
+
chain?: 'mainnet' | 'testnet';
|
|
123
|
+
/** Bootstrap nodes */
|
|
124
|
+
bootnodes?: string[];
|
|
125
|
+
/** Auto-start the node */
|
|
126
|
+
autoStart?: boolean;
|
|
127
|
+
/** RPC port */
|
|
128
|
+
rpcPort?: number;
|
|
129
|
+
/** P2P port */
|
|
130
|
+
p2pPort?: number;
|
|
131
|
+
/** Auto-download binary if not found */
|
|
132
|
+
autoDownload?: boolean;
|
|
133
|
+
/** RPC URL for connecting to an existing node (when autoStart is false) */
|
|
134
|
+
rpcUrl?: string;
|
|
135
|
+
/** Enable runtime job orchestration for payments/invoices/channels (default: true) */
|
|
136
|
+
useRuntimeJobs?: boolean;
|
|
137
|
+
/** Optional sqlite path for runtime jobs */
|
|
138
|
+
runtimeJobsDbPath?: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* FiberPay - Main interface for AI agents
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```typescript
|
|
145
|
+
* const fiber = new FiberPay({
|
|
146
|
+
* binaryPath: '/usr/local/bin/fnn',
|
|
147
|
+
* dataDir: '~/.fiber-pay',
|
|
148
|
+
* });
|
|
149
|
+
*
|
|
150
|
+
* await fiber.initialize();
|
|
151
|
+
*
|
|
152
|
+
* // Check balance
|
|
153
|
+
* const balance = await fiber.getBalance();
|
|
154
|
+
*
|
|
155
|
+
* // Send payment
|
|
156
|
+
* const result = await fiber.pay({
|
|
157
|
+
* invoice: 'fibt1...',
|
|
158
|
+
* });
|
|
159
|
+
*
|
|
160
|
+
* // Create invoice to receive payment
|
|
161
|
+
* const invoice = await fiber.createInvoice({
|
|
162
|
+
* amountCkb: 10,
|
|
163
|
+
* description: 'Payment for services',
|
|
164
|
+
* });
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
declare class FiberPay {
|
|
168
|
+
private config;
|
|
169
|
+
private process;
|
|
170
|
+
private rpc;
|
|
171
|
+
private policy;
|
|
172
|
+
private keys;
|
|
173
|
+
private initialized;
|
|
174
|
+
private invoiceVerifier;
|
|
175
|
+
private paymentProofManager;
|
|
176
|
+
private liquidityAnalyzer;
|
|
177
|
+
private runtimeJobStore;
|
|
178
|
+
private runtimeJobManager;
|
|
179
|
+
constructor(config: FiberPayConfig);
|
|
180
|
+
/**
|
|
181
|
+
* Initialize the FiberPay instance
|
|
182
|
+
* - Downloads the binary if needed (and autoDownload is true)
|
|
183
|
+
* - Generates or loads keys
|
|
184
|
+
* - Starts the Fiber node (if autoStart is true)
|
|
185
|
+
* - Connects to RPC
|
|
186
|
+
*/
|
|
187
|
+
initialize(options?: {
|
|
188
|
+
onDownloadProgress?: (progress: DownloadProgress) => void;
|
|
189
|
+
}): Promise<AgentResult<{
|
|
190
|
+
nodeId: string;
|
|
191
|
+
}>>;
|
|
192
|
+
/**
|
|
193
|
+
* Shutdown the FiberPay instance
|
|
194
|
+
*/
|
|
195
|
+
shutdown(): Promise<AgentResult<void>>;
|
|
196
|
+
/**
|
|
197
|
+
* Pay an invoice or send directly to a node
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* // Pay invoice
|
|
201
|
+
* await fiber.pay({ invoice: 'fibt1...' });
|
|
202
|
+
*
|
|
203
|
+
* // Send directly (keysend)
|
|
204
|
+
* await fiber.pay({
|
|
205
|
+
* recipientNodeId: 'QmXXX...',
|
|
206
|
+
* amountCkb: 10,
|
|
207
|
+
* });
|
|
208
|
+
*/
|
|
209
|
+
pay(params: {
|
|
210
|
+
/** Invoice string to pay */
|
|
211
|
+
invoice?: string;
|
|
212
|
+
/** Recipient node ID for keysend */
|
|
213
|
+
recipientNodeId?: string;
|
|
214
|
+
/** Amount in CKB (for keysend) */
|
|
215
|
+
amountCkb?: number;
|
|
216
|
+
/** Maximum fee in CKB */
|
|
217
|
+
maxFeeCkb?: number;
|
|
218
|
+
/** Custom TLV records to attach (up to 2KB) */
|
|
219
|
+
customRecords?: Record<string, HexString>;
|
|
220
|
+
/** Maximum number of MPP parts (e.g. 4) */
|
|
221
|
+
maxParts?: number;
|
|
222
|
+
}): Promise<AgentResult<PaymentResult>>;
|
|
223
|
+
/**
|
|
224
|
+
* Create an invoice to receive payment
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* const invoice = await fiber.createInvoice({
|
|
228
|
+
* amountCkb: 10,
|
|
229
|
+
* description: 'For coffee',
|
|
230
|
+
* expiryMinutes: 60,
|
|
231
|
+
* });
|
|
232
|
+
* console.log(invoice.data?.invoice); // Share this with payer
|
|
233
|
+
*/
|
|
234
|
+
createInvoice(params: {
|
|
235
|
+
/** Amount to receive in CKB */
|
|
236
|
+
amountCkb: number;
|
|
237
|
+
/** Description for the payer */
|
|
238
|
+
description?: string;
|
|
239
|
+
/** Expiry time in minutes (default: 60) */
|
|
240
|
+
expiryMinutes?: number;
|
|
241
|
+
}): Promise<AgentResult<InvoiceResult>>;
|
|
242
|
+
/**
|
|
243
|
+
* Get current balance information
|
|
244
|
+
*/
|
|
245
|
+
getBalance(): Promise<AgentResult<BalanceInfo>>;
|
|
246
|
+
/**
|
|
247
|
+
* Check payment status
|
|
248
|
+
*/
|
|
249
|
+
getPaymentStatus(paymentHash: string): Promise<AgentResult<PaymentResult>>;
|
|
250
|
+
/**
|
|
251
|
+
* Check invoice status
|
|
252
|
+
*/
|
|
253
|
+
getInvoiceStatus(paymentHash: string): Promise<AgentResult<InvoiceResult>>;
|
|
254
|
+
/**
|
|
255
|
+
* List all channels
|
|
256
|
+
*/
|
|
257
|
+
listChannels(): Promise<AgentResult<ChannelSummary[]>>;
|
|
258
|
+
/**
|
|
259
|
+
* Open a new channel
|
|
260
|
+
*/
|
|
261
|
+
openChannel(params: {
|
|
262
|
+
/** Peer node ID or address */
|
|
263
|
+
peer: string;
|
|
264
|
+
/** Funding amount in CKB */
|
|
265
|
+
fundingCkb: number;
|
|
266
|
+
/** Make channel public */
|
|
267
|
+
isPublic?: boolean;
|
|
268
|
+
/**
|
|
269
|
+
* Optional idempotency key for retries.
|
|
270
|
+
* Reuse the same key when retrying the same open intent; use a new key for a distinct open request.
|
|
271
|
+
*/
|
|
272
|
+
idempotencyKey?: string;
|
|
273
|
+
}): Promise<AgentResult<{
|
|
274
|
+
channelId: string;
|
|
275
|
+
}>>;
|
|
276
|
+
/**
|
|
277
|
+
* Close a channel
|
|
278
|
+
*/
|
|
279
|
+
closeChannel(params: {
|
|
280
|
+
/** Channel ID */
|
|
281
|
+
channelId: string;
|
|
282
|
+
/** Force close (unilateral) */
|
|
283
|
+
force?: boolean;
|
|
284
|
+
}): Promise<AgentResult<void>>;
|
|
285
|
+
/**
|
|
286
|
+
* Get node information
|
|
287
|
+
*/
|
|
288
|
+
getNodeInfo(): Promise<AgentResult<{
|
|
289
|
+
nodeId: string;
|
|
290
|
+
version: string;
|
|
291
|
+
channelCount: number;
|
|
292
|
+
peersCount: number;
|
|
293
|
+
}>>;
|
|
294
|
+
/**
|
|
295
|
+
* Validate an invoice before payment
|
|
296
|
+
* Checks format, expiry, amount, cryptographic correctness, and peer connectivity
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* ```typescript
|
|
300
|
+
* const validation = await fiber.validateInvoice('fibt1...');
|
|
301
|
+
* if (validation.data?.recommendation === 'reject') {
|
|
302
|
+
* console.log('Do not pay:', validation.data.reason);
|
|
303
|
+
* }
|
|
304
|
+
* ```
|
|
305
|
+
*/
|
|
306
|
+
validateInvoice(invoice: string): Promise<AgentResult<InvoiceValidationResult>>;
|
|
307
|
+
/**
|
|
308
|
+
* Get payment proof (cryptographic evidence of payment)
|
|
309
|
+
* Returns stored proof if available, or creates one from RPC status
|
|
310
|
+
*/
|
|
311
|
+
getPaymentProof(paymentHash: string): Promise<AgentResult<{
|
|
312
|
+
proof: PaymentProof | null;
|
|
313
|
+
verified: boolean;
|
|
314
|
+
status: string;
|
|
315
|
+
}>>;
|
|
316
|
+
/**
|
|
317
|
+
* Get payment proof summary for audit trail
|
|
318
|
+
*/
|
|
319
|
+
getPaymentProofSummary(): Promise<AgentResult<PaymentProofSummary>>;
|
|
320
|
+
/**
|
|
321
|
+
* Export payment audit report
|
|
322
|
+
*/
|
|
323
|
+
getPaymentAuditReport(options?: {
|
|
324
|
+
startTime?: number;
|
|
325
|
+
endTime?: number;
|
|
326
|
+
}): Promise<AgentResult<string>>;
|
|
327
|
+
/**
|
|
328
|
+
* Create a hold invoice (for escrow / conditional payments)
|
|
329
|
+
* The payer's funds are held until you explicitly settle with the preimage,
|
|
330
|
+
* or cancelled if you don't settle before expiry.
|
|
331
|
+
*
|
|
332
|
+
* @example
|
|
333
|
+
* ```typescript
|
|
334
|
+
* const invoice = await fiber.createHoldInvoice({
|
|
335
|
+
* amountCkb: 10,
|
|
336
|
+
* paymentHash: '0x...', // SHA-256 hash of your secret preimage
|
|
337
|
+
* description: 'Escrow for service',
|
|
338
|
+
* });
|
|
339
|
+
* // Share invoice.data.invoice with the payer
|
|
340
|
+
* // When conditions are met, call settleInvoice() with the preimage
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
createHoldInvoice(params: {
|
|
344
|
+
/** Amount to receive in CKB */
|
|
345
|
+
amountCkb: number;
|
|
346
|
+
/** Payment hash (SHA-256 of preimage you control) */
|
|
347
|
+
paymentHash: string;
|
|
348
|
+
/** Description for the payer */
|
|
349
|
+
description?: string;
|
|
350
|
+
/** Expiry time in minutes (default: 60) */
|
|
351
|
+
expiryMinutes?: number;
|
|
352
|
+
}): Promise<AgentResult<HoldInvoiceResult>>;
|
|
353
|
+
/**
|
|
354
|
+
* Settle a hold invoice by revealing the preimage
|
|
355
|
+
* This releases the held funds to you. No policy check needed since
|
|
356
|
+
* settling receives money, it doesn't spend it.
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```typescript
|
|
360
|
+
* await fiber.settleInvoice({
|
|
361
|
+
* paymentHash: '0x...',
|
|
362
|
+
* preimage: '0x...', // The secret preimage whose hash matches paymentHash
|
|
363
|
+
* });
|
|
364
|
+
* ```
|
|
365
|
+
*/
|
|
366
|
+
settleInvoice(params: {
|
|
367
|
+
/** Payment hash of the hold invoice */
|
|
368
|
+
paymentHash: string;
|
|
369
|
+
/** Preimage that hashes to the payment hash */
|
|
370
|
+
preimage: string;
|
|
371
|
+
}): Promise<AgentResult<void>>;
|
|
372
|
+
/**
|
|
373
|
+
* Wait for a payment to complete (Success or Failed)
|
|
374
|
+
* Wraps the SDK-level polling helper with AgentResult return type.
|
|
375
|
+
*/
|
|
376
|
+
waitForPayment(paymentHash: string, options?: {
|
|
377
|
+
/** Timeout in ms (default: 120000) */
|
|
378
|
+
timeoutMs?: number;
|
|
379
|
+
}): Promise<AgentResult<PaymentResult>>;
|
|
380
|
+
/**
|
|
381
|
+
* Wait for a channel to become ready (ChannelReady state)
|
|
382
|
+
* Useful after opening a channel — waits for on-chain confirmation.
|
|
383
|
+
*/
|
|
384
|
+
waitForChannelReady(channelId: string, options?: {
|
|
385
|
+
/** Timeout in ms (default: 300000 = 5 min) */
|
|
386
|
+
timeoutMs?: number;
|
|
387
|
+
}): Promise<AgentResult<ChannelSummary>>;
|
|
388
|
+
/**
|
|
389
|
+
* Analyze liquidity across all channels
|
|
390
|
+
* Provides detailed health metrics and recommendations
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* ```typescript
|
|
394
|
+
* const analysis = await fiber.analyzeLiquidity();
|
|
395
|
+
* console.log(`Health score: ${analysis.data?.channels.averageHealthScore}`);
|
|
396
|
+
* console.log(analysis.data?.summary);
|
|
397
|
+
* ```
|
|
398
|
+
*/
|
|
399
|
+
analyzeLiquidity(): Promise<AgentResult<LiquidityAnalysisResult>>;
|
|
400
|
+
/**
|
|
401
|
+
* Check if you have enough liquidity to send a specific amount
|
|
402
|
+
*/
|
|
403
|
+
canSend(amountCkb: number): Promise<AgentResult<{
|
|
404
|
+
canSend: boolean;
|
|
405
|
+
shortfallCkb: number;
|
|
406
|
+
availableCkb: number;
|
|
407
|
+
recommendation: string;
|
|
408
|
+
}>>;
|
|
409
|
+
/**
|
|
410
|
+
* Get remaining spending allowance
|
|
411
|
+
*/
|
|
412
|
+
getSpendingAllowance(): {
|
|
413
|
+
perTransactionCkb: number;
|
|
414
|
+
perWindowCkb: number;
|
|
415
|
+
};
|
|
416
|
+
/**
|
|
417
|
+
* Get audit log
|
|
418
|
+
*/
|
|
419
|
+
getAuditLog(options?: {
|
|
420
|
+
limit?: number;
|
|
421
|
+
since?: number;
|
|
422
|
+
}): _fiber_pay_sdk.AuditLogEntry[];
|
|
423
|
+
private ensureInitialized;
|
|
424
|
+
private getRpc;
|
|
425
|
+
private waitForRuntimeJobTerminal;
|
|
426
|
+
/**
|
|
427
|
+
* Map RPC CkbInvoiceStatus to agent-level status string
|
|
428
|
+
*/
|
|
429
|
+
private mapInvoiceStatus;
|
|
430
|
+
private getInvoiceExpiryIso;
|
|
431
|
+
private getAttributeU64;
|
|
432
|
+
private errorResult;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Create a FiberPay instance with sensible defaults
|
|
436
|
+
* Binary will be auto-downloaded if not provided
|
|
437
|
+
*/
|
|
438
|
+
declare function createFiberPay(options?: {
|
|
439
|
+
/** Path to the fnn binary (optional - will auto-download if not provided) */
|
|
440
|
+
binaryPath?: string;
|
|
441
|
+
/** Base directory for data */
|
|
442
|
+
dataDir?: string;
|
|
443
|
+
/** Path to the config file (optional - will use built-in testnet config if not provided) */
|
|
444
|
+
configFilePath?: string;
|
|
445
|
+
/** Network: testnet or mainnet */
|
|
446
|
+
network?: 'testnet' | 'mainnet';
|
|
447
|
+
/** Chain: testnet or mainnet (alias for network) */
|
|
448
|
+
chain?: 'testnet' | 'mainnet';
|
|
449
|
+
/** Auto-download binary if not found (default: true) */
|
|
450
|
+
autoDownload?: boolean;
|
|
451
|
+
/** Auto-start the Fiber node on initialize (default: true) */
|
|
452
|
+
autoStart?: boolean;
|
|
453
|
+
/** RPC URL to connect to an existing node (overrides autoStart) */
|
|
454
|
+
rpcUrl?: string;
|
|
455
|
+
/** Key encryption password */
|
|
456
|
+
keyPassword?: string;
|
|
457
|
+
}): FiberPay;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Tool definitions for MCP integration
|
|
461
|
+
* Each tool has:
|
|
462
|
+
* - name: unique identifier
|
|
463
|
+
* - description: what the tool does (shown to the LLM)
|
|
464
|
+
* - inputSchema: JSON Schema for parameters
|
|
465
|
+
*/
|
|
466
|
+
declare const MCP_TOOLS: {
|
|
467
|
+
readonly fiber_pay: {
|
|
468
|
+
readonly name: "fiber_pay";
|
|
469
|
+
readonly description: "Pay an invoice or send CKB directly to a node on the Lightning Network.\n \nExamples:\n- Pay an invoice: fiber_pay({ invoice: \"fibt1...\" })\n- Send directly: fiber_pay({ recipientNodeId: \"QmXXX...\", amountCkb: 10 })\n\nReturns payment status and tracking hash.";
|
|
470
|
+
readonly inputSchema: {
|
|
471
|
+
readonly type: "object";
|
|
472
|
+
readonly properties: {
|
|
473
|
+
readonly invoice: {
|
|
474
|
+
readonly type: "string";
|
|
475
|
+
readonly description: "Lightning invoice string to pay (starts with fibt or fibb)";
|
|
476
|
+
};
|
|
477
|
+
readonly recipientNodeId: {
|
|
478
|
+
readonly type: "string";
|
|
479
|
+
readonly description: "Recipient node ID for direct payment (keysend)";
|
|
480
|
+
};
|
|
481
|
+
readonly amountCkb: {
|
|
482
|
+
readonly type: "number";
|
|
483
|
+
readonly description: "Amount to send in CKB (required for keysend)";
|
|
484
|
+
};
|
|
485
|
+
readonly maxFeeCkb: {
|
|
486
|
+
readonly type: "number";
|
|
487
|
+
readonly description: "Maximum fee willing to pay in CKB";
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
readonly oneOf: readonly [{
|
|
491
|
+
readonly required: readonly ["invoice"];
|
|
492
|
+
}, {
|
|
493
|
+
readonly required: readonly ["recipientNodeId", "amountCkb"];
|
|
494
|
+
}];
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
readonly fiber_create_invoice: {
|
|
498
|
+
readonly name: "fiber_create_invoice";
|
|
499
|
+
readonly description: "Create an invoice to receive payment.\n \nExample: fiber_create_invoice({ amountCkb: 10, description: \"For coffee\" })\n\nReturns invoice string to share with payer.";
|
|
500
|
+
readonly inputSchema: {
|
|
501
|
+
readonly type: "object";
|
|
502
|
+
readonly properties: {
|
|
503
|
+
readonly amountCkb: {
|
|
504
|
+
readonly type: "number";
|
|
505
|
+
readonly description: "Amount to receive in CKB";
|
|
506
|
+
};
|
|
507
|
+
readonly description: {
|
|
508
|
+
readonly type: "string";
|
|
509
|
+
readonly description: "Description for the payer";
|
|
510
|
+
};
|
|
511
|
+
readonly expiryMinutes: {
|
|
512
|
+
readonly type: "number";
|
|
513
|
+
readonly description: "Invoice expiry time in minutes (default: 60)";
|
|
514
|
+
};
|
|
515
|
+
};
|
|
516
|
+
readonly required: readonly ["amountCkb"];
|
|
517
|
+
};
|
|
518
|
+
};
|
|
519
|
+
readonly fiber_get_balance: {
|
|
520
|
+
readonly name: "fiber_get_balance";
|
|
521
|
+
readonly description: "Get current balance information including:\n- Total balance in CKB\n- Available to send\n- Available to receive\n- Number of channels\n- Remaining spending allowance\n\nNo parameters required.";
|
|
522
|
+
readonly inputSchema: {
|
|
523
|
+
readonly type: "object";
|
|
524
|
+
readonly properties: {};
|
|
525
|
+
};
|
|
526
|
+
};
|
|
527
|
+
readonly fiber_get_payment_status: {
|
|
528
|
+
readonly name: "fiber_get_payment_status";
|
|
529
|
+
readonly description: "Check the status of a payment by its hash.\n \nExample: fiber_get_payment_status({ paymentHash: \"0x...\" })";
|
|
530
|
+
readonly inputSchema: {
|
|
531
|
+
readonly type: "object";
|
|
532
|
+
readonly properties: {
|
|
533
|
+
readonly paymentHash: {
|
|
534
|
+
readonly type: "string";
|
|
535
|
+
readonly description: "Payment hash to check";
|
|
536
|
+
};
|
|
537
|
+
};
|
|
538
|
+
readonly required: readonly ["paymentHash"];
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
readonly fiber_get_invoice_status: {
|
|
542
|
+
readonly name: "fiber_get_invoice_status";
|
|
543
|
+
readonly description: "Check the status of an invoice (whether it's been paid).\n \nExample: fiber_get_invoice_status({ paymentHash: \"0x...\" })";
|
|
544
|
+
readonly inputSchema: {
|
|
545
|
+
readonly type: "object";
|
|
546
|
+
readonly properties: {
|
|
547
|
+
readonly paymentHash: {
|
|
548
|
+
readonly type: "string";
|
|
549
|
+
readonly description: "Payment hash of the invoice";
|
|
550
|
+
};
|
|
551
|
+
};
|
|
552
|
+
readonly required: readonly ["paymentHash"];
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
readonly fiber_list_channels: {
|
|
556
|
+
readonly name: "fiber_list_channels";
|
|
557
|
+
readonly description: "List all payment channels with their balances and states.\n\nNo parameters required.";
|
|
558
|
+
readonly inputSchema: {
|
|
559
|
+
readonly type: "object";
|
|
560
|
+
readonly properties: {};
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
readonly fiber_open_channel: {
|
|
564
|
+
readonly name: "fiber_open_channel";
|
|
565
|
+
readonly description: "Open a new payment channel with a peer.\n \nExample: fiber_open_channel({ \n peer: \"/ip4/x.x.x.x/tcp/8228/p2p/QmXXX...\", \n fundingCkb: 100 \n})\n\nNote: This requires on-chain CKB for funding.";
|
|
566
|
+
readonly inputSchema: {
|
|
567
|
+
readonly type: "object";
|
|
568
|
+
readonly properties: {
|
|
569
|
+
readonly peer: {
|
|
570
|
+
readonly type: "string";
|
|
571
|
+
readonly description: "Peer multiaddr or node ID";
|
|
572
|
+
};
|
|
573
|
+
readonly fundingCkb: {
|
|
574
|
+
readonly type: "number";
|
|
575
|
+
readonly description: "Amount of CKB to fund the channel";
|
|
576
|
+
};
|
|
577
|
+
readonly isPublic: {
|
|
578
|
+
readonly type: "boolean";
|
|
579
|
+
readonly description: "Whether to make the channel public (default: true)";
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
readonly required: readonly ["peer", "fundingCkb"];
|
|
583
|
+
};
|
|
584
|
+
};
|
|
585
|
+
readonly fiber_close_channel: {
|
|
586
|
+
readonly name: "fiber_close_channel";
|
|
587
|
+
readonly description: "Close a payment channel and settle funds on-chain.\n \nExample: fiber_close_channel({ channelId: \"0x...\" })\n\nUse force: true only if peer is unresponsive.";
|
|
588
|
+
readonly inputSchema: {
|
|
589
|
+
readonly type: "object";
|
|
590
|
+
readonly properties: {
|
|
591
|
+
readonly channelId: {
|
|
592
|
+
readonly type: "string";
|
|
593
|
+
readonly description: "Channel ID to close";
|
|
594
|
+
};
|
|
595
|
+
readonly force: {
|
|
596
|
+
readonly type: "boolean";
|
|
597
|
+
readonly description: "Force close (unilateral, use only if peer unresponsive)";
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
readonly required: readonly ["channelId"];
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
readonly fiber_get_node_info: {
|
|
604
|
+
readonly name: "fiber_get_node_info";
|
|
605
|
+
readonly description: "Get information about this node including node ID, public key, and statistics.\n\nNo parameters required.";
|
|
606
|
+
readonly inputSchema: {
|
|
607
|
+
readonly type: "object";
|
|
608
|
+
readonly properties: {};
|
|
609
|
+
};
|
|
610
|
+
};
|
|
611
|
+
readonly fiber_get_spending_allowance: {
|
|
612
|
+
readonly name: "fiber_get_spending_allowance";
|
|
613
|
+
readonly description: "Get remaining spending allowance based on security policy.\n\nReturns:\n- Per-transaction limit in CKB\n- Remaining allowance for current time window\n\nNo parameters required.";
|
|
614
|
+
readonly inputSchema: {
|
|
615
|
+
readonly type: "object";
|
|
616
|
+
readonly properties: {};
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
readonly fiber_download_binary: {
|
|
620
|
+
readonly name: "fiber_download_binary";
|
|
621
|
+
readonly description: "Download and install the Fiber Network Node (fnn) binary for the current platform.\n\nThis is required before using any Fiber payment features. The binary will be automatically \ndownloaded from GitHub releases and installed to the data directory.\n\nExamples:\n- Download latest: fiber_download_binary({})\n- Download specific version: fiber_download_binary({ version: \"v0.4.0\" })\n- Force re-download: fiber_download_binary({ force: true })\n\nReturns the path to the installed binary.";
|
|
622
|
+
readonly inputSchema: {
|
|
623
|
+
readonly type: "object";
|
|
624
|
+
readonly properties: {
|
|
625
|
+
readonly version: {
|
|
626
|
+
readonly type: "string";
|
|
627
|
+
readonly description: "Specific version to download (e.g., \"v0.4.0\"). Defaults to latest.";
|
|
628
|
+
};
|
|
629
|
+
readonly force: {
|
|
630
|
+
readonly type: "boolean";
|
|
631
|
+
readonly description: "Force re-download even if binary already exists";
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
readonly fiber_validate_invoice: {
|
|
637
|
+
readonly name: "fiber_validate_invoice";
|
|
638
|
+
readonly description: "Validate an invoice before payment. Checks format, cryptographic correctness, expiry, \namount, and peer connectivity. Returns recommendation to proceed, warn, or reject.\n\nUse this BEFORE paying an invoice to ensure safety.\n\nExample: fiber_validate_invoice({ invoice: \"fibt1...\" })\n\nReturns:\n- valid: boolean (overall validity)\n- details: parsed invoice details (amount, expiry, payment hash)\n- checks: individual validation results (format, expiry, amount, preimage, peer)\n- issues: list of warnings and critical issues found\n- recommendation: 'proceed' | 'warn' | 'reject'\n- reason: human-readable recommendation reason";
|
|
639
|
+
readonly inputSchema: {
|
|
640
|
+
readonly type: "object";
|
|
641
|
+
readonly properties: {
|
|
642
|
+
readonly invoice: {
|
|
643
|
+
readonly type: "string";
|
|
644
|
+
readonly description: "Invoice string to validate (starts with fibt or fibb)";
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
readonly required: readonly ["invoice"];
|
|
648
|
+
};
|
|
649
|
+
};
|
|
650
|
+
readonly fiber_get_payment_proof: {
|
|
651
|
+
readonly name: "fiber_get_payment_proof";
|
|
652
|
+
readonly description: "Get cryptographic proof of payment execution. Useful for audit trail and reconciliation.\n\nExample: fiber_get_payment_proof({ paymentHash: \"0x...\" })\n\nReturns stored payment proof including:\n- Invoice original\n- Preimage (if available)\n- Fee breakdown\n- Verification status\n- Proof metadata";
|
|
653
|
+
readonly inputSchema: {
|
|
654
|
+
readonly type: "object";
|
|
655
|
+
readonly properties: {
|
|
656
|
+
readonly paymentHash: {
|
|
657
|
+
readonly type: "string";
|
|
658
|
+
readonly description: "Payment hash to retrieve proof for";
|
|
659
|
+
};
|
|
660
|
+
};
|
|
661
|
+
readonly required: readonly ["paymentHash"];
|
|
662
|
+
};
|
|
663
|
+
};
|
|
664
|
+
readonly fiber_analyze_liquidity: {
|
|
665
|
+
readonly name: "fiber_analyze_liquidity";
|
|
666
|
+
readonly description: "Comprehensive liquidity analysis across all channels. Provides health metrics,\nidentifies issues, and generates recommendations for rebalancing and funding.\n\nUse this to:\n- Understand current channel health\n- Identify liquidity gaps\n- Get rebalancing recommendations\n- Estimate available runway\n\nNo parameters required.\n\nReturns:\n- balance: total, available to send/receive\n- channels: health metrics for each channel\n- liquidity: gaps and runway estimation\n- recommendations: rebalance suggestions and funding needs\n- summary: human-readable status";
|
|
667
|
+
readonly inputSchema: {
|
|
668
|
+
readonly type: "object";
|
|
669
|
+
readonly properties: {};
|
|
670
|
+
};
|
|
671
|
+
};
|
|
672
|
+
readonly fiber_can_send: {
|
|
673
|
+
readonly name: "fiber_can_send";
|
|
674
|
+
readonly description: "Check if you have enough liquidity to send a specific amount. Returns shortfall \nif insufficient and recommendations.\n\nUse this BEFORE attempting a payment to verify you have enough liquidity.\n\nExample: fiber_can_send({ amountCkb: 100 })\n\nReturns:\n- canSend: boolean\n- shortfallCkb: missing amount (0 if can send)\n- availableCkb: current available balance\n- recommendation: what to do if insufficient";
|
|
675
|
+
readonly inputSchema: {
|
|
676
|
+
readonly type: "object";
|
|
677
|
+
readonly properties: {
|
|
678
|
+
readonly amountCkb: {
|
|
679
|
+
readonly type: "number";
|
|
680
|
+
readonly description: "Amount in CKB to check";
|
|
681
|
+
};
|
|
682
|
+
};
|
|
683
|
+
readonly required: readonly ["amountCkb"];
|
|
684
|
+
};
|
|
685
|
+
};
|
|
686
|
+
readonly fiber_create_hold_invoice: {
|
|
687
|
+
readonly name: "fiber_create_hold_invoice";
|
|
688
|
+
readonly description: "Create a hold invoice for escrow or conditional payments.\n \nA hold invoice locks the payer's funds until you explicitly settle with the preimage,\nor the invoice expires. This enables escrow patterns without a trusted third party.\n\nExample: fiber_create_hold_invoice({ \n amountCkb: 10, \n paymentHash: \"0x...\", \n description: \"Escrow for service delivery\" \n})\n\nFlow:\n1. Generate a secret preimage and compute its SHA-256 hash\n2. Create hold invoice with the hash\n3. Share invoice with payer — their funds are held when they pay\n4. When conditions are met, call fiber_settle_invoice with the preimage\n5. If conditions are NOT met, let the invoice expire (funds return to payer)\n\nReturns invoice string and payment hash.";
|
|
689
|
+
readonly inputSchema: {
|
|
690
|
+
readonly type: "object";
|
|
691
|
+
readonly properties: {
|
|
692
|
+
readonly amountCkb: {
|
|
693
|
+
readonly type: "number";
|
|
694
|
+
readonly description: "Amount to receive in CKB";
|
|
695
|
+
};
|
|
696
|
+
readonly paymentHash: {
|
|
697
|
+
readonly type: "string";
|
|
698
|
+
readonly description: "SHA-256 hash of your secret preimage (0x-prefixed hex)";
|
|
699
|
+
};
|
|
700
|
+
readonly description: {
|
|
701
|
+
readonly type: "string";
|
|
702
|
+
readonly description: "Description for the payer";
|
|
703
|
+
};
|
|
704
|
+
readonly expiryMinutes: {
|
|
705
|
+
readonly type: "number";
|
|
706
|
+
readonly description: "Invoice expiry time in minutes (default: 60)";
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
readonly required: readonly ["amountCkb", "paymentHash"];
|
|
710
|
+
};
|
|
711
|
+
};
|
|
712
|
+
readonly fiber_settle_invoice: {
|
|
713
|
+
readonly name: "fiber_settle_invoice";
|
|
714
|
+
readonly description: "Settle a hold invoice by revealing the preimage.\n \nThis releases the held funds to you. Only call this after conditions are met.\nThe preimage must hash (SHA-256) to the payment_hash used when creating the hold invoice.\n\nExample: fiber_settle_invoice({ \n paymentHash: \"0x...\", \n preimage: \"0x...\" \n})";
|
|
715
|
+
readonly inputSchema: {
|
|
716
|
+
readonly type: "object";
|
|
717
|
+
readonly properties: {
|
|
718
|
+
readonly paymentHash: {
|
|
719
|
+
readonly type: "string";
|
|
720
|
+
readonly description: "Payment hash of the hold invoice";
|
|
721
|
+
};
|
|
722
|
+
readonly preimage: {
|
|
723
|
+
readonly type: "string";
|
|
724
|
+
readonly description: "Secret preimage (0x-prefixed hex, 32 bytes)";
|
|
725
|
+
};
|
|
726
|
+
};
|
|
727
|
+
readonly required: readonly ["paymentHash", "preimage"];
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
readonly fiber_wait_for_payment: {
|
|
731
|
+
readonly name: "fiber_wait_for_payment";
|
|
732
|
+
readonly description: "Wait for a payment to complete (reach Success or Failed status).\n \nPolls the payment status until it reaches a terminal state. Useful after sending\na payment to wait for confirmation.\n\nExample: fiber_wait_for_payment({ paymentHash: \"0x...\", timeoutMs: 60000 })\n\nReturns the final payment status.";
|
|
733
|
+
readonly inputSchema: {
|
|
734
|
+
readonly type: "object";
|
|
735
|
+
readonly properties: {
|
|
736
|
+
readonly paymentHash: {
|
|
737
|
+
readonly type: "string";
|
|
738
|
+
readonly description: "Payment hash to wait for";
|
|
739
|
+
};
|
|
740
|
+
readonly timeoutMs: {
|
|
741
|
+
readonly type: "number";
|
|
742
|
+
readonly description: "Timeout in milliseconds (default: 120000 = 2 min)";
|
|
743
|
+
};
|
|
744
|
+
};
|
|
745
|
+
readonly required: readonly ["paymentHash"];
|
|
746
|
+
};
|
|
747
|
+
};
|
|
748
|
+
readonly fiber_wait_for_channel_ready: {
|
|
749
|
+
readonly name: "fiber_wait_for_channel_ready";
|
|
750
|
+
readonly description: "Wait for a channel to become ready after opening.\n \nAfter opening a channel, it takes time for the funding transaction to be confirmed\non-chain. This tool polls until the channel reaches ChannelReady state.\n\nExample: fiber_wait_for_channel_ready({ channelId: \"0x...\", timeoutMs: 300000 })\n\nReturns channel info once ready.";
|
|
751
|
+
readonly inputSchema: {
|
|
752
|
+
readonly type: "object";
|
|
753
|
+
readonly properties: {
|
|
754
|
+
readonly channelId: {
|
|
755
|
+
readonly type: "string";
|
|
756
|
+
readonly description: "Channel ID to wait for";
|
|
757
|
+
};
|
|
758
|
+
readonly timeoutMs: {
|
|
759
|
+
readonly type: "number";
|
|
760
|
+
readonly description: "Timeout in milliseconds (default: 300000 = 5 min)";
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
readonly required: readonly ["channelId"];
|
|
764
|
+
};
|
|
765
|
+
};
|
|
766
|
+
};
|
|
767
|
+
type McpToolName = keyof typeof MCP_TOOLS;
|
|
768
|
+
type EmptyInput = Record<string, never>;
|
|
769
|
+
type McpToolInput<T extends McpToolName> = T extends 'fiber_pay' ? {
|
|
770
|
+
invoice?: string;
|
|
771
|
+
recipientNodeId?: string;
|
|
772
|
+
amountCkb?: number;
|
|
773
|
+
maxFeeCkb?: number;
|
|
774
|
+
customRecords?: Record<string, string>;
|
|
775
|
+
maxParts?: number;
|
|
776
|
+
} : T extends 'fiber_create_invoice' ? {
|
|
777
|
+
amountCkb: number;
|
|
778
|
+
description?: string;
|
|
779
|
+
expiryMinutes?: number;
|
|
780
|
+
} : T extends 'fiber_get_balance' ? EmptyInput : T extends 'fiber_get_payment_status' ? {
|
|
781
|
+
paymentHash: string;
|
|
782
|
+
} : T extends 'fiber_get_invoice_status' ? {
|
|
783
|
+
paymentHash: string;
|
|
784
|
+
} : T extends 'fiber_list_channels' ? EmptyInput : T extends 'fiber_open_channel' ? {
|
|
785
|
+
peer: string;
|
|
786
|
+
fundingCkb: number;
|
|
787
|
+
isPublic?: boolean;
|
|
788
|
+
} : T extends 'fiber_close_channel' ? {
|
|
789
|
+
channelId: string;
|
|
790
|
+
force?: boolean;
|
|
791
|
+
} : T extends 'fiber_get_node_info' ? EmptyInput : T extends 'fiber_get_spending_allowance' ? EmptyInput : T extends 'fiber_download_binary' ? {
|
|
792
|
+
version?: string;
|
|
793
|
+
force?: boolean;
|
|
794
|
+
} : T extends 'fiber_validate_invoice' ? {
|
|
795
|
+
invoice: string;
|
|
796
|
+
} : T extends 'fiber_get_payment_proof' ? {
|
|
797
|
+
paymentHash: string;
|
|
798
|
+
} : T extends 'fiber_analyze_liquidity' ? EmptyInput : T extends 'fiber_can_send' ? {
|
|
799
|
+
amountCkb: number;
|
|
800
|
+
} : T extends 'fiber_create_hold_invoice' ? {
|
|
801
|
+
amountCkb: number;
|
|
802
|
+
paymentHash: string;
|
|
803
|
+
description?: string;
|
|
804
|
+
expiryMinutes?: number;
|
|
805
|
+
} : T extends 'fiber_settle_invoice' ? {
|
|
806
|
+
paymentHash: string;
|
|
807
|
+
preimage: string;
|
|
808
|
+
} : T extends 'fiber_wait_for_payment' ? {
|
|
809
|
+
paymentHash: string;
|
|
810
|
+
timeoutMs?: number;
|
|
811
|
+
} : T extends 'fiber_wait_for_channel_ready' ? {
|
|
812
|
+
channelId: string;
|
|
813
|
+
timeoutMs?: number;
|
|
814
|
+
} : never;
|
|
815
|
+
type McpToolResult<T extends McpToolName> = T extends 'fiber_pay' ? AgentResult<PaymentResult> : T extends 'fiber_create_invoice' ? AgentResult<InvoiceResult> : T extends 'fiber_get_balance' ? AgentResult<BalanceInfo> : T extends 'fiber_get_payment_status' ? AgentResult<PaymentResult> : T extends 'fiber_get_invoice_status' ? AgentResult<InvoiceResult> : T extends 'fiber_list_channels' ? AgentResult<ChannelSummary[]> : T extends 'fiber_open_channel' ? AgentResult<{
|
|
816
|
+
channelId: string;
|
|
817
|
+
}> : T extends 'fiber_close_channel' ? AgentResult<void> : T extends 'fiber_get_node_info' ? AgentResult<{
|
|
818
|
+
nodeId: string;
|
|
819
|
+
publicKey: string;
|
|
820
|
+
version: string;
|
|
821
|
+
channelCount: number;
|
|
822
|
+
peersCount: number;
|
|
823
|
+
}> : T extends 'fiber_get_spending_allowance' ? {
|
|
824
|
+
perTransactionCkb: number;
|
|
825
|
+
perWindowCkb: number;
|
|
826
|
+
} : T extends 'fiber_download_binary' ? AgentResult<{
|
|
827
|
+
path: string;
|
|
828
|
+
version: string;
|
|
829
|
+
platform: string;
|
|
830
|
+
arch: string;
|
|
831
|
+
}> : T extends 'fiber_validate_invoice' ? AgentResult<InvoiceValidationResult> : T extends 'fiber_get_payment_proof' ? AgentResult<{
|
|
832
|
+
proof: PaymentProof | null;
|
|
833
|
+
verified: boolean;
|
|
834
|
+
status: string;
|
|
835
|
+
}> : T extends 'fiber_analyze_liquidity' ? AgentResult<LiquidityAnalysisResult> : T extends 'fiber_can_send' ? AgentResult<{
|
|
836
|
+
canSend: boolean;
|
|
837
|
+
shortfallCkb: number;
|
|
838
|
+
availableCkb: number;
|
|
839
|
+
recommendation: string;
|
|
840
|
+
}> : T extends 'fiber_create_hold_invoice' ? AgentResult<HoldInvoiceResult> : T extends 'fiber_settle_invoice' ? AgentResult<void> : T extends 'fiber_wait_for_payment' ? AgentResult<PaymentResult> : T extends 'fiber_wait_for_channel_ready' ? AgentResult<ChannelSummary> : never;
|
|
841
|
+
|
|
842
|
+
export { type AgentResult as A, type BalanceInfo as B, type ChannelSummary as C, FiberPay as F, type HoldInvoiceResult as H, type InvoiceResult as I, MCP_TOOLS, type McpToolInput, type McpToolName, type McpToolResult, type PaymentResult as P, type FiberPayConfig as a, createFiberPay as c };
|