@sats-connect/core 0.0.9-6671fd7 → 0.0.9-69f5b41

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 CHANGED
@@ -288,15 +288,24 @@ declare const getAddress: (options: GetAddressOptions) => Promise<void>;
288
288
  declare const getInfoMethodName = "getInfo";
289
289
  declare const getInfoParamsSchema: z.ZodUndefined;
290
290
  declare const getInfoResultSchema: z.ZodObject<{
291
- version: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
291
+ /**
292
+ * Version of the wallet.
293
+ */
294
+ version: z.ZodString;
295
+ /**
296
+ * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
297
+ */
292
298
  methods: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
299
+ /**
300
+ * List of WBIP standards supported by the wallet. Not currently used.
301
+ */
293
302
  supports: z.ZodArray<z.ZodString, "many">;
294
303
  }, "strip", z.ZodTypeAny, {
295
- version: string | number;
304
+ version: string;
296
305
  supports: string[];
297
306
  methods?: string[] | undefined;
298
307
  }, {
299
- version: string | number;
308
+ version: string;
300
309
  supports: string[];
301
310
  methods?: string[] | undefined;
302
311
  }>;
@@ -324,8 +333,8 @@ type GetInfo = MethodParamsAndResult<z.infer<typeof getInfoParamsSchema>, z.infe
324
333
  declare const getAddressesMethodName = "getAddresses";
325
334
  declare const getAddressesParamsSchema: z.ZodObject<{
326
335
  /**
327
- * The purposes for which to generate addresses.
328
- * possible values are "payment", "ordinals", ...
336
+ * The purposes for which to generate addresses. See
337
+ * {@linkcode AddressPurpose} for available purposes.
329
338
  */
330
339
  purposes: z.ZodArray<z.ZodNativeEnum<typeof AddressPurpose>, "many">;
331
340
  /**
@@ -383,8 +392,8 @@ declare const getAddressesRequestMessageSchema: z.ZodObject<z.objectUtil.extendS
383
392
  method: z.ZodLiteral<"getAddresses">;
384
393
  params: z.ZodObject<{
385
394
  /**
386
- * The purposes for which to generate addresses.
387
- * possible values are "payment", "ordinals", ...
395
+ * The purposes for which to generate addresses. See
396
+ * {@linkcode AddressPurpose} for available purposes.
388
397
  */
389
398
  purposes: z.ZodArray<z.ZodNativeEnum<typeof AddressPurpose>, "many">;
390
399
  /**
@@ -417,31 +426,87 @@ declare const getAddressesRequestMessageSchema: z.ZodObject<z.objectUtil.extendS
417
426
  id: string;
418
427
  }>;
419
428
  type GetAddresses = MethodParamsAndResult<z.infer<typeof getAddressesParamsSchema>, z.infer<typeof getAddressesResultSchema>>;
420
- type SignMessageParams = {
429
+ declare const signMessageMethodName = "signMessage";
430
+ declare const signMessageParamsSchema: z.ZodObject<{
421
431
  /**
422
432
  * The address used for signing.
423
433
  **/
424
- address: string;
434
+ address: z.ZodString;
425
435
  /**
426
436
  * The message to sign.
427
437
  **/
438
+ message: z.ZodString;
439
+ }, "strip", z.ZodTypeAny, {
428
440
  message: string;
429
- };
430
- type SignMessageResult = {
441
+ address: string;
442
+ }, {
443
+ message: string;
444
+ address: string;
445
+ }>;
446
+ declare const signMessageResultSchema: z.ZodObject<{
431
447
  /**
432
448
  * The signature of the message.
433
449
  */
434
- signature: string;
450
+ signature: z.ZodString;
435
451
  /**
436
452
  * hash of the message.
437
453
  */
438
- messageHash: string;
454
+ messageHash: z.ZodString;
439
455
  /**
440
456
  * The address used for signing.
441
457
  */
458
+ address: z.ZodString;
459
+ }, "strip", z.ZodTypeAny, {
442
460
  address: string;
443
- };
444
- type SignMessage = MethodParamsAndResult<SignMessageParams, SignMessageResult>;
461
+ signature: string;
462
+ messageHash: string;
463
+ }, {
464
+ address: string;
465
+ signature: string;
466
+ messageHash: string;
467
+ }>;
468
+ declare const signMessageRequestMessageSchema: z.ZodObject<z.objectUtil.extendShape<{
469
+ jsonrpc: z.ZodLiteral<"2.0">;
470
+ method: z.ZodString;
471
+ params: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnknown, "many">, z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>]>>;
472
+ id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodNull]>>;
473
+ }, {
474
+ method: z.ZodLiteral<"getAddresses">;
475
+ params: z.ZodObject<{
476
+ /**
477
+ * The address used for signing.
478
+ **/
479
+ address: z.ZodString;
480
+ /**
481
+ * The message to sign.
482
+ **/
483
+ message: z.ZodString;
484
+ }, "strip", z.ZodTypeAny, {
485
+ message: string;
486
+ address: string;
487
+ }, {
488
+ message: string;
489
+ address: string;
490
+ }>;
491
+ id: z.ZodString;
492
+ }>, "strip", z.ZodTypeAny, {
493
+ jsonrpc: "2.0";
494
+ params: {
495
+ message: string;
496
+ address: string;
497
+ };
498
+ method: "getAddresses";
499
+ id: string;
500
+ }, {
501
+ jsonrpc: "2.0";
502
+ params: {
503
+ message: string;
504
+ address: string;
505
+ };
506
+ method: "getAddresses";
507
+ id: string;
508
+ }>;
509
+ type SignMessage = MethodParamsAndResult<z.infer<typeof signMessageParamsSchema>, z.infer<typeof signMessageResultSchema>>;
445
510
  type Recipient$1 = {
446
511
  /**
447
512
  * The recipient's address.
@@ -501,8 +566,8 @@ type SignPsbt = MethodParamsAndResult<SignPsbtParams, SignPsbtResult>;
501
566
  declare const getAccountsMethodName = "getAccounts";
502
567
  declare const getAccountsParamsSchema: z.ZodObject<{
503
568
  /**
504
- * The purposes for which to generate addresses.
505
- * possible values are "payment", "ordinals", ...
569
+ * The purposes for which to generate addresses. See
570
+ * {@linkcode AddressPurpose} for available purposes.
506
571
  */
507
572
  purposes: z.ZodArray<z.ZodNativeEnum<typeof AddressPurpose>, "many">;
508
573
  /**
@@ -541,8 +606,8 @@ declare const getAccountsRequestMessageSchema: z.ZodObject<z.objectUtil.extendSh
541
606
  method: z.ZodLiteral<"getAccounts">;
542
607
  params: z.ZodObject<{
543
608
  /**
544
- * The purposes for which to generate addresses.
545
- * possible values are "payment", "ordinals", ...
609
+ * The purposes for which to generate addresses. See
610
+ * {@linkcode AddressPurpose} for available purposes.
546
611
  */
547
612
  purposes: z.ZodArray<z.ZodNativeEnum<typeof AddressPurpose>, "many">;
548
613
  /**
@@ -938,4 +1003,4 @@ declare class BaseAdapter extends SatsConnectAdapter {
938
1003
  declare const DefaultAdaptersInfo: Record<string, Provider>;
939
1004
  declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
940
1005
 
941
- 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 GetAccounts, type GetAccountsResult, type GetAddressOptions, type GetAddressPayload, type GetAddressResponse, type GetAddresses, type GetAddressesParams, type GetAddressesResult, 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, 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 SignMessageParams, 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, addressSchema, createInscription, createRepeatInscriptions, defaultAdapters, getAccountsMethodName, getAccountsParamsSchema, getAccountsRequestMessageSchema, getAccountsResultSchema, getAddress, getAddressesMethodName, getAddressesParamsSchema, getAddressesRequestMessageSchema, getAddressesResultSchema, getCapabilities, getDefaultProvider, getInfoMethodName, getInfoParamsSchema, getInfoResultSchema, getInfoSchema, getProviderById, getProviderOrThrow, getProviders, getSupportedWallets, isProviderInstalled, removeDefaultProvider, request, rpcRequestMessageSchema, sendBtcTransaction, setDefaultProvider, signMessage, signMultipleTransactions, signTransaction };
1006
+ 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 GetAccounts, type GetAccountsResult, type GetAddressOptions, type GetAddressPayload, type GetAddressResponse, type GetAddresses, type GetAddressesParams, type GetAddressesResult, 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, 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, addressSchema, createInscription, createRepeatInscriptions, defaultAdapters, getAccountsMethodName, getAccountsParamsSchema, getAccountsRequestMessageSchema, getAccountsResultSchema, getAddress, getAddressesMethodName, getAddressesParamsSchema, getAddressesRequestMessageSchema, getAddressesResultSchema, getCapabilities, getDefaultProvider, getInfoMethodName, getInfoParamsSchema, getInfoResultSchema, getInfoSchema, getProviderById, getProviderOrThrow, getProviders, getSupportedWallets, isProviderInstalled, removeDefaultProvider, request, rpcRequestMessageSchema, sendBtcTransaction, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signTransaction };
package/dist/index.mjs CHANGED
@@ -558,8 +558,17 @@ var getAddress = async (options) => {
558
558
  var getInfoMethodName = "getInfo";
559
559
  var getInfoParamsSchema = z3.undefined();
560
560
  var getInfoResultSchema = z3.object({
561
- version: z3.union([z3.number(), z3.string()]),
561
+ /**
562
+ * Version of the wallet.
563
+ */
564
+ version: z3.string(),
565
+ /**
566
+ * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
567
+ */
562
568
  methods: z3.array(z3.string()).optional(),
569
+ /**
570
+ * List of WBIP standards supported by the wallet. Not currently used.
571
+ */
563
572
  supports: z3.array(z3.string())
564
573
  });
565
574
  var getInfoSchema = rpcRequestMessageSchema.extend({
@@ -570,8 +579,8 @@ var getInfoSchema = rpcRequestMessageSchema.extend({
570
579
  var getAddressesMethodName = "getAddresses";
571
580
  var getAddressesParamsSchema = z3.object({
572
581
  /**
573
- * The purposes for which to generate addresses.
574
- * possible values are "payment", "ordinals", ...
582
+ * The purposes for which to generate addresses. See
583
+ * {@linkcode AddressPurpose} for available purposes.
575
584
  */
576
585
  purposes: z3.array(z3.nativeEnum(AddressPurpose)),
577
586
  /**
@@ -590,6 +599,36 @@ var getAddressesRequestMessageSchema = rpcRequestMessageSchema.extend({
590
599
  params: getAddressesParamsSchema,
591
600
  id: z3.string()
592
601
  });
602
+ var signMessageMethodName = "signMessage";
603
+ var signMessageParamsSchema = z3.object({
604
+ /**
605
+ * The address used for signing.
606
+ **/
607
+ address: z3.string(),
608
+ /**
609
+ * The message to sign.
610
+ **/
611
+ message: z3.string()
612
+ });
613
+ var signMessageResultSchema = z3.object({
614
+ /**
615
+ * The signature of the message.
616
+ */
617
+ signature: z3.string(),
618
+ /**
619
+ * hash of the message.
620
+ */
621
+ messageHash: z3.string(),
622
+ /**
623
+ * The address used for signing.
624
+ */
625
+ address: z3.string()
626
+ });
627
+ var signMessageRequestMessageSchema = rpcRequestMessageSchema.extend({
628
+ method: z3.literal(getAddressesMethodName),
629
+ params: signMessageParamsSchema,
630
+ id: z3.string()
631
+ });
593
632
  var getAccountsMethodName = "getAccounts";
594
633
  var getAccountsParamsSchema = getAddressesParamsSchema;
595
634
  var getAccountsResultSchema = z3.array(addressSchema);
@@ -1072,6 +1111,10 @@ export {
1072
1111
  sendBtcTransaction,
1073
1112
  setDefaultProvider,
1074
1113
  signMessage,
1114
+ signMessageMethodName,
1115
+ signMessageParamsSchema,
1116
+ signMessageRequestMessageSchema,
1117
+ signMessageResultSchema,
1075
1118
  signMultipleTransactions,
1076
1119
  signTransaction
1077
1120
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sats-connect/core",
3
- "version": "0.0.9-6671fd7",
3
+ "version": "0.0.9-69f5b41",
4
4
  "main": "dist/index.mjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",