@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.
@@ -13,8 +13,20 @@ export declare enum NetworkName {
13
13
  Devnet = "devnet"
14
14
  }
15
15
  export declare const ChainIdToAnsSupportedNetworkMap: Record<string, string>;
16
- /** The base URL for all Aptos Connect wallets. */
16
+ /**
17
+ * The base URL for all Aptos Connect wallets.
18
+ *
19
+ * @deprecated Use {@link PETRA_WEB_BASE_URL} instead.
20
+ */
17
21
  export declare const APTOS_CONNECT_BASE_URL = "https://aptosconnect.app";
18
- /** The URL to the Aptos Connect account page if the user is signed in to Aptos Connect. */
22
+ /** The base URL for all Petra Web wallets. */
23
+ export declare const PETRA_WEB_BASE_URL = "https://web.petra.app";
24
+ /**
25
+ * The URL to the Aptos Connect account page if the user is signed in to Aptos Connect.
26
+ *
27
+ * @deprecated Use {@link PETRA_WEB_ACCOUNT_URL} instead.
28
+ */
19
29
  export declare const APTOS_CONNECT_ACCOUNT_URL = "https://aptosconnect.app/dashboard/main-account";
30
+ /** The URL to the Petra Web account page if the user is signed in to Petra Web. */
31
+ export declare const PETRA_WEB_ACCOUNT_URL = "https://web.petra.app/dashboard/main-account";
20
32
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAC1B;;;;OAIG;IACH,SAAS,cAAc;IACvB,WAAW,gBAAgB;CAC5B;AAED,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGlE,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,sBAAsB,6BAA6B,CAAC;AAEjE,2FAA2F;AAC3F,eAAO,MAAM,yBAAyB,oDACa,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAC1B;;;;OAIG;IACH,SAAS,cAAc;IACvB,WAAW,gBAAgB;CAC5B;AAED,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGlE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,6BAA6B,CAAC;AAEjE,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,oDACa,CAAC;AAEpD,mFAAmF;AACnF,eAAO,MAAM,qBAAqB,iDACc,CAAC"}
package/dist/index.js CHANGED
@@ -392,6 +392,12 @@ __export(index_exports, {
392
392
  NetworkName: function() {
393
393
  return NetworkName;
394
394
  },
395
+ PETRA_WEB_ACCOUNT_URL: function() {
396
+ return PETRA_WEB_ACCOUNT_URL;
397
+ },
398
+ PETRA_WEB_BASE_URL: function() {
399
+ return PETRA_WEB_BASE_URL;
400
+ },
395
401
  WalletCore: function() {
396
402
  return WalletCore;
397
403
  },
@@ -422,6 +428,9 @@ __export(index_exports, {
422
428
  getLocalStorage: function() {
423
429
  return getLocalStorage;
424
430
  },
431
+ getPetraWebWallets: function() {
432
+ return getPetraWebWallets;
433
+ },
425
434
  getSDKWallets: function() {
426
435
  return getSDKWallets;
427
436
  },
@@ -452,6 +461,9 @@ __export(index_exports, {
452
461
  isMobile: function() {
453
462
  return isMobile;
454
463
  },
464
+ isPetraWebWallet: function() {
465
+ return isPetraWebWallet;
466
+ },
455
467
  isRedirectable: function() {
456
468
  return isRedirectable;
457
469
  },
@@ -470,7 +482,7 @@ __export(index_exports, {
470
482
  });
471
483
  module.exports = __toCommonJS(index_exports);
472
484
  // src/version.ts
473
- var WALLET_ADAPTER_CORE_VERSION = "7.6.0";
485
+ var WALLET_ADAPTER_CORE_VERSION = "7.7.1";
474
486
  // src/WalletCore.ts
475
487
  var import_eventemitter3 = __toESM(require("eventemitter3"));
476
488
  var import_ts_sdk2 = require("@aptos-labs/ts-sdk");
@@ -730,7 +742,9 @@ var ChainIdToAnsSupportedNetworkMap = {
730
742
  "2": "testnet"
731
743
  };
732
744
  var APTOS_CONNECT_BASE_URL = "https://aptosconnect.app";
745
+ var PETRA_WEB_BASE_URL = "https://web.petra.app";
733
746
  var APTOS_CONNECT_ACCOUNT_URL = "https://aptosconnect.app/dashboard/main-account";
747
+ var PETRA_WEB_ACCOUNT_URL = "https://web.petra.app/dashboard/main-account";
734
748
  // src/utils/helpers.ts
735
749
  var import_ts_sdk = require("@aptos-labs/ts-sdk");
736
750
  function isMobile() {
@@ -909,8 +923,11 @@ function truncateAddress(address) {
909
923
  return "".concat(address.slice(0, 6), "...").concat(address.slice(-5));
910
924
  }
911
925
  function isAptosConnectWallet(wallet) {
926
+ return isPetraWebWallet(wallet);
927
+ }
928
+ function isPetraWebWallet(wallet) {
912
929
  if (!wallet.url) return false;
913
- return wallet.url.startsWith(APTOS_CONNECT_BASE_URL);
930
+ return wallet.url.startsWith(APTOS_CONNECT_BASE_URL) || wallet.url.startsWith(PETRA_WEB_BASE_URL);
914
931
  }
915
932
  function getAptosConnectWallets(wallets) {
916
933
  var _partitionWallets = partitionWallets(wallets, isAptosConnectWallet), defaultWallets = _partitionWallets.defaultWallets, moreWallets = _partitionWallets.moreWallets;
@@ -919,12 +936,23 @@ function getAptosConnectWallets(wallets) {
919
936
  otherWallets: moreWallets
920
937
  };
921
938
  }
939
+ function getPetraWebWallets(wallets) {
940
+ var _partitionWallets = partitionWallets(wallets, isPetraWebWallet), defaultWallets = _partitionWallets.defaultWallets, moreWallets = _partitionWallets.moreWallets;
941
+ return {
942
+ petraWebWallets: defaultWallets,
943
+ otherWallets: moreWallets
944
+ };
945
+ }
922
946
  function groupAndSortWallets(wallets, options) {
923
- var _getAptosConnectWallets = getAptosConnectWallets(wallets), aptosConnectWallets = _getAptosConnectWallets.aptosConnectWallets, otherWallets = _getAptosConnectWallets.otherWallets;
947
+ var aptosConnectWallets = getAptosConnectWallets(wallets).aptosConnectWallets;
948
+ var _getPetraWebWallets = getPetraWebWallets(wallets), otherWallets = _getPetraWebWallets.otherWallets, petraWebWallets = _getPetraWebWallets.petraWebWallets;
924
949
  var _partitionWallets = partitionWallets(otherWallets), defaultWallets = _partitionWallets.defaultWallets, moreWallets = _partitionWallets.moreWallets;
925
950
  if (options === null || options === void 0 ? void 0 : options.sortAptosConnectWallets) {
926
951
  aptosConnectWallets.sort(options.sortAptosConnectWallets);
927
952
  }
953
+ if (options === null || options === void 0 ? void 0 : options.sortPetraWebWallets) {
954
+ petraWebWallets.sort(options.sortPetraWebWallets);
955
+ }
928
956
  if (options === null || options === void 0 ? void 0 : options.sortAvailableWallets) {
929
957
  defaultWallets.sort(options.sortAvailableWallets);
930
958
  }
@@ -932,7 +960,8 @@ function groupAndSortWallets(wallets, options) {
932
960
  moreWallets.sort(options.sortInstallableWallets);
933
961
  }
934
962
  return {
935
- /** Wallets that use social login to create an account on the blockchain */ aptosConnectWallets: aptosConnectWallets,
963
+ /** @deprecated Use {@link petraWebWallets} instead. */ aptosConnectWallets: aptosConnectWallets,
964
+ /** Wallets that use social login to create an account on the blockchain */ petraWebWallets: petraWebWallets,
936
965
  /** Wallets that are currently installed or loadable. */ availableWallets: defaultWallets,
937
966
  /** Wallets that are NOT currently installed or loadable. */ installableWallets: moreWallets
938
967
  };
@@ -2360,6 +2389,8 @@ if (typeof window !== "undefined") {
2360
2389
  APTOS_CONNECT_BASE_URL: APTOS_CONNECT_BASE_URL,
2361
2390
  ChainIdToAnsSupportedNetworkMap: ChainIdToAnsSupportedNetworkMap,
2362
2391
  NetworkName: NetworkName,
2392
+ PETRA_WEB_ACCOUNT_URL: PETRA_WEB_ACCOUNT_URL,
2393
+ PETRA_WEB_BASE_URL: PETRA_WEB_BASE_URL,
2363
2394
  WalletCore: WalletCore,
2364
2395
  WalletReadyState: WalletReadyState,
2365
2396
  aptosStandardSupportedWalletList: aptosStandardSupportedWalletList,
@@ -2370,6 +2401,7 @@ if (typeof window !== "undefined") {
2370
2401
  getAptosConfig: getAptosConfig,
2371
2402
  getAptosConnectWallets: getAptosConnectWallets,
2372
2403
  getLocalStorage: getLocalStorage,
2404
+ getPetraWebWallets: getPetraWebWallets,
2373
2405
  getSDKWallets: getSDKWallets,
2374
2406
  groupAndSortWallets: groupAndSortWallets,
2375
2407
  handlePublishPackageTransaction: handlePublishPackageTransaction,
@@ -2380,6 +2412,7 @@ if (typeof window !== "undefined") {
2380
2412
  isInstallRequired: isInstallRequired,
2381
2413
  isInstalledOrLoadable: isInstalledOrLoadable,
2382
2414
  isMobile: isMobile,
2415
+ isPetraWebWallet: isPetraWebWallet,
2383
2416
  isRedirectable: isRedirectable,
2384
2417
  partitionWallets: partitionWallets,
2385
2418
  removeLocalStorage: removeLocalStorage,