@aptos-labs/wallet-adapter-core 7.6.0 → 7.7.0
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 +2 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/utils/walletSelector.d.ts +5 -5
- package/dist/utils/walletSelector.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/constants.ts +4 -4
- package/src/utils/walletSelector.ts +5 -5
|
@@ -18,18 +18,18 @@ export declare function isInstalledOrLoadable(wallet: AdapterWallet | AdapterNot
|
|
|
18
18
|
export declare function isInstallRequired(wallet: AdapterWallet | AdapterNotDetectedWallet): boolean;
|
|
19
19
|
/** Truncates the provided wallet address at the middle with an ellipsis. */
|
|
20
20
|
export declare function truncateAddress(address: string | undefined): string | undefined;
|
|
21
|
-
/** Returns `true` if the provided wallet is an
|
|
21
|
+
/** Returns `true` if the provided wallet is an Petra Web wallet. */
|
|
22
22
|
export declare function isAptosConnectWallet(wallet: WalletInfo | AdapterWallet): boolean;
|
|
23
23
|
/**
|
|
24
|
-
* Partitions the `wallets` array so that
|
|
25
|
-
*
|
|
24
|
+
* Partitions the `wallets` array so that Petra Web wallets are grouped separately from the rest.
|
|
25
|
+
* Petra Web is a web wallet that uses social login to create accounts on the blockchain.
|
|
26
26
|
*/
|
|
27
27
|
export declare function getAptosConnectWallets(wallets: ReadonlyArray<AdapterWallet | AdapterNotDetectedWallet>): {
|
|
28
28
|
aptosConnectWallets: AdapterWallet[];
|
|
29
29
|
otherWallets: AdapterNotDetectedWallet[];
|
|
30
30
|
};
|
|
31
31
|
export interface WalletSortingOptions {
|
|
32
|
-
/** An optional function for sorting
|
|
32
|
+
/** An optional function for sorting Petra Web wallets. */
|
|
33
33
|
sortAptosConnectWallets?: (a: AdapterWallet, b: AdapterWallet) => number;
|
|
34
34
|
/** An optional function for sorting wallets that are currently installed or loadable. */
|
|
35
35
|
sortAvailableWallets?: (a: AdapterWallet | AdapterNotDetectedWallet, b: AdapterWallet | AdapterNotDetectedWallet) => number;
|
|
@@ -40,7 +40,7 @@ export interface WalletSortingOptions {
|
|
|
40
40
|
* Partitions the `wallets` array into three distinct groups:
|
|
41
41
|
*
|
|
42
42
|
* `aptosConnectWallets` - Wallets that use social login to create accounts on
|
|
43
|
-
* the blockchain via
|
|
43
|
+
* the blockchain via Petra Web.
|
|
44
44
|
*
|
|
45
45
|
* `availableWallets` - Wallets that are currently installed or loadable by the client.
|
|
46
46
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletSelector.d.ts","sourceRoot":"","sources":["../../src/utils/walletSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAIxE;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,aAAa,CAAC,aAAa,GAAG,wBAAwB,CAAC,EAChE,iBAAiB,GAAE,CACjB,MAAM,EAAE,aAAa,GAAG,wBAAwB,KAC7C,OAA+B;;;EAWrC;AAED,2DAA2D;AAC3D,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,aAAa,GAAG,wBAAwB,WAGjD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,GAAG,wBAAwB,WAMjD;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,sBAG1D;AAED,
|
|
1
|
+
{"version":3,"file":"walletSelector.d.ts","sourceRoot":"","sources":["../../src/utils/walletSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC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
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-labs/wallet-adapter-core",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.0",
|
|
4
4
|
"description": "Aptos Wallet Adapter Core",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@aptos-labs/wallet-adapter-tsconfig": "0.0.2"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@aptos-connect/wallet-adapter-plugin": "^2.
|
|
43
|
+
"@aptos-connect/wallet-adapter-plugin": "^2.7.0",
|
|
44
44
|
"@aptos-labs/wallet-standard": "^0.5.2",
|
|
45
45
|
"buffer": "^6.0.3",
|
|
46
46
|
"eventemitter3": "^4.0.7",
|
package/src/constants.ts
CHANGED
|
@@ -19,9 +19,9 @@ export const ChainIdToAnsSupportedNetworkMap: Record<string, string> = {
|
|
|
19
19
|
"2": "testnet", // testnet
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
/** The base URL for all
|
|
23
|
-
export const APTOS_CONNECT_BASE_URL = "https://
|
|
22
|
+
/** The base URL for all Petra Web wallets. */
|
|
23
|
+
export const APTOS_CONNECT_BASE_URL = "https://web.petra.app";
|
|
24
24
|
|
|
25
|
-
/** The URL to the
|
|
25
|
+
/** The URL to the Petra Web account page if the user is signed in to Petra Web. */
|
|
26
26
|
export const APTOS_CONNECT_ACCOUNT_URL =
|
|
27
|
-
"https://
|
|
27
|
+
"https://web.petra.app/dashboard/main-account";
|
|
@@ -51,15 +51,15 @@ export function truncateAddress(address: string | undefined) {
|
|
|
51
51
|
return `${address.slice(0, 6)}...${address.slice(-5)}`;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
/** Returns `true` if the provided wallet is an
|
|
54
|
+
/** Returns `true` if the provided wallet is an Petra Web wallet. */
|
|
55
55
|
export function isAptosConnectWallet(wallet: WalletInfo | AdapterWallet) {
|
|
56
56
|
if (!wallet.url) return false;
|
|
57
57
|
return wallet.url.startsWith(APTOS_CONNECT_BASE_URL);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* Partitions the `wallets` array so that
|
|
62
|
-
*
|
|
61
|
+
* Partitions the `wallets` array so that Petra Web wallets are grouped separately from the rest.
|
|
62
|
+
* Petra Web is a web wallet that uses social login to create accounts on the blockchain.
|
|
63
63
|
*/
|
|
64
64
|
export function getAptosConnectWallets(
|
|
65
65
|
wallets: ReadonlyArray<AdapterWallet | AdapterNotDetectedWallet>,
|
|
@@ -72,7 +72,7 @@ export function getAptosConnectWallets(
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
export interface WalletSortingOptions {
|
|
75
|
-
/** An optional function for sorting
|
|
75
|
+
/** An optional function for sorting Petra Web wallets. */
|
|
76
76
|
sortAptosConnectWallets?: (a: AdapterWallet, b: AdapterWallet) => number;
|
|
77
77
|
/** An optional function for sorting wallets that are currently installed or loadable. */
|
|
78
78
|
sortAvailableWallets?: (
|
|
@@ -90,7 +90,7 @@ export interface WalletSortingOptions {
|
|
|
90
90
|
* Partitions the `wallets` array into three distinct groups:
|
|
91
91
|
*
|
|
92
92
|
* `aptosConnectWallets` - Wallets that use social login to create accounts on
|
|
93
|
-
* the blockchain via
|
|
93
|
+
* the blockchain via Petra Web.
|
|
94
94
|
*
|
|
95
95
|
* `availableWallets` - Wallets that are currently installed or loadable by the client.
|
|
96
96
|
*
|