@sats-connect/core 0.4.0-6c651d4 → 0.4.0-6fc961d
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 +18 -92
- package/dist/index.d.ts +18 -92
- package/dist/index.js +0 -101
- package/dist/index.mjs +0 -93
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -491,58 +491,32 @@ declare const sendTransferRequestMessageSchema: v.ObjectSchema<{
|
|
|
491
491
|
}, undefined>;
|
|
492
492
|
type SendTransferRequestMessage = v.InferOutput<typeof sendTransferRequestMessageSchema>;
|
|
493
493
|
type SendTransfer = MethodParamsAndResult<SendTransferParams, SendTransferResult>;
|
|
494
|
-
|
|
495
|
-
declare const signPsbtParamsSchema: v.ObjectSchema<{
|
|
494
|
+
type SignPsbtParams = {
|
|
496
495
|
/**
|
|
497
496
|
* The base64 encoded PSBT to sign.
|
|
498
497
|
*/
|
|
499
|
-
|
|
498
|
+
psbt: string;
|
|
500
499
|
/**
|
|
501
500
|
* The inputs to sign.
|
|
502
501
|
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
503
502
|
*/
|
|
504
|
-
|
|
505
|
-
readonly allowedSignHash: v.OptionalSchema<v.NumberSchema<undefined>, never>;
|
|
503
|
+
signInputs: Record<string, number[]>;
|
|
506
504
|
/**
|
|
507
505
|
* Whether to broadcast the transaction after signing.
|
|
508
506
|
**/
|
|
509
|
-
|
|
510
|
-
}
|
|
511
|
-
type
|
|
512
|
-
declare const signPsbtResultSchema: v.ObjectSchema<{
|
|
507
|
+
broadcast?: boolean;
|
|
508
|
+
};
|
|
509
|
+
type SignPsbtResult = {
|
|
513
510
|
/**
|
|
514
511
|
* The base64 encoded PSBT after signing.
|
|
515
512
|
*/
|
|
516
|
-
|
|
513
|
+
psbt: string;
|
|
517
514
|
/**
|
|
518
515
|
* The transaction id as a hex-encoded string.
|
|
519
516
|
* This is only returned if the transaction was broadcast.
|
|
520
517
|
**/
|
|
521
|
-
|
|
522
|
-
}
|
|
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>;
|
|
518
|
+
txid?: string;
|
|
519
|
+
};
|
|
546
520
|
type SignPsbt = MethodParamsAndResult<SignPsbtParams, SignPsbtResult>;
|
|
547
521
|
declare const getAccountsMethodName = "getAccounts";
|
|
548
522
|
declare const getAccountsParamsSchema: v.ObjectSchema<{
|
|
@@ -941,21 +915,20 @@ interface Domain {
|
|
|
941
915
|
*/
|
|
942
916
|
domain: string;
|
|
943
917
|
}
|
|
944
|
-
|
|
945
|
-
declare const stxCallContractParamsSchema: v.ObjectSchema<{
|
|
918
|
+
interface CallContractParams {
|
|
946
919
|
/**
|
|
947
|
-
* The contract
|
|
920
|
+
* The contract's Crockford base-32 encoded Stacks address and name.
|
|
948
921
|
*
|
|
949
922
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
950
923
|
*/
|
|
951
|
-
|
|
924
|
+
contract: string;
|
|
952
925
|
/**
|
|
953
926
|
* The name of the function to call.
|
|
954
927
|
*
|
|
955
928
|
* Note: spec changes ongoing,
|
|
956
929
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
957
930
|
*/
|
|
958
|
-
|
|
931
|
+
functionName: string;
|
|
959
932
|
/**
|
|
960
933
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
961
934
|
* strings of Clarity values.
|
|
@@ -970,57 +943,10 @@ declare const stxCallContractParamsSchema: v.ObjectSchema<{
|
|
|
970
943
|
* const hexArgs = functionArgs.map(cvToString);
|
|
971
944
|
* ```
|
|
972
945
|
*/
|
|
973
|
-
|
|
974
|
-
}
|
|
975
|
-
type
|
|
976
|
-
|
|
977
|
-
/**
|
|
978
|
-
* The ID of the transaction.
|
|
979
|
-
*/
|
|
980
|
-
readonly txid: v.StringSchema<undefined>;
|
|
981
|
-
/**
|
|
982
|
-
* A Stacks transaction as a hex-encoded string.
|
|
983
|
-
*/
|
|
984
|
-
readonly transaction: v.StringSchema<undefined>;
|
|
985
|
-
}, undefined>;
|
|
986
|
-
type StxCallContractResult = v.InferOutput<typeof stxCallContractResultSchema>;
|
|
987
|
-
declare const stxCallContractRequestMessageSchema: v.ObjectSchema<{
|
|
988
|
-
readonly method: v.LiteralSchema<"stx_callContract", undefined>;
|
|
989
|
-
readonly params: v.ObjectSchema<{
|
|
990
|
-
/**
|
|
991
|
-
* The contract principal.
|
|
992
|
-
*
|
|
993
|
-
* E.g. `"SPKE...GD5C.my-contract"`
|
|
994
|
-
*/
|
|
995
|
-
readonly contract: v.StringSchema<undefined>;
|
|
996
|
-
/**
|
|
997
|
-
* The name of the function to call.
|
|
998
|
-
*
|
|
999
|
-
* Note: spec changes ongoing,
|
|
1000
|
-
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1001
|
-
*/
|
|
1002
|
-
readonly functionName: v.StringSchema<undefined>;
|
|
1003
|
-
/**
|
|
1004
|
-
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1005
|
-
* strings of Clarity values.
|
|
1006
|
-
*
|
|
1007
|
-
* To convert Clarity values to their hex representation, the `cvToString`
|
|
1008
|
-
* helper from the `@stacks/transactions` package may be helpful.
|
|
1009
|
-
*
|
|
1010
|
-
* ```js
|
|
1011
|
-
* import { cvToString } from '@stacks/transactions';
|
|
1012
|
-
*
|
|
1013
|
-
* const functionArgs = [someClarityValue1, someClarityValue2];
|
|
1014
|
-
* const hexArgs = functionArgs.map(cvToString);
|
|
1015
|
-
* ```
|
|
1016
|
-
*/
|
|
1017
|
-
readonly arguments: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, never>;
|
|
1018
|
-
}, undefined>;
|
|
1019
|
-
readonly id: v.StringSchema<undefined>;
|
|
1020
|
-
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1021
|
-
}, undefined>;
|
|
1022
|
-
type StxCallContractRequestMessage = v.InferOutput<typeof stxCallContractRequestMessageSchema>;
|
|
1023
|
-
type StxCallContract = MethodParamsAndResult<StxCallContractParams, StxCallContractResult>;
|
|
946
|
+
arguments?: Array<string>;
|
|
947
|
+
}
|
|
948
|
+
type CallContractResult = TxId & Transaction;
|
|
949
|
+
type StxCallContract = MethodParamsAndResult<CallContractParams, CallContractResult>;
|
|
1024
950
|
type TransferStxParams = Amount & Recipient & Partial<Memo> & Partial<ParameterFormatVersion> & Partial<PostConditionMode> & Partial<PostConditions> & Partial<Pubkey>;
|
|
1025
951
|
type TransferStxResult = TxId & Transaction;
|
|
1026
952
|
type StxTransferStx = MethodParamsAndResult<TransferStxParams, TransferStxResult>;
|
|
@@ -1698,4 +1624,4 @@ declare class BaseAdapter extends SatsConnectAdapter {
|
|
|
1698
1624
|
declare const DefaultAdaptersInfo: Record<string, Provider>;
|
|
1699
1625
|
declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
|
|
1700
1626
|
|
|
1701
|
-
export { type AccountChangeEvent, type AddListener, type Address$1 as 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 DeployContractParams, type DeployContractResult, 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$1 as 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
|
|
1627
|
+
export { type AccountChangeEvent, type AddListener, type Address$1 as Address, AddressPurpose, AddressType, BaseAdapter, type BitcoinNetwork, BitcoinNetworkType, type BitcoinProvider, type BtcRequestMethod, type BtcRequests, type CallContractParams, type CallContractResult, type Capability, type Connect, type ConnectParams, type ConnectRequestMessage, type ConnectResult, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type DeployContractParams, type DeployContractResult, 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$1 as 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 SignPsbtResult, type SignStructuredMessageResult, type SignStxMessageParams, type SignStxMessageResult, type SignTransactionOptions, type SignTransactionPayload, type SignTransactionResponse, type StxCallContract, type StxDeployContract, type StxGetAccounts, type StxGetAccountsResult, type StxGetAddresses, type StxGetAddressesParams, type StxGetAddressesRequestMessage, type StxGetAddressesResult, type StxRequestMethod, type StxRequests, type StxSignStructuredMessage, type StxSignStxMessage, type StxSignTransaction, type StxSignTransactionParams, type StxSignTransactionRequestMessage, type StxSignTransactionResult, type StxTransferStx, type SupportedWallet, type TransferRunes, type TransferRunesParams, type TransferRunesRequest, type TransferRunesResult, TransferRunesResultSchema, type TransferStxParams, type TransferStxResult, 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, signTransaction, stxGetAddressesMethodName, stxGetAddressesParamsSchema, stxGetAddressesRequestMessageSchema, stxGetAddressesResultSchema, stxSignTransactionMethodName, stxSignTransactionParamsSchema, stxSignTransactionRequestMessageSchema, stxSignTransactionResultSchema, transferRunesMethodName, transferRunesParamsSchema, transferRunesRequestSchema, walletEventSchema, walletTypeSchema, walletTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -491,58 +491,32 @@ declare const sendTransferRequestMessageSchema: v.ObjectSchema<{
|
|
|
491
491
|
}, undefined>;
|
|
492
492
|
type SendTransferRequestMessage = v.InferOutput<typeof sendTransferRequestMessageSchema>;
|
|
493
493
|
type SendTransfer = MethodParamsAndResult<SendTransferParams, SendTransferResult>;
|
|
494
|
-
|
|
495
|
-
declare const signPsbtParamsSchema: v.ObjectSchema<{
|
|
494
|
+
type SignPsbtParams = {
|
|
496
495
|
/**
|
|
497
496
|
* The base64 encoded PSBT to sign.
|
|
498
497
|
*/
|
|
499
|
-
|
|
498
|
+
psbt: string;
|
|
500
499
|
/**
|
|
501
500
|
* The inputs to sign.
|
|
502
501
|
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
503
502
|
*/
|
|
504
|
-
|
|
505
|
-
readonly allowedSignHash: v.OptionalSchema<v.NumberSchema<undefined>, never>;
|
|
503
|
+
signInputs: Record<string, number[]>;
|
|
506
504
|
/**
|
|
507
505
|
* Whether to broadcast the transaction after signing.
|
|
508
506
|
**/
|
|
509
|
-
|
|
510
|
-
}
|
|
511
|
-
type
|
|
512
|
-
declare const signPsbtResultSchema: v.ObjectSchema<{
|
|
507
|
+
broadcast?: boolean;
|
|
508
|
+
};
|
|
509
|
+
type SignPsbtResult = {
|
|
513
510
|
/**
|
|
514
511
|
* The base64 encoded PSBT after signing.
|
|
515
512
|
*/
|
|
516
|
-
|
|
513
|
+
psbt: string;
|
|
517
514
|
/**
|
|
518
515
|
* The transaction id as a hex-encoded string.
|
|
519
516
|
* This is only returned if the transaction was broadcast.
|
|
520
517
|
**/
|
|
521
|
-
|
|
522
|
-
}
|
|
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>;
|
|
518
|
+
txid?: string;
|
|
519
|
+
};
|
|
546
520
|
type SignPsbt = MethodParamsAndResult<SignPsbtParams, SignPsbtResult>;
|
|
547
521
|
declare const getAccountsMethodName = "getAccounts";
|
|
548
522
|
declare const getAccountsParamsSchema: v.ObjectSchema<{
|
|
@@ -941,21 +915,20 @@ interface Domain {
|
|
|
941
915
|
*/
|
|
942
916
|
domain: string;
|
|
943
917
|
}
|
|
944
|
-
|
|
945
|
-
declare const stxCallContractParamsSchema: v.ObjectSchema<{
|
|
918
|
+
interface CallContractParams {
|
|
946
919
|
/**
|
|
947
|
-
* The contract
|
|
920
|
+
* The contract's Crockford base-32 encoded Stacks address and name.
|
|
948
921
|
*
|
|
949
922
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
950
923
|
*/
|
|
951
|
-
|
|
924
|
+
contract: string;
|
|
952
925
|
/**
|
|
953
926
|
* The name of the function to call.
|
|
954
927
|
*
|
|
955
928
|
* Note: spec changes ongoing,
|
|
956
929
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
957
930
|
*/
|
|
958
|
-
|
|
931
|
+
functionName: string;
|
|
959
932
|
/**
|
|
960
933
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
961
934
|
* strings of Clarity values.
|
|
@@ -970,57 +943,10 @@ declare const stxCallContractParamsSchema: v.ObjectSchema<{
|
|
|
970
943
|
* const hexArgs = functionArgs.map(cvToString);
|
|
971
944
|
* ```
|
|
972
945
|
*/
|
|
973
|
-
|
|
974
|
-
}
|
|
975
|
-
type
|
|
976
|
-
|
|
977
|
-
/**
|
|
978
|
-
* The ID of the transaction.
|
|
979
|
-
*/
|
|
980
|
-
readonly txid: v.StringSchema<undefined>;
|
|
981
|
-
/**
|
|
982
|
-
* A Stacks transaction as a hex-encoded string.
|
|
983
|
-
*/
|
|
984
|
-
readonly transaction: v.StringSchema<undefined>;
|
|
985
|
-
}, undefined>;
|
|
986
|
-
type StxCallContractResult = v.InferOutput<typeof stxCallContractResultSchema>;
|
|
987
|
-
declare const stxCallContractRequestMessageSchema: v.ObjectSchema<{
|
|
988
|
-
readonly method: v.LiteralSchema<"stx_callContract", undefined>;
|
|
989
|
-
readonly params: v.ObjectSchema<{
|
|
990
|
-
/**
|
|
991
|
-
* The contract principal.
|
|
992
|
-
*
|
|
993
|
-
* E.g. `"SPKE...GD5C.my-contract"`
|
|
994
|
-
*/
|
|
995
|
-
readonly contract: v.StringSchema<undefined>;
|
|
996
|
-
/**
|
|
997
|
-
* The name of the function to call.
|
|
998
|
-
*
|
|
999
|
-
* Note: spec changes ongoing,
|
|
1000
|
-
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1001
|
-
*/
|
|
1002
|
-
readonly functionName: v.StringSchema<undefined>;
|
|
1003
|
-
/**
|
|
1004
|
-
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1005
|
-
* strings of Clarity values.
|
|
1006
|
-
*
|
|
1007
|
-
* To convert Clarity values to their hex representation, the `cvToString`
|
|
1008
|
-
* helper from the `@stacks/transactions` package may be helpful.
|
|
1009
|
-
*
|
|
1010
|
-
* ```js
|
|
1011
|
-
* import { cvToString } from '@stacks/transactions';
|
|
1012
|
-
*
|
|
1013
|
-
* const functionArgs = [someClarityValue1, someClarityValue2];
|
|
1014
|
-
* const hexArgs = functionArgs.map(cvToString);
|
|
1015
|
-
* ```
|
|
1016
|
-
*/
|
|
1017
|
-
readonly arguments: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, never>;
|
|
1018
|
-
}, undefined>;
|
|
1019
|
-
readonly id: v.StringSchema<undefined>;
|
|
1020
|
-
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1021
|
-
}, undefined>;
|
|
1022
|
-
type StxCallContractRequestMessage = v.InferOutput<typeof stxCallContractRequestMessageSchema>;
|
|
1023
|
-
type StxCallContract = MethodParamsAndResult<StxCallContractParams, StxCallContractResult>;
|
|
946
|
+
arguments?: Array<string>;
|
|
947
|
+
}
|
|
948
|
+
type CallContractResult = TxId & Transaction;
|
|
949
|
+
type StxCallContract = MethodParamsAndResult<CallContractParams, CallContractResult>;
|
|
1024
950
|
type TransferStxParams = Amount & Recipient & Partial<Memo> & Partial<ParameterFormatVersion> & Partial<PostConditionMode> & Partial<PostConditions> & Partial<Pubkey>;
|
|
1025
951
|
type TransferStxResult = TxId & Transaction;
|
|
1026
952
|
type StxTransferStx = MethodParamsAndResult<TransferStxParams, TransferStxResult>;
|
|
@@ -1698,4 +1624,4 @@ declare class BaseAdapter extends SatsConnectAdapter {
|
|
|
1698
1624
|
declare const DefaultAdaptersInfo: Record<string, Provider>;
|
|
1699
1625
|
declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
|
|
1700
1626
|
|
|
1701
|
-
export { type AccountChangeEvent, type AddListener, type Address$1 as 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 DeployContractParams, type DeployContractResult, 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$1 as 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
|
|
1627
|
+
export { type AccountChangeEvent, type AddListener, type Address$1 as Address, AddressPurpose, AddressType, BaseAdapter, type BitcoinNetwork, BitcoinNetworkType, type BitcoinProvider, type BtcRequestMethod, type BtcRequests, type CallContractParams, type CallContractResult, type Capability, type Connect, type ConnectParams, type ConnectRequestMessage, type ConnectResult, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type DeployContractParams, type DeployContractResult, 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$1 as 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 SignPsbtResult, type SignStructuredMessageResult, type SignStxMessageParams, type SignStxMessageResult, type SignTransactionOptions, type SignTransactionPayload, type SignTransactionResponse, type StxCallContract, type StxDeployContract, type StxGetAccounts, type StxGetAccountsResult, type StxGetAddresses, type StxGetAddressesParams, type StxGetAddressesRequestMessage, type StxGetAddressesResult, type StxRequestMethod, type StxRequests, type StxSignStructuredMessage, type StxSignStxMessage, type StxSignTransaction, type StxSignTransactionParams, type StxSignTransactionRequestMessage, type StxSignTransactionResult, type StxTransferStx, type SupportedWallet, type TransferRunes, type TransferRunesParams, type TransferRunesRequest, type TransferRunesResult, TransferRunesResultSchema, type TransferStxParams, type TransferStxResult, 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, signTransaction, stxGetAddressesMethodName, stxGetAddressesParamsSchema, stxGetAddressesRequestMessageSchema, stxGetAddressesResultSchema, stxSignTransactionMethodName, stxSignTransactionParamsSchema, stxSignTransactionRequestMessageSchema, stxSignTransactionResultSchema, transferRunesMethodName, transferRunesParamsSchema, transferRunesRequestSchema, walletEventSchema, walletTypeSchema, walletTypes };
|
package/dist/index.js
CHANGED
|
@@ -134,15 +134,7 @@ __export(src_exports, {
|
|
|
134
134
|
signMessageRequestMessageSchema: () => signMessageRequestMessageSchema,
|
|
135
135
|
signMessageResultSchema: () => signMessageResultSchema,
|
|
136
136
|
signMultipleTransactions: () => signMultipleTransactions,
|
|
137
|
-
signPsbtMethodName: () => signPsbtMethodName,
|
|
138
|
-
signPsbtParamsSchema: () => signPsbtParamsSchema,
|
|
139
|
-
signPsbtRequestMessageSchema: () => signPsbtRequestMessageSchema,
|
|
140
|
-
signPsbtResultSchema: () => signPsbtResultSchema,
|
|
141
137
|
signTransaction: () => signTransaction,
|
|
142
|
-
stxCallContractMethodName: () => stxCallContractMethodName,
|
|
143
|
-
stxCallContractParamsSchema: () => stxCallContractParamsSchema,
|
|
144
|
-
stxCallContractRequestMessageSchema: () => stxCallContractRequestMessageSchema,
|
|
145
|
-
stxCallContractResultSchema: () => stxCallContractResultSchema,
|
|
146
138
|
stxGetAddressesMethodName: () => stxGetAddressesMethodName,
|
|
147
139
|
stxGetAddressesParamsSchema: () => stxGetAddressesParamsSchema,
|
|
148
140
|
stxGetAddressesRequestMessageSchema: () => stxGetAddressesRequestMessageSchema,
|
|
@@ -325,55 +317,6 @@ var getAddress = async (options) => {
|
|
|
325
317
|
};
|
|
326
318
|
|
|
327
319
|
// src/request/types/stxMethods.ts
|
|
328
|
-
var stxCallContractMethodName = "stx_callContract";
|
|
329
|
-
var stxCallContractParamsSchema = v4.object({
|
|
330
|
-
/**
|
|
331
|
-
* The contract principal.
|
|
332
|
-
*
|
|
333
|
-
* E.g. `"SPKE...GD5C.my-contract"`
|
|
334
|
-
*/
|
|
335
|
-
contract: v4.string(),
|
|
336
|
-
/**
|
|
337
|
-
* The name of the function to call.
|
|
338
|
-
*
|
|
339
|
-
* Note: spec changes ongoing,
|
|
340
|
-
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
341
|
-
*/
|
|
342
|
-
functionName: v4.string(),
|
|
343
|
-
/**
|
|
344
|
-
* The function's arguments. The arguments are expected to be hex-encoded
|
|
345
|
-
* strings of Clarity values.
|
|
346
|
-
*
|
|
347
|
-
* To convert Clarity values to their hex representation, the `cvToString`
|
|
348
|
-
* helper from the `@stacks/transactions` package may be helpful.
|
|
349
|
-
*
|
|
350
|
-
* ```js
|
|
351
|
-
* import { cvToString } from '@stacks/transactions';
|
|
352
|
-
*
|
|
353
|
-
* const functionArgs = [someClarityValue1, someClarityValue2];
|
|
354
|
-
* const hexArgs = functionArgs.map(cvToString);
|
|
355
|
-
* ```
|
|
356
|
-
*/
|
|
357
|
-
arguments: v4.optional(v4.array(v4.string()))
|
|
358
|
-
});
|
|
359
|
-
var stxCallContractResultSchema = v4.object({
|
|
360
|
-
/**
|
|
361
|
-
* The ID of the transaction.
|
|
362
|
-
*/
|
|
363
|
-
txid: v4.string(),
|
|
364
|
-
/**
|
|
365
|
-
* A Stacks transaction as a hex-encoded string.
|
|
366
|
-
*/
|
|
367
|
-
transaction: v4.string()
|
|
368
|
-
});
|
|
369
|
-
var stxCallContractRequestMessageSchema = v4.object({
|
|
370
|
-
...rpcRequestMessageSchema.entries,
|
|
371
|
-
...v4.object({
|
|
372
|
-
method: v4.literal(stxCallContractMethodName),
|
|
373
|
-
params: stxCallContractParamsSchema,
|
|
374
|
-
id: v4.string()
|
|
375
|
-
}).entries
|
|
376
|
-
});
|
|
377
320
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
378
321
|
var stxGetAddressesParamsSchema = v4.nullish(
|
|
379
322
|
v4.object({
|
|
@@ -560,42 +503,6 @@ var sendTransferRequestMessageSchema = v6.object({
|
|
|
560
503
|
id: v6.string()
|
|
561
504
|
}).entries
|
|
562
505
|
});
|
|
563
|
-
var signPsbtMethodName = "signPsbt";
|
|
564
|
-
var signPsbtParamsSchema = v6.object({
|
|
565
|
-
/**
|
|
566
|
-
* The base64 encoded PSBT to sign.
|
|
567
|
-
*/
|
|
568
|
-
psbt: v6.string(),
|
|
569
|
-
/**
|
|
570
|
-
* The inputs to sign.
|
|
571
|
-
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
572
|
-
*/
|
|
573
|
-
signInputs: v6.record(v6.string(), v6.array(v6.number())),
|
|
574
|
-
allowedSignHash: v6.optional(v6.number()),
|
|
575
|
-
/**
|
|
576
|
-
* Whether to broadcast the transaction after signing.
|
|
577
|
-
**/
|
|
578
|
-
broadcast: v6.optional(v6.boolean())
|
|
579
|
-
});
|
|
580
|
-
var signPsbtResultSchema = v6.object({
|
|
581
|
-
/**
|
|
582
|
-
* The base64 encoded PSBT after signing.
|
|
583
|
-
*/
|
|
584
|
-
psbt: v6.string(),
|
|
585
|
-
/**
|
|
586
|
-
* The transaction id as a hex-encoded string.
|
|
587
|
-
* This is only returned if the transaction was broadcast.
|
|
588
|
-
**/
|
|
589
|
-
txid: v6.optional(v6.string())
|
|
590
|
-
});
|
|
591
|
-
var signPsbtRequestMessageSchema = v6.object({
|
|
592
|
-
...rpcRequestMessageSchema.entries,
|
|
593
|
-
...v6.object({
|
|
594
|
-
method: v6.literal(signPsbtMethodName),
|
|
595
|
-
params: signPsbtParamsSchema,
|
|
596
|
-
id: v6.string()
|
|
597
|
-
}).entries
|
|
598
|
-
});
|
|
599
506
|
var getAccountsMethodName = "getAccounts";
|
|
600
507
|
var getAccountsParamsSchema = v6.object({
|
|
601
508
|
/**
|
|
@@ -1920,15 +1827,7 @@ var signMultipleTransactions = async (options) => {
|
|
|
1920
1827
|
signMessageRequestMessageSchema,
|
|
1921
1828
|
signMessageResultSchema,
|
|
1922
1829
|
signMultipleTransactions,
|
|
1923
|
-
signPsbtMethodName,
|
|
1924
|
-
signPsbtParamsSchema,
|
|
1925
|
-
signPsbtRequestMessageSchema,
|
|
1926
|
-
signPsbtResultSchema,
|
|
1927
1830
|
signTransaction,
|
|
1928
|
-
stxCallContractMethodName,
|
|
1929
|
-
stxCallContractParamsSchema,
|
|
1930
|
-
stxCallContractRequestMessageSchema,
|
|
1931
|
-
stxCallContractResultSchema,
|
|
1932
1831
|
stxGetAddressesMethodName,
|
|
1933
1832
|
stxGetAddressesParamsSchema,
|
|
1934
1833
|
stxGetAddressesRequestMessageSchema,
|
package/dist/index.mjs
CHANGED
|
@@ -163,55 +163,6 @@ var getAddress = async (options) => {
|
|
|
163
163
|
};
|
|
164
164
|
|
|
165
165
|
// src/request/types/stxMethods.ts
|
|
166
|
-
var stxCallContractMethodName = "stx_callContract";
|
|
167
|
-
var stxCallContractParamsSchema = v4.object({
|
|
168
|
-
/**
|
|
169
|
-
* The contract principal.
|
|
170
|
-
*
|
|
171
|
-
* E.g. `"SPKE...GD5C.my-contract"`
|
|
172
|
-
*/
|
|
173
|
-
contract: v4.string(),
|
|
174
|
-
/**
|
|
175
|
-
* The name of the function to call.
|
|
176
|
-
*
|
|
177
|
-
* Note: spec changes ongoing,
|
|
178
|
-
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
179
|
-
*/
|
|
180
|
-
functionName: v4.string(),
|
|
181
|
-
/**
|
|
182
|
-
* The function's arguments. The arguments are expected to be hex-encoded
|
|
183
|
-
* strings of Clarity values.
|
|
184
|
-
*
|
|
185
|
-
* To convert Clarity values to their hex representation, the `cvToString`
|
|
186
|
-
* helper from the `@stacks/transactions` package may be helpful.
|
|
187
|
-
*
|
|
188
|
-
* ```js
|
|
189
|
-
* import { cvToString } from '@stacks/transactions';
|
|
190
|
-
*
|
|
191
|
-
* const functionArgs = [someClarityValue1, someClarityValue2];
|
|
192
|
-
* const hexArgs = functionArgs.map(cvToString);
|
|
193
|
-
* ```
|
|
194
|
-
*/
|
|
195
|
-
arguments: v4.optional(v4.array(v4.string()))
|
|
196
|
-
});
|
|
197
|
-
var stxCallContractResultSchema = v4.object({
|
|
198
|
-
/**
|
|
199
|
-
* The ID of the transaction.
|
|
200
|
-
*/
|
|
201
|
-
txid: v4.string(),
|
|
202
|
-
/**
|
|
203
|
-
* A Stacks transaction as a hex-encoded string.
|
|
204
|
-
*/
|
|
205
|
-
transaction: v4.string()
|
|
206
|
-
});
|
|
207
|
-
var stxCallContractRequestMessageSchema = v4.object({
|
|
208
|
-
...rpcRequestMessageSchema.entries,
|
|
209
|
-
...v4.object({
|
|
210
|
-
method: v4.literal(stxCallContractMethodName),
|
|
211
|
-
params: stxCallContractParamsSchema,
|
|
212
|
-
id: v4.string()
|
|
213
|
-
}).entries
|
|
214
|
-
});
|
|
215
166
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
216
167
|
var stxGetAddressesParamsSchema = v4.nullish(
|
|
217
168
|
v4.object({
|
|
@@ -398,42 +349,6 @@ var sendTransferRequestMessageSchema = v6.object({
|
|
|
398
349
|
id: v6.string()
|
|
399
350
|
}).entries
|
|
400
351
|
});
|
|
401
|
-
var signPsbtMethodName = "signPsbt";
|
|
402
|
-
var signPsbtParamsSchema = v6.object({
|
|
403
|
-
/**
|
|
404
|
-
* The base64 encoded PSBT to sign.
|
|
405
|
-
*/
|
|
406
|
-
psbt: v6.string(),
|
|
407
|
-
/**
|
|
408
|
-
* The inputs to sign.
|
|
409
|
-
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
410
|
-
*/
|
|
411
|
-
signInputs: v6.record(v6.string(), v6.array(v6.number())),
|
|
412
|
-
allowedSignHash: v6.optional(v6.number()),
|
|
413
|
-
/**
|
|
414
|
-
* Whether to broadcast the transaction after signing.
|
|
415
|
-
**/
|
|
416
|
-
broadcast: v6.optional(v6.boolean())
|
|
417
|
-
});
|
|
418
|
-
var signPsbtResultSchema = v6.object({
|
|
419
|
-
/**
|
|
420
|
-
* The base64 encoded PSBT after signing.
|
|
421
|
-
*/
|
|
422
|
-
psbt: v6.string(),
|
|
423
|
-
/**
|
|
424
|
-
* The transaction id as a hex-encoded string.
|
|
425
|
-
* This is only returned if the transaction was broadcast.
|
|
426
|
-
**/
|
|
427
|
-
txid: v6.optional(v6.string())
|
|
428
|
-
});
|
|
429
|
-
var signPsbtRequestMessageSchema = v6.object({
|
|
430
|
-
...rpcRequestMessageSchema.entries,
|
|
431
|
-
...v6.object({
|
|
432
|
-
method: v6.literal(signPsbtMethodName),
|
|
433
|
-
params: signPsbtParamsSchema,
|
|
434
|
-
id: v6.string()
|
|
435
|
-
}).entries
|
|
436
|
-
});
|
|
437
352
|
var getAccountsMethodName = "getAccounts";
|
|
438
353
|
var getAccountsParamsSchema = v6.object({
|
|
439
354
|
/**
|
|
@@ -1757,15 +1672,7 @@ export {
|
|
|
1757
1672
|
signMessageRequestMessageSchema,
|
|
1758
1673
|
signMessageResultSchema,
|
|
1759
1674
|
signMultipleTransactions,
|
|
1760
|
-
signPsbtMethodName,
|
|
1761
|
-
signPsbtParamsSchema,
|
|
1762
|
-
signPsbtRequestMessageSchema,
|
|
1763
|
-
signPsbtResultSchema,
|
|
1764
1675
|
signTransaction,
|
|
1765
|
-
stxCallContractMethodName,
|
|
1766
|
-
stxCallContractParamsSchema,
|
|
1767
|
-
stxCallContractRequestMessageSchema,
|
|
1768
|
-
stxCallContractResultSchema,
|
|
1769
1676
|
stxGetAddressesMethodName,
|
|
1770
1677
|
stxGetAddressesParamsSchema,
|
|
1771
1678
|
stxGetAddressesRequestMessageSchema,
|