@aptos-labs/wallet-adapter-core 4.23.1 → 4.24.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/AIP62StandardWallets/registry.d.ts +5 -3
- package/dist/AIP62StandardWallets/registry.d.ts.map +1 -1
- package/dist/AIP62StandardWallets/types.d.ts +1 -0
- package/dist/AIP62StandardWallets/types.d.ts.map +1 -1
- package/dist/WalletCore.d.ts.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -5
- package/dist/index.mjs.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/AIP62StandardWallets/registry.ts +6 -3
- package/src/AIP62StandardWallets/types.ts +3 -0
- package/src/WalletCore.ts +17 -4
- package/src/version.ts +1 -1
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const WALLET_ADAPTER_CORE_VERSION = "4.
|
|
1
|
+
export declare const WALLET_ADAPTER_CORE_VERSION = "4.24.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -8,11 +8,13 @@ import { AptosStandardSupportedWallet } from "./types";
|
|
|
8
8
|
*
|
|
9
9
|
* AIP-62 compatible wallets are required to add their wallet info here if they want to be detected by the adapter
|
|
10
10
|
*
|
|
11
|
-
* name - The name of your wallet cast to WalletName (Ex. "Petra" as WalletName<"Petra">)
|
|
12
|
-
* url -
|
|
13
|
-
* icon - An icon for your wallet. Can be one of 4 data types. Be sure to follow the below format exactly (including the literal "," after base64).
|
|
11
|
+
* @param name - The name of your wallet cast to WalletName (Ex. "Petra" as WalletName<"Petra">)
|
|
12
|
+
* @param url - The link to your chrome extension or main website where new users can create an account with your wallet.
|
|
13
|
+
* @param icon - An icon for your wallet. Can be one of 4 data types. Be sure to follow the below format exactly (including the literal "," after base64).
|
|
14
14
|
* Format: `data:image/${"svg+xml" | "webp" | "png" | "gif"};base64,${string}`
|
|
15
15
|
* Note: ${...} data in the above format should be replaced. Other characters are literals (ex. ";")
|
|
16
|
+
* @param deeplinkProvider optional - An optional deeplink provider for the wallet. If the wallet is not installed, we can redirect the user to the wallet's deeplink provider
|
|
17
|
+
* @example "https://myWallet.app/explore?link="
|
|
16
18
|
*/
|
|
17
19
|
export const aptosStandardSupportedWalletList: Array<AptosStandardSupportedWallet> =
|
|
18
20
|
[
|
|
@@ -29,6 +31,7 @@ export const aptosStandardSupportedWalletList: Array<AptosStandardSupportedWalle
|
|
|
29
31
|
icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAWbSURBVHgB7Z09c9NYFIaPlFSpUqQNK6rQhbSkWJghLZP9BesxfwAqytg1xe7+AY+3go5ACzObBkpwSqrVQkuRCiqkva8UZW1je22wpHPveZ8ZRU6wwwznueee+6FLJCuSdzrb7nZTNjaOJc9/ctdNiaJESPPkeeq+phLH5/L162k0HJ7JikTLvtEFPnFBf+D+0l/dt9tCNJK6xnjmZOg7GdJlPvC/AhQtPo5P3MsHQvwhiobLiLBQABf82y74z4Qt3ldSybKHToLTeW+I5/1B3u2euOD/JQy+zyRowEUs5zAzA1x+oCckJHrRYNCf/uE3AjD4QfONBBMC5PfvY2j3TEi4ZNmd8eHilQDFMK/s8xMhIXPhJLjuJLjAN/8VgRsbPWHwLbAtm5tXRWGRAS5b/99C7FBmgbTMAGXrJ5aIomJir8wA3S5afyLEEkUtEBezfQy+RYpFvdilgmMhNnGxRw2wL8QqScy1fMNE0T4yQCLEKkksxDQUwDj2BNjbK69pdndn/zxwNsUCCOyNGyJ374psbYkMBiLv30++59o1kW5X5NMnkdFI5OXL8nXghCsAAn10NL/Fz2NnpxQFFyR5/bq8BypDWAIg6AcHIoeH60nn4/K8e1deECIgwhAAQULQEXxIUAf43bju3ZvMDJ7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dGsd+Xdbs/dToSERD8aDHrTP4zmvZsSBMXM4INo0afyTudY4vg39zIR4iNFXXfZtc9k4XJw0V9k2R1OFHkIhvVZdn1R8MHCDDDx+zqdxK0c9tz1szAjaKWc1XUTe+OV/iKWFmAcJ8NtJ8Kxe7kvkCGKEiHN45Zz3b/9yN3/uVzUGxXD+RX4F56985hsqA6SAAAAAElFTkSuQmCC",
|
|
30
32
|
readyState: WalletReadyState.NotDetected,
|
|
31
33
|
isAIP62Standard: true,
|
|
34
|
+
deeplinkProvider: "https://petra.app/explore?link=",
|
|
32
35
|
},
|
|
33
36
|
{
|
|
34
37
|
name: "Pontem Wallet" as WalletName<"Pontem Wallet">,
|
|
@@ -14,6 +14,9 @@ export interface AptosStandardSupportedWallet<Name extends string = string> {
|
|
|
14
14
|
// A flag to indicate that this AptosStandardSupportedWallet implements the AIP-62 Wallet Standard.
|
|
15
15
|
// See https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-62.md for more details.
|
|
16
16
|
isAIP62Standard: true;
|
|
17
|
+
// An optional deeplink provider for the wallet. If the wallet is not installed, we can redirect the user to the wallet's deeplink provider
|
|
18
|
+
// @example "https://myWallet.app/explore?link="
|
|
19
|
+
deeplinkProvider?: string;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
// Update this with the name of your wallet when you create a new wallet plugin.
|
package/src/WalletCore.ts
CHANGED
|
@@ -741,11 +741,24 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
|
|
|
741
741
|
isRedirectable() &&
|
|
742
742
|
selectedWallet.readyState !== WalletReadyState.Installed
|
|
743
743
|
) {
|
|
744
|
-
//
|
|
745
|
-
if (selectedWallet.isAIP62Standard
|
|
746
|
-
|
|
747
|
-
|
|
744
|
+
// If wallet is AIP-62 compatible
|
|
745
|
+
if (selectedWallet.isAIP62Standard) {
|
|
746
|
+
// If wallet has a openInMobileApp method, use it
|
|
747
|
+
if (selectedWallet.openInMobileApp) {
|
|
748
|
+
selectedWallet.openInMobileApp();
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
751
|
+
// If wallet has a deeplinkProvider property, i.e wallet is on the internal registry, use it
|
|
752
|
+
const uninstalledWallet =
|
|
753
|
+
selectedWallet as AptosStandardSupportedWallet;
|
|
754
|
+
if (uninstalledWallet.deeplinkProvider) {
|
|
755
|
+
const url = encodeURIComponent(window.location.href);
|
|
756
|
+
const location = uninstalledWallet.deeplinkProvider.concat(url);
|
|
757
|
+
window.location.href = location;
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
748
760
|
}
|
|
761
|
+
// Wallet is on the old standard, check if it has a deeplinkProvider method property
|
|
749
762
|
if (selectedWallet.deeplinkProvider) {
|
|
750
763
|
const url = encodeURIComponent(window.location.href);
|
|
751
764
|
const location = selectedWallet.deeplinkProvider({ url });
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const WALLET_ADAPTER_CORE_VERSION = "4.
|
|
1
|
+
export const WALLET_ADAPTER_CORE_VERSION = "4.24.0";
|