keymaster-connect 0.2.0 → 0.4.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/README.md +47 -4
- package/dist/chunk-7ZOCLB2S.js +68 -0
- package/dist/chunk-7ZOCLB2S.js.map +1 -0
- package/dist/{chunk-FUIH6ZOG.js → chunk-QUZZ2OXO.js} +25 -3
- package/dist/chunk-QUZZ2OXO.js.map +1 -0
- package/dist/index.d.ts +82 -27
- package/dist/index.js +104 -32
- package/dist/index.js.map +1 -1
- package/dist/{protocol-BIUxkT-w.d.ts → protocol-Czc3NgOD.d.ts} +278 -5
- package/dist/protocol.d.ts +1 -1
- package/dist/protocol.js +1 -1
- package/dist/script.d.ts +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +232 -10
- package/dist/server.js.map +1 -1
- package/dist/signing.d.ts +12 -0
- package/dist/signing.js +3 -0
- package/dist/signing.js.map +1 -0
- package/package.json +17 -15
- package/dist/chunk-FUIH6ZOG.js.map +0 -1
|
@@ -175,6 +175,53 @@ declare function isValidMsFileSourceId(input: unknown): input is string;
|
|
|
175
175
|
interface MsFileStatParams {
|
|
176
176
|
seedHashHex: string;
|
|
177
177
|
}
|
|
178
|
+
interface MsFileContentReadParams extends MsFileStatParams {
|
|
179
|
+
clientRequestId?: string;
|
|
180
|
+
/** 本次下载任务的完整数据块单价上限,单位聪。 */
|
|
181
|
+
maxFullBlockPriceSatoshis?: string;
|
|
182
|
+
}
|
|
183
|
+
interface MsFileReadStatusParams {
|
|
184
|
+
clientRequestId: string;
|
|
185
|
+
}
|
|
186
|
+
type MsFileContentOpenParams = MsFileContentReadParams & MsFileReadStatusParams;
|
|
187
|
+
/** 查询钱包允许的块价范围,或按读取编号修改当前任务的手动块价。 */
|
|
188
|
+
interface MsFileDownloadPriceParams {
|
|
189
|
+
clientRequestId?: string;
|
|
190
|
+
maxFullBlockPriceSatoshis?: string;
|
|
191
|
+
}
|
|
192
|
+
interface MsFileDownloadPriceResult {
|
|
193
|
+
/** 钱包允许应用设置的最大完整块单价,单位聪。 */
|
|
194
|
+
walletMaxFullBlockPriceSatoshis: string;
|
|
195
|
+
}
|
|
196
|
+
interface MsFileContentRangeParams extends MsFileReadStatusParams {
|
|
197
|
+
offset: number;
|
|
198
|
+
length: number;
|
|
199
|
+
}
|
|
200
|
+
interface MsFileContentRangeResult {
|
|
201
|
+
fileSizeBytes?: number;
|
|
202
|
+
mediaType?: string;
|
|
203
|
+
content?: BinaryField;
|
|
204
|
+
}
|
|
205
|
+
interface MsFileReadStatusDetails {
|
|
206
|
+
clientRequestId: string;
|
|
207
|
+
seedHashHex: string;
|
|
208
|
+
taskId?: string;
|
|
209
|
+
verifiedBlockCount?: number;
|
|
210
|
+
totalBlockCount?: number;
|
|
211
|
+
funds?: "none" | "pending" | "settled" | "problem";
|
|
212
|
+
/** 此读取记录有权调整关联下载任务的手动块价。 */
|
|
213
|
+
priceAdjustable?: true;
|
|
214
|
+
/** 当前任务的完整数据块单价上限,单位聪。 */
|
|
215
|
+
currentMaxFullBlockPriceSatoshis?: string;
|
|
216
|
+
}
|
|
217
|
+
/** Action for the caller: wait for content, read the complete file, or stop waiting. */
|
|
218
|
+
type MsFileReadStatus = MsFileReadStatusDetails & ({
|
|
219
|
+
phase: "pending" | "available";
|
|
220
|
+
error?: never;
|
|
221
|
+
} | {
|
|
222
|
+
phase: "stopped";
|
|
223
|
+
error: ProtocolError;
|
|
224
|
+
});
|
|
178
225
|
interface MsFileStatAvailableEntry {
|
|
179
226
|
supplierPublicKeyHex: string;
|
|
180
227
|
status: "available";
|
|
@@ -288,8 +335,8 @@ type ProtocolErrorCode =
|
|
|
288
335
|
| "hardware_connect_payment_unsupported" | "payment_not_found"
|
|
289
336
|
/** Too many non-terminal Connect payment responsibilities. */
|
|
290
337
|
| "payment_pending_limit"
|
|
291
|
-
/** Same stable
|
|
292
|
-
| "id_conflict" | "msfile_not_configured" | "msfile_unavailable" | "msfile_identity_required" | "msfile_supplier_not_found" | "msfile_supplier_disabled" | "msfile_invalid_hash" | "msfile_price_limit_exceeded" | "msfile_integrity_error" | "msfile_content_not_found" | "msfile_rate_limited" | "msfile_supplier_error" | "msfile_transport_error" | "msfile_protocol_error" | "internal_error";
|
|
338
|
+
/** Same stable request key with different facts, or a resumable MSFile read failure. */
|
|
339
|
+
| "id_conflict" | "msfile_read_not_found" | "msfile_read_interrupted" | "msfile_read_cancelled" | "msfile_range_timeout" | "name_not_found" | "invalid_name" | "invalid_public_key" | "primary_name_required" | "domain_service_not_configured" | "domain_service_unavailable" | "domain_network_mismatch" | "msfile_not_configured" | "msfile_unavailable" | "msfile_identity_required" | "msfile_supplier_not_found" | "msfile_supplier_disabled" | "msfile_invalid_hash" | "msfile_price_limit_exceeded" | "msfile_integrity_error" | "msfile_content_not_found" | "msfile_rate_limited" | "msfile_supplier_error" | "msfile_transport_error" | "msfile_protocol_error" | "internal_error";
|
|
293
340
|
interface ProtocolError {
|
|
294
341
|
code: ProtocolErrorCode;
|
|
295
342
|
message: string;
|
|
@@ -316,8 +363,15 @@ interface ProtocolCancelMessage {
|
|
|
316
363
|
* 设计缘由:
|
|
317
364
|
* - `channel.message_received` 是已验签的 Channel 公开消息,只发送给
|
|
318
365
|
* 当前 session 已精确订阅的频道;
|
|
366
|
+
* - `chain.height_changed` 是当前连接钱包已同步的链尖快照;
|
|
319
367
|
*/
|
|
320
|
-
type ProtocolEventName = "channel.message_received";
|
|
368
|
+
type ProtocolEventName = "channel.message_received" | "chain.height_changed";
|
|
369
|
+
/** 钱包同一次同步取得的链尖高度和哈希。 */
|
|
370
|
+
interface ChainHeightResult {
|
|
371
|
+
height: number;
|
|
372
|
+
/** 64 位小写十六进制区块哈希。 */
|
|
373
|
+
blockHash: string;
|
|
374
|
+
}
|
|
321
375
|
interface IdentityGetParams {
|
|
322
376
|
/** 目标站点 origin;必须等于 `event.origin`,否则拒绝。 */
|
|
323
377
|
aud: string;
|
|
@@ -438,7 +492,111 @@ interface PaymentStatusParams {
|
|
|
438
492
|
clientRequestId: string;
|
|
439
493
|
}
|
|
440
494
|
type PaymentStatusResult = PaymentPayResult;
|
|
495
|
+
interface ChainOutpoint {
|
|
496
|
+
txid: string;
|
|
497
|
+
vout: number;
|
|
498
|
+
}
|
|
499
|
+
interface PaymentDataSignature {
|
|
500
|
+
outputIndex: number;
|
|
501
|
+
offset: number;
|
|
502
|
+
prefixHex: string;
|
|
503
|
+
suffixHex: string;
|
|
504
|
+
}
|
|
505
|
+
interface PaymentPrepareParams extends PaymentStatusParams {
|
|
506
|
+
outputs: PaymentOutput[];
|
|
507
|
+
dataSignature: PaymentDataSignature;
|
|
508
|
+
}
|
|
509
|
+
type PaymentPrepareResult = PaymentPayResult & {
|
|
510
|
+
reservation?: {
|
|
511
|
+
reservationId: string;
|
|
512
|
+
inputs: ChainOutpoint[];
|
|
513
|
+
expiresAt: number;
|
|
514
|
+
};
|
|
515
|
+
};
|
|
516
|
+
interface PaymentReservationParams extends PaymentStatusParams {
|
|
517
|
+
reservationId: string;
|
|
518
|
+
}
|
|
519
|
+
interface PaymentCommitParams extends PaymentReservationParams {
|
|
520
|
+
signingObject: BinaryField;
|
|
521
|
+
}
|
|
522
|
+
type ChainScriptHistoryParams = {
|
|
523
|
+
script: string;
|
|
524
|
+
} & ({
|
|
525
|
+
state: "confirmed";
|
|
526
|
+
fromHeight: number;
|
|
527
|
+
toHeight: number;
|
|
528
|
+
cursor?: string;
|
|
529
|
+
} | {
|
|
530
|
+
state: "unconfirmed";
|
|
531
|
+
cursor?: string;
|
|
532
|
+
});
|
|
533
|
+
interface ChainScriptHistoryResult {
|
|
534
|
+
entries: Array<{
|
|
535
|
+
txid: string;
|
|
536
|
+
height: number | null;
|
|
537
|
+
}>;
|
|
538
|
+
cursor?: string;
|
|
539
|
+
}
|
|
540
|
+
type ChainTransactionResult = {
|
|
541
|
+
state: "not_observed" | "invalid";
|
|
542
|
+
} | {
|
|
543
|
+
state: "unconfirmed";
|
|
544
|
+
rawTxHex: string;
|
|
545
|
+
} | {
|
|
546
|
+
state: "confirmed";
|
|
547
|
+
rawTxHex: string;
|
|
548
|
+
height: number;
|
|
549
|
+
blockHash: string;
|
|
550
|
+
index: number;
|
|
551
|
+
};
|
|
552
|
+
type ChainTransactionBatchParams = {
|
|
553
|
+
txids: string[];
|
|
554
|
+
mode: "raw" | "status";
|
|
555
|
+
};
|
|
556
|
+
type ChainTransactionBatchEntry = {
|
|
557
|
+
txid: string;
|
|
558
|
+
} & ({
|
|
559
|
+
state: "not_observed";
|
|
560
|
+
} | {
|
|
561
|
+
state: "unconfirmed";
|
|
562
|
+
rawTxHex?: string;
|
|
563
|
+
} | {
|
|
564
|
+
state: "confirmed";
|
|
565
|
+
height: number;
|
|
566
|
+
blockHash: string;
|
|
567
|
+
rawTxHex?: string;
|
|
568
|
+
});
|
|
569
|
+
interface ChainTransactionBatchResult {
|
|
570
|
+
/** Missing IDs have no usable observation in this response and can be retried. */
|
|
571
|
+
entries: ChainTransactionBatchEntry[];
|
|
572
|
+
}
|
|
573
|
+
interface ChainBroadcastResult {
|
|
574
|
+
state: "accepted" | "rejected" | "unknown";
|
|
575
|
+
txid: string;
|
|
576
|
+
}
|
|
577
|
+
interface ApplicationPaymentParams {
|
|
578
|
+
purpose: string;
|
|
579
|
+
inputs: ChainOutpoint[];
|
|
580
|
+
address: string;
|
|
581
|
+
feeSatoshis: number;
|
|
582
|
+
rawTxHex: string;
|
|
583
|
+
}
|
|
584
|
+
interface MsFileImportParams {
|
|
585
|
+
fileName: string;
|
|
586
|
+
content: BinaryField;
|
|
587
|
+
}
|
|
588
|
+
interface MsFileContentResult {
|
|
589
|
+
seed: BinaryField;
|
|
590
|
+
content: BinaryField;
|
|
591
|
+
}
|
|
592
|
+
/** Signed by the connected wallet over the canonical login-proof envelope. */
|
|
593
|
+
interface ConnectLoginProof {
|
|
594
|
+
envelope: BinaryField;
|
|
595
|
+
signature: BinaryField;
|
|
596
|
+
}
|
|
441
597
|
interface ConnectLoginParams {
|
|
598
|
+
/** One-time challenge issued by the application backend (32 bytes, lowercase hex). */
|
|
599
|
+
loginChallenge?: string;
|
|
442
600
|
/** 人类可读确认文案。 */
|
|
443
601
|
text: string;
|
|
444
602
|
/**
|
|
@@ -455,6 +613,8 @@ interface ConnectLoginParams {
|
|
|
455
613
|
publicationProof?: string;
|
|
456
614
|
}
|
|
457
615
|
interface ConnectLoginResult {
|
|
616
|
+
/** Present when the request includes loginChallenge. */
|
|
617
|
+
loginProof?: ConnectLoginProof;
|
|
458
618
|
/** 不透明恢复凭据,绑定原钱包和精确来源;不得写入日志或 URL。 */
|
|
459
619
|
authorizationId: string;
|
|
460
620
|
networkIdentity: NetworkIdentity;
|
|
@@ -470,6 +630,8 @@ interface ConnectLogoutResult {
|
|
|
470
630
|
revokedAt: number;
|
|
471
631
|
}
|
|
472
632
|
interface ConnectLaunchParams {
|
|
633
|
+
/** One-time challenge issued by the application backend (32 bytes, lowercase hex). */
|
|
634
|
+
loginChallenge?: string;
|
|
473
635
|
/** 由 launcher 写入 client app 启动 URL 的 launchToken。一次性消费。 */
|
|
474
636
|
launchToken: string;
|
|
475
637
|
/**
|
|
@@ -479,13 +641,48 @@ interface ConnectLaunchParams {
|
|
|
479
641
|
publicationProof?: string;
|
|
480
642
|
}
|
|
481
643
|
interface ConnectLaunchResult {
|
|
644
|
+
/** Present when the request includes loginChallenge. */
|
|
645
|
+
loginProof?: ConnectLoginProof;
|
|
482
646
|
authorizationId: string;
|
|
483
647
|
networkIdentity: NetworkIdentity;
|
|
484
648
|
resolvedClaims: Record<string, ResolvedClaimValue>;
|
|
485
649
|
resolvedAt: number;
|
|
486
650
|
}
|
|
487
651
|
/** 协议方法名常量集合。 */
|
|
488
|
-
declare const
|
|
652
|
+
declare const DOMAIN_MAX_PROFILES = 100;
|
|
653
|
+
interface DomainProfile {
|
|
654
|
+
publicKeyHex: string;
|
|
655
|
+
domain: string;
|
|
656
|
+
avatar?: {
|
|
657
|
+
seedHashHex: string;
|
|
658
|
+
};
|
|
659
|
+
header?: {
|
|
660
|
+
seedHashHex: string;
|
|
661
|
+
};
|
|
662
|
+
text?: Record<string, string>;
|
|
663
|
+
expiresAt: number;
|
|
664
|
+
}
|
|
665
|
+
type ProfileResult = {
|
|
666
|
+
publicKeyHex: string;
|
|
667
|
+
profile: DomainProfile;
|
|
668
|
+
} | {
|
|
669
|
+
publicKeyHex: string;
|
|
670
|
+
error: {
|
|
671
|
+
code: "invalid_public_key" | "name_not_found" | "primary_name_required";
|
|
672
|
+
};
|
|
673
|
+
};
|
|
674
|
+
interface DomainProfilesResult {
|
|
675
|
+
results: ProfileResult[];
|
|
676
|
+
}
|
|
677
|
+
interface DomainProfilesParams {
|
|
678
|
+
publicKeys: string[];
|
|
679
|
+
serviceId?: string;
|
|
680
|
+
}
|
|
681
|
+
interface DomainGetPublicKeyParams {
|
|
682
|
+
domain: string;
|
|
683
|
+
serviceId?: string;
|
|
684
|
+
}
|
|
685
|
+
declare const PROTOCOL_METHODS: readonly ["identity.get", "intent.sign", "cipher.encrypt", "cipher.decrypt", "payment.pay", "payment.status", "payment.prepare", "payment.commit", "payment.cancel", "chain.get_height", "chain.list_script_history", "chain.get_transaction", "chain.get_transactions", "chain.list_script_unspent", "chain.broadcast", "application.key", "application.sign_message", "application.sign_payment", "msfile.seller.status", "msfile.import", "msfile.content.read", "msfile.content.status", "msfile.content.open", "msfile.content.price", "msfile.content.range", "domain.profiles", "domain.get_public_key", "connect.login", "connect.logout", "connect.launch", "channel.publish", "channel.subscription_set", "msfile.stat", "msfile.seed.read", "msfile.block.read"];
|
|
489
686
|
type ProtocolMethod = (typeof PROTOCOL_METHODS)[number];
|
|
490
687
|
/**
|
|
491
688
|
* 方法 -> 请求参数类型 的映射。`MethodParams<M>` 是计算出的参数类型。
|
|
@@ -498,6 +695,39 @@ interface MethodParamsMap {
|
|
|
498
695
|
"cipher.decrypt": CipherDecryptParams;
|
|
499
696
|
"payment.pay": PaymentPayParams;
|
|
500
697
|
"payment.status": PaymentStatusParams;
|
|
698
|
+
"payment.prepare": PaymentPrepareParams;
|
|
699
|
+
"payment.commit": PaymentCommitParams;
|
|
700
|
+
"payment.cancel": PaymentReservationParams;
|
|
701
|
+
"chain.get_height": {};
|
|
702
|
+
"chain.list_script_history": ChainScriptHistoryParams;
|
|
703
|
+
"chain.get_transaction": {
|
|
704
|
+
txid: string;
|
|
705
|
+
observedRawTxHex?: string;
|
|
706
|
+
};
|
|
707
|
+
"chain.get_transactions": ChainTransactionBatchParams;
|
|
708
|
+
"chain.list_script_unspent": {
|
|
709
|
+
script: string;
|
|
710
|
+
};
|
|
711
|
+
"chain.broadcast": {
|
|
712
|
+
rawTxHex: string;
|
|
713
|
+
};
|
|
714
|
+
"application.key": {
|
|
715
|
+
purpose: string;
|
|
716
|
+
};
|
|
717
|
+
"application.sign_message": {
|
|
718
|
+
purpose: string;
|
|
719
|
+
message: BinaryField;
|
|
720
|
+
};
|
|
721
|
+
"application.sign_payment": ApplicationPaymentParams;
|
|
722
|
+
"msfile.seller.status": {};
|
|
723
|
+
"msfile.import": MsFileImportParams;
|
|
724
|
+
"msfile.content.read": MsFileContentReadParams;
|
|
725
|
+
"msfile.content.status": MsFileReadStatusParams;
|
|
726
|
+
"msfile.content.open": MsFileContentOpenParams;
|
|
727
|
+
"msfile.content.price": MsFileDownloadPriceParams;
|
|
728
|
+
"msfile.content.range": MsFileContentRangeParams;
|
|
729
|
+
"domain.profiles": DomainProfilesParams;
|
|
730
|
+
"domain.get_public_key": DomainGetPublicKeyParams;
|
|
501
731
|
"connect.login": ConnectLoginParams;
|
|
502
732
|
"connect.logout": ConnectLogoutParams;
|
|
503
733
|
"connect.launch": ConnectLaunchParams;
|
|
@@ -514,6 +744,44 @@ interface MethodResultMap {
|
|
|
514
744
|
"cipher.decrypt": CipherDecryptResult;
|
|
515
745
|
"payment.pay": PaymentPayResult;
|
|
516
746
|
"payment.status": PaymentStatusResult;
|
|
747
|
+
"payment.prepare": PaymentPrepareResult;
|
|
748
|
+
"payment.commit": PaymentPayResult;
|
|
749
|
+
"payment.cancel": PaymentPayResult;
|
|
750
|
+
"chain.get_height": ChainHeightResult;
|
|
751
|
+
"chain.list_script_history": ChainScriptHistoryResult;
|
|
752
|
+
"chain.get_transaction": ChainTransactionResult;
|
|
753
|
+
"chain.get_transactions": ChainTransactionBatchResult;
|
|
754
|
+
"chain.list_script_unspent": {
|
|
755
|
+
outputs: Array<ChainOutpoint & {
|
|
756
|
+
satoshis: number;
|
|
757
|
+
}>;
|
|
758
|
+
};
|
|
759
|
+
"chain.broadcast": ChainBroadcastResult;
|
|
760
|
+
"application.key": {
|
|
761
|
+
publicKeyHex: string;
|
|
762
|
+
};
|
|
763
|
+
"application.sign_message": {
|
|
764
|
+
publicKeyHex: string;
|
|
765
|
+
signature: BinaryField;
|
|
766
|
+
};
|
|
767
|
+
"application.sign_payment": {
|
|
768
|
+
rawTxHex: string;
|
|
769
|
+
};
|
|
770
|
+
"msfile.seller.status": {
|
|
771
|
+
ready: boolean;
|
|
772
|
+
};
|
|
773
|
+
"msfile.import": {
|
|
774
|
+
seedHashHex: string;
|
|
775
|
+
};
|
|
776
|
+
"msfile.content.read": MsFileContentResult;
|
|
777
|
+
"msfile.content.status": MsFileReadStatus;
|
|
778
|
+
"msfile.content.open": MsFileReadStatus;
|
|
779
|
+
"msfile.content.price": MsFileDownloadPriceResult;
|
|
780
|
+
"msfile.content.range": MsFileContentRangeResult;
|
|
781
|
+
"domain.profiles": DomainProfilesResult;
|
|
782
|
+
"domain.get_public_key": {
|
|
783
|
+
publicKeyHex: string;
|
|
784
|
+
};
|
|
517
785
|
"connect.login": ConnectLoginResult;
|
|
518
786
|
"connect.logout": ConnectLogoutResult;
|
|
519
787
|
"connect.launch": ConnectLaunchResult;
|
|
@@ -530,6 +798,11 @@ type ProtocolEventPayload = {
|
|
|
530
798
|
type: "event";
|
|
531
799
|
event: "channel.message_received";
|
|
532
800
|
data: ChannelMessageReceivedEventData;
|
|
801
|
+
} | {
|
|
802
|
+
v: typeof PROTOCOL_VERSION;
|
|
803
|
+
type: "event";
|
|
804
|
+
event: "chain.height_changed";
|
|
805
|
+
data: ChainHeightResult;
|
|
533
806
|
};
|
|
534
807
|
type ProtocolEventMessage = ProtocolEventPayload & {
|
|
535
808
|
networkIdentity: NetworkIdentity;
|
|
@@ -560,4 +833,4 @@ type ProtocolResultMessage = {
|
|
|
560
833
|
networkIdentity?: NetworkIdentity;
|
|
561
834
|
};
|
|
562
835
|
|
|
563
|
-
export {
|
|
836
|
+
export { type BsvNetwork as $, type AiTool as A, type BinaryField as B, type ConnectLoginParams as C, type DomainProfile as D, type MsFileReadStatus as E, type MsFileDownloadPriceResult as F, type MsFileContentRangeResult as G, type MsFileStatParams as H, type IdentityGetParams as I, type MsFileStatResult as J, type MsFileSeedReadParams as K, type MsFileReadResult as L, type MethodParams as M, type NetworkIdentity as N, type MsFileBlockReadParams as O, type ProtocolEventMessage as P, type PaymentStatusResult as Q, type ChannelPublishParams as R, type ChannelPublishResult as S, type ChannelSubscriptionSetParams as T, type ChannelSubscriptionSetResult as U, type ProtocolErrorCode as V, AI_TOOLS_MAX_JSON_CHARS as W, type AiToolDefinition as X, type AiToolMessage as Y, type AiToolSchema as Z, type ApplicationPaymentParams as _, type DomainProfilesResult as a, isAiToolMessage as a$, type ChainScriptHistoryParams as a0, type ChainTransactionBatchEntry as a1, type ChainTransactionBatchParams as a2, type ChannelMessageReceivedEventData as a3, type ChannelSubscriptionErrorCode as a4, type ChannelSubscriptionPhase as a5, type ChannelSubscriptionStatus as a6, type ConnectLoginProof as a7, type ConnectLogoutParams as a8, type ConnectPaymentStatus as a9, type MsFileStatAbsentEntry as aA, type MsFileStatAvailableEntry as aB, type MsFileStatDiscoveringEntry as aC, type MsFileStatNetworkErrorEntry as aD, type MsFileStatQuotedEntry as aE, type MsFileSupplierStat as aF, type P2pkhTransferAssetId as aG, PROTOCOL_METHODS as aH, PROTOCOL_VERSION as aI, type PaymentCommitParams as aJ, type PaymentDataSignature as aK, type PaymentOutput as aL, type PaymentPrepareParams as aM, type PaymentReleaseSummary as aN, type PaymentReservationParams as aO, type ProfileResult as aP, type ProtocolCancelMessage as aQ, type ProtocolClosingMessage as aR, type ProtocolError as aS, type ProtocolEventName as aT, type ProtocolEventPayload as aU, type ProtocolReadyMessage as aV, type ProtocolRequestMessage as aW, type ProtocolResultMessage as aX, type ResolvedClaimValue as aY, assertToolJson as aZ, assertToolPayload as a_, DOMAIN_MAX_PROFILES as aa, type DomainGetPublicKeyParams as ab, type DomainProfilesParams as ac, type JSONValue as ad, MSFILE_BLOCK_SIZE_BYTES as ae, MSFILE_DIGEST_SIZE_BYTES as af, MSFILE_LOCAL_SOURCE_ID as ag, MSFILE_MAX_BLOCK_BYTES as ah, MSFILE_MAX_CONTENT_BYTES as ai, MSFILE_MAX_ERROR_MESSAGE_BYTES as aj, MSFILE_MAX_HEADER_BYTES as ak, MSFILE_MAX_SEED_BYTES as al, MSFILE_PROTOCOL_ID as am, type MethodParamsMap as an, type MethodResultMap as ao, type MsFileContentOpenParams as ap, type MsFileContentRangeParams as aq, type MsFileContentReadParams as ar, type MsFileDownloadPriceParams as as, type MsFileImportParams as at, type MsFileLocalSourceStat as au, type MsFileReadStatusParams as av, type MsFileRemoteSourceStat as aw, type MsFileSatoshiAmount as ax, type MsFileSourceKind as ay, type MsFileSourceStat as az, type AiToolsRegistered as b, isValidMsFileSourceId as b0, parseToolDefinitions as b1, sameNetworkIdentity as b2, validateBsvNetwork as b3, validateNetworkIdentity as b4, validateToolArguments as b5, type ProtocolMethod as c, type MethodResult as d, type ConnectLoginResult as e, type ConnectLogoutResult as f, type ConnectLaunchParams as g, type ConnectLaunchResult as h, type IdentityGetResult as i, type IntentSignParams as j, type IntentSignResult as k, type CipherEncryptParams as l, type CipherEncryptResult as m, type CipherDecryptParams as n, type CipherDecryptResult as o, type PaymentPayParams as p, type PaymentPayResult as q, type PaymentPrepareResult as r, type PaymentStatusParams as s, type ChainHeightResult as t, type ChainScriptHistoryResult as u, type ChainTransactionResult as v, type ChainTransactionBatchResult as w, type ChainOutpoint as x, type ChainBroadcastResult as y, type MsFileContentResult as z };
|
package/dist/protocol.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { X as AiToolDefinition, Y as AiToolMessage, Z as AiToolSchema, b as AiToolsRegistered, _ as ApplicationPaymentParams, B as BinaryField, $ as BsvNetwork, y as ChainBroadcastResult, t as ChainHeightResult, x as ChainOutpoint, a0 as ChainScriptHistoryParams, u as ChainScriptHistoryResult, a1 as ChainTransactionBatchEntry, a2 as ChainTransactionBatchParams, w as ChainTransactionBatchResult, v as ChainTransactionResult, a3 as ChannelMessageReceivedEventData, R as ChannelPublishParams, S as ChannelPublishResult, a4 as ChannelSubscriptionErrorCode, a5 as ChannelSubscriptionPhase, T as ChannelSubscriptionSetParams, U as ChannelSubscriptionSetResult, a6 as ChannelSubscriptionStatus, n as CipherDecryptParams, o as CipherDecryptResult, l as CipherEncryptParams, m as CipherEncryptResult, g as ConnectLaunchParams, h as ConnectLaunchResult, C as ConnectLoginParams, a7 as ConnectLoginProof, e as ConnectLoginResult, a8 as ConnectLogoutParams, f as ConnectLogoutResult, a9 as ConnectPaymentStatus, aa as DOMAIN_MAX_PROFILES, ab as DomainGetPublicKeyParams, D as DomainProfile, ac as DomainProfilesParams, a as DomainProfilesResult, I as IdentityGetParams, i as IdentityGetResult, j as IntentSignParams, k as IntentSignResult, ad as JSONValue, ae as MSFILE_BLOCK_SIZE_BYTES, af as MSFILE_DIGEST_SIZE_BYTES, ag as MSFILE_LOCAL_SOURCE_ID, ah as MSFILE_MAX_BLOCK_BYTES, ai as MSFILE_MAX_CONTENT_BYTES, aj as MSFILE_MAX_ERROR_MESSAGE_BYTES, ak as MSFILE_MAX_HEADER_BYTES, al as MSFILE_MAX_SEED_BYTES, am as MSFILE_PROTOCOL_ID, M as MethodParams, an as MethodParamsMap, d as MethodResult, ao as MethodResultMap, O as MsFileBlockReadParams, ap as MsFileContentOpenParams, aq as MsFileContentRangeParams, G as MsFileContentRangeResult, ar as MsFileContentReadParams, z as MsFileContentResult, as as MsFileDownloadPriceParams, F as MsFileDownloadPriceResult, at as MsFileImportParams, au as MsFileLocalSourceStat, L as MsFileReadResult, E as MsFileReadStatus, av as MsFileReadStatusParams, aw as MsFileRemoteSourceStat, ax as MsFileSatoshiAmount, K as MsFileSeedReadParams, ay as MsFileSourceKind, az as MsFileSourceStat, aA as MsFileStatAbsentEntry, aB as MsFileStatAvailableEntry, aC as MsFileStatDiscoveringEntry, aD as MsFileStatNetworkErrorEntry, H as MsFileStatParams, aE as MsFileStatQuotedEntry, J as MsFileStatResult, aF as MsFileSupplierStat, N as NetworkIdentity, aG as P2pkhTransferAssetId, aH as PROTOCOL_METHODS, aI as PROTOCOL_VERSION, aJ as PaymentCommitParams, aK as PaymentDataSignature, aL as PaymentOutput, p as PaymentPayParams, q as PaymentPayResult, aM as PaymentPrepareParams, r as PaymentPrepareResult, aN as PaymentReleaseSummary, aO as PaymentReservationParams, s as PaymentStatusParams, Q as PaymentStatusResult, aP as ProfileResult, aQ as ProtocolCancelMessage, aR as ProtocolClosingMessage, aS as ProtocolError, V as ProtocolErrorCode, P as ProtocolEventMessage, aT as ProtocolEventName, aU as ProtocolEventPayload, c as ProtocolMethod, aV as ProtocolReadyMessage, aW as ProtocolRequestMessage, aX as ProtocolResultMessage, aY as ResolvedClaimValue, b0 as isValidMsFileSourceId, b2 as sameNetworkIdentity, b3 as validateBsvNetwork, b4 as validateNetworkIdentity } from './protocol-Czc3NgOD.js';
|
package/dist/protocol.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { MSFILE_BLOCK_SIZE_BYTES, MSFILE_DIGEST_SIZE_BYTES, MSFILE_LOCAL_SOURCE_ID, MSFILE_MAX_BLOCK_BYTES, MSFILE_MAX_CONTENT_BYTES, MSFILE_MAX_ERROR_MESSAGE_BYTES, MSFILE_MAX_HEADER_BYTES, MSFILE_MAX_SEED_BYTES, MSFILE_PROTOCOL_ID, PROTOCOL_METHODS, PROTOCOL_VERSION, isValidMsFileSourceId, sameNetworkIdentity, validateBsvNetwork, validateNetworkIdentity } from './chunk-
|
|
1
|
+
export { DOMAIN_MAX_PROFILES, MSFILE_BLOCK_SIZE_BYTES, MSFILE_DIGEST_SIZE_BYTES, MSFILE_LOCAL_SOURCE_ID, MSFILE_MAX_BLOCK_BYTES, MSFILE_MAX_CONTENT_BYTES, MSFILE_MAX_ERROR_MESSAGE_BYTES, MSFILE_MAX_HEADER_BYTES, MSFILE_MAX_SEED_BYTES, MSFILE_PROTOCOL_ID, PROTOCOL_METHODS, PROTOCOL_VERSION, isValidMsFileSourceId, sameNetworkIdentity, validateBsvNetwork, validateNetworkIdentity } from './chunk-QUZZ2OXO.js';
|
|
2
2
|
//# sourceMappingURL=protocol.js.map
|
|
3
3
|
//# sourceMappingURL=protocol.js.map
|
package/dist/script.d.ts
CHANGED
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { V as ProtocolErrorCode, aG as P2pkhTransferAssetId, aW as ProtocolRequestMessage, N as NetworkIdentity, c as ProtocolMethod, M as MethodParams, Y as AiToolMessage, X as AiToolDefinition, ad as JSONValue, aX as ProtocolResultMessage, aV as ProtocolReadyMessage, aR as ProtocolClosingMessage, d as MethodResult, aS as ProtocolError, aU as ProtocolEventPayload } from './protocol-Czc3NgOD.js';
|
|
2
|
+
export { W as AI_TOOLS_MAX_JSON_CHARS, A as AiTool, Z as AiToolSchema, b as AiToolsRegistered, aZ as assertToolJson, a_ as assertToolPayload, a$ as isAiToolMessage, b1 as parseToolDefinitions, b5 as validateToolArguments } from './protocol-Czc3NgOD.js';
|
|
3
3
|
|
|
4
4
|
/** 校验失败:抛出的对象。service 会捕获并组装 ProtocolError。 */
|
|
5
5
|
declare class ProtocolValidationError extends Error {
|