@sats-connect/core 0.8.1-a6a42ae → 0.8.1-c2412c4
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 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +61 -28
- package/dist/index.mjs +60 -28
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -346,7 +346,6 @@ type ListenerInfo = {
|
|
|
346
346
|
};
|
|
347
347
|
type AddListener = (arg: ListenerInfo) => () => void;
|
|
348
348
|
interface BaseBitcoinProvider {
|
|
349
|
-
version?: number;
|
|
350
349
|
request: <Method extends keyof Requests>(method: Method, options: Params<Method>, providerId?: string) => Promise<RpcResponse<Method>>;
|
|
351
350
|
connect: (request: string) => Promise<GetAddressResponse>;
|
|
352
351
|
signMessage: (request: string) => Promise<SignMessageResponse>;
|
|
@@ -359,7 +358,6 @@ interface BaseBitcoinProvider {
|
|
|
359
358
|
}
|
|
360
359
|
type Capability = keyof BaseBitcoinProvider;
|
|
361
360
|
interface BitcoinProvider extends BaseBitcoinProvider {
|
|
362
|
-
version: 1;
|
|
363
361
|
getCapabilities?: (request: string) => Promise<GetCapabilitiesResponse>;
|
|
364
362
|
}
|
|
365
363
|
interface Provider {
|
|
@@ -396,6 +394,10 @@ declare function getDefaultProvider(): string | null;
|
|
|
396
394
|
declare function removeDefaultProvider(): void;
|
|
397
395
|
declare function getSupportedWallets(): SupportedWallet[];
|
|
398
396
|
|
|
397
|
+
declare enum ProviderPlatform {
|
|
398
|
+
Web = "web",
|
|
399
|
+
Mobile = "mobile"
|
|
400
|
+
}
|
|
399
401
|
declare const getInfoMethodName = "getInfo";
|
|
400
402
|
declare const getInfoParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
|
|
401
403
|
type GetInfoParams = v.InferOutput<typeof getInfoParamsSchema>;
|
|
@@ -404,6 +406,10 @@ declare const getInfoResultSchema: v.ObjectSchema<{
|
|
|
404
406
|
* Version of the wallet.
|
|
405
407
|
*/
|
|
406
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>;
|
|
407
413
|
/**
|
|
408
414
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
409
415
|
*/
|
|
@@ -2198,4 +2204,4 @@ declare class BaseAdapter extends SatsConnectAdapter {
|
|
|
2198
2204
|
declare const DefaultAdaptersInfo: Record<string, Provider>;
|
|
2199
2205
|
declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
|
|
2200
2206
|
|
|
2201
|
-
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
|
@@ -346,7 +346,6 @@ type ListenerInfo = {
|
|
|
346
346
|
};
|
|
347
347
|
type AddListener = (arg: ListenerInfo) => () => void;
|
|
348
348
|
interface BaseBitcoinProvider {
|
|
349
|
-
version?: number;
|
|
350
349
|
request: <Method extends keyof Requests>(method: Method, options: Params<Method>, providerId?: string) => Promise<RpcResponse<Method>>;
|
|
351
350
|
connect: (request: string) => Promise<GetAddressResponse>;
|
|
352
351
|
signMessage: (request: string) => Promise<SignMessageResponse>;
|
|
@@ -359,7 +358,6 @@ interface BaseBitcoinProvider {
|
|
|
359
358
|
}
|
|
360
359
|
type Capability = keyof BaseBitcoinProvider;
|
|
361
360
|
interface BitcoinProvider extends BaseBitcoinProvider {
|
|
362
|
-
version: 1;
|
|
363
361
|
getCapabilities?: (request: string) => Promise<GetCapabilitiesResponse>;
|
|
364
362
|
}
|
|
365
363
|
interface Provider {
|
|
@@ -396,6 +394,10 @@ declare function getDefaultProvider(): string | null;
|
|
|
396
394
|
declare function removeDefaultProvider(): void;
|
|
397
395
|
declare function getSupportedWallets(): SupportedWallet[];
|
|
398
396
|
|
|
397
|
+
declare enum ProviderPlatform {
|
|
398
|
+
Web = "web",
|
|
399
|
+
Mobile = "mobile"
|
|
400
|
+
}
|
|
399
401
|
declare const getInfoMethodName = "getInfo";
|
|
400
402
|
declare const getInfoParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
|
|
401
403
|
type GetInfoParams = v.InferOutput<typeof getInfoParamsSchema>;
|
|
@@ -404,6 +406,10 @@ declare const getInfoResultSchema: v.ObjectSchema<{
|
|
|
404
406
|
* Version of the wallet.
|
|
405
407
|
*/
|
|
406
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>;
|
|
407
413
|
/**
|
|
408
414
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
409
415
|
*/
|
|
@@ -2198,4 +2204,4 @@ declare class BaseAdapter extends SatsConnectAdapter {
|
|
|
2198
2204
|
declare const DefaultAdaptersInfo: Record<string, Provider>;
|
|
2199
2205
|
declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
|
|
2200
2206
|
|
|
2201
|
-
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,
|
|
@@ -429,15 +430,23 @@ function getSupportedWallets() {
|
|
|
429
430
|
}
|
|
430
431
|
|
|
431
432
|
// src/request/sanitizeRequest.ts
|
|
432
|
-
var sanitizeRequest = (method, params,
|
|
433
|
-
|
|
434
|
-
const
|
|
435
|
-
|
|
436
|
-
|
|
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 {
|
|
437
446
|
}
|
|
438
447
|
return { method, params };
|
|
439
448
|
};
|
|
440
|
-
var
|
|
449
|
+
var sanitizeAddressPurposeRequest = (method, params) => {
|
|
441
450
|
const filterPurposes = (purposes) => purposes?.filter(
|
|
442
451
|
(purpose) => purpose !== "spark" /* Spark */ && purpose !== "starknet" /* Starknet */
|
|
443
452
|
);
|
|
@@ -685,6 +694,11 @@ var addNetworkResultSchema = v5.object({
|
|
|
685
694
|
});
|
|
686
695
|
|
|
687
696
|
// src/request/types/btcMethods.ts
|
|
697
|
+
var ProviderPlatform = /* @__PURE__ */ ((ProviderPlatform2) => {
|
|
698
|
+
ProviderPlatform2["Web"] = "web";
|
|
699
|
+
ProviderPlatform2["Mobile"] = "mobile";
|
|
700
|
+
return ProviderPlatform2;
|
|
701
|
+
})(ProviderPlatform || {});
|
|
688
702
|
var getInfoMethodName = "getInfo";
|
|
689
703
|
var getInfoParamsSchema = v6.nullish(v6.null());
|
|
690
704
|
var getInfoResultSchema = v6.object({
|
|
@@ -692,6 +706,10 @@ var getInfoResultSchema = v6.object({
|
|
|
692
706
|
* Version of the wallet.
|
|
693
707
|
*/
|
|
694
708
|
version: v6.string(),
|
|
709
|
+
/**
|
|
710
|
+
* The platform the wallet is running on (web or mobile).
|
|
711
|
+
*/
|
|
712
|
+
platform: v6.optional(v6.enum(ProviderPlatform)),
|
|
695
713
|
/**
|
|
696
714
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
697
715
|
*/
|
|
@@ -1569,27 +1587,9 @@ var stxTransferStxRequestMessageSchema = v24.object({
|
|
|
1569
1587
|
});
|
|
1570
1588
|
|
|
1571
1589
|
// src/request/index.ts
|
|
1572
|
-
var
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
provider = await getProviderById(providerId);
|
|
1576
|
-
}
|
|
1577
|
-
if (!provider) {
|
|
1578
|
-
throw new Error("no wallet provider was found");
|
|
1579
|
-
}
|
|
1580
|
-
if (!method) {
|
|
1581
|
-
throw new Error("A wallet method is required");
|
|
1582
|
-
}
|
|
1583
|
-
const providerVersion = provider.version ?? 0;
|
|
1584
|
-
const {
|
|
1585
|
-
method: sanitizedMethod,
|
|
1586
|
-
params: sanitizedParams,
|
|
1587
|
-
overrideResponse
|
|
1588
|
-
} = sanitizeRequest(method, params, providerVersion);
|
|
1589
|
-
if (overrideResponse) {
|
|
1590
|
-
return overrideResponse;
|
|
1591
|
-
}
|
|
1592
|
-
const response = await provider.request(sanitizedMethod, sanitizedParams);
|
|
1590
|
+
var cache = {};
|
|
1591
|
+
var requestInternal = async (provider, method, params) => {
|
|
1592
|
+
const response = await provider.request(method, params);
|
|
1593
1593
|
if (v25.is(rpcErrorResponseMessageSchema, response)) {
|
|
1594
1594
|
return {
|
|
1595
1595
|
status: "error",
|
|
@@ -1611,6 +1611,39 @@ var request = async (method, params, providerId) => {
|
|
|
1611
1611
|
}
|
|
1612
1612
|
};
|
|
1613
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
|
+
};
|
|
1614
1647
|
var addListener = (...rawArgs) => {
|
|
1615
1648
|
const [listenerInfo, providerId] = (() => {
|
|
1616
1649
|
if (rawArgs.length === 1) {
|
|
@@ -2412,7 +2445,6 @@ var extractOrValidateCapabilities = (provider, reportedCapabilities) => {
|
|
|
2412
2445
|
return true;
|
|
2413
2446
|
};
|
|
2414
2447
|
const capabilityMap = {
|
|
2415
|
-
version: validateCapability("version"),
|
|
2416
2448
|
request: validateCapability("request"),
|
|
2417
2449
|
connect: validateCapability("connect"),
|
|
2418
2450
|
signMessage: validateCapability("signMessage"),
|
|
@@ -2617,6 +2649,7 @@ var signMultipleTransactions = async (options) => {
|
|
|
2617
2649
|
DefaultAdaptersInfo,
|
|
2618
2650
|
MessageSigningProtocols,
|
|
2619
2651
|
PermissionRequestParams,
|
|
2652
|
+
ProviderPlatform,
|
|
2620
2653
|
RpcErrorCode,
|
|
2621
2654
|
RpcIdSchema,
|
|
2622
2655
|
SatsConnectAdapter,
|
package/dist/index.mjs
CHANGED
|
@@ -195,15 +195,23 @@ function getSupportedWallets() {
|
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
// src/request/sanitizeRequest.ts
|
|
198
|
-
var sanitizeRequest = (method, params,
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
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 {
|
|
203
211
|
}
|
|
204
212
|
return { method, params };
|
|
205
213
|
};
|
|
206
|
-
var
|
|
214
|
+
var sanitizeAddressPurposeRequest = (method, params) => {
|
|
207
215
|
const filterPurposes = (purposes) => purposes?.filter(
|
|
208
216
|
(purpose) => purpose !== "spark" /* Spark */ && purpose !== "starknet" /* Starknet */
|
|
209
217
|
);
|
|
@@ -451,6 +459,11 @@ var addNetworkResultSchema = v5.object({
|
|
|
451
459
|
});
|
|
452
460
|
|
|
453
461
|
// src/request/types/btcMethods.ts
|
|
462
|
+
var ProviderPlatform = /* @__PURE__ */ ((ProviderPlatform2) => {
|
|
463
|
+
ProviderPlatform2["Web"] = "web";
|
|
464
|
+
ProviderPlatform2["Mobile"] = "mobile";
|
|
465
|
+
return ProviderPlatform2;
|
|
466
|
+
})(ProviderPlatform || {});
|
|
454
467
|
var getInfoMethodName = "getInfo";
|
|
455
468
|
var getInfoParamsSchema = v6.nullish(v6.null());
|
|
456
469
|
var getInfoResultSchema = v6.object({
|
|
@@ -458,6 +471,10 @@ var getInfoResultSchema = v6.object({
|
|
|
458
471
|
* Version of the wallet.
|
|
459
472
|
*/
|
|
460
473
|
version: v6.string(),
|
|
474
|
+
/**
|
|
475
|
+
* The platform the wallet is running on (web or mobile).
|
|
476
|
+
*/
|
|
477
|
+
platform: v6.optional(v6.enum(ProviderPlatform)),
|
|
461
478
|
/**
|
|
462
479
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
463
480
|
*/
|
|
@@ -1335,27 +1352,9 @@ var stxTransferStxRequestMessageSchema = v24.object({
|
|
|
1335
1352
|
});
|
|
1336
1353
|
|
|
1337
1354
|
// src/request/index.ts
|
|
1338
|
-
var
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
provider = await getProviderById(providerId);
|
|
1342
|
-
}
|
|
1343
|
-
if (!provider) {
|
|
1344
|
-
throw new Error("no wallet provider was found");
|
|
1345
|
-
}
|
|
1346
|
-
if (!method) {
|
|
1347
|
-
throw new Error("A wallet method is required");
|
|
1348
|
-
}
|
|
1349
|
-
const providerVersion = provider.version ?? 0;
|
|
1350
|
-
const {
|
|
1351
|
-
method: sanitizedMethod,
|
|
1352
|
-
params: sanitizedParams,
|
|
1353
|
-
overrideResponse
|
|
1354
|
-
} = sanitizeRequest(method, params, providerVersion);
|
|
1355
|
-
if (overrideResponse) {
|
|
1356
|
-
return overrideResponse;
|
|
1357
|
-
}
|
|
1358
|
-
const response = await provider.request(sanitizedMethod, sanitizedParams);
|
|
1355
|
+
var cache = {};
|
|
1356
|
+
var requestInternal = async (provider, method, params) => {
|
|
1357
|
+
const response = await provider.request(method, params);
|
|
1359
1358
|
if (v25.is(rpcErrorResponseMessageSchema, response)) {
|
|
1360
1359
|
return {
|
|
1361
1360
|
status: "error",
|
|
@@ -1377,6 +1376,39 @@ var request = async (method, params, providerId) => {
|
|
|
1377
1376
|
}
|
|
1378
1377
|
};
|
|
1379
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
|
+
};
|
|
1380
1412
|
var addListener = (...rawArgs) => {
|
|
1381
1413
|
const [listenerInfo, providerId] = (() => {
|
|
1382
1414
|
if (rawArgs.length === 1) {
|
|
@@ -2178,7 +2210,6 @@ var extractOrValidateCapabilities = (provider, reportedCapabilities) => {
|
|
|
2178
2210
|
return true;
|
|
2179
2211
|
};
|
|
2180
2212
|
const capabilityMap = {
|
|
2181
|
-
version: validateCapability("version"),
|
|
2182
2213
|
request: validateCapability("request"),
|
|
2183
2214
|
connect: validateCapability("connect"),
|
|
2184
2215
|
signMessage: validateCapability("signMessage"),
|
|
@@ -2382,6 +2413,7 @@ export {
|
|
|
2382
2413
|
DefaultAdaptersInfo,
|
|
2383
2414
|
MessageSigningProtocols,
|
|
2384
2415
|
PermissionRequestParams,
|
|
2416
|
+
ProviderPlatform,
|
|
2385
2417
|
RpcErrorCode,
|
|
2386
2418
|
RpcIdSchema,
|
|
2387
2419
|
SatsConnectAdapter,
|