Skip to content

Commit 2d26d85

Browse files
feat: added deeplink provider that is used by phantom and solflare
1 parent e547df6 commit 2d26d85

File tree

11 files changed

+711
-585
lines changed

11 files changed

+711
-585
lines changed

packages/appkit/src/AppKit.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,15 @@ export class AppKit {
749749
customList.push(ConstantsUtil.PHANTOM_CUSTOM_WALLET);
750750
}
751751

752+
const addSolflare =
753+
adapters.some(adapter => adapter.getSupportedNamespace() === 'solana') &&
754+
extraConnectors?.some(connector => connector.type.toLowerCase() === 'solflare') &&
755+
!customList.some(wallet => wallet.id === ConstantsUtil.SOLFLARE_CUSTOM_WALLET.id);
756+
757+
if (addSolflare) {
758+
customList.push(ConstantsUtil.SOLFLARE_CUSTOM_WALLET);
759+
}
760+
752761
OptionsController.setCustomWallets(customList);
753762
}
754763

packages/appkit/src/utils/HelpersUtil.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ export const WcHelpersUtil = {
213213
return 'phantom';
214214
} else if (wallet.id === ConstantsUtil.COINBASE_CUSTOM_WALLET.id) {
215215
return 'coinbase';
216+
} else if (wallet.id === ConstantsUtil.SOLFLARE_CUSTOM_WALLET.id) {
217+
return 'solflare';
216218
} else {
217219
return 'walletconnect';
218220
}

packages/appkit/src/views/w3m-connecting-external-view/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export function ConnectingExternalView() {
4242
if (wallet) {
4343
if (
4444
wallet.id === ConstantsUtil.PHANTOM_CUSTOM_WALLET.id ||
45+
wallet.id === ConstantsUtil.SOLFLARE_CUSTOM_WALLET.id ||
4546
wallet.id === ConstantsUtil.COINBASE_CUSTOM_WALLET.id
4647
) {
4748
await connect({ wallet });

packages/common/src/types/wallet/connector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { AppKitSIWEClient } from '../siwe';
88
import type { Storage } from '../storage';
99
import type { WcWallet } from '../api/wallet-api';
1010

11-
export type ConnectorType = 'walletconnect' | 'coinbase' | 'phantom';
11+
export type ConnectorType = 'walletconnect' | 'coinbase' | 'phantom' | 'solflare';
1212

1313
export interface BaseNamespace {
1414
chains?: CaipNetworkId[];

packages/common/src/utils/ConstantsUtil.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ export const ConstantsUtil = {
4747
mobile_link: 'https://wallet.coinbase.com/wsegue'
4848
},
4949

50+
SOLFLARE_CUSTOM_WALLET: {
51+
id: '1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79',
52+
name: 'Solflare Wallet',
53+
image_id: '34c0e38d-66c4-470e-1aed-a6fabe2d1e00',
54+
mobile_link: 'solflare://'
55+
},
56+
5057
// Storage Keys
5158
STORAGE_KEYS: {
5259
WC_DEEPLINK: 'WALLETCONNECT_DEEPLINK_CHOICE', //dont change this one

0 commit comments

Comments
 (0)