@sats-connect/core 0.1.2-3c27b78 → 0.1.2

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
@@ -35,6 +35,7 @@ declare const createRepeatInscriptions: (options: CreateRepeatInscriptionsOption
35
35
  interface SignMessagePayload extends RequestPayload {
36
36
  address: string;
37
37
  message: string;
38
+ protocol?: MessageSigningProtocols;
38
39
  }
39
40
  type SignMessageResponse = string;
40
41
  type SignMessageOptions = RequestOptions<SignMessagePayload, SignMessageResponse>;
@@ -365,6 +366,10 @@ declare const getAddressesRequestMessageSchema: v.ObjectSchema<{
365
366
  type GetAddressesRequestMessage = v.InferOutput<typeof getAddressesRequestMessageSchema>;
366
367
  type GetAddresses = MethodParamsAndResult<v.InferOutput<typeof getAddressesParamsSchema>, v.InferOutput<typeof getAddressesResultSchema>>;
367
368
  declare const signMessageMethodName = "signMessage";
369
+ declare enum MessageSigningProtocols {
370
+ ECDSA = "ECDSA",
371
+ BIP322 = "BIP322"
372
+ }
368
373
  declare const signMessageParamsSchema: v.ObjectSchema<{
369
374
  /**
370
375
  * The address used for signing.
@@ -374,6 +379,10 @@ declare const signMessageParamsSchema: v.ObjectSchema<{
374
379
  * The message to sign.
375
380
  **/
376
381
  readonly message: v.StringSchema<undefined>;
382
+ /**
383
+ * The protocol to use for signing the message.
384
+ */
385
+ readonly protocol: v.OptionalSchema<v.EnumSchema<typeof MessageSigningProtocols, undefined>, never>;
377
386
  }, undefined>;
378
387
  type SignMessageParams = v.InferOutput<typeof signMessageParamsSchema>;
379
388
  declare const signMessageResultSchema: v.ObjectSchema<{
@@ -389,6 +398,10 @@ declare const signMessageResultSchema: v.ObjectSchema<{
389
398
  * The address used for signing.
390
399
  */
391
400
  readonly address: v.StringSchema<undefined>;
401
+ /**
402
+ * The protocol to use for signing the message.
403
+ */
404
+ readonly protocol: v.EnumSchema<typeof MessageSigningProtocols, undefined>;
392
405
  }, undefined>;
393
406
  type SignMessageResult = v.InferOutput<typeof signMessageResultSchema>;
394
407
  declare const signMessageRequestMessageSchema: v.ObjectSchema<{
@@ -402,6 +415,10 @@ declare const signMessageRequestMessageSchema: v.ObjectSchema<{
402
415
  * The message to sign.
403
416
  **/
404
417
  readonly message: v.StringSchema<undefined>;
418
+ /**
419
+ * The protocol to use for signing the message.
420
+ */
421
+ readonly protocol: v.OptionalSchema<v.EnumSchema<typeof MessageSigningProtocols, undefined>, never>;
405
422
  }, undefined>;
406
423
  readonly id: v.StringSchema<undefined>;
407
424
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
@@ -568,6 +585,28 @@ declare const getInscriptionsSchema: v.ObjectSchema<{
568
585
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
569
586
  }, undefined>;
570
587
  type GetInscriptions = MethodParamsAndResult<v.InferOutput<typeof getInscriptionsParamsSchema>, v.InferOutput<typeof getInscriptionsResultSchema>>;
588
+ declare const sendInscriptionsMethodName = "ord_sendInscriptions";
589
+ declare const sendInscriptionsParamsSchema: v.ObjectSchema<{
590
+ readonly transfers: v.ArraySchema<v.ObjectSchema<{
591
+ readonly address: v.StringSchema<undefined>;
592
+ readonly inscriptionId: v.StringSchema<undefined>;
593
+ }, undefined>, undefined>;
594
+ }, undefined>;
595
+ declare const sendInscriptionsResultSchema: v.ObjectSchema<{
596
+ readonly txid: v.StringSchema<undefined>;
597
+ }, undefined>;
598
+ declare const sendInscriptionsSchema: v.ObjectSchema<{
599
+ readonly method: v.LiteralSchema<"ord_sendInscriptions", undefined>;
600
+ readonly params: v.ObjectSchema<{
601
+ readonly transfers: v.ArraySchema<v.ObjectSchema<{
602
+ readonly address: v.StringSchema<undefined>;
603
+ readonly inscriptionId: v.StringSchema<undefined>;
604
+ }, undefined>, undefined>;
605
+ }, undefined>;
606
+ readonly id: v.StringSchema<undefined>;
607
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
608
+ }, undefined>;
609
+ type SendInscriptions = MethodParamsAndResult<v.InferOutput<typeof sendInscriptionsParamsSchema>, v.InferOutput<typeof sendInscriptionsResultSchema>>;
571
610
 
572
611
  type CreateMintOrderRequest = {
573
612
  runeName: string;
@@ -1022,6 +1061,7 @@ interface RunesRequests {
1022
1061
  type RunesRequestMethod = keyof RunesRequests;
1023
1062
  interface OrdinalsRequests {
1024
1063
  ord_getInscriptions: GetInscriptions;
1064
+ ord_sendInscriptions: SendInscriptions;
1025
1065
  }
1026
1066
  type OrdinalsRequestMethod = keyof OrdinalsRequests;
1027
1067
  interface WalletRequests {
@@ -1033,7 +1073,7 @@ type Requests = BtcRequests & StxRequests & RunesRequests & WalletRequests & Ord
1033
1073
  type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : never;
1034
1074
  type Params<Method> = Method extends keyof Requests ? Requests[Method]['params'] : never;
1035
1075
 
1036
- declare const request: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletRequests | "ord_getInscriptions">(method: Method, params: Params<Method>, providerId?: string) => Promise<RpcResult<Method>>;
1076
+ 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>>;
1037
1077
 
1038
1078
  declare abstract class SatsConnectAdapter {
1039
1079
  abstract readonly id: string;
@@ -1051,10 +1091,10 @@ declare abstract class SatsConnectAdapter {
1051
1091
  declare class BaseAdapter extends SatsConnectAdapter {
1052
1092
  id: string;
1053
1093
  constructor(providerId: string);
1054
- requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletRequests | "ord_getInscriptions">(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
1094
+ requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletRequests | keyof OrdinalsRequests>(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
1055
1095
  }
1056
1096
 
1057
1097
  declare const DefaultAdaptersInfo: Record<string, Provider>;
1058
1098
  declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
1059
1099
 
1060
- 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, 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 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 WalletRequests, type WalletType, 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, removeDefaultProvider, renouncePermissionsMethodName, renouncePermissionsParamsSchema, renouncePermissionsRequestMessageSchema, renouncePermissionsResultSchema, request, requestPermissionsMethodName, requestPermissionsParamsSchema, requestPermissionsRequestMessageSchema, requestPermissionsResultSchema, rpcErrorResponseMessageSchema, rpcRequestMessageSchema, rpcResponseMessageSchema, rpcSuccessResponseMessageSchema, sendBtcTransaction, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signTransaction, stxGetAddressesMethodName, stxGetAddressesParamsSchema, stxGetAddressesRequestMessageSchema, stxGetAddressesResultSchema, stxSignTransactionMethodName, stxSignTransactionParamsSchema, stxSignTransactionRequestMessageSchema, stxSignTransactionResultSchema, walletTypeSchema, walletTypes };
1100
+ 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 TransferStxParams, type TransferStxResult, type WalletRequests, type WalletType, 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, 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, walletTypeSchema, walletTypes };
package/dist/index.mjs CHANGED
@@ -718,6 +718,11 @@ var getAddressesRequestMessageSchema = v5.object({
718
718
  }).entries
719
719
  });
720
720
  var signMessageMethodName = "signMessage";
721
+ var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
722
+ MessageSigningProtocols2["ECDSA"] = "ECDSA";
723
+ MessageSigningProtocols2["BIP322"] = "BIP322";
724
+ return MessageSigningProtocols2;
725
+ })(MessageSigningProtocols || {});
721
726
  var signMessageParamsSchema = v5.object({
722
727
  /**
723
728
  * The address used for signing.
@@ -726,7 +731,11 @@ var signMessageParamsSchema = v5.object({
726
731
  /**
727
732
  * The message to sign.
728
733
  **/
729
- message: v5.string()
734
+ message: v5.string(),
735
+ /**
736
+ * The protocol to use for signing the message.
737
+ */
738
+ protocol: v5.optional(v5.enum(MessageSigningProtocols))
730
739
  });
731
740
  var signMessageResultSchema = v5.object({
732
741
  /**
@@ -740,7 +749,11 @@ var signMessageResultSchema = v5.object({
740
749
  /**
741
750
  * The address used for signing.
742
751
  */
743
- address: v5.string()
752
+ address: v5.string(),
753
+ /**
754
+ * The protocol to use for signing the message.
755
+ */
756
+ protocol: v5.enum(MessageSigningProtocols)
744
757
  });
745
758
  var signMessageRequestMessageSchema = v5.object({
746
759
  ...rpcRequestMessageSchema.entries,
@@ -902,6 +915,26 @@ var getInscriptionsSchema = v8.object({
902
915
  id: v8.string()
903
916
  }).entries
904
917
  });
918
+ var sendInscriptionsMethodName = "ord_sendInscriptions";
919
+ var sendInscriptionsParamsSchema = v8.object({
920
+ transfers: v8.array(
921
+ v8.object({
922
+ address: v8.string(),
923
+ inscriptionId: v8.string()
924
+ })
925
+ )
926
+ });
927
+ var sendInscriptionsResultSchema = v8.object({
928
+ txid: v8.string()
929
+ });
930
+ var sendInscriptionsSchema = v8.object({
931
+ ...rpcRequestMessageSchema.entries,
932
+ ...v8.object({
933
+ method: v8.literal(sendInscriptionsMethodName),
934
+ params: sendInscriptionsParamsSchema,
935
+ id: v8.string()
936
+ }).entries
937
+ });
905
938
 
906
939
  // src/request/index.ts
907
940
  var request = async (method, params, providerId) => {
@@ -1351,6 +1384,7 @@ export {
1351
1384
  BaseAdapter,
1352
1385
  BitcoinNetworkType,
1353
1386
  DefaultAdaptersInfo,
1387
+ MessageSigningProtocols,
1354
1388
  RpcErrorCode,
1355
1389
  RpcIdSchema,
1356
1390
  SatsConnectAdapter,
@@ -1409,6 +1443,10 @@ export {
1409
1443
  rpcResponseMessageSchema,
1410
1444
  rpcSuccessResponseMessageSchema,
1411
1445
  sendBtcTransaction,
1446
+ sendInscriptionsMethodName,
1447
+ sendInscriptionsParamsSchema,
1448
+ sendInscriptionsResultSchema,
1449
+ sendInscriptionsSchema,
1412
1450
  setDefaultProvider,
1413
1451
  signMessage,
1414
1452
  signMessageMethodName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sats-connect/core",
3
- "version": "0.1.2-3c27b78",
3
+ "version": "0.1.2",
4
4
  "main": "dist/index.mjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",