@aptos-labs/wallet-adapter-core 7.6.0 → 7.7.1

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.mjs CHANGED
@@ -319,7 +319,7 @@ function _ts_generator(thisArg, body) {
319
319
  };
320
320
  }
321
321
  }
322
- var WALLET_ADAPTER_CORE_VERSION = "7.6.0";
322
+ var WALLET_ADAPTER_CORE_VERSION = "7.7.1";
323
323
  // src/WalletCore.ts
324
324
  import EventEmitter from "eventemitter3";
325
325
  import { AccountAddress, Aptos as Aptos2, Network as Network2, NetworkToChainId } from "@aptos-labs/ts-sdk";
@@ -598,7 +598,9 @@ var ChainIdToAnsSupportedNetworkMap = {
598
598
  "2": "testnet"
599
599
  };
600
600
  var APTOS_CONNECT_BASE_URL = "https://aptosconnect.app";
601
+ var PETRA_WEB_BASE_URL = "https://web.petra.app";
601
602
  var APTOS_CONNECT_ACCOUNT_URL = "https://aptosconnect.app/dashboard/main-account";
603
+ var PETRA_WEB_ACCOUNT_URL = "https://web.petra.app/dashboard/main-account";
602
604
  // src/utils/helpers.ts
603
605
  import { Aptos, AptosConfig, Hex, Network, NetworkToNodeAPI } from "@aptos-labs/ts-sdk";
604
606
  function isMobile() {
@@ -777,8 +779,11 @@ function truncateAddress(address) {
777
779
  return "".concat(address.slice(0, 6), "...").concat(address.slice(-5));
778
780
  }
779
781
  function isAptosConnectWallet(wallet) {
782
+ return isPetraWebWallet(wallet);
783
+ }
784
+ function isPetraWebWallet(wallet) {
780
785
  if (!wallet.url) return false;
781
- return wallet.url.startsWith(APTOS_CONNECT_BASE_URL);
786
+ return wallet.url.startsWith(APTOS_CONNECT_BASE_URL) || wallet.url.startsWith(PETRA_WEB_BASE_URL);
782
787
  }
783
788
  function getAptosConnectWallets(wallets) {
784
789
  var _partitionWallets = partitionWallets(wallets, isAptosConnectWallet), defaultWallets = _partitionWallets.defaultWallets, moreWallets = _partitionWallets.moreWallets;
@@ -787,12 +792,23 @@ function getAptosConnectWallets(wallets) {
787
792
  otherWallets: moreWallets
788
793
  };
789
794
  }
795
+ function getPetraWebWallets(wallets) {
796
+ var _partitionWallets = partitionWallets(wallets, isPetraWebWallet), defaultWallets = _partitionWallets.defaultWallets, moreWallets = _partitionWallets.moreWallets;
797
+ return {
798
+ petraWebWallets: defaultWallets,
799
+ otherWallets: moreWallets
800
+ };
801
+ }
790
802
  function groupAndSortWallets(wallets, options) {
791
- var _getAptosConnectWallets = getAptosConnectWallets(wallets), aptosConnectWallets = _getAptosConnectWallets.aptosConnectWallets, otherWallets = _getAptosConnectWallets.otherWallets;
803
+ var aptosConnectWallets = getAptosConnectWallets(wallets).aptosConnectWallets;
804
+ var _getPetraWebWallets = getPetraWebWallets(wallets), otherWallets = _getPetraWebWallets.otherWallets, petraWebWallets = _getPetraWebWallets.petraWebWallets;
792
805
  var _partitionWallets = partitionWallets(otherWallets), defaultWallets = _partitionWallets.defaultWallets, moreWallets = _partitionWallets.moreWallets;
793
806
  if (options === null || options === void 0 ? void 0 : options.sortAptosConnectWallets) {
794
807
  aptosConnectWallets.sort(options.sortAptosConnectWallets);
795
808
  }
809
+ if (options === null || options === void 0 ? void 0 : options.sortPetraWebWallets) {
810
+ petraWebWallets.sort(options.sortPetraWebWallets);
811
+ }
796
812
  if (options === null || options === void 0 ? void 0 : options.sortAvailableWallets) {
797
813
  defaultWallets.sort(options.sortAvailableWallets);
798
814
  }
@@ -800,7 +816,8 @@ function groupAndSortWallets(wallets, options) {
800
816
  moreWallets.sort(options.sortInstallableWallets);
801
817
  }
802
818
  return {
803
- /** Wallets that use social login to create an account on the blockchain */ aptosConnectWallets: aptosConnectWallets,
819
+ /** @deprecated Use {@link petraWebWallets} instead. */ aptosConnectWallets: aptosConnectWallets,
820
+ /** Wallets that use social login to create an account on the blockchain */ petraWebWallets: petraWebWallets,
804
821
  /** Wallets that are currently installed or loadable. */ availableWallets: defaultWallets,
805
822
  /** Wallets that are NOT currently installed or loadable. */ installableWallets: moreWallets
806
823
  };
@@ -2223,5 +2240,5 @@ var WalletCore = /*#__PURE__*/ function(EventEmitter) {
2223
2240
  if (typeof window !== "undefined") {
2224
2241
  window.WALLET_ADAPTER_CORE_VERSION = WALLET_ADAPTER_CORE_VERSION;
2225
2242
  }
2226
- export { APTOS_CONNECT_ACCOUNT_URL, APTOS_CONNECT_BASE_URL, ChainIdToAnsSupportedNetworkMap, NetworkName, WalletCore, WalletReadyState, aptosStandardSupportedWalletList, convertNetwork, crossChainStandardSupportedWalletList, fetchDevnetChainId, generalizedErrorMessage, getAptosConfig, getAptosConnectWallets, getLocalStorage, getSDKWallets, groupAndSortWallets, handlePublishPackageTransaction, isAptosConnectWallet, isAptosLiveNetwork, isAptosNetwork, isInAppBrowser, isInstallRequired, isInstalledOrLoadable, isMobile, isRedirectable, partitionWallets, removeLocalStorage, setLocalStorage, truncateAddress };
2243
+ export { APTOS_CONNECT_ACCOUNT_URL, APTOS_CONNECT_BASE_URL, ChainIdToAnsSupportedNetworkMap, NetworkName, PETRA_WEB_ACCOUNT_URL, PETRA_WEB_BASE_URL, WalletCore, WalletReadyState, aptosStandardSupportedWalletList, convertNetwork, crossChainStandardSupportedWalletList, fetchDevnetChainId, generalizedErrorMessage, getAptosConfig, getAptosConnectWallets, getLocalStorage, getPetraWebWallets, getSDKWallets, groupAndSortWallets, handlePublishPackageTransaction, isAptosConnectWallet, isAptosLiveNetwork, isAptosNetwork, isInAppBrowser, isInstallRequired, isInstalledOrLoadable, isMobile, isPetraWebWallet, isRedirectable, partitionWallets, removeLocalStorage, setLocalStorage, truncateAddress };
2227
2244
  //# sourceMappingURL=index.mjs.map