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

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;
@@ -518,6 +518,37 @@ declare const getBalanceRequestMessageSchema: v.ObjectSchema<{
518
518
  }, undefined>;
519
519
  type GetBalance = MethodParamsAndResult<v.InferOutput<typeof getBalanceParamsSchema>, v.InferOutput<typeof getBalanceResultSchema>>;
520
520
 
521
+ declare const getInscriptionsMethodName = "ord_getInscriptions";
522
+ declare const getInscriptionsParamsSchema: v.ObjectSchema<{
523
+ readonly offset: v.NumberSchema<undefined>;
524
+ readonly limit: v.NumberSchema<undefined>;
525
+ }, undefined>;
526
+ declare const getInscriptionsResultSchema: v.ObjectSchema<{
527
+ readonly inscriptions: v.ArraySchema<v.ObjectSchema<{
528
+ readonly inscriptionId: v.StringSchema<undefined>;
529
+ readonly inscriptionNumber: v.StringSchema<undefined>;
530
+ readonly address: v.StringSchema<undefined>;
531
+ readonly collectionName: v.OptionalSchema<v.StringSchema<undefined>, never>;
532
+ readonly postage: v.StringSchema<undefined>;
533
+ readonly contentLength: v.StringSchema<undefined>;
534
+ readonly contentType: v.StringSchema<undefined>;
535
+ readonly timestamp: v.NumberSchema<undefined>;
536
+ readonly offset: v.NumberSchema<undefined>;
537
+ readonly genesisTransaction: v.StringSchema<undefined>;
538
+ readonly output: v.StringSchema<undefined>;
539
+ }, undefined>, undefined>;
540
+ }, undefined>;
541
+ declare const getInscriptionsSchema: v.ObjectSchema<{
542
+ readonly method: v.LiteralSchema<"ord_getInscriptions", undefined>;
543
+ readonly params: v.ObjectSchema<{
544
+ readonly offset: v.NumberSchema<undefined>;
545
+ readonly limit: v.NumberSchema<undefined>;
546
+ }, undefined>;
547
+ readonly id: v.StringSchema<undefined>;
548
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
549
+ }, undefined>;
550
+ type GetInscriptions = MethodParamsAndResult<v.InferOutput<typeof getInscriptionsParamsSchema>, v.InferOutput<typeof getInscriptionsResultSchema>>;
551
+
521
552
  type CreateMintOrderRequest = {
522
553
  runeName: string;
523
554
  repeats: number;
@@ -629,7 +660,7 @@ interface RbfOrderResult {
629
660
  fundingAddress: string;
630
661
  }
631
662
  type RbfOrder = MethodParamsAndResult<RbfOrderParams, RbfOrderResult>;
632
- declare const getRunesBalanceMethodName = "getRunesBalance";
663
+ declare const getRunesBalanceMethodName = "runes_getBalance";
633
664
  declare const getRunesBalanceParamsSchema: v.NullSchema<undefined>;
634
665
  declare const getRunesBalanceResultSchema: v.ObjectSchema<{
635
666
  readonly balances: v.ArraySchema<v.ObjectSchema<{
@@ -641,7 +672,7 @@ declare const getRunesBalanceResultSchema: v.ObjectSchema<{
641
672
  }, undefined>, undefined>;
642
673
  }, undefined>;
643
674
  declare const getRunesBalanceRequestMessageSchema: v.ObjectSchema<{
644
- readonly method: v.LiteralSchema<"getRunesBalance", undefined>;
675
+ readonly method: v.LiteralSchema<"runes_getBalance", undefined>;
645
676
  readonly params: v.NullSchema<undefined>;
646
677
  readonly id: v.StringSchema<undefined>;
647
678
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
@@ -819,35 +850,60 @@ type GetAccountsResult = {
819
850
  }>;
820
851
  };
821
852
  type StxGetAccounts = MethodParamsAndResult<{}, GetAccountsResult>;
822
- type GetAddressesParams = undefined | null;
823
- type GetAddressesResult = {
824
- addresses: Array<Address & PublicKey>;
825
- };
826
- type StxGetAddresses = MethodParamsAndResult<GetAddressesParams, GetAddressesResult>;
853
+ declare const stxGetAddressesMethodName = "stx_getAddresses";
854
+ declare const stxGetAddressesParamsSchema: v.NullishSchema<v.ObjectSchema<{
855
+ /**
856
+ * A message to be displayed to the user in the request prompt.
857
+ */
858
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, never>;
859
+ }, undefined>, never>;
860
+ declare const stxGetAddressesResultSchema: v.ObjectSchema<{
861
+ /**
862
+ * The addresses generated for the given purposes.
863
+ */
864
+ readonly addresses: v.ArraySchema<v.ObjectSchema<{
865
+ readonly address: v.StringSchema<undefined>;
866
+ readonly publicKey: v.StringSchema<undefined>;
867
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
868
+ readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
869
+ }, undefined>, undefined>;
870
+ }, undefined>;
871
+ declare const stxGetAddressesRequestMessageSchema: v.ObjectSchema<{
872
+ readonly method: v.LiteralSchema<"stx_getAddresses", undefined>;
873
+ readonly params: v.NullishSchema<v.ObjectSchema<{
874
+ /**
875
+ * A message to be displayed to the user in the request prompt.
876
+ */
877
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, never>;
878
+ }, undefined>, never>;
879
+ readonly id: v.StringSchema<undefined>;
880
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
881
+ }, undefined>;
882
+ type StxGetAddresses = MethodParamsAndResult<v.InferOutput<typeof stxGetAddressesParamsSchema>, v.InferOutput<typeof stxGetAddressesResultSchema>>;
827
883
  type SignTransactionParams = Transaction & Partial<Pubkey>;
828
884
  type SignTransactionResult = Transaction;
829
885
  type StxSignTransaction = MethodParamsAndResult<SignTransactionParams, SignTransactionResult>;
830
886
 
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>;
887
+ declare const requestPermissionsMethodName = "wallet_requestPermissions";
888
+ declare const requestPermissionsParamsSchema: v.UndefinedSchema<undefined>;
889
+ declare const requestPermissionsResultSchema: v.LiteralSchema<true, undefined>;
890
+ declare const requestPermissionsRequestMessageSchema: v.ObjectSchema<{
891
+ readonly method: v.LiteralSchema<"wallet_requestPermissions", undefined>;
836
892
  readonly params: v.UndefinedSchema<undefined>;
837
893
  readonly id: v.StringSchema<undefined>;
838
894
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
839
895
  }, 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>;
896
+ type RequestPermissions = MethodParamsAndResult<v.InferOutput<typeof requestPermissionsParamsSchema>, v.InferOutput<typeof requestPermissionsResultSchema>>;
897
+ declare const renouncePermissionsMethodName = "wallet_renouncePermissions";
898
+ declare const renouncePermissionsParamsSchema: v.UndefinedSchema<undefined>;
899
+ declare const renouncePermissionsResultSchema: v.LiteralSchema<true, undefined>;
900
+ declare const renouncePermissionsRequestMessageSchema: v.ObjectSchema<{
901
+ readonly method: v.LiteralSchema<"wallet_renouncePermissions", undefined>;
846
902
  readonly params: v.UndefinedSchema<undefined>;
847
903
  readonly id: v.StringSchema<undefined>;
848
904
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
849
905
  }, undefined>;
850
- type Disconnect = MethodParamsAndResult<v.InferOutput<typeof revokePermissionsParamsSchema>, v.InferOutput<typeof revokePermissionsResultSchema>>;
906
+ type RenouncePermissions = MethodParamsAndResult<v.InferOutput<typeof renouncePermissionsParamsSchema>, v.InferOutput<typeof renouncePermissionsResultSchema>>;
851
907
 
852
908
  interface StxRequests {
853
909
  stx_callContract: StxCallContract;
@@ -881,15 +937,19 @@ interface RunesRequests {
881
937
  runes_getBalance: GetRunesBalance;
882
938
  }
883
939
  type RunesRequestMethod = keyof RunesRequests;
940
+ interface OrdinalsRequests {
941
+ ord_getInscriptions: GetInscriptions;
942
+ }
943
+ type OrdinalsRequestMethod = keyof OrdinalsRequests;
884
944
  interface WalletMethods {
885
- wallet_connect: Connect;
886
- wallet_disconnect: Disconnect;
945
+ wallet_requestPermissions: RequestPermissions;
946
+ wallet_renouncePermissions: RenouncePermissions;
887
947
  }
888
- type Requests = BtcRequests & StxRequests & RunesRequests & WalletMethods;
948
+ type Requests = BtcRequests & StxRequests & RunesRequests & WalletMethods & OrdinalsRequests;
889
949
  type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : never;
890
950
  type Params<Method> = Method extends keyof Requests ? Requests[Method]['params'] : never;
891
951
 
892
- declare const request: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletMethods>(method: Method, params: Params<Method>, providerId?: string) => Promise<RpcResult<Method>>;
952
+ 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
953
 
894
954
  declare abstract class SatsConnectAdapter {
895
955
  abstract readonly id: string;
@@ -907,10 +967,10 @@ declare abstract class SatsConnectAdapter {
907
967
  declare class BaseAdapter extends SatsConnectAdapter {
908
968
  id: string;
909
969
  constructor(providerId: string);
910
- requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletMethods>(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
970
+ requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletMethods | "ord_getInscriptions">(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
911
971
  }
912
972
 
913
973
  declare const DefaultAdaptersInfo: Record<string, Provider>;
914
974
  declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
915
975
 
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 };
976
+ 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 GetAccountsResult, type GetAddressOptions, type GetAddressPayload, type GetAddressResponse, type GetAddresses, type GetBalance, type GetCapabilitiesOptions, type GetCapabilitiesPayload, type GetCapabilitiesResponse, type GetInfo, type GetInscriptions, type GetOrder, type GetRunesBalance, 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 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, 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
@@ -526,7 +526,7 @@ function getSupportedWallets() {
526
526
  }
527
527
 
528
528
  // src/request/index.ts
529
- import * as v6 from "valibot";
529
+ import * as v8 from "valibot";
530
530
 
531
531
  // src/addresses/index.ts
532
532
  import { createUnsecuredToken } from "jsontokens";
@@ -572,178 +572,237 @@ var getAddress = async (options) => {
572
572
  }
573
573
  };
574
574
 
575
- // src/request/types/btcMethods.ts
575
+ // src/request/types/stxMethods.ts
576
576
  import * as v3 from "valibot";
577
+ var stxGetAddressesMethodName = "stx_getAddresses";
578
+ var stxGetAddressesParamsSchema = v3.nullish(
579
+ v3.object({
580
+ /**
581
+ * A message to be displayed to the user in the request prompt.
582
+ */
583
+ message: v3.optional(v3.string())
584
+ })
585
+ );
586
+ var stxGetAddressesResultSchema = v3.object({
587
+ /**
588
+ * The addresses generated for the given purposes.
589
+ */
590
+ addresses: v3.array(addressSchema)
591
+ });
592
+ var stxGetAddressesRequestMessageSchema = v3.object({
593
+ ...rpcRequestMessageSchema.entries,
594
+ ...v3.object({
595
+ method: v3.literal(stxGetAddressesMethodName),
596
+ params: stxGetAddressesParamsSchema,
597
+ id: v3.string()
598
+ }).entries
599
+ });
600
+
601
+ // src/request/types/btcMethods.ts
602
+ import * as v4 from "valibot";
577
603
  var getInfoMethodName = "getInfo";
578
- var getInfoParamsSchema = v3.null();
579
- var getInfoResultSchema = v3.object({
604
+ var getInfoParamsSchema = v4.null();
605
+ var getInfoResultSchema = v4.object({
580
606
  /**
581
607
  * Version of the wallet.
582
608
  */
583
- version: v3.string(),
609
+ version: v4.string(),
584
610
  /**
585
611
  * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
586
612
  */
587
- methods: v3.optional(v3.array(v3.string())),
613
+ methods: v4.optional(v4.array(v4.string())),
588
614
  /**
589
615
  * List of WBIP standards supported by the wallet. Not currently used.
590
616
  */
591
- supports: v3.array(v3.string())
617
+ supports: v4.array(v4.string())
592
618
  });
593
- var getInfoSchema = v3.object({
619
+ var getInfoSchema = v4.object({
594
620
  ...rpcRequestMessageSchema.entries,
595
- ...v3.object({
596
- method: v3.literal(getInfoMethodName),
621
+ ...v4.object({
622
+ method: v4.literal(getInfoMethodName),
597
623
  params: getInfoParamsSchema,
598
- id: v3.string()
624
+ id: v4.string()
599
625
  }).entries
600
626
  });
601
627
  var getAddressesMethodName = "getAddresses";
602
- var getAddressesParamsSchema = v3.object({
628
+ var getAddressesParamsSchema = v4.object({
603
629
  /**
604
630
  * The purposes for which to generate addresses. See
605
631
  * {@linkcode AddressPurpose} for available purposes.
606
632
  */
607
- purposes: v3.array(v3.enum(AddressPurpose)),
633
+ purposes: v4.array(v4.enum(AddressPurpose)),
608
634
  /**
609
635
  * A message to be displayed to the user in the request prompt.
610
636
  */
611
- message: v3.optional(v3.string())
637
+ message: v4.optional(v4.string())
612
638
  });
613
- var getAddressesResultSchema = v3.object({
639
+ var getAddressesResultSchema = v4.object({
614
640
  /**
615
641
  * The addresses generated for the given purposes.
616
642
  */
617
- addresses: v3.array(addressSchema)
643
+ addresses: v4.array(addressSchema)
618
644
  });
619
- var getAddressesRequestMessageSchema = v3.object({
645
+ var getAddressesRequestMessageSchema = v4.object({
620
646
  ...rpcRequestMessageSchema.entries,
621
- ...v3.object({
622
- method: v3.literal(getAddressesMethodName),
647
+ ...v4.object({
648
+ method: v4.literal(getAddressesMethodName),
623
649
  params: getAddressesParamsSchema,
624
- id: v3.string()
650
+ id: v4.string()
625
651
  }).entries
626
652
  });
627
653
  var signMessageMethodName = "signMessage";
628
- var signMessageParamsSchema = v3.object({
654
+ var signMessageParamsSchema = v4.object({
629
655
  /**
630
656
  * The address used for signing.
631
657
  **/
632
- address: v3.string(),
658
+ address: v4.string(),
633
659
  /**
634
660
  * The message to sign.
635
661
  **/
636
- message: v3.string()
662
+ message: v4.string()
637
663
  });
638
- var signMessageResultSchema = v3.object({
664
+ var signMessageResultSchema = v4.object({
639
665
  /**
640
666
  * The signature of the message.
641
667
  */
642
- signature: v3.string(),
668
+ signature: v4.string(),
643
669
  /**
644
670
  * hash of the message.
645
671
  */
646
- messageHash: v3.string(),
672
+ messageHash: v4.string(),
647
673
  /**
648
674
  * The address used for signing.
649
675
  */
650
- address: v3.string()
676
+ address: v4.string()
651
677
  });
652
- var signMessageRequestMessageSchema = v3.object({
678
+ var signMessageRequestMessageSchema = v4.object({
653
679
  ...rpcRequestMessageSchema.entries,
654
- ...v3.object({
655
- method: v3.literal(signMessageMethodName),
680
+ ...v4.object({
681
+ method: v4.literal(signMessageMethodName),
656
682
  params: signMessageParamsSchema,
657
- id: v3.string()
683
+ id: v4.string()
658
684
  }).entries
659
685
  });
660
686
  var getAccountsMethodName = "getAccounts";
661
687
  var getAccountsParamsSchema = getAddressesParamsSchema;
662
- var getAccountsResultSchema = v3.array(addressSchema);
663
- var getAccountsRequestMessageSchema = v3.object({
688
+ var getAccountsResultSchema = v4.array(addressSchema);
689
+ var getAccountsRequestMessageSchema = v4.object({
664
690
  ...rpcRequestMessageSchema.entries,
665
- ...v3.object({
666
- method: v3.literal(getAccountsMethodName),
691
+ ...v4.object({
692
+ method: v4.literal(getAccountsMethodName),
667
693
  params: getAccountsParamsSchema,
668
- id: v3.string()
694
+ id: v4.string()
669
695
  }).entries
670
696
  });
671
697
  var getBalanceMethodName = "getBalance";
672
- var getBalanceParamsSchema = v3.undefined();
673
- var getBalanceResultSchema = v3.object({
698
+ var getBalanceParamsSchema = v4.undefined();
699
+ var getBalanceResultSchema = v4.object({
674
700
  /**
675
701
  * The confirmed balance of the wallet in sats. Using a string due to chrome
676
702
  * messages not supporting bigint
677
703
  * (https://issues.chromium.org/issues/40116184).
678
704
  */
679
- confirmed: v3.string(),
705
+ confirmed: v4.string(),
680
706
  /**
681
707
  * The unconfirmed balance of the wallet in sats. Using a string due to chrome
682
708
  * messages not supporting bigint
683
709
  * (https://issues.chromium.org/issues/40116184).
684
710
  */
685
- unconfirmed: v3.string(),
711
+ unconfirmed: v4.string(),
686
712
  /**
687
713
  * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
688
714
  * sats. Using a string due to chrome messages not supporting bigint
689
715
  * (https://issues.chromium.org/issues/40116184).
690
716
  */
691
- total: v3.string()
717
+ total: v4.string()
692
718
  });
693
- var getBalanceRequestMessageSchema = v3.object({
719
+ var getBalanceRequestMessageSchema = v4.object({
694
720
  ...rpcRequestMessageSchema.entries,
695
- ...v3.object({
696
- method: v3.literal(getBalanceMethodName),
697
- id: v3.string()
721
+ ...v4.object({
722
+ method: v4.literal(getBalanceMethodName),
723
+ id: v4.string()
698
724
  }).entries
699
725
  });
700
726
 
701
727
  // 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({
728
+ import * as v5 from "valibot";
729
+ var requestPermissionsMethodName = "wallet_requestPermissions";
730
+ var requestPermissionsParamsSchema = v5.undefined();
731
+ var requestPermissionsResultSchema = v5.literal(true);
732
+ var requestPermissionsRequestMessageSchema = v5.object({
707
733
  ...rpcRequestMessageSchema.entries,
708
- ...v4.object({
709
- method: v4.literal(grantPermissionsMethodName),
710
- params: grantPermissionsParamsSchema,
711
- id: v4.string()
734
+ ...v5.object({
735
+ method: v5.literal(requestPermissionsMethodName),
736
+ params: requestPermissionsParamsSchema,
737
+ id: v5.string()
712
738
  }).entries
713
739
  });
714
- var revokePermissionsMethodName = "wallet_revokePermissions";
715
- var revokePermissionsParamsSchema = v4.undefined();
716
- var revokePermissionsResultSchema = v4.literal(true);
717
- var revokePermissionsRequestMessageSchema = v4.object({
740
+ var renouncePermissionsMethodName = "wallet_renouncePermissions";
741
+ var renouncePermissionsParamsSchema = v5.undefined();
742
+ var renouncePermissionsResultSchema = v5.literal(true);
743
+ var renouncePermissionsRequestMessageSchema = v5.object({
718
744
  ...rpcRequestMessageSchema.entries,
719
- ...v4.object({
720
- method: v4.literal(revokePermissionsMethodName),
721
- params: revokePermissionsParamsSchema,
722
- id: v4.string()
745
+ ...v5.object({
746
+ method: v5.literal(renouncePermissionsMethodName),
747
+ params: renouncePermissionsParamsSchema,
748
+ id: v5.string()
723
749
  }).entries
724
750
  });
725
751
 
726
752
  // 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())
753
+ import * as v6 from "valibot";
754
+ var getRunesBalanceMethodName = "runes_getBalance";
755
+ var getRunesBalanceParamsSchema = v6.null();
756
+ var getRunesBalanceResultSchema = v6.object({
757
+ balances: v6.array(
758
+ v6.object({
759
+ runeName: v6.string(),
760
+ amount: v6.string(),
761
+ divisibility: v6.number(),
762
+ symbol: v6.string(),
763
+ inscriptionId: v6.nullish(v6.string())
738
764
  })
739
765
  )
740
766
  });
741
- var getRunesBalanceRequestMessageSchema = v5.object({
767
+ var getRunesBalanceRequestMessageSchema = v6.object({
742
768
  ...rpcRequestMessageSchema.entries,
743
- ...v5.object({
744
- method: v5.literal(getRunesBalanceMethodName),
769
+ ...v6.object({
770
+ method: v6.literal(getRunesBalanceMethodName),
745
771
  params: getRunesBalanceParamsSchema,
746
- id: v5.string()
772
+ id: v6.string()
773
+ }).entries
774
+ });
775
+
776
+ // src/request/types/ordinalsMethods.ts
777
+ import * as v7 from "valibot";
778
+ var getInscriptionsMethodName = "ord_getInscriptions";
779
+ var getInscriptionsParamsSchema = v7.object({
780
+ offset: v7.number(),
781
+ limit: v7.number()
782
+ });
783
+ var getInscriptionsResultSchema = v7.object({
784
+ inscriptions: v7.array(
785
+ v7.object({
786
+ inscriptionId: v7.string(),
787
+ inscriptionNumber: v7.string(),
788
+ address: v7.string(),
789
+ collectionName: v7.optional(v7.string()),
790
+ postage: v7.string(),
791
+ contentLength: v7.string(),
792
+ contentType: v7.string(),
793
+ timestamp: v7.number(),
794
+ offset: v7.number(),
795
+ genesisTransaction: v7.string(),
796
+ output: v7.string()
797
+ })
798
+ )
799
+ });
800
+ var getInscriptionsSchema = v7.object({
801
+ ...rpcRequestMessageSchema.entries,
802
+ ...v7.object({
803
+ method: v7.literal(getInscriptionsMethodName),
804
+ params: getInscriptionsParamsSchema,
805
+ id: v7.string()
747
806
  }).entries
748
807
  });
749
808
 
@@ -760,13 +819,13 @@ var request = async (method, params, providerId) => {
760
819
  throw new Error("A wallet method is required");
761
820
  }
762
821
  const response = await provider.request(method, params);
763
- if (v6.is(rpcErrorResponseMessageSchema, response)) {
822
+ if (v8.is(rpcErrorResponseMessageSchema, response)) {
764
823
  return {
765
824
  status: "error",
766
825
  error: response.error
767
826
  };
768
827
  }
769
- if (v6.is(rpcSuccessResponseMessageSchema, response)) {
828
+ if (v8.is(rpcSuccessResponseMessageSchema, response)) {
770
829
  return {
771
830
  status: "success",
772
831
  result: response.result
@@ -1221,6 +1280,10 @@ export {
1221
1280
  getInfoParamsSchema,
1222
1281
  getInfoResultSchema,
1223
1282
  getInfoSchema,
1283
+ getInscriptionsMethodName,
1284
+ getInscriptionsParamsSchema,
1285
+ getInscriptionsResultSchema,
1286
+ getInscriptionsSchema,
1224
1287
  getProviderById,
1225
1288
  getProviderOrThrow,
1226
1289
  getProviders,
@@ -1229,17 +1292,17 @@ export {
1229
1292
  getRunesBalanceRequestMessageSchema,
1230
1293
  getRunesBalanceResultSchema,
1231
1294
  getSupportedWallets,
1232
- grantPermissionsMethodName,
1233
- grantPermissionsParamsSchema,
1234
- grantPermissionsRequestMessageSchema,
1235
- grantPermissionsResultSchema,
1236
1295
  isProviderInstalled,
1237
1296
  removeDefaultProvider,
1297
+ renouncePermissionsMethodName,
1298
+ renouncePermissionsParamsSchema,
1299
+ renouncePermissionsRequestMessageSchema,
1300
+ renouncePermissionsResultSchema,
1238
1301
  request,
1239
- revokePermissionsMethodName,
1240
- revokePermissionsParamsSchema,
1241
- revokePermissionsRequestMessageSchema,
1242
- revokePermissionsResultSchema,
1302
+ requestPermissionsMethodName,
1303
+ requestPermissionsParamsSchema,
1304
+ requestPermissionsRequestMessageSchema,
1305
+ requestPermissionsResultSchema,
1243
1306
  rpcErrorResponseMessageSchema,
1244
1307
  rpcRequestMessageSchema,
1245
1308
  rpcResponseMessageSchema,
@@ -1252,5 +1315,9 @@ export {
1252
1315
  signMessageRequestMessageSchema,
1253
1316
  signMessageResultSchema,
1254
1317
  signMultipleTransactions,
1255
- signTransaction
1318
+ signTransaction,
1319
+ stxGetAddressesMethodName,
1320
+ stxGetAddressesParamsSchema,
1321
+ stxGetAddressesRequestMessageSchema,
1322
+ stxGetAddressesResultSchema
1256
1323
  };
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-c2da35e",
4
4
  "main": "dist/index.mjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",