@sats-connect/core 0.1.0-6ee3e3f → 0.1.0-b9085f0

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,9 +339,7 @@ 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>; /**
343
- * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
344
- */
342
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
345
343
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
346
344
  }, undefined>, undefined>;
347
345
  }, undefined>;
@@ -478,12 +476,9 @@ declare const getAccountsParamsSchema: v.ObjectSchema<{
478
476
  }, undefined>;
479
477
  type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;
480
478
  declare const getAccountsResultSchema: v.ArraySchema<v.ObjectSchema<{
481
- readonly walletType: v.PicklistSchema<readonly ["software", "ledger"], undefined>;
482
479
  readonly address: v.StringSchema<undefined>;
483
480
  readonly publicKey: v.StringSchema<undefined>;
484
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>; /**
485
- * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
486
- */
481
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
487
482
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
488
483
  }, undefined>, undefined>;
489
484
  type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;
@@ -973,20 +968,6 @@ declare const renouncePermissionsRequestMessageSchema: v.ObjectSchema<{
973
968
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
974
969
  }, undefined>;
975
970
  type RenouncePermissions = MethodParamsAndResult<v.InferOutput<typeof renouncePermissionsParamsSchema>, v.InferOutput<typeof renouncePermissionsResultSchema>>;
976
- declare const getWalletTypeMethodName = "wallet_getWalletType";
977
- declare const getWalletTypeParamsSchema: v.NullishSchema<v.NullSchema<undefined>, never>;
978
- declare const getWalletTypeResultSchema: v.PicklistSchema<readonly ["software", "ledger"], undefined>;
979
- declare const getWalletTypeRequestMessageSchema: v.ObjectSchema<{
980
- readonly method: v.LiteralSchema<"wallet_getWalletType", undefined>;
981
- readonly id: v.StringSchema<undefined>;
982
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
983
- readonly params: v.OptionalSchema<v.UnionSchema<[v.ArraySchema<v.UnknownSchema, undefined>, v.LooseObjectSchema<{}, undefined>, v.NullSchema<undefined>], undefined>, never>;
984
- }, undefined>;
985
- type GetWalletType = MethodParamsAndResult<v.InferOutput<typeof getWalletTypeParamsSchema>, v.InferOutput<typeof getWalletTypeResultSchema>>;
986
-
987
- declare const walletTypes: readonly ["software", "ledger"];
988
- declare const walletTypeSchema: v.PicklistSchema<readonly ["software", "ledger"], undefined>;
989
- type WalletType = v.InferOutput<typeof walletTypeSchema>;
990
971
 
