@aptos-labs/wallet-adapter-core 4.2.1 → 4.4.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/src/WalletCore.ts CHANGED
@@ -83,6 +83,11 @@ import { aptosStandardSupportedWalletList } from "./AIP62StandardWallets/registr
83
83
 
84
84
  export type IAptosWallet = AptosStandardWallet & Wallet;
85
85
 
86
+ /** Any wallet that can be handled by `WalletCore`.
87
+ * This includes both wallets from legacy wallet adapter plugins and compatible AIP-62 standard wallets.
88
+ */
89
+ export type AnyAptosWallet = Wallet | AptosStandardSupportedWallet;
90
+
86
91
  export class WalletCore extends EventEmitter<WalletCoreEvents> {
87
92
  // Private array to hold legacy wallet adapter plugins
88
93
  private _wallets: ReadonlyArray<Wallet> = [];
@@ -95,7 +100,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
95
100
 
96
101
  // Private array to hold all wallets (legacy wallet adapter plugins AND compatible AIP-62 standard wallets)
97
102
  // while providing support for legacy and new wallet standard
98
- private _all_wallets: Array<Wallet | AptosStandardSupportedWallet> = [];
103
+ private _all_wallets: Array<AnyAptosWallet> = [];
99
104
 
100
105
  // Current connected wallet
101
106
  private _wallet: Wallet | null = null;
@@ -243,6 +248,8 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
243
248
  * @returns
244
249
  */
245
250
  excludeWallet(walletName: string): boolean {
251
+ // for now, we always include AptosConnect
252
+ if (walletName === "Google (AptosConnect)") return false;
246
253
  // If _optInWallets is not empty, and does not include the provided wallet,
247
254
  // return true to exclude the wallet, otherwise return false
248
255
  if (
@@ -516,7 +523,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
516
523
  /**
517
524
  * Getter to fetch all detected wallets
518
525
  */
519
- get wallets(): ReadonlyArray<Wallet | AptosStandardSupportedWallet> {
526
+ get wallets(): ReadonlyArray<AnyAptosWallet> {
520
527
  return this._all_wallets;
521
528
  }
522
529
 
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { WALLET_ADAPTER_CORE_VERSION } from "./version";
2
2
 
3
- export { WalletCore } from "./WalletCore";
3
+ export { type AnyAptosWallet, WalletCore } from "./WalletCore";
4
4
  export * from "./LegacyWalletPlugins";
5
5
  export * from "./constants";
6
6
  export * from "./utils";
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const WALLET_ADAPTER_CORE_VERSION = "4.2.1";
1
+ export const WALLET_ADAPTER_CORE_VERSION = "4.4.0";