@sats-connect/core 0.13.1-49d1c59 → 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 +248 -217
- package/dist/index.d.ts +248 -217
- package/dist/index.js +795 -734
- package/dist/index.mjs +791 -734
- 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,604 +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
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
)
|
|
1243
|
-
|
|
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()
|
|
1297
|
+
})
|
|
1298
|
+
)
|
|
1299
|
+
});
|
|
1300
|
+
var sparkGetClawbackEligibleTransfersRequestMessageSchema = v27.object({
|
|
1244
1301
|
...rpcRequestMessageSchema.entries,
|
|
1245
|
-
...
|
|
1246
|
-
method:
|
|
1302
|
+
...v27.object({
|
|
1303
|
+
method: v27.literal(sparkGetClawbackEligibleTransfersMethodName),
|
|
1247
1304
|
params: sparkGetClawbackEligibleTransfersParamsSchema,
|
|
1248
|
-
id:
|
|
1305
|
+
id: v27.string()
|
|
1249
1306
|
}).entries
|
|
1250
1307
|
});
|
|
1251
1308
|
|
|
1252
1309
|
// src/request/types/sparkMethods/flashnetMethods/getJwt.ts
|
|
1253
|
-
var
|
|
1310
|
+
var v28 = __toESM(require("valibot"));
|
|
1254
1311
|
var sparkFlashnetGetJwtMethodName = "spark_flashnet_getJwt";
|
|
1255
|
-
var sparkFlashnetGetJwtParamsSchema =
|
|
1256
|
-
var sparkFlashnetGetJwtResultSchema =
|
|
1312
|
+
var sparkFlashnetGetJwtParamsSchema = v28.null();
|
|
1313
|
+
var sparkFlashnetGetJwtResultSchema = v28.object({
|
|
1257
1314
|
/**
|
|
1258
1315
|
* The JWT token for authenticated requests to the Flashnet API.
|
|
1259
1316
|
*/
|
|
1260
|
-
jwt:
|
|
1317
|
+
jwt: v28.string()
|
|
1261
1318
|
});
|
|
1262
|
-
var sparkFlashnetGetJwtRequestMessageSchema =
|
|
1319
|
+
var sparkFlashnetGetJwtRequestMessageSchema = v28.object({
|
|
1263
1320
|
...rpcRequestMessageSchema.entries,
|
|
1264
|
-
...
|
|
1265
|
-
method:
|
|
1321
|
+
...v28.object({
|
|
1322
|
+
method: v28.literal(sparkFlashnetGetJwtMethodName),
|
|
1266
1323
|
params: sparkFlashnetGetJwtParamsSchema,
|
|
1267
|
-
id:
|
|
1324
|
+
id: v28.string()
|
|
1268
1325
|
}).entries
|
|
1269
1326
|
});
|
|
1270
1327
|
|
|
1271
1328
|
// src/request/types/sparkMethods/flashnetMethods/intents/addLiquidity.ts
|
|
1272
|
-
var
|
|
1273
|
-
var sparkFlashnetAddLiquidityIntentSchema =
|
|
1274
|
-
type:
|
|
1275
|
-
data:
|
|
1276
|
-
userPublicKey:
|
|
1277
|
-
poolId:
|
|
1278
|
-
assetAAmount:
|
|
1279
|
-
assetBAmount:
|
|
1280
|
-
assetAMinAmountIn:
|
|
1281
|
-
assetBMinAmountIn:
|
|
1282
|
-
assetATransferId:
|
|
1283
|
-
assetBTransferId:
|
|
1284
|
-
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()
|
|
1285
1342
|
})
|
|
1286
1343
|
});
|
|
1287
1344
|
|
|
1288
1345
|
// src/request/types/sparkMethods/flashnetMethods/intents/clawback.ts
|
|
1289
|
-
var
|
|
1290
|
-
var sparkFlashnetClawbackIntentSchema =
|
|
1291
|
-
type:
|
|
1292
|
-
data:
|
|
1293
|
-
senderPublicKey:
|
|
1294
|
-
sparkTransferId:
|
|
1295
|
-
lpIdentityPublicKey:
|
|
1296
|
-
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()
|
|
1297
1354
|
})
|
|
1298
1355
|
});
|
|
1299
1356
|
|
|
1300
1357
|
// src/request/types/sparkMethods/flashnetMethods/intents/confirmInitialDeposit.ts
|
|
1301
|
-
var
|
|
1302
|
-
var sparkFlashnetConfirmInitialDepositIntentSchema =
|
|
1303
|
-
type:
|
|
1304
|
-
data:
|
|
1305
|
-
poolId:
|
|
1306
|
-
assetASparkTransferId:
|
|
1307
|
-
poolOwnerPublicKey:
|
|
1308
|
-
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()
|
|
1309
1366
|
})
|
|
1310
1367
|
});
|
|
1311
1368
|
|
|
1312
1369
|
// src/request/types/sparkMethods/flashnetMethods/intents/createConstantProductPool.ts
|
|
1313
|
-
var
|
|
1314
|
-
var sparkFlashnetCreateConstantProductPoolIntentSchema =
|
|
1315
|
-
type:
|
|
1316
|
-
data:
|
|
1317
|
-
poolOwnerPublicKey:
|
|
1318
|
-
assetAAddress:
|
|
1319
|
-
assetBAddress:
|
|
1320
|
-
lpFeeRateBps:
|
|
1321
|
-
totalHostFeeRateBps:
|
|
1322
|
-
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()
|
|
1323
1380
|
})
|
|
1324
1381
|
});
|
|
1325
1382
|
|
|
1326
1383
|
// src/request/types/sparkMethods/flashnetMethods/intents/createSingleSidedPool.ts
|
|
1327
|
-
var
|
|
1328
|
-
var sparkFlashnetCreateSingleSidedPoolIntentSchema =
|
|
1329
|
-
type:
|
|
1330
|
-
data:
|
|
1331
|
-
assetAAddress:
|
|
1332
|
-
assetBAddress:
|
|
1333
|
-
assetAInitialReserve:
|
|
1334
|
-
virtualReserveA:
|
|
1335
|
-
virtualReserveB:
|
|
1336
|
-
threshold:
|
|
1337
|
-
lpFeeRateBps:
|
|
1338
|
-
totalHostFeeRateBps:
|
|
1339
|
-
poolOwnerPublicKey:
|
|
1340
|
-
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()
|
|
1341
1398
|
})
|
|
1342
1399
|
});
|
|
1343
1400
|
|
|
1344
1401
|
// src/request/types/sparkMethods/flashnetMethods/intents/removeLiquidity.ts
|
|
1345
|
-
var
|
|
1346
|
-
var sparkFlashnetRemoveLiquidityIntentSchema =
|
|
1347
|
-
type:
|
|
1348
|
-
data:
|
|
1349
|
-
userPublicKey:
|
|
1350
|
-
poolId:
|
|
1351
|
-
lpTokensToRemove:
|
|
1352
|
-
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()
|
|
1353
1410
|
})
|
|
1354
1411
|
});
|
|
1355
1412
|
|
|
1356
1413
|
// src/request/types/sparkMethods/flashnetMethods/intents/routeSwap.ts
|
|
1357
|
-
var
|
|
1358
|
-
var sparkFlashnetRouteSwapIntentSchema =
|
|
1359
|
-
type:
|
|
1360
|
-
data:
|
|
1361
|
-
userPublicKey:
|
|
1362
|
-
initialSparkTransferId:
|
|
1363
|
-
hops:
|
|
1364
|
-
|
|
1365
|
-
poolId:
|
|
1366
|
-
inputAssetAddress:
|
|
1367
|
-
outputAssetAddress:
|
|
1368
|
-
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()]))
|
|
1369
1426
|
})
|
|
1370
1427
|
),
|
|
1371
|
-
inputAmount:
|
|
1372
|
-
maxRouteSlippageBps:
|
|
1373
|
-
minAmountOut:
|
|
1374
|
-
defaultIntegratorFeeRateBps:
|
|
1375
|
-
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()
|
|
1376
1433
|
})
|
|
1377
1434
|
});
|
|
1378
1435
|
|
|
1379
1436
|
// src/request/types/sparkMethods/flashnetMethods/intents/swap.ts
|
|
1380
|
-
var
|
|
1381
|
-
var sparkFlashnetSwapIntentSchema =
|
|
1382
|
-
type:
|
|
1383
|
-
data:
|
|
1384
|
-
userPublicKey:
|
|
1385
|
-
poolId:
|
|
1386
|
-
transferId:
|
|
1387
|
-
assetInAddress:
|
|
1388
|
-
assetOutAddress:
|
|
1389
|
-
amountIn:
|
|
1390
|
-
maxSlippageBps:
|
|
1391
|
-
minAmountOut:
|
|
1392
|
-
totalIntegratorFeeRateBps:
|
|
1393
|
-
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()
|
|
1394
1451
|
})
|
|
1395
1452
|
});
|
|
1396
1453
|
|
|
1397
1454
|
// src/request/types/sparkMethods/flashnetMethods/signIntent.ts
|
|
1398
|
-
var
|
|
1455
|
+
var v37 = __toESM(require("valibot"));
|
|
1399
1456
|
var sparkFlashnetSignIntentMethodName = "spark_flashnet_signIntent";
|
|
1400
|
-
var sparkFlashnetSignIntentParamsSchema =
|
|
1457
|
+
var sparkFlashnetSignIntentParamsSchema = v37.union([
|
|
1401
1458
|
sparkFlashnetSwapIntentSchema,
|
|
1402
1459
|
sparkFlashnetRouteSwapIntentSchema,
|
|
1403
1460
|
sparkFlashnetAddLiquidityIntentSchema,
|
|
@@ -1407,109 +1464,109 @@ var sparkFlashnetSignIntentParamsSchema = v25.union([
|
|
|
1407
1464
|
sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
1408
1465
|
sparkFlashnetRemoveLiquidityIntentSchema
|
|
1409
1466
|
]);
|
|
1410
|
-
var sparkFlashnetSignIntentResultSchema =
|
|
1467
|
+
var sparkFlashnetSignIntentResultSchema = v37.object({
|
|
1411
1468
|
/**
|
|
1412
1469
|
* The signed intent as a hex string.
|
|
1413
1470
|
*/
|
|
1414
|
-
signature:
|
|
1471
|
+
signature: v37.string()
|
|
1415
1472
|
});
|
|
1416
|
-
var sparkFlashnetSignIntentRequestMessageSchema =
|
|
1473
|
+
var sparkFlashnetSignIntentRequestMessageSchema = v37.object({
|
|
1417
1474
|
...rpcRequestMessageSchema.entries,
|
|
1418
|
-
...
|
|
1419
|
-
method:
|
|
1475
|
+
...v37.object({
|
|
1476
|
+
method: v37.literal(sparkFlashnetSignIntentMethodName),
|
|
1420
1477
|
params: sparkFlashnetSignIntentParamsSchema,
|
|
1421
|
-
id:
|
|
1478
|
+
id: v37.string()
|
|
1422
1479
|
}).entries
|
|
1423
1480
|
});
|
|
1424
1481
|
|
|
1425
1482
|
// src/request/types/sparkMethods/flashnetMethods/signStructuredMessage.ts
|
|
1426
|
-
var
|
|
1483
|
+
var v38 = __toESM(require("valibot"));
|
|
1427
1484
|
var sparkFlashnetSignStructuredMessageMethodName = "spark_flashnet_signStructuredMessage";
|
|
1428
|
-
var sparkFlashnetSignStructuredMessageParamsSchema =
|
|
1429
|
-
message:
|
|
1485
|
+
var sparkFlashnetSignStructuredMessageParamsSchema = v38.object({
|
|
1486
|
+
message: v38.string()
|
|
1430
1487
|
});
|
|
1431
|
-
var sparkFlashnetSignStructuredMessageResultSchema =
|
|
1432
|
-
message:
|
|
1433
|
-
signature:
|
|
1488
|
+
var sparkFlashnetSignStructuredMessageResultSchema = v38.object({
|
|
1489
|
+
message: v38.string(),
|
|
1490
|
+
signature: v38.string()
|
|
1434
1491
|
});
|
|
1435
|
-
var sparkFlashnetSignStructuredMessageRequestMessageSchema =
|
|
1492
|
+
var sparkFlashnetSignStructuredMessageRequestMessageSchema = v38.object({
|
|
1436
1493
|
...rpcRequestMessageSchema.entries,
|
|
1437
|
-
...
|
|
1438
|
-
method:
|
|
1494
|
+
...v38.object({
|
|
1495
|
+
method: v38.literal(sparkFlashnetSignStructuredMessageMethodName),
|
|
1439
1496
|
params: sparkFlashnetSignStructuredMessageParamsSchema,
|
|
1440
|
-
id:
|
|
1497
|
+
id: v38.string()
|
|
1441
1498
|
}).entries
|
|
1442
1499
|
});
|
|
1443
1500
|
|
|
1444
1501
|
// src/request/types/sparkMethods/getAddresses.ts
|
|
1445
|
-
var
|
|
1502
|
+
var v39 = __toESM(require("valibot"));
|
|
1446
1503
|
var sparkGetAddressesMethodName = "spark_getAddresses";
|
|
1447
|
-
var sparkGetAddressesParamsSchema =
|
|
1448
|
-
|
|
1504
|
+
var sparkGetAddressesParamsSchema = v39.nullish(
|
|
1505
|
+
v39.object({
|
|
1449
1506
|
/**
|
|
1450
1507
|
* A message to be displayed to the user in the request prompt.
|
|
1451
1508
|
*/
|
|
1452
|
-
message:
|
|
1509
|
+
message: v39.optional(v39.string())
|
|
1453
1510
|
})
|
|
1454
1511
|
);
|
|
1455
|
-
var sparkGetAddressesResultSchema =
|
|
1512
|
+
var sparkGetAddressesResultSchema = v39.object({
|
|
1456
1513
|
/**
|
|
1457
1514
|
* The addresses generated for the given purposes.
|
|
1458
1515
|
*/
|
|
1459
|
-
addresses:
|
|
1516
|
+
addresses: v39.array(addressSchema),
|
|
1460
1517
|
network: getNetworkResultSchema
|
|
1461
1518
|
});
|
|
1462
|
-
var sparkGetAddressesRequestMessageSchema =
|
|
1519
|
+
var sparkGetAddressesRequestMessageSchema = v39.object({
|
|
1463
1520
|
...rpcRequestMessageSchema.entries,
|
|
1464
|
-
...
|
|
1465
|
-
method:
|
|
1521
|
+
...v39.object({
|
|
1522
|
+
method: v39.literal(sparkGetAddressesMethodName),
|
|
1466
1523
|
params: sparkGetAddressesParamsSchema,
|
|
1467
|
-
id:
|
|
1524
|
+
id: v39.string()
|
|
1468
1525
|
}).entries
|
|
1469
1526
|
});
|
|
1470
1527
|
|
|
1471
1528
|
// src/request/types/sparkMethods/getBalance.ts
|
|
1472
|
-
var
|
|
1529
|
+
var v40 = __toESM(require("valibot"));
|
|
1473
1530
|
var sparkGetBalanceMethodName = "spark_getBalance";
|
|
1474
|
-
var sparkGetBalanceParamsSchema =
|
|
1475
|
-
var sparkGetBalanceResultSchema =
|
|
1531
|
+
var sparkGetBalanceParamsSchema = v40.nullish(v40.null());
|
|
1532
|
+
var sparkGetBalanceResultSchema = v40.object({
|
|
1476
1533
|
/**
|
|
1477
1534
|
* The Spark Bitcoin address balance in sats in string form.
|
|
1478
1535
|
*/
|
|
1479
|
-
balance:
|
|
1480
|
-
tokenBalances:
|
|
1481
|
-
|
|
1536
|
+
balance: v40.string(),
|
|
1537
|
+
tokenBalances: v40.array(
|
|
1538
|
+
v40.object({
|
|
1482
1539
|
/* The address balance of the token in string form as it can overflow a js number */
|
|
1483
|
-
balance:
|
|
1484
|
-
tokenMetadata:
|
|
1485
|
-
tokenIdentifier:
|
|
1486
|
-
tokenName:
|
|
1487
|
-
tokenTicker:
|
|
1488
|
-
decimals:
|
|
1489
|
-
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()
|
|
1490
1547
|
})
|
|
1491
1548
|
})
|
|
1492
1549
|
)
|
|
1493
1550
|
});
|
|
1494
|
-
var sparkGetBalanceRequestMessageSchema =
|
|
1551
|
+
var sparkGetBalanceRequestMessageSchema = v40.object({
|
|
1495
1552
|
...rpcRequestMessageSchema.entries,
|
|
1496
|
-
...
|
|
1497
|
-
method:
|
|
1553
|
+
...v40.object({
|
|
1554
|
+
method: v40.literal(sparkGetBalanceMethodName),
|
|
1498
1555
|
params: sparkGetBalanceParamsSchema,
|
|
1499
|
-
id:
|
|
1556
|
+
id: v40.string()
|
|
1500
1557
|
}).entries
|
|
1501
1558
|
});
|
|
1502
1559
|
|
|
1503
1560
|
// src/request/types/sparkMethods/signMessage.ts
|
|
1504
|
-
var
|
|
1561
|
+
var v41 = __toESM(require("valibot"));
|
|
1505
1562
|
var sparkSignMessageMethodName = "spark_signMessage";
|
|
1506
|
-
var sparkSignMessageParamsSchema =
|
|
1563
|
+
var sparkSignMessageParamsSchema = v41.object({
|
|
1507
1564
|
/**
|
|
1508
1565
|
* The message to sign. The message should only consist of valid UTF-8 characters.
|
|
1509
1566
|
*/
|
|
1510
|
-
message:
|
|
1567
|
+
message: v41.string()
|
|
1511
1568
|
});
|
|
1512
|
-
var sparkSignMessageResultSchema =
|
|
1569
|
+
var sparkSignMessageResultSchema = v41.object({
|
|
1513
1570
|
/**
|
|
1514
1571
|
* The signature, encoded in base64, of the message hash.
|
|
1515
1572
|
*
|
|
@@ -1517,98 +1574,98 @@ var sparkSignMessageResultSchema = v29.object({
|
|
|
1517
1574
|
* and the resulting byte array is hashed with SHA256 before signing
|
|
1518
1575
|
* with the private key.
|
|
1519
1576
|
*/
|
|
1520
|
-
signature:
|
|
1577
|
+
signature: v41.string()
|
|
1521
1578
|
});
|
|
1522
|
-
var sparkSignMessageRequestMessageSchema =
|
|
1579
|
+
var sparkSignMessageRequestMessageSchema = v41.object({
|
|
1523
1580
|
...rpcRequestMessageSchema.entries,
|
|
1524
|
-
...
|
|
1525
|
-
method:
|
|
1581
|
+
...v41.object({
|
|
1582
|
+
method: v41.literal(sparkSignMessageMethodName),
|
|
1526
1583
|
params: sparkSignMessageParamsSchema,
|
|
1527
|
-
id:
|
|
1584
|
+
id: v41.string()
|
|
1528
1585
|
}).entries
|
|
1529
1586
|
});
|
|
1530
1587
|
|
|
1531
1588
|
// src/request/types/sparkMethods/transfer.ts
|
|
1532
|
-
var
|
|
1589
|
+
var v42 = __toESM(require("valibot"));
|
|
1533
1590
|
var sparkTransferMethodName = "spark_transfer";
|
|
1534
|
-
var sparkTransferParamsSchema =
|
|
1591
|
+
var sparkTransferParamsSchema = v42.object({
|
|
1535
1592
|
/**
|
|
1536
1593
|
* Amount of SATS to transfer as a string or number.
|
|
1537
1594
|
*/
|
|
1538
|
-
amountSats:
|
|
1595
|
+
amountSats: v42.union([v42.number(), v42.string()]),
|
|
1539
1596
|
/**
|
|
1540
1597
|
* The recipient's spark address.
|
|
1541
1598
|
*/
|
|
1542
|
-
receiverSparkAddress:
|
|
1599
|
+
receiverSparkAddress: v42.string()
|
|
1543
1600
|
});
|
|
1544
|
-
var sparkTransferResultSchema =
|
|
1601
|
+
var sparkTransferResultSchema = v42.object({
|
|
1545
1602
|
/**
|
|
1546
1603
|
* The ID of the transaction.
|
|
1547
1604
|
*/
|
|
1548
|
-
id:
|
|
1605
|
+
id: v42.string()
|
|
1549
1606
|
});
|
|
1550
|
-
var sparkTransferRequestMessageSchema =
|
|
1607
|
+
var sparkTransferRequestMessageSchema = v42.object({
|
|
1551
1608
|
...rpcRequestMessageSchema.entries,
|
|
1552
|
-
...
|
|
1553
|
-
method:
|
|
1609
|
+
...v42.object({
|
|
1610
|
+
method: v42.literal(sparkTransferMethodName),
|
|
1554
1611
|
params: sparkTransferParamsSchema,
|
|
1555
|
-
id:
|
|
1612
|
+
id: v42.string()
|
|
1556
1613
|
}).entries
|
|
1557
1614
|
});
|
|
1558
1615
|
|
|
1559
1616
|
// src/request/types/sparkMethods/transferToken.ts
|
|
1560
|
-
var
|
|
1617
|
+
var v43 = __toESM(require("valibot"));
|
|
1561
1618
|
var sparkTransferTokenMethodName = "spark_transferToken";
|
|
1562
|
-
var sparkTransferTokenParamsSchema =
|
|
1619
|
+
var sparkTransferTokenParamsSchema = v43.object({
|
|
1563
1620
|
/**
|
|
1564
1621
|
* Amount of units of the token to transfer as a string or number.
|
|
1565
1622
|
*/
|
|
1566
|
-
tokenAmount:
|
|
1623
|
+
tokenAmount: v43.union([v43.number(), v43.string()]),
|
|
1567
1624
|
/**
|
|
1568
1625
|
* The Bech32m token identifier.
|
|
1569
1626
|
*/
|
|
1570
|
-
tokenIdentifier:
|
|
1627
|
+
tokenIdentifier: v43.string(),
|
|
1571
1628
|
/**
|
|
1572
1629
|
* The recipient's spark address.
|
|
1573
1630
|
*/
|
|
1574
|
-
receiverSparkAddress:
|
|
1631
|
+
receiverSparkAddress: v43.string()
|
|
1575
1632
|
});
|
|
1576
|
-
var sparkTransferTokenResultSchema =
|
|
1633
|
+
var sparkTransferTokenResultSchema = v43.object({
|
|
1577
1634
|
/**
|
|
1578
1635
|
* The ID of the transaction.
|
|
1579
1636
|
*/
|
|
1580
|
-
id:
|
|
1637
|
+
id: v43.string()
|
|
1581
1638
|
});
|
|
1582
|
-
var sparkTransferTokenRequestMessageSchema =
|
|
1639
|
+
var sparkTransferTokenRequestMessageSchema = v43.object({
|
|
1583
1640
|
...rpcRequestMessageSchema.entries,
|
|
1584
|
-
...
|
|
1585
|
-
method:
|
|
1641
|
+
...v43.object({
|
|
1642
|
+
method: v43.literal(sparkTransferTokenMethodName),
|
|
1586
1643
|
params: sparkTransferTokenParamsSchema,
|
|
1587
|
-
id:
|
|
1644
|
+
id: v43.string()
|
|
1588
1645
|
}).entries
|
|
1589
1646
|
});
|
|
1590
1647
|
|
|
1591
1648
|
// src/request/types/stxMethods/callContract.ts
|
|
1592
|
-
var
|
|
1649
|
+
var v44 = __toESM(require("valibot"));
|
|
1593
1650
|
var stxCallContractMethodName = "stx_callContract";
|
|
1594
|
-
var stxCallContractParamsSchema =
|
|
1651
|
+
var stxCallContractParamsSchema = v44.object({
|
|
1595
1652
|
/**
|
|
1596
1653
|
* The contract principal.
|
|
1597
1654
|
*
|
|
1598
1655
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
1599
1656
|
*/
|
|
1600
|
-
contract:
|
|
1657
|
+
contract: v44.string(),
|
|
1601
1658
|
/**
|
|
1602
1659
|
* The name of the function to call.
|
|
1603
1660
|
*
|
|
1604
1661
|
* Note: spec changes ongoing,
|
|
1605
1662
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1606
1663
|
*/
|
|
1607
|
-
functionName:
|
|
1664
|
+
functionName: v44.string(),
|
|
1608
1665
|
/**
|
|
1609
1666
|
* @deprecated in favor of `functionArgs` for @stacks/connect compatibility
|
|
1610
1667
|
*/
|
|
1611
|
-
arguments:
|
|
1668
|
+
arguments: v44.optional(v44.array(v44.string())),
|
|
1612
1669
|
/**
|
|
1613
1670
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1614
1671
|
* strings of Clarity values.
|
|
@@ -1623,274 +1680,274 @@ var stxCallContractParamsSchema = v32.object({
|
|
|
1623
1680
|
* const hexArgs = functionArgs.map(cvToHex);
|
|
1624
1681
|
* ```
|
|
1625
1682
|
*/
|
|
1626
|
-
functionArgs:
|
|
1683
|
+
functionArgs: v44.optional(v44.array(v44.string())),
|
|
1627
1684
|
/**
|
|
1628
1685
|
* The post conditions to apply to the contract call.
|
|
1629
1686
|
*/
|
|
1630
|
-
postConditions:
|
|
1687
|
+
postConditions: v44.optional(v44.array(v44.string())),
|
|
1631
1688
|
/**
|
|
1632
1689
|
* The mode to apply to the post conditions.
|
|
1633
1690
|
*/
|
|
1634
|
-
postConditionMode:
|
|
1691
|
+
postConditionMode: v44.optional(v44.union([v44.literal("allow"), v44.literal("deny")]))
|
|
1635
1692
|
});
|
|
1636
|
-
var stxCallContractResultSchema =
|
|
1693
|
+
var stxCallContractResultSchema = v44.object({
|
|
1637
1694
|
/**
|
|
1638
1695
|
* The ID of the transaction.
|
|
1639
1696
|
*/
|
|
1640
|
-
txid:
|
|
1697
|
+
txid: v44.string(),
|
|
1641
1698
|
/**
|
|
1642
1699
|
* A Stacks transaction as a hex-encoded string.
|
|
1643
1700
|
*/
|
|
1644
|
-
transaction:
|
|
1701
|
+
transaction: v44.string()
|
|
1645
1702
|
});
|
|
1646
|
-
var stxCallContractRequestMessageSchema =
|
|
1703
|
+
var stxCallContractRequestMessageSchema = v44.object({
|
|
1647
1704
|
...rpcRequestMessageSchema.entries,
|
|
1648
|
-
...
|
|
1649
|
-
method:
|
|
1705
|
+
...v44.object({
|
|
1706
|
+
method: v44.literal(stxCallContractMethodName),
|
|
1650
1707
|
params: stxCallContractParamsSchema,
|
|
1651
|
-
id:
|
|
1708
|
+
id: v44.string()
|
|
1652
1709
|
}).entries
|
|
1653
1710
|
});
|
|
1654
1711
|
|
|
1655
1712
|
// src/request/types/stxMethods/deployContract.ts
|
|
1656
|
-
var
|
|
1713
|
+
var v45 = __toESM(require("valibot"));
|
|
1657
1714
|
var stxDeployContractMethodName = "stx_deployContract";
|
|
1658
|
-
var stxDeployContractParamsSchema =
|
|
1715
|
+
var stxDeployContractParamsSchema = v45.object({
|
|
1659
1716
|
/**
|
|
1660
1717
|
* Name of the contract.
|
|
1661
1718
|
*/
|
|
1662
|
-
name:
|
|
1719
|
+
name: v45.string(),
|
|
1663
1720
|
/**
|
|
1664
1721
|
* The source code of the Clarity contract.
|
|
1665
1722
|
*/
|
|
1666
|
-
clarityCode:
|
|
1723
|
+
clarityCode: v45.string(),
|
|
1667
1724
|
/**
|
|
1668
1725
|
* The version of the Clarity contract.
|
|
1669
1726
|
*/
|
|
1670
|
-
clarityVersion:
|
|
1727
|
+
clarityVersion: v45.optional(v45.number()),
|
|
1671
1728
|
/**
|
|
1672
1729
|
* The post conditions to apply to the contract call.
|
|
1673
1730
|
*/
|
|
1674
|
-
postConditions:
|
|
1731
|
+
postConditions: v45.optional(v45.array(v45.string())),
|
|
1675
1732
|
/**
|
|
1676
1733
|
* The mode to apply to the post conditions.
|
|
1677
1734
|
*/
|
|
1678
|
-
postConditionMode:
|
|
1735
|
+
postConditionMode: v45.optional(v45.union([v45.literal("allow"), v45.literal("deny")]))
|
|
1679
1736
|
});
|
|
1680
|
-
var stxDeployContractResultSchema =
|
|
1737
|
+
var stxDeployContractResultSchema = v45.object({
|
|
1681
1738
|
/**
|
|
1682
1739
|
* The ID of the transaction.
|
|
1683
1740
|
*/
|
|
1684
|
-
txid:
|
|
1741
|
+
txid: v45.string(),
|
|
1685
1742
|
/**
|
|
1686
1743
|
* A Stacks transaction as a hex-encoded string.
|
|
1687
1744
|
*/
|
|
1688
|
-
transaction:
|
|
1745
|
+
transaction: v45.string()
|
|
1689
1746
|
});
|
|
1690
|
-
var stxDeployContractRequestMessageSchema =
|
|
1747
|
+
var stxDeployContractRequestMessageSchema = v45.object({
|
|
1691
1748
|
...rpcRequestMessageSchema.entries,
|
|
1692
|
-
...
|
|
1693
|
-
method:
|
|
1749
|
+
...v45.object({
|
|
1750
|
+
method: v45.literal(stxDeployContractMethodName),
|
|
1694
1751
|
params: stxDeployContractParamsSchema,
|
|
1695
|
-
id:
|
|
1752
|
+
id: v45.string()
|
|
1696
1753
|
}).entries
|
|
1697
1754
|
});
|
|
1698
1755
|
|
|
1699
1756
|
// src/request/types/stxMethods/getAccounts.ts
|
|
1700
|
-
var
|
|
1757
|
+
var v46 = __toESM(require("valibot"));
|
|
1701
1758
|
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
1702
|
-
var stxGetAccountsParamsSchema =
|
|
1703
|
-
var stxGetAccountsResultSchema =
|
|
1759
|
+
var stxGetAccountsParamsSchema = v46.nullish(v46.null());
|
|
1760
|
+
var stxGetAccountsResultSchema = v46.object({
|
|
1704
1761
|
/**
|
|
1705
1762
|
* The addresses generated for the given purposes.
|
|
1706
1763
|
*/
|
|
1707
|
-
addresses:
|
|
1708
|
-
|
|
1709
|
-
address:
|
|
1710
|
-
publicKey:
|
|
1711
|
-
gaiaHubUrl:
|
|
1712
|
-
gaiaAppKey:
|
|
1764
|
+
addresses: v46.array(
|
|
1765
|
+
v46.object({
|
|
1766
|
+
address: v46.string(),
|
|
1767
|
+
publicKey: v46.string(),
|
|
1768
|
+
gaiaHubUrl: v46.string(),
|
|
1769
|
+
gaiaAppKey: v46.string()
|
|
1713
1770
|
})
|
|
1714
1771
|
),
|
|
1715
1772
|
network: getNetworkResultSchema
|
|
1716
1773
|
});
|
|
1717
|
-
var stxGetAccountsRequestMessageSchema =
|
|
1774
|
+
var stxGetAccountsRequestMessageSchema = v46.object({
|
|
1718
1775
|
...rpcRequestMessageSchema.entries,
|
|
1719
|
-
...
|
|
1720
|
-
method:
|
|
1776
|
+
...v46.object({
|
|
1777
|
+
method: v46.literal(stxGetAccountsMethodName),
|
|
1721
1778
|
params: stxGetAccountsParamsSchema,
|
|
1722
|
-
id:
|
|
1779
|
+
id: v46.string()
|
|
1723
1780
|
}).entries
|
|
1724
1781
|
});
|
|
1725
1782
|
|
|
1726
1783
|
// src/request/types/stxMethods/getAddresses.ts
|
|
1727
|
-
var
|
|
1784
|
+
var v47 = __toESM(require("valibot"));
|
|
1728
1785
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
1729
|
-
var stxGetAddressesParamsSchema =
|
|
1730
|
-
|
|
1786
|
+
var stxGetAddressesParamsSchema = v47.nullish(
|
|
1787
|
+
v47.object({
|
|
1731
1788
|
/**
|
|
1732
1789
|
* A message to be displayed to the user in the request prompt.
|
|
1733
1790
|
*/
|
|
1734
|
-
message:
|
|
1791
|
+
message: v47.optional(v47.string())
|
|
1735
1792
|
})
|
|
1736
1793
|
);
|
|
1737
|
-
var stxGetAddressesResultSchema =
|
|
1794
|
+
var stxGetAddressesResultSchema = v47.object({
|
|
1738
1795
|
/**
|
|
1739
1796
|
* The addresses generated for the given purposes.
|
|
1740
1797
|
*/
|
|
1741
|
-
addresses:
|
|
1798
|
+
addresses: v47.array(addressSchema),
|
|
1742
1799
|
network: getNetworkResultSchema
|
|
1743
1800
|
});
|
|
1744
|
-
var stxGetAddressesRequestMessageSchema =
|
|
1801
|
+
var stxGetAddressesRequestMessageSchema = v47.object({
|
|
1745
1802
|
...rpcRequestMessageSchema.entries,
|
|
1746
|
-
...
|
|
1747
|
-
method:
|
|
1803
|
+
...v47.object({
|
|
1804
|
+
method: v47.literal(stxGetAddressesMethodName),
|
|
1748
1805
|
params: stxGetAddressesParamsSchema,
|
|
1749
|
-
id:
|
|
1806
|
+
id: v47.string()
|
|
1750
1807
|
}).entries
|
|
1751
1808
|
});
|
|
1752
1809
|
|
|
1753
1810
|
// src/request/types/stxMethods/signMessage.ts
|
|
1754
|
-
var
|
|
1811
|
+
var v48 = __toESM(require("valibot"));
|
|
1755
1812
|
var stxSignMessageMethodName = "stx_signMessage";
|
|
1756
|
-
var stxSignMessageParamsSchema =
|
|
1813
|
+
var stxSignMessageParamsSchema = v48.object({
|
|
1757
1814
|
/**
|
|
1758
1815
|
* The message to sign.
|
|
1759
1816
|
*/
|
|
1760
|
-
message:
|
|
1817
|
+
message: v48.string()
|
|
1761
1818
|
});
|
|
1762
|
-
var stxSignMessageResultSchema =
|
|
1819
|
+
var stxSignMessageResultSchema = v48.object({
|
|
1763
1820
|
/**
|
|
1764
1821
|
* The signature of the message.
|
|
1765
1822
|
*/
|
|
1766
|
-
signature:
|
|
1823
|
+
signature: v48.string(),
|
|
1767
1824
|
/**
|
|
1768
1825
|
* The public key used to sign the message.
|
|
1769
1826
|
*/
|
|
1770
|
-
publicKey:
|
|
1827
|
+
publicKey: v48.string()
|
|
1771
1828
|
});
|
|
1772
|
-
var stxSignMessageRequestMessageSchema =
|
|
1829
|
+
var stxSignMessageRequestMessageSchema = v48.object({
|
|
1773
1830
|
...rpcRequestMessageSchema.entries,
|
|
1774
|
-
...
|
|
1775
|
-
method:
|
|
1831
|
+
...v48.object({
|
|
1832
|
+
method: v48.literal(stxSignMessageMethodName),
|
|
1776
1833
|
params: stxSignMessageParamsSchema,
|
|
1777
|
-
id:
|
|
1834
|
+
id: v48.string()
|
|
1778
1835
|
}).entries
|
|
1779
1836
|
});
|
|
1780
1837
|
|
|
1781
1838
|
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
1782
|
-
var
|
|
1839
|
+
var v49 = __toESM(require("valibot"));
|
|
1783
1840
|
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
1784
|
-
var stxSignStructuredMessageParamsSchema =
|
|
1841
|
+
var stxSignStructuredMessageParamsSchema = v49.object({
|
|
1785
1842
|
/**
|
|
1786
1843
|
* The domain to be signed.
|
|
1787
1844
|
*/
|
|
1788
|
-
domain:
|
|
1845
|
+
domain: v49.string(),
|
|
1789
1846
|
/**
|
|
1790
1847
|
* Message payload to be signed.
|
|
1791
1848
|
*/
|
|
1792
|
-
message:
|
|
1849
|
+
message: v49.string(),
|
|
1793
1850
|
/**
|
|
1794
1851
|
* The public key to sign the message with.
|
|
1795
1852
|
*/
|
|
1796
|
-
publicKey:
|
|
1853
|
+
publicKey: v49.optional(v49.string())
|
|
1797
1854
|
});
|
|
1798
|
-
var stxSignStructuredMessageResultSchema =
|
|
1855
|
+
var stxSignStructuredMessageResultSchema = v49.object({
|
|
1799
1856
|
/**
|
|
1800
1857
|
* Signature of the message.
|
|
1801
1858
|
*/
|
|
1802
|
-
signature:
|
|
1859
|
+
signature: v49.string(),
|
|
1803
1860
|
/**
|
|
1804
1861
|
* Public key as hex-encoded string.
|
|
1805
1862
|
*/
|
|
1806
|
-
publicKey:
|
|
1863
|
+
publicKey: v49.string()
|
|
1807
1864
|
});
|
|
1808
|
-
var stxSignStructuredMessageRequestMessageSchema =
|
|
1865
|
+
var stxSignStructuredMessageRequestMessageSchema = v49.object({
|
|
1809
1866
|
...rpcRequestMessageSchema.entries,
|
|
1810
|
-
...
|
|
1811
|
-
method:
|
|
1867
|
+
...v49.object({
|
|
1868
|
+
method: v49.literal(stxSignStructuredMessageMethodName),
|
|
1812
1869
|
params: stxSignStructuredMessageParamsSchema,
|
|
1813
|
-
id:
|
|
1870
|
+
id: v49.string()
|
|
1814
1871
|
}).entries
|
|
1815
1872
|
});
|
|
1816
1873
|
|
|
1817
1874
|
// src/request/types/stxMethods/signTransaction.ts
|
|
1818
|
-
var
|
|
1875
|
+
var v50 = __toESM(require("valibot"));
|
|
1819
1876
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
1820
|
-
var stxSignTransactionParamsSchema =
|
|
1877
|
+
var stxSignTransactionParamsSchema = v50.object({
|
|
1821
1878
|
/**
|
|
1822
1879
|
* The transaction to sign as a hex-encoded string.
|
|
1823
1880
|
*/
|
|
1824
|
-
transaction:
|
|
1881
|
+
transaction: v50.string(),
|
|
1825
1882
|
/**
|
|
1826
1883
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1827
1884
|
* when not provided.
|
|
1828
1885
|
*/
|
|
1829
|
-
pubkey:
|
|
1886
|
+
pubkey: v50.optional(v50.string()),
|
|
1830
1887
|
/**
|
|
1831
1888
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
1832
1889
|
*/
|
|
1833
|
-
broadcast:
|
|
1890
|
+
broadcast: v50.optional(v50.boolean())
|
|
1834
1891
|
});
|
|
1835
|
-
var stxSignTransactionResultSchema =
|
|
1892
|
+
var stxSignTransactionResultSchema = v50.object({
|
|
1836
1893
|
/**
|
|
1837
1894
|
* The signed transaction as a hex-encoded string.
|
|
1838
1895
|
*/
|
|
1839
|
-
transaction:
|
|
1896
|
+
transaction: v50.string()
|
|
1840
1897
|
});
|
|
1841
|
-
var stxSignTransactionRequestMessageSchema =
|
|
1898
|
+
var stxSignTransactionRequestMessageSchema = v50.object({
|
|
1842
1899
|
...rpcRequestMessageSchema.entries,
|
|
1843
|
-
...
|
|
1844
|
-
method:
|
|
1900
|
+
...v50.object({
|
|
1901
|
+
method: v50.literal(stxSignTransactionMethodName),
|
|
1845
1902
|
params: stxSignTransactionParamsSchema,
|
|
1846
|
-
id:
|
|
1903
|
+
id: v50.string()
|
|
1847
1904
|
}).entries
|
|
1848
1905
|
});
|
|
1849
1906
|
|
|
1850
1907
|
// src/request/types/stxMethods/signTransactions.ts
|
|
1851
|
-
var
|
|
1908
|
+
var v51 = __toESM(require("valibot"));
|
|
1852
1909
|
var stxSignTransactionsMethodName = "stx_signTransactions";
|
|
1853
|
-
var stxSignTransactionsParamsSchema =
|
|
1910
|
+
var stxSignTransactionsParamsSchema = v51.object({
|
|
1854
1911
|
/**
|
|
1855
1912
|
* The transactions to sign as hex-encoded strings.
|
|
1856
1913
|
*/
|
|
1857
|
-
transactions:
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1914
|
+
transactions: v51.pipe(
|
|
1915
|
+
v51.array(
|
|
1916
|
+
v51.pipe(
|
|
1917
|
+
v51.string(),
|
|
1918
|
+
v51.check((hex) => {
|
|
1862
1919
|
return true;
|
|
1863
1920
|
}, "Invalid hex-encoded Stacks transaction.")
|
|
1864
1921
|
)
|
|
1865
1922
|
),
|
|
1866
|
-
|
|
1923
|
+
v51.minLength(1)
|
|
1867
1924
|
),
|
|
1868
1925
|
/**
|
|
1869
1926
|
* Whether the signed transactions should be broadcast after signing. Defaults
|
|
1870
1927
|
* to `true`.
|
|
1871
1928
|
*/
|
|
1872
|
-
broadcast:
|
|
1929
|
+
broadcast: v51.optional(v51.boolean())
|
|
1873
1930
|
});
|
|
1874
|
-
var stxSignTransactionsResultSchema =
|
|
1931
|
+
var stxSignTransactionsResultSchema = v51.object({
|
|
1875
1932
|
/**
|
|
1876
1933
|
* The signed transactions as hex-encoded strings, in the same order as in the
|
|
1877
1934
|
* sign request.
|
|
1878
1935
|
*/
|
|
1879
|
-
transactions:
|
|
1936
|
+
transactions: v51.array(v51.string())
|
|
1880
1937
|
});
|
|
1881
|
-
var stxSignTransactionsRequestMessageSchema =
|
|
1938
|
+
var stxSignTransactionsRequestMessageSchema = v51.object({
|
|
1882
1939
|
...rpcRequestMessageSchema.entries,
|
|
1883
|
-
...
|
|
1884
|
-
method:
|
|
1940
|
+
...v51.object({
|
|
1941
|
+
method: v51.literal(stxSignTransactionsMethodName),
|
|
1885
1942
|
params: stxSignTransactionsParamsSchema,
|
|
1886
|
-
id:
|
|
1943
|
+
id: v51.string()
|
|
1887
1944
|
}).entries
|
|
1888
1945
|
});
|
|
1889
1946
|
|
|
1890
1947
|
// src/request/types/stxMethods/transferStx.ts
|
|
1891
|
-
var
|
|
1948
|
+
var v52 = __toESM(require("valibot"));
|
|
1892
1949
|
var stxTransferStxMethodName = "stx_transferStx";
|
|
1893
|
-
var stxTransferStxParamsSchema =
|
|
1950
|
+
var stxTransferStxParamsSchema = v52.object({
|
|
1894
1951
|
/**
|
|
1895
1952
|
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
1896
1953
|
* parseable by `BigInt` is acceptable.
|
|
@@ -1903,23 +1960,23 @@ var stxTransferStxParamsSchema = v40.object({
|
|
|
1903
1960
|
* const amount3 = '1234';
|
|
1904
1961
|
* ```
|
|
1905
1962
|
*/
|
|
1906
|
-
amount:
|
|
1963
|
+
amount: v52.union([v52.number(), v52.string()]),
|
|
1907
1964
|
/**
|
|
1908
1965
|
* The recipient's principal.
|
|
1909
1966
|
*/
|
|
1910
|
-
recipient:
|
|
1967
|
+
recipient: v52.string(),
|
|
1911
1968
|
/**
|
|
1912
1969
|
* A string representing the memo.
|
|
1913
1970
|
*/
|
|
1914
|
-
memo:
|
|
1971
|
+
memo: v52.optional(v52.string()),
|
|
1915
1972
|
/**
|
|
1916
1973
|
* Version of parameter format.
|
|
1917
1974
|
*/
|
|
1918
|
-
version:
|
|
1975
|
+
version: v52.optional(v52.string()),
|
|
1919
1976
|
/**
|
|
1920
1977
|
* The mode of the post conditions.
|
|
1921
1978
|
*/
|
|
1922
|
-
postConditionMode:
|
|
1979
|
+
postConditionMode: v52.optional(v52.number()),
|
|
1923
1980
|
/**
|
|
1924
1981
|
* A hex-encoded string representing the post conditions.
|
|
1925
1982
|
*
|
|
@@ -1932,29 +1989,29 @@ var stxTransferStxParamsSchema = v40.object({
|
|
|
1932
1989
|
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
1933
1990
|
* ```
|
|
1934
1991
|
*/
|
|
1935
|
-
postConditions:
|
|
1992
|
+
postConditions: v52.optional(v52.array(v52.string())),
|
|
1936
1993
|
/**
|
|
1937
1994
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1938
1995
|
* when not provided.
|
|
1939
1996
|
*/
|
|
1940
|
-
pubkey:
|
|
1997
|
+
pubkey: v52.optional(v52.string())
|
|
1941
1998
|
});
|
|
1942
|
-
var stxTransferStxResultSchema =
|
|
1999
|
+
var stxTransferStxResultSchema = v52.object({
|
|
1943
2000
|
/**
|
|
1944
2001
|
* The ID of the transaction.
|
|
1945
2002
|
*/
|
|
1946
|
-
txid:
|
|
2003
|
+
txid: v52.string(),
|
|
1947
2004
|
/**
|
|
1948
2005
|
* A Stacks transaction as a hex-encoded string.
|
|
1949
2006
|
*/
|
|
1950
|
-
transaction:
|
|
2007
|
+
transaction: v52.string()
|
|
1951
2008
|
});
|
|
1952
|
-
var stxTransferStxRequestMessageSchema =
|
|
2009
|
+
var stxTransferStxRequestMessageSchema = v52.object({
|
|
1953
2010
|
...rpcRequestMessageSchema.entries,
|
|
1954
|
-
...
|
|
1955
|
-
method:
|
|
2011
|
+
...v52.object({
|
|
2012
|
+
method: v52.literal(stxTransferStxMethodName),
|
|
1956
2013
|
params: stxTransferStxParamsSchema,
|
|
1957
|
-
id:
|
|
2014
|
+
id: v52.string()
|
|
1958
2015
|
}).entries
|
|
1959
2016
|
});
|
|
1960
2017
|
|
|
@@ -1962,13 +2019,13 @@ var stxTransferStxRequestMessageSchema = v40.object({
|
|
|
1962
2019
|
var cache = {};
|
|
1963
2020
|
var requestInternal = async (provider, method, params) => {
|
|
1964
2021
|
const response = await provider.request(method, params);
|
|
1965
|
-
if (
|
|
2022
|
+
if (v53.is(rpcErrorResponseMessageSchema, response)) {
|
|
1966
2023
|
return {
|
|
1967
2024
|
status: "error",
|
|
1968
2025
|
error: response.error
|
|
1969
2026
|
};
|
|
1970
2027
|
}
|
|
1971
|
-
if (
|
|
2028
|
+
if (v53.is(rpcSuccessResponseMessageSchema, response)) {
|
|
1972
2029
|
return {
|
|
1973
2030
|
status: "success",
|
|
1974
2031
|
result: response.result
|
|
@@ -3105,6 +3162,10 @@ var signMultipleTransactions = async (options) => {
|
|
|
3105
3162
|
isProviderInstalled,
|
|
3106
3163
|
networkChangeEventName,
|
|
3107
3164
|
networkChangeSchema,
|
|
3165
|
+
openReceiveMethodName,
|
|
3166
|
+
openReceiveParamsSchema,
|
|
3167
|
+
openReceiveRequestMessageSchema,
|
|
3168
|
+
openReceiveResultSchema,
|
|
3108
3169
|
permission,
|
|
3109
3170
|
removeDefaultProvider,
|
|
3110
3171
|
renouncePermissionsMethodName,
|