991
972
  interface StxRequests {
992
973
  stx_callContract: StxCallContract;
@@ -1024,16 +1005,15 @@ interface OrdinalsRequests {
1024
1005
  ord_getInscriptions: GetInscriptions;
1025
1006
  }
1026
1007
  type OrdinalsRequestMethod = keyof OrdinalsRequests;
1027
- interface WalletRequests {
1008
+ interface WalletMethods {
1028
1009
  wallet_requestPermissions: RequestPermissions;
1029
1010
  wallet_renouncePermissions: RenouncePermissions;
1030
- wallet_getWalletType: GetWalletType;
1031
1011
  }
1032
- type Requests = BtcRequests & StxRequests & RunesRequests & WalletRequests & OrdinalsRequests;
1012
+ type Requests = BtcRequests & StxRequests & RunesRequests & WalletMethods & OrdinalsRequests;
1033
1013
  type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : never;
1034
1014
  type Params<Method> = Method extends keyof Requests ? Requests[Method]['params'] : never;
1035
1015
 
1036
- declare const request: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletRequests | "ord_getInscriptions">(method: Method, params: Params<Method>, providerId?: string) => Promise<RpcResult<Method>>;
1016
+ 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>>;
1037
1017
 
1038
1018
  declare abstract class SatsConnectAdapter {
1039
1019
  abstract readonly id: string;
@@ -1051,10 +1031,10 @@ declare abstract class SatsConnectAdapter {
1051
1031
  declare class BaseAdapter extends SatsConnectAdapter {
1052
1032
  id: string;
1053
1033
  constructor(providerId: string);
1054
- requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletRequests | "ord_getInscriptions">(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
1034
+ requestInternal: <Method extends keyof BtcRequests | keyof StxRequests | keyof RunesRequests | keyof WalletMethods | "ord_getInscriptions">(method: Method, params: Params<Method>) => Promise<RpcResult<Method>>;
1055
1035
  }
1056
1036
 
1057
1037
  declare const DefaultAdaptersInfo: Record<string, Provider>;
1058
1038
  declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
1059
1039
 
1060
- export { type Address$1 as Address, AddressPurpose, AddressType, BaseAdapter, type BitcoinNetwork, BitcoinNetworkType, type BitcoinProvider, type BtcRequestMethod, type BtcRequests, type CallContractParams, type CallContractResult, type Capability, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type DeployContractParams, type DeployContractResult, type EstimateRbfOrder, type EstimateRunesEtch, type EstimateRunesEtchParams, type EstimateRunesEtchResult, type EstimateRunesMint, type EstimateRunesMintParams, type EstimateRunesMintResult, type EtchRunes, type EtchRunesParams, type EtchRunesResult, type GetAccounts, type GetAccountsParams, type GetAccountsRequestMessage, type GetAccountsResult, type GetAddressOptions, type GetAddressPayload, type GetAddressResponse, type GetAddresses, type GetAddressesParams, type GetAddressesRequestMessage, type GetAddressesResult, type GetBalance, type GetCapabilitiesOptions, type GetCapabilitiesPayload, type GetCapabilitiesResponse, type GetInfo, type GetInfoParams, type GetInfoRequestMessage, type GetInfoResult, type GetInscriptions, type GetOrder, type GetRunesBalance, type GetRunesBalanceParams, type GetRunesBalanceRequestMessage, type GetRunesBalanceResult, type GetWalletType, type InputToSign, type MethodParamsAndResult, type MintRunes, type MintRunesParams, type MintRunesResult, type OrdinalsRequestMethod, type OrdinalsRequests, type Params, type Provider, type PsbtPayload, type RbfOrder, type Recipient$2 as Recipient, type RenouncePermissions, type RequestOptions, type RequestPayload, type RequestPermissions, type Requests, type Return, type RpcBase, type RpcError, RpcErrorCode, type RpcErrorResponse, type RpcErrorResponseMessage, type RpcId, RpcIdSchema, type RpcRequest, type RpcRequestMessage, type RpcResponse, type RpcResponseMessage, type RpcResult, type RpcSuccessResponse, type RpcSuccessResponseMessage, type RunesRequestMethod, type RunesRequests, SatsConnectAdapter, type SendBtcTransactionOptions, type SendBtcTransactionPayload, type SendBtcTransactionResponse, type SendTransfer, type SendTransferParams, type SerializedRecipient, type SerializedSendBtcTransactionPayload, type SignMessage, type SignMessageOptions, type SignMessageParams, type SignMessagePayload, type SignMessageRequestMessage, type SignMessageResponse, type SignMessageResult, type SignMultiplePsbtPayload, type SignMultipleTransactionOptions, type SignMultipleTransactionsPayload, type SignMultipleTransactionsResponse, type SignPsbt, type SignPsbtParams, type SignPsbtResult, type SignStructuredMessageResult, type SignStxMessageParams, type SignStxMessageResult, type SignTransactionOptions, type SignTransactionPayload, type SignTransactionResponse, type StxCallContract, type StxDeployContract, type StxGetAccounts, type StxGetAccountsResult, type StxGetAddresses, type StxGetAddressesParams, type StxGetAddressesRequestMessage, type StxGetAddressesResult, type StxRequestMethod, type StxRequests, type StxSignStructuredMessage, type StxSignStxMessage, type StxSignTransaction, type StxSignTransactionParams, type StxSignTransactionRequestMessage, type StxSignTransactionResult, type StxTransferStx, type SupportedWallet, type TransferStxParams, type TransferStxResult, type WalletRequests, type WalletType, addressSchema, createInscription, createRepeatInscriptions, defaultAdapters, getAccountsMethodName, getAccountsParamsSchema, getAccountsRequestMessageSchema, getAccountsResultSchema, getAddress, getAddressesMethodName, getAddressesParamsSchema, getAddressesRequestMessageSchema, getAddressesResultSchema, getBalanceMethodName, getBalanceParamsSchema, getBalanceRequestMessageSchema, getBalanceResultSchema, getCapabilities, getDefaultProvider, getInfoMethodName, getInfoParamsSchema, getInfoRequestMessageSchema, getInfoResultSchema, getInscriptionsMethodName, getInscriptionsParamsSchema, getInscriptionsResultSchema, getInscriptionsSchema, getProviderById, getProviderOrThrow, getProviders, getRunesBalanceMethodName, getRunesBalanceParamsSchema, getRunesBalanceRequestMessageSchema, getRunesBalanceResultSchema, getSupportedWallets, getWalletTypeMethodName, getWalletTypeParamsSchema, getWalletTypeRequestMessageSchema, getWalletTypeResultSchema, isProviderInstalled, removeDefaultProvider, renouncePermissionsMethodName, renouncePermissionsParamsSchema, renouncePermissionsRequestMessageSchema, renouncePermissionsResultSchema, request, requestPermissionsMethodName, requestPermissionsParamsSchema, requestPermissionsRequestMessageSchema, requestPermissionsResultSchema, rpcErrorResponseMessageSchema, rpcRequestMessageSchema, rpcResponseMessageSchema, rpcSuccessResponseMessageSchema, sendBtcTransaction, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signTransaction, stxGetAddressesMethodName, stxGetAddressesParamsSchema, stxGetAddressesRequestMessageSchema, stxGetAddressesResultSchema, stxSignTransactionMethodName, stxSignTransactionParamsSchema, stxSignTransactionRequestMessageSchema, stxSignTransactionResultSchema, walletTypeSchema, walletTypes };
1040
+ 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 SignTransactionPayload, type SignTransactionResponse, type StxCallContract, type StxDeployContract, type StxGetAccounts, type StxGetAccountsResult, type StxGetAddresses, type StxGetAddressesParams, type StxGetAddressesRequestMessage, type StxGetAddressesResult, type StxRequestMethod, type StxRequests, type StxSignStructuredMessage, type StxSignStxMessage, type StxSignTransaction, type StxSignTransactionParams, type StxSignTransactionRequestMessage, type StxSignTransactionResult, type StxTransferStx, type SupportedWallet, type TransferStxParams, type TransferStxResult, type 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, stxSignTransactionMethodName, stxSignTransactionParamsSchema, stxSignTransactionRequestMessageSchema, stxSignTransactionResultSchema };
package/dist/index.mjs CHANGED
@@ -556,7 +556,7 @@ function getSupportedWallets() {
556
556
  }
557
557
 
558
558
  // src/request/index.ts
559
- import * as v9 from "valibot";
559
+ import * as v8 from "valibot";
560
560
 
561
561
  // src/addresses/index.ts
562
562
  import { createUnsecuredToken } from "jsontokens";
@@ -659,247 +659,213 @@ var stxSignTransactionRequestMessageSchema = v3.object({
659
659
  });
660
660
 
661
661
  // src/request/types/btcMethods.ts
662
- import * as v5 from "valibot";
663
-
664
- // src/request/types/common.ts
665
662
  import * as v4 from "valibot";
666
- var walletTypes = ["software", "ledger"];
667
- var walletTypeSchema = v4.picklist(walletTypes);
668
-
669
- // src/request/types/btcMethods.ts
670
663
  var getInfoMethodName = "getInfo";
671
- var getInfoParamsSchema = v5.nullish(v5.null());
672
- var getInfoResultSchema = v5.object({
664
+ var getInfoParamsSchema = v4.nullish(v4.null());
665
+ var getInfoResultSchema = v4.object({
673
666
  /**
674
667
  * Version of the wallet.
675
668
  */
676
- version: v5.string(),
669
+ version: v4.string(),
677
670
  /**
678
671
  * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
679
672
  */
680
- methods: v5.optional(v5.array(v5.string())),
673
+ methods: v4.optional(v4.array(v4.string())),
681
674
  /**
682
675
  * List of WBIP standards supported by the wallet. Not currently used.
683
676
  */
684
- supports: v5.array(v5.string())
677
+ supports: v4.array(v4.string())
685
678
  });
686
- var getInfoRequestMessageSchema = v5.object({
679
+ var getInfoRequestMessageSchema = v4.object({
687
680
  ...rpcRequestMessageSchema.entries,
688
- ...v5.object({
689
- method: v5.literal(getInfoMethodName),
681
+ ...v4.object({
682
+ method: v4.literal(getInfoMethodName),
690
683
  params: getInfoParamsSchema,
691
- id: v5.string()
684
+ id: v4.string()
692
685
  }).entries
693
686
  });
694
687
  var getAddressesMethodName = "getAddresses";
695
- var getAddressesParamsSchema = v5.object({
688
+ var getAddressesParamsSchema = v4.object({
696
689
  /**
697
690
  * The purposes for which to generate addresses. See
698
691
  * {@linkcode AddressPurpose} for available purposes.
699
692
  */
700
- purposes: v5.array(v5.enum(AddressPurpose)),
693
+ purposes: v4.array(v4.enum(AddressPurpose)),
701
694
  /**
702
695
  * A message to be displayed to the user in the request prompt.
703
696
  */
704
- message: v5.optional(v5.string())
697
+ message: v4.optional(v4.string())
705
698
  });
706
- var getAddressesResultSchema = v5.object({
699
+ var getAddressesResultSchema = v4.object({
707
700
  /**
708
701
  * The addresses generated for the given purposes.
709
702
  */
710
- addresses: v5.array(addressSchema)
703
+ addresses: v4.array(addressSchema)
711
704
  });
712
- var getAddressesRequestMessageSchema = v5.object({
705
+ var getAddressesRequestMessageSchema = v4.object({
713
706
  ...rpcRequestMessageSchema.entries,
714
- ...v5.object({
715
- method: v5.literal(getAddressesMethodName),
707
+ ...v4.object({
708
+ method: v4.literal(getAddressesMethodName),
716
709
  params: getAddressesParamsSchema,
717
- id: v5.string()
710
+ id: v4.string()
718
711
  }).entries
719
712
  });
720
713
  var signMessageMethodName = "signMessage";
721
- var signMessageParamsSchema = v5.object({
714
+ var signMessageParamsSchema = v4.object({
722
715
  /**
723
716
  * The address used for signing.
724
717
  **/
725
- address: v5.string(),
718
+ address: v4.string(),
726
719
  /**
727
720
  * The message to sign.
728
721
  **/
729
- message: v5.string()
722
+ message: v4.string()
730
723
  });
731
- var signMessageResultSchema = v5.object({
724
+ var signMessageResultSchema = v4.object({
732
725
  /**
733
726
  * The signature of the message.
734
727
  */
735
- signature: v5.string(),
728
+ signature: v4.string(),
736
729
  /**
737
730
  * hash of the message.
738
731
  */
739
- messageHash: v5.string(),
732
+ messageHash: v4.string(),
740
733
  /**
741
734
  * The address used for signing.
742
735
  */
743
- address: v5.string()
736
+ address: v4.string()
744
737
  });
745
- var signMessageRequestMessageSchema = v5.object({
738
+ var signMessageRequestMessageSchema = v4.object({
746
739
  ...rpcRequestMessageSchema.entries,
747
- ...v5.object({
748
- method: v5.literal(signMessageMethodName),
740
+ ...v4.object({
741
+ method: v4.literal(signMessageMethodName),
749
742
  params: signMessageParamsSchema,
750
- id: v5.string()
743
+ id: v4.string()
751
744
  }).entries
752
745
  });
753
746
  var getAccountsMethodName = "getAccounts";
754
- var getAccountsParamsSchema = v5.object({
755
- /**
756
- * The purposes for which to generate addresses. See
757
- * {@linkcode AddressPurpose} for available purposes.
758
- */
759
- purposes: v5.array(v5.enum(AddressPurpose)),
760
- /**
761
- * A message to be displayed to the user in the request prompt.
762
- */
763
- message: v5.optional(v5.string())
764
- });
765
- var getAccountsResultSchema = v5.array(
766
- v5.object({
767
- ...addressSchema.entries,
768
- ...v5.object({
769
- walletType: walletTypeSchema
770
- }).entries
771
- })
772
- );
773
- var getAccountsRequestMessageSchema = v5.object({
747
+ var getAccountsParamsSchema = getAddressesParamsSchema;
748
+ var getAccountsResultSchema = v4.array(addressSchema);
749
+ var getAccountsRequestMessageSchema = v4.object({
774
750
  ...rpcRequestMessageSchema.entries,
775
- ...v5.object({
776
- method: v5.literal(getAccountsMethodName),
751
+ ...v4.object({
752
+ method: v4.literal(getAccountsMethodName),
777
753
  params: getAccountsParamsSchema,
778
- id: v5.string()
754
+ id: v4.string()
779
755
  }).entries
780
756
  });
781
757
  var getBalanceMethodName = "getBalance";
782
- var getBalanceParamsSchema = v5.nullish(v5.null());
783
- var getBalanceResultSchema = v5.object({
758
+ var getBalanceParamsSchema = v4.nullish(v4.null());
759
+ var getBalanceResultSchema = v4.object({
784
760
  /**
785
761
  * The confirmed balance of the wallet in sats. Using a string due to chrome
786
762
  * messages not supporting bigint
787
763
  * (https://issues.chromium.org/issues/40116184).
788
764
  */
789
- confirmed: v5.string(),
765
+ confirmed: v4.string(),
790
766
  /**
791
767
  * The unconfirmed balance of the wallet in sats. Using a string due to chrome
792
768
  * messages not supporting bigint
793
769
  * (https://issues.chromium.org/issues/40116184).
794
770
  */
795
- unconfirmed: v5.string(),
771
+ unconfirmed: v4.string(),
796
772
  /**
797
773
  * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
798
774
  * sats. Using a string due to chrome messages not supporting bigint
799
775
  * (https://issues.chromium.org/issues/40116184).
800
776
  */
801
- total: v5.string()
777
+ total: v4.string()
802
778
  });
803
- var getBalanceRequestMessageSchema = v5.object({
779
+ var getBalanceRequestMessageSchema = v4.object({
804
780
  ...rpcRequestMessageSchema.entries,
805
- ...v5.object({
806
- method: v5.literal(getBalanceMethodName),
807
- id: v5.string()
781
+ ...v4.object({
782
+ method: v4.literal(getBalanceMethodName),
783
+ id: v4.string()
808
784
  }).entries
809
785
  });
810
786
 
811
787
  // src/request/types/walletMethods.ts
812
- import * as v6 from "valibot";
788
+ import * as v5 from "valibot";
813
789
  var requestPermissionsMethodName = "wallet_requestPermissions";
814
- var requestPermissionsParamsSchema = v6.undefined();
815
- var requestPermissionsResultSchema = v6.literal(true);
816
- var requestPermissionsRequestMessageSchema = v6.object({
790
+ var requestPermissionsParamsSchema = v5.undefined();
791
+ var requestPermissionsResultSchema = v5.literal(true);
792
+ var requestPermissionsRequestMessageSchema = v5.object({
817
793
  ...rpcRequestMessageSchema.entries,
818
- ...v6.object({
819
- method: v6.literal(requestPermissionsMethodName),
794
+ ...v5.object({
795
+ method: v5.literal(requestPermissionsMethodName),
820
796
  params: requestPermissionsParamsSchema,
821
- id: v6.string()
797
+ id: v5.string()
822
798
  }).entries
823
799
  });
824
800
  var renouncePermissionsMethodName = "wallet_renouncePermissions";
825
- var renouncePermissionsParamsSchema = v6.undefined();
826
- var renouncePermissionsResultSchema = v6.literal(true);
827
- var renouncePermissionsRequestMessageSchema = v6.object({
801
+ var renouncePermissionsParamsSchema = v5.undefined();
802
+ var renouncePermissionsResultSchema = v5.literal(true);
803
+ var renouncePermissionsRequestMessageSchema = v5.object({
828
804
  ...rpcRequestMessageSchema.entries,
829
- ...v6.object({
830
- method: v6.literal(renouncePermissionsMethodName),
805
+ ...v5.object({
806
+ method: v5.literal(renouncePermissionsMethodName),
831
807
  params: renouncePermissionsParamsSchema,
832
- id: v6.string()
833
- }).entries
834
- });
835
- var getWalletTypeMethodName = "wallet_getWalletType";
836
- var getWalletTypeParamsSchema = v6.nullish(v6.null());
837
- var getWalletTypeResultSchema = walletTypeSchema;
838
- var getWalletTypeRequestMessageSchema = v6.object({
839
- ...rpcRequestMessageSchema.entries,
840
- ...v6.object({
841
- method: v6.literal(getWalletTypeMethodName),
842
- id: v6.string()
808
+ id: v5.string()
843
809
  }).entries
844
810
  });
845
811
 
846
812
  // src/request/types/runesMethods.ts
847
- import * as v7 from "valibot";
813
+ import * as v6 from "valibot";
848
814
  var getRunesBalanceMethodName = "runes_getBalance";
849
- var getRunesBalanceParamsSchema = v7.nullish(v7.null());
850
- var getRunesBalanceResultSchema = v7.object({
851
- balances: v7.array(
852
- v7.object({
853
- runeName: v7.string(),
854
- amount: v7.string(),
855
- divisibility: v7.number(),
856
- symbol: v7.string(),
857
- inscriptionId: v7.nullish(v7.string())
815
+ var getRunesBalanceParamsSchema = v6.nullish(v6.null());
816
+ var getRunesBalanceResultSchema = v6.object({
817
+ balances: v6.array(
818
+ v6.object({
819
+ runeName: v6.string(),
820
+ amount: v6.string(),
821
+ divisibility: v6.number(),
822
+ symbol: v6.string(),
823
+ inscriptionId: v6.nullish(v6.string())
858
824
  })
859
825
  )
860
826
  });
861
- var getRunesBalanceRequestMessageSchema = v7.object({
827
+ var getRunesBalanceRequestMessageSchema = v6.object({
862
828
  ...rpcRequestMessageSchema.entries,
863
- ...v7.object({
864
- method: v7.literal(getRunesBalanceMethodName),
829
+ ...v6.object({
830
+ method: v6.literal(getRunesBalanceMethodName),
865
831
  params: getRunesBalanceParamsSchema,
866
- id: v7.string()
832
+ id: v6.string()
867
833
  }).entries
868
834
  });
869
835
 
870
836
  // src/request/types/ordinalsMethods.ts
871
- import * as v8 from "valibot";
837
+ import * as v7 from "valibot";
872
838
  var getInscriptionsMethodName = "ord_getInscriptions";
873
- var getInscriptionsParamsSchema = v8.object({
874
- offset: v8.number(),
875
- limit: v8.number()
839
+ var getInscriptionsParamsSchema = v7.object({
840
+ offset: v7.number(),
841
+ limit: v7.number()
876
842
  });
877
- var getInscriptionsResultSchema = v8.object({
878
- total: v8.number(),
879
- limit: v8.number(),
880
- offset: v8.number(),
881
- inscriptions: v8.array(
882
- v8.object({
883
- inscriptionId: v8.string(),
884
- inscriptionNumber: v8.string(),
885
- address: v8.string(),
886
- collectionName: v8.optional(v8.string()),
887
- postage: v8.string(),
888
- contentLength: v8.string(),
889
- contentType: v8.string(),
890
- timestamp: v8.number(),
891
- offset: v8.number(),
892
- genesisTransaction: v8.string(),
893
- output: v8.string()
843
+ var getInscriptionsResultSchema = v7.object({
844
+ total: v7.number(),
845
+ limit: v7.number(),
846
+ offset: v7.number(),
847
+ inscriptions: v7.array(
848
+ v7.object({
849
+ inscriptionId: v7.string(),
850
+ inscriptionNumber: v7.string(),
851
+ address: v7.string(),
852
+ collectionName: v7.optional(v7.string()),
853
+ postage: v7.string(),
854
+ contentLength: v7.string(),
855
+ contentType: v7.string(),
856
+ timestamp: v7.number(),
857
+ offset: v7.number(),
858
+ genesisTransaction: v7.string(),
859
+ output: v7.string()
894
860
  })
895
861
  )
896
862
  });
897
- var getInscriptionsSchema = v8.object({
863
+ var getInscriptionsSchema = v7.object({
898
864
  ...rpcRequestMessageSchema.entries,
899
- ...v8.object({
900
- method: v8.literal(getInscriptionsMethodName),
865
+ ...v7.object({
866
+ method: v7.literal(getInscriptionsMethodName),
901
867
  params: getInscriptionsParamsSchema,
902
- id: v8.string()
868
+ id: v7.string()
903
869
  }).entries
904
870
  });
905
871
 
@@ -916,13 +882,13 @@ var request = async (method, params, providerId) => {
916
882
  throw new Error("A wallet method is required");
917
883
  }
918
884
  const response = await provider.request(method, params);
919
- if (v9.is(rpcErrorResponseMessageSchema, response)) {
885
+ if (v8.is(rpcErrorResponseMessageSchema, response)) {
920
886
  return {
921
887
  status: "error",
922
888
  error: response.error
923
889
  };
924
890
  }
925
- if (v9.is(rpcSuccessResponseMessageSchema, response)) {
891
+ if (v8.is(rpcSuccessResponseMessageSchema, response)) {
926
892
  return {
927
893
  status: "success",
928
894
  result: response.result
@@ -1389,10 +1355,6 @@ export {
1389
1355
  getRunesBalanceRequestMessageSchema,
1390
1356
  getRunesBalanceResultSchema,
1391
1357
  getSupportedWallets,
1392
- getWalletTypeMethodName,
1393
- getWalletTypeParamsSchema,
1394
- getWalletTypeRequestMessageSchema,
1395
- getWalletTypeResultSchema,
1396
1358
  isProviderInstalled,
1397
1359
  removeDefaultProvider,
1398
1360
  renouncePermissionsMethodName,
@@ -1424,7 +1386,5 @@ export {
1424
1386
  stxSignTransactionMethodName,
1425
1387
  stxSignTransactionParamsSchema,
1426
1388
  stxSignTransactionRequestMessageSchema,
1427
- stxSignTransactionResultSchema,
1428
- walletTypeSchema,
1429
- walletTypes
1389
+ stxSignTransactionResultSchema
1430
1390
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sats-connect/core",
3
- "version": "0.1.0-6ee3e3f",
3
+ "version": "0.1.0-b9085f0",
4
4
  "main": "dist/index.mjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",