@sats-connect/core 0.0.11-aaf7b1c → 0.0.11-bed3235

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
@@ -116,7 +116,7 @@ interface Provider {
116
116
  mozillaAddOnsUrl?: string;
117
117
  googlePlayStoreUrl?: string;
118
118
  iOSAppStoreUrl?: string;
119
- methods?: (StxRequestMethod | BtcRequestMethod | RunesRequestMethod)[];
119
+ methods?: (StxRequestMethod | BtcRequestMethod | RunesRequestMethod | OrdinalsRequestMethod)[];
120
120
  }
121
121
  interface SupportedWallet extends Provider {
122
122
  isInstalled: boolean;
@@ -294,7 +294,8 @@ type GetAddressOptions = RequestOptions<GetAddressPayload, GetAddressResponse>;
294
294
  declare const getAddress: (options: GetAddressOptions) => Promise<void>;
295
295
 
296
296
  declare const getInfoMethodName = "getInfo";
297
- declare const getInfoParamsSchema: v.NullSchema<undefined>;
297
+ declare const getInfoParamsSchema: v.NullishSchema<v.NullSchema<undefined>, never>;
298
+ type GetInfoParams = v.InferOutput<typeof getInfoParamsSchema>;
298
299
  declare const getInfoResultSchema: v.ObjectSchema<{
299
300
  /**
300
301
  * Version of the wallet.
@@ -309,12 +310,14 @@ declare const getInfoResultSchema: v.ObjectSchema<{
309
310
  */
310
311
  readonly supports: v.ArraySchema<v.StringSchema<undefined>, undefined>;
311
312
  }, undefined>;
312
- declare const getInfoSchema: v.ObjectSchema<{
313
+ type GetInfoResult = v.InferOutput<typeof getInfoResultSchema>;
314
+ declare const getInfoRequestMessageSchema: v.ObjectSchema<{
313
315
  readonly method: v.LiteralSchema<"getInfo", undefined>;
314
- readonly params: v.NullSchema<undefined>;
316
+ readonly params: v.NullishSchema<v.NullSchema<undefined>, never>;
315
317
  readonly id: v.StringSchema<undefined>;
316
318
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
317
319
  }, undefined>;
320
+ type GetInfoRequestMessage = v.InferOutput<typeof getInfoRequestMessageSchema>;
318
321
  type GetInfo = MethodParamsAndResult<v.InferOutput<typeof getInfoParamsSchema>, v.InferOutput<typeof getInfoResultSchema>>;
319
322
  declare const getAddressesMethodName = "getAddresses";
320
323
  declare const getAddressesParamsSchema: v.ObjectSchema<{
@@ -328,6 +331,7 @@ declare const getAddressesParamsSchema: v.ObjectSchema<{
328
331
  */
329
332
  readonly message: v.OptionalSchema<v.StringSchema<undefined>, never>;
330
333
  }, undefined>;
334
+ type GetAddressesParams = v.InferOutput<typeof getAddressesParamsSchema>;
331
335
  declare const getAddressesResultSchema: v.ObjectSchema<{
332
336
  /**
333
337
  * The addresses generated for the given purposes.
@@ -339,6 +343,7 @@ declare const getAddressesResultSchema: v.ObjectSchema<{
339
343
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
340
344
  }, undefined>, undefined>;
341
345
  }, undefined>;
346
+ type GetAddressesResult = v.InferOutput<typeof getAddressesResultSchema>;
342
347
  declare const getAddressesRequestMessageSchema: v.ObjectSchema<{
343
348
  readonly method: v.LiteralSchema<"getAddresses", undefined>;
344
349
  readonly params: v.ObjectSchema<{
@@ -355,6 +360,7 @@ declare const getAddressesRequestMessageSchema: v.ObjectSchema<{
355
360
  readonly id: v.StringSchema<undefined>;
356
361
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
357
362
  }, undefined>;
363
+ type GetAddressesRequestMessage = v.InferOutput<typeof getAddressesRequestMessageSchema>;
358
364
  type GetAddresses = MethodParamsAndResult<v.InferOutput<typeof getAddressesParamsSchema>, v.InferOutput<typeof getAddressesResultSchema>>;
359
365
  declare const signMessageMethodName = "signMessage";
360
366
  declare const signMessageParamsSchema: v.ObjectSchema<{
@@ -367,6 +373,7 @@ declare const signMessageParamsSchema: v.ObjectSchema<{
367
373
  **/
368
374
  readonly message: v.StringSchema<undefined>;
369
375
  }, undefined>;
376
+ type SignMessageParams = v.InferOutput<typeof signMessageParamsSchema>;
370
377
  declare const signMessageResultSchema: v.ObjectSchema<{
371
378
  /**
372
379
  * The signature of the message.
@@ -381,6 +388,7 @@ declare const signMessageResultSchema: v.ObjectSchema<{
381
388
  */
382
389
  readonly address: v.StringSchema<undefined>;
383
390
  }, undefined>;
391
+ type SignMessageResult = v.InferOutput<typeof signMessageResultSchema>;
384
392
  declare const signMessageRequestMessageSchema: v.ObjectSchema<{
385
393
  readonly method: v.LiteralSchema<"signMessage", undefined>;
386
394
  readonly params: v.ObjectSchema<{
@@ -396,6 +404,7 @@ declare const signMessageRequestMessageSchema: v.ObjectSchema<{
396
404
  readonly id: v.StringSchema<undefined>;
397
405
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
398
406
  }, undefined>;
407
+ type SignMessageRequestMessage = v.InferOutput<typeof signMessageRequestMessageSchema>;
399
408
  type SignMessage = MethodParamsAndResult<v.InferOutput<typeof signMessageParamsSchema>, v.InferOutput<typeof signMessageResultSchema>>;
400
409
  type Recipient$1 = {
401
410
  /**
@@ -465,12 +474,14 @@ declare const getAccountsParamsSchema: v.ObjectSchema<{
465
474
  */
466
475
  readonly message: v.OptionalSchema<v.StringSchema<undefined>, never>;
467
476
  }, undefined>;
477
+ type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;
468
478
  declare const getAccountsResultSchema: v.ArraySchema<v.ObjectSchema<{
469
479
  readonly address: v.StringSchema<undefined>;
470
480
  readonly publicKey: v.StringSchema<undefined>;
471
481
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
472
482
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
473
483
  }, undefined>, undefined>;
484
+ type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;
474
485
  declare const getAccountsRequestMessageSchema: v.ObjectSchema<{
475
486
  readonly method: v.LiteralSchema<"getAccounts", undefined>;
476
487
  readonly params: v.ObjectSchema<{
@@ -487,9 +498,10 @@ declare const getAccountsRequestMessageSchema: v.ObjectSchema<{
487
498
  readonly id: v.StringSchema<undefined>;
488
499
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
489
500
  }, undefined>;
501
+ type GetAccountsRequestMessage = v.InferOutput<typeof getAccountsRequestMessageSchema>;
490
502
  type GetAccounts = MethodParamsAndResult<v.InferOutput<typeof getAccountsParamsSchema>, v.InferOutput<typeof getAccountsResultSchema>>;
491
503
  declare const getBalanceMethodName = "getBalance";
492
- declare const getBalanceParamsSchema: v.UndefinedSchema<undefined>;
504
+ declare const getBalanceParamsSchema: v.NullishSchema<v.NullSchema<undefined>, never>;
493
505
  declare const getBalanceResultSchema: v.ObjectSchema<{
494
506
  /**
495
507
  * The confirmed balance of the wallet in sats. Using a string due to chrome
@@ -518,6 +530,37 @@ declare const getBalanceRequestMessageSchema: v.ObjectSchema<{
518
530
  }, undefined>;
519
531
  type GetBalance = MethodParamsAndResult<v.InferOutput<typeof getBalanceParamsSchema>, v.InferOutput<typeof getBalanceResultSchema>>;
520
532
 
533
+ declare const getInscriptionsMethodName = "ord_getInscriptions";
534
+ declare const getInscriptionsParamsSchema: v.ObjectSchema<{
535
+ readonly offset: v.NumberSchema<undefined>;
536
+ readonly limit: v.NumberSchema<undefined>;
537
+ }, undefined>;
538
+ declare const getInscriptionsResultSchema: v.ObjectSchema<{
539
+ readonly inscriptions: v.ArraySchema<v.ObjectSchema<{
540
+ readonly inscriptionId: v.StringSchema<undefined>;
541
+ readonly inscriptionNumber: v.StringSchema<undefined>;
542
+ readonly address: v.StringSchema<undefined>;
543
+ readonly collectionName: v.OptionalSchema<v.StringSchema<undefined>, never>;
544
+ readonly postage: v.StringSchema<undefined>;
545
+ readonly contentLength: v.StringSchema<undefined>;
546
+ readonly contentType: v.StringSchema<undefined>;
547
+ readonly timestamp: v.NumberSchema<undefined>;
548
+ readonly offset: v.NumberSchema<undefined>;
549
+ readonly genesisTransaction: v.StringSchema<undefined>;
550
+ readonly output: v.StringSchema<undefined>;
551
+ }, undefined>, undefined>;
552
+ }, undefined>;
553
+ declare const getInscriptionsSchema: v.ObjectSchema<{
554
+ readonly method: v.LiteralSchema<"ord_getInscriptions", undefined>;
555
+ readonly params: v.ObjectSchema<{
556
+ readonly offset: v.NumberSchema<undefined>;
557
+ readonly limit: v.NumberSchema<undefined>;
558
+ }, undefined>;
559
+ readonly id: v.StringSchema<undefined>;
560
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
561
+ }, undefined>;
562
+ type GetInscriptions = MethodParamsAndResult<v.InferOutput<typeof getInscriptionsParamsSchema>, v.InferOutput<typeof getInscriptionsResultSchema>>;
563
+
521
564
  type CreateMintOrderRequest = {
522
565
  runeName: string;
523
566
  repeats: number;
@@ -629,8 +672,9 @@ interface RbfOrderResult {
629
672
  fundingAddress: string;
630
673
  }
631
674
  type RbfOrder = MethodParamsAndResult<RbfOrderParams, RbfOrderResult>;
632
- declare const getRunesBalanceMethodName = "getRunesBalance";
633
- declare const getRunesBalanceParamsSchema: v.NullSchema<undefined>;
675
+ declare const getRunesBalanceMethodName = "runes_getBalance";
676
+ declare const getRunesBalanceParamsSchema: v.NullishSchema<v.NullSchema<undefined>, never>;
677
+ type GetRunesBalanceParams = v.InferOutput<typeof getRunesBalanceParamsSchema>;
634
678
  declare const getRunesBalanceResultSchema: v.ObjectSchema<{
635
679
  readonly balances: v.ArraySchema<v.ObjectSchema<{
636
680
  readonly runeName: v.StringSchema<undefined>;
@@ -640,12 +684,14 @@ declare const getRunesBalanceResultSchema: v.ObjectSchema<{
640
684
  readonly inscriptionId: v.NullishSchema<v.StringSchema<undefined>, never>;
641
685
  }, undefined>, undefined>;
642
686
  }, undefined>;
687
+ type GetRunesBalanceResult = v.InferOutput<typeof getRunesBalanceResultSchema>;
643
688
  declare const getRunesBalanceRequestMessageSchema: v.ObjectSchema<{
644
- readonly method: v.LiteralSchema<"getRunesBalance", undefined>;
645
- readonly params: v.NullSchema<undefined>;
689
+ readonly method: v.LiteralSchema<"runes_getBalance", undefined>;
690
+ readonly params: v.NullishSchema<v.NullSchema<undefined>, never>;
646
691
  readonly id: v.StringSchema<undefined>;
647
692
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
648
693
  }, undefined>;
694
+ type GetRunesBalanceRequestMessage = v.InferOutput<typeof getRunesBalanceRequestMessageSchema>;
649
695
  type GetRunesBalance = MethodParamsAndResult<v.InferOutput<typeof getRunesBalanceParamsSchema>, v.InferOutput<typeof getRunesBalanceResultSchema>>;
650
696
 
651
697
  interface Pubkey {
@@ -812,42 +858,70 @@ interface DeployContractParams {
812
858
  }
813
859
  type DeployContractResult = TxId & Transaction;
814
860
  type StxDeployContract = MethodParamsAndResult<DeployContractParams, DeployContractResult>;
815
- type GetAccountsResult = {
861
+ type StxGetAccountsResult = {
816
862
  addresses: Array<Address & PublicKey & {
817
863
  gaiaHubUrl: string;
818
864
  gaiaAppKey: string;
819
865
  }>;
820
866
  };
821
- type StxGetAccounts = MethodParamsAndResult<{}, GetAccountsResult>;
822
- type GetAddressesParams = undefined | null;
823
- type GetAddressesResult = {
824
- addresses: Array<Address & PublicKey>;
825
- };
826
- type StxGetAddresses = MethodParamsAndResult<GetAddressesParams, GetAddressesResult>;
867
+ type StxGetAccounts = MethodParamsAndResult<{}, StxGetAccountsResult>;
868
+ declare const stxGetAddressesMethodName = "stx_getAddresses";
869
+ declare const stxGetAddressesParamsSchema: v.NullishSchema<v.ObjectSchema<{
870
+ /**
871
+ * A message to be displayed to the user in the request prompt.
872
+ */
873
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, never>;
874
+ }, undefined>, never>;
875
+ type StxGetAddressesParams = v.InferOutput<typeof stxGetAddressesParamsSchema>;
876
+ declare const stxGetAddressesResultSchema: v.ObjectSchema<{
877
+ /**
878
+ * The addresses generated for the given purposes.
879
+ */
880
+ readonly addresses: v.ArraySchema<v.ObjectSchema<{
881
+ readonly address: v.StringSchema<undefined>;
882
+ readonly publicKey: v.StringSchema<undefined>;
883
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
884
+ readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
885
+ }, undefined>, undefined>;
886
+ }, undefined>;
887
+ type StxGetAddressesResult = v.InferOutput<typeof stxGetAddressesResultSchema>;
888
+ declare const stxGetAddressesRequestMessageSchema: v.ObjectSchema<{
889
+ readonly method: v.LiteralSchema<"stx_getAddresses", undefined>;
890
+ readonly params: v.NullishSchema<v.ObjectSchema<{
891
+ /**
892
+ * A message to be displayed to the user in the request prompt.
893
+ */
894
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, never>;
895
+ }, undefined>, never>;
896
+ readonly id: v.StringSchema<undefined>;
897
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
898
+ }, undefined>;
899
+ type StxGetAddressesRequestMessage = v.InferOutput<typeof stxGetAddressesRequestMessageSchema>;
900
+ type StxGetAddresses = MethodParamsAndResult<v.InferOutput<typeof stxGetAddressesParamsSchema>, v.InferOutput<typeof stxGetAddressesResultSchema>>;
827
901
  type SignTransactionParams = Transaction & Partial<Pubkey>;
828
902
  type SignTransactionResult = Transaction;
829
903
  type StxSignTransaction = MethodParamsAndResult<SignTransactionParams, SignTransactionResult>;
830
904
 
831
- declare const grantPermissionsMethodName = "wallet_grantPermissions";
832
- declare const grantPermissionsParamsSchema: v.UndefinedSchema<undefined>;
833
- declare const grantPermissionsResultSchema: v.LiteralSchema<true, undefined>;
834
- declare const grantPermissionsRequestMessageSchema: v.ObjectSchema<{
835
- readonly method: v.LiteralSchema<"wallet_grantPermissions", undefined>;
905
+ declare const requestPermissionsMethodName = "wallet_requestPermissions";
906
+ declare const requestPermissionsParamsSchema: v.UndefinedSchema<undefined>;
907
+ declare const requestPermissionsResultSchema: v.LiteralSchema<true, undefined>;
908
+ declare const requestPermissionsRequestMessageSchema: v.ObjectSchema<{
909
+ readonly method: v.LiteralSchema<"wallet_requestPermissions", undefined>;
836
910
  readonly params: v.UndefinedSchema<undefined>;
837
911
  readonly id: v.StringSchema<undefined>;
838
912
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
839
913
  }, undefined>;
840
- type Connect = MethodParamsAndResult<v.InferOutput<typeof grantPermissionsParamsSchema>, v.InferOutput<typeof grantPermissionsResultSchema>>;
841
- declare const revokePermissionsMethodName = "wallet_revokePermissions";
842
- declare const revokePermissionsParamsSchema: v.UndefinedSchema<undefined>;
843
- declare const revokePermissionsResultSchema: v.LiteralSchema<true, undefined>;
844
- declare const revokePermissionsRequestMessageSchema: v.ObjectSchema<{
845
- readonly method: v.LiteralSchema<"wallet_revokePermissions", undefined>;
914
+ type RequestPermissions = MethodParamsAndResult<v.InferOutput<typeof requestPermissionsParamsSchema>, v.InferOutput<typeof requestPermissionsResultSchema>>;
915
+ declare const renouncePermissionsMethodName = "wallet_renouncePermissions";
916
+ declare const renouncePermissionsParamsSchema: v.UndefinedSchema<undefined>;
917
+ declare const renouncePermissionsResultSchema: v.LiteralSchema<true, undefined>;
918
+ declare const renouncePermissionsRequestMessageSchema: v.ObjectSchema<{
919
+ readonly method: v.LiteralSchema<"wallet_renouncePermissions", undefined>;
846
920
  readonly params: v.UndefinedSchema<undefined>;
847
921
  readonly id: v.StringSchema<undefined>;
848
922
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
849
923
  }, undefined>;
850
- type Disconnect = MethodParamsAndResult<v.InferOutput<typeof revokePermissionsParamsSchema>, v.InferOutput<typeof revokePermissionsResultSchema>>;
924
+ type RenouncePermissions = MethodParamsAndResult<v.InferOutput<typeof renouncePermissionsParamsSchema>, v.InferOutput<typeof renouncePermissionsResultSchema>>;
851
925
 
852
926
  interface StxRequests {
853
927
  stx_callContract: StxCallContract;
@@ -881,15 +955,19 @@ interface RunesRequests {
881
955
  runes_getBalance: GetRunesBalance;
882
956
  }
883
957
  type RunesRequestMethod = keyof RunesRequests;
958
+ interface OrdinalsRequests {
959
+ ord_getInscriptions: GetInscriptions;
960
+ }
961
+ type OrdinalsRequestMethod = keyof OrdinalsRequests;
884
962
  interface WalletMethods {
885
- wallet_connect: Connect;
886
- wallet_disconnect: Disconnect;
963
+ wallet_requestPermissions: RequestPermissions;
964
+ wallet_renouncePermissions: RenouncePermissions;
887
965
  }
888
- type Requests = BtcRequests & StxRequests & RunesRequests & WalletMethods;
966
+ type Requests = BtcRequests & StxRequests & RunesRequests & WalletMethods & OrdinalsRequests;
889
967
  type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : never;
890
968
  type Params<Method> = Method extends keyof Requests ? Requests[Method]['params'] : never;
891
969
 
892
- declare const request: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletMethods>(method: Method, params: Params<Method>, providerId?: string) => Promise<RpcResult<Method>>;
970
+ declare const request: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletMethods | "ord_getInscriptions">(method: Method, params: Params<Method>, providerId?: string) => Promise<RpcResult<Method>>;
893
971
 
894
972
  declare abstract class SatsConnectAdapter {
895
973
  abstract readonly id: string;
@@ -907,10 +985,10 @@ declare abstract class SatsConnectAdapter {
907
985
  declare class BaseAdapter extends SatsConnectAdapter {
908
986
  id: string;
909
987
  constructor(providerId: string);
910
- requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletMethods>(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
988
+ requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletMethods | "ord_getInscriptions">(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
911
989
  }
912
990
 
913
991
  declare const DefaultAdaptersInfo: Record<string, Provider>;
914
992
  declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
915
993
 
916
- 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 EstimateRbfOrder, type EstimateRunesEtch, type EstimateRunesEtchParams, type EstimateRunesEtchResult, type EstimateRunesMint, type EstimateRunesMintParams, type EstimateRunesMintResult, type EtchRunes, type EtchRunesParams, type EtchRunesResult, 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 GetOrder, type GetRunesBalance, type InputToSign, type MethodParamsAndResult, type MintRunes, type MintRunesParams, type MintRunesResult, type Params, type Provider, type PsbtPayload, type RbfOrder, type Recipient$2 as Recipient, type RequestOptions, type RequestPayload, 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 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, createInscription, createRepeatInscriptions, defaultAdapters, getAccountsMethodName, getAccountsParamsSchema, getAccountsRequestMessageSchema, getAccountsResultSchema, getAddress, getAddressesMethodName, getAddressesParamsSchema, getAddressesRequestMessageSchema, getAddressesResultSchema, getBalanceMethodName, getBalanceParamsSchema, getBalanceRequestMessageSchema, getBalanceResultSchema, getCapabilities, getDefaultProvider, getInfoMethodName, getInfoParamsSchema, getInfoResultSchema, getInfoSchema, getProviderById, getProviderOrThrow, getProviders, getRunesBalanceMethodName, getRunesBalanceParamsSchema, getRunesBalanceRequestMessageSchema, getRunesBalanceResultSchema, getSupportedWallets, grantPermissionsMethodName, grantPermissionsParamsSchema, grantPermissionsRequestMessageSchema, grantPermissionsResultSchema, isProviderInstalled, removeDefaultProvider, request, revokePermissionsMethodName, revokePermissionsParamsSchema, revokePermissionsRequestMessageSchema, revokePermissionsResultSchema, rpcErrorResponseMessageSchema, rpcRequestMessageSchema, rpcResponseMessageSchema, rpcSuccessResponseMessageSchema, sendBtcTransaction, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signTransaction };
994
+ 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 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 SignTransactionParams, type SignTransactionPayload, type SignTransactionResponse, type SignTransactionResult, 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 StxTransferStx, type SupportedWallet, type TransferStxParams, type TransferStxResult, type WalletMethods, 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, 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 };
package/dist/index.mjs CHANGED
@@ -202,6 +202,16 @@ var getRunesApiClient = (network = "Mainnet" /* Mainnet */) => {
202
202
  var SatsConnectAdapter = class {
203
203
  async mintRunes(params) {
204
204
  try {
205
+ const walletInfo = await this.requestInternal("getInfo", null).catch(() => null);
206
+ if (walletInfo && walletInfo.status === "success") {
207
+ const isMintSupported = walletInfo.result.methods?.includes("runes_mint");
208
+ if (isMintSupported) {
209
+ const response = await this.requestInternal("runes_mint", params);
210
+ if (response) {
211
+ return response;
212
+ }
213
+ }
214
+ }
205
215
  const mintRequest = {
206
216
  destinationAddress: params.destinationAddress,
207
217
  feeRate: params.feeRate,
@@ -271,6 +281,16 @@ var SatsConnectAdapter = class {
271
281
  appServiceFeeAddress: params.appServiceFeeAddress
272
282
  };
273
283
  try {
284
+ const walletInfo = await this.requestInternal("getInfo", null).catch(() => null);
285
+ if (walletInfo && walletInfo.status === "success") {
286
+ const isEtchSupported = walletInfo.result.methods?.includes("runes_etch");
287
+ if (isEtchSupported) {
288
+ const response = await this.requestInternal("runes_etch", params);
289
+ if (response) {
290
+ return response;
291
+ }
292
+ }
293
+ }
274
294
  const orderResponse = await new RunesApi(params.network).createEtchOrder(etchRequest);
275
295
  if (!orderResponse.data) {
276
296
  return {
@@ -526,7 +546,7 @@ function getSupportedWallets() {
526
546
  }
527
547
 
528
548
  // src/request/index.ts
529
- import * as v6 from "valibot";
549
+ import * as v8 from "valibot";
530
550
 
531
551
  // src/addresses/index.ts
532
552
  import { createUnsecuredToken } from "jsontokens";
@@ -572,178 +592,237 @@ var getAddress = async (options) => {
572
592
  }
573
593
  };
574
594
 
575
- // src/request/types/btcMethods.ts
595
+ // src/request/types/stxMethods.ts
576
596
  import * as v3 from "valibot";
597
+ var stxGetAddressesMethodName = "stx_getAddresses";
598
+ var stxGetAddressesParamsSchema = v3.nullish(
599
+ v3.object({
600
+ /**
601
+ * A message to be displayed to the user in the request prompt.
602
+ */
603
+ message: v3.optional(v3.string())
604
+ })
605
+ );
606
+ var stxGetAddressesResultSchema = v3.object({
607
+ /**
608
+ * The addresses generated for the given purposes.
609
+ */
610
+ addresses: v3.array(addressSchema)
611
+ });
612
+ var stxGetAddressesRequestMessageSchema = v3.object({
613
+ ...rpcRequestMessageSchema.entries,
614
+ ...v3.object({
615
+ method: v3.literal(stxGetAddressesMethodName),
616
+ params: stxGetAddressesParamsSchema,
617
+ id: v3.string()
618
+ }).entries
619
+ });
620
+
621
+ // src/request/types/btcMethods.ts
622
+ import * as v4 from "valibot";
577
623
  var getInfoMethodName = "getInfo";
578
- var getInfoParamsSchema = v3.null();
579
- var getInfoResultSchema = v3.object({
624
+ var getInfoParamsSchema = v4.nullish(v4.null());
625
+ var getInfoResultSchema = v4.object({
580
626
  /**
581
627
  * Version of the wallet.
582
628
  */
583
- version: v3.string(),
629
+ version: v4.string(),
584
630
  /**
585
631
  * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
586
632
  */
587
- methods: v3.optional(v3.array(v3.string())),
633
+ methods: v4.optional(v4.array(v4.string())),
588
634
  /**
589
635
  * List of WBIP standards supported by the wallet. Not currently used.
590
636
  */
591
- supports: v3.array(v3.string())
637
+ supports: v4.array(v4.string())
592
638
  });
593
- var getInfoSchema = v3.object({
639
+ var getInfoRequestMessageSchema = v4.object({
594
640
  ...rpcRequestMessageSchema.entries,
595
- ...v3.object({
596
- method: v3.literal(getInfoMethodName),
641
+ ...v4.object({
642
+ method: v4.literal(getInfoMethodName),
597
643
  params: getInfoParamsSchema,
598
- id: v3.string()
644
+ id: v4.string()
599
645
  }).entries
600
646
  });
601
647
  var getAddressesMethodName = "getAddresses";
602
- var getAddressesParamsSchema = v3.object({
648
+ var getAddressesParamsSchema = v4.object({
603
649
  /**
604
650
  * The purposes for which to generate addresses. See
605
651
  * {@linkcode AddressPurpose} for available purposes.
606
652
  */
607
- purposes: v3.array(v3.enum(AddressPurpose)),
653
+ purposes: v4.array(v4.enum(AddressPurpose)),
608
654
  /**
609
655
  * A message to be displayed to the user in the request prompt.
610
656
  */
611
- message: v3.optional(v3.string())
657
+ message: v4.optional(v4.string())
612
658
  });
613
- var getAddressesResultSchema = v3.object({
659
+ var getAddressesResultSchema = v4.object({
614
660
  /**
615
661
  * The addresses generated for the given purposes.
616
662
  */
617
- addresses: v3.array(addressSchema)
663
+ addresses: v4.array(addressSchema)
618
664
  });
619
- var getAddressesRequestMessageSchema = v3.object({
665
+ var getAddressesRequestMessageSchema = v4.object({
620
666
  ...rpcRequestMessageSchema.entries,
621
- ...v3.object({
622
- method: v3.literal(getAddressesMethodName),
667
+ ...v4.object({
668
+ method: v4.literal(getAddressesMethodName),
623
669
  params: getAddressesParamsSchema,
624
- id: v3.string()
670
+ id: v4.string()
625
671
  }).entries
626
672
  });
627
673
  var signMessageMethodName = "signMessage";
628
- var signMessageParamsSchema = v3.object({
674
+ var signMessageParamsSchema = v4.object({
629
675
  /**
630
676
  * The address used for signing.
631
677
  **/
632
- address: v3.string(),
678
+ address: v4.string(),
633
679
  /**
634
680
  * The message to sign.
635
681
  **/
636
- message: v3.string()
682
+ message: v4.string()
637
683
  });
638
- var signMessageResultSchema = v3.object({
684
+ var signMessageResultSchema = v4.object({
639
685
  /**
640
686
  * The signature of the message.
641
687
  */
642
- signature: v3.string(),
688
+ signature: v4.string(),
643
689
  /**
644
690
  * hash of the message.
645
691
  */
646
- messageHash: v3.string(),
692
+ messageHash: v4.string(),
647
693
  /**
648
694
  * The address used for signing.
649
695
  */
650
- address: v3.string()
696
+ address: v4.string()
651
697
  });
652
- var signMessageRequestMessageSchema = v3.object({
698
+ var signMessageRequestMessageSchema = v4.object({
653
699
  ...rpcRequestMessageSchema.entries,
654
- ...v3.object({
655
- method: v3.literal(signMessageMethodName),
700
+ ...v4.object({
701
+ method: v4.literal(signMessageMethodName),
656
702
  params: signMessageParamsSchema,
657
- id: v3.string()
703
+ id: v4.string()
658
704
  }).entries
659
705
  });
660
706
  var getAccountsMethodName = "getAccounts";
661
707
  var getAccountsParamsSchema = getAddressesParamsSchema;
662
- var getAccountsResultSchema = v3.array(addressSchema);
663
- var getAccountsRequestMessageSchema = v3.object({
708
+ var getAccountsResultSchema = v4.array(addressSchema);
709
+ var getAccountsRequestMessageSchema = v4.object({
664
710
  ...rpcRequestMessageSchema.entries,
665
- ...v3.object({
666
- method: v3.literal(getAccountsMethodName),
711
+ ...v4.object({
712
+ method: v4.literal(getAccountsMethodName),
667
713
  params: getAccountsParamsSchema,
668
- id: v3.string()
714
+ id: v4.string()
669
715
  }).entries
670
716
  });
671
717
  var getBalanceMethodName = "getBalance";
672
- var getBalanceParamsSchema = v3.undefined();
673
- var getBalanceResultSchema = v3.object({
718
+ var getBalanceParamsSchema = v4.nullish(v4.null());
719
+ var getBalanceResultSchema = v4.object({
674
720
  /**
675
721
  * The confirmed balance of the wallet in sats. Using a string due to chrome
676
722
  * messages not supporting bigint
677
723
  * (https://issues.chromium.org/issues/40116184).
678
724
  */
679
- confirmed: v3.string(),
725
+ confirmed: v4.string(),
680
726
  /**
681
727
  * The unconfirmed balance of the wallet in sats. Using a string due to chrome
682
728
  * messages not supporting bigint
683
729
  * (https://issues.chromium.org/issues/40116184).
684
730
  */
685
- unconfirmed: v3.string(),
731
+ unconfirmed: v4.string(),
686
732
  /**
687
733
  * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
688
734
  * sats. Using a string due to chrome messages not supporting bigint
689
735
  * (https://issues.chromium.org/issues/40116184).
690
736
  */
691
- total: v3.string()
737
+ total: v4.string()
692
738
  });
693
- var getBalanceRequestMessageSchema = v3.object({
739
+ var getBalanceRequestMessageSchema = v4.object({
694
740
  ...rpcRequestMessageSchema.entries,
695
- ...v3.object({
696
- method: v3.literal(getBalanceMethodName),
697
- id: v3.string()
741
+ ...v4.object({
742
+ method: v4.literal(getBalanceMethodName),
743
+ id: v4.string()
698
744
  }).entries
699
745
  });
700
746
 
701
747
  // src/request/types/walletMethods.ts
702
- import * as v4 from "valibot";
703
- var grantPermissionsMethodName = "wallet_grantPermissions";
704
- var grantPermissionsParamsSchema = v4.undefined();
705
- var grantPermissionsResultSchema = v4.literal(true);
706
- var grantPermissionsRequestMessageSchema = v4.object({
748
+ import * as v5 from "valibot";
749
+ var requestPermissionsMethodName = "wallet_requestPermissions";
750
+ var requestPermissionsParamsSchema = v5.undefined();
751
+ var requestPermissionsResultSchema = v5.literal(true);
752
+ var requestPermissionsRequestMessageSchema = v5.object({
707
753
  ...rpcRequestMessageSchema.entries,
708
- ...v4.object({
709
- method: v4.literal(grantPermissionsMethodName),
710
- params: grantPermissionsParamsSchema,
711
- id: v4.string()
754
+ ...v5.object({
755
+ method: v5.literal(requestPermissionsMethodName),
756
+ params: requestPermissionsParamsSchema,
757
+ id: v5.string()
712
758
  }).entries
713
759
  });
714
- var revokePermissionsMethodName = "wallet_revokePermissions";
715
- var revokePermissionsParamsSchema = v4.undefined();
716
- var revokePermissionsResultSchema = v4.literal(true);
717
- var revokePermissionsRequestMessageSchema = v4.object({
760
+ var renouncePermissionsMethodName = "wallet_renouncePermissions";
761
+ var renouncePermissionsParamsSchema = v5.undefined();
762
+ var renouncePermissionsResultSchema = v5.literal(true);
763
+ var renouncePermissionsRequestMessageSchema = v5.object({
718
764
  ...rpcRequestMessageSchema.entries,
719
- ...v4.object({
720
- method: v4.literal(revokePermissionsMethodName),
721
- params: revokePermissionsParamsSchema,
722
- id: v4.string()
765
+ ...v5.object({
766
+ method: v5.literal(renouncePermissionsMethodName),
767
+ params: renouncePermissionsParamsSchema,
768
+ id: v5.string()
723
769
  }).entries
724
770
  });
725
771
 
726
772
  // src/request/types/runesMethods.ts
727
- import * as v5 from "valibot";
728
- var getRunesBalanceMethodName = "getRunesBalance";
729
- var getRunesBalanceParamsSchema = v5.null();
730
- var getRunesBalanceResultSchema = v5.object({
731
- balances: v5.array(
732
- v5.object({
733
- runeName: v5.string(),
734
- amount: v5.string(),
735
- divisibility: v5.number(),
736
- symbol: v5.string(),
737
- inscriptionId: v5.nullish(v5.string())
773
+ import * as v6 from "valibot";
774
+ var getRunesBalanceMethodName = "runes_getBalance";
775
+ var getRunesBalanceParamsSchema = v6.nullish(v6.null());
776
+ var getRunesBalanceResultSchema = v6.object({
777
+ balances: v6.array(
778
+ v6.object({
779
+ runeName: v6.string(),
780
+ amount: v6.string(),
781
+ divisibility: v6.number(),
782
+ symbol: v6.string(),
783
+ inscriptionId: v6.nullish(v6.string())
738
784
  })
739
785
  )
740
786
  });
741
- var getRunesBalanceRequestMessageSchema = v5.object({
787
+ var getRunesBalanceRequestMessageSchema = v6.object({
742
788
  ...rpcRequestMessageSchema.entries,
743
- ...v5.object({
744
- method: v5.literal(getRunesBalanceMethodName),
789
+ ...v6.object({
790
+ method: v6.literal(getRunesBalanceMethodName),
745
791
  params: getRunesBalanceParamsSchema,
746
- id: v5.string()
792
+ id: v6.string()
793
+ }).entries
794
+ });
795
+
796
+ // src/request/types/ordinalsMethods.ts
797
+ import * as v7 from "valibot";
798
+ var getInscriptionsMethodName = "ord_getInscriptions";
799
+ var getInscriptionsParamsSchema = v7.object({
800
+ offset: v7.number(),
801
+ limit: v7.number()
802
+ });
803
+ var getInscriptionsResultSchema = v7.object({
804
+ inscriptions: v7.array(
805
+ v7.object({
806
+ inscriptionId: v7.string(),
807
+ inscriptionNumber: v7.string(),
808
+ address: v7.string(),
809
+ collectionName: v7.optional(v7.string()),
810
+ postage: v7.string(),
811
+ contentLength: v7.string(),
812
+ contentType: v7.string(),
813
+ timestamp: v7.number(),
814
+ offset: v7.number(),
815
+ genesisTransaction: v7.string(),
816
+ output: v7.string()
817
+ })
818
+ )
819
+ });
820
+ var getInscriptionsSchema = v7.object({
821
+ ...rpcRequestMessageSchema.entries,
822
+ ...v7.object({
823
+ method: v7.literal(getInscriptionsMethodName),
824
+ params: getInscriptionsParamsSchema,
825
+ id: v7.string()
747
826
  }).entries
748
827
  });
749
828
 
@@ -760,13 +839,13 @@ var request = async (method, params, providerId) => {
760
839
  throw new Error("A wallet method is required");
761
840
  }
762
841
  const response = await provider.request(method, params);
763
- if (v6.is(rpcErrorResponseMessageSchema, response)) {
842
+ if (v8.is(rpcErrorResponseMessageSchema, response)) {
764
843
  return {
765
844
  status: "error",
766
845
  error: response.error
767
846
  };
768
847
  }
769
- if (v6.is(rpcSuccessResponseMessageSchema, response)) {
848
+ if (v8.is(rpcSuccessResponseMessageSchema, response)) {
770
849
  return {
771
850
  status: "success",
772
851
  result: response.result
@@ -1219,8 +1298,12 @@ export {
1219
1298
  getDefaultProvider,
1220
1299
  getInfoMethodName,
1221
1300
  getInfoParamsSchema,
1301
+ getInfoRequestMessageSchema,
1222
1302
  getInfoResultSchema,
1223
- getInfoSchema,
1303
+ getInscriptionsMethodName,
1304
+ getInscriptionsParamsSchema,
1305
+ getInscriptionsResultSchema,
1306
+ getInscriptionsSchema,
1224
1307
  getProviderById,
1225
1308
  getProviderOrThrow,
1226
1309
  getProviders,
@@ -1229,17 +1312,17 @@ export {
1229
1312
  getRunesBalanceRequestMessageSchema,
1230
1313
  getRunesBalanceResultSchema,
1231
1314
  getSupportedWallets,
1232
- grantPermissionsMethodName,
1233
- grantPermissionsParamsSchema,
1234
- grantPermissionsRequestMessageSchema,
1235
- grantPermissionsResultSchema,
1236
1315
  isProviderInstalled,
1237
1316
  removeDefaultProvider,
1317
+ renouncePermissionsMethodName,
1318
+ renouncePermissionsParamsSchema,
1319
+ renouncePermissionsRequestMessageSchema,
1320
+ renouncePermissionsResultSchema,
1238
1321
  request,
1239
- revokePermissionsMethodName,
1240
- revokePermissionsParamsSchema,
1241
- revokePermissionsRequestMessageSchema,
1242
- revokePermissionsResultSchema,
1322
+ requestPermissionsMethodName,
1323
+ requestPermissionsParamsSchema,
1324
+ requestPermissionsRequestMessageSchema,
1325
+ requestPermissionsResultSchema,
1243
1326
  rpcErrorResponseMessageSchema,
1244
1327
  rpcRequestMessageSchema,
1245
1328
  rpcResponseMessageSchema,
@@ -1252,5 +1335,9 @@ export {
1252
1335
  signMessageRequestMessageSchema,
1253
1336
  signMessageResultSchema,
1254
1337
  signMultipleTransactions,
1255
- signTransaction
1338
+ signTransaction,
1339
+ stxGetAddressesMethodName,
1340
+ stxGetAddressesParamsSchema,
1341
+ stxGetAddressesRequestMessageSchema,
1342
+ stxGetAddressesResultSchema
1256
1343
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sats-connect/core",
3
- "version": "0.0.11-aaf7b1c",
3
+ "version": "0.0.11-bed3235",
4
4
  "main": "dist/index.mjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",