@aptos-labs/wallet-adapter-core 7.7.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/constants.d.ts +14 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.js +39 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -7
- package/dist/index.mjs.map +1 -1
- package/dist/utils/types.d.ts.map +1 -1
- package/dist/utils/walletSelector.d.ts +31 -5
- package/dist/utils/walletSelector.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/WalletCore.ts +27 -27
- package/src/constants.ts +17 -2
- package/src/utils/types.ts +1 -2
- package/src/utils/walletSelector.ts +54 -8
- package/src/version.ts +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -13,8 +13,20 @@ export declare enum NetworkName {
|
|
|
13
13
|
Devnet = "devnet"
|
|
14
14
|
}
|
|
15
15
|
export declare const ChainIdToAnsSupportedNetworkMap: Record<string, string>;
|
|
16
|
-
/**
|
|
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
|
|
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
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -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
|
|
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.
|
|
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");
|
|
@@ -479,7 +491,7 @@ var import_wallet_standard = require("@aptos-labs/wallet-standard");
|
|
|
479
491
|
var GA4 = /*#__PURE__*/ function() {
|
|
480
492
|
function GA4() {
|
|
481
493
|
_class_call_check(this, GA4);
|
|
482
|
-
this.aptosGAID =
|
|
494
|
+
this.aptosGAID = "G-GNVVWBL3J9";
|
|
483
495
|
this.injectGA(this.aptosGAID);
|
|
484
496
|
}
|
|
485
497
|
_create_class(GA4, [
|
|
@@ -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
|
|
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
|
-
/**
|
|
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
|
};
|
|
@@ -1213,7 +1242,7 @@ var WalletCore = /*#__PURE__*/ function(_import_eventemitter3_default) {
|
|
|
1213
1242
|
network: (_this__network = this._network) === null || _this__network === void 0 ? void 0 : _this__network.name,
|
|
1214
1243
|
network_url: (_this__network1 = this._network) === null || _this__network1 === void 0 ? void 0 : _this__network1.url,
|
|
1215
1244
|
adapter_core_version: WALLET_ADAPTER_CORE_VERSION,
|
|
1216
|
-
send_to:
|
|
1245
|
+
send_to: "G-GNVVWBL3J9"
|
|
1217
1246
|
}, additionalInfo));
|
|
1218
1247
|
}
|
|
1219
1248
|
},
|
|
@@ -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,
|