diff --git a/.changeset/tasty-poets-build.md b/.changeset/tasty-poets-build.md new file mode 100644 index 00000000..61b7bd12 --- /dev/null +++ b/.changeset/tasty-poets-build.md @@ -0,0 +1,5 @@ +--- +"@aptos-labs/wallet-adapter-core": patch +--- + +add leap wallet as AIP-62 wallet diff --git a/README.md b/README.md index a6bd5425..3ff6098c 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Note: These are in alphabetical order, any new wallets must be in alphabetical o - [Nightly](https://chromewebstore.google.com/detail/nightly/fiikommddbeccaoicoejoniammnalkfa) - [Petra](https://chromewebstore.google.com/detail/petra-aptos-wallet/ejjladinnckdgjemekebdpeokbikhfci?hl=en) - [Pontem](https://www.npmjs.com/package/@pontem/wallet-adapter-plugin) +- [Leap Wallet](https://chromewebstore.google.com/detail/leap-cosmos-wallet/fcfcfllfndlomdhbehjjcoimbgofdncg) - T wallet Legacy standard compatible diff --git a/apps/nextjs-example/src/app/page.tsx b/apps/nextjs-example/src/app/page.tsx index 032a79e0..dd48c570 100644 --- a/apps/nextjs-example/src/app/page.tsx +++ b/apps/nextjs-example/src/app/page.tsx @@ -48,7 +48,9 @@ import { registerWallet } from "@aptos-labs/wallet-standard"; registerWallet(myWallet); })(); -const isTelegramMiniApp = typeof window !== 'undefined' && (window as any).TelegramWebviewProxy !== undefined; +const isTelegramMiniApp = + typeof window !== "undefined" && + (window as any).TelegramWebviewProxy !== undefined; if (isTelegramMiniApp) { initTelegram(); } @@ -169,7 +171,9 @@ function WalletConnection({ }; // TODO: Do a proper check for network change support - const isNetworkChangeSupported = wallet?.name === "Nightly"; + const isNetworkChangeSupported = ["Nightly", "Leap Wallet"].includes( + wallet?.name ?? "" + ); return ( diff --git a/apps/nuxt-example/components/WalletConnection/WalletConnection.vue b/apps/nuxt-example/components/WalletConnection/WalletConnection.vue index c742ddb8..845679cd 100644 --- a/apps/nuxt-example/components/WalletConnection/WalletConnection.vue +++ b/apps/nuxt-example/components/WalletConnection/WalletConnection.vue @@ -8,13 +8,13 @@ import { import { Network } from "@aptos-labs/ts-sdk"; const WalletIcon = defineAsyncComponent( - () => import("~/components/ui/Wallet/WalletIcon.vue"), + () => import("~/components/ui/Wallet/WalletIcon.vue") ); const WalletLink = defineAsyncComponent( - () => import("~/components/ui/Wallet/WalletLink.vue"), + () => import("~/components/ui/Wallet/WalletLink.vue") ); const DisplayValue = defineAsyncComponent( - () => import("~/components/DisplayValue.vue"), + () => import("~/components/DisplayValue.vue") ); interface WalletConnectionProps { @@ -31,7 +31,7 @@ const { account, network, wallet } = toRefs(props); const isValidNetworkName = computed(() => { if (isAptosNetwork(network.value)) { return Object.values(Network).includes( - network.value?.name, + network.value?.name ); } // If the configured network is not an Aptos network, i.e is a custom network @@ -40,8 +40,8 @@ const isValidNetworkName = computed(() => { }); // TODO: Do a proper check for network change support -const isNetworkChangeSupported = computed( - () => wallet.value?.name === "Nightly", +const isNetworkChangeSupported = computed(() => + ["Nightly", "Leap Wallet"].includes(wallet.value?.name ?? "") ); diff --git a/packages/wallet-adapter-core/package.json b/packages/wallet-adapter-core/package.json index 07e6eb76..3d4d5917 100644 --- a/packages/wallet-adapter-core/package.json +++ b/packages/wallet-adapter-core/package.json @@ -1,6 +1,6 @@ { "name": "@aptos-labs/wallet-adapter-core", - "version": "4.23.0", + "version": "4.23.1", "description": "Aptos Wallet Adapter Core", "main": "./dist/index.js", "module": "./dist/index.mjs", diff --git a/packages/wallet-adapter-core/src/AIP62StandardWallets/registry.ts b/packages/wallet-adapter-core/src/AIP62StandardWallets/registry.ts index 52c533ee..3ec6b81c 100644 --- a/packages/wallet-adapter-core/src/AIP62StandardWallets/registry.ts +++ b/packages/wallet-adapter-core/src/AIP62StandardWallets/registry.ts @@ -37,4 +37,11 @@ export const aptosStandardSupportedWalletList: Array, + url: "https://chromewebstore.google.com/detail/leap-cosmos-wallet/fcfcfllfndlomdhbehjjcoimbgofdncg?utm_source=wallet-adapter&utm_medium=movementecosystem-wallet-adapter&utm_campaign=movementecosystem", + icon: "data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42MjE0IDkxLjc4NDggNjcuNDM0IDg5LjYyNzggNjYuNjk3MiA4Ny4zMDI5QzY2LjE3MDEgODUuNjM5NiA2NS44ODExIDgzLjkxMzUgNjUuODM1OSA4Mi4xNzYxQzY1LjgwNiA4MS4wMjk0IDY2LjgyNDQgODAuMTgwOCA2Ny45NjczIDgwLjI3OTFMODQuNDAwNyA4MS42OTI4TDk5Ljc5OTUgODMuMDE3NloiIGZpbGw9IiMwOTI1MTEiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF83ODBfNjEwIj4KPHJlY3Qgd2lkdGg9IjE2NiIgaGVpZ2h0PSIxNjYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==", + readyState: WalletReadyState.NotDetected, + isAIP62Standard: true, + }, ]; diff --git a/packages/wallet-adapter-core/src/AIP62StandardWallets/types.ts b/packages/wallet-adapter-core/src/AIP62StandardWallets/types.ts index e0ba26a9..c405373d 100644 --- a/packages/wallet-adapter-core/src/AIP62StandardWallets/types.ts +++ b/packages/wallet-adapter-core/src/AIP62StandardWallets/types.ts @@ -23,4 +23,5 @@ export type AvailableWallets = | "T wallet" | "Pontem Wallet" | "Mizu Wallet" - | "Continue with Google"; + | "Continue with Google" + | "Leap Wallet";