@sats-connect/core 0.13.1-7ac4592 → 0.14.0-37f2f13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +241 -212
- package/dist/index.d.ts +241 -212
- package/dist/index.js +792 -733
- package/dist/index.mjs +788 -733
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -121,6 +121,10 @@ __export(index_exports, {
|
|
|
121
121
|
isProviderInstalled: () => isProviderInstalled,
|
|
122
122
|
networkChangeEventName: () => networkChangeEventName,
|
|
123
123
|
networkChangeSchema: () => networkChangeSchema,
|
|
124
|
+
openReceiveMethodName: () => openReceiveMethodName,
|
|
125
|
+
openReceiveParamsSchema: () => openReceiveParamsSchema,
|
|
126
|
+
openReceiveRequestMessageSchema: () => openReceiveRequestMessageSchema,
|
|
127
|
+
openReceiveResultSchema: () => openReceiveResultSchema,
|
|
124
128
|
permission: () => permission,
|
|
125
129
|
removeDefaultProvider: () => removeDefaultProvider,
|
|
126
130
|
renouncePermissionsMethodName: () => renouncePermissionsMethodName,
|
|
@@ -274,7 +278,7 @@ __export(index_exports, {
|
|
|
274
278
|
module.exports = __toCommonJS(index_exports);
|
|
275
279
|
|
|
276
280
|
// src/request/index.ts
|
|
277
|
-
var
|
|
281
|
+
var v53 = __toESM(require("valibot"));
|
|
278
282
|
|
|
279
283
|
// src/provider/types.ts
|
|
280
284
|
var v4 = __toESM(require("valibot"));
|
|
@@ -518,219 +522,270 @@ var sanitizeAddressPurposeRequest = (method, params) => {
|
|
|
518
522
|
};
|
|
519
523
|
|
|
520
524
|
// src/request/types/btcMethods.ts
|
|
521
|
-
var
|
|
525
|
+
var v18 = __toESM(require("valibot"));
|
|
522
526
|
|
|
523
|
-
// src/request/types/walletMethods.ts
|
|
527
|
+
// src/request/types/walletMethods/addNetwork.ts
|
|
524
528
|
var v5 = __toESM(require("valibot"));
|
|
525
|
-
var
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
})
|
|
537
|
-
var walletPermissionSchema = v5.object({
|
|
538
|
-
type: v5.literal("wallet"),
|
|
539
|
-
resourceId: v5.string(),
|
|
540
|
-
clientId: v5.string(),
|
|
541
|
-
actions: walletActionsSchema
|
|
542
|
-
});
|
|
543
|
-
var PermissionRequestParams = v5.variant("type", [
|
|
529
|
+
var addNetworkMethodName = "wallet_addNetwork";
|
|
530
|
+
var addNetworkParamsSchema = v5.variant("chain", [
|
|
531
|
+
v5.object({
|
|
532
|
+
chain: v5.literal("bitcoin"),
|
|
533
|
+
type: v5.enum(BitcoinNetworkType),
|
|
534
|
+
name: v5.string(),
|
|
535
|
+
rpcUrl: v5.string(),
|
|
536
|
+
rpcFallbackUrl: v5.optional(v5.string()),
|
|
537
|
+
indexerUrl: v5.optional(v5.string()),
|
|
538
|
+
blockExplorerUrl: v5.optional(v5.string()),
|
|
539
|
+
switch: v5.optional(v5.boolean())
|
|
540
|
+
}),
|
|
544
541
|
v5.object({
|
|
545
|
-
|
|
542
|
+
chain: v5.literal("stacks"),
|
|
543
|
+
name: v5.string(),
|
|
544
|
+
type: v5.enum(StacksNetworkType),
|
|
545
|
+
rpcUrl: v5.string(),
|
|
546
|
+
blockExplorerUrl: v5.optional(v5.string()),
|
|
547
|
+
switch: v5.optional(v5.boolean())
|
|
546
548
|
}),
|
|
547
549
|
v5.object({
|
|
548
|
-
|
|
550
|
+
chain: v5.literal("starknet"),
|
|
551
|
+
name: v5.string(),
|
|
552
|
+
type: v5.enum(StarknetNetworkType),
|
|
553
|
+
rpcUrl: v5.string(),
|
|
554
|
+
blockExplorerUrl: v5.optional(v5.string()),
|
|
555
|
+
switch: v5.optional(v5.boolean())
|
|
549
556
|
})
|
|
550
557
|
]);
|
|
551
|
-
var
|
|
552
|
-
var requestPermissionsMethodName = "wallet_requestPermissions";
|
|
553
|
-
var requestPermissionsParamsSchema = v5.nullish(v5.array(PermissionRequestParams));
|
|
554
|
-
var requestPermissionsResultSchema = v5.literal(true);
|
|
555
|
-
var requestPermissionsRequestMessageSchema = v5.object({
|
|
558
|
+
var addNetworkRequestMessageSchema = v5.object({
|
|
556
559
|
...rpcRequestMessageSchema.entries,
|
|
557
560
|
...v5.object({
|
|
558
|
-
method: v5.literal(
|
|
559
|
-
params:
|
|
561
|
+
method: v5.literal(addNetworkMethodName),
|
|
562
|
+
params: addNetworkParamsSchema,
|
|
560
563
|
id: v5.string()
|
|
561
564
|
}).entries
|
|
562
565
|
});
|
|
563
|
-
var
|
|
564
|
-
|
|
565
|
-
var renouncePermissionsResultSchema = v5.nullish(v5.null());
|
|
566
|
-
var renouncePermissionsRequestMessageSchema = v5.object({
|
|
567
|
-
...rpcRequestMessageSchema.entries,
|
|
568
|
-
...v5.object({
|
|
569
|
-
method: v5.literal(renouncePermissionsMethodName),
|
|
570
|
-
params: renouncePermissionsParamsSchema,
|
|
571
|
-
id: v5.string()
|
|
572
|
-
}).entries
|
|
566
|
+
var addNetworkResultSchema = v5.object({
|
|
567
|
+
id: v5.string()
|
|
573
568
|
});
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
var
|
|
577
|
-
var
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
method: v5.literal(disconnectMethodName),
|
|
581
|
-
params: disconnectParamsSchema,
|
|
582
|
-
id: v5.string()
|
|
583
|
-
}).entries
|
|
569
|
+
|
|
570
|
+
// src/request/types/walletMethods/changeNetwork.ts
|
|
571
|
+
var v6 = __toESM(require("valibot"));
|
|
572
|
+
var changeNetworkMethodName = "wallet_changeNetwork";
|
|
573
|
+
var changeNetworkParamsSchema = v6.object({
|
|
574
|
+
name: v6.enum(BitcoinNetworkType)
|
|
584
575
|
});
|
|
585
|
-
var
|
|
586
|
-
var
|
|
587
|
-
var getWalletTypeResultSchema = walletTypeSchema;
|
|
588
|
-
var getWalletTypeRequestMessageSchema = v5.object({
|
|
576
|
+
var changeNetworkResultSchema = v6.nullish(v6.null());
|
|
577
|
+
var changeNetworkRequestMessageSchema = v6.object({
|
|
589
578
|
...rpcRequestMessageSchema.entries,
|
|
590
|
-
...
|
|
591
|
-
method:
|
|
592
|
-
params:
|
|
593
|
-
id:
|
|
579
|
+
...v6.object({
|
|
580
|
+
method: v6.literal(changeNetworkMethodName),
|
|
581
|
+
params: changeNetworkParamsSchema,
|
|
582
|
+
id: v6.string()
|
|
594
583
|
}).entries
|
|
595
584
|
});
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
var
|
|
599
|
-
var
|
|
585
|
+
|
|
586
|
+
// src/request/types/walletMethods/changeNetworkById.ts
|
|
587
|
+
var v7 = __toESM(require("valibot"));
|
|
588
|
+
var changeNetworkByIdMethodName = "wallet_changeNetworkById";
|
|
589
|
+
var changeNetworkByIdParamsSchema = v7.object({
|
|
590
|
+
id: v7.string()
|
|
591
|
+
});
|
|
592
|
+
var changeNetworkByIdResultSchema = v7.nullish(v7.null());
|
|
593
|
+
var changeNetworkByIdRequestMessageSchema = v7.object({
|
|
600
594
|
...rpcRequestMessageSchema.entries,
|
|
601
|
-
...
|
|
602
|
-
method:
|
|
603
|
-
params:
|
|
604
|
-
id:
|
|
595
|
+
...v7.object({
|
|
596
|
+
method: v7.literal(changeNetworkByIdMethodName),
|
|
597
|
+
params: changeNetworkByIdParamsSchema,
|
|
598
|
+
id: v7.string()
|
|
605
599
|
}).entries
|
|
606
600
|
});
|
|
601
|
+
|
|
602
|
+
// src/request/types/walletMethods/common.ts
|
|
603
|
+
var v8 = __toESM(require("valibot"));
|
|
604
|
+
var accountActionsSchema = v8.object({
|
|
605
|
+
read: v8.optional(v8.boolean())
|
|
606
|
+
});
|
|
607
|
+
var walletActionsSchema = v8.object({
|
|
608
|
+
readNetwork: v8.optional(v8.boolean())
|
|
609
|
+
});
|
|
610
|
+
var accountPermissionSchema = v8.object({
|
|
611
|
+
type: v8.literal("account"),
|
|
612
|
+
resourceId: v8.string(),
|
|
613
|
+
clientId: v8.string(),
|
|
614
|
+
actions: accountActionsSchema
|
|
615
|
+
});
|
|
616
|
+
var walletPermissionSchema = v8.object({
|
|
617
|
+
type: v8.literal("wallet"),
|
|
618
|
+
resourceId: v8.string(),
|
|
619
|
+
clientId: v8.string(),
|
|
620
|
+
actions: walletActionsSchema
|
|
621
|
+
});
|
|
622
|
+
var PermissionRequestParams = v8.variant("type", [
|
|
623
|
+
v8.object({
|
|
624
|
+
...v8.omit(accountPermissionSchema, ["clientId"]).entries
|
|
625
|
+
}),
|
|
626
|
+
v8.object({
|
|
627
|
+
...v8.omit(walletPermissionSchema, ["clientId"]).entries
|
|
628
|
+
})
|
|
629
|
+
]);
|
|
630
|
+
var permission = v8.variant("type", [accountPermissionSchema, walletPermissionSchema]);
|
|
631
|
+
|
|
632
|
+
// src/request/types/walletMethods/connect.ts
|
|
633
|
+
var v10 = __toESM(require("valibot"));
|
|
634
|
+
|
|
635
|
+
// src/request/types/walletMethods/getNetwork.ts
|
|
636
|
+
var v9 = __toESM(require("valibot"));
|
|
607
637
|
var getNetworkMethodName = "wallet_getNetwork";
|
|
608
|
-
var getNetworkParamsSchema =
|
|
609
|
-
var getNetworkResultSchema =
|
|
610
|
-
bitcoin:
|
|
611
|
-
name:
|
|
638
|
+
var getNetworkParamsSchema = v9.nullish(v9.null());
|
|
639
|
+
var getNetworkResultSchema = v9.object({
|
|
640
|
+
bitcoin: v9.object({
|
|
641
|
+
name: v9.enum(BitcoinNetworkType)
|
|
612
642
|
}),
|
|
613
|
-
stacks:
|
|
614
|
-
name:
|
|
643
|
+
stacks: v9.object({
|
|
644
|
+
name: v9.enum(StacksNetworkType)
|
|
615
645
|
}),
|
|
616
|
-
spark:
|
|
617
|
-
name:
|
|
646
|
+
spark: v9.object({
|
|
647
|
+
name: v9.enum(SparkNetworkType)
|
|
618
648
|
})
|
|
619
649
|
});
|
|
620
|
-
var getNetworkRequestMessageSchema =
|
|
650
|
+
var getNetworkRequestMessageSchema = v9.object({
|
|
621
651
|
...rpcRequestMessageSchema.entries,
|
|
622
|
-
...
|
|
623
|
-
method:
|
|
652
|
+
...v9.object({
|
|
653
|
+
method: v9.literal(getNetworkMethodName),
|
|
624
654
|
params: getNetworkParamsSchema,
|
|
625
|
-
id:
|
|
655
|
+
id: v9.string()
|
|
626
656
|
}).entries
|
|
627
657
|
});
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
658
|
+
|
|
659
|
+
// src/request/types/walletMethods/connect.ts
|
|
660
|
+
var connectMethodName = "wallet_connect";
|
|
661
|
+
var connectParamsSchema = v10.nullish(
|
|
662
|
+
v10.object({
|
|
663
|
+
permissions: v10.optional(v10.array(PermissionRequestParams)),
|
|
664
|
+
addresses: v10.optional(v10.array(v10.enum(AddressPurpose))),
|
|
665
|
+
message: v10.optional(
|
|
666
|
+
v10.pipe(v10.string(), v10.maxLength(80, "The message must not exceed 80 characters."))
|
|
667
|
+
),
|
|
668
|
+
network: v10.optional(v10.enum(BitcoinNetworkType))
|
|
669
|
+
})
|
|
670
|
+
);
|
|
671
|
+
var connectResultSchema = v10.object({
|
|
672
|
+
id: v10.string(),
|
|
673
|
+
addresses: v10.array(addressSchema),
|
|
674
|
+
walletType: walletTypeSchema,
|
|
675
|
+
network: getNetworkResultSchema
|
|
631
676
|
});
|
|
632
|
-
var
|
|
633
|
-
var changeNetworkRequestMessageSchema = v5.object({
|
|
677
|
+
var connectRequestMessageSchema = v10.object({
|
|
634
678
|
...rpcRequestMessageSchema.entries,
|
|
635
|
-
...
|
|
636
|
-
method:
|
|
637
|
-
params:
|
|
638
|
-
id:
|
|
679
|
+
...v10.object({
|
|
680
|
+
method: v10.literal(connectMethodName),
|
|
681
|
+
params: connectParamsSchema,
|
|
682
|
+
id: v10.string()
|
|
639
683
|
}).entries
|
|
640
684
|
});
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
var
|
|
646
|
-
var
|
|
685
|
+
|
|
686
|
+
// src/request/types/walletMethods/disconnect.ts
|
|
687
|
+
var v11 = __toESM(require("valibot"));
|
|
688
|
+
var disconnectMethodName = "wallet_disconnect";
|
|
689
|
+
var disconnectParamsSchema = v11.nullish(v11.null());
|
|
690
|
+
var disconnectResultSchema = v11.nullish(v11.null());
|
|
691
|
+
var disconnectRequestMessageSchema = v11.object({
|
|
647
692
|
...rpcRequestMessageSchema.entries,
|
|
648
|
-
...
|
|
649
|
-
method:
|
|
650
|
-
params:
|
|
651
|
-
id:
|
|
693
|
+
...v11.object({
|
|
694
|
+
method: v11.literal(disconnectMethodName),
|
|
695
|
+
params: disconnectParamsSchema,
|
|
696
|
+
id: v11.string()
|
|
652
697
|
}).entries
|
|
653
698
|
});
|
|
699
|
+
|
|
700
|
+
// src/request/types/walletMethods/getAccount.ts
|
|
701
|
+
var v12 = __toESM(require("valibot"));
|
|
654
702
|
var getAccountMethodName = "wallet_getAccount";
|
|
655
|
-
var getAccountParamsSchema =
|
|
656
|
-
var getAccountResultSchema =
|
|
657
|
-
id:
|
|
658
|
-
addresses:
|
|
703
|
+
var getAccountParamsSchema = v12.nullish(v12.null());
|
|
704
|
+
var getAccountResultSchema = v12.object({
|
|
705
|
+
id: v12.string(),
|
|
706
|
+
addresses: v12.array(addressSchema),
|
|
659
707
|
walletType: walletTypeSchema,
|
|
660
708
|
network: getNetworkResultSchema
|
|
661
709
|
});
|
|
662
|
-
var getAccountRequestMessageSchema =
|
|
710
|
+
var getAccountRequestMessageSchema = v12.object({
|
|
663
711
|
...rpcRequestMessageSchema.entries,
|
|
664
|
-
...
|
|
665
|
-
method:
|
|
712
|
+
...v12.object({
|
|
713
|
+
method: v12.literal(getAccountMethodName),
|
|
666
714
|
params: getAccountParamsSchema,
|
|
667
|
-
id:
|
|
715
|
+
id: v12.string()
|
|
668
716
|
}).entries
|
|
669
717
|
});
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
addresses: v5.array(addressSchema),
|
|
684
|
-
walletType: walletTypeSchema,
|
|
685
|
-
network: getNetworkResultSchema
|
|
718
|
+
|
|
719
|
+
// src/request/types/walletMethods/getCurrentPermissions.ts
|
|
720
|
+
var v13 = __toESM(require("valibot"));
|
|
721
|
+
var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
|
|
722
|
+
var getCurrentPermissionsParamsSchema = v13.nullish(v13.null());
|
|
723
|
+
var getCurrentPermissionsResultSchema = v13.array(permission);
|
|
724
|
+
var getCurrentPermissionsRequestMessageSchema = v13.object({
|
|
725
|
+
...rpcRequestMessageSchema.entries,
|
|
726
|
+
...v13.object({
|
|
727
|
+
method: v13.literal(getCurrentPermissionsMethodName),
|
|
728
|
+
params: getCurrentPermissionsParamsSchema,
|
|
729
|
+
id: v13.string()
|
|
730
|
+
}).entries
|
|
686
731
|
});
|
|
687
|
-
|
|
732
|
+
|
|
733
|
+
// src/request/types/walletMethods/getWalletType.ts
|
|
734
|
+
var v14 = __toESM(require("valibot"));
|
|
735
|
+
var getWalletTypeMethodName = "wallet_getWalletType";
|
|
736
|
+
var getWalletTypeParamsSchema = v14.nullish(v14.null());
|
|
737
|
+
var getWalletTypeResultSchema = walletTypeSchema;
|
|
738
|
+
var getWalletTypeRequestMessageSchema = v14.object({
|
|
688
739
|
...rpcRequestMessageSchema.entries,
|
|
689
|
-
...
|
|
690
|
-
method:
|
|
691
|
-
params:
|
|
692
|
-
id:
|
|
740
|
+
...v14.object({
|
|
741
|
+
method: v14.literal(getWalletTypeMethodName),
|
|
742
|
+
params: getWalletTypeParamsSchema,
|
|
743
|
+
id: v14.string()
|
|
693
744
|
}).entries
|
|
694
745
|
});
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
blockExplorerUrl: v5.optional(v5.string()),
|
|
705
|
-
switch: v5.optional(v5.boolean())
|
|
706
|
-
}),
|
|
707
|
-
v5.object({
|
|
708
|
-
chain: v5.literal("stacks"),
|
|
709
|
-
name: v5.string(),
|
|
710
|
-
type: v5.enum(StacksNetworkType),
|
|
711
|
-
rpcUrl: v5.string(),
|
|
712
|
-
blockExplorerUrl: v5.optional(v5.string()),
|
|
713
|
-
switch: v5.optional(v5.boolean())
|
|
714
|
-
}),
|
|
715
|
-
v5.object({
|
|
716
|
-
chain: v5.literal("starknet"),
|
|
717
|
-
name: v5.string(),
|
|
718
|
-
type: v5.enum(StarknetNetworkType),
|
|
719
|
-
rpcUrl: v5.string(),
|
|
720
|
-
blockExplorerUrl: v5.optional(v5.string()),
|
|
721
|
-
switch: v5.optional(v5.boolean())
|
|
722
|
-
})
|
|
723
|
-
]);
|
|
724
|
-
var addNetworkRequestMessageSchema = v5.object({
|
|
746
|
+
|
|
747
|
+
// src/request/types/walletMethods/openReceive.ts
|
|
748
|
+
var v15 = __toESM(require("valibot"));
|
|
749
|
+
var openReceiveMethodName = "wallet_openReceive";
|
|
750
|
+
var openReceiveParamsSchema = v15.object({
|
|
751
|
+
address: v15.string()
|
|
752
|
+
});
|
|
753
|
+
var openReceiveResultSchema = v15.nullish(v15.null());
|
|
754
|
+
var openReceiveRequestMessageSchema = v15.object({
|
|
725
755
|
...rpcRequestMessageSchema.entries,
|
|
726
|
-
...
|
|
727
|
-
method:
|
|
728
|
-
params:
|
|
729
|
-
id:
|
|
756
|
+
...v15.object({
|
|
757
|
+
method: v15.literal(openReceiveMethodName),
|
|
758
|
+
params: openReceiveParamsSchema,
|
|
759
|
+
id: v15.string()
|
|
730
760
|
}).entries
|
|
731
761
|
});
|
|
732
|
-
|
|
733
|
-
|
|
762
|
+
|
|
763
|
+
// src/request/types/walletMethods/renouncePermissions.ts
|
|
764
|
+
var v16 = __toESM(require("valibot"));
|
|
765
|
+
var renouncePermissionsMethodName = "wallet_renouncePermissions";
|
|
766
|
+
var renouncePermissionsParamsSchema = v16.nullish(v16.null());
|
|
767
|
+
var renouncePermissionsResultSchema = v16.nullish(v16.null());
|
|
768
|
+
var renouncePermissionsRequestMessageSchema = v16.object({
|
|
769
|
+
...rpcRequestMessageSchema.entries,
|
|
770
|
+
...v16.object({
|
|
771
|
+
method: v16.literal(renouncePermissionsMethodName),
|
|
772
|
+
params: renouncePermissionsParamsSchema,
|
|
773
|
+
id: v16.string()
|
|
774
|
+
}).entries
|
|
775
|
+
});
|
|
776
|
+
|
|
777
|
+
// src/request/types/walletMethods/requestPermissions.ts
|
|
778
|
+
var v17 = __toESM(require("valibot"));
|
|
779
|
+
var requestPermissionsMethodName = "wallet_requestPermissions";
|
|
780
|
+
var requestPermissionsParamsSchema = v17.nullish(v17.array(PermissionRequestParams));
|
|
781
|
+
var requestPermissionsResultSchema = v17.literal(true);
|
|
782
|
+
var requestPermissionsRequestMessageSchema = v17.object({
|
|
783
|
+
...rpcRequestMessageSchema.entries,
|
|
784
|
+
...v17.object({
|
|
785
|
+
method: v17.literal(requestPermissionsMethodName),
|
|
786
|
+
params: requestPermissionsParamsSchema,
|
|
787
|
+
id: v17.string()
|
|
788
|
+
}).entries
|
|
734
789
|
});
|
|
735
790
|
|
|
736
791
|
// src/request/types/btcMethods.ts
|
|
@@ -740,58 +795,58 @@ var ProviderPlatform = /* @__PURE__ */ ((ProviderPlatform2) => {
|
|
|
740
795
|
return ProviderPlatform2;
|
|
741
796
|
})(ProviderPlatform || {});
|
|
742
797
|
var getInfoMethodName = "getInfo";
|
|
743
|
-
var getInfoParamsSchema =
|
|
744
|
-
var getInfoResultSchema =
|
|
798
|
+
var getInfoParamsSchema = v18.nullish(v18.null());
|
|
799
|
+
var getInfoResultSchema = v18.object({
|
|
745
800
|
/**
|
|
746
801
|
* Version of the wallet.
|
|
747
802
|
*/
|
|
748
|
-
version:
|
|
803
|
+
version: v18.string(),
|
|
749
804
|
/**
|
|
750
805
|
* The platform the wallet is running on (web or mobile).
|
|
751
806
|
*/
|
|
752
|
-
platform:
|
|
807
|
+
platform: v18.optional(v18.enum(ProviderPlatform)),
|
|
753
808
|
/**
|
|
754
809
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
755
810
|
*/
|
|
756
|
-
methods:
|
|
811
|
+
methods: v18.optional(v18.array(v18.string())),
|
|
757
812
|
/**
|
|
758
813
|
* List of WBIP standards supported by the wallet. Not currently used.
|
|
759
814
|
*/
|
|
760
|
-
supports:
|
|
815
|
+
supports: v18.array(v18.string())
|
|
761
816
|
});
|
|
762
|
-
var getInfoRequestMessageSchema =
|
|
817
|
+
var getInfoRequestMessageSchema = v18.object({
|
|
763
818
|
...rpcRequestMessageSchema.entries,
|
|
764
|
-
...
|
|
765
|
-
method:
|
|
819
|
+
...v18.object({
|
|
820
|
+
method: v18.literal(getInfoMethodName),
|
|
766
821
|
params: getInfoParamsSchema,
|
|
767
|
-
id:
|
|
822
|
+
id: v18.string()
|
|
768
823
|
}).entries
|
|
769
824
|
});
|
|
770
825
|
var getAddressesMethodName = "getAddresses";
|
|
771
|
-
var getAddressesParamsSchema =
|
|
826
|
+
var getAddressesParamsSchema = v18.object({
|
|
772
827
|
/**
|
|
773
828
|
* The purposes for which to generate addresses. See
|
|
774
829
|
* {@linkcode AddressPurpose} for available purposes.
|
|
775
830
|
*/
|
|
776
|
-
purposes:
|
|
831
|
+
purposes: v18.array(v18.enum(AddressPurpose)),
|
|
777
832
|
/**
|
|
778
833
|
* A message to be displayed to the user in the request prompt.
|
|
779
834
|
*/
|
|
780
|
-
message:
|
|
835
|
+
message: v18.optional(v18.string())
|
|
781
836
|
});
|
|
782
|
-
var getAddressesResultSchema =
|
|
837
|
+
var getAddressesResultSchema = v18.object({
|
|
783
838
|
/**
|
|
784
839
|
* The addresses generated for the given purposes.
|
|
785
840
|
*/
|
|
786
|
-
addresses:
|
|
841
|
+
addresses: v18.array(addressSchema),
|
|
787
842
|
network: getNetworkResultSchema
|
|
788
843
|
});
|
|
789
|
-
var getAddressesRequestMessageSchema =
|
|
844
|
+
var getAddressesRequestMessageSchema = v18.object({
|
|
790
845
|
...rpcRequestMessageSchema.entries,
|
|
791
|
-
...
|
|
792
|
-
method:
|
|
846
|
+
...v18.object({
|
|
847
|
+
method: v18.literal(getAddressesMethodName),
|
|
793
848
|
params: getAddressesParamsSchema,
|
|
794
|
-
id:
|
|
849
|
+
id: v18.string()
|
|
795
850
|
}).entries
|
|
796
851
|
});
|
|
797
852
|
var signMessageMethodName = "signMessage";
|
|
@@ -800,606 +855,606 @@ var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
|
|
|
800
855
|
MessageSigningProtocols2["BIP322"] = "BIP322";
|
|
801
856
|
return MessageSigningProtocols2;
|
|
802
857
|
})(MessageSigningProtocols || {});
|
|
803
|
-
var signMessageParamsSchema =
|
|
858
|
+
var signMessageParamsSchema = v18.object({
|
|
804
859
|
/**
|
|
805
860
|
* The address used for signing.
|
|
806
861
|
**/
|
|
807
|
-
address:
|
|
862
|
+
address: v18.string(),
|
|
808
863
|
/**
|
|
809
864
|
* The message to sign.
|
|
810
865
|
**/
|
|
811
|
-
message:
|
|
866
|
+
message: v18.string(),
|
|
812
867
|
/**
|
|
813
868
|
* The protocol to use for signing the message.
|
|
814
869
|
*/
|
|
815
|
-
protocol:
|
|
870
|
+
protocol: v18.optional(v18.enum(MessageSigningProtocols))
|
|
816
871
|
});
|
|
817
|
-
var signMessageResultSchema =
|
|
872
|
+
var signMessageResultSchema = v18.object({
|
|
818
873
|
/**
|
|
819
874
|
* The signature of the message.
|
|
820
875
|
*/
|
|
821
|
-
signature:
|
|
876
|
+
signature: v18.string(),
|
|
822
877
|
/**
|
|
823
878
|
* hash of the message.
|
|
824
879
|
*/
|
|
825
|
-
messageHash:
|
|
880
|
+
messageHash: v18.string(),
|
|
826
881
|
/**
|
|
827
882
|
* The address used for signing.
|
|
828
883
|
*/
|
|
829
|
-
address:
|
|
884
|
+
address: v18.string(),
|
|
830
885
|
/**
|
|
831
886
|
* The protocol to use for signing the message.
|
|
832
887
|
*/
|
|
833
|
-
protocol:
|
|
888
|
+
protocol: v18.enum(MessageSigningProtocols)
|
|
834
889
|
});
|
|
835
|
-
var signMessageRequestMessageSchema =
|
|
890
|
+
var signMessageRequestMessageSchema = v18.object({
|
|
836
891
|
...rpcRequestMessageSchema.entries,
|
|
837
|
-
...
|
|
838
|
-
method:
|
|
892
|
+
...v18.object({
|
|
893
|
+
method: v18.literal(signMessageMethodName),
|
|
839
894
|
params: signMessageParamsSchema,
|
|
840
|
-
id:
|
|
895
|
+
id: v18.string()
|
|
841
896
|
}).entries
|
|
842
897
|
});
|
|
843
898
|
var sendTransferMethodName = "sendTransfer";
|
|
844
|
-
var sendTransferParamsSchema =
|
|
899
|
+
var sendTransferParamsSchema = v18.object({
|
|
845
900
|
/**
|
|
846
901
|
* Array of recipients to send to.
|
|
847
902
|
* The amount to send to each recipient is in satoshis.
|
|
848
903
|
*/
|
|
849
|
-
recipients:
|
|
850
|
-
|
|
851
|
-
address:
|
|
852
|
-
amount:
|
|
904
|
+
recipients: v18.array(
|
|
905
|
+
v18.object({
|
|
906
|
+
address: v18.string(),
|
|
907
|
+
amount: v18.number()
|
|
853
908
|
})
|
|
854
909
|
)
|
|
855
910
|
});
|
|
856
|
-
var sendTransferResultSchema =
|
|
911
|
+
var sendTransferResultSchema = v18.object({
|
|
857
912
|
/**
|
|
858
913
|
* The transaction id as a hex-encoded string.
|
|
859
914
|
*/
|
|
860
|
-
txid:
|
|
915
|
+
txid: v18.string()
|
|
861
916
|
});
|
|
862
|
-
var sendTransferRequestMessageSchema =
|
|
917
|
+
var sendTransferRequestMessageSchema = v18.object({
|
|
863
918
|
...rpcRequestMessageSchema.entries,
|
|
864
|
-
...
|
|
865
|
-
method:
|
|
919
|
+
...v18.object({
|
|
920
|
+
method: v18.literal(sendTransferMethodName),
|
|
866
921
|
params: sendTransferParamsSchema,
|
|
867
|
-
id:
|
|
922
|
+
id: v18.string()
|
|
868
923
|
}).entries
|
|
869
924
|
});
|
|
870
925
|
var signPsbtMethodName = "signPsbt";
|
|
871
|
-
var signPsbtParamsSchema =
|
|
926
|
+
var signPsbtParamsSchema = v18.object({
|
|
872
927
|
/**
|
|
873
928
|
* The base64 encoded PSBT to sign.
|
|
874
929
|
*/
|
|
875
|
-
psbt:
|
|
930
|
+
psbt: v18.string(),
|
|
876
931
|
/**
|
|
877
932
|
* The inputs to sign.
|
|
878
933
|
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
879
934
|
*/
|
|
880
|
-
signInputs:
|
|
935
|
+
signInputs: v18.optional(v18.record(v18.string(), v18.array(v18.number()))),
|
|
881
936
|
/**
|
|
882
937
|
* Whether to broadcast the transaction after signing.
|
|
883
938
|
**/
|
|
884
|
-
broadcast:
|
|
939
|
+
broadcast: v18.optional(v18.boolean())
|
|
885
940
|
});
|
|
886
|
-
var signPsbtResultSchema =
|
|
941
|
+
var signPsbtResultSchema = v18.object({
|
|
887
942
|
/**
|
|
888
943
|
* The base64 encoded PSBT after signing.
|
|
889
944
|
*/
|
|
890
|
-
psbt:
|
|
945
|
+
psbt: v18.string(),
|
|
891
946
|
/**
|
|
892
947
|
* The transaction id as a hex-encoded string.
|
|
893
948
|
* This is only returned if the transaction was broadcast.
|
|
894
949
|
**/
|
|
895
|
-
txid:
|
|
950
|
+
txid: v18.optional(v18.string())
|
|
896
951
|
});
|
|
897
|
-
var signPsbtRequestMessageSchema =
|
|
952
|
+
var signPsbtRequestMessageSchema = v18.object({
|
|
898
953
|
...rpcRequestMessageSchema.entries,
|
|
899
|
-
...
|
|
900
|
-
method:
|
|
954
|
+
...v18.object({
|
|
955
|
+
method: v18.literal(signPsbtMethodName),
|
|
901
956
|
params: signPsbtParamsSchema,
|
|
902
|
-
id:
|
|
957
|
+
id: v18.string()
|
|
903
958
|
}).entries
|
|
904
959
|
});
|
|
905
960
|
var getAccountsMethodName = "getAccounts";
|
|
906
|
-
var getAccountsParamsSchema =
|
|
961
|
+
var getAccountsParamsSchema = v18.object({
|
|
907
962
|
/**
|
|
908
963
|
* The purposes for which to generate addresses. See
|
|
909
964
|
* {@linkcode AddressPurpose} for available purposes.
|
|
910
965
|
*/
|
|
911
|
-
purposes:
|
|
966
|
+
purposes: v18.array(v18.enum(AddressPurpose)),
|
|
912
967
|
/**
|
|
913
968
|
* A message to be displayed to the user in the request prompt.
|
|
914
969
|
*/
|
|
915
|
-
message:
|
|
970
|
+
message: v18.optional(v18.string())
|
|
916
971
|
});
|
|
917
|
-
var getAccountsResultSchema =
|
|
918
|
-
|
|
972
|
+
var getAccountsResultSchema = v18.array(
|
|
973
|
+
v18.object({
|
|
919
974
|
...addressSchema.entries,
|
|
920
|
-
...
|
|
975
|
+
...v18.object({
|
|
921
976
|
walletType: walletTypeSchema
|
|
922
977
|
}).entries
|
|
923
978
|
})
|
|
924
979
|
);
|
|
925
|
-
var getAccountsRequestMessageSchema =
|
|
980
|
+
var getAccountsRequestMessageSchema = v18.object({
|
|
926
981
|
...rpcRequestMessageSchema.entries,
|
|
927
|
-
...
|
|
928
|
-
method:
|
|
982
|
+
...v18.object({
|
|
983
|
+
method: v18.literal(getAccountsMethodName),
|
|
929
984
|
params: getAccountsParamsSchema,
|
|
930
|
-
id:
|
|
985
|
+
id: v18.string()
|
|
931
986
|
}).entries
|
|
932
987
|
});
|
|
933
988
|
var getBalanceMethodName = "getBalance";
|
|
934
|
-
var getBalanceParamsSchema =
|
|
935
|
-
var getBalanceResultSchema =
|
|
989
|
+
var getBalanceParamsSchema = v18.nullish(v18.null());
|
|
990
|
+
var getBalanceResultSchema = v18.object({
|
|
936
991
|
/**
|
|
937
992
|
* The confirmed balance of the wallet in sats. Using a string due to chrome
|
|
938
993
|
* messages not supporting bigint
|
|
939
994
|
* (https://issues.chromium.org/issues/40116184).
|
|
940
995
|
*/
|
|
941
|
-
confirmed:
|
|
996
|
+
confirmed: v18.string(),
|
|
942
997
|
/**
|
|
943
998
|
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
|
|
944
999
|
* messages not supporting bigint
|
|
945
1000
|
* (https://issues.chromium.org/issues/40116184).
|
|
946
1001
|
*/
|
|
947
|
-
unconfirmed:
|
|
1002
|
+
unconfirmed: v18.string(),
|
|
948
1003
|
/**
|
|
949
1004
|
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
950
1005
|
* sats. Using a string due to chrome messages not supporting bigint
|
|
951
1006
|
* (https://issues.chromium.org/issues/40116184).
|
|
952
1007
|
*/
|
|
953
|
-
total:
|
|
1008
|
+
total: v18.string()
|
|
954
1009
|
});
|
|
955
|
-
var getBalanceRequestMessageSchema =
|
|
1010
|
+
var getBalanceRequestMessageSchema = v18.object({
|
|
956
1011
|
...rpcRequestMessageSchema.entries,
|
|
957
|
-
...
|
|
958
|
-
method:
|
|
959
|
-
id:
|
|
1012
|
+
...v18.object({
|
|
1013
|
+
method: v18.literal(getBalanceMethodName),
|
|
1014
|
+
id: v18.string()
|
|
960
1015
|
}).entries
|
|
961
1016
|
});
|
|
962
1017
|
|
|
963
1018
|
// src/request/types/ordinalsMethods.ts
|
|
964
|
-
var
|
|
1019
|
+
var v19 = __toESM(require("valibot"));
|
|
965
1020
|
var getInscriptionsMethodName = "ord_getInscriptions";
|
|
966
|
-
var getInscriptionsParamsSchema =
|
|
967
|
-
offset:
|
|
968
|
-
limit:
|
|
969
|
-
});
|
|
970
|
-
var getInscriptionsResultSchema =
|
|
971
|
-
total:
|
|
972
|
-
limit:
|
|
973
|
-
offset:
|
|
974
|
-
inscriptions:
|
|
975
|
-
|
|
976
|
-
inscriptionId:
|
|
977
|
-
inscriptionNumber:
|
|
978
|
-
address:
|
|
979
|
-
collectionName:
|
|
980
|
-
postage:
|
|
981
|
-
contentLength:
|
|
982
|
-
contentType:
|
|
983
|
-
timestamp:
|
|
984
|
-
offset:
|
|
985
|
-
genesisTransaction:
|
|
986
|
-
output:
|
|
1021
|
+
var getInscriptionsParamsSchema = v19.object({
|
|
1022
|
+
offset: v19.number(),
|
|
1023
|
+
limit: v19.number()
|
|
1024
|
+
});
|
|
1025
|
+
var getInscriptionsResultSchema = v19.object({
|
|
1026
|
+
total: v19.number(),
|
|
1027
|
+
limit: v19.number(),
|
|
1028
|
+
offset: v19.number(),
|
|
1029
|
+
inscriptions: v19.array(
|
|
1030
|
+
v19.object({
|
|
1031
|
+
inscriptionId: v19.string(),
|
|
1032
|
+
inscriptionNumber: v19.string(),
|
|
1033
|
+
address: v19.string(),
|
|
1034
|
+
collectionName: v19.optional(v19.string()),
|
|
1035
|
+
postage: v19.string(),
|
|
1036
|
+
contentLength: v19.string(),
|
|
1037
|
+
contentType: v19.string(),
|
|
1038
|
+
timestamp: v19.number(),
|
|
1039
|
+
offset: v19.number(),
|
|
1040
|
+
genesisTransaction: v19.string(),
|
|
1041
|
+
output: v19.string()
|
|
987
1042
|
})
|
|
988
1043
|
)
|
|
989
1044
|
});
|
|
990
|
-
var getInscriptionsRequestMessageSchema =
|
|
1045
|
+
var getInscriptionsRequestMessageSchema = v19.object({
|
|
991
1046
|
...rpcRequestMessageSchema.entries,
|
|
992
|
-
...
|
|
993
|
-
method:
|
|
1047
|
+
...v19.object({
|
|
1048
|
+
method: v19.literal(getInscriptionsMethodName),
|
|
994
1049
|
params: getInscriptionsParamsSchema,
|
|
995
|
-
id:
|
|
1050
|
+
id: v19.string()
|
|
996
1051
|
}).entries
|
|
997
1052
|
});
|
|
998
1053
|
var sendInscriptionsMethodName = "ord_sendInscriptions";
|
|
999
|
-
var sendInscriptionsParamsSchema =
|
|
1000
|
-
transfers:
|
|
1001
|
-
|
|
1002
|
-
address:
|
|
1003
|
-
inscriptionId:
|
|
1054
|
+
var sendInscriptionsParamsSchema = v19.object({
|
|
1055
|
+
transfers: v19.array(
|
|
1056
|
+
v19.object({
|
|
1057
|
+
address: v19.string(),
|
|
1058
|
+
inscriptionId: v19.string()
|
|
1004
1059
|
})
|
|
1005
1060
|
)
|
|
1006
1061
|
});
|
|
1007
|
-
var sendInscriptionsResultSchema =
|
|
1008
|
-
txid:
|
|
1062
|
+
var sendInscriptionsResultSchema = v19.object({
|
|
1063
|
+
txid: v19.string()
|
|
1009
1064
|
});
|
|
1010
|
-
var sendInscriptionsRequestMessageSchema =
|
|
1065
|
+
var sendInscriptionsRequestMessageSchema = v19.object({
|
|
1011
1066
|
...rpcRequestMessageSchema.entries,
|
|
1012
|
-
...
|
|
1013
|
-
method:
|
|
1067
|
+
...v19.object({
|
|
1068
|
+
method: v19.literal(sendInscriptionsMethodName),
|
|
1014
1069
|
params: sendInscriptionsParamsSchema,
|
|
1015
|
-
id:
|
|
1070
|
+
id: v19.string()
|
|
1016
1071
|
}).entries
|
|
1017
1072
|
});
|
|
1018
1073
|
|
|
1019
1074
|
// src/request/types/runesMethods/etch.ts
|
|
1020
|
-
var
|
|
1075
|
+
var v20 = __toESM(require("valibot"));
|
|
1021
1076
|
var runesEtchMethodName = "runes_etch";
|
|
1022
|
-
var etchTermsSchema =
|
|
1023
|
-
amount:
|
|
1024
|
-
cap:
|
|
1025
|
-
heightStart:
|
|
1026
|
-
heightEnd:
|
|
1027
|
-
offsetStart:
|
|
1028
|
-
offsetEnd:
|
|
1029
|
-
});
|
|
1030
|
-
var inscriptionDetailsSchema =
|
|
1031
|
-
contentType:
|
|
1032
|
-
contentBase64:
|
|
1033
|
-
});
|
|
1034
|
-
var runesEtchParamsSchema =
|
|
1035
|
-
runeName:
|
|
1036
|
-
divisibility:
|
|
1037
|
-
symbol:
|
|
1038
|
-
premine:
|
|
1039
|
-
isMintable:
|
|
1040
|
-
delegateInscriptionId:
|
|
1041
|
-
destinationAddress:
|
|
1042
|
-
refundAddress:
|
|
1043
|
-
feeRate:
|
|
1044
|
-
appServiceFee:
|
|
1045
|
-
appServiceFeeAddress:
|
|
1046
|
-
terms:
|
|
1047
|
-
inscriptionDetails:
|
|
1048
|
-
network:
|
|
1049
|
-
});
|
|
1050
|
-
var runesEtchResultSchema =
|
|
1051
|
-
orderId:
|
|
1052
|
-
fundTransactionId:
|
|
1053
|
-
fundingAddress:
|
|
1054
|
-
});
|
|
1055
|
-
var runesEtchRequestMessageSchema =
|
|
1077
|
+
var etchTermsSchema = v20.object({
|
|
1078
|
+
amount: v20.string(),
|
|
1079
|
+
cap: v20.string(),
|
|
1080
|
+
heightStart: v20.optional(v20.string()),
|
|
1081
|
+
heightEnd: v20.optional(v20.string()),
|
|
1082
|
+
offsetStart: v20.optional(v20.string()),
|
|
1083
|
+
offsetEnd: v20.optional(v20.string())
|
|
1084
|
+
});
|
|
1085
|
+
var inscriptionDetailsSchema = v20.object({
|
|
1086
|
+
contentType: v20.string(),
|
|
1087
|
+
contentBase64: v20.string()
|
|
1088
|
+
});
|
|
1089
|
+
var runesEtchParamsSchema = v20.object({
|
|
1090
|
+
runeName: v20.string(),
|
|
1091
|
+
divisibility: v20.optional(v20.number()),
|
|
1092
|
+
symbol: v20.optional(v20.string()),
|
|
1093
|
+
premine: v20.optional(v20.string()),
|
|
1094
|
+
isMintable: v20.boolean(),
|
|
1095
|
+
delegateInscriptionId: v20.optional(v20.string()),
|
|
1096
|
+
destinationAddress: v20.string(),
|
|
1097
|
+
refundAddress: v20.string(),
|
|
1098
|
+
feeRate: v20.number(),
|
|
1099
|
+
appServiceFee: v20.optional(v20.number()),
|
|
1100
|
+
appServiceFeeAddress: v20.optional(v20.string()),
|
|
1101
|
+
terms: v20.optional(etchTermsSchema),
|
|
1102
|
+
inscriptionDetails: v20.optional(inscriptionDetailsSchema),
|
|
1103
|
+
network: v20.optional(v20.enum(BitcoinNetworkType))
|
|
1104
|
+
});
|
|
1105
|
+
var runesEtchResultSchema = v20.object({
|
|
1106
|
+
orderId: v20.string(),
|
|
1107
|
+
fundTransactionId: v20.string(),
|
|
1108
|
+
fundingAddress: v20.string()
|
|
1109
|
+
});
|
|
1110
|
+
var runesEtchRequestMessageSchema = v20.object({
|
|
1056
1111
|
...rpcRequestMessageSchema.entries,
|
|
1057
|
-
...
|
|
1058
|
-
method:
|
|
1112
|
+
...v20.object({
|
|
1113
|
+
method: v20.literal(runesEtchMethodName),
|
|
1059
1114
|
params: runesEtchParamsSchema,
|
|
1060
|
-
id:
|
|
1115
|
+
id: v20.string()
|
|
1061
1116
|
}).entries
|
|
1062
1117
|
});
|
|
1063
1118
|
|
|
1064
1119
|
// src/request/types/runesMethods/getBalance.ts
|
|
1065
|
-
var
|
|
1120
|
+
var v21 = __toESM(require("valibot"));
|
|
1066
1121
|
var runesGetBalanceMethodName = "runes_getBalance";
|
|
1067
|
-
var runesGetBalanceParamsSchema =
|
|
1068
|
-
var runesGetBalanceResultSchema =
|
|
1069
|
-
balances:
|
|
1070
|
-
|
|
1071
|
-
runeName:
|
|
1072
|
-
amount:
|
|
1073
|
-
divisibility:
|
|
1074
|
-
symbol:
|
|
1075
|
-
inscriptionId:
|
|
1076
|
-
spendableBalance:
|
|
1122
|
+
var runesGetBalanceParamsSchema = v21.nullish(v21.null());
|
|
1123
|
+
var runesGetBalanceResultSchema = v21.object({
|
|
1124
|
+
balances: v21.array(
|
|
1125
|
+
v21.object({
|
|
1126
|
+
runeName: v21.string(),
|
|
1127
|
+
amount: v21.string(),
|
|
1128
|
+
divisibility: v21.number(),
|
|
1129
|
+
symbol: v21.string(),
|
|
1130
|
+
inscriptionId: v21.nullish(v21.string()),
|
|
1131
|
+
spendableBalance: v21.string()
|
|
1077
1132
|
})
|
|
1078
1133
|
)
|
|
1079
1134
|
});
|
|
1080
|
-
var runesGetBalanceRequestMessageSchema =
|
|
1135
|
+
var runesGetBalanceRequestMessageSchema = v21.object({
|
|
1081
1136
|
...rpcRequestMessageSchema.entries,
|
|
1082
|
-
...
|
|
1083
|
-
method:
|
|
1137
|
+
...v21.object({
|
|
1138
|
+
method: v21.literal(runesGetBalanceMethodName),
|
|
1084
1139
|
params: runesGetBalanceParamsSchema,
|
|
1085
|
-
id:
|
|
1140
|
+
id: v21.string()
|
|
1086
1141
|
}).entries
|
|
1087
1142
|
});
|
|
1088
1143
|
|
|
1089
1144
|
// src/request/types/runesMethods/mint.ts
|
|
1090
|
-
var
|
|
1145
|
+
var v22 = __toESM(require("valibot"));
|
|
1091
1146
|
var runesMintMethodName = "runes_mint";
|
|
1092
|
-
var runesMintParamsSchema =
|
|
1093
|
-
appServiceFee:
|
|
1094
|
-
appServiceFeeAddress:
|
|
1095
|
-
destinationAddress:
|
|
1096
|
-
feeRate:
|
|
1097
|
-
refundAddress:
|
|
1098
|
-
repeats:
|
|
1099
|
-
runeName:
|
|
1100
|
-
network:
|
|
1101
|
-
});
|
|
1102
|
-
var runesMintResultSchema =
|
|
1103
|
-
orderId:
|
|
1104
|
-
fundTransactionId:
|
|
1105
|
-
fundingAddress:
|
|
1106
|
-
});
|
|
1107
|
-
var runesMintRequestMessageSchema =
|
|
1147
|
+
var runesMintParamsSchema = v22.object({
|
|
1148
|
+
appServiceFee: v22.optional(v22.number()),
|
|
1149
|
+
appServiceFeeAddress: v22.optional(v22.string()),
|
|
1150
|
+
destinationAddress: v22.string(),
|
|
1151
|
+
feeRate: v22.number(),
|
|
1152
|
+
refundAddress: v22.string(),
|
|
1153
|
+
repeats: v22.number(),
|
|
1154
|
+
runeName: v22.string(),
|
|
1155
|
+
network: v22.optional(v22.enum(BitcoinNetworkType))
|
|
1156
|
+
});
|
|
1157
|
+
var runesMintResultSchema = v22.object({
|
|
1158
|
+
orderId: v22.string(),
|
|
1159
|
+
fundTransactionId: v22.string(),
|
|
1160
|
+
fundingAddress: v22.string()
|
|
1161
|
+
});
|
|
1162
|
+
var runesMintRequestMessageSchema = v22.object({
|
|
1108
1163
|
...rpcRequestMessageSchema.entries,
|
|
1109
|
-
...
|
|
1110
|
-
method:
|
|
1164
|
+
...v22.object({
|
|
1165
|
+
method: v22.literal(runesMintMethodName),
|
|
1111
1166
|
params: runesMintParamsSchema,
|
|
1112
|
-
id:
|
|
1167
|
+
id: v22.string()
|
|
1113
1168
|
}).entries
|
|
1114
1169
|
});
|
|
1115
1170
|
|
|
1116
1171
|
// src/request/types/runesMethods/transfer.ts
|
|
1117
|
-
var
|
|
1172
|
+
var v23 = __toESM(require("valibot"));
|
|
1118
1173
|
var runesTransferMethodName = "runes_transfer";
|
|
1119
|
-
var runesTransferParamsSchema =
|
|
1120
|
-
recipients:
|
|
1121
|
-
|
|
1122
|
-
runeName:
|
|
1123
|
-
amount:
|
|
1124
|
-
address:
|
|
1174
|
+
var runesTransferParamsSchema = v23.object({
|
|
1175
|
+
recipients: v23.array(
|
|
1176
|
+
v23.object({
|
|
1177
|
+
runeName: v23.string(),
|
|
1178
|
+
amount: v23.string(),
|
|
1179
|
+
address: v23.string()
|
|
1125
1180
|
})
|
|
1126
1181
|
)
|
|
1127
1182
|
});
|
|
1128
|
-
var runesTransferResultSchema =
|
|
1129
|
-
txid:
|
|
1183
|
+
var runesTransferResultSchema = v23.object({
|
|
1184
|
+
txid: v23.string()
|
|
1130
1185
|
});
|
|
1131
|
-
var runesTransferRequestMessageSchema =
|
|
1186
|
+
var runesTransferRequestMessageSchema = v23.object({
|
|
1132
1187
|
...rpcRequestMessageSchema.entries,
|
|
1133
|
-
...
|
|
1134
|
-
method:
|
|
1188
|
+
...v23.object({
|
|
1189
|
+
method: v23.literal(runesTransferMethodName),
|
|
1135
1190
|
params: runesTransferParamsSchema,
|
|
1136
|
-
id:
|
|
1191
|
+
id: v23.string()
|
|
1137
1192
|
}).entries
|
|
1138
1193
|
});
|
|
1139
1194
|
|
|
1140
1195
|
// src/request/types/sparkMethods/flashnetMethods/clawbackFunds.ts
|
|
1141
|
-
var
|
|
1196
|
+
var v24 = __toESM(require("valibot"));
|
|
1142
1197
|
var sparkFlashnetClawbackFundsMethodName = "spark_flashnet_clawbackFunds";
|
|
1143
|
-
var sparkFlashnetClawbackFundsParamsSchema =
|
|
1144
|
-
sparkTransferId:
|
|
1145
|
-
lpIdentityPublicKey:
|
|
1146
|
-
});
|
|
1147
|
-
var sparkFlashnetClawbackFundsResultSchema =
|
|
1148
|
-
requestId:
|
|
1149
|
-
accepted:
|
|
1150
|
-
internalRequestId:
|
|
1151
|
-
sparkStatusTrackingId:
|
|
1152
|
-
error:
|
|
1153
|
-
});
|
|
1154
|
-
var sparkFlashnetClawbackFundsRequestMessageSchema =
|
|
1198
|
+
var sparkFlashnetClawbackFundsParamsSchema = v24.object({
|
|
1199
|
+
sparkTransferId: v24.string(),
|
|
1200
|
+
lpIdentityPublicKey: v24.string()
|
|
1201
|
+
});
|
|
1202
|
+
var sparkFlashnetClawbackFundsResultSchema = v24.object({
|
|
1203
|
+
requestId: v24.string(),
|
|
1204
|
+
accepted: v24.boolean(),
|
|
1205
|
+
internalRequestId: v24.optional(v24.string()),
|
|
1206
|
+
sparkStatusTrackingId: v24.optional(v24.string()),
|
|
1207
|
+
error: v24.optional(v24.string())
|
|
1208
|
+
});
|
|
1209
|
+
var sparkFlashnetClawbackFundsRequestMessageSchema = v24.object({
|
|
1155
1210
|
...rpcRequestMessageSchema.entries,
|
|
1156
|
-
...
|
|
1157
|
-
method:
|
|
1211
|
+
...v24.object({
|
|
1212
|
+
method: v24.literal(sparkFlashnetClawbackFundsMethodName),
|
|
1158
1213
|
params: sparkFlashnetClawbackFundsParamsSchema,
|
|
1159
|
-
id:
|
|
1214
|
+
id: v24.string()
|
|
1160
1215
|
}).entries
|
|
1161
1216
|
});
|
|
1162
1217
|
|
|
1163
1218
|
// src/request/types/sparkMethods/flashnetMethods/executeRouteSwap.ts
|
|
1164
|
-
var
|
|
1219
|
+
var v25 = __toESM(require("valibot"));
|
|
1165
1220
|
var sparkFlashnetExecuteRouteSwapMethodName = "spark_flashnet_executeRouteSwap";
|
|
1166
|
-
var sparkFlashnetExecuteRouteSwapParamsSchema =
|
|
1167
|
-
hops:
|
|
1168
|
-
|
|
1169
|
-
poolId:
|
|
1170
|
-
assetInAddress:
|
|
1171
|
-
assetOutAddress:
|
|
1172
|
-
hopIntegratorFeeRateBps:
|
|
1221
|
+
var sparkFlashnetExecuteRouteSwapParamsSchema = v25.object({
|
|
1222
|
+
hops: v25.array(
|
|
1223
|
+
v25.object({
|
|
1224
|
+
poolId: v25.string(),
|
|
1225
|
+
assetInAddress: v25.string(),
|
|
1226
|
+
assetOutAddress: v25.string(),
|
|
1227
|
+
hopIntegratorFeeRateBps: v25.optional(v25.number())
|
|
1173
1228
|
})
|
|
1174
1229
|
),
|
|
1175
|
-
initialAssetAddress:
|
|
1176
|
-
inputAmount:
|
|
1177
|
-
maxRouteSlippageBps:
|
|
1178
|
-
minAmountOut:
|
|
1179
|
-
integratorFeeRateBps:
|
|
1180
|
-
integratorPublicKey:
|
|
1181
|
-
});
|
|
1182
|
-
var sparkFlashnetExecuteRouteSwapResultSchema =
|
|
1183
|
-
requestId:
|
|
1184
|
-
accepted:
|
|
1185
|
-
outputAmount:
|
|
1186
|
-
executionPrice:
|
|
1187
|
-
finalOutboundTransferId:
|
|
1188
|
-
error:
|
|
1189
|
-
});
|
|
1190
|
-
var sparkFlashnetExecuteRouteSwapRequestMessageSchema =
|
|
1230
|
+
initialAssetAddress: v25.string(),
|
|
1231
|
+
inputAmount: v25.string(),
|
|
1232
|
+
maxRouteSlippageBps: v25.string(),
|
|
1233
|
+
minAmountOut: v25.optional(v25.string()),
|
|
1234
|
+
integratorFeeRateBps: v25.optional(v25.number()),
|
|
1235
|
+
integratorPublicKey: v25.optional(v25.string())
|
|
1236
|
+
});
|
|
1237
|
+
var sparkFlashnetExecuteRouteSwapResultSchema = v25.object({
|
|
1238
|
+
requestId: v25.string(),
|
|
1239
|
+
accepted: v25.boolean(),
|
|
1240
|
+
outputAmount: v25.string(),
|
|
1241
|
+
executionPrice: v25.string(),
|
|
1242
|
+
finalOutboundTransferId: v25.string(),
|
|
1243
|
+
error: v25.optional(v25.string())
|
|
1244
|
+
});
|
|
1245
|
+
var sparkFlashnetExecuteRouteSwapRequestMessageSchema = v25.object({
|
|
1191
1246
|
...rpcRequestMessageSchema.entries,
|
|
1192
|
-
...
|
|
1193
|
-
method:
|
|
1247
|
+
...v25.object({
|
|
1248
|
+
method: v25.literal(sparkFlashnetExecuteRouteSwapMethodName),
|
|
1194
1249
|
params: sparkFlashnetExecuteRouteSwapParamsSchema,
|
|
1195
|
-
id:
|
|
1250
|
+
id: v25.string()
|
|
1196
1251
|
}).entries
|
|
1197
1252
|
});
|
|
1198
1253
|
|
|
1199
1254
|
// src/request/types/sparkMethods/flashnetMethods/executeSwap.ts
|
|
1200
|
-
var
|
|
1255
|
+
var v26 = __toESM(require("valibot"));
|
|
1201
1256
|
var sparkFlashnetExecuteSwapMethodName = "spark_flashnet_executeSwap";
|
|
1202
|
-
var sparkFlashnetExecuteSwapParamsSchema =
|
|
1203
|
-
poolId:
|
|
1204
|
-
assetInAddress:
|
|
1205
|
-
assetOutAddress:
|
|
1206
|
-
amountIn:
|
|
1207
|
-
maxSlippageBps:
|
|
1208
|
-
minAmountOut:
|
|
1209
|
-
integratorFeeRateBps:
|
|
1210
|
-
integratorPublicKey:
|
|
1211
|
-
});
|
|
1212
|
-
var sparkFlashnetExecuteSwapResultSchema =
|
|
1213
|
-
requestId:
|
|
1214
|
-
accepted:
|
|
1215
|
-
amountOut:
|
|
1216
|
-
feeAmount:
|
|
1217
|
-
executionPrice:
|
|
1218
|
-
assetOutAddress:
|
|
1219
|
-
assetInAddress:
|
|
1220
|
-
outboundTransferId:
|
|
1221
|
-
error:
|
|
1222
|
-
});
|
|
1223
|
-
var sparkFlashnetExecuteSwapRequestMessageSchema =
|
|
1257
|
+
var sparkFlashnetExecuteSwapParamsSchema = v26.object({
|
|
1258
|
+
poolId: v26.string(),
|
|
1259
|
+
assetInAddress: v26.string(),
|
|
1260
|
+
assetOutAddress: v26.string(),
|
|
1261
|
+
amountIn: v26.string(),
|
|
1262
|
+
maxSlippageBps: v26.number(),
|
|
1263
|
+
minAmountOut: v26.optional(v26.string()),
|
|
1264
|
+
integratorFeeRateBps: v26.optional(v26.number()),
|
|
1265
|
+
integratorPublicKey: v26.optional(v26.string())
|
|
1266
|
+
});
|
|
1267
|
+
var sparkFlashnetExecuteSwapResultSchema = v26.object({
|
|
1268
|
+
requestId: v26.string(),
|
|
1269
|
+
accepted: v26.boolean(),
|
|
1270
|
+
amountOut: v26.optional(v26.string()),
|
|
1271
|
+
feeAmount: v26.optional(v26.string()),
|
|
1272
|
+
executionPrice: v26.optional(v26.string()),
|
|
1273
|
+
assetOutAddress: v26.optional(v26.string()),
|
|
1274
|
+
assetInAddress: v26.optional(v26.string()),
|
|
1275
|
+
outboundTransferId: v26.optional(v26.string()),
|
|
1276
|
+
error: v26.optional(v26.string())
|
|
1277
|
+
});
|
|
1278
|
+
var sparkFlashnetExecuteSwapRequestMessageSchema = v26.object({
|
|
1224
1279
|
...rpcRequestMessageSchema.entries,
|
|
1225
|
-
...
|
|
1226
|
-
method:
|
|
1280
|
+
...v26.object({
|
|
1281
|
+
method: v26.literal(sparkFlashnetExecuteSwapMethodName),
|
|
1227
1282
|
params: sparkFlashnetExecuteSwapParamsSchema,
|
|
1228
|
-
id:
|
|
1283
|
+
id: v26.string()
|
|
1229
1284
|
}).entries
|
|
1230
1285
|
});
|
|
1231
1286
|
|
|
1232
1287
|
// src/request/types/sparkMethods/flashnetMethods/getClawbackEligibleTransfers.ts
|
|
1233
|
-
var
|
|
1288
|
+
var v27 = __toESM(require("valibot"));
|
|
1234
1289
|
var sparkGetClawbackEligibleTransfersMethodName = "spark_flashnet_getClawbackEligibleTransfers";
|
|
1235
|
-
var sparkGetClawbackEligibleTransfersParamsSchema =
|
|
1236
|
-
var sparkGetClawbackEligibleTransfersResultSchema =
|
|
1237
|
-
eligibleTransfers:
|
|
1238
|
-
|
|
1239
|
-
txId:
|
|
1240
|
-
createdAt:
|
|
1241
|
-
lpIdentityPublicKey:
|
|
1290
|
+
var sparkGetClawbackEligibleTransfersParamsSchema = v27.nullish(v27.null());
|
|
1291
|
+
var sparkGetClawbackEligibleTransfersResultSchema = v27.object({
|
|
1292
|
+
eligibleTransfers: v27.array(
|
|
1293
|
+
v27.object({
|
|
1294
|
+
txId: v27.string(),
|
|
1295
|
+
createdAt: v27.string(),
|
|
1296
|
+
lpIdentityPublicKey: v27.string()
|
|
1242
1297
|
})
|
|
1243
1298
|
)
|
|
1244
1299
|
});
|
|
1245
|
-
var sparkGetClawbackEligibleTransfersRequestMessageSchema =
|
|
1300
|
+
var sparkGetClawbackEligibleTransfersRequestMessageSchema = v27.object({
|
|
1246
1301
|
...rpcRequestMessageSchema.entries,
|
|
1247
|
-
...
|
|
1248
|
-
method:
|
|
1302
|
+
...v27.object({
|
|
1303
|
+
method: v27.literal(sparkGetClawbackEligibleTransfersMethodName),
|
|
1249
1304
|
params: sparkGetClawbackEligibleTransfersParamsSchema,
|
|
1250
|
-
id:
|
|
1305
|
+
id: v27.string()
|
|
1251
1306
|
}).entries
|
|
1252
1307
|
});
|
|
1253
1308
|
|
|
1254
1309
|
// src/request/types/sparkMethods/flashnetMethods/getJwt.ts
|
|
1255
|
-
var
|
|
1310
|
+
var v28 = __toESM(require("valibot"));
|
|
1256
1311
|
var sparkFlashnetGetJwtMethodName = "spark_flashnet_getJwt";
|
|
1257
|
-
var sparkFlashnetGetJwtParamsSchema =
|
|
1258
|
-
var sparkFlashnetGetJwtResultSchema =
|
|
1312
|
+
var sparkFlashnetGetJwtParamsSchema = v28.null();
|
|
1313
|
+
var sparkFlashnetGetJwtResultSchema = v28.object({
|
|
1259
1314
|
/**
|
|
1260
1315
|
* The JWT token for authenticated requests to the Flashnet API.
|
|
1261
1316
|
*/
|
|
1262
|
-
jwt:
|
|
1317
|
+
jwt: v28.string()
|
|
1263
1318
|
});
|
|
1264
|
-
var sparkFlashnetGetJwtRequestMessageSchema =
|
|
1319
|
+
var sparkFlashnetGetJwtRequestMessageSchema = v28.object({
|
|
1265
1320
|
...rpcRequestMessageSchema.entries,
|
|
1266
|
-
...
|
|
1267
|
-
method:
|
|
1321
|
+
...v28.object({
|
|
1322
|
+
method: v28.literal(sparkFlashnetGetJwtMethodName),
|
|
1268
1323
|
params: sparkFlashnetGetJwtParamsSchema,
|
|
1269
|
-
id:
|
|
1324
|
+
id: v28.string()
|
|
1270
1325
|
}).entries
|
|
1271
1326
|
});
|
|
1272
1327
|
|
|
1273
1328
|
// src/request/types/sparkMethods/flashnetMethods/intents/addLiquidity.ts
|
|
1274
|
-
var
|
|
1275
|
-
var sparkFlashnetAddLiquidityIntentSchema =
|
|
1276
|
-
type:
|
|
1277
|
-
data:
|
|
1278
|
-
userPublicKey:
|
|
1279
|
-
poolId:
|
|
1280
|
-
assetAAmount:
|
|
1281
|
-
assetBAmount:
|
|
1282
|
-
assetAMinAmountIn:
|
|
1283
|
-
assetBMinAmountIn:
|
|
1284
|
-
assetATransferId:
|
|
1285
|
-
assetBTransferId:
|
|
1286
|
-
nonce:
|
|
1329
|
+
var v29 = __toESM(require("valibot"));
|
|
1330
|
+
var sparkFlashnetAddLiquidityIntentSchema = v29.object({
|
|
1331
|
+
type: v29.literal("addLiquidity"),
|
|
1332
|
+
data: v29.object({
|
|
1333
|
+
userPublicKey: v29.string(),
|
|
1334
|
+
poolId: v29.string(),
|
|
1335
|
+
assetAAmount: v29.string(),
|
|
1336
|
+
assetBAmount: v29.string(),
|
|
1337
|
+
assetAMinAmountIn: v29.string(),
|
|
1338
|
+
assetBMinAmountIn: v29.string(),
|
|
1339
|
+
assetATransferId: v29.string(),
|
|
1340
|
+
assetBTransferId: v29.string(),
|
|
1341
|
+
nonce: v29.string()
|
|
1287
1342
|
})
|
|
1288
1343
|
});
|
|
1289
1344
|
|
|
1290
1345
|
// src/request/types/sparkMethods/flashnetMethods/intents/clawback.ts
|
|
1291
|
-
var
|
|
1292
|
-
var sparkFlashnetClawbackIntentSchema =
|
|
1293
|
-
type:
|
|
1294
|
-
data:
|
|
1295
|
-
senderPublicKey:
|
|
1296
|
-
sparkTransferId:
|
|
1297
|
-
lpIdentityPublicKey:
|
|
1298
|
-
nonce:
|
|
1346
|
+
var v30 = __toESM(require("valibot"));
|
|
1347
|
+
var sparkFlashnetClawbackIntentSchema = v30.object({
|
|
1348
|
+
type: v30.literal("clawback"),
|
|
1349
|
+
data: v30.object({
|
|
1350
|
+
senderPublicKey: v30.string(),
|
|
1351
|
+
sparkTransferId: v30.string(),
|
|
1352
|
+
lpIdentityPublicKey: v30.string(),
|
|
1353
|
+
nonce: v30.string()
|
|
1299
1354
|
})
|
|
1300
1355
|
});
|
|
1301
1356
|
|
|
1302
1357
|
// src/request/types/sparkMethods/flashnetMethods/intents/confirmInitialDeposit.ts
|
|
1303
|
-
var
|
|
1304
|
-
var sparkFlashnetConfirmInitialDepositIntentSchema =
|
|
1305
|
-
type:
|
|
1306
|
-
data:
|
|
1307
|
-
poolId:
|
|
1308
|
-
assetASparkTransferId:
|
|
1309
|
-
poolOwnerPublicKey:
|
|
1310
|
-
nonce:
|
|
1358
|
+
var v31 = __toESM(require("valibot"));
|
|
1359
|
+
var sparkFlashnetConfirmInitialDepositIntentSchema = v31.object({
|
|
1360
|
+
type: v31.literal("confirmInitialDeposit"),
|
|
1361
|
+
data: v31.object({
|
|
1362
|
+
poolId: v31.string(),
|
|
1363
|
+
assetASparkTransferId: v31.string(),
|
|
1364
|
+
poolOwnerPublicKey: v31.string(),
|
|
1365
|
+
nonce: v31.string()
|
|
1311
1366
|
})
|
|
1312
1367
|
});
|
|
1313
1368
|
|
|
1314
1369
|
// src/request/types/sparkMethods/flashnetMethods/intents/createConstantProductPool.ts
|
|
1315
|
-
var
|
|
1316
|
-
var sparkFlashnetCreateConstantProductPoolIntentSchema =
|
|
1317
|
-
type:
|
|
1318
|
-
data:
|
|
1319
|
-
poolOwnerPublicKey:
|
|
1320
|
-
assetAAddress:
|
|
1321
|
-
assetBAddress:
|
|
1322
|
-
lpFeeRateBps:
|
|
1323
|
-
totalHostFeeRateBps:
|
|
1324
|
-
nonce:
|
|
1370
|
+
var v32 = __toESM(require("valibot"));
|
|
1371
|
+
var sparkFlashnetCreateConstantProductPoolIntentSchema = v32.object({
|
|
1372
|
+
type: v32.literal("createConstantProductPool"),
|
|
1373
|
+
data: v32.object({
|
|
1374
|
+
poolOwnerPublicKey: v32.string(),
|
|
1375
|
+
assetAAddress: v32.string(),
|
|
1376
|
+
assetBAddress: v32.string(),
|
|
1377
|
+
lpFeeRateBps: v32.union([v32.number(), v32.string()]),
|
|
1378
|
+
totalHostFeeRateBps: v32.union([v32.number(), v32.string()]),
|
|
1379
|
+
nonce: v32.string()
|
|
1325
1380
|
})
|
|
1326
1381
|
});
|
|
1327
1382
|
|
|
1328
1383
|
// src/request/types/sparkMethods/flashnetMethods/intents/createSingleSidedPool.ts
|
|
1329
|
-
var
|
|
1330
|
-
var sparkFlashnetCreateSingleSidedPoolIntentSchema =
|
|
1331
|
-
type:
|
|
1332
|
-
data:
|
|
1333
|
-
assetAAddress:
|
|
1334
|
-
assetBAddress:
|
|
1335
|
-
assetAInitialReserve:
|
|
1336
|
-
virtualReserveA:
|
|
1337
|
-
virtualReserveB:
|
|
1338
|
-
threshold:
|
|
1339
|
-
lpFeeRateBps:
|
|
1340
|
-
totalHostFeeRateBps:
|
|
1341
|
-
poolOwnerPublicKey:
|
|
1342
|
-
nonce:
|
|
1384
|
+
var v33 = __toESM(require("valibot"));
|
|
1385
|
+
var sparkFlashnetCreateSingleSidedPoolIntentSchema = v33.object({
|
|
1386
|
+
type: v33.literal("createSingleSidedPool"),
|
|
1387
|
+
data: v33.object({
|
|
1388
|
+
assetAAddress: v33.string(),
|
|
1389
|
+
assetBAddress: v33.string(),
|
|
1390
|
+
assetAInitialReserve: v33.string(),
|
|
1391
|
+
virtualReserveA: v33.union([v33.number(), v33.string()]),
|
|
1392
|
+
virtualReserveB: v33.union([v33.number(), v33.string()]),
|
|
1393
|
+
threshold: v33.union([v33.number(), v33.string()]),
|
|
1394
|
+
lpFeeRateBps: v33.union([v33.number(), v33.string()]),
|
|
1395
|
+
totalHostFeeRateBps: v33.union([v33.number(), v33.string()]),
|
|
1396
|
+
poolOwnerPublicKey: v33.string(),
|
|
1397
|
+
nonce: v33.string()
|
|
1343
1398
|
})
|
|
1344
1399
|
});
|
|
1345
1400
|
|
|
1346
1401
|
// src/request/types/sparkMethods/flashnetMethods/intents/removeLiquidity.ts
|
|
1347
|
-
var
|
|
1348
|
-
var sparkFlashnetRemoveLiquidityIntentSchema =
|
|
1349
|
-
type:
|
|
1350
|
-
data:
|
|
1351
|
-
userPublicKey:
|
|
1352
|
-
poolId:
|
|
1353
|
-
lpTokensToRemove:
|
|
1354
|
-
nonce:
|
|
1402
|
+
var v34 = __toESM(require("valibot"));
|
|
1403
|
+
var sparkFlashnetRemoveLiquidityIntentSchema = v34.object({
|
|
1404
|
+
type: v34.literal("removeLiquidity"),
|
|
1405
|
+
data: v34.object({
|
|
1406
|
+
userPublicKey: v34.string(),
|
|
1407
|
+
poolId: v34.string(),
|
|
1408
|
+
lpTokensToRemove: v34.string(),
|
|
1409
|
+
nonce: v34.string()
|
|
1355
1410
|
})
|
|
1356
1411
|
});
|
|
1357
1412
|
|
|
1358
1413
|
// src/request/types/sparkMethods/flashnetMethods/intents/routeSwap.ts
|
|
1359
|
-
var
|
|
1360
|
-
var sparkFlashnetRouteSwapIntentSchema =
|
|
1361
|
-
type:
|
|
1362
|
-
data:
|
|
1363
|
-
userPublicKey:
|
|
1364
|
-
initialSparkTransferId:
|
|
1365
|
-
hops:
|
|
1366
|
-
|
|
1367
|
-
poolId:
|
|
1368
|
-
inputAssetAddress:
|
|
1369
|
-
outputAssetAddress:
|
|
1370
|
-
hopIntegratorFeeRateBps:
|
|
1414
|
+
var v35 = __toESM(require("valibot"));
|
|
1415
|
+
var sparkFlashnetRouteSwapIntentSchema = v35.object({
|
|
1416
|
+
type: v35.literal("executeRouteSwap"),
|
|
1417
|
+
data: v35.object({
|
|
1418
|
+
userPublicKey: v35.string(),
|
|
1419
|
+
initialSparkTransferId: v35.string(),
|
|
1420
|
+
hops: v35.array(
|
|
1421
|
+
v35.object({
|
|
1422
|
+
poolId: v35.string(),
|
|
1423
|
+
inputAssetAddress: v35.string(),
|
|
1424
|
+
outputAssetAddress: v35.string(),
|
|
1425
|
+
hopIntegratorFeeRateBps: v35.optional(v35.union([v35.number(), v35.string()]))
|
|
1371
1426
|
})
|
|
1372
1427
|
),
|
|
1373
|
-
inputAmount:
|
|
1374
|
-
maxRouteSlippageBps:
|
|
1375
|
-
minAmountOut:
|
|
1376
|
-
defaultIntegratorFeeRateBps:
|
|
1377
|
-
nonce:
|
|
1428
|
+
inputAmount: v35.string(),
|
|
1429
|
+
maxRouteSlippageBps: v35.union([v35.number(), v35.string()]),
|
|
1430
|
+
minAmountOut: v35.string(),
|
|
1431
|
+
defaultIntegratorFeeRateBps: v35.optional(v35.union([v35.number(), v35.string()])),
|
|
1432
|
+
nonce: v35.string()
|
|
1378
1433
|
})
|
|
1379
1434
|
});
|
|
1380
1435
|
|
|
1381
1436
|
// src/request/types/sparkMethods/flashnetMethods/intents/swap.ts
|
|
1382
|
-
var
|
|
1383
|
-
var sparkFlashnetSwapIntentSchema =
|
|
1384
|
-
type:
|
|
1385
|
-
data:
|
|
1386
|
-
userPublicKey:
|
|
1387
|
-
poolId:
|
|
1388
|
-
transferId:
|
|
1389
|
-
assetInAddress:
|
|
1390
|
-
assetOutAddress:
|
|
1391
|
-
amountIn:
|
|
1392
|
-
maxSlippageBps:
|
|
1393
|
-
minAmountOut:
|
|
1394
|
-
totalIntegratorFeeRateBps:
|
|
1395
|
-
nonce:
|
|
1437
|
+
var v36 = __toESM(require("valibot"));
|
|
1438
|
+
var sparkFlashnetSwapIntentSchema = v36.object({
|
|
1439
|
+
type: v36.literal("executeSwap"),
|
|
1440
|
+
data: v36.object({
|
|
1441
|
+
userPublicKey: v36.string(),
|
|
1442
|
+
poolId: v36.string(),
|
|
1443
|
+
transferId: v36.string(),
|
|
1444
|
+
assetInAddress: v36.string(),
|
|
1445
|
+
assetOutAddress: v36.string(),
|
|
1446
|
+
amountIn: v36.string(),
|
|
1447
|
+
maxSlippageBps: v36.union([v36.number(), v36.string()]),
|
|
1448
|
+
minAmountOut: v36.string(),
|
|
1449
|
+
totalIntegratorFeeRateBps: v36.optional(v36.union([v36.number(), v36.string()])),
|
|
1450
|
+
nonce: v36.string()
|
|
1396
1451
|
})
|
|
1397
1452
|
});
|
|
1398
1453
|
|
|
1399
1454
|
// src/request/types/sparkMethods/flashnetMethods/signIntent.ts
|
|
1400
|
-
var
|
|
1455
|
+
var v37 = __toESM(require("valibot"));
|
|
1401
1456
|
var sparkFlashnetSignIntentMethodName = "spark_flashnet_signIntent";
|
|
1402
|
-
var sparkFlashnetSignIntentParamsSchema =
|
|
1457
|
+
var sparkFlashnetSignIntentParamsSchema = v37.union([
|
|
1403
1458
|
sparkFlashnetSwapIntentSchema,
|
|
1404
1459
|
sparkFlashnetRouteSwapIntentSchema,
|
|
1405
1460
|
sparkFlashnetAddLiquidityIntentSchema,
|
|
@@ -1409,109 +1464,109 @@ var sparkFlashnetSignIntentParamsSchema = v25.union([
|
|
|
1409
1464
|
sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
1410
1465
|
sparkFlashnetRemoveLiquidityIntentSchema
|
|
1411
1466
|
]);
|
|
1412
|
-
var sparkFlashnetSignIntentResultSchema =
|
|
1467
|
+
var sparkFlashnetSignIntentResultSchema = v37.object({
|
|
1413
1468
|
/**
|
|
1414
1469
|
* The signed intent as a hex string.
|
|
1415
1470
|
*/
|
|
1416
|
-
signature:
|
|
1471
|
+
signature: v37.string()
|
|
1417
1472
|
});
|
|
1418
|
-
var sparkFlashnetSignIntentRequestMessageSchema =
|
|
1473
|
+
var sparkFlashnetSignIntentRequestMessageSchema = v37.object({
|
|
1419
1474
|
...rpcRequestMessageSchema.entries,
|
|
1420
|
-
...
|
|
1421
|
-
method:
|
|
1475
|
+
...v37.object({
|
|
1476
|
+
method: v37.literal(sparkFlashnetSignIntentMethodName),
|
|
1422
1477
|
params: sparkFlashnetSignIntentParamsSchema,
|
|
1423
|
-
id:
|
|
1478
|
+
id: v37.string()
|
|
1424
1479
|
}).entries
|
|
1425
1480
|
});
|
|
1426
1481
|
|
|
1427
1482
|
// src/request/types/sparkMethods/flashnetMethods/signStructuredMessage.ts
|
|
1428
|
-
var
|
|
1483
|
+
var v38 = __toESM(require("valibot"));
|
|
1429
1484
|
var sparkFlashnetSignStructuredMessageMethodName = "spark_flashnet_signStructuredMessage";
|
|
1430
|
-
var sparkFlashnetSignStructuredMessageParamsSchema =
|
|
1431
|
-
message:
|
|
1485
|
+
var sparkFlashnetSignStructuredMessageParamsSchema = v38.object({
|
|
1486
|
+
message: v38.string()
|
|
1432
1487
|
});
|
|
1433
|
-
var sparkFlashnetSignStructuredMessageResultSchema =
|
|
1434
|
-
message:
|
|
1435
|
-
signature:
|
|
1488
|
+
var sparkFlashnetSignStructuredMessageResultSchema = v38.object({
|
|
1489
|
+
message: v38.string(),
|
|
1490
|
+
signature: v38.string()
|
|
1436
1491
|
});
|
|
1437
|
-
var sparkFlashnetSignStructuredMessageRequestMessageSchema =
|
|
1492
|
+
var sparkFlashnetSignStructuredMessageRequestMessageSchema = v38.object({
|
|
1438
1493
|
...rpcRequestMessageSchema.entries,
|
|
1439
|
-
...
|
|
1440
|
-
method:
|
|
1494
|
+
...v38.object({
|
|
1495
|
+
method: v38.literal(sparkFlashnetSignStructuredMessageMethodName),
|
|
1441
1496
|
params: sparkFlashnetSignStructuredMessageParamsSchema,
|
|
1442
|
-
id:
|
|
1497
|
+
id: v38.string()
|
|
1443
1498
|
}).entries
|
|
1444
1499
|
});
|
|
1445
1500
|
|
|
1446
1501
|
// src/request/types/sparkMethods/getAddresses.ts
|
|
1447
|
-
var
|
|
1502
|
+
var v39 = __toESM(require("valibot"));
|
|
1448
1503
|
var sparkGetAddressesMethodName = "spark_getAddresses";
|
|
1449
|
-
var sparkGetAddressesParamsSchema =
|
|
1450
|
-
|
|
1504
|
+
var sparkGetAddressesParamsSchema = v39.nullish(
|
|
1505
|
+
v39.object({
|
|
1451
1506
|
/**
|
|
1452
1507
|
* A message to be displayed to the user in the request prompt.
|
|
1453
1508
|
*/
|
|
1454
|
-
message:
|
|
1509
|
+
message: v39.optional(v39.string())
|
|
1455
1510
|
})
|
|
1456
1511
|
);
|
|
1457
|
-
var sparkGetAddressesResultSchema =
|
|
1512
|
+
var sparkGetAddressesResultSchema = v39.object({
|
|
1458
1513
|
/**
|
|
1459
1514
|
* The addresses generated for the given purposes.
|
|
1460
1515
|
*/
|
|
1461
|
-
addresses:
|
|
1516
|
+
addresses: v39.array(addressSchema),
|
|
1462
1517
|
network: getNetworkResultSchema
|
|
1463
1518
|
});
|
|
1464
|
-
var sparkGetAddressesRequestMessageSchema =
|
|
1519
|
+
var sparkGetAddressesRequestMessageSchema = v39.object({
|
|
1465
1520
|
...rpcRequestMessageSchema.entries,
|
|
1466
|
-
...
|
|
1467
|
-
method:
|
|
1521
|
+
...v39.object({
|
|
1522
|
+
method: v39.literal(sparkGetAddressesMethodName),
|
|
1468
1523
|
params: sparkGetAddressesParamsSchema,
|
|
1469
|
-
id:
|
|
1524
|
+
id: v39.string()
|
|
1470
1525
|
}).entries
|
|
1471
1526
|
});
|
|
1472
1527
|
|
|
1473
1528
|
// src/request/types/sparkMethods/getBalance.ts
|
|
1474
|
-
var
|
|
1529
|
+
var v40 = __toESM(require("valibot"));
|
|
1475
1530
|
var sparkGetBalanceMethodName = "spark_getBalance";
|
|
1476
|
-
var sparkGetBalanceParamsSchema =
|
|
1477
|
-
var sparkGetBalanceResultSchema =
|
|
1531
|
+
var sparkGetBalanceParamsSchema = v40.nullish(v40.null());
|
|
1532
|
+
var sparkGetBalanceResultSchema = v40.object({
|
|
1478
1533
|
/**
|
|
1479
1534
|
* The Spark Bitcoin address balance in sats in string form.
|
|
1480
1535
|
*/
|
|
1481
|
-
balance:
|
|
1482
|
-
tokenBalances:
|
|
1483
|
-
|
|
1536
|
+
balance: v40.string(),
|
|
1537
|
+
tokenBalances: v40.array(
|
|
1538
|
+
v40.object({
|
|
1484
1539
|
/* The address balance of the token in string form as it can overflow a js number */
|
|
1485
|
-
balance:
|
|
1486
|
-
tokenMetadata:
|
|
1487
|
-
tokenIdentifier:
|
|
1488
|
-
tokenName:
|
|
1489
|
-
tokenTicker:
|
|
1490
|
-
decimals:
|
|
1491
|
-
maxSupply:
|
|
1540
|
+
balance: v40.string(),
|
|
1541
|
+
tokenMetadata: v40.object({
|
|
1542
|
+
tokenIdentifier: v40.string(),
|
|
1543
|
+
tokenName: v40.string(),
|
|
1544
|
+
tokenTicker: v40.string(),
|
|
1545
|
+
decimals: v40.number(),
|
|
1546
|
+
maxSupply: v40.string()
|
|
1492
1547
|
})
|
|
1493
1548
|
})
|
|
1494
1549
|
)
|
|
1495
1550
|
});
|
|
1496
|
-
var sparkGetBalanceRequestMessageSchema =
|
|
1551
|
+
var sparkGetBalanceRequestMessageSchema = v40.object({
|
|
1497
1552
|
...rpcRequestMessageSchema.entries,
|
|
1498
|
-
...
|
|
1499
|
-
method:
|
|
1553
|
+
...v40.object({
|
|
1554
|
+
method: v40.literal(sparkGetBalanceMethodName),
|
|
1500
1555
|
params: sparkGetBalanceParamsSchema,
|
|
1501
|
-
id:
|
|
1556
|
+
id: v40.string()
|
|
1502
1557
|
}).entries
|
|
1503
1558
|
});
|
|
1504
1559
|
|
|
1505
1560
|
// src/request/types/sparkMethods/signMessage.ts
|
|
1506
|
-
var
|
|
1561
|
+
var v41 = __toESM(require("valibot"));
|
|
1507
1562
|
var sparkSignMessageMethodName = "spark_signMessage";
|
|
1508
|
-
var sparkSignMessageParamsSchema =
|
|
1563
|
+
var sparkSignMessageParamsSchema = v41.object({
|
|
1509
1564
|
/**
|
|
1510
1565
|
* The message to sign. The message should only consist of valid UTF-8 characters.
|
|
1511
1566
|
*/
|
|
1512
|
-
message:
|
|
1567
|
+
message: v41.string()
|
|
1513
1568
|
});
|
|
1514
|
-
var sparkSignMessageResultSchema =
|
|
1569
|
+
var sparkSignMessageResultSchema = v41.object({
|
|
1515
1570
|
/**
|
|
1516
1571
|
* The signature, encoded in base64, of the message hash.
|
|
1517
1572
|
*
|
|
@@ -1519,98 +1574,98 @@ var sparkSignMessageResultSchema = v29.object({
|
|
|
1519
1574
|
* and the resulting byte array is hashed with SHA256 before signing
|
|
1520
1575
|
* with the private key.
|
|
1521
1576
|
*/
|
|
1522
|
-
signature:
|
|
1577
|
+
signature: v41.string()
|
|
1523
1578
|
});
|
|
1524
|
-
var sparkSignMessageRequestMessageSchema =
|
|
1579
|
+
var sparkSignMessageRequestMessageSchema = v41.object({
|
|
1525
1580
|
...rpcRequestMessageSchema.entries,
|
|
1526
|
-
...
|
|
1527
|
-
method:
|
|
1581
|
+
...v41.object({
|
|
1582
|
+
method: v41.literal(sparkSignMessageMethodName),
|
|
1528
1583
|
params: sparkSignMessageParamsSchema,
|
|
1529
|
-
id:
|
|
1584
|
+
id: v41.string()
|
|
1530
1585
|
}).entries
|
|
1531
1586
|
});
|
|
1532
1587
|
|
|
1533
1588
|
// src/request/types/sparkMethods/transfer.ts
|
|
1534
|
-
var
|
|
1589
|
+
var v42 = __toESM(require("valibot"));
|
|
1535
1590
|
var sparkTransferMethodName = "spark_transfer";
|
|
1536
|
-
var sparkTransferParamsSchema =
|
|
1591
|
+
var sparkTransferParamsSchema = v42.object({
|
|
1537
1592
|
/**
|
|
1538
1593
|
* Amount of SATS to transfer as a string or number.
|
|
1539
1594
|
*/
|
|
1540
|
-
amountSats:
|
|
1595
|
+
amountSats: v42.union([v42.number(), v42.string()]),
|
|
1541
1596
|
/**
|
|
1542
1597
|
* The recipient's spark address.
|
|
1543
1598
|
*/
|
|
1544
|
-
receiverSparkAddress:
|
|
1599
|
+
receiverSparkAddress: v42.string()
|
|
1545
1600
|
});
|
|
1546
|
-
var sparkTransferResultSchema =
|
|
1601
|
+
var sparkTransferResultSchema = v42.object({
|
|
1547
1602
|
/**
|
|
1548
1603
|
* The ID of the transaction.
|
|
1549
1604
|
*/
|
|
1550
|
-
id:
|
|
1605
|
+
id: v42.string()
|
|
1551
1606
|
});
|
|
1552
|
-
var sparkTransferRequestMessageSchema =
|
|
1607
|
+
var sparkTransferRequestMessageSchema = v42.object({
|
|
1553
1608
|
...rpcRequestMessageSchema.entries,
|
|
1554
|
-
...
|
|
1555
|
-
method:
|
|
1609
|
+
...v42.object({
|
|
1610
|
+
method: v42.literal(sparkTransferMethodName),
|
|
1556
1611
|
params: sparkTransferParamsSchema,
|
|
1557
|
-
id:
|
|
1612
|
+
id: v42.string()
|
|
1558
1613
|
}).entries
|
|
1559
1614
|
});
|
|
1560
1615
|
|
|
1561
1616
|
// src/request/types/sparkMethods/transferToken.ts
|
|
1562
|
-
var
|
|
1617
|
+
var v43 = __toESM(require("valibot"));
|
|
1563
1618
|
var sparkTransferTokenMethodName = "spark_transferToken";
|
|
1564
|
-
var sparkTransferTokenParamsSchema =
|
|
1619
|
+
var sparkTransferTokenParamsSchema = v43.object({
|
|
1565
1620
|
/**
|
|
1566
1621
|
* Amount of units of the token to transfer as a string or number.
|
|
1567
1622
|
*/
|
|
1568
|
-
tokenAmount:
|
|
1623
|
+
tokenAmount: v43.union([v43.number(), v43.string()]),
|
|
1569
1624
|
/**
|
|
1570
1625
|
* The Bech32m token identifier.
|
|
1571
1626
|
*/
|
|
1572
|
-
tokenIdentifier:
|
|
1627
|
+
tokenIdentifier: v43.string(),
|
|
1573
1628
|
/**
|
|
1574
1629
|
* The recipient's spark address.
|
|
1575
1630
|
*/
|
|
1576
|
-
receiverSparkAddress:
|
|
1631
|
+
receiverSparkAddress: v43.string()
|
|
1577
1632
|
});
|
|
1578
|
-
var sparkTransferTokenResultSchema =
|
|
1633
|
+
var sparkTransferTokenResultSchema = v43.object({
|
|
1579
1634
|
/**
|
|
1580
1635
|
* The ID of the transaction.
|
|
1581
1636
|
*/
|
|
1582
|
-
id:
|
|
1637
|
+
id: v43.string()
|
|
1583
1638
|
});
|
|
1584
|
-
var sparkTransferTokenRequestMessageSchema =
|
|
1639
|
+
var sparkTransferTokenRequestMessageSchema = v43.object({
|
|
1585
1640
|
...rpcRequestMessageSchema.entries,
|
|
1586
|
-
...
|
|
1587
|
-
method:
|
|
1641
|
+
...v43.object({
|
|
1642
|
+
method: v43.literal(sparkTransferTokenMethodName),
|
|
1588
1643
|
params: sparkTransferTokenParamsSchema,
|
|
1589
|
-
id:
|
|
1644
|
+
id: v43.string()
|
|
1590
1645
|
}).entries
|
|
1591
1646
|
});
|
|
1592
1647
|
|
|
1593
1648
|
// src/request/types/stxMethods/callContract.ts
|
|
1594
|
-
var
|
|
1649
|
+
var v44 = __toESM(require("valibot"));
|
|
1595
1650
|
var stxCallContractMethodName = "stx_callContract";
|
|
1596
|
-
var stxCallContractParamsSchema =
|
|
1651
|
+
var stxCallContractParamsSchema = v44.object({
|
|
1597
1652
|
/**
|
|
1598
1653
|
* The contract principal.
|
|
1599
1654
|
*
|
|
1600
1655
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
1601
1656
|
*/
|
|
1602
|
-
contract:
|
|
1657
|
+
contract: v44.string(),
|
|
1603
1658
|
/**
|
|
1604
1659
|
* The name of the function to call.
|
|
1605
1660
|
*
|
|
1606
1661
|
* Note: spec changes ongoing,
|
|
1607
1662
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1608
1663
|
*/
|
|
1609
|
-
functionName:
|
|
1664
|
+
functionName: v44.string(),
|
|
1610
1665
|
/**
|
|
1611
1666
|
* @deprecated in favor of `functionArgs` for @stacks/connect compatibility
|
|
1612
1667
|
*/
|
|
1613
|
-
arguments:
|
|
1668
|
+
arguments: v44.optional(v44.array(v44.string())),
|
|
1614
1669
|
/**
|
|
1615
1670
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1616
1671
|
* strings of Clarity values.
|
|
@@ -1625,274 +1680,274 @@ var stxCallContractParamsSchema = v32.object({
|
|
|
1625
1680
|
* const hexArgs = functionArgs.map(cvToHex);
|
|
1626
1681
|
* ```
|
|
1627
1682
|
*/
|
|
1628
|
-
functionArgs:
|
|
1683
|
+
functionArgs: v44.optional(v44.array(v44.string())),
|
|
1629
1684
|
/**
|
|
1630
1685
|
* The post conditions to apply to the contract call.
|
|
1631
1686
|
*/
|
|
1632
|
-
postConditions:
|
|
1687
|
+
postConditions: v44.optional(v44.array(v44.string())),
|
|
1633
1688
|
/**
|
|
1634
1689
|
* The mode to apply to the post conditions.
|
|
1635
1690
|
*/
|
|
1636
|
-
postConditionMode:
|
|
1691
|
+
postConditionMode: v44.optional(v44.union([v44.literal("allow"), v44.literal("deny")]))
|
|
1637
1692
|
});
|
|
1638
|
-
var stxCallContractResultSchema =
|
|
1693
|
+
var stxCallContractResultSchema = v44.object({
|
|
1639
1694
|
/**
|
|
1640
1695
|
* The ID of the transaction.
|
|
1641
1696
|
*/
|
|
1642
|
-
txid:
|
|
1697
|
+
txid: v44.string(),
|
|
1643
1698
|
/**
|
|
1644
1699
|
* A Stacks transaction as a hex-encoded string.
|
|
1645
1700
|
*/
|
|
1646
|
-
transaction:
|
|
1701
|
+
transaction: v44.string()
|
|
1647
1702
|
});
|
|
1648
|
-
var stxCallContractRequestMessageSchema =
|
|
1703
|
+
var stxCallContractRequestMessageSchema = v44.object({
|
|
1649
1704
|
...rpcRequestMessageSchema.entries,
|
|
1650
|
-
...
|
|
1651
|
-
method:
|
|
1705
|
+
...v44.object({
|
|
1706
|
+
method: v44.literal(stxCallContractMethodName),
|
|
1652
1707
|
params: stxCallContractParamsSchema,
|
|
1653
|
-
id:
|
|
1708
|
+
id: v44.string()
|
|
1654
1709
|
}).entries
|
|
1655
1710
|
});
|
|
1656
1711
|
|
|
1657
1712
|
// src/request/types/stxMethods/deployContract.ts
|
|
1658
|
-
var
|
|
1713
|
+
var v45 = __toESM(require("valibot"));
|
|
1659
1714
|
var stxDeployContractMethodName = "stx_deployContract";
|
|
1660
|
-
var stxDeployContractParamsSchema =
|
|
1715
|
+
var stxDeployContractParamsSchema = v45.object({
|
|
1661
1716
|
/**
|
|
1662
1717
|
* Name of the contract.
|
|
1663
1718
|
*/
|
|
1664
|
-
name:
|
|
1719
|
+
name: v45.string(),
|
|
1665
1720
|
/**
|
|
1666
1721
|
* The source code of the Clarity contract.
|
|
1667
1722
|
*/
|
|
1668
|
-
clarityCode:
|
|
1723
|
+
clarityCode: v45.string(),
|
|
1669
1724
|
/**
|
|
1670
1725
|
* The version of the Clarity contract.
|
|
1671
1726
|
*/
|
|
1672
|
-
clarityVersion:
|
|
1727
|
+
clarityVersion: v45.optional(v45.number()),
|
|
1673
1728
|
/**
|
|
1674
1729
|
* The post conditions to apply to the contract call.
|
|
1675
1730
|
*/
|
|
1676
|
-
postConditions:
|
|
1731
|
+
postConditions: v45.optional(v45.array(v45.string())),
|
|
1677
1732
|
/**
|
|
1678
1733
|
* The mode to apply to the post conditions.
|
|
1679
1734
|
*/
|
|
1680
|
-
postConditionMode:
|
|
1735
|
+
postConditionMode: v45.optional(v45.union([v45.literal("allow"), v45.literal("deny")]))
|
|
1681
1736
|
});
|
|
1682
|
-
var stxDeployContractResultSchema =
|
|
1737
|
+
var stxDeployContractResultSchema = v45.object({
|
|
1683
1738
|
/**
|
|
1684
1739
|
* The ID of the transaction.
|
|
1685
1740
|
*/
|
|
1686
|
-
txid:
|
|
1741
|
+
txid: v45.string(),
|
|
1687
1742
|
/**
|
|
1688
1743
|
* A Stacks transaction as a hex-encoded string.
|
|
1689
1744
|
*/
|
|
1690
|
-
transaction:
|
|
1745
|
+
transaction: v45.string()
|
|
1691
1746
|
});
|
|
1692
|
-
var stxDeployContractRequestMessageSchema =
|
|
1747
|
+
var stxDeployContractRequestMessageSchema = v45.object({
|
|
1693
1748
|
...rpcRequestMessageSchema.entries,
|
|
1694
|
-
...
|
|
1695
|
-
method:
|
|
1749
|
+
...v45.object({
|
|
1750
|
+
method: v45.literal(stxDeployContractMethodName),
|
|
1696
1751
|
params: stxDeployContractParamsSchema,
|
|
1697
|
-
id:
|
|
1752
|
+
id: v45.string()
|
|
1698
1753
|
}).entries
|
|
1699
1754
|
});
|
|
1700
1755
|
|
|
1701
1756
|
// src/request/types/stxMethods/getAccounts.ts
|
|
1702
|
-
var
|
|
1757
|
+
var v46 = __toESM(require("valibot"));
|
|
1703
1758
|
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
1704
|
-
var stxGetAccountsParamsSchema =
|
|
1705
|
-
var stxGetAccountsResultSchema =
|
|
1759
|
+
var stxGetAccountsParamsSchema = v46.nullish(v46.null());
|
|
1760
|
+
var stxGetAccountsResultSchema = v46.object({
|
|
1706
1761
|
/**
|
|
1707
1762
|
* The addresses generated for the given purposes.
|
|
1708
1763
|
*/
|
|
1709
|
-
addresses:
|
|
1710
|
-
|
|
1711
|
-
address:
|
|
1712
|
-
publicKey:
|
|
1713
|
-
gaiaHubUrl:
|
|
1714
|
-
gaiaAppKey:
|
|
1764
|
+
addresses: v46.array(
|
|
1765
|
+
v46.object({
|
|
1766
|
+
address: v46.string(),
|
|
1767
|
+
publicKey: v46.string(),
|
|
1768
|
+
gaiaHubUrl: v46.string(),
|
|
1769
|
+
gaiaAppKey: v46.string()
|
|
1715
1770
|
})
|
|
1716
1771
|
),
|
|
1717
1772
|
network: getNetworkResultSchema
|
|
1718
1773
|
});
|
|
1719
|
-
var stxGetAccountsRequestMessageSchema =
|
|
1774
|
+
var stxGetAccountsRequestMessageSchema = v46.object({
|
|
1720
1775
|
...rpcRequestMessageSchema.entries,
|
|
1721
|
-
...
|
|
1722
|
-
method:
|
|
1776
|
+
...v46.object({
|
|
1777
|
+
method: v46.literal(stxGetAccountsMethodName),
|
|
1723
1778
|
params: stxGetAccountsParamsSchema,
|
|
1724
|
-
id:
|
|
1779
|
+
id: v46.string()
|
|
1725
1780
|
}).entries
|
|
1726
1781
|
});
|
|
1727
1782
|
|
|
1728
1783
|
// src/request/types/stxMethods/getAddresses.ts
|
|
1729
|
-
var
|
|
1784
|
+
var v47 = __toESM(require("valibot"));
|
|
1730
1785
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
1731
|
-
var stxGetAddressesParamsSchema =
|
|
1732
|
-
|
|
1786
|
+
var stxGetAddressesParamsSchema = v47.nullish(
|
|
1787
|
+
v47.object({
|
|
1733
1788
|
/**
|
|
1734
1789
|
* A message to be displayed to the user in the request prompt.
|
|
1735
1790
|
*/
|
|
1736
|
-
message:
|
|
1791
|
+
message: v47.optional(v47.string())
|
|
1737
1792
|
})
|
|
1738
1793
|
);
|
|
1739
|
-
var stxGetAddressesResultSchema =
|
|
1794
|
+
var stxGetAddressesResultSchema = v47.object({
|
|
1740
1795
|
/**
|
|
1741
1796
|
* The addresses generated for the given purposes.
|
|
1742
1797
|
*/
|
|
1743
|
-
addresses:
|
|
1798
|
+
addresses: v47.array(addressSchema),
|
|
1744
1799
|
network: getNetworkResultSchema
|
|
1745
1800
|
});
|
|
1746
|
-
var stxGetAddressesRequestMessageSchema =
|
|
1801
|
+
var stxGetAddressesRequestMessageSchema = v47.object({
|
|
1747
1802
|
...rpcRequestMessageSchema.entries,
|
|
1748
|
-
...
|
|
1749
|
-
method:
|
|
1803
|
+
...v47.object({
|
|
1804
|
+
method: v47.literal(stxGetAddressesMethodName),
|
|
1750
1805
|
params: stxGetAddressesParamsSchema,
|
|
1751
|
-
id:
|
|
1806
|
+
id: v47.string()
|
|
1752
1807
|
}).entries
|
|
1753
1808
|
});
|
|
1754
1809
|
|
|
1755
1810
|
// src/request/types/stxMethods/signMessage.ts
|
|
1756
|
-
var
|
|
1811
|
+
var v48 = __toESM(require("valibot"));
|
|
1757
1812
|
var stxSignMessageMethodName = "stx_signMessage";
|
|
1758
|
-
var stxSignMessageParamsSchema =
|
|
1813
|
+
var stxSignMessageParamsSchema = v48.object({
|
|
1759
1814
|
/**
|
|
1760
1815
|
* The message to sign.
|
|
1761
1816
|
*/
|
|
1762
|
-
message:
|
|
1817
|
+
message: v48.string()
|
|
1763
1818
|
});
|
|
1764
|
-
var stxSignMessageResultSchema =
|
|
1819
|
+
var stxSignMessageResultSchema = v48.object({
|
|
1765
1820
|
/**
|
|
1766
1821
|
* The signature of the message.
|
|
1767
1822
|
*/
|
|
1768
|
-
signature:
|
|
1823
|
+
signature: v48.string(),
|
|
1769
1824
|
/**
|
|
1770
1825
|
* The public key used to sign the message.
|
|
1771
1826
|
*/
|
|
1772
|
-
publicKey:
|
|
1827
|
+
publicKey: v48.string()
|
|
1773
1828
|
});
|
|
1774
|
-
var stxSignMessageRequestMessageSchema =
|
|
1829
|
+
var stxSignMessageRequestMessageSchema = v48.object({
|
|
1775
1830
|
...rpcRequestMessageSchema.entries,
|
|
1776
|
-
...
|
|
1777
|
-
method:
|
|
1831
|
+
...v48.object({
|
|
1832
|
+
method: v48.literal(stxSignMessageMethodName),
|
|
1778
1833
|
params: stxSignMessageParamsSchema,
|
|
1779
|
-
id:
|
|
1834
|
+
id: v48.string()
|
|
1780
1835
|
}).entries
|
|
1781
1836
|
});
|
|
1782
1837
|
|
|
1783
1838
|
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
1784
|
-
var
|
|
1839
|
+
var v49 = __toESM(require("valibot"));
|
|
1785
1840
|
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
1786
|
-
var stxSignStructuredMessageParamsSchema =
|
|
1841
|
+
var stxSignStructuredMessageParamsSchema = v49.object({
|
|
1787
1842
|
/**
|
|
1788
1843
|
* The domain to be signed.
|
|
1789
1844
|
*/
|
|
1790
|
-
domain:
|
|
1845
|
+
domain: v49.string(),
|
|
1791
1846
|
/**
|
|
1792
1847
|
* Message payload to be signed.
|
|
1793
1848
|
*/
|
|
1794
|
-
message:
|
|
1849
|
+
message: v49.string(),
|
|
1795
1850
|
/**
|
|
1796
1851
|
* The public key to sign the message with.
|
|
1797
1852
|
*/
|
|
1798
|
-
publicKey:
|
|
1853
|
+
publicKey: v49.optional(v49.string())
|
|
1799
1854
|
});
|
|
1800
|
-
var stxSignStructuredMessageResultSchema =
|
|
1855
|
+
var stxSignStructuredMessageResultSchema = v49.object({
|
|
1801
1856
|
/**
|
|
1802
1857
|
* Signature of the message.
|
|
1803
1858
|
*/
|
|
1804
|
-
signature:
|
|
1859
|
+
signature: v49.string(),
|
|
1805
1860
|
/**
|
|
1806
1861
|
* Public key as hex-encoded string.
|
|
1807
1862
|
*/
|
|
1808
|
-
publicKey:
|
|
1863
|
+
publicKey: v49.string()
|
|
1809
1864
|
});
|
|
1810
|
-
var stxSignStructuredMessageRequestMessageSchema =
|
|
1865
|
+
var stxSignStructuredMessageRequestMessageSchema = v49.object({
|
|
1811
1866
|
...rpcRequestMessageSchema.entries,
|
|
1812
|
-
...
|
|
1813
|
-
method:
|
|
1867
|
+
...v49.object({
|
|
1868
|
+
method: v49.literal(stxSignStructuredMessageMethodName),
|
|
1814
1869
|
params: stxSignStructuredMessageParamsSchema,
|
|
1815
|
-
id:
|
|
1870
|
+
id: v49.string()
|
|
1816
1871
|
}).entries
|
|
1817
1872
|
});
|
|
1818
1873
|
|
|
1819
1874
|
// src/request/types/stxMethods/signTransaction.ts
|
|
1820
|
-
var
|
|
1875
|
+
var v50 = __toESM(require("valibot"));
|
|
1821
1876
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
1822
|
-
var stxSignTransactionParamsSchema =
|
|
1877
|
+
var stxSignTransactionParamsSchema = v50.object({
|
|
1823
1878
|
/**
|
|
1824
1879
|
* The transaction to sign as a hex-encoded string.
|
|
1825
1880
|
*/
|
|
1826
|
-
transaction:
|
|
1881
|
+
transaction: v50.string(),
|
|
1827
1882
|
/**
|
|
1828
1883
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1829
1884
|
* when not provided.
|
|
1830
1885
|
*/
|
|
1831
|
-
pubkey:
|
|
1886
|
+
pubkey: v50.optional(v50.string()),
|
|
1832
1887
|
/**
|
|
1833
1888
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
1834
1889
|
*/
|
|
1835
|
-
broadcast:
|
|
1890
|
+
broadcast: v50.optional(v50.boolean())
|
|
1836
1891
|
});
|
|
1837
|
-
var stxSignTransactionResultSchema =
|
|
1892
|
+
var stxSignTransactionResultSchema = v50.object({
|
|
1838
1893
|
/**
|
|
1839
1894
|
* The signed transaction as a hex-encoded string.
|
|
1840
1895
|
*/
|
|
1841
|
-
transaction:
|
|
1896
|
+
transaction: v50.string()
|
|
1842
1897
|
});
|
|
1843
|
-
var stxSignTransactionRequestMessageSchema =
|
|
1898
|
+
var stxSignTransactionRequestMessageSchema = v50.object({
|
|
1844
1899
|
...rpcRequestMessageSchema.entries,
|
|
1845
|
-
...
|
|
1846
|
-
method:
|
|
1900
|
+
...v50.object({
|
|
1901
|
+
method: v50.literal(stxSignTransactionMethodName),
|
|
1847
1902
|
params: stxSignTransactionParamsSchema,
|
|
1848
|
-
id:
|
|
1903
|
+
id: v50.string()
|
|
1849
1904
|
}).entries
|
|
1850
1905
|
});
|
|
1851
1906
|
|
|
1852
1907
|
// src/request/types/stxMethods/signTransactions.ts
|
|
1853
|
-
var
|
|
1908
|
+
var v51 = __toESM(require("valibot"));
|
|
1854
1909
|
var stxSignTransactionsMethodName = "stx_signTransactions";
|
|
1855
|
-
var stxSignTransactionsParamsSchema =
|
|
1910
|
+
var stxSignTransactionsParamsSchema = v51.object({
|
|
1856
1911
|
/**
|
|
1857
1912
|
* The transactions to sign as hex-encoded strings.
|
|
1858
1913
|
*/
|
|
1859
|
-
transactions:
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1914
|
+
transactions: v51.pipe(
|
|
1915
|
+
v51.array(
|
|
1916
|
+
v51.pipe(
|
|
1917
|
+
v51.string(),
|
|
1918
|
+
v51.check((hex) => {
|
|
1864
1919
|
return true;
|
|
1865
1920
|
}, "Invalid hex-encoded Stacks transaction.")
|
|
1866
1921
|
)
|
|
1867
1922
|
),
|
|
1868
|
-
|
|
1923
|
+
v51.minLength(1)
|
|
1869
1924
|
),
|
|
1870
1925
|
/**
|
|
1871
1926
|
* Whether the signed transactions should be broadcast after signing. Defaults
|
|
1872
1927
|
* to `true`.
|
|
1873
1928
|
*/
|
|
1874
|
-
broadcast:
|
|
1929
|
+
broadcast: v51.optional(v51.boolean())
|
|
1875
1930
|
});
|
|
1876
|
-
var stxSignTransactionsResultSchema =
|
|
1931
|
+
var stxSignTransactionsResultSchema = v51.object({
|
|
1877
1932
|
/**
|
|
1878
1933
|
* The signed transactions as hex-encoded strings, in the same order as in the
|
|
1879
1934
|
* sign request.
|
|
1880
1935
|
*/
|
|
1881
|
-
transactions:
|
|
1936
|
+
transactions: v51.array(v51.string())
|
|
1882
1937
|
});
|
|
1883
|
-
var stxSignTransactionsRequestMessageSchema =
|
|
1938
|
+
var stxSignTransactionsRequestMessageSchema = v51.object({
|
|
1884
1939
|
...rpcRequestMessageSchema.entries,
|
|
1885
|
-
...
|
|
1886
|
-
method:
|
|
1940
|
+
...v51.object({
|
|
1941
|
+
method: v51.literal(stxSignTransactionsMethodName),
|
|
1887
1942
|
params: stxSignTransactionsParamsSchema,
|
|
1888
|
-
id:
|
|
1943
|
+
id: v51.string()
|
|
1889
1944
|
}).entries
|
|
1890
1945
|
});
|
|
1891
1946
|
|
|
1892
1947
|
// src/request/types/stxMethods/transferStx.ts
|
|
1893
|
-
var
|
|
1948
|
+
var v52 = __toESM(require("valibot"));
|
|
1894
1949
|
var stxTransferStxMethodName = "stx_transferStx";
|
|
1895
|
-
var stxTransferStxParamsSchema =
|
|
1950
|
+
var stxTransferStxParamsSchema = v52.object({
|
|
1896
1951
|
/**
|
|
1897
1952
|
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
1898
1953
|
* parseable by `BigInt` is acceptable.
|
|
@@ -1905,23 +1960,23 @@ var stxTransferStxParamsSchema = v40.object({
|
|
|
1905
1960
|
* const amount3 = '1234';
|
|
1906
1961
|
* ```
|
|
1907
1962
|
*/
|
|
1908
|
-
amount:
|
|
1963
|
+
amount: v52.union([v52.number(), v52.string()]),
|
|
1909
1964
|
/**
|
|
1910
1965
|
* The recipient's principal.
|
|
1911
1966
|
*/
|
|
1912
|
-
recipient:
|
|
1967
|
+
recipient: v52.string(),
|
|
1913
1968
|
/**
|
|
1914
1969
|
* A string representing the memo.
|
|
1915
1970
|
*/
|
|
1916
|
-
memo:
|
|
1971
|
+
memo: v52.optional(v52.string()),
|
|
1917
1972
|
/**
|
|
1918
1973
|
* Version of parameter format.
|
|
1919
1974
|
*/
|
|
1920
|
-
version:
|
|
1975
|
+
version: v52.optional(v52.string()),
|
|
1921
1976
|
/**
|
|
1922
1977
|
* The mode of the post conditions.
|
|
1923
1978
|
*/
|
|
1924
|
-
postConditionMode:
|
|
1979
|
+
postConditionMode: v52.optional(v52.number()),
|
|
1925
1980
|
/**
|
|
1926
1981
|
* A hex-encoded string representing the post conditions.
|
|
1927
1982
|
*
|
|
@@ -1934,29 +1989,29 @@ var stxTransferStxParamsSchema = v40.object({
|
|
|
1934
1989
|
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
1935
1990
|
* ```
|
|
1936
1991
|
*/
|
|
1937
|
-
postConditions:
|
|
1992
|
+
postConditions: v52.optional(v52.array(v52.string())),
|
|
1938
1993
|
/**
|
|
1939
1994
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1940
1995
|
* when not provided.
|
|
1941
1996
|
*/
|
|
1942
|
-
pubkey:
|
|
1997
|
+
pubkey: v52.optional(v52.string())
|
|
1943
1998
|
});
|
|
1944
|
-
var stxTransferStxResultSchema =
|
|
1999
|
+
var stxTransferStxResultSchema = v52.object({
|
|
1945
2000
|
/**
|
|
1946
2001
|
* The ID of the transaction.
|
|
1947
2002
|
*/
|
|
1948
|
-
txid:
|
|
2003
|
+
txid: v52.string(),
|
|
1949
2004
|
/**
|
|
1950
2005
|
* A Stacks transaction as a hex-encoded string.
|
|
1951
2006
|
*/
|
|
1952
|
-
transaction:
|
|
2007
|
+
transaction: v52.string()
|
|
1953
2008
|
});
|
|
1954
|
-
var stxTransferStxRequestMessageSchema =
|
|
2009
|
+
var stxTransferStxRequestMessageSchema = v52.object({
|
|
1955
2010
|
...rpcRequestMessageSchema.entries,
|
|
1956
|
-
...
|
|
1957
|
-
method:
|
|
2011
|
+
...v52.object({
|
|
2012
|
+
method: v52.literal(stxTransferStxMethodName),
|
|
1958
2013
|
params: stxTransferStxParamsSchema,
|
|
1959
|
-
id:
|
|
2014
|
+
id: v52.string()
|
|
1960
2015
|
}).entries
|
|
1961
2016
|
});
|
|
1962
2017
|
|
|
@@ -1964,13 +2019,13 @@ var stxTransferStxRequestMessageSchema = v40.object({
|
|
|
1964
2019
|
var cache = {};
|
|
1965
2020
|
var requestInternal = async (provider, method, params) => {
|
|
1966
2021
|
const response = await provider.request(method, params);
|
|
1967
|
-
if (
|
|
2022
|
+
if (v53.is(rpcErrorResponseMessageSchema, response)) {
|
|
1968
2023
|
return {
|
|
1969
2024
|
status: "error",
|
|
1970
2025
|
error: response.error
|
|
1971
2026
|
};
|
|
1972
2027
|
}
|
|
1973
|
-
if (
|
|
2028
|
+
if (v53.is(rpcSuccessResponseMessageSchema, response)) {
|
|
1974
2029
|
return {
|
|
1975
2030
|
status: "success",
|
|
1976
2031
|
result: response.result
|
|
@@ -3107,6 +3162,10 @@ var signMultipleTransactions = async (options) => {
|
|
|
3107
3162
|
isProviderInstalled,
|
|
3108
3163
|
networkChangeEventName,
|
|
3109
3164
|
networkChangeSchema,
|
|
3165
|
+
openReceiveMethodName,
|
|
3166
|
+
openReceiveParamsSchema,
|
|
3167
|
+
openReceiveRequestMessageSchema,
|
|
3168
|
+
openReceiveResultSchema,
|
|
3110
3169
|
permission,
|
|
3111
3170
|
removeDefaultProvider,
|
|
3112
3171
|
renouncePermissionsMethodName,
|