@sats-connect/core 0.2.3-9fcbd9e → 0.3.0-380bb2b
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 +22 -1
- package/dist/index.mjs +25 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -104,10 +104,17 @@ declare const networkChangeSchema: v.ObjectSchema<{
|
|
|
104
104
|
readonly type: v.LiteralSchema<"networkChange", undefined>;
|
|
105
105
|
}, undefined>;
|
|
106
106
|
type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;
|
|
107
|
+
declare const disconnectEventName = "disconnect";
|
|
108
|
+
declare const disconnectSchema: v.ObjectSchema<{
|
|
109
|
+
readonly type: v.LiteralSchema<"disconnect", undefined>;
|
|
110
|
+
}, undefined>;
|
|
111
|
+
type DisconnectEvent = v.InferOutput<typeof disconnectSchema>;
|
|
107
112
|
declare const walletEventSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
108
113
|
readonly type: v.LiteralSchema<"accountChange", undefined>;
|
|
109
114
|
}, undefined>, v.ObjectSchema<{
|
|
110
115
|
readonly type: v.LiteralSchema<"networkChange", undefined>;
|
|
116
|
+
}, undefined>, v.ObjectSchema<{
|
|
117
|
+
readonly type: v.LiteralSchema<"disconnect", undefined>;
|
|
111
118
|
}, undefined>], undefined>;
|
|
112
119
|
type WalletEvent = v.InferOutput<typeof walletEventSchema>;
|
|
113
120
|
type AddListener = <const WalletEventName extends WalletEvent['type']>(eventName: WalletEventName, cb: (event: Extract<WalletEvent, {
|
|
@@ -312,6 +319,9 @@ interface GetAddressResponse {
|
|
|
312
319
|
}
|
|
313
320
|
type GetAddressOptions = RequestOptions<GetAddressPayload, GetAddressResponse>;
|
|
314
321
|
|
|
322
|
+
/**
|
|
323
|
+
* @deprecated Use `request()` instead
|
|
324
|
+
*/
|
|
315
325
|
declare const getAddress: (options: GetAddressOptions) => Promise<void>;
|
|
316
326
|
|
|
317
327
|
declare const getInfoMethodName = "getInfo";
|
|
@@ -1069,6 +1079,16 @@ declare const getWalletTypeRequestMessageSchema: v.ObjectSchema<{
|
|
|
1069
1079
|
readonly params: v.OptionalSchema<v.UnionSchema<[v.ArraySchema<v.UnknownSchema, undefined>, v.LooseObjectSchema<{}, undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
1070
1080
|
}, undefined>;
|
|
1071
1081
|
type GetWalletType = MethodParamsAndResult<v.InferOutput<typeof getWalletTypeParamsSchema>, v.InferOutput<typeof getWalletTypeResultSchema>>;
|
|
1082
|
+
declare const getPermissionsMethodName = "wallet_getPermissions";
|
|
1083
|
+
declare const getPermissionsParamsSchema: v.NullishSchema<v.NullSchema<undefined>, never>;
|
|
1084
|
+
declare const getPermissionsResultSchema: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1085
|
+
declare const getPermissionsRequestMessageSchema: v.ObjectSchema<{
|
|
1086
|
+
readonly method: v.LiteralSchema<"wallet_getPermissions", undefined>;
|
|
1087
|
+
readonly id: v.StringSchema<undefined>;
|
|
1088
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1089
|
+
readonly params: v.OptionalSchema<v.UnionSchema<[v.ArraySchema<v.UnknownSchema, undefined>, v.LooseObjectSchema<{}, undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
1090
|
+
}, undefined>;
|
|
1091
|
+
type GetPermissions = MethodParamsAndResult<v.InferOutput<typeof getPermissionsParamsSchema>, v.InferOutput<typeof getPermissionsResultSchema>>;
|
|
1072
1092
|
|
|
1073
1093
|
declare const walletTypes: readonly ["software", "ledger"];
|
|
1074
1094
|
declare const walletTypeSchema: v.PicklistSchema<readonly ["software", "ledger"], undefined>;
|
|
@@ -1116,6 +1136,7 @@ interface WalletRequests {
|
|
|
1116
1136
|
wallet_requestPermissions: RequestPermissions;
|
|
1117
1137
|
wallet_renouncePermissions: RenouncePermissions;
|
|
1118
1138
|
wallet_getWalletType: GetWalletType;
|
|
1139
|
+
wallet_getPermissions: GetPermissions;
|
|
1119
1140
|
}
|
|
1120
1141
|
type Requests = BtcRequests & StxRequests & RunesRequests & WalletRequests & OrdinalsRequests;
|
|
1121
1142
|
type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : never;
|
|
@@ -1148,4 +1169,4 @@ declare class BaseAdapter extends SatsConnectAdapter {
|
|
|
1148
1169
|
declare const DefaultAdaptersInfo: Record<string, Provider>;
|
|
1149
1170
|
declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
|
|
1150
1171
|
|
|
1151
|
-
export { type AccountChangeEvent, type AddListener, type Address$1 as Address, AddressPurpose, AddressType, BaseAdapter, type BitcoinNetwork, BitcoinNetworkType, type BitcoinProvider, type BtcRequestMethod, type BtcRequests, type CallContractParams, type CallContractResult, type Capability, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type DeployContractParams, type DeployContractResult, type EstimateRbfOrder, type EstimateRunesEtch, type EstimateRunesEtchParams, type EstimateRunesEtchResult, type EstimateRunesMint, type EstimateRunesMintParams, type EstimateRunesMintResult, type EtchRunes, type EtchRunesParams, type EtchRunesResult, 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 GetCapabilitiesOptions, type GetCapabilitiesPayload, type GetCapabilitiesResponse, type GetInfo, type GetInfoParams, type GetInfoRequestMessage, type GetInfoResult, type GetInscriptions, type GetOrder, type GetRunesBalance, type GetRunesBalanceParams, type GetRunesBalanceRequestMessage, type GetRunesBalanceResult, type GetWalletType, type InputToSign, MessageSigningProtocols, type MethodParamsAndResult, type MintRunes, type MintRunesParams, type MintRunesResult, type NetworkChangeEvent, type OrdinalsRequestMethod, type OrdinalsRequests, type Params, type Provider, type PsbtPayload, type RbfOrder, type Recipient$2 as Recipient, type RenouncePermissions, type RequestOptions, type RequestPayload, type RequestPermissions, type Requests, type Return, type RpcBase, type RpcError, RpcErrorCode, type RpcErrorResponse, type RpcErrorResponseMessage, type RpcId, RpcIdSchema, type RpcRequest, type RpcRequestMessage, type RpcResponse, type RpcResponseMessage, type RpcResult, type RpcSuccessResponse, type RpcSuccessResponseMessage, type RunesRequestMethod, type RunesRequests, SatsConnectAdapter, type SendBtcTransactionOptions, type SendBtcTransactionPayload, type SendBtcTransactionResponse, type SendInscriptions, type SendTransfer, type SendTransferParams, type SerializedRecipient, type SerializedSendBtcTransactionPayload, type SignMessage, type SignMessageOptions, type SignMessageParams, type SignMessagePayload, type SignMessageRequestMessage, type SignMessageResponse, type SignMessageResult, type SignMultiplePsbtPayload, type SignMultipleTransactionOptions, type SignMultipleTransactionsPayload, type SignMultipleTransactionsResponse, type SignPsbt, type SignPsbtParams, type SignPsbtResult, type SignStructuredMessageResult, type SignStxMessageParams, type SignStxMessageResult, type SignTransactionOptions, type SignTransactionPayload, type SignTransactionResponse, type StxCallContract, type StxDeployContract, type StxGetAccounts, type StxGetAccountsResult, type StxGetAddresses, type StxGetAddressesParams, type StxGetAddressesRequestMessage, type StxGetAddressesResult, type StxRequestMethod, type StxRequests, type StxSignStructuredMessage, type StxSignStxMessage, type StxSignTransaction, type StxSignTransactionParams, type StxSignTransactionRequestMessage, type StxSignTransactionResult, type StxTransferStx, type SupportedWallet, type TransferRunes, type TransferRunesParams, type TransferRunesRequest, type TransferRunesResult, TransferRunesResultSchema, type TransferStxParams, type TransferStxResult, type WalletEvent, type WalletRequests, type WalletType, accountChangeEventName, accountChangeSchema, addListener, addressSchema, createInscription, createRepeatInscriptions, defaultAdapters, getAccountsMethodName, getAccountsParamsSchema, getAccountsRequestMessageSchema, getAccountsResultSchema, getAddress, getAddressesMethodName, getAddressesParamsSchema, getAddressesRequestMessageSchema, getAddressesResultSchema, getBalanceMethodName, getBalanceParamsSchema, getBalanceRequestMessageSchema, getBalanceResultSchema, getCapabilities, getDefaultProvider, getInfoMethodName, getInfoParamsSchema, getInfoRequestMessageSchema, getInfoResultSchema, getInscriptionsMethodName, getInscriptionsParamsSchema, getInscriptionsResultSchema, getInscriptionsSchema, getProviderById, getProviderOrThrow, getProviders, getRunesBalanceMethodName, getRunesBalanceParamsSchema, getRunesBalanceRequestMessageSchema, getRunesBalanceResultSchema, getSupportedWallets, getWalletTypeMethodName, getWalletTypeParamsSchema, getWalletTypeRequestMessageSchema, getWalletTypeResultSchema, isProviderInstalled, networkChangeEventName, networkChangeSchema, removeDefaultProvider, renouncePermissionsMethodName, renouncePermissionsParamsSchema, renouncePermissionsRequestMessageSchema, renouncePermissionsResultSchema, request, requestPermissionsMethodName, requestPermissionsParamsSchema, requestPermissionsRequestMessageSchema, requestPermissionsResultSchema, rpcErrorResponseMessageSchema, rpcRequestMessageSchema, rpcResponseMessageSchema, rpcSuccessResponseMessageSchema, sendBtcTransaction, sendInscriptionsMethodName, sendInscriptionsParamsSchema, sendInscriptionsResultSchema, sendInscriptionsSchema, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signTransaction, stxGetAddressesMethodName, stxGetAddressesParamsSchema, stxGetAddressesRequestMessageSchema, stxGetAddressesResultSchema, stxSignTransactionMethodName, stxSignTransactionParamsSchema, stxSignTransactionRequestMessageSchema, stxSignTransactionResultSchema, transferRunesMethodName, transferRunesParamsSchema, transferRunesRequestSchema, walletEventSchema, walletTypeSchema, walletTypes };
|
|
1172
|
+
export { type AccountChangeEvent, type AddListener, type Address$1 as Address, AddressPurpose, AddressType, BaseAdapter, type BitcoinNetwork, BitcoinNetworkType, type BitcoinProvider, type BtcRequestMethod, type BtcRequests, type CallContractParams, type CallContractResult, type Capability, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type DeployContractParams, type DeployContractResult, type DisconnectEvent, type EstimateRbfOrder, type EstimateRunesEtch, type EstimateRunesEtchParams, type EstimateRunesEtchResult, type EstimateRunesMint, type EstimateRunesMintParams, type EstimateRunesMintResult, type EtchRunes, type EtchRunesParams, type EtchRunesResult, 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 GetCapabilitiesOptions, type GetCapabilitiesPayload, type GetCapabilitiesResponse, type GetInfo, type GetInfoParams, type GetInfoRequestMessage, type GetInfoResult, type GetInscriptions, type GetOrder, type GetPermissions, type GetRunesBalance, type GetRunesBalanceParams, type GetRunesBalanceRequestMessage, type GetRunesBalanceResult, type GetWalletType, type InputToSign, MessageSigningProtocols, type MethodParamsAndResult, type MintRunes, type MintRunesParams, type MintRunesResult, type NetworkChangeEvent, type OrdinalsRequestMethod, type OrdinalsRequests, type Params, type Provider, type PsbtPayload, type RbfOrder, type Recipient$2 as Recipient, type RenouncePermissions, type RequestOptions, type RequestPayload, type RequestPermissions, type Requests, type Return, type RpcBase, type RpcError, RpcErrorCode, type RpcErrorResponse, type RpcErrorResponseMessage, type RpcId, RpcIdSchema, type RpcRequest, type RpcRequestMessage, type RpcResponse, type RpcResponseMessage, type RpcResult, type RpcSuccessResponse, type RpcSuccessResponseMessage, type RunesRequestMethod, type RunesRequests, SatsConnectAdapter, type SendBtcTransactionOptions, type SendBtcTransactionPayload, type SendBtcTransactionResponse, type SendInscriptions, type SendTransfer, type SendTransferParams, type SerializedRecipient, type SerializedSendBtcTransactionPayload, type SignMessage, type SignMessageOptions, type SignMessageParams, type SignMessagePayload, type SignMessageRequestMessage, type SignMessageResponse, type SignMessageResult, type SignMultiplePsbtPayload, type SignMultipleTransactionOptions, type SignMultipleTransactionsPayload, type SignMultipleTransactionsResponse, type SignPsbt, type SignPsbtParams, type SignPsbtResult, type SignStructuredMessageResult, type SignStxMessageParams, type SignStxMessageResult, type SignTransactionOptions, type SignTransactionPayload, type SignTransactionResponse, type StxCallContract, type StxDeployContract, type StxGetAccounts, type StxGetAccountsResult, type StxGetAddresses, type StxGetAddressesParams, type StxGetAddressesRequestMessage, type StxGetAddressesResult, type StxRequestMethod, type StxRequests, type StxSignStructuredMessage, type StxSignStxMessage, type StxSignTransaction, type StxSignTransactionParams, type StxSignTransactionRequestMessage, type StxSignTransactionResult, type StxTransferStx, type SupportedWallet, type TransferRunes, type TransferRunesParams, type TransferRunesRequest, type TransferRunesResult, TransferRunesResultSchema, type TransferStxParams, type TransferStxResult, type WalletEvent, type WalletRequests, type WalletType, accountChangeEventName, accountChangeSchema, addListener, addressSchema, createInscription, createRepeatInscriptions, defaultAdapters, disconnectEventName, disconnectSchema, getAccountsMethodName, getAccountsParamsSchema, getAccountsRequestMessageSchema, getAccountsResultSchema, getAddress, getAddressesMethodName, getAddressesParamsSchema, getAddressesRequestMessageSchema, getAddressesResultSchema, getBalanceMethodName, getBalanceParamsSchema, getBalanceRequestMessageSchema, getBalanceResultSchema, getCapabilities, getDefaultProvider, getInfoMethodName, getInfoParamsSchema, getInfoRequestMessageSchema, getInfoResultSchema, getInscriptionsMethodName, getInscriptionsParamsSchema, getInscriptionsResultSchema, getInscriptionsSchema, getPermissionsMethodName, getPermissionsParamsSchema, getPermissionsRequestMessageSchema, getPermissionsResultSchema, getProviderById, getProviderOrThrow, getProviders, getRunesBalanceMethodName, getRunesBalanceParamsSchema, getRunesBalanceRequestMessageSchema, getRunesBalanceResultSchema, getSupportedWallets, getWalletTypeMethodName, getWalletTypeParamsSchema, getWalletTypeRequestMessageSchema, getWalletTypeResultSchema, isProviderInstalled, networkChangeEventName, networkChangeSchema, removeDefaultProvider, renouncePermissionsMethodName, renouncePermissionsParamsSchema, renouncePermissionsRequestMessageSchema, renouncePermissionsResultSchema, request, requestPermissionsMethodName, requestPermissionsParamsSchema, requestPermissionsRequestMessageSchema, requestPermissionsResultSchema, rpcErrorResponseMessageSchema, rpcRequestMessageSchema, rpcResponseMessageSchema, rpcSuccessResponseMessageSchema, sendBtcTransaction, sendInscriptionsMethodName, sendInscriptionsParamsSchema, sendInscriptionsResultSchema, sendInscriptionsSchema, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signTransaction, stxGetAddressesMethodName, stxGetAddressesParamsSchema, stxGetAddressesRequestMessageSchema, stxGetAddressesResultSchema, stxSignTransactionMethodName, stxSignTransactionParamsSchema, stxSignTransactionRequestMessageSchema, stxSignTransactionResultSchema, transferRunesMethodName, transferRunesParamsSchema, transferRunesRequestSchema, walletEventSchema, walletTypeSchema, walletTypes };
|
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,15 @@ var networkChangeEventName = "networkChange";
|
|
|
11
11
|
var networkChangeSchema = v.object({
|
|
12
12
|
type: v.literal(networkChangeEventName)
|
|
13
13
|
});
|
|
14
|
-
var
|
|
14
|
+
var disconnectEventName = "disconnect";
|
|
15
|
+
var disconnectSchema = v.object({
|
|
16
|
+
type: v.literal(disconnectEventName)
|
|
17
|
+
});
|
|
18
|
+
var walletEventSchema = v.variant("type", [
|
|
19
|
+
accountChangeSchema,
|
|
20
|
+
networkChangeSchema,
|
|
21
|
+
disconnectSchema
|
|
22
|
+
]);
|
|
15
23
|
|
|
16
24
|
// src/provider/index.ts
|
|
17
25
|
async function getProviderOrThrow(getProvider) {
|
|
@@ -409,6 +417,16 @@ var getWalletTypeRequestMessageSchema = v7.object({
|
|
|
409
417
|
id: v7.string()
|
|
410
418
|
}).entries
|
|
411
419
|
});
|
|
420
|
+
var getPermissionsMethodName = "wallet_getPermissions";
|
|
421
|
+
var getPermissionsParamsSchema = v7.nullish(v7.null());
|
|
422
|
+
var getPermissionsResultSchema = v7.array(v7.string());
|
|
423
|
+
var getPermissionsRequestMessageSchema = v7.object({
|
|
424
|
+
...rpcRequestMessageSchema.entries,
|
|
425
|
+
...v7.object({
|
|
426
|
+
method: v7.literal(getPermissionsMethodName),
|
|
427
|
+
id: v7.string()
|
|
428
|
+
}).entries
|
|
429
|
+
});
|
|
412
430
|
|
|
413
431
|
// src/request/types/runesMethods.ts
|
|
414
432
|
import * as v8 from "valibot";
|
|
@@ -1461,6 +1479,8 @@ export {
|
|
|
1461
1479
|
createInscription,
|
|
1462
1480
|
createRepeatInscriptions,
|
|
1463
1481
|
defaultAdapters,
|
|
1482
|
+
disconnectEventName,
|
|
1483
|
+
disconnectSchema,
|
|
1464
1484
|
getAccountsMethodName,
|
|
1465
1485
|
getAccountsParamsSchema,
|
|
1466
1486
|
getAccountsRequestMessageSchema,
|
|
@@ -1484,6 +1504,10 @@ export {
|
|
|
1484
1504
|
getInscriptionsParamsSchema,
|
|
1485
1505
|
getInscriptionsResultSchema,
|
|
1486
1506
|
getInscriptionsSchema,
|
|
1507
|
+
getPermissionsMethodName,
|
|
1508
|
+
getPermissionsParamsSchema,
|
|
1509
|
+
getPermissionsRequestMessageSchema,
|
|
1510
|
+
getPermissionsResultSchema,
|
|
1487
1511
|
getProviderById,
|
|
1488
1512
|
getProviderOrThrow,
|
|
1489
1513
|
getProviders,
|