@sats-connect/core 0.1.2-cc71c98 → 0.1.2-da959f1
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 +24 -28
- package/dist/index.mjs +771 -753
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -94,6 +94,25 @@ declare const signTransaction: (options: SignTransactionOptions) => Promise<void
|
|
|
94
94
|
|
|
95
95
|
declare const signMultipleTransactions: (options: SignMultipleTransactionOptions) => Promise<void>;
|
|
96
96
|
|
|
97
|
+
declare const accountChangeEventName = "accountChange";
|
|
98
|
+
declare const accountChangeSchema: v.ObjectSchema<{
|
|
99
|
+
readonly type: v.LiteralSchema<"accountChange", undefined>;
|
|
100
|
+
}, undefined>;
|
|
101
|
+
type AccountChangeEvent = v.InferOutput<typeof accountChangeSchema>;
|
|
102
|
+
declare const networkChangeEventName = "networkChange";
|
|
103
|
+
declare const networkChangeSchema: v.ObjectSchema<{
|
|
104
|
+
readonly type: v.LiteralSchema<"networkChange", undefined>;
|
|
105
|
+
}, undefined>;
|
|
106
|
+
type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;
|
|
107
|
+
declare const walletEventSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
108
|
+
readonly type: v.LiteralSchema<"accountChange", undefined>;
|
|
109
|
+
}, undefined>, v.ObjectSchema<{
|
|
110
|
+
readonly type: v.LiteralSchema<"networkChange", undefined>;
|
|
111
|
+
}, undefined>], undefined>;
|
|
112
|
+
type WalletEvent = v.InferOutput<typeof walletEventSchema>;
|
|
113
|
+
type AddListener = <const WalletEventName extends WalletEvent['type']>(eventName: WalletEventName, cb: (event: Extract<WalletEvent, {
|
|
114
|
+
type: WalletEventName;
|
|
115
|
+
}>) => void) => () => void;
|
|
97
116
|
interface BaseBitcoinProvider {
|
|
98
117
|
request: <Method extends keyof Requests>(method: Method, options: Params<Method>, providerId?: string) => Promise<RpcResponse<Method>>;
|
|
99
118
|
connect: (request: string) => Promise<GetAddressResponse>;
|
|
@@ -103,6 +122,7 @@ interface BaseBitcoinProvider {
|
|
|
103
122
|
createInscription: (request: string) => Promise<CreateInscriptionResponse>;
|
|
104
123
|
createRepeatInscriptions: (request: string) => Promise<CreateRepeatInscriptionsResponse>;
|
|
105
124
|
signMultipleTransactions: (request: string) => Promise<SignMultipleTransactionsResponse>;
|
|
125
|
+
addListener: AddListener;
|
|
106
126
|
}
|
|
107
127
|
type Capability = keyof BaseBitcoinProvider;
|
|
108
128
|
interface BitcoinProvider extends BaseBitcoinProvider {
|
|
@@ -740,32 +760,6 @@ declare const getRunesBalanceRequestMessageSchema: v.ObjectSchema<{
|
|
|
740
760
|
}, undefined>;
|
|
741
761
|
type GetRunesBalanceRequestMessage = v.InferOutput<typeof getRunesBalanceRequestMessageSchema>;
|
|
742
762
|
type GetRunesBalance = MethodParamsAndResult<v.InferOutput<typeof getRunesBalanceParamsSchema>, v.InferOutput<typeof getRunesBalanceResultSchema>>;
|
|
743
|
-
declare const transferRunesMethodName = "runes_transfer";
|
|
744
|
-
declare const transferRunesParamsSchema: v.ObjectSchema<{
|
|
745
|
-
readonly recipients: v.ArraySchema<v.ObjectSchema<{
|
|
746
|
-
readonly runeName: v.StringSchema<undefined>;
|
|
747
|
-
readonly amount: v.StringSchema<undefined>;
|
|
748
|
-
readonly address: v.StringSchema<undefined>;
|
|
749
|
-
}, undefined>, undefined>;
|
|
750
|
-
}, undefined>;
|
|
751
|
-
declare const transferRunesSchema: v.ObjectSchema<{
|
|
752
|
-
readonly method: v.LiteralSchema<"runes_transfer", undefined>;
|
|
753
|
-
readonly params: v.ObjectSchema<{
|
|
754
|
-
readonly recipients: v.ArraySchema<v.ObjectSchema<{
|
|
755
|
-
readonly runeName: v.StringSchema<undefined>;
|
|
756
|
-
readonly amount: v.StringSchema<undefined>;
|
|
757
|
-
readonly address: v.StringSchema<undefined>;
|
|
758
|
-
}, undefined>, undefined>;
|
|
759
|
-
}, undefined>;
|
|
760
|
-
readonly id: v.StringSchema<undefined>;
|
|
761
|
-
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
762
|
-
}, undefined>;
|
|
763
|
-
type TransferRunesParams = v.InferOutput<typeof transferRunesParamsSchema>;
|
|
764
|
-
declare const TransferRunesResultSchema: v.ObjectSchema<{
|
|
765
|
-
readonly txid: v.StringSchema<undefined>;
|
|
766
|
-
}, undefined>;
|
|
767
|
-
type TransferRunesResult = v.InferOutput<typeof TransferRunesResultSchema>;
|
|
768
|
-
type TransferRunes = MethodParamsAndResult<TransferRunesParams, TransferRunesResult>;
|
|
769
763
|
|
|
770
764
|
interface Pubkey {
|
|
771
765
|
/**
|
|
@@ -1083,7 +1077,6 @@ interface RunesRequests {
|
|
|
1083
1077
|
runes_estimateRbfOrder: EstimateRbfOrder;
|
|
1084
1078
|
runes_rbfOrder: RbfOrder;
|
|
1085
1079
|
runes_getBalance: GetRunesBalance;
|
|
1086
|
-
runes_transfer: TransferRunes;
|
|
1087
1080
|
}
|
|
1088
1081
|
type RunesRequestMethod = keyof RunesRequests;
|
|
1089
1082
|
interface OrdinalsRequests {
|
|
@@ -1101,6 +1094,7 @@ type Return<Method> = Method extends keyof Requests ? Requests[Method]['result']
|
|
|
1101
1094
|
type Params<Method> = Method extends keyof Requests ? Requests[Method]['params'] : never;
|
|
1102
1095
|
|
|
1103
1096
|
declare const request: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletRequests | keyof OrdinalsRequests>(method: Method, params: Params<Method>, providerId?: string) => Promise<RpcResult<Method>>;
|
|
1097
|
+
declare const addListener: (event: Parameters<AddListener>[0], cb: Parameters<AddListener>[1], providerId?: string) => ReturnType<AddListener>;
|
|
1104
1098
|
|
|
1105
1099
|
declare abstract class SatsConnectAdapter {
|
|
1106
1100
|
abstract readonly id: string;
|
|
@@ -1112,6 +1106,7 @@ declare abstract class SatsConnectAdapter {
|
|
|
1112
1106
|
private estimateRbfOrder;
|
|
1113
1107
|
private rbfOrder;
|
|
1114
1108
|
request<Method extends keyof Requests>(method: Method, params: Params<Method>): Promise<RpcResult<Method>>;
|
|
1109
|
+
abstract addListener: AddListener;
|
|
1115
1110
|
protected abstract requestInternal<Method extends keyof Requests>(method: Method, params: Params<Method>): Promise<RpcResult<Method>>;
|
|
1116
1111
|
}
|
|
1117
1112
|
|
|
@@ -1119,9 +1114,10 @@ declare class BaseAdapter extends SatsConnectAdapter {
|
|
|
1119
1114
|
id: string;
|
|
1120
1115
|
constructor(providerId: string);
|
|
1121
1116
|
requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletRequests | keyof OrdinalsRequests>(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
|
|
1117
|
+
addListener: AddListener;
|
|
1122
1118
|
}
|
|
1123
1119
|
|
|
1124
1120
|
declare const DefaultAdaptersInfo: Record<string, Provider>;
|
|
1125
1121
|
declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
|
|
1126
1122
|
|
|
1127
|
-
export { 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 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
|
|
1123
|
+
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 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, walletEventSchema, walletTypeSchema, walletTypes };
|