@sats-connect/core 0.0.14 → 0.0.15-204b382

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
@@ -339,7 +339,9 @@ declare const getAddressesResultSchema: v.ObjectSchema<{
339
339
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
340
340
  readonly address: v.StringSchema<undefined>;
341
341
  readonly publicKey: v.StringSchema<undefined>;
342
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
342
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>; /**
343
+ * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
344
+ */
343
345
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
344
346
  }, undefined>, undefined>;
345
347
  }, undefined>;
@@ -476,9 +478,12 @@ declare const getAccountsParamsSchema: v.ObjectSchema<{
476
478
  }, undefined>;
477
479
  type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;
478
480
  declare const getAccountsResultSchema: v.ArraySchema<v.ObjectSchema<{
481
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger"], undefined>;
479
482
  readonly address: v.StringSchema<undefined>;
480
483
  readonly publicKey: v.StringSchema<undefined>;
481
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
484
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>; /**
485
+ * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
486
+ */
482
487
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
483
488
  }, undefined>, undefined>;
484
489
  type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;
@@ -925,6 +930,20 @@ declare const renouncePermissionsRequestMessageSchema: v.ObjectSchema<{
925
930
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
926
931
  }, undefined>;
927
932
  type RenouncePermissions = MethodParamsAndResult<v.InferOutput<typeof renouncePermissionsParamsSchema>, v.InferOutput<typeof renouncePermissionsResultSchema>>;
933
+ declare const getWalletTypeMethodName = "wallet_getWalletType";
934
+ declare const getWalletTypeParamsSchema: v.NullishSchema<v.NullSchema<undefined>, never>;
935
+ declare const getWalletTypeResultSchema: v.PicklistSchema<readonly ["software", "ledger"], undefined>;
936
+ declare const getWalletTypeRequestMessageSchema: v.ObjectSchema<{
937
+ readonly method: v.LiteralSchema<"wallet_getWalletType", undefined>;
938
+ readonly id: v.StringSchema<undefined>;
939
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
940
+ readonly params: v.OptionalSchema<v.UnionSchema<[v.ArraySchema<v.UnknownSchema, undefined>, v.LooseObjectSchema<{}, undefined>, v.NullSchema<undefined>], undefined>, never>;
941
+ }, undefined>;
942
+ type GetWalletType = MethodParamsAndResult<v.InferOutput<typeof getWalletTypeParamsSchema>, v.InferOutput<typeof getWalletTypeResultSchema>>;
943
+
944
+ declare const walletTypes: readonly ["software", "ledger"];
945
+ declare const walletTypeSchema: v.PicklistSchema<readonly ["software", "ledger"], undefined>;
946
+ type WalletType = v.InferOutput<typeof walletTypeSchema>;
928
947
 
929
948
  interface StxRequests {
930
949
  stx_callContract: StxCallContract;
@@ -962,15 +981,16 @@ interface OrdinalsRequests {
962
981
  ord_getInscriptions: GetInscriptions;
963
982
  }
964
983
  type OrdinalsRequestMethod = keyof OrdinalsRequests;
965
- interface WalletMethods {
984
+ interface WalletRequests {
966
985
  wallet_requestPermissions: RequestPermissions;
967
986
  wallet_renouncePermissions: RenouncePermissions;
987
+ wallet_getWalletType: GetWalletType;
968
988
  }
969
- type Requests = BtcRequests & StxRequests & RunesRequests & WalletMethods & OrdinalsRequests;
989
+ type Requests = BtcRequests & StxRequests & RunesRequests & WalletRequests & OrdinalsRequests;
970
990
  type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : never;
971
991
  type Params<Method> = Method extends keyof Requests ? Requests[Method]['params'] : never;
972
992
 
973
- 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>>;
993
+ 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>>;
974
994
 
975
995
  declare abstract class SatsConnectAdapter {
976
996
  abstract readonly id: string;
@@ -988,10 +1008,10 @@ declare abstract class SatsConnectAdapter {
988
1008
  declare class BaseAdapter extends SatsConnectAdapter {
989
1009
  id: string;
990
1010
  constructor(providerId: string);
991
- requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletMethods | "ord_getInscriptions">(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
1011
+ requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletRequests | "ord_getInscriptions">(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
992
1012
  }
993
1013
 
994
1014
  declare const DefaultAdaptersInfo: Record<string, Provider>;
995
1015
  declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
996
1016
 
997
- 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 };
1017
+ 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 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 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, walletTypeSchema, walletTypes };
package/dist/index.mjs CHANGED
@@ -208,7 +208,12 @@ var SatsConnectAdapter = class {
208
208
  if (isMintSupported) {
209
209
  const response = await this.requestInternal("runes_mint", params);
210
210
  if (response) {
211
- return response;
211
+ if (response.status === "success") {
212
+ return response;
213
+ }
214
+ if (response.status === "error" && response.error.code !== -32601 /* METHOD_NOT_FOUND */) {
215
+ return response;
216
+ }
212
217
  }
213
218
  }
214
219
  }
@@ -287,7 +292,12 @@ var SatsConnectAdapter = class {
287
292
  if (isEtchSupported) {
288
293
  const response = await this.requestInternal("runes_etch", params);
289
294
  if (response) {
290
- return response;
295
+ if (response.status === "success") {
296
+ return response;
297
+ }
298
+ if (response.status === "error" && response.error.code !== -32601 /* METHOD_NOT_FOUND */) {
299
+ return response;
300
+ }
291
301
  }
292
302
  }
293
303
  }
@@ -546,7 +556,7 @@ function getSupportedWallets() {
546
556
  }
547
557
 
548
558
  // src/request/index.ts
549
- import * as v8 from "valibot";
559
+ import * as v9 from "valibot";
550
560
 
551
561
  // src/addresses/index.ts
552
562
  import { createUnsecuredToken } from "jsontokens";
@@ -619,213 +629,247 @@ var stxGetAddressesRequestMessageSchema = v3.object({
619
629
  });
620
630
 
621
631
  // src/request/types/btcMethods.ts
632
+ import * as v5 from "valibot";
633
+
634
+ // src/request/types/common.ts
622
635
  import * as v4 from "valibot";
636
+ var walletTypes = ["software", "ledger"];
637
+ var walletTypeSchema = v4.picklist(walletTypes);
638
+
639
+ // src/request/types/btcMethods.ts
623
640
  var getInfoMethodName = "getInfo";
624
- var getInfoParamsSchema = v4.nullish(v4.null());
625
- var getInfoResultSchema = v4.object({
641
+ var getInfoParamsSchema = v5.nullish(v5.null());
642
+ var getInfoResultSchema = v5.object({
626
643
  /**
627
644
  * Version of the wallet.
628
645
  */
629
- version: v4.string(),
646
+ version: v5.string(),
630
647
  /**
631
648
  * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
632
649
  */
633
- methods: v4.optional(v4.array(v4.string())),
650
+ methods: v5.optional(v5.array(v5.string())),
634
651
  /**
635
652
  * List of WBIP standards supported by the wallet. Not currently used.
636
653
  */
637
- supports: v4.array(v4.string())
654
+ supports: v5.array(v5.string())
638
655
  });
639
- var getInfoRequestMessageSchema = v4.object({
656
+ var getInfoRequestMessageSchema = v5.object({
640
657
  ...rpcRequestMessageSchema.entries,
641
- ...v4.object({
642
- method: v4.literal(getInfoMethodName),
658
+ ...v5.object({
659
+ method: v5.literal(getInfoMethodName),
643
660
  params: getInfoParamsSchema,
644
- id: v4.string()
661
+ id: v5.string()
645
662
  }).entries
646
663
  });
647
664
  var getAddressesMethodName = "getAddresses";
648
- var getAddressesParamsSchema = v4.object({
665
+ var getAddressesParamsSchema = v5.object({
649
666
  /**
650
667
  * The purposes for which to generate addresses. See
651
668
  * {@linkcode AddressPurpose} for available purposes.
652
669
  */
653
- purposes: v4.array(v4.enum(AddressPurpose)),
670
+ purposes: v5.array(v5.enum(AddressPurpose)),
654
671
  /**
655
672
  * A message to be displayed to the user in the request prompt.
656
673
  */
657
- message: v4.optional(v4.string())
674
+ message: v5.optional(v5.string())
658
675
  });
659
- var getAddressesResultSchema = v4.object({
676
+ var getAddressesResultSchema = v5.object({
660
677
  /**
661
678
  * The addresses generated for the given purposes.
662
679
  */
663
- addresses: v4.array(addressSchema)
680
+ addresses: v5.array(addressSchema)
664
681
  });
665
- var getAddressesRequestMessageSchema = v4.object({
682
+ var getAddressesRequestMessageSchema = v5.object({
666
683
  ...rpcRequestMessageSchema.entries,
667
- ...v4.object({
668
- method: v4.literal(getAddressesMethodName),
684
+ ...v5.object({
685
+ method: v5.literal(getAddressesMethodName),
669
686
  params: getAddressesParamsSchema,
670
- id: v4.string()
687
+ id: v5.string()
671
688
  }).entries
672
689
  });
673
690
  var signMessageMethodName = "signMessage";
674
- var signMessageParamsSchema = v4.object({
691
+ var signMessageParamsSchema = v5.object({
675
692
  /**
676
693
  * The address used for signing.
677
694
  **/
678
- address: v4.string(),
695
+ address: v5.string(),
679
696
  /**
680
697
  * The message to sign.
681
698
  **/
682
- message: v4.string()
699
+ message: v5.string()
683
700
  });
684
- var signMessageResultSchema = v4.object({
701
+ var signMessageResultSchema = v5.object({
685
702
  /**
686
703
  * The signature of the message.
687
704
  */
688
- signature: v4.string(),
705
+ signature: v5.string(),
689
706
  /**
690
707
  * hash of the message.
691
708
  */
692
- messageHash: v4.string(),
709
+ messageHash: v5.string(),
693
710
  /**
694
711
  * The address used for signing.
695
712
  */
696
- address: v4.string()
713
+ address: v5.string()
697
714
  });
698
- var signMessageRequestMessageSchema = v4.object({
715
+ var signMessageRequestMessageSchema = v5.object({
699
716
  ...rpcRequestMessageSchema.entries,
700
- ...v4.object({
701
- method: v4.literal(signMessageMethodName),
717
+ ...v5.object({
718
+ method: v5.literal(signMessageMethodName),
702
719
  params: signMessageParamsSchema,
703
- id: v4.string()
720
+ id: v5.string()
704
721
  }).entries
705
722
  });
706
723
  var getAccountsMethodName = "getAccounts";
707
- var getAccountsParamsSchema = getAddressesParamsSchema;
708
- var getAccountsResultSchema = v4.array(addressSchema);
709
- var getAccountsRequestMessageSchema = v4.object({
724
+ var getAccountsParamsSchema = v5.object({
725
+ /**
726
+ * The purposes for which to generate addresses. See
727
+ * {@linkcode AddressPurpose} for available purposes.
728
+ */
729
+ purposes: v5.array(v5.enum(AddressPurpose)),
730
+ /**
731
+ * A message to be displayed to the user in the request prompt.
732
+ */
733
+ message: v5.optional(v5.string())
734
+ });
735
+ var getAccountsResultSchema = v5.array(
736
+ v5.object({
737
+ ...addressSchema.entries,
738
+ ...v5.object({
739
+ walletType: walletTypeSchema
740
+ }).entries
741
+ })
742
+ );
743
+ var getAccountsRequestMessageSchema = v5.object({
710
744
  ...rpcRequestMessageSchema.entries,
711
- ...v4.object({
712
- method: v4.literal(getAccountsMethodName),
745
+ ...v5.object({
746
+ method: v5.literal(getAccountsMethodName),
713
747
  params: getAccountsParamsSchema,
714
- id: v4.string()
748
+ id: v5.string()
715
749
  }).entries
716
750
  });
717
751
  var getBalanceMethodName = "getBalance";
718
- var getBalanceParamsSchema = v4.nullish(v4.null());
719
- var getBalanceResultSchema = v4.object({
752
+ var getBalanceParamsSchema = v5.nullish(v5.null());
753
+ var getBalanceResultSchema = v5.object({
720
754
  /**
721
755
  * The confirmed balance of the wallet in sats. Using a string due to chrome
722
756
  * messages not supporting bigint
723
757
  * (https://issues.chromium.org/issues/40116184).
724
758
  */
725
- confirmed: v4.string(),
759
+ confirmed: v5.string(),
726
760
  /**
727
761
  * The unconfirmed balance of the wallet in sats. Using a string due to chrome
728
762
  * messages not supporting bigint
729
763
  * (https://issues.chromium.org/issues/40116184).
730
764
  */
731
- unconfirmed: v4.string(),
765
+ unconfirmed: v5.string(),
732
766
  /**
733
767
  * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
734
768
  * sats. Using a string due to chrome messages not supporting bigint
735
769
  * (https://issues.chromium.org/issues/40116184).
736
770
  */
737
- total: v4.string()
771
+ total: v5.string()
738
772
  });
739
- var getBalanceRequestMessageSchema = v4.object({
773
+ var getBalanceRequestMessageSchema = v5.object({
740
774
  ...rpcRequestMessageSchema.entries,
741
- ...v4.object({
742
- method: v4.literal(getBalanceMethodName),
743
- id: v4.string()
775
+ ...v5.object({
776
+ method: v5.literal(getBalanceMethodName),
777
+ id: v5.string()
744
778
  }).entries
745
779
  });
746
780
 
747
781
  // src/request/types/walletMethods.ts
748
- import * as v5 from "valibot";
782
+ import * as v6 from "valibot";
749
783
  var requestPermissionsMethodName = "wallet_requestPermissions";
750
- var requestPermissionsParamsSchema = v5.undefined();
751
- var requestPermissionsResultSchema = v5.literal(true);
752
- var requestPermissionsRequestMessageSchema = v5.object({
784
+ var requestPermissionsParamsSchema = v6.undefined();
785
+ var requestPermissionsResultSchema = v6.literal(true);
786
+ var requestPermissionsRequestMessageSchema = v6.object({
753
787
  ...rpcRequestMessageSchema.entries,
754
- ...v5.object({
755
- method: v5.literal(requestPermissionsMethodName),
788
+ ...v6.object({
789
+ method: v6.literal(requestPermissionsMethodName),
756
790
  params: requestPermissionsParamsSchema,
757
- id: v5.string()
791
+ id: v6.string()
758
792
  }).entries
759
793
  });
760
794
  var renouncePermissionsMethodName = "wallet_renouncePermissions";
761
- var renouncePermissionsParamsSchema = v5.undefined();
762
- var renouncePermissionsResultSchema = v5.literal(true);
763
- var renouncePermissionsRequestMessageSchema = v5.object({
795
+ var renouncePermissionsParamsSchema = v6.undefined();
796
+ var renouncePermissionsResultSchema = v6.literal(true);
797
+ var renouncePermissionsRequestMessageSchema = v6.object({
764
798
  ...rpcRequestMessageSchema.entries,
765
- ...v5.object({
766
- method: v5.literal(renouncePermissionsMethodName),
799
+ ...v6.object({
800
+ method: v6.literal(renouncePermissionsMethodName),
767
801
  params: renouncePermissionsParamsSchema,
768
- id: v5.string()
802
+ id: v6.string()
803
+ }).entries
804
+ });
805
+ var getWalletTypeMethodName = "wallet_getWalletType";
806
+ var getWalletTypeParamsSchema = v6.nullish(v6.null());
807
+ var getWalletTypeResultSchema = walletTypeSchema;
808
+ var getWalletTypeRequestMessageSchema = v6.object({
809
+ ...rpcRequestMessageSchema.entries,
810
+ ...v6.object({
811
+ method: v6.literal(getWalletTypeMethodName),
812
+ id: v6.string()
769
813
  }).entries
770
814
  });
771
815
 
772
816
  // src/request/types/runesMethods.ts
773
- import * as v6 from "valibot";
817
+ import * as v7 from "valibot";
774
818
  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())
819
+ var getRunesBalanceParamsSchema = v7.nullish(v7.null());
820
+ var getRunesBalanceResultSchema = v7.object({
821
+ balances: v7.array(
822
+ v7.object({
823
+ runeName: v7.string(),
824
+ amount: v7.string(),
825
+ divisibility: v7.number(),
826
+ symbol: v7.string(),
827
+ inscriptionId: v7.nullish(v7.string())
784
828
  })
785
829
  )
786
830
  });
787
- var getRunesBalanceRequestMessageSchema = v6.object({
831
+ var getRunesBalanceRequestMessageSchema = v7.object({
788
832
  ...rpcRequestMessageSchema.entries,
789
- ...v6.object({
790
- method: v6.literal(getRunesBalanceMethodName),
833
+ ...v7.object({
834
+ method: v7.literal(getRunesBalanceMethodName),
791
835
  params: getRunesBalanceParamsSchema,
792
- id: v6.string()
836
+ id: v7.string()
793
837
  }).entries
794
838
  });
795
839
 
796
840
  // src/request/types/ordinalsMethods.ts
797
- import * as v7 from "valibot";
841
+ import * as v8 from "valibot";
798
842
  var getInscriptionsMethodName = "ord_getInscriptions";
799
- var getInscriptionsParamsSchema = v7.object({
800
- offset: v7.number(),
801
- limit: v7.number()
843
+ var getInscriptionsParamsSchema = v8.object({
844
+ offset: v8.number(),
845
+ limit: v8.number()
802
846
  });
803
- var getInscriptionsResultSchema = v7.object({
804
- total: v7.number(),
805
- limit: v7.number(),
806
- offset: v7.number(),
807
- inscriptions: v7.array(
808
- v7.object({
809
- inscriptionId: v7.string(),
810
- inscriptionNumber: v7.string(),
811
- address: v7.string(),
812
- collectionName: v7.optional(v7.string()),
813
- postage: v7.string(),
814
- contentLength: v7.string(),
815
- contentType: v7.string(),
816
- timestamp: v7.number(),
817
- offset: v7.number(),
818
- genesisTransaction: v7.string(),
819
- output: v7.string()
847
+ var getInscriptionsResultSchema = v8.object({
848
+ total: v8.number(),
849
+ limit: v8.number(),
850
+ offset: v8.number(),
851
+ inscriptions: v8.array(
852
+ v8.object({
853
+ inscriptionId: v8.string(),
854
+ inscriptionNumber: v8.string(),
855
+ address: v8.string(),
856
+ collectionName: v8.optional(v8.string()),
857
+ postage: v8.string(),
858
+ contentLength: v8.string(),
859
+ contentType: v8.string(),
860
+ timestamp: v8.number(),
861
+ offset: v8.number(),
862
+ genesisTransaction: v8.string(),
863
+ output: v8.string()
820
864
  })
821
865
  )
822
866
  });
823
- var getInscriptionsSchema = v7.object({
867
+ var getInscriptionsSchema = v8.object({
824
868
  ...rpcRequestMessageSchema.entries,
825
- ...v7.object({
826
- method: v7.literal(getInscriptionsMethodName),
869
+ ...v8.object({
870
+ method: v8.literal(getInscriptionsMethodName),
827
871
  params: getInscriptionsParamsSchema,
828
- id: v7.string()
872
+ id: v8.string()
829
873
  }).entries
830
874
  });
831
875
 
@@ -842,13 +886,13 @@ var request = async (method, params, providerId) => {
842
886
  throw new Error("A wallet method is required");
843
887
  }
844
888
  const response = await provider.request(method, params);
845
- if (v8.is(rpcErrorResponseMessageSchema, response)) {
889
+ if (v9.is(rpcErrorResponseMessageSchema, response)) {
846
890
  return {
847
891
  status: "error",
848
892
  error: response.error
849
893
  };
850
894
  }
851
- if (v8.is(rpcSuccessResponseMessageSchema, response)) {
895
+ if (v9.is(rpcSuccessResponseMessageSchema, response)) {
852
896
  return {
853
897
  status: "success",
854
898
  result: response.result
@@ -1315,6 +1359,10 @@ export {
1315
1359
  getRunesBalanceRequestMessageSchema,
1316
1360
  getRunesBalanceResultSchema,
1317
1361
  getSupportedWallets,
1362
+ getWalletTypeMethodName,
1363
+ getWalletTypeParamsSchema,
1364
+ getWalletTypeRequestMessageSchema,
1365
+ getWalletTypeResultSchema,
1318
1366
  isProviderInstalled,
1319
1367
  removeDefaultProvider,
1320
1368
  renouncePermissionsMethodName,
@@ -1342,5 +1390,7 @@ export {
1342
1390
  stxGetAddressesMethodName,
1343
1391
  stxGetAddressesParamsSchema,
1344
1392
  stxGetAddressesRequestMessageSchema,
1345
- stxGetAddressesResultSchema
1393
+ stxGetAddressesResultSchema,
1394
+ walletTypeSchema,
1395
+ walletTypes
1346
1396
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sats-connect/core",
3
- "version": "0.0.14",
3
+ "version": "0.0.15-204b382",
4
4
  "main": "dist/index.mjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",