Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aptos cctp: support aptos connect #3330

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions wormhole-connect/src/hooks/useWalletCompatibility.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useMemo } from 'react';
import { Chain } from '@wormhole-foundation/sdk';
import { WalletData } from '../store/wallet';
import { type AvailableWallets } from '@aptos-labs/wallet-adapter-core';

export type WalletCompatibilityResult = {
isCompatible: boolean;
Expand All @@ -26,24 +25,24 @@ export const useWalletCompatibility = ({

if (isManualCCTPRoute) {
// Aptos CCTP requires modern (AIP-62 standard) wallets with support for signing move script transaction types
const compatibleWallets: AvailableWallets[] = [
// NOTE: This package is missing some of the wallet types, so we're using a string array instead
// import { type AvailableWallets } from '@aptos-labs/wallet-adapter-core';
const compatibleWallets: string[] = [
'Petra',
'Pontem Wallet',
'Nightly',
'Continue with Google',
'Continue with Apple',
];
if (
(sourceChain === 'Aptos' &&
!compatibleWallets.includes(
sendingWallet.name as AvailableWallets,
)) ||
!compatibleWallets.includes(sendingWallet.name)) ||
(destChain === 'Aptos' &&
!compatibleWallets.includes(receivingWallet.name as AvailableWallets))
!compatibleWallets.includes(receivingWallet.name))
) {
return {
isCompatible: false,
warning: `Please use ${compatibleWallets.join(
' or ',
)} with the Aptos CCTP route.`,
warning: 'Please use a compatible wallet for this route.',
};
}
}
Expand Down
Loading