@sats-connect/core 0.4.0-d60f0ef → 0.4.0-de32322
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 +391 -155
- package/dist/index.d.ts +391 -155
- package/dist/index.js +562 -208
- package/dist/index.mjs +534 -208
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -42,15 +42,15 @@ type SignMessageOptions = RequestOptions<SignMessagePayload, SignMessageResponse
|
|
|
42
42
|
|
|
43
43
|
declare const signMessage: (options: SignMessageOptions) => Promise<void>;
|
|
44
44
|
|
|
45
|
-
interface Recipient
|
|
45
|
+
interface Recipient {
|
|
46
46
|
address: string;
|
|
47
47
|
amountSats: bigint;
|
|
48
48
|
}
|
|
49
|
-
type SerializedRecipient = Omit<Recipient
|
|
49
|
+
type SerializedRecipient = Omit<Recipient, 'amountSats'> & {
|
|
50
50
|
amountSats: string;
|
|
51
51
|
};
|
|
52
52
|
interface SendBtcTransactionPayload extends RequestPayload {
|
|
53
|
-
recipients: Recipient
|
|
53
|
+
recipients: Recipient[];
|
|
54
54
|
senderAddress: string;
|
|
55
55
|
message?: string;
|
|
56
56
|
}
|
|
@@ -313,9 +313,9 @@ declare const addressSchema: v.ObjectSchema<{
|
|
|
313
313
|
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
314
314
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
315
315
|
}, undefined>;
|
|
316
|
-
type Address
|
|
316
|
+
type Address = v.InferOutput<typeof addressSchema>;
|
|
317
317
|
interface GetAddressResponse {
|
|
318
|
-
addresses: Address
|
|
318
|
+
addresses: Address[];
|
|
319
319
|
}
|
|
320
320
|
type GetAddressOptions = RequestOptions<GetAddressPayload, GetAddressResponse>;
|
|
321
321
|
|
|
@@ -489,33 +489,60 @@ declare const sendTransferRequestMessageSchema: v.ObjectSchema<{
|
|
|
489
489
|
readonly id: v.StringSchema<undefined>;
|
|
490
490
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
491
491
|
}, undefined>;
|
|
492
|
+
type SendTransferRequestMessage = v.InferOutput<typeof sendTransferRequestMessageSchema>;
|
|
492
493
|
type SendTransfer = MethodParamsAndResult<SendTransferParams, SendTransferResult>;
|
|
493
|
-
|
|
494
|
+
declare const signPsbtMethodName = "signPsbt";
|
|
495
|
+
declare const signPsbtParamsSchema: v.ObjectSchema<{
|
|
494
496
|
/**
|
|
495
497
|
* The base64 encoded PSBT to sign.
|
|
496
498
|
*/
|
|
497
|
-
psbt:
|
|
499
|
+
readonly psbt: v.StringSchema<undefined>;
|
|
498
500
|
/**
|
|
499
501
|
* The inputs to sign.
|
|
500
502
|
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
501
503
|
*/
|
|
502
|
-
signInputs:
|
|
504
|
+
readonly signInputs: v.RecordSchema<v.StringSchema<undefined>, v.ArraySchema<v.NumberSchema<undefined>, undefined>, undefined>;
|
|
505
|
+
readonly allowedSignHash: v.OptionalSchema<v.NumberSchema<undefined>, never>;
|
|
503
506
|
/**
|
|
504
507
|
* Whether to broadcast the transaction after signing.
|
|
505
508
|
**/
|
|
506
|
-
broadcast
|
|
507
|
-
}
|
|
508
|
-
type
|
|
509
|
+
readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, never>;
|
|
510
|
+
}, undefined>;
|
|
511
|
+
type SignPsbtParams = v.InferOutput<typeof signPsbtParamsSchema>;
|
|
512
|
+
declare const signPsbtResultSchema: v.ObjectSchema<{
|
|
509
513
|
/**
|
|
510
514
|
* The base64 encoded PSBT after signing.
|
|
511
515
|
*/
|
|
512
|
-
psbt:
|
|
516
|
+
readonly psbt: v.StringSchema<undefined>;
|
|
513
517
|
/**
|
|
514
518
|
* The transaction id as a hex-encoded string.
|
|
515
519
|
* This is only returned if the transaction was broadcast.
|
|
516
520
|
**/
|
|
517
|
-
txid
|
|
518
|
-
}
|
|
521
|
+
readonly txid: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
522
|
+
}, undefined>;
|
|
523
|
+
type SignPsbtResult = v.InferOutput<typeof signPsbtResultSchema>;
|
|
524
|
+
declare const signPsbtRequestMessageSchema: v.ObjectSchema<{
|
|
525
|
+
readonly method: v.LiteralSchema<"signPsbt", undefined>;
|
|
526
|
+
readonly params: v.ObjectSchema<{
|
|
527
|
+
/**
|
|
528
|
+
* The base64 encoded PSBT to sign.
|
|
529
|
+
*/
|
|
530
|
+
readonly psbt: v.StringSchema<undefined>;
|
|
531
|
+
/**
|
|
532
|
+
* The inputs to sign.
|
|
533
|
+
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
534
|
+
*/
|
|
535
|
+
readonly signInputs: v.RecordSchema<v.StringSchema<undefined>, v.ArraySchema<v.NumberSchema<undefined>, undefined>, undefined>;
|
|
536
|
+
readonly allowedSignHash: v.OptionalSchema<v.NumberSchema<undefined>, never>;
|
|
537
|
+
/**
|
|
538
|
+
* Whether to broadcast the transaction after signing.
|
|
539
|
+
**/
|
|
540
|
+
readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, never>;
|
|
541
|
+
}, undefined>;
|
|
542
|
+
readonly id: v.StringSchema<undefined>;
|
|
543
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
544
|
+
}, undefined>;
|
|
545
|
+
type SignPsbtRequestMessage = v.InferOutput<typeof signPsbtRequestMessageSchema>;
|
|
519
546
|
type SignPsbt = MethodParamsAndResult<SignPsbtParams, SignPsbtResult>;
|
|
520
547
|
declare const getAccountsMethodName = "getAccounts";
|
|
521
548
|
declare const getAccountsParamsSchema: v.ObjectSchema<{
|
|
@@ -807,127 +834,21 @@ declare const TransferRunesResultSchema: v.ObjectSchema<{
|
|
|
807
834
|
type TransferRunesResult = v.InferOutput<typeof TransferRunesResultSchema>;
|
|
808
835
|
type TransferRunes = MethodParamsAndResult<TransferRunesParams, TransferRunesResult>;
|
|
809
836
|
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
* When sending a transfer STX request to a wallet, users can generally
|
|
813
|
-
* choose from which accout they want to send the STX tokens from. In
|
|
814
|
-
* cases where applications want the transfer to be made from a specific
|
|
815
|
-
* account, they can provide the `pubkey` of the address they'd like the
|
|
816
|
-
* transfer to be made from. It is up to wallet providers to handle this
|
|
817
|
-
* field as they see fit.
|
|
818
|
-
*/
|
|
819
|
-
pubkey: string;
|
|
820
|
-
}
|
|
821
|
-
interface Address {
|
|
822
|
-
/**
|
|
823
|
-
* A Crockford base-32 encoded Stacks address.
|
|
824
|
-
*/
|
|
825
|
-
address: string;
|
|
826
|
-
}
|
|
827
|
-
interface PostConditions {
|
|
828
|
-
/**
|
|
829
|
-
* A hex-encoded string representing the post conditions.
|
|
830
|
-
*
|
|
831
|
-
* A post condition may be converted to it's hex representation using the `serializePostCondition` helper from the `@stacks/transactions` package,
|
|
832
|
-
*
|
|
833
|
-
* ```js
|
|
834
|
-
* import { serializePostCondition } from '@stacks/transactions';
|
|
835
|
-
*
|
|
836
|
-
* const postCondition = somePostCondition;
|
|
837
|
-
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
838
|
-
* ```
|
|
839
|
-
*/
|
|
840
|
-
postConditions: Array<string>;
|
|
841
|
-
}
|
|
842
|
-
interface PostConditionMode {
|
|
843
|
-
/**
|
|
844
|
-
* The mode of the post conditions.
|
|
845
|
-
*/
|
|
846
|
-
postConditionMode: number;
|
|
847
|
-
}
|
|
848
|
-
interface ParameterFormatVersion {
|
|
849
|
-
/**
|
|
850
|
-
* Version of parameter format.
|
|
851
|
-
*/
|
|
852
|
-
version: string;
|
|
853
|
-
}
|
|
854
|
-
interface Recipient {
|
|
855
|
-
/**
|
|
856
|
-
* The recipeint's Crockford base-32 encoded Stacks address.
|
|
857
|
-
*/
|
|
858
|
-
recipient: string;
|
|
859
|
-
}
|
|
860
|
-
interface Amount {
|
|
861
|
-
/**
|
|
862
|
-
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
863
|
-
* parseable by `BigInt` is acceptable.
|
|
864
|
-
*
|
|
865
|
-
* Example,
|
|
866
|
-
*
|
|
867
|
-
* ```js
|
|
868
|
-
* const amount1 = 1234;
|
|
869
|
-
* const amount2 = 1234n;
|
|
870
|
-
* const amount3 = '1234';
|
|
871
|
-
* ```
|
|
872
|
-
*/
|
|
873
|
-
amount: number | string;
|
|
874
|
-
}
|
|
875
|
-
interface Memo {
|
|
876
|
-
/**
|
|
877
|
-
* A string representing the memo.
|
|
878
|
-
*/
|
|
879
|
-
memo: string;
|
|
880
|
-
}
|
|
881
|
-
interface TxId {
|
|
882
|
-
/**
|
|
883
|
-
* The ID of the transaction.
|
|
884
|
-
*/
|
|
885
|
-
txid: string;
|
|
886
|
-
}
|
|
887
|
-
interface Transaction {
|
|
888
|
-
/**
|
|
889
|
-
* A Stacks transaction as a hex-encoded string.
|
|
890
|
-
*/
|
|
891
|
-
transaction: string;
|
|
892
|
-
}
|
|
893
|
-
interface Message {
|
|
894
|
-
/**
|
|
895
|
-
* Message payload to be signed.
|
|
896
|
-
*/
|
|
897
|
-
message: string;
|
|
898
|
-
}
|
|
899
|
-
interface Signature {
|
|
900
|
-
/**
|
|
901
|
-
* Signature of the message.
|
|
902
|
-
*/
|
|
903
|
-
signature: string;
|
|
904
|
-
}
|
|
905
|
-
interface PublicKey {
|
|
837
|
+
declare const stxCallContractMethodName = "stx_callContract";
|
|
838
|
+
declare const stxCallContractParamsSchema: v.ObjectSchema<{
|
|
906
839
|
/**
|
|
907
|
-
*
|
|
908
|
-
*/
|
|
909
|
-
publicKey: string;
|
|
910
|
-
}
|
|
911
|
-
interface Domain {
|
|
912
|
-
/**
|
|
913
|
-
* The domain to be signed.
|
|
914
|
-
*/
|
|
915
|
-
domain: string;
|
|
916
|
-
}
|
|
917
|
-
interface CallContractParams {
|
|
918
|
-
/**
|
|
919
|
-
* The contract's Crockford base-32 encoded Stacks address and name.
|
|
840
|
+
* The contract principal.
|
|
920
841
|
*
|
|
921
842
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
922
843
|
*/
|
|
923
|
-
contract:
|
|
844
|
+
readonly contract: v.StringSchema<undefined>;
|
|
924
845
|
/**
|
|
925
846
|
* The name of the function to call.
|
|
926
847
|
*
|
|
927
848
|
* Note: spec changes ongoing,
|
|
928
849
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
929
850
|
*/
|
|
930
|
-
functionName:
|
|
851
|
+
readonly functionName: v.StringSchema<undefined>;
|
|
931
852
|
/**
|
|
932
853
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
933
854
|
* strings of Clarity values.
|
|
@@ -942,42 +863,131 @@ interface CallContractParams {
|
|
|
942
863
|
* const hexArgs = functionArgs.map(cvToString);
|
|
943
864
|
* ```
|
|
944
865
|
*/
|
|
945
|
-
arguments
|
|
946
|
-
}
|
|
947
|
-
type
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
866
|
+
readonly arguments: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, never>;
|
|
867
|
+
}, undefined>;
|
|
868
|
+
type StxCallContractParams = v.InferOutput<typeof stxCallContractParamsSchema>;
|
|
869
|
+
declare const stxCallContractResultSchema: v.ObjectSchema<{
|
|
870
|
+
/**
|
|
871
|
+
* The ID of the transaction.
|
|
872
|
+
*/
|
|
873
|
+
readonly txid: v.StringSchema<undefined>;
|
|
874
|
+
/**
|
|
875
|
+
* A Stacks transaction as a hex-encoded string.
|
|
876
|
+
*/
|
|
877
|
+
readonly transaction: v.StringSchema<undefined>;
|
|
878
|
+
}, undefined>;
|
|
879
|
+
type StxCallContractResult = v.InferOutput<typeof stxCallContractResultSchema>;
|
|
880
|
+
declare const stxCallContractRequestMessageSchema: v.ObjectSchema<{
|
|
881
|
+
readonly method: v.LiteralSchema<"stx_callContract", undefined>;
|
|
882
|
+
readonly params: v.ObjectSchema<{
|
|
883
|
+
/**
|
|
884
|
+
* The contract principal.
|
|
885
|
+
*
|
|
886
|
+
* E.g. `"SPKE...GD5C.my-contract"`
|
|
887
|
+
*/
|
|
888
|
+
readonly contract: v.StringSchema<undefined>;
|
|
889
|
+
/**
|
|
890
|
+
* The name of the function to call.
|
|
891
|
+
*
|
|
892
|
+
* Note: spec changes ongoing,
|
|
893
|
+
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
894
|
+
*/
|
|
895
|
+
readonly functionName: v.StringSchema<undefined>;
|
|
896
|
+
/**
|
|
897
|
+
* The function's arguments. The arguments are expected to be hex-encoded
|
|
898
|
+
* strings of Clarity values.
|
|
899
|
+
*
|
|
900
|
+
* To convert Clarity values to their hex representation, the `cvToString`
|
|
901
|
+
* helper from the `@stacks/transactions` package may be helpful.
|
|
902
|
+
*
|
|
903
|
+
* ```js
|
|
904
|
+
* import { cvToString } from '@stacks/transactions';
|
|
905
|
+
*
|
|
906
|
+
* const functionArgs = [someClarityValue1, someClarityValue2];
|
|
907
|
+
* const hexArgs = functionArgs.map(cvToString);
|
|
908
|
+
* ```
|
|
909
|
+
*/
|
|
910
|
+
readonly arguments: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, never>;
|
|
911
|
+
}, undefined>;
|
|
912
|
+
readonly id: v.StringSchema<undefined>;
|
|
913
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
914
|
+
}, undefined>;
|
|
915
|
+
type StxCallContractRequestMessage = v.InferOutput<typeof stxCallContractRequestMessageSchema>;
|
|
916
|
+
type StxCallContract = MethodParamsAndResult<StxCallContractParams, StxCallContractResult>;
|
|
917
|
+
|
|
918
|
+
declare const stxDeployContractMethodName = "stx_deployContract";
|
|
919
|
+
declare const stxDeployContractParamsSchema: v.ObjectSchema<{
|
|
959
920
|
/**
|
|
960
921
|
* Name of the contract.
|
|
961
922
|
*/
|
|
962
|
-
name:
|
|
923
|
+
readonly name: v.StringSchema<undefined>;
|
|
963
924
|
/**
|
|
964
|
-
* The code of the Clarity contract.
|
|
925
|
+
* The source code of the Clarity contract.
|
|
965
926
|
*/
|
|
966
|
-
clarityCode:
|
|
927
|
+
readonly clarityCode: v.StringSchema<undefined>;
|
|
967
928
|
/**
|
|
968
929
|
* The version of the Clarity contract.
|
|
969
930
|
*/
|
|
970
|
-
clarityVersion
|
|
971
|
-
}
|
|
972
|
-
type
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
931
|
+
readonly clarityVersion: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
932
|
+
}, undefined>;
|
|
933
|
+
type StxDeployContractParams = v.InferOutput<typeof stxDeployContractParamsSchema>;
|
|
934
|
+
declare const stxDeployContractResultSchema: v.ObjectSchema<{
|
|
935
|
+
/**
|
|
936
|
+
* The ID of the transaction.
|
|
937
|
+
*/
|
|
938
|
+
readonly txid: v.StringSchema<undefined>;
|
|
939
|
+
/**
|
|
940
|
+
* A Stacks transaction as a hex-encoded string.
|
|
941
|
+
*/
|
|
942
|
+
readonly transaction: v.StringSchema<undefined>;
|
|
943
|
+
}, undefined>;
|
|
944
|
+
type StxDeployContractResult = v.InferOutput<typeof stxDeployContractResultSchema>;
|
|
945
|
+
declare const stxDeployContractRequestMessageSchema: v.ObjectSchema<{
|
|
946
|
+
readonly method: v.LiteralSchema<"stx_deployContract", undefined>;
|
|
947
|
+
readonly params: v.ObjectSchema<{
|
|
948
|
+
/**
|
|
949
|
+
* Name of the contract.
|
|
950
|
+
*/
|
|
951
|
+
readonly name: v.StringSchema<undefined>;
|
|
952
|
+
/**
|
|
953
|
+
* The source code of the Clarity contract.
|
|
954
|
+
*/
|
|
955
|
+
readonly clarityCode: v.StringSchema<undefined>;
|
|
956
|
+
/**
|
|
957
|
+
* The version of the Clarity contract.
|
|
958
|
+
*/
|
|
959
|
+
readonly clarityVersion: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
960
|
+
}, undefined>;
|
|
961
|
+
readonly id: v.StringSchema<undefined>;
|
|
962
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
963
|
+
}, undefined>;
|
|
964
|
+
type StxDeployContractRequestMessage = v.InferOutput<typeof stxDeployContractRequestMessageSchema>;
|
|
965
|
+
type StxDeployContract = MethodParamsAndResult<StxDeployContractParams, StxDeployContractResult>;
|
|
966
|
+
|
|
967
|
+
declare const stxGetAccountsMethodName = "stx_getAccounts";
|
|
968
|
+
declare const stxGetAccountsParamsSchema: v.NullishSchema<v.NullSchema<undefined>, never>;
|
|
969
|
+
type StxGetAccountsParams = v.InferOutput<typeof stxGetAccountsParamsSchema>;
|
|
970
|
+
declare const stxGetAccountsResultSchema: v.ObjectSchema<{
|
|
971
|
+
/**
|
|
972
|
+
* The addresses generated for the given purposes.
|
|
973
|
+
*/
|
|
974
|
+
readonly addresses: v.ArraySchema<v.ObjectSchema<{
|
|
975
|
+
readonly address: v.StringSchema<undefined>;
|
|
976
|
+
readonly publicKey: v.StringSchema<undefined>;
|
|
977
|
+
readonly gaiaHubUrl: v.StringSchema<undefined>;
|
|
978
|
+
readonly gaiaAppKey: v.StringSchema<undefined>;
|
|
979
|
+
}, undefined>, undefined>;
|
|
980
|
+
}, undefined>;
|
|
981
|
+
type StxGetAccountsResult = v.InferOutput<typeof stxGetAccountsResultSchema>;
|
|
982
|
+
declare const stxGetAccountsRequestMessageSchema: v.ObjectSchema<{
|
|
983
|
+
readonly method: v.LiteralSchema<"stx_getAccounts", undefined>;
|
|
984
|
+
readonly params: v.NullishSchema<v.NullSchema<undefined>, never>;
|
|
985
|
+
readonly id: v.StringSchema<undefined>;
|
|
986
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
987
|
+
}, undefined>;
|
|
988
|
+
type StxGetAccountsRequestMessage = v.InferOutput<typeof stxGetAccountsRequestMessageSchema>;
|
|
989
|
+
type StxGetAccounts = MethodParamsAndResult<StxGetAccountsParams, StxGetAccountsResult>;
|
|
990
|
+
|
|
981
991
|
declare const stxGetAddressesMethodName = "stx_getAddresses";
|
|
982
992
|
declare const stxGetAddressesParamsSchema: v.NullishSchema<v.ObjectSchema<{
|
|
983
993
|
/**
|
|
@@ -1011,6 +1021,113 @@ declare const stxGetAddressesRequestMessageSchema: v.ObjectSchema<{
|
|
|
1011
1021
|
}, undefined>;
|
|
1012
1022
|
type StxGetAddressesRequestMessage = v.InferOutput<typeof stxGetAddressesRequestMessageSchema>;
|
|
1013
1023
|
type StxGetAddresses = MethodParamsAndResult<v.InferOutput<typeof stxGetAddressesParamsSchema>, v.InferOutput<typeof stxGetAddressesResultSchema>>;
|
|
1024
|
+
|
|
1025
|
+
declare const stxSignMessageMethodName = "stx_signMessage";
|
|
1026
|
+
declare const stxSignMessageParamsSchema: v.ObjectSchema<{
|
|
1027
|
+
/**
|
|
1028
|
+
* The message to sign.
|
|
1029
|
+
*/
|
|
1030
|
+
readonly message: v.StringSchema<undefined>;
|
|
1031
|
+
/**
|
|
1032
|
+
* The public key to sign the message with.
|
|
1033
|
+
*/
|
|
1034
|
+
readonly publicKey: v.StringSchema<undefined>;
|
|
1035
|
+
/**
|
|
1036
|
+
* The format version of the parameter.
|
|
1037
|
+
*/
|
|
1038
|
+
readonly parameterFormatVersion: v.OptionalSchema<v.NumberSchema<undefined>, never>;
|
|
1039
|
+
}, undefined>;
|
|
1040
|
+
type StxSignMessageParams = v.InferOutput<typeof stxSignMessageParamsSchema>;
|
|
1041
|
+
declare const stxSignMessageResultSchema: v.ObjectSchema<{
|
|
1042
|
+
/**
|
|
1043
|
+
* The signature of the message.
|
|
1044
|
+
*/
|
|
1045
|
+
readonly signature: v.StringSchema<undefined>;
|
|
1046
|
+
/**
|
|
1047
|
+
* The public key used to sign the message.
|
|
1048
|
+
*/
|
|
1049
|
+
readonly publicKey: v.StringSchema<undefined>;
|
|
1050
|
+
}, undefined>;
|
|
1051
|
+
type StxSignMessageResult = v.InferOutput<typeof stxSignMessageResultSchema>;
|
|
1052
|
+
declare const stxSignMessageRequestMessageSchema: v.ObjectSchema<{
|
|
1053
|
+
readonly method: v.LiteralSchema<"stx_signMessage", undefined>;
|
|
1054
|
+
readonly params: v.ObjectSchema<{
|
|
1055
|
+
/**
|
|
1056
|
+
* The message to sign.
|
|
1057
|
+
*/
|
|
1058
|
+
readonly message: v.StringSchema<undefined>;
|
|
1059
|
+
/**
|
|
1060
|
+
* The public key to sign the message with.
|
|
1061
|
+
*/
|
|
1062
|
+
readonly publicKey: v.StringSchema<undefined>;
|
|
1063
|
+
/**
|
|
1064
|
+
* The format version of the parameter.
|
|
1065
|
+
*/
|
|
1066
|
+
readonly parameterFormatVersion: v.OptionalSchema<v.NumberSchema<undefined>, never>;
|
|
1067
|
+
}, undefined>;
|
|
1068
|
+
readonly id: v.StringSchema<undefined>;
|
|
1069
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1070
|
+
}, undefined>;
|
|
1071
|
+
type StxSignMessageRequestMessage = v.InferOutput<typeof stxSignMessageRequestMessageSchema>;
|
|
1072
|
+
type StxSignMessage = MethodParamsAndResult<StxSignMessageParams, StxSignMessageResult>;
|
|
1073
|
+
|
|
1074
|
+
declare const stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
1075
|
+
declare const stxSignStructuredMessageParamsSchema: v.ObjectSchema<{
|
|
1076
|
+
/**
|
|
1077
|
+
* The domain to be signed.
|
|
1078
|
+
*/
|
|
1079
|
+
readonly domain: v.StringSchema<undefined>;
|
|
1080
|
+
/**
|
|
1081
|
+
* Message payload to be signed.
|
|
1082
|
+
*/
|
|
1083
|
+
readonly message: v.StringSchema<undefined>;
|
|
1084
|
+
/**
|
|
1085
|
+
* The format version of the parameter.
|
|
1086
|
+
*/
|
|
1087
|
+
readonly parameterFormatVersion: v.OptionalSchema<v.NumberSchema<undefined>, never>;
|
|
1088
|
+
/**
|
|
1089
|
+
* The public key to sign the message with.
|
|
1090
|
+
*/
|
|
1091
|
+
readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
1092
|
+
}, undefined>;
|
|
1093
|
+
type StxSignStructuredMessageParams = v.InferOutput<typeof stxSignStructuredMessageParamsSchema>;
|
|
1094
|
+
declare const stxSignStructuredMessageResultSchema: v.ObjectSchema<{
|
|
1095
|
+
/**
|
|
1096
|
+
* Signature of the message.
|
|
1097
|
+
*/
|
|
1098
|
+
readonly signature: v.StringSchema<undefined>;
|
|
1099
|
+
/**
|
|
1100
|
+
* Public key as hex-encoded string.
|
|
1101
|
+
*/
|
|
1102
|
+
readonly publicKey: v.StringSchema<undefined>;
|
|
1103
|
+
}, undefined>;
|
|
1104
|
+
type StxSignStructuredMessageResult = v.InferOutput<typeof stxSignStructuredMessageResultSchema>;
|
|
1105
|
+
declare const stxSignStructuredMessageRequestMessageSchema: v.ObjectSchema<{
|
|
1106
|
+
readonly method: v.LiteralSchema<"stx_signStructuredMessage", undefined>;
|
|
1107
|
+
readonly params: v.ObjectSchema<{
|
|
1108
|
+
/**
|
|
1109
|
+
* The domain to be signed.
|
|
1110
|
+
*/
|
|
1111
|
+
readonly domain: v.StringSchema<undefined>;
|
|
1112
|
+
/**
|
|
1113
|
+
* Message payload to be signed.
|
|
1114
|
+
*/
|
|
1115
|
+
readonly message: v.StringSchema<undefined>;
|
|
1116
|
+
/**
|
|
1117
|
+
* The format version of the parameter.
|
|
1118
|
+
*/
|
|
1119
|
+
readonly parameterFormatVersion: v.OptionalSchema<v.NumberSchema<undefined>, never>;
|
|
1120
|
+
/**
|
|
1121
|
+
* The public key to sign the message with.
|
|
1122
|
+
*/
|
|
1123
|
+
readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
1124
|
+
}, undefined>;
|
|
1125
|
+
readonly id: v.StringSchema<undefined>;
|
|
1126
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1127
|
+
}, undefined>;
|
|
1128
|
+
type StxSignStructuredMessageRequestMessage = v.InferOutput<typeof stxSignStructuredMessageRequestMessageSchema>;
|
|
1129
|
+
type StxSignStructuredMessage = MethodParamsAndResult<StxSignStructuredMessageParams, StxSignStructuredMessageResult>;
|
|
1130
|
+
|
|
1014
1131
|
declare const stxSignTransactionMethodName = "stx_signTransaction";
|
|
1015
1132
|
declare const stxSignTransactionParamsSchema: v.ObjectSchema<{
|
|
1016
1133
|
/**
|
|
@@ -1058,6 +1175,125 @@ declare const stxSignTransactionRequestMessageSchema: v.ObjectSchema<{
|
|
|
1058
1175
|
type StxSignTransactionRequestMessage = v.InferOutput<typeof stxSignTransactionRequestMessageSchema>;
|
|
1059
1176
|
type StxSignTransaction = MethodParamsAndResult<StxSignTransactionParams, StxSignTransactionResult>;
|
|
1060
1177
|
|
|
1178
|
+
declare const stxTransferStxMethodName = "stx_transferStx";
|
|
1179
|
+
declare const stxTransferStxParamsSchema: v.ObjectSchema<{
|
|
1180
|
+
/**
|
|
1181
|
+
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
1182
|
+
* parseable by `BigInt` is acceptable.
|
|
1183
|
+
*
|
|
1184
|
+
* Example,
|
|
1185
|
+
*
|
|
1186
|
+
* ```js
|
|
1187
|
+
* const amount1 = 1234;
|
|
1188
|
+
* const amount2 = 1234n;
|
|
1189
|
+
* const amount3 = '1234';
|
|
1190
|
+
* ```
|
|
1191
|
+
*/
|
|
1192
|
+
readonly amount: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
|
|
1193
|
+
/**
|
|
1194
|
+
* The recipeint's principal.
|
|
1195
|
+
*/
|
|
1196
|
+
readonly recipient: v.StringSchema<undefined>;
|
|
1197
|
+
/**
|
|
1198
|
+
* A string representing the memo.
|
|
1199
|
+
*/
|
|
1200
|
+
readonly memo: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
1201
|
+
/**
|
|
1202
|
+
* Version of parameter format.
|
|
1203
|
+
*/
|
|
1204
|
+
readonly version: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
1205
|
+
/**
|
|
1206
|
+
* The mode of the post conditions.
|
|
1207
|
+
*/
|
|
1208
|
+
readonly postConditionMode: v.OptionalSchema<v.NumberSchema<undefined>, never>;
|
|
1209
|
+
/**
|
|
1210
|
+
* A hex-encoded string representing the post conditions.
|
|
1211
|
+
*
|
|
1212
|
+
* A post condition may be converted to it's hex representation using the `serializePostCondition` helper from the `@stacks/transactions` package,
|
|
1213
|
+
*
|
|
1214
|
+
* ```js
|
|
1215
|
+
* import { serializePostCondition } from '@stacks/transactions';
|
|
1216
|
+
*
|
|
1217
|
+
* const postCondition = somePostCondition;
|
|
1218
|
+
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
1219
|
+
* ```
|
|
1220
|
+
*/
|
|
1221
|
+
readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, never>;
|
|
1222
|
+
/**
|
|
1223
|
+
* The public key to sign the transaction with. The wallet may use any key
|
|
1224
|
+
* when not provided.
|
|
1225
|
+
*/
|
|
1226
|
+
readonly pubkey: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
1227
|
+
}, undefined>;
|
|
1228
|
+
type StxTransferStxParams = v.InferOutput<typeof stxTransferStxParamsSchema>;
|
|
1229
|
+
declare const stxTransferStxResultSchema: v.ObjectSchema<{
|
|
1230
|
+
/**
|
|
1231
|
+
* The ID of the transaction.
|
|
1232
|
+
*/
|
|
1233
|
+
readonly txid: v.StringSchema<undefined>;
|
|
1234
|
+
/**
|
|
1235
|
+
* A Stacks transaction as a hex-encoded string.
|
|
1236
|
+
*/
|
|
1237
|
+
readonly transaction: v.StringSchema<undefined>;
|
|
1238
|
+
}, undefined>;
|
|
1239
|
+
type StxTransferStxResult = v.InferOutput<typeof stxTransferStxResultSchema>;
|
|
1240
|
+
declare const stxTransferStxRequestMessageSchema: v.ObjectSchema<{
|
|
1241
|
+
readonly method: v.LiteralSchema<"stx_transferStx", undefined>;
|
|
1242
|
+
readonly params: v.ObjectSchema<{
|
|
1243
|
+
/**
|
|
1244
|
+
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
1245
|
+
* parseable by `BigInt` is acceptable.
|
|
1246
|
+
*
|
|
1247
|
+
* Example,
|
|
1248
|
+
*
|
|
1249
|
+
* ```js
|
|
1250
|
+
* const amount1 = 1234;
|
|
1251
|
+
* const amount2 = 1234n;
|
|
1252
|
+
* const amount3 = '1234';
|
|
1253
|
+
* ```
|
|
1254
|
+
*/
|
|
1255
|
+
readonly amount: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
|
|
1256
|
+
/**
|
|
1257
|
+
* The recipeint's principal.
|
|
1258
|
+
*/
|
|
1259
|
+
readonly recipient: v.StringSchema<undefined>;
|
|
1260
|
+
/**
|
|
1261
|
+
* A string representing the memo.
|
|
1262
|
+
*/
|
|
1263
|
+
readonly memo: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
1264
|
+
/**
|
|
1265
|
+
* Version of parameter format.
|
|
1266
|
+
*/
|
|
1267
|
+
readonly version: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
1268
|
+
/**
|
|
1269
|
+
* The mode of the post conditions.
|
|
1270
|
+
*/
|
|
1271
|
+
readonly postConditionMode: v.OptionalSchema<v.NumberSchema<undefined>, never>;
|
|
1272
|
+
/**
|
|
1273
|
+
* A hex-encoded string representing the post conditions.
|
|
1274
|
+
*
|
|
1275
|
+
* A post condition may be converted to it's hex representation using the `serializePostCondition` helper from the `@stacks/transactions` package,
|
|
1276
|
+
*
|
|
1277
|
+
* ```js
|
|
1278
|
+
* import { serializePostCondition } from '@stacks/transactions';
|
|
1279
|
+
*
|
|
1280
|
+
* const postCondition = somePostCondition;
|
|
1281
|
+
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
1282
|
+
* ```
|
|
1283
|
+
*/
|
|
1284
|
+
readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, never>;
|
|
1285
|
+
/**
|
|
1286
|
+
* The public key to sign the transaction with. The wallet may use any key
|
|
1287
|
+
* when not provided.
|
|
1288
|
+
*/
|
|
1289
|
+
readonly pubkey: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
1290
|
+
}, undefined>;
|
|
1291
|
+
readonly id: v.StringSchema<undefined>;
|
|
1292
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1293
|
+
}, undefined>;
|
|
1294
|
+
type StxTransferStxRequestMessage = v.InferOutput<typeof stxTransferStxRequestMessageSchema>;
|
|
1295
|
+
type StxTransferStx = MethodParamsAndResult<StxTransferStxParams, StxTransferStxResult>;
|
|
1296
|
+
|
|
1061
1297
|
/**
|
|
1062
1298
|
* Permissions with the clientId field omitted and optional actions. Used for
|
|
1063
1299
|
* permission requests, since the wallet performs authentication based on the
|
|
@@ -1553,7 +1789,7 @@ interface StxRequests {
|
|
|
1553
1789
|
stx_deployContract: StxDeployContract;
|
|
1554
1790
|
stx_getAccounts: StxGetAccounts;
|
|
1555
1791
|
stx_getAddresses: StxGetAddresses;
|
|
1556
|
-
stx_signMessage:
|
|
1792
|
+
stx_signMessage: StxSignMessage;
|
|
1557
1793
|
stx_signStructuredMessage: StxSignStructuredMessage;
|
|
1558
1794
|
stx_signTransaction: StxSignTransaction;
|
|
1559
1795
|
stx_transferStx: StxTransferStx;
|
|
@@ -1623,4 +1859,4 @@ declare class BaseAdapter extends SatsConnectAdapter {
|
|
|
1623
1859
|
declare const DefaultAdaptersInfo: Record<string, Provider>;
|
|
1624
1860
|
declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
|
|
1625
1861
|
|
|
1626
|
-
export { type AccountChangeEvent, type AddListener, type Address
|
|
1862
|
+
export { type AccountChangeEvent, type AddListener, type Address, AddressPurpose, AddressType, BaseAdapter, type BitcoinNetwork, BitcoinNetworkType, type BitcoinProvider, type BtcRequestMethod, type BtcRequests, type Capability, type Connect, type ConnectParams, type ConnectRequestMessage, type ConnectResult, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type Disconnect, type DisconnectEvent, type DisconnectParams, type DisconnectRequestMessage, type DisconnectResult, type EstimateRbfOrder, type EstimateRunesEtch, type EstimateRunesEtchParams, type EstimateRunesEtchResult, type EstimateRunesMint, type EstimateRunesMintParams, type EstimateRunesMintResult, type EtchRunes, type EtchRunesParams, type EtchRunesResult, type GetAccount, type GetAccountParams, type GetAccountRequestMessage, type GetAccountResult, type GetAccounts, type GetAccountsParams, type GetAccountsRequestMessage, type GetAccountsResult, type GetAddressOptions, type GetAddressPayload, type GetAddressResponse, type GetAddresses, type GetAddressesParams, type GetAddressesRequestMessage, type GetAddressesResult, type GetBalance, type GetBalanceParams, type GetBalanceRequestMessage, type GetBalanceResult, type GetCapabilitiesOptions, type GetCapabilitiesPayload, type GetCapabilitiesResponse, type GetCurrentPermissions, type GetCurrentPermissionsParams, type GetCurrentPermissionsRequestMessage, type GetCurrentPermissionsResult, type GetInfo, type GetInfoParams, type GetInfoRequestMessage, type GetInfoResult, type GetInscriptions, type GetOrder, type GetRunesBalance, type GetRunesBalanceParams, type GetRunesBalanceRequestMessage, type GetRunesBalanceResult, type GetWalletType, type GetWalletTypeParams, type GetWalletTypeRequestMessage, type GetWalletTypeResult, type InputToSign, MessageSigningProtocols, type MethodParamsAndResult, type MintRunes, type MintRunesParams, type MintRunesResult, type NetworkChangeEvent, type OrdinalsRequestMethod, type OrdinalsRequests, type Params, type PermissionWithoutClientId, type Provider, type PsbtPayload, type RbfOrder, type Recipient, type RenouncePermissions, type RenouncePermissionsParams, type RenouncePermissionsRequestMessage, type RenouncePermissionsResult, type RequestOptions, type RequestPayload, type RequestPermissions, type RequestPermissionsParams, type RequestPermissionsRequestMessage, type RequestPermissionsResult, type Requests, type Return, type RpcBase, type RpcError, RpcErrorCode, type RpcErrorResponse, type RpcErrorResponseMessage, type RpcId, RpcIdSchema, type RpcRequest, type RpcRequestMessage, type RpcResponse, type RpcResponseMessage, type RpcResult, type RpcSuccessResponse, type RpcSuccessResponseMessage, type RunesRequestMethod, type RunesRequests, SatsConnectAdapter, type SendBtcTransactionOptions, type SendBtcTransactionPayload, type SendBtcTransactionResponse, type SendInscriptions, type SendTransfer, type SendTransferParams, type SendTransferRequestMessage, type SendTransferResult, type SerializedRecipient, type SerializedSendBtcTransactionPayload, type SignMessage, type SignMessageOptions, type SignMessageParams, type SignMessagePayload, type SignMessageRequestMessage, type SignMessageResponse, type SignMessageResult, type SignMultiplePsbtPayload, type SignMultipleTransactionOptions, type SignMultipleTransactionsPayload, type SignMultipleTransactionsResponse, type SignPsbt, type SignPsbtParams, type SignPsbtRequestMessage, type SignPsbtResult, type SignTransactionOptions, type SignTransactionPayload, type SignTransactionResponse, type StxCallContract, type StxCallContractParams, type StxCallContractRequestMessage, type StxCallContractResult, type StxDeployContract, type StxDeployContractParams, type StxDeployContractRequestMessage, type StxDeployContractResult, type StxGetAccounts, type StxGetAccountsParams, type StxGetAccountsRequestMessage, type StxGetAccountsResult, type StxGetAddresses, type StxGetAddressesParams, type StxGetAddressesRequestMessage, type StxGetAddressesResult, type StxRequestMethod, type StxRequests, type StxSignMessage, type StxSignMessageParams, type StxSignMessageRequestMessage, type StxSignMessageResult, type StxSignStructuredMessage, type StxSignStructuredMessageParams, type StxSignStructuredMessageRequestMessage, type StxSignStructuredMessageResult, type StxSignTransaction, type StxSignTransactionParams, type StxSignTransactionRequestMessage, type StxSignTransactionResult, type StxTransferStx, type StxTransferStxParams, type StxTransferStxRequestMessage, type StxTransferStxResult, type SupportedWallet, type TransferRunes, type TransferRunesParams, type TransferRunesRequest, type TransferRunesResult, TransferRunesResultSchema, type WalletEvent, type WalletRequests, type WalletType, accountChangeEventName, accountChangeSchema, addListener, addressSchema, connectMethodName, connectParamsSchema, connectRequestMessageSchema, connectResultSchema, createInscription, createRepeatInscriptions, defaultAdapters, disconnectEventName, disconnectMethodName, disconnectParamsSchema, disconnectRequestMessageSchema, disconnectResultSchema, disconnectSchema, getAccountMethodName, getAccountParamsSchema, getAccountRequestMessageSchema, getAccountResultSchema, getAccountsMethodName, getAccountsParamsSchema, getAccountsRequestMessageSchema, getAccountsResultSchema, getAddress, getAddressesMethodName, getAddressesParamsSchema, getAddressesRequestMessageSchema, getAddressesResultSchema, getBalanceMethodName, getBalanceParamsSchema, getBalanceRequestMessageSchema, getBalanceResultSchema, getCapabilities, getCurrentPermissionsMethodName, getCurrentPermissionsParamsSchema, getCurrentPermissionsRequestMessageSchema, getCurrentPermissionsResultSchema, getDefaultProvider, getInfoMethodName, getInfoParamsSchema, getInfoRequestMessageSchema, getInfoResultSchema, getInscriptionsMethodName, getInscriptionsParamsSchema, getInscriptionsResultSchema, getInscriptionsSchema, getProviderById, getProviderOrThrow, getProviders, getRunesBalanceMethodName, getRunesBalanceParamsSchema, getRunesBalanceRequestMessageSchema, getRunesBalanceResultSchema, getSupportedWallets, getWalletTypeMethodName, getWalletTypeParamsSchema, getWalletTypeRequestMessageSchema, getWalletTypeResultSchema, isProviderInstalled, networkChangeEventName, networkChangeSchema, permissionTemplate, removeDefaultProvider, renouncePermissionsMethodName, renouncePermissionsParamsSchema, renouncePermissionsRequestMessageSchema, renouncePermissionsResultSchema, request, requestPermissionsMethodName, requestPermissionsParamsSchema, requestPermissionsRequestMessageSchema, requestPermissionsResultSchema, rpcErrorResponseMessageSchema, rpcRequestMessageSchema, rpcResponseMessageSchema, rpcSuccessResponseMessageSchema, sendBtcTransaction, sendInscriptionsMethodName, sendInscriptionsParamsSchema, sendInscriptionsResultSchema, sendInscriptionsSchema, sendTransferMethodName, sendTransferParamsSchema, sendTransferRequestMessageSchema, sendTransferResultSchema, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signPsbtMethodName, signPsbtParamsSchema, signPsbtRequestMessageSchema, signPsbtResultSchema, signTransaction, stxCallContractMethodName, stxCallContractParamsSchema, stxCallContractRequestMessageSchema, stxCallContractResultSchema, stxDeployContractMethodName, stxDeployContractParamsSchema, stxDeployContractRequestMessageSchema, stxDeployContractResultSchema, stxGetAccountsMethodName, stxGetAccountsParamsSchema, stxGetAccountsRequestMessageSchema, stxGetAccountsResultSchema, stxGetAddressesMethodName, stxGetAddressesParamsSchema, stxGetAddressesRequestMessageSchema, stxGetAddressesResultSchema, stxSignMessageMethodName, stxSignMessageParamsSchema, stxSignMessageRequestMessageSchema, stxSignMessageResultSchema, stxSignStructuredMessageMethodName, stxSignStructuredMessageParamsSchema, stxSignStructuredMessageRequestMessageSchema, stxSignStructuredMessageResultSchema, stxSignTransactionMethodName, stxSignTransactionParamsSchema, stxSignTransactionRequestMessageSchema, stxSignTransactionResultSchema, stxTransferStxMethodName, stxTransferStxParamsSchema, stxTransferStxRequestMessageSchema, stxTransferStxResultSchema, transferRunesMethodName, transferRunesParamsSchema, transferRunesRequestSchema, walletEventSchema, walletTypeSchema, walletTypes };
|