@sats-connect/core 0.0.10 → 0.0.11-2768523
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 +223 -68
- package/dist/index.mjs +282 -42
- package/package.json +6 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
|
|
1
3
|
interface GetCapabilitiesPayload extends RequestPayload {
|
|
2
4
|
}
|
|
3
5
|
type GetCapabilitiesResponse = Capability[];
|
|
@@ -141,7 +143,8 @@ declare function getSupportedWallets(): SupportedWallet[];
|
|
|
141
143
|
|
|
142
144
|
declare enum BitcoinNetworkType {
|
|
143
145
|
Mainnet = "Mainnet",
|
|
144
|
-
Testnet = "Testnet"
|
|
146
|
+
Testnet = "Testnet",
|
|
147
|
+
Signet = "Signet"
|
|
145
148
|
}
|
|
146
149
|
interface BitcoinNetwork {
|
|
147
150
|
type: BitcoinNetworkType;
|
|
@@ -156,7 +159,15 @@ interface RequestOptions<Payload extends RequestPayload, Response> {
|
|
|
156
159
|
payload: Payload;
|
|
157
160
|
getProvider?: () => Promise<BitcoinProvider | undefined>;
|
|
158
161
|
}
|
|
159
|
-
|
|
162
|
+
declare const RpcIdSchema: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
163
|
+
type RpcId = v.InferOutput<typeof RpcIdSchema>;
|
|
164
|
+
declare const rpcRequestMessageSchema: v.ObjectSchema<{
|
|
165
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
166
|
+
readonly method: v.StringSchema<undefined>;
|
|
167
|
+
readonly params: v.OptionalSchema<v.UnionSchema<[v.ArraySchema<v.UnknownSchema, undefined>, v.LooseObjectSchema<{}, undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
168
|
+
readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
169
|
+
}, undefined>;
|
|
170
|
+
type RpcRequestMessage = v.InferOutput<typeof rpcRequestMessageSchema>;
|
|
160
171
|
interface RpcBase {
|
|
161
172
|
jsonrpc: '2.0';
|
|
162
173
|
id: RpcId;
|
|
@@ -203,8 +214,31 @@ declare enum RpcErrorCode {
|
|
|
203
214
|
/**
|
|
204
215
|
* method is not supported for the address provided
|
|
205
216
|
*/
|
|
206
|
-
METHOD_NOT_SUPPORTED = -32001
|
|
207
|
-
|
|
217
|
+
METHOD_NOT_SUPPORTED = -32001,
|
|
218
|
+
/**
|
|
219
|
+
* The client does not have permission to access the requested resource.
|
|
220
|
+
*/
|
|
221
|
+
ACCESS_DENIED = -32002
|
|
222
|
+
}
|
|
223
|
+
declare const rpcSuccessResponseMessageSchema: v.ObjectSchema<{
|
|
224
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
225
|
+
readonly result: v.UnknownSchema;
|
|
226
|
+
readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
227
|
+
}, undefined>;
|
|
228
|
+
declare const rpcErrorResponseMessageSchema: v.ObjectSchema<{
|
|
229
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
230
|
+
readonly error: v.UnknownSchema;
|
|
231
|
+
readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
232
|
+
}, undefined>;
|
|
233
|
+
declare const rpcResponseMessageSchema: v.UnionSchema<[v.ObjectSchema<{
|
|
234
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
235
|
+
readonly result: v.UnknownSchema;
|
|
236
|
+
readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
237
|
+
}, undefined>, v.ObjectSchema<{
|
|
238
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
239
|
+
readonly error: v.UnknownSchema;
|
|
240
|
+
readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
241
|
+
}, undefined>], undefined>;
|
|
208
242
|
interface RpcError {
|
|
209
243
|
code: number | RpcErrorCode;
|
|
210
244
|
message: string;
|
|
@@ -242,12 +276,13 @@ declare enum AddressType {
|
|
|
242
276
|
p2tr = "p2tr",
|
|
243
277
|
stacks = "stacks"
|
|
244
278
|
}
|
|
245
|
-
|
|
246
|
-
address:
|
|
247
|
-
publicKey:
|
|
248
|
-
purpose
|
|
249
|
-
addressType
|
|
250
|
-
}
|
|
279
|
+
declare const addressSchema: v.ObjectSchema<{
|
|
280
|
+
readonly address: v.StringSchema<undefined>;
|
|
281
|
+
readonly publicKey: v.StringSchema<undefined>;
|
|
282
|
+
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
283
|
+
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
284
|
+
}, undefined>;
|
|
285
|
+
type Address$1 = v.InferOutput<typeof addressSchema>;
|
|
251
286
|
interface GetAddressResponse {
|
|
252
287
|
addresses: Address$1[];
|
|
253
288
|
}
|
|
@@ -255,59 +290,110 @@ type GetAddressOptions = RequestOptions<GetAddressPayload, GetAddressResponse>;
|
|
|
255
290
|
|
|
256
291
|
declare const getAddress: (options: GetAddressOptions) => Promise<void>;
|
|
257
292
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
*
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
293
|
+
declare const getInfoMethodName = "getInfo";
|
|
294
|
+
declare const getInfoParamsSchema: v.NullSchema<undefined>;
|
|
295
|
+
declare const getInfoResultSchema: v.ObjectSchema<{
|
|
296
|
+
/**
|
|
297
|
+
* Version of the wallet.
|
|
298
|
+
*/
|
|
299
|
+
readonly version: v.StringSchema<undefined>;
|
|
300
|
+
/**
|
|
301
|
+
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
302
|
+
*/
|
|
303
|
+
readonly methods: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, never>;
|
|
304
|
+
/**
|
|
305
|
+
* List of WBIP standards supported by the wallet. Not currently used.
|
|
306
|
+
*/
|
|
307
|
+
readonly supports: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
308
|
+
}, undefined>;
|
|
309
|
+
declare const getInfoSchema: v.ObjectSchema<{
|
|
310
|
+
readonly method: v.LiteralSchema<"getInfo", undefined>;
|
|
311
|
+
readonly params: v.NullSchema<undefined>;
|
|
312
|
+
readonly id: v.StringSchema<undefined>;
|
|
313
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
314
|
+
}, undefined>;
|
|
315
|
+
type GetInfo = MethodParamsAndResult<v.InferOutput<typeof getInfoParamsSchema>, v.InferOutput<typeof getInfoResultSchema>>;
|
|
316
|
+
declare const getAddressesMethodName = "getAddresses";
|
|
317
|
+
declare const getAddressesParamsSchema: v.ObjectSchema<{
|
|
318
|
+
/**
|
|
319
|
+
* The purposes for which to generate addresses. See
|
|
320
|
+
* {@linkcode AddressPurpose} for available purposes.
|
|
321
|
+
*/
|
|
322
|
+
readonly purposes: v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>;
|
|
323
|
+
/**
|
|
324
|
+
* A message to be displayed to the user in the request prompt.
|
|
325
|
+
*/
|
|
326
|
+
readonly message: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
327
|
+
}, undefined>;
|
|
328
|
+
declare const getAddressesResultSchema: v.ObjectSchema<{
|
|
329
|
+
/**
|
|
330
|
+
* The addresses generated for the given purposes.
|
|
331
|
+
*/
|
|
332
|
+
readonly addresses: v.ArraySchema<v.ObjectSchema<{
|
|
333
|
+
readonly address: v.StringSchema<undefined>;
|
|
334
|
+
readonly publicKey: v.StringSchema<undefined>;
|
|
335
|
+
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
336
|
+
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
337
|
+
}, undefined>, undefined>;
|
|
338
|
+
}, undefined>;
|
|
339
|
+
declare const getAddressesRequestMessageSchema: v.ObjectSchema<{
|
|
340
|
+
readonly method: v.LiteralSchema<"getAddresses", undefined>;
|
|
341
|
+
readonly params: v.ObjectSchema<{
|
|
342
|
+
/**
|
|
343
|
+
* The purposes for which to generate addresses. See
|
|
344
|
+
* {@linkcode AddressPurpose} for available purposes.
|
|
345
|
+
*/
|
|
346
|
+
readonly purposes: v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>;
|
|
347
|
+
/**
|
|
348
|
+
* A message to be displayed to the user in the request prompt.
|
|
349
|
+
*/
|
|
350
|
+
readonly message: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
351
|
+
}, undefined>;
|
|
352
|
+
readonly id: v.StringSchema<undefined>;
|
|
353
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
354
|
+
}, undefined>;
|
|
355
|
+
type GetAddresses = MethodParamsAndResult<v.InferOutput<typeof getAddressesParamsSchema>, v.InferOutput<typeof getAddressesResultSchema>>;
|
|
356
|
+
declare const signMessageMethodName = "signMessage";
|
|
357
|
+
declare const signMessageParamsSchema: v.ObjectSchema<{
|
|
287
358
|
/**
|
|
288
359
|
* The address used for signing.
|
|
289
360
|
**/
|
|
290
|
-
address:
|
|
361
|
+
readonly address: v.StringSchema<undefined>;
|
|
291
362
|
/**
|
|
292
363
|
* The message to sign.
|
|
293
364
|
**/
|
|
294
|
-
message:
|
|
295
|
-
}
|
|
296
|
-
|
|
365
|
+
readonly message: v.StringSchema<undefined>;
|
|
366
|
+
}, undefined>;
|
|
367
|
+
declare const signMessageResultSchema: v.ObjectSchema<{
|
|
297
368
|
/**
|
|
298
369
|
* The signature of the message.
|
|
299
370
|
*/
|
|
300
|
-
signature:
|
|
371
|
+
readonly signature: v.StringSchema<undefined>;
|
|
301
372
|
/**
|
|
302
373
|
* hash of the message.
|
|
303
374
|
*/
|
|
304
|
-
messageHash:
|
|
375
|
+
readonly messageHash: v.StringSchema<undefined>;
|
|
305
376
|
/**
|
|
306
377
|
* The address used for signing.
|
|
307
378
|
*/
|
|
308
|
-
address:
|
|
309
|
-
}
|
|
310
|
-
|
|
379
|
+
readonly address: v.StringSchema<undefined>;
|
|
380
|
+
}, undefined>;
|
|
381
|
+
declare const signMessageRequestMessageSchema: v.ObjectSchema<{
|
|
382
|
+
readonly method: v.LiteralSchema<"signMessage", undefined>;
|
|
383
|
+
readonly params: v.ObjectSchema<{
|
|
384
|
+
/**
|
|
385
|
+
* The address used for signing.
|
|
386
|
+
**/
|
|
387
|
+
readonly address: v.StringSchema<undefined>;
|
|
388
|
+
/**
|
|
389
|
+
* The message to sign.
|
|
390
|
+
**/
|
|
391
|
+
readonly message: v.StringSchema<undefined>;
|
|
392
|
+
}, undefined>;
|
|
393
|
+
readonly id: v.StringSchema<undefined>;
|
|
394
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
395
|
+
}, undefined>;
|
|
396
|
+
type SignMessage = MethodParamsAndResult<v.InferOutput<typeof signMessageParamsSchema>, v.InferOutput<typeof signMessageResultSchema>>;
|
|
311
397
|
type Recipient$1 = {
|
|
312
398
|
/**
|
|
313
399
|
* The recipient's address.
|
|
@@ -364,22 +450,65 @@ type SignPsbtResult = {
|
|
|
364
450
|
txid?: string;
|
|
365
451
|
};
|
|
366
452
|
type SignPsbt = MethodParamsAndResult<SignPsbtParams, SignPsbtResult>;
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
*
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
453
|
+
declare const getAccountsMethodName = "getAccounts";
|
|
454
|
+
declare const getAccountsParamsSchema: v.ObjectSchema<{
|
|
455
|
+
/**
|
|
456
|
+
* The purposes for which to generate addresses. See
|
|
457
|
+
* {@linkcode AddressPurpose} for available purposes.
|
|
458
|
+
*/
|
|
459
|
+
readonly purposes: v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>;
|
|
460
|
+
/**
|
|
461
|
+
* A message to be displayed to the user in the request prompt.
|
|
462
|
+
*/
|
|
463
|
+
readonly message: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
464
|
+
}, undefined>;
|
|
465
|
+
declare const getAccountsResultSchema: v.ArraySchema<v.ObjectSchema<{
|
|
466
|
+
readonly address: v.StringSchema<undefined>;
|
|
467
|
+
readonly publicKey: v.StringSchema<undefined>;
|
|
468
|
+
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
469
|
+
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
470
|
+
}, undefined>, undefined>;
|
|
471
|
+
declare const getAccountsRequestMessageSchema: v.ObjectSchema<{
|
|
472
|
+
readonly method: v.LiteralSchema<"getAccounts", undefined>;
|
|
473
|
+
readonly params: v.ObjectSchema<{
|
|
474
|
+
/**
|
|
475
|
+
* The purposes for which to generate addresses. See
|
|
476
|
+
* {@linkcode AddressPurpose} for available purposes.
|
|
477
|
+
*/
|
|
478
|
+
readonly purposes: v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>;
|
|
479
|
+
/**
|
|
480
|
+
* A message to be displayed to the user in the request prompt.
|
|
481
|
+
*/
|
|
482
|
+
readonly message: v.OptionalSchema<v.StringSchema<undefined>, never>;
|
|
483
|
+
}, undefined>;
|
|
484
|
+
readonly id: v.StringSchema<undefined>;
|
|
485
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
486
|
+
}, undefined>;
|
|
487
|
+
type GetAccounts = MethodParamsAndResult<v.InferOutput<typeof getAccountsParamsSchema>, v.InferOutput<typeof getAccountsResultSchema>>;
|
|
488
|
+
declare const getBalanceMethodName = "getBalance";
|
|
489
|
+
declare const getBalanceParamsSchema: v.UndefinedSchema<undefined>;
|
|
490
|
+
declare const getBalanceResultSchema: v.ObjectSchema<{
|
|
491
|
+
/**
|
|
492
|
+
* The confirmed balance of the wallet in sats.
|
|
493
|
+
*/
|
|
494
|
+
readonly confirmed: v.BigintSchema<undefined>;
|
|
495
|
+
/**
|
|
496
|
+
* The unconfirmed balance of the wallet in sats.
|
|
497
|
+
*/
|
|
498
|
+
readonly unconfirmed: v.BigintSchema<undefined>;
|
|
499
|
+
/**
|
|
500
|
+
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
501
|
+
* sats.
|
|
502
|
+
*/
|
|
503
|
+
readonly total: v.BigintSchema<undefined>;
|
|
504
|
+
}, undefined>;
|
|
505
|
+
declare const getBalanceSchema: v.ObjectSchema<{
|
|
506
|
+
readonly method: v.LiteralSchema<"getBalance", undefined>;
|
|
507
|
+
readonly id: v.StringSchema<undefined>;
|
|
508
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
509
|
+
readonly params: v.OptionalSchema<v.UnionSchema<[v.ArraySchema<v.UnknownSchema, undefined>, v.LooseObjectSchema<{}, undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
510
|
+
}, undefined>;
|
|
511
|
+
type GetBalance = MethodParamsAndResult<v.InferOutput<typeof getBalanceParamsSchema>, v.InferOutput<typeof getBalanceResultSchema>>;
|
|
383
512
|
|
|
384
513
|
type CreateMintOrderRequest = {
|
|
385
514
|
runeName: string;
|
|
@@ -684,6 +813,27 @@ type SignTransactionParams = Transaction & Partial<Pubkey>;
|
|
|
684
813
|
type SignTransactionResult = Transaction;
|
|
685
814
|
type StxSignTransaction = MethodParamsAndResult<SignTransactionParams, SignTransactionResult>;
|
|
686
815
|
|
|
816
|
+
declare const connectMethodName = "wallet_connect";
|
|
817
|
+
declare const connectParamsSchema: v.UndefinedSchema<undefined>;
|
|
818
|
+
declare const connectResultSchema: v.UndefinedSchema<undefined>;
|
|
819
|
+
declare const connectSchema: v.ObjectSchema<{
|
|
820
|
+
readonly method: v.LiteralSchema<"wallet_connect", undefined>;
|
|
821
|
+
readonly params: v.UndefinedSchema<undefined>;
|
|
822
|
+
readonly id: v.StringSchema<undefined>;
|
|
823
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
824
|
+
}, undefined>;
|
|
825
|
+
type Connect = MethodParamsAndResult<v.InferOutput<typeof connectParamsSchema>, v.InferOutput<typeof connectResultSchema>>;
|
|
826
|
+
declare const disconnectMethodName = "wallet_disconnect";
|
|
827
|
+
declare const disconnectParamsSchema: v.UndefinedSchema<undefined>;
|
|
828
|
+
declare const disconnectResultSchema: v.UndefinedSchema<undefined>;
|
|
829
|
+
declare const disconnectSchema: v.ObjectSchema<{
|
|
830
|
+
readonly method: v.LiteralSchema<"wallet_disconnect", undefined>;
|
|
831
|
+
readonly params: v.UndefinedSchema<undefined>;
|
|
832
|
+
readonly id: v.StringSchema<undefined>;
|
|
833
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
834
|
+
}, undefined>;
|
|
835
|
+
type Disconnect = MethodParamsAndResult<v.InferOutput<typeof disconnectParamsSchema>, v.InferOutput<typeof disconnectResultSchema>>;
|
|
836
|
+
|
|
687
837
|
interface StxRequests {
|
|
688
838
|
stx_callContract: StxCallContract;
|
|
689
839
|
stx_deployContract: StxDeployContract;
|
|
@@ -699,6 +849,7 @@ interface BtcRequests {
|
|
|
699
849
|
getInfo: GetInfo;
|
|
700
850
|
getAddresses: GetAddresses;
|
|
701
851
|
getAccounts: GetAccounts;
|
|
852
|
+
getBalance: GetBalance;
|
|
702
853
|
signMessage: SignMessage;
|
|
703
854
|
sendTransfer: SendTransfer;
|
|
704
855
|
signPsbt: SignPsbt;
|
|
@@ -715,11 +866,15 @@ interface RunesRequests {
|
|
|
715
866
|
runes_getBalance: GetRunesBalance;
|
|
716
867
|
}
|
|
717
868
|
type RunesRequestMethod = keyof RunesRequests;
|
|
718
|
-
|
|
869
|
+
interface WalletMethods {
|
|
870
|
+
wallet_connect: Connect;
|
|
871
|
+
wallet_disconnect: Disconnect;
|
|
872
|
+
}
|
|
873
|
+
type Requests = BtcRequests & StxRequests & RunesRequests & WalletMethods;
|
|
719
874
|
type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : never;
|
|
720
875
|
type Params<Method> = Method extends keyof Requests ? Requests[Method]['params'] : never;
|
|
721
876
|
|
|
722
|
-
declare const request: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests>(method: Method, params: Params<Method>, providerId?: string) => Promise<RpcResult<Method>>;
|
|
877
|
+
declare const request: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletMethods>(method: Method, params: Params<Method>, providerId?: string) => Promise<RpcResult<Method>>;
|
|
723
878
|
|
|
724
879
|
declare abstract class SatsConnectAdapter {
|
|
725
880
|
abstract readonly id: string;
|
|
@@ -737,10 +892,10 @@ declare abstract class SatsConnectAdapter {
|
|
|
737
892
|
declare class BaseAdapter extends SatsConnectAdapter {
|
|
738
893
|
id: string;
|
|
739
894
|
constructor(providerId: string);
|
|
740
|
-
requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests>(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
|
|
895
|
+
requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletMethods>(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
|
|
741
896
|
}
|
|
742
897
|
|
|
743
898
|
declare const DefaultAdaptersInfo: Record<string, Provider>;
|
|
744
899
|
declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
|
|
745
900
|
|
|
746
|
-
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
|
|
901
|
+
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 Connect, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type DeployContractParams, type DeployContractResult, type Disconnect, type GetAccounts, type GetAccountsResult, type GetAddressOptions, type GetAddressPayload, type GetAddressResponse, type GetAddresses, type GetAddressesParams, type GetAddressesResult, type GetBalance, type GetCapabilitiesOptions, type GetCapabilitiesPayload, type GetCapabilitiesResponse, type GetInfo, type InputToSign, type MethodParamsAndResult, type Params, type Provider, type PsbtPayload, type Recipient$2 as Recipient, type RequestOptions, type RequestPayload, type Requests, type Return, type RpcBase, type RpcError, RpcErrorCode, type RpcErrorResponse, type RpcId, RpcIdSchema, type RpcRequest, type RpcRequestMessage, type RpcResponse, type RpcResult, type RpcSuccessResponse, type RunesRequestMethod, type RunesRequests, SatsConnectAdapter, type SendBtcTransactionOptions, type SendBtcTransactionPayload, type SendBtcTransactionResponse, type SendTransfer, type SendTransferParams, type SerializedRecipient, type SerializedSendBtcTransactionPayload, type SignMessage, type SignMessageOptions, type SignMessagePayload, type SignMessageResponse, type SignMultiplePsbtPayload, type SignMultipleTransactionOptions, type SignMultipleTransactionsPayload, type SignMultipleTransactionsResponse, type SignPsbt, type SignPsbtParams, type SignPsbtResult, type SignStructuredMessageResult, type SignStxMessageParams, type SignStxMessageResult, type SignTransactionOptions, type SignTransactionParams, type SignTransactionPayload, type SignTransactionResponse, type SignTransactionResult, type StxCallContract, type StxDeployContract, type StxGetAccounts, type StxGetAddresses, type StxRequestMethod, type StxRequests, type StxSignStructuredMessage, type StxSignStxMessage, type StxSignTransaction, type StxTransferStx, type SupportedWallet, type TransferStxParams, type TransferStxResult, type WalletMethods, addressSchema, connectMethodName, connectParamsSchema, connectResultSchema, connectSchema, createInscription, createRepeatInscriptions, defaultAdapters, disconnectMethodName, disconnectParamsSchema, disconnectResultSchema, disconnectSchema, getAccountsMethodName, getAccountsParamsSchema, getAccountsRequestMessageSchema, getAccountsResultSchema, getAddress, getAddressesMethodName, getAddressesParamsSchema, getAddressesRequestMessageSchema, getAddressesResultSchema, getBalanceMethodName, getBalanceParamsSchema, getBalanceResultSchema, getBalanceSchema, getCapabilities, getDefaultProvider, getInfoMethodName, getInfoParamsSchema, getInfoResultSchema, getInfoSchema, getProviderById, getProviderOrThrow, getProviders, getSupportedWallets, isProviderInstalled, removeDefaultProvider, request, rpcErrorResponseMessageSchema, rpcRequestMessageSchema, rpcResponseMessageSchema, rpcSuccessResponseMessageSchema, sendBtcTransaction, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signTransaction };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
// src/types.ts
|
|
2
|
+
import * as v from "valibot";
|
|
2
3
|
var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType2) => {
|
|
3
4
|
BitcoinNetworkType2["Mainnet"] = "Mainnet";
|
|
4
5
|
BitcoinNetworkType2["Testnet"] = "Testnet";
|
|
6
|
+
BitcoinNetworkType2["Signet"] = "Signet";
|
|
5
7
|
return BitcoinNetworkType2;
|
|
6
8
|
})(BitcoinNetworkType || {});
|
|
9
|
+
var RpcIdSchema = v.optional(v.union([v.string(), v.number(), v.null()]));
|
|
10
|
+
var rpcRequestMessageSchema = v.object({
|
|
11
|
+
jsonrpc: v.literal("2.0"),
|
|
12
|
+
method: v.string(),
|
|
13
|
+
params: v.optional(
|
|
14
|
+
v.union([
|
|
15
|
+
v.array(v.unknown()),
|
|
16
|
+
v.looseObject({}),
|
|
17
|
+
// Note: This is to support current incorrect usage of RPC 2.0. Params need
|
|
18
|
+
// to be either an array or an object when provided. Changing this now would
|
|
19
|
+
// be a breaking change, so accepting null values for now. Tracking in
|
|
20
|
+
// https://linear.app/xverseapp/issue/ENG-4538.
|
|
21
|
+
v.null()
|
|
22
|
+
])
|
|
23
|
+
),
|
|
24
|
+
id: RpcIdSchema
|
|
25
|
+
});
|
|
7
26
|
var RpcErrorCode = /* @__PURE__ */ ((RpcErrorCode2) => {
|
|
8
27
|
RpcErrorCode2[RpcErrorCode2["PARSE_ERROR"] = -32700] = "PARSE_ERROR";
|
|
9
28
|
RpcErrorCode2[RpcErrorCode2["INVALID_REQUEST"] = -32600] = "INVALID_REQUEST";
|
|
@@ -12,12 +31,32 @@ var RpcErrorCode = /* @__PURE__ */ ((RpcErrorCode2) => {
|
|
|
12
31
|
RpcErrorCode2[RpcErrorCode2["INTERNAL_ERROR"] = -32603] = "INTERNAL_ERROR";
|
|
13
32
|
RpcErrorCode2[RpcErrorCode2["USER_REJECTION"] = -32e3] = "USER_REJECTION";
|
|
14
33
|
RpcErrorCode2[RpcErrorCode2["METHOD_NOT_SUPPORTED"] = -32001] = "METHOD_NOT_SUPPORTED";
|
|
34
|
+
RpcErrorCode2[RpcErrorCode2["ACCESS_DENIED"] = -32002] = "ACCESS_DENIED";
|
|
15
35
|
return RpcErrorCode2;
|
|
16
36
|
})(RpcErrorCode || {});
|
|
37
|
+
var rpcSuccessResponseMessageSchema = v.object({
|
|
38
|
+
jsonrpc: v.literal("2.0"),
|
|
39
|
+
result: v.unknown(),
|
|
40
|
+
id: RpcIdSchema
|
|
41
|
+
});
|
|
42
|
+
var rpcErrorResponseMessageSchema = v.object({
|
|
43
|
+
jsonrpc: v.literal("2.0"),
|
|
44
|
+
error: v.unknown(),
|
|
45
|
+
id: RpcIdSchema
|
|
46
|
+
});
|
|
47
|
+
var rpcResponseMessageSchema = v.union([
|
|
48
|
+
rpcSuccessResponseMessageSchema,
|
|
49
|
+
rpcErrorResponseMessageSchema
|
|
50
|
+
]);
|
|
17
51
|
|
|
18
52
|
// src/runes/api.ts
|
|
19
53
|
import axios from "axios";
|
|
20
|
-
var
|
|
54
|
+
var urlNetworkSuffix = {
|
|
55
|
+
["Mainnet" /* Mainnet */]: "",
|
|
56
|
+
["Testnet" /* Testnet */]: "-testnet",
|
|
57
|
+
["Signet" /* Signet */]: "-signet"
|
|
58
|
+
};
|
|
59
|
+
var ORDINALS_API_BASE_URL = (network = "Mainnet" /* Mainnet */) => `https://ordinals${urlNetworkSuffix[network]}.xverse.app/v1`;
|
|
21
60
|
var RunesApi = class {
|
|
22
61
|
client;
|
|
23
62
|
constructor(network) {
|
|
@@ -151,9 +190,13 @@ var RunesApi = class {
|
|
|
151
190
|
}
|
|
152
191
|
};
|
|
153
192
|
};
|
|
154
|
-
var
|
|
155
|
-
var
|
|
156
|
-
|
|
193
|
+
var clients = {};
|
|
194
|
+
var getRunesApiClient = (network = "Mainnet" /* Mainnet */) => {
|
|
195
|
+
if (!clients[network]) {
|
|
196
|
+
clients[network] = new RunesApi(network);
|
|
197
|
+
}
|
|
198
|
+
return clients[network];
|
|
199
|
+
};
|
|
157
200
|
|
|
158
201
|
// src/adapters/satsConnectAdapter.ts
|
|
159
202
|
var SatsConnectAdapter = class {
|
|
@@ -483,49 +526,13 @@ function getSupportedWallets() {
|
|
|
483
526
|
}
|
|
484
527
|
|
|
485
528
|
// src/request/index.ts
|
|
486
|
-
|
|
487
|
-
let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
|
|
488
|
-
if (providerId) {
|
|
489
|
-
provider = await getProviderById(providerId);
|
|
490
|
-
}
|
|
491
|
-
if (!provider) {
|
|
492
|
-
throw new Error("no wallet provider was found");
|
|
493
|
-
}
|
|
494
|
-
if (!method) {
|
|
495
|
-
throw new Error("A wallet method is required");
|
|
496
|
-
}
|
|
497
|
-
const response = await provider.request(method, params);
|
|
498
|
-
if (isRpcSuccessResponse(response)) {
|
|
499
|
-
return {
|
|
500
|
-
status: "success",
|
|
501
|
-
result: response.result
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
return {
|
|
505
|
-
status: "error",
|
|
506
|
-
error: response.error
|
|
507
|
-
};
|
|
508
|
-
};
|
|
509
|
-
var isRpcSuccessResponse = (response) => {
|
|
510
|
-
return Object.hasOwn(response, "result") && !!response.result;
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
// src/adapters/xverse.ts
|
|
514
|
-
var XverseAdapter = class extends SatsConnectAdapter {
|
|
515
|
-
id = DefaultAdaptersInfo.xverse.id;
|
|
516
|
-
requestInternal = async (method, params) => {
|
|
517
|
-
return request(method, params, this.id);
|
|
518
|
-
};
|
|
519
|
-
};
|
|
520
|
-
|
|
521
|
-
// src/adapters/unisat.ts
|
|
522
|
-
import { Buffer } from "buffer";
|
|
523
|
-
import { AddressType as AddressType2, getAddressInfo } from "bitcoin-address-validation";
|
|
529
|
+
import * as v5 from "valibot";
|
|
524
530
|
|
|
525
531
|
// src/addresses/index.ts
|
|
526
532
|
import { createUnsecuredToken } from "jsontokens";
|
|
527
533
|
|
|
528
534
|
// src/addresses/types.ts
|
|
535
|
+
import * as v2 from "valibot";
|
|
529
536
|
var AddressPurpose = /* @__PURE__ */ ((AddressPurpose2) => {
|
|
530
537
|
AddressPurpose2["Ordinals"] = "ordinals";
|
|
531
538
|
AddressPurpose2["Payment"] = "payment";
|
|
@@ -541,6 +548,12 @@ var AddressType = /* @__PURE__ */ ((AddressType3) => {
|
|
|
541
548
|
AddressType3["stacks"] = "stacks";
|
|
542
549
|
return AddressType3;
|
|
543
550
|
})(AddressType || {});
|
|
551
|
+
var addressSchema = v2.object({
|
|
552
|
+
address: v2.string(),
|
|
553
|
+
publicKey: v2.string(),
|
|
554
|
+
purpose: v2.enum(AddressPurpose),
|
|
555
|
+
addressType: v2.enum(AddressType)
|
|
556
|
+
});
|
|
544
557
|
|
|
545
558
|
// src/addresses/index.ts
|
|
546
559
|
var getAddress = async (options) => {
|
|
@@ -559,7 +572,200 @@ var getAddress = async (options) => {
|
|
|
559
572
|
}
|
|
560
573
|
};
|
|
561
574
|
|
|
575
|
+
// src/request/types/btcMethods.ts
|
|
576
|
+
import * as v3 from "valibot";
|
|
577
|
+
var getInfoMethodName = "getInfo";
|
|
578
|
+
var getInfoParamsSchema = v3.null();
|
|
579
|
+
var getInfoResultSchema = v3.object({
|
|
580
|
+
/**
|
|
581
|
+
* Version of the wallet.
|
|
582
|
+
*/
|
|
583
|
+
version: v3.string(),
|
|
584
|
+
/**
|
|
585
|
+
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
586
|
+
*/
|
|
587
|
+
methods: v3.optional(v3.array(v3.string())),
|
|
588
|
+
/**
|
|
589
|
+
* List of WBIP standards supported by the wallet. Not currently used.
|
|
590
|
+
*/
|
|
591
|
+
supports: v3.array(v3.string())
|
|
592
|
+
});
|
|
593
|
+
var getInfoSchema = v3.object({
|
|
594
|
+
...rpcRequestMessageSchema.entries,
|
|
595
|
+
...v3.object({
|
|
596
|
+
method: v3.literal(getInfoMethodName),
|
|
597
|
+
params: getInfoParamsSchema,
|
|
598
|
+
id: v3.string()
|
|
599
|
+
}).entries
|
|
600
|
+
});
|
|
601
|
+
var getAddressesMethodName = "getAddresses";
|
|
602
|
+
var getAddressesParamsSchema = v3.object({
|
|
603
|
+
/**
|
|
604
|
+
* The purposes for which to generate addresses. See
|
|
605
|
+
* {@linkcode AddressPurpose} for available purposes.
|
|
606
|
+
*/
|
|
607
|
+
purposes: v3.array(v3.enum(AddressPurpose)),
|
|
608
|
+
/**
|
|
609
|
+
* A message to be displayed to the user in the request prompt.
|
|
610
|
+
*/
|
|
611
|
+
message: v3.optional(v3.string())
|
|
612
|
+
});
|
|
613
|
+
var getAddressesResultSchema = v3.object({
|
|
614
|
+
/**
|
|
615
|
+
* The addresses generated for the given purposes.
|
|
616
|
+
*/
|
|
617
|
+
addresses: v3.array(addressSchema)
|
|
618
|
+
});
|
|
619
|
+
var getAddressesRequestMessageSchema = v3.object({
|
|
620
|
+
...rpcRequestMessageSchema.entries,
|
|
621
|
+
...v3.object({
|
|
622
|
+
method: v3.literal(getAddressesMethodName),
|
|
623
|
+
params: getAddressesParamsSchema,
|
|
624
|
+
id: v3.string()
|
|
625
|
+
}).entries
|
|
626
|
+
});
|
|
627
|
+
var signMessageMethodName = "signMessage";
|
|
628
|
+
var signMessageParamsSchema = v3.object({
|
|
629
|
+
/**
|
|
630
|
+
* The address used for signing.
|
|
631
|
+
**/
|
|
632
|
+
address: v3.string(),
|
|
633
|
+
/**
|
|
634
|
+
* The message to sign.
|
|
635
|
+
**/
|
|
636
|
+
message: v3.string()
|
|
637
|
+
});
|
|
638
|
+
var signMessageResultSchema = v3.object({
|
|
639
|
+
/**
|
|
640
|
+
* The signature of the message.
|
|
641
|
+
*/
|
|
642
|
+
signature: v3.string(),
|
|
643
|
+
/**
|
|
644
|
+
* hash of the message.
|
|
645
|
+
*/
|
|
646
|
+
messageHash: v3.string(),
|
|
647
|
+
/**
|
|
648
|
+
* The address used for signing.
|
|
649
|
+
*/
|
|
650
|
+
address: v3.string()
|
|
651
|
+
});
|
|
652
|
+
var signMessageRequestMessageSchema = v3.object({
|
|
653
|
+
...rpcRequestMessageSchema.entries,
|
|
654
|
+
...v3.object({
|
|
655
|
+
method: v3.literal(signMessageMethodName),
|
|
656
|
+
params: signMessageParamsSchema,
|
|
657
|
+
id: v3.string()
|
|
658
|
+
}).entries
|
|
659
|
+
});
|
|
660
|
+
var getAccountsMethodName = "getAccounts";
|
|
661
|
+
var getAccountsParamsSchema = getAddressesParamsSchema;
|
|
662
|
+
var getAccountsResultSchema = v3.array(addressSchema);
|
|
663
|
+
var getAccountsRequestMessageSchema = v3.object({
|
|
664
|
+
...rpcRequestMessageSchema.entries,
|
|
665
|
+
...v3.object({
|
|
666
|
+
method: v3.literal(getAccountsMethodName),
|
|
667
|
+
params: getAccountsParamsSchema,
|
|
668
|
+
id: v3.string()
|
|
669
|
+
}).entries
|
|
670
|
+
});
|
|
671
|
+
var getBalanceMethodName = "getBalance";
|
|
672
|
+
var getBalanceParamsSchema = v3.undefined();
|
|
673
|
+
var getBalanceResultSchema = v3.object({
|
|
674
|
+
/**
|
|
675
|
+
* The confirmed balance of the wallet in sats.
|
|
676
|
+
*/
|
|
677
|
+
confirmed: v3.bigint(),
|
|
678
|
+
/**
|
|
679
|
+
* The unconfirmed balance of the wallet in sats.
|
|
680
|
+
*/
|
|
681
|
+
unconfirmed: v3.bigint(),
|
|
682
|
+
/**
|
|
683
|
+
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
684
|
+
* sats.
|
|
685
|
+
*/
|
|
686
|
+
total: v3.bigint()
|
|
687
|
+
});
|
|
688
|
+
var getBalanceSchema = v3.object({
|
|
689
|
+
...rpcRequestMessageSchema.entries,
|
|
690
|
+
...v3.object({
|
|
691
|
+
method: v3.literal(getBalanceMethodName),
|
|
692
|
+
id: v3.string()
|
|
693
|
+
}).entries
|
|
694
|
+
});
|
|
695
|
+
|
|
696
|
+
// src/request/types/walletMethods.ts
|
|
697
|
+
import * as v4 from "valibot";
|
|
698
|
+
var connectMethodName = "wallet_connect";
|
|
699
|
+
var connectParamsSchema = v4.undefined();
|
|
700
|
+
var connectResultSchema = v4.undefined();
|
|
701
|
+
var connectSchema = v4.object({
|
|
702
|
+
...rpcRequestMessageSchema.entries,
|
|
703
|
+
...v4.object({
|
|
704
|
+
method: v4.literal(connectMethodName),
|
|
705
|
+
params: connectParamsSchema,
|
|
706
|
+
id: v4.string()
|
|
707
|
+
}).entries
|
|
708
|
+
});
|
|
709
|
+
var disconnectMethodName = "wallet_disconnect";
|
|
710
|
+
var disconnectParamsSchema = v4.undefined();
|
|
711
|
+
var disconnectResultSchema = v4.undefined();
|
|
712
|
+
var disconnectSchema = v4.object({
|
|
713
|
+
...rpcRequestMessageSchema.entries,
|
|
714
|
+
...v4.object({
|
|
715
|
+
method: v4.literal(disconnectMethodName),
|
|
716
|
+
params: disconnectParamsSchema,
|
|
717
|
+
id: v4.string()
|
|
718
|
+
}).entries
|
|
719
|
+
});
|
|
720
|
+
|
|
721
|
+
// src/request/index.ts
|
|
722
|
+
var request = async (method, params, providerId) => {
|
|
723
|
+
let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
|
|
724
|
+
if (providerId) {
|
|
725
|
+
provider = await getProviderById(providerId);
|
|
726
|
+
}
|
|
727
|
+
if (!provider) {
|
|
728
|
+
throw new Error("no wallet provider was found");
|
|
729
|
+
}
|
|
730
|
+
if (!method) {
|
|
731
|
+
throw new Error("A wallet method is required");
|
|
732
|
+
}
|
|
733
|
+
const response = await provider.request(method, params);
|
|
734
|
+
const parseResult = v5.safeParse(rpcResponseMessageSchema, response);
|
|
735
|
+
if (!parseResult.success) {
|
|
736
|
+
return {
|
|
737
|
+
status: "error",
|
|
738
|
+
error: {
|
|
739
|
+
code: -32603 /* INTERNAL_ERROR */,
|
|
740
|
+
message: "Received unknown response from provider.",
|
|
741
|
+
data: response
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
const parsedResponse = parseResult.output;
|
|
746
|
+
if ("error" in parsedResponse) {
|
|
747
|
+
return {
|
|
748
|
+
status: "error",
|
|
749
|
+
error: parsedResponse.error
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
return {
|
|
753
|
+
status: "success",
|
|
754
|
+
result: parsedResponse.result
|
|
755
|
+
};
|
|
756
|
+
};
|
|
757
|
+
|
|
758
|
+
// src/adapters/xverse.ts
|
|
759
|
+
var XverseAdapter = class extends SatsConnectAdapter {
|
|
760
|
+
id = DefaultAdaptersInfo.xverse.id;
|
|
761
|
+
requestInternal = async (method, params) => {
|
|
762
|
+
return request(method, params, this.id);
|
|
763
|
+
};
|
|
764
|
+
};
|
|
765
|
+
|
|
562
766
|
// src/adapters/unisat.ts
|
|
767
|
+
import { Buffer } from "buffer";
|
|
768
|
+
import { AddressType as AddressType2, getAddressInfo } from "bitcoin-address-validation";
|
|
563
769
|
function convertSignInputsToInputType(signInputs, allowedSignHash) {
|
|
564
770
|
let result = [];
|
|
565
771
|
for (let address in signInputs) {
|
|
@@ -963,13 +1169,39 @@ export {
|
|
|
963
1169
|
BitcoinNetworkType,
|
|
964
1170
|
DefaultAdaptersInfo,
|
|
965
1171
|
RpcErrorCode,
|
|
1172
|
+
RpcIdSchema,
|
|
966
1173
|
SatsConnectAdapter,
|
|
1174
|
+
addressSchema,
|
|
1175
|
+
connectMethodName,
|
|
1176
|
+
connectParamsSchema,
|
|
1177
|
+
connectResultSchema,
|
|
1178
|
+
connectSchema,
|
|
967
1179
|
createInscription,
|
|
968
1180
|
createRepeatInscriptions,
|
|
969
1181
|
defaultAdapters,
|
|
1182
|
+
disconnectMethodName,
|
|
1183
|
+
disconnectParamsSchema,
|
|
1184
|
+
disconnectResultSchema,
|
|
1185
|
+
disconnectSchema,
|
|
1186
|
+
getAccountsMethodName,
|
|
1187
|
+
getAccountsParamsSchema,
|
|
1188
|
+
getAccountsRequestMessageSchema,
|
|
1189
|
+
getAccountsResultSchema,
|
|
970
1190
|
getAddress,
|
|
1191
|
+
getAddressesMethodName,
|
|
1192
|
+
getAddressesParamsSchema,
|
|
1193
|
+
getAddressesRequestMessageSchema,
|
|
1194
|
+
getAddressesResultSchema,
|
|
1195
|
+
getBalanceMethodName,
|
|
1196
|
+
getBalanceParamsSchema,
|
|
1197
|
+
getBalanceResultSchema,
|
|
1198
|
+
getBalanceSchema,
|
|
971
1199
|
getCapabilities,
|
|
972
1200
|
getDefaultProvider,
|
|
1201
|
+
getInfoMethodName,
|
|
1202
|
+
getInfoParamsSchema,
|
|
1203
|
+
getInfoResultSchema,
|
|
1204
|
+
getInfoSchema,
|
|
973
1205
|
getProviderById,
|
|
974
1206
|
getProviderOrThrow,
|
|
975
1207
|
getProviders,
|
|
@@ -977,9 +1209,17 @@ export {
|
|
|
977
1209
|
isProviderInstalled,
|
|
978
1210
|
removeDefaultProvider,
|
|
979
1211
|
request,
|
|
1212
|
+
rpcErrorResponseMessageSchema,
|
|
1213
|
+
rpcRequestMessageSchema,
|
|
1214
|
+
rpcResponseMessageSchema,
|
|
1215
|
+
rpcSuccessResponseMessageSchema,
|
|
980
1216
|
sendBtcTransaction,
|
|
981
1217
|
setDefaultProvider,
|
|
982
1218
|
signMessage,
|
|
1219
|
+
signMessageMethodName,
|
|
1220
|
+
signMessageParamsSchema,
|
|
1221
|
+
signMessageRequestMessageSchema,
|
|
1222
|
+
signMessageResultSchema,
|
|
983
1223
|
signMultipleTransactions,
|
|
984
1224
|
signTransaction
|
|
985
1225
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sats-connect/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11-2768523",
|
|
4
4
|
"main": "dist/index.mjs",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.mts",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"test": "jest",
|
|
12
12
|
"build-debug": "webpack --mode development",
|
|
13
13
|
"build": "npm run clean && tsup src/index.ts --format esm --dts",
|
|
14
|
+
"build:watch": "npm run clean && tsup src/index.ts --format esm --dts --watch",
|
|
14
15
|
"clean": "rimraf dist",
|
|
15
16
|
"lint": "prettier --write .",
|
|
16
17
|
"prepare": "husky install"
|
|
@@ -30,6 +31,9 @@
|
|
|
30
31
|
"jsontokens": "4.0.1",
|
|
31
32
|
"lodash.omit": "4.5.0"
|
|
32
33
|
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"valibot": "0.33.2"
|
|
36
|
+
},
|
|
33
37
|
"devDependencies": {
|
|
34
38
|
"@types/jest": "^29.2.6",
|
|
35
39
|
"@types/lodash.omit": "4.5.9",
|
|
@@ -42,7 +46,7 @@
|
|
|
42
46
|
"ts-jest": "^29.0.5",
|
|
43
47
|
"ts-loader": "^9.4.1",
|
|
44
48
|
"tsup": "^8.0.2",
|
|
45
|
-
"typescript": "
|
|
49
|
+
"typescript": "5.4.5",
|
|
46
50
|
"util": "^0.12.4",
|
|
47
51
|
"vm-browserify": "^1.1.2",
|
|
48
52
|
"webpack": "^5.74.0",
|