@sats-connect/core 0.8.1 → 0.8.2-0eb31e4
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 +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +96 -13
- package/dist/index.mjs +95 -13
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -394,6 +394,10 @@ declare function getDefaultProvider(): string | null;
|
|
|
394
394
|
declare function removeDefaultProvider(): void;
|
|
395
395
|
declare function getSupportedWallets(): SupportedWallet[];
|
|
396
396
|
|
|
397
|
+
declare enum ProviderPlatform {
|
|
398
|
+
Web = "web",
|
|
399
|
+
Mobile = "mobile"
|
|
400
|
+
}
|
|
397
401
|
declare const getInfoMethodName = "getInfo";
|
|
398
402
|
declare const getInfoParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
|
|
399
403
|
type GetInfoParams = v.InferOutput<typeof getInfoParamsSchema>;
|
|
@@ -402,6 +406,10 @@ declare const getInfoResultSchema: v.ObjectSchema<{
|
|
|
402
406
|
* Version of the wallet.
|
|
403
407
|
*/
|
|
404
408
|
readonly version: v.StringSchema<undefined>;
|
|
409
|
+
/**
|
|
410
|
+
* The platform the wallet is running on (web or mobile).
|
|
411
|
+
*/
|
|
412
|
+
readonly platform: v.OptionalSchema<v.EnumSchema<typeof ProviderPlatform, undefined>, undefined>;
|
|
405
413
|
/**
|
|
406
414
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
407
415
|
*/
|
|
@@ -2196,4 +2204,4 @@ declare class BaseAdapter extends SatsConnectAdapter {
|
|
|
2196
2204
|
declare const DefaultAdaptersInfo: Record<string, Provider>;
|
|
2197
2205
|
declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
|
|
2198
2206
|
|
|
2199
|
-
export { type AccountChangeCallback, type AccountChangeEvent, type AddListener, type AddNetwork, type AddNetworkParams, type AddNetworkRequestMessage, type AddNetworkResult, type Address, AddressPurpose, AddressType, BaseAdapter, type BitcoinNetwork, BitcoinNetworkType, type BitcoinProvider, type BtcRequestMethod, type BtcRequests, type Capability, type ChangeNetwork, type ChangeNetworkById, type ChangeNetworkByIdParams, type ChangeNetworkByIdRequestMessage, type ChangeNetworkByIdResult, type ChangeNetworkParams, type ChangeNetworkRequestMessage, type ChangeNetworkResult, type Connect, type ConnectParams, type ConnectRequestMessage, type ConnectResult, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type Disconnect, type DisconnectCallback, type DisconnectEvent, type DisconnectParams, type DisconnectRequestMessage, type DisconnectResult, 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 GetInscriptionsParams, type GetInscriptionsRequestMessage, type GetInscriptionsResult, type GetNetwork, type GetNetworkParams, type GetNetworkRequestMessage, type GetNetworkResult, type GetWalletType, type GetWalletTypeParams, type GetWalletTypeRequestMessage, type GetWalletTypeResult, type InputToSign, type ListenerInfo, MessageSigningProtocols, type MethodParamsAndResult, type NetworkChangeCallback, type NetworkChangeEvent, type OrdinalsRequestMethod, type OrdinalsRequests, type Params, PermissionRequestParams, type PermissionWithoutClientId, type Provider, type PsbtPayload, 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 RunesEstimateEtch, type RunesEstimateEtchParams, type RunesEstimateEtchResult, type RunesEstimateMint, type RunesEstimateRbfOrder, type RunesEtch, type RunesEtchParams, type RunesEtchRequestMessage, type RunesEtchResult, type RunesGetBalance, type RunesGetBalanceParams, type RunesGetBalanceResult, type RunesGetOrder, type RunesMint, type RunesMintParams, type RunesMintRequestMessage, type RunesMintResult, type RunesRbfOrder, type RunesRequestMethod, type RunesRequests, type RunesTransfer, type RunesTransferRequestMessage, type RunesTransferResult, SatsConnectAdapter, type SendBtcTransactionOptions, type SendBtcTransactionPayload, type SendBtcTransactionResponse, type SendInscriptions, type SendInscriptionsParams, type SendInscriptionsRequestMessage, type SendInscriptionsResult, 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 SparkGetAddresses, type SparkGetAddressesParams, type SparkGetAddressesRequestMessage, type SparkGetAddressesResult, type SparkGetBalance, type SparkGetBalanceParams, type SparkGetBalanceRequestMessage, type SparkGetBalanceResult, SparkNetworkType, type SparkRequestMethod, type SparkRequests, type SparkTransfer, type SparkTransferParams, type SparkTransferRequestMessage, type SparkTransferResult, type SparkTransferToken, type SparkTransferTokenParams, type SparkTransferTokenRequestMessage, type SparkTransferTokenResult, StacksNetworkType, StarknetNetworkType, 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 StxSignTransactions, type StxSignTransactionsParams, type StxSignTransactionsRequestMessage, type StxSignTransactionsResult, type StxTransferStx, type StxTransferStxParams, type StxTransferStxRequestMessage, type StxTransferStxResult, type SupportedWallet, type TransferRunesParams, type WalletEvent, type WalletRequests, type WalletType, accountActionsSchema, accountChangeEventName, accountChangeSchema, accountPermissionSchema, addListener, addNetworkMethodName, addNetworkParamsSchema, addNetworkRequestMessageSchema, addNetworkResultSchema, addressSchema, changeNetworkByIdMethodName, changeNetworkByIdParamsSchema, changeNetworkByIdRequestMessageSchema, changeNetworkByIdResultSchema, changeNetworkMethodName, changeNetworkParamsSchema, changeNetworkRequestMessageSchema, changeNetworkResultSchema, 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, getInscriptionsRequestMessageSchema, getInscriptionsResultSchema, getNetworkMethodName, getNetworkParamsSchema, getNetworkRequestMessageSchema, getNetworkResultSchema, getProviderById, getProviderOrThrow, getProviders, getSupportedWallets, getWalletTypeMethodName, getWalletTypeParamsSchema, getWalletTypeRequestMessageSchema, getWalletTypeResultSchema, isProviderInstalled, networkChangeEventName, networkChangeSchema, permission, removeDefaultProvider, renouncePermissionsMethodName, renouncePermissionsParamsSchema, renouncePermissionsRequestMessageSchema, renouncePermissionsResultSchema, request, requestPermissionsMethodName, requestPermissionsParamsSchema, requestPermissionsRequestMessageSchema, requestPermissionsResultSchema, rpcErrorResponseMessageSchema, rpcRequestMessageSchema, rpcResponseMessageSchema, rpcSuccessResponseMessageSchema, type runesEstimateMintParams, type runesEstimateMintResult, runesEtchMethodName, runesEtchParamsSchema, runesEtchRequestMessageSchema, runesEtchResultSchema, runesGetBalanceMethodName, runesGetBalanceParamsSchema, type runesGetBalanceRequestMessage, runesGetBalanceRequestMessageSchema, runesGetBalanceResultSchema, runesMintMethodName, runesMintParamsSchema, runesMintRequestMessageSchema, runesMintResultSchema, runesTransferMethodName, runesTransferParamsSchema, runesTransferRequestMessageSchema, runesTransferResultSchema, sendBtcTransaction, sendInscriptionsMethodName, sendInscriptionsParamsSchema, sendInscriptionsRequestMessageSchema, sendInscriptionsResultSchema, sendTransferMethodName, sendTransferParamsSchema, sendTransferRequestMessageSchema, sendTransferResultSchema, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signPsbtMethodName, signPsbtParamsSchema, signPsbtRequestMessageSchema, signPsbtResultSchema, signTransaction, sparkGetAddressesMethodName, sparkGetAddressesParamsSchema, sparkGetAddressesRequestMessageSchema, sparkGetAddressesResultSchema, sparkGetBalanceMethodName, sparkGetBalanceParamsSchema, sparkGetBalanceRequestMessageSchema, sparkGetBalanceResultSchema, sparkTransferMethodName, sparkTransferParamsSchema, sparkTransferRequestMessageSchema, sparkTransferResultSchema, sparkTransferTokenMethodName, sparkTransferTokenParamsSchema, sparkTransferTokenRequestMessageSchema, sparkTransferTokenResultSchema, 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, stxSignTransactionsMethodName, stxSignTransactionsParamsSchema, stxSignTransactionsRequestMessageSchema, stxSignTransactionsResultSchema, stxTransferStxMethodName, stxTransferStxParamsSchema, stxTransferStxRequestMessageSchema, stxTransferStxResultSchema, walletActionsSchema, walletEventSchema, walletPermissionSchema, walletTypeSchema, walletTypes };
|
|
2207
|
+
export { type AccountChangeCallback, type AccountChangeEvent, type AddListener, type AddNetwork, type AddNetworkParams, type AddNetworkRequestMessage, type AddNetworkResult, type Address, AddressPurpose, AddressType, BaseAdapter, type BitcoinNetwork, BitcoinNetworkType, type BitcoinProvider, type BtcRequestMethod, type BtcRequests, type Capability, type ChangeNetwork, type ChangeNetworkById, type ChangeNetworkByIdParams, type ChangeNetworkByIdRequestMessage, type ChangeNetworkByIdResult, type ChangeNetworkParams, type ChangeNetworkRequestMessage, type ChangeNetworkResult, type Connect, type ConnectParams, type ConnectRequestMessage, type ConnectResult, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type Disconnect, type DisconnectCallback, type DisconnectEvent, type DisconnectParams, type DisconnectRequestMessage, type DisconnectResult, 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 GetInscriptionsParams, type GetInscriptionsRequestMessage, type GetInscriptionsResult, type GetNetwork, type GetNetworkParams, type GetNetworkRequestMessage, type GetNetworkResult, type GetWalletType, type GetWalletTypeParams, type GetWalletTypeRequestMessage, type GetWalletTypeResult, type InputToSign, type ListenerInfo, MessageSigningProtocols, type MethodParamsAndResult, type NetworkChangeCallback, type NetworkChangeEvent, type OrdinalsRequestMethod, type OrdinalsRequests, type Params, PermissionRequestParams, type PermissionWithoutClientId, type Provider, ProviderPlatform, type PsbtPayload, 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 RunesEstimateEtch, type RunesEstimateEtchParams, type RunesEstimateEtchResult, type RunesEstimateMint, type RunesEstimateRbfOrder, type RunesEtch, type RunesEtchParams, type RunesEtchRequestMessage, type RunesEtchResult, type RunesGetBalance, type RunesGetBalanceParams, type RunesGetBalanceResult, type RunesGetOrder, type RunesMint, type RunesMintParams, type RunesMintRequestMessage, type RunesMintResult, type RunesRbfOrder, type RunesRequestMethod, type RunesRequests, type RunesTransfer, type RunesTransferRequestMessage, type RunesTransferResult, SatsConnectAdapter, type SendBtcTransactionOptions, type SendBtcTransactionPayload, type SendBtcTransactionResponse, type SendInscriptions, type SendInscriptionsParams, type SendInscriptionsRequestMessage, type SendInscriptionsResult, 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 SparkGetAddresses, type SparkGetAddressesParams, type SparkGetAddressesRequestMessage, type SparkGetAddressesResult, type SparkGetBalance, type SparkGetBalanceParams, type SparkGetBalanceRequestMessage, type SparkGetBalanceResult, SparkNetworkType, type SparkRequestMethod, type SparkRequests, type SparkTransfer, type SparkTransferParams, type SparkTransferRequestMessage, type SparkTransferResult, type SparkTransferToken, type SparkTransferTokenParams, type SparkTransferTokenRequestMessage, type SparkTransferTokenResult, StacksNetworkType, StarknetNetworkType, 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 StxSignTransactions, type StxSignTransactionsParams, type StxSignTransactionsRequestMessage, type StxSignTransactionsResult, type StxTransferStx, type StxTransferStxParams, type StxTransferStxRequestMessage, type StxTransferStxResult, type SupportedWallet, type TransferRunesParams, type WalletEvent, type WalletRequests, type WalletType, accountActionsSchema, accountChangeEventName, accountChangeSchema, accountPermissionSchema, addListener, addNetworkMethodName, addNetworkParamsSchema, addNetworkRequestMessageSchema, addNetworkResultSchema, addressSchema, changeNetworkByIdMethodName, changeNetworkByIdParamsSchema, changeNetworkByIdRequestMessageSchema, changeNetworkByIdResultSchema, changeNetworkMethodName, changeNetworkParamsSchema, changeNetworkRequestMessageSchema, changeNetworkResultSchema, 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, getInscriptionsRequestMessageSchema, getInscriptionsResultSchema, getNetworkMethodName, getNetworkParamsSchema, getNetworkRequestMessageSchema, getNetworkResultSchema, getProviderById, getProviderOrThrow, getProviders, getSupportedWallets, getWalletTypeMethodName, getWalletTypeParamsSchema, getWalletTypeRequestMessageSchema, getWalletTypeResultSchema, isProviderInstalled, networkChangeEventName, networkChangeSchema, permission, removeDefaultProvider, renouncePermissionsMethodName, renouncePermissionsParamsSchema, renouncePermissionsRequestMessageSchema, renouncePermissionsResultSchema, request, requestPermissionsMethodName, requestPermissionsParamsSchema, requestPermissionsRequestMessageSchema, requestPermissionsResultSchema, rpcErrorResponseMessageSchema, rpcRequestMessageSchema, rpcResponseMessageSchema, rpcSuccessResponseMessageSchema, type runesEstimateMintParams, type runesEstimateMintResult, runesEtchMethodName, runesEtchParamsSchema, runesEtchRequestMessageSchema, runesEtchResultSchema, runesGetBalanceMethodName, runesGetBalanceParamsSchema, type runesGetBalanceRequestMessage, runesGetBalanceRequestMessageSchema, runesGetBalanceResultSchema, runesMintMethodName, runesMintParamsSchema, runesMintRequestMessageSchema, runesMintResultSchema, runesTransferMethodName, runesTransferParamsSchema, runesTransferRequestMessageSchema, runesTransferResultSchema, sendBtcTransaction, sendInscriptionsMethodName, sendInscriptionsParamsSchema, sendInscriptionsRequestMessageSchema, sendInscriptionsResultSchema, sendTransferMethodName, sendTransferParamsSchema, sendTransferRequestMessageSchema, sendTransferResultSchema, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signPsbtMethodName, signPsbtParamsSchema, signPsbtRequestMessageSchema, signPsbtResultSchema, signTransaction, sparkGetAddressesMethodName, sparkGetAddressesParamsSchema, sparkGetAddressesRequestMessageSchema, sparkGetAddressesResultSchema, sparkGetBalanceMethodName, sparkGetBalanceParamsSchema, sparkGetBalanceRequestMessageSchema, sparkGetBalanceResultSchema, sparkTransferMethodName, sparkTransferParamsSchema, sparkTransferRequestMessageSchema, sparkTransferResultSchema, sparkTransferTokenMethodName, sparkTransferTokenParamsSchema, sparkTransferTokenRequestMessageSchema, sparkTransferTokenResultSchema, 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, stxSignTransactionsMethodName, stxSignTransactionsParamsSchema, stxSignTransactionsRequestMessageSchema, stxSignTransactionsResultSchema, stxTransferStxMethodName, stxTransferStxParamsSchema, stxTransferStxRequestMessageSchema, stxTransferStxResultSchema, walletActionsSchema, walletEventSchema, walletPermissionSchema, walletTypeSchema, walletTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -394,6 +394,10 @@ declare function getDefaultProvider(): string | null;
|
|
|
394
394
|
declare function removeDefaultProvider(): void;
|
|
395
395
|
declare function getSupportedWallets(): SupportedWallet[];
|
|
396
396
|
|
|
397
|
+
declare enum ProviderPlatform {
|
|
398
|
+
Web = "web",
|
|
399
|
+
Mobile = "mobile"
|
|
400
|
+
}
|
|
397
401
|
declare const getInfoMethodName = "getInfo";
|
|
398
402
|
declare const getInfoParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
|
|
399
403
|
type GetInfoParams = v.InferOutput<typeof getInfoParamsSchema>;
|
|
@@ -402,6 +406,10 @@ declare const getInfoResultSchema: v.ObjectSchema<{
|
|
|
402
406
|
* Version of the wallet.
|
|
403
407
|
*/
|
|
404
408
|
readonly version: v.StringSchema<undefined>;
|
|
409
|
+
/**
|
|
410
|
+
* The platform the wallet is running on (web or mobile).
|
|
411
|
+
*/
|
|
412
|
+
readonly platform: v.OptionalSchema<v.EnumSchema<typeof ProviderPlatform, undefined>, undefined>;
|
|
405
413
|
/**
|
|
406
414
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
407
415
|
*/
|
|
@@ -2196,4 +2204,4 @@ declare class BaseAdapter extends SatsConnectAdapter {
|
|
|
2196
2204
|
declare const DefaultAdaptersInfo: Record<string, Provider>;
|
|
2197
2205
|
declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
|
|
2198
2206
|
|
|
2199
|
-
export { type AccountChangeCallback, type AccountChangeEvent, type AddListener, type AddNetwork, type AddNetworkParams, type AddNetworkRequestMessage, type AddNetworkResult, type Address, AddressPurpose, AddressType, BaseAdapter, type BitcoinNetwork, BitcoinNetworkType, type BitcoinProvider, type BtcRequestMethod, type BtcRequests, type Capability, type ChangeNetwork, type ChangeNetworkById, type ChangeNetworkByIdParams, type ChangeNetworkByIdRequestMessage, type ChangeNetworkByIdResult, type ChangeNetworkParams, type ChangeNetworkRequestMessage, type ChangeNetworkResult, type Connect, type ConnectParams, type ConnectRequestMessage, type ConnectResult, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type Disconnect, type DisconnectCallback, type DisconnectEvent, type DisconnectParams, type DisconnectRequestMessage, type DisconnectResult, 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 GetInscriptionsParams, type GetInscriptionsRequestMessage, type GetInscriptionsResult, type GetNetwork, type GetNetworkParams, type GetNetworkRequestMessage, type GetNetworkResult, type GetWalletType, type GetWalletTypeParams, type GetWalletTypeRequestMessage, type GetWalletTypeResult, type InputToSign, type ListenerInfo, MessageSigningProtocols, type MethodParamsAndResult, type NetworkChangeCallback, type NetworkChangeEvent, type OrdinalsRequestMethod, type OrdinalsRequests, type Params, PermissionRequestParams, type PermissionWithoutClientId, type Provider, type PsbtPayload, 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 RunesEstimateEtch, type RunesEstimateEtchParams, type RunesEstimateEtchResult, type RunesEstimateMint, type RunesEstimateRbfOrder, type RunesEtch, type RunesEtchParams, type RunesEtchRequestMessage, type RunesEtchResult, type RunesGetBalance, type RunesGetBalanceParams, type RunesGetBalanceResult, type RunesGetOrder, type RunesMint, type RunesMintParams, type RunesMintRequestMessage, type RunesMintResult, type RunesRbfOrder, type RunesRequestMethod, type RunesRequests, type RunesTransfer, type RunesTransferRequestMessage, type RunesTransferResult, SatsConnectAdapter, type SendBtcTransactionOptions, type SendBtcTransactionPayload, type SendBtcTransactionResponse, type SendInscriptions, type SendInscriptionsParams, type SendInscriptionsRequestMessage, type SendInscriptionsResult, 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 SparkGetAddresses, type SparkGetAddressesParams, type SparkGetAddressesRequestMessage, type SparkGetAddressesResult, type SparkGetBalance, type SparkGetBalanceParams, type SparkGetBalanceRequestMessage, type SparkGetBalanceResult, SparkNetworkType, type SparkRequestMethod, type SparkRequests, type SparkTransfer, type SparkTransferParams, type SparkTransferRequestMessage, type SparkTransferResult, type SparkTransferToken, type SparkTransferTokenParams, type SparkTransferTokenRequestMessage, type SparkTransferTokenResult, StacksNetworkType, StarknetNetworkType, 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 StxSignTransactions, type StxSignTransactionsParams, type StxSignTransactionsRequestMessage, type StxSignTransactionsResult, type StxTransferStx, type StxTransferStxParams, type StxTransferStxRequestMessage, type StxTransferStxResult, type SupportedWallet, type TransferRunesParams, type WalletEvent, type WalletRequests, type WalletType, accountActionsSchema, accountChangeEventName, accountChangeSchema, accountPermissionSchema, addListener, addNetworkMethodName, addNetworkParamsSchema, addNetworkRequestMessageSchema, addNetworkResultSchema, addressSchema, changeNetworkByIdMethodName, changeNetworkByIdParamsSchema, changeNetworkByIdRequestMessageSchema, changeNetworkByIdResultSchema, changeNetworkMethodName, changeNetworkParamsSchema, changeNetworkRequestMessageSchema, changeNetworkResultSchema, 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, getInscriptionsRequestMessageSchema, getInscriptionsResultSchema, getNetworkMethodName, getNetworkParamsSchema, getNetworkRequestMessageSchema, getNetworkResultSchema, getProviderById, getProviderOrThrow, getProviders, getSupportedWallets, getWalletTypeMethodName, getWalletTypeParamsSchema, getWalletTypeRequestMessageSchema, getWalletTypeResultSchema, isProviderInstalled, networkChangeEventName, networkChangeSchema, permission, removeDefaultProvider, renouncePermissionsMethodName, renouncePermissionsParamsSchema, renouncePermissionsRequestMessageSchema, renouncePermissionsResultSchema, request, requestPermissionsMethodName, requestPermissionsParamsSchema, requestPermissionsRequestMessageSchema, requestPermissionsResultSchema, rpcErrorResponseMessageSchema, rpcRequestMessageSchema, rpcResponseMessageSchema, rpcSuccessResponseMessageSchema, type runesEstimateMintParams, type runesEstimateMintResult, runesEtchMethodName, runesEtchParamsSchema, runesEtchRequestMessageSchema, runesEtchResultSchema, runesGetBalanceMethodName, runesGetBalanceParamsSchema, type runesGetBalanceRequestMessage, runesGetBalanceRequestMessageSchema, runesGetBalanceResultSchema, runesMintMethodName, runesMintParamsSchema, runesMintRequestMessageSchema, runesMintResultSchema, runesTransferMethodName, runesTransferParamsSchema, runesTransferRequestMessageSchema, runesTransferResultSchema, sendBtcTransaction, sendInscriptionsMethodName, sendInscriptionsParamsSchema, sendInscriptionsRequestMessageSchema, sendInscriptionsResultSchema, sendTransferMethodName, sendTransferParamsSchema, sendTransferRequestMessageSchema, sendTransferResultSchema, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signPsbtMethodName, signPsbtParamsSchema, signPsbtRequestMessageSchema, signPsbtResultSchema, signTransaction, sparkGetAddressesMethodName, sparkGetAddressesParamsSchema, sparkGetAddressesRequestMessageSchema, sparkGetAddressesResultSchema, sparkGetBalanceMethodName, sparkGetBalanceParamsSchema, sparkGetBalanceRequestMessageSchema, sparkGetBalanceResultSchema, sparkTransferMethodName, sparkTransferParamsSchema, sparkTransferRequestMessageSchema, sparkTransferResultSchema, sparkTransferTokenMethodName, sparkTransferTokenParamsSchema, sparkTransferTokenRequestMessageSchema, sparkTransferTokenResultSchema, 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, stxSignTransactionsMethodName, stxSignTransactionsParamsSchema, stxSignTransactionsRequestMessageSchema, stxSignTransactionsResultSchema, stxTransferStxMethodName, stxTransferStxParamsSchema, stxTransferStxRequestMessageSchema, stxTransferStxResultSchema, walletActionsSchema, walletEventSchema, walletPermissionSchema, walletTypeSchema, walletTypes };
|
|
2207
|
+
export { type AccountChangeCallback, type AccountChangeEvent, type AddListener, type AddNetwork, type AddNetworkParams, type AddNetworkRequestMessage, type AddNetworkResult, type Address, AddressPurpose, AddressType, BaseAdapter, type BitcoinNetwork, BitcoinNetworkType, type BitcoinProvider, type BtcRequestMethod, type BtcRequests, type Capability, type ChangeNetwork, type ChangeNetworkById, type ChangeNetworkByIdParams, type ChangeNetworkByIdRequestMessage, type ChangeNetworkByIdResult, type ChangeNetworkParams, type ChangeNetworkRequestMessage, type ChangeNetworkResult, type Connect, type ConnectParams, type ConnectRequestMessage, type ConnectResult, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type Disconnect, type DisconnectCallback, type DisconnectEvent, type DisconnectParams, type DisconnectRequestMessage, type DisconnectResult, 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 GetInscriptionsParams, type GetInscriptionsRequestMessage, type GetInscriptionsResult, type GetNetwork, type GetNetworkParams, type GetNetworkRequestMessage, type GetNetworkResult, type GetWalletType, type GetWalletTypeParams, type GetWalletTypeRequestMessage, type GetWalletTypeResult, type InputToSign, type ListenerInfo, MessageSigningProtocols, type MethodParamsAndResult, type NetworkChangeCallback, type NetworkChangeEvent, type OrdinalsRequestMethod, type OrdinalsRequests, type Params, PermissionRequestParams, type PermissionWithoutClientId, type Provider, ProviderPlatform, type PsbtPayload, 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 RunesEstimateEtch, type RunesEstimateEtchParams, type RunesEstimateEtchResult, type RunesEstimateMint, type RunesEstimateRbfOrder, type RunesEtch, type RunesEtchParams, type RunesEtchRequestMessage, type RunesEtchResult, type RunesGetBalance, type RunesGetBalanceParams, type RunesGetBalanceResult, type RunesGetOrder, type RunesMint, type RunesMintParams, type RunesMintRequestMessage, type RunesMintResult, type RunesRbfOrder, type RunesRequestMethod, type RunesRequests, type RunesTransfer, type RunesTransferRequestMessage, type RunesTransferResult, SatsConnectAdapter, type SendBtcTransactionOptions, type SendBtcTransactionPayload, type SendBtcTransactionResponse, type SendInscriptions, type SendInscriptionsParams, type SendInscriptionsRequestMessage, type SendInscriptionsResult, 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 SparkGetAddresses, type SparkGetAddressesParams, type SparkGetAddressesRequestMessage, type SparkGetAddressesResult, type SparkGetBalance, type SparkGetBalanceParams, type SparkGetBalanceRequestMessage, type SparkGetBalanceResult, SparkNetworkType, type SparkRequestMethod, type SparkRequests, type SparkTransfer, type SparkTransferParams, type SparkTransferRequestMessage, type SparkTransferResult, type SparkTransferToken, type SparkTransferTokenParams, type SparkTransferTokenRequestMessage, type SparkTransferTokenResult, StacksNetworkType, StarknetNetworkType, 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 StxSignTransactions, type StxSignTransactionsParams, type StxSignTransactionsRequestMessage, type StxSignTransactionsResult, type StxTransferStx, type StxTransferStxParams, type StxTransferStxRequestMessage, type StxTransferStxResult, type SupportedWallet, type TransferRunesParams, type WalletEvent, type WalletRequests, type WalletType, accountActionsSchema, accountChangeEventName, accountChangeSchema, accountPermissionSchema, addListener, addNetworkMethodName, addNetworkParamsSchema, addNetworkRequestMessageSchema, addNetworkResultSchema, addressSchema, changeNetworkByIdMethodName, changeNetworkByIdParamsSchema, changeNetworkByIdRequestMessageSchema, changeNetworkByIdResultSchema, changeNetworkMethodName, changeNetworkParamsSchema, changeNetworkRequestMessageSchema, changeNetworkResultSchema, 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, getInscriptionsRequestMessageSchema, getInscriptionsResultSchema, getNetworkMethodName, getNetworkParamsSchema, getNetworkRequestMessageSchema, getNetworkResultSchema, getProviderById, getProviderOrThrow, getProviders, getSupportedWallets, getWalletTypeMethodName, getWalletTypeParamsSchema, getWalletTypeRequestMessageSchema, getWalletTypeResultSchema, isProviderInstalled, networkChangeEventName, networkChangeSchema, permission, removeDefaultProvider, renouncePermissionsMethodName, renouncePermissionsParamsSchema, renouncePermissionsRequestMessageSchema, renouncePermissionsResultSchema, request, requestPermissionsMethodName, requestPermissionsParamsSchema, requestPermissionsRequestMessageSchema, requestPermissionsResultSchema, rpcErrorResponseMessageSchema, rpcRequestMessageSchema, rpcResponseMessageSchema, rpcSuccessResponseMessageSchema, type runesEstimateMintParams, type runesEstimateMintResult, runesEtchMethodName, runesEtchParamsSchema, runesEtchRequestMessageSchema, runesEtchResultSchema, runesGetBalanceMethodName, runesGetBalanceParamsSchema, type runesGetBalanceRequestMessage, runesGetBalanceRequestMessageSchema, runesGetBalanceResultSchema, runesMintMethodName, runesMintParamsSchema, runesMintRequestMessageSchema, runesMintResultSchema, runesTransferMethodName, runesTransferParamsSchema, runesTransferRequestMessageSchema, runesTransferResultSchema, sendBtcTransaction, sendInscriptionsMethodName, sendInscriptionsParamsSchema, sendInscriptionsRequestMessageSchema, sendInscriptionsResultSchema, sendTransferMethodName, sendTransferParamsSchema, sendTransferRequestMessageSchema, sendTransferResultSchema, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signPsbtMethodName, signPsbtParamsSchema, signPsbtRequestMessageSchema, signPsbtResultSchema, signTransaction, sparkGetAddressesMethodName, sparkGetAddressesParamsSchema, sparkGetAddressesRequestMessageSchema, sparkGetAddressesResultSchema, sparkGetBalanceMethodName, sparkGetBalanceParamsSchema, sparkGetBalanceRequestMessageSchema, sparkGetBalanceResultSchema, sparkTransferMethodName, sparkTransferParamsSchema, sparkTransferRequestMessageSchema, sparkTransferResultSchema, sparkTransferTokenMethodName, sparkTransferTokenParamsSchema, sparkTransferTokenRequestMessageSchema, sparkTransferTokenResultSchema, 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, stxSignTransactionsMethodName, stxSignTransactionsParamsSchema, stxSignTransactionsRequestMessageSchema, stxSignTransactionsResultSchema, stxTransferStxMethodName, stxTransferStxParamsSchema, stxTransferStxRequestMessageSchema, stxTransferStxResultSchema, walletActionsSchema, walletEventSchema, walletPermissionSchema, walletTypeSchema, walletTypes };
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
DefaultAdaptersInfo: () => DefaultAdaptersInfo,
|
|
38
38
|
MessageSigningProtocols: () => MessageSigningProtocols,
|
|
39
39
|
PermissionRequestParams: () => PermissionRequestParams,
|
|
40
|
+
ProviderPlatform: () => ProviderPlatform,
|
|
40
41
|
RpcErrorCode: () => RpcErrorCode,
|
|
41
42
|
RpcIdSchema: () => RpcIdSchema,
|
|
42
43
|
SatsConnectAdapter: () => SatsConnectAdapter,
|
|
@@ -232,6 +233,9 @@ __export(index_exports, {
|
|
|
232
233
|
});
|
|
233
234
|
module.exports = __toCommonJS(index_exports);
|
|
234
235
|
|
|
236
|
+
// src/request/index.ts
|
|
237
|
+
var v25 = __toESM(require("valibot"));
|
|
238
|
+
|
|
235
239
|
// src/provider/types.ts
|
|
236
240
|
var v4 = __toESM(require("valibot"));
|
|
237
241
|
|
|
@@ -425,8 +429,53 @@ function getSupportedWallets() {
|
|
|
425
429
|
return wallets;
|
|
426
430
|
}
|
|
427
431
|
|
|
428
|
-
// src/request/
|
|
429
|
-
var
|
|
432
|
+
// src/request/sanitizeRequest.ts
|
|
433
|
+
var sanitizeRequest = (method, params, providerInfo) => {
|
|
434
|
+
try {
|
|
435
|
+
const [major, minor, patch] = providerInfo.version.split(".").map((part) => parseInt(part, 10));
|
|
436
|
+
const platform = providerInfo.platform;
|
|
437
|
+
if (
|
|
438
|
+
// platform is missing for versions < 1.5.0 on web and < 1.55.0 on mobile
|
|
439
|
+
!platform || platform === "web" /* Web */ && major <= 1 && minor <= 4 || platform === "mobile" /* Mobile */ && major <= 1 && minor <= 54
|
|
440
|
+
) {
|
|
441
|
+
const v1Sanitized = sanitizeAddressPurposeRequest(method, params);
|
|
442
|
+
method = v1Sanitized.method;
|
|
443
|
+
params = v1Sanitized.params;
|
|
444
|
+
}
|
|
445
|
+
} catch {
|
|
446
|
+
}
|
|
447
|
+
return { method, params };
|
|
448
|
+
};
|
|
449
|
+
var sanitizeAddressPurposeRequest = (method, params) => {
|
|
450
|
+
const filterPurposes = (purposes) => purposes?.filter(
|
|
451
|
+
(purpose) => purpose !== "spark" /* Spark */ && purpose !== "starknet" /* Starknet */
|
|
452
|
+
);
|
|
453
|
+
if (method === "wallet_connect") {
|
|
454
|
+
const typedParams = params;
|
|
455
|
+
if (!typedParams) {
|
|
456
|
+
return { method, params };
|
|
457
|
+
}
|
|
458
|
+
const { addresses, ...rest } = typedParams;
|
|
459
|
+
const overrideParams = {
|
|
460
|
+
...rest,
|
|
461
|
+
addresses: filterPurposes(addresses)
|
|
462
|
+
};
|
|
463
|
+
return { method, params: overrideParams };
|
|
464
|
+
}
|
|
465
|
+
if (method === "getAccounts") {
|
|
466
|
+
const typedParams = params;
|
|
467
|
+
const { purposes, ...rest } = typedParams;
|
|
468
|
+
const overrideParams = { ...rest, purposes: filterPurposes(purposes) };
|
|
469
|
+
return { method, params: overrideParams };
|
|
470
|
+
}
|
|
471
|
+
if (method === "getAddresses") {
|
|
472
|
+
const typedParams = params;
|
|
473
|
+
const { purposes, ...rest } = typedParams;
|
|
474
|
+
const overrideParams = { ...rest, purposes: filterPurposes(purposes) };
|
|
475
|
+
return { method, params: overrideParams };
|
|
476
|
+
}
|
|
477
|
+
return { method, params };
|
|
478
|
+
};
|
|
430
479
|
|
|
431
480
|
// src/request/types/btcMethods.ts
|
|
432
481
|
var v6 = __toESM(require("valibot"));
|
|
@@ -645,6 +694,11 @@ var addNetworkResultSchema = v5.object({
|
|
|
645
694
|
});
|
|
646
695
|
|
|
647
696
|
// src/request/types/btcMethods.ts
|
|
697
|
+
var ProviderPlatform = /* @__PURE__ */ ((ProviderPlatform2) => {
|
|
698
|
+
ProviderPlatform2["Web"] = "web";
|
|
699
|
+
ProviderPlatform2["Mobile"] = "mobile";
|
|
700
|
+
return ProviderPlatform2;
|
|
701
|
+
})(ProviderPlatform || {});
|
|
648
702
|
var getInfoMethodName = "getInfo";
|
|
649
703
|
var getInfoParamsSchema = v6.nullish(v6.null());
|
|
650
704
|
var getInfoResultSchema = v6.object({
|
|
@@ -652,6 +706,10 @@ var getInfoResultSchema = v6.object({
|
|
|
652
706
|
* Version of the wallet.
|
|
653
707
|
*/
|
|
654
708
|
version: v6.string(),
|
|
709
|
+
/**
|
|
710
|
+
* The platform the wallet is running on (web or mobile).
|
|
711
|
+
*/
|
|
712
|
+
platform: v6.optional(v6.enum(ProviderPlatform)),
|
|
655
713
|
/**
|
|
656
714
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
657
715
|
*/
|
|
@@ -1529,17 +1587,8 @@ var stxTransferStxRequestMessageSchema = v24.object({
|
|
|
1529
1587
|
});
|
|
1530
1588
|
|
|
1531
1589
|
// src/request/index.ts
|
|
1532
|
-
var
|
|
1533
|
-
|
|
1534
|
-
if (providerId) {
|
|
1535
|
-
provider = await getProviderById(providerId);
|
|
1536
|
-
}
|
|
1537
|
-
if (!provider) {
|
|
1538
|
-
throw new Error("no wallet provider was found");
|
|
1539
|
-
}
|
|
1540
|
-
if (!method) {
|
|
1541
|
-
throw new Error("A wallet method is required");
|
|
1542
|
-
}
|
|
1590
|
+
var cache = {};
|
|
1591
|
+
var requestInternal = async (provider, method, params) => {
|
|
1543
1592
|
const response = await provider.request(method, params);
|
|
1544
1593
|
if (v25.is(rpcErrorResponseMessageSchema, response)) {
|
|
1545
1594
|
return {
|
|
@@ -1562,6 +1611,39 @@ var request = async (method, params, providerId) => {
|
|
|
1562
1611
|
}
|
|
1563
1612
|
};
|
|
1564
1613
|
};
|
|
1614
|
+
var request = async (method, params, providerId) => {
|
|
1615
|
+
let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
|
|
1616
|
+
if (providerId) {
|
|
1617
|
+
provider = await getProviderById(providerId);
|
|
1618
|
+
}
|
|
1619
|
+
if (!provider) {
|
|
1620
|
+
throw new Error("no wallet provider was found");
|
|
1621
|
+
}
|
|
1622
|
+
if (!method) {
|
|
1623
|
+
throw new Error("A wallet method is required");
|
|
1624
|
+
}
|
|
1625
|
+
if (!cache.providerInfo) {
|
|
1626
|
+
const infoResult = await requestInternal(provider, "getInfo", null);
|
|
1627
|
+
if (infoResult.status === "success") {
|
|
1628
|
+
cache.providerInfo = infoResult.result;
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
if (cache.providerInfo) {
|
|
1632
|
+
if (method === "getInfo") {
|
|
1633
|
+
return {
|
|
1634
|
+
status: "success",
|
|
1635
|
+
result: cache.providerInfo
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1638
|
+
const sanitized = sanitizeRequest(method, params, cache.providerInfo);
|
|
1639
|
+
if (sanitized.overrideResponse) {
|
|
1640
|
+
return sanitized.overrideResponse;
|
|
1641
|
+
}
|
|
1642
|
+
method = sanitized.method;
|
|
1643
|
+
params = sanitized.params;
|
|
1644
|
+
}
|
|
1645
|
+
return requestInternal(provider, method, params);
|
|
1646
|
+
};
|
|
1565
1647
|
var addListener = (...rawArgs) => {
|
|
1566
1648
|
const [listenerInfo, providerId] = (() => {
|
|
1567
1649
|
if (rawArgs.length === 1) {
|
|
@@ -2567,6 +2649,7 @@ var signMultipleTransactions = async (options) => {
|
|
|
2567
2649
|
DefaultAdaptersInfo,
|
|
2568
2650
|
MessageSigningProtocols,
|
|
2569
2651
|
PermissionRequestParams,
|
|
2652
|
+
ProviderPlatform,
|
|
2570
2653
|
RpcErrorCode,
|
|
2571
2654
|
RpcIdSchema,
|
|
2572
2655
|
SatsConnectAdapter,
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/request/index.ts
|
|
2
|
+
import * as v25 from "valibot";
|
|
3
|
+
|
|
1
4
|
// src/provider/types.ts
|
|
2
5
|
import * as v4 from "valibot";
|
|
3
6
|
|
|
@@ -191,8 +194,53 @@ function getSupportedWallets() {
|
|
|
191
194
|
return wallets;
|
|
192
195
|
}
|
|
193
196
|
|
|
194
|
-
// src/request/
|
|
195
|
-
|
|
197
|
+
// src/request/sanitizeRequest.ts
|
|
198
|
+
var sanitizeRequest = (method, params, providerInfo) => {
|
|
199
|
+
try {
|
|
200
|
+
const [major, minor, patch] = providerInfo.version.split(".").map((part) => parseInt(part, 10));
|
|
201
|
+
const platform = providerInfo.platform;
|
|
202
|
+
if (
|
|
203
|
+
// platform is missing for versions < 1.5.0 on web and < 1.55.0 on mobile
|
|
204
|
+
!platform || platform === "web" /* Web */ && major <= 1 && minor <= 4 || platform === "mobile" /* Mobile */ && major <= 1 && minor <= 54
|
|
205
|
+
) {
|
|
206
|
+
const v1Sanitized = sanitizeAddressPurposeRequest(method, params);
|
|
207
|
+
method = v1Sanitized.method;
|
|
208
|
+
params = v1Sanitized.params;
|
|
209
|
+
}
|
|
210
|
+
} catch {
|
|
211
|
+
}
|
|
212
|
+
return { method, params };
|
|
213
|
+
};
|
|
214
|
+
var sanitizeAddressPurposeRequest = (method, params) => {
|
|
215
|
+
const filterPurposes = (purposes) => purposes?.filter(
|
|
216
|
+
(purpose) => purpose !== "spark" /* Spark */ && purpose !== "starknet" /* Starknet */
|
|
217
|
+
);
|
|
218
|
+
if (method === "wallet_connect") {
|
|
219
|
+
const typedParams = params;
|
|
220
|
+
if (!typedParams) {
|
|
221
|
+
return { method, params };
|
|
222
|
+
}
|
|
223
|
+
const { addresses, ...rest } = typedParams;
|
|
224
|
+
const overrideParams = {
|
|
225
|
+
...rest,
|
|
226
|
+
addresses: filterPurposes(addresses)
|
|
227
|
+
};
|
|
228
|
+
return { method, params: overrideParams };
|
|
229
|
+
}
|
|
230
|
+
if (method === "getAccounts") {
|
|
231
|
+
const typedParams = params;
|
|
232
|
+
const { purposes, ...rest } = typedParams;
|
|
233
|
+
const overrideParams = { ...rest, purposes: filterPurposes(purposes) };
|
|
234
|
+
return { method, params: overrideParams };
|
|
235
|
+
}
|
|
236
|
+
if (method === "getAddresses") {
|
|
237
|
+
const typedParams = params;
|
|
238
|
+
const { purposes, ...rest } = typedParams;
|
|
239
|
+
const overrideParams = { ...rest, purposes: filterPurposes(purposes) };
|
|
240
|
+
return { method, params: overrideParams };
|
|
241
|
+
}
|
|
242
|
+
return { method, params };
|
|
243
|
+
};
|
|
196
244
|
|
|
197
245
|
// src/request/types/btcMethods.ts
|
|
198
246
|
import * as v6 from "valibot";
|
|
@@ -411,6 +459,11 @@ var addNetworkResultSchema = v5.object({
|
|
|
411
459
|
});
|
|
412
460
|
|
|
413
461
|
// src/request/types/btcMethods.ts
|
|
462
|
+
var ProviderPlatform = /* @__PURE__ */ ((ProviderPlatform2) => {
|
|
463
|
+
ProviderPlatform2["Web"] = "web";
|
|
464
|
+
ProviderPlatform2["Mobile"] = "mobile";
|
|
465
|
+
return ProviderPlatform2;
|
|
466
|
+
})(ProviderPlatform || {});
|
|
414
467
|
var getInfoMethodName = "getInfo";
|
|
415
468
|
var getInfoParamsSchema = v6.nullish(v6.null());
|
|
416
469
|
var getInfoResultSchema = v6.object({
|
|
@@ -418,6 +471,10 @@ var getInfoResultSchema = v6.object({
|
|
|
418
471
|
* Version of the wallet.
|
|
419
472
|
*/
|
|
420
473
|
version: v6.string(),
|
|
474
|
+
/**
|
|
475
|
+
* The platform the wallet is running on (web or mobile).
|
|
476
|
+
*/
|
|
477
|
+
platform: v6.optional(v6.enum(ProviderPlatform)),
|
|
421
478
|
/**
|
|
422
479
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
423
480
|
*/
|
|
@@ -1295,17 +1352,8 @@ var stxTransferStxRequestMessageSchema = v24.object({
|
|
|
1295
1352
|
});
|
|
1296
1353
|
|
|
1297
1354
|
// src/request/index.ts
|
|
1298
|
-
var
|
|
1299
|
-
|
|
1300
|
-
if (providerId) {
|
|
1301
|
-
provider = await getProviderById(providerId);
|
|
1302
|
-
}
|
|
1303
|
-
if (!provider) {
|
|
1304
|
-
throw new Error("no wallet provider was found");
|
|
1305
|
-
}
|
|
1306
|
-
if (!method) {
|
|
1307
|
-
throw new Error("A wallet method is required");
|
|
1308
|
-
}
|
|
1355
|
+
var cache = {};
|
|
1356
|
+
var requestInternal = async (provider, method, params) => {
|
|
1309
1357
|
const response = await provider.request(method, params);
|
|
1310
1358
|
if (v25.is(rpcErrorResponseMessageSchema, response)) {
|
|
1311
1359
|
return {
|
|
@@ -1328,6 +1376,39 @@ var request = async (method, params, providerId) => {
|
|
|
1328
1376
|
}
|
|
1329
1377
|
};
|
|
1330
1378
|
};
|
|
1379
|
+
var request = async (method, params, providerId) => {
|
|
1380
|
+
let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
|
|
1381
|
+
if (providerId) {
|
|
1382
|
+
provider = await getProviderById(providerId);
|
|
1383
|
+
}
|
|
1384
|
+
if (!provider) {
|
|
1385
|
+
throw new Error("no wallet provider was found");
|
|
1386
|
+
}
|
|
1387
|
+
if (!method) {
|
|
1388
|
+
throw new Error("A wallet method is required");
|
|
1389
|
+
}
|
|
1390
|
+
if (!cache.providerInfo) {
|
|
1391
|
+
const infoResult = await requestInternal(provider, "getInfo", null);
|
|
1392
|
+
if (infoResult.status === "success") {
|
|
1393
|
+
cache.providerInfo = infoResult.result;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
if (cache.providerInfo) {
|
|
1397
|
+
if (method === "getInfo") {
|
|
1398
|
+
return {
|
|
1399
|
+
status: "success",
|
|
1400
|
+
result: cache.providerInfo
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1403
|
+
const sanitized = sanitizeRequest(method, params, cache.providerInfo);
|
|
1404
|
+
if (sanitized.overrideResponse) {
|
|
1405
|
+
return sanitized.overrideResponse;
|
|
1406
|
+
}
|
|
1407
|
+
method = sanitized.method;
|
|
1408
|
+
params = sanitized.params;
|
|
1409
|
+
}
|
|
1410
|
+
return requestInternal(provider, method, params);
|
|
1411
|
+
};
|
|
1331
1412
|
var addListener = (...rawArgs) => {
|
|
1332
1413
|
const [listenerInfo, providerId] = (() => {
|
|
1333
1414
|
if (rawArgs.length === 1) {
|
|
@@ -2332,6 +2413,7 @@ export {
|
|
|
2332
2413
|
DefaultAdaptersInfo,
|
|
2333
2414
|
MessageSigningProtocols,
|
|
2334
2415
|
PermissionRequestParams,
|
|
2416
|
+
ProviderPlatform,
|
|
2335
2417
|
RpcErrorCode,
|
|
2336
2418
|
RpcIdSchema,
|
|
2337
2419
|
SatsConnectAdapter,
|