Skip to content

Commit

Permalink
integrate wander
Browse files Browse the repository at this point in the history
  • Loading branch information
NickJ202 committed Feb 13, 2025
1 parent 73b6637 commit 9324c51
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Binary file added src/assets/wander.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/helpers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import user from 'assets/user.svg';
import volumeActive from 'assets/volume-active.svg';
import volumeInactive from 'assets/volume-inactive.svg';
import wallet from 'assets/wallet.svg';
import wander from 'assets/wander.png';
import wrappedAr from 'assets/wrapped-ar.svg';
import x from 'assets/x.svg';

Expand Down Expand Up @@ -113,6 +114,7 @@ export const ASSETS = {
arconnect: arconnect,
arweaveApp: arweaveApp,
othent: othent,
wander: wander,
},
x: x,
};
Expand Down Expand Up @@ -260,7 +262,7 @@ export const CONTENT_TYPES = {
audio: 'audio/mpeg',
};

export const AR_WALLETS = [{ type: WalletEnum.arConnect, logo: ASSETS.wallets.arconnect }];
export const AR_WALLETS = [{ type: WalletEnum.wander, logo: ASSETS.wallets.wander }];

export const WALLET_PERMISSIONS = ['ACCESS_ADDRESS', 'ACCESS_PUBLIC_KEY', 'SIGN_TRANSACTION', 'DISPATCH', 'SIGNATURE'];

Expand Down
1 change: 1 addition & 0 deletions src/helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export enum WalletEnum {
arConnect = 'arConnect',
arweaveApp = 'arweave.app',
othent = 'othent',
wander = 'wander',
}

export type TagType = { name: string; value: string };
Expand Down
10 changes: 5 additions & 5 deletions src/providers/ArweaveProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,17 +287,17 @@ export function ArweaveProvider(props: ArweaveProviderProps) {
}
}

async function handleConnect(walletType: WalletEnum.arConnect | WalletEnum.othent) {
async function handleConnect(walletType: WalletEnum.wander | WalletEnum.othent) {
let walletObj: any = null;
switch (walletType) {
case WalletEnum.arConnect:
case WalletEnum.wander:
handleArConnect();
break;
case WalletEnum.othent:
handleOthent();
break;
default:
if (window.arweaveWallet || walletType === WalletEnum.arConnect) {
if (window.arweaveWallet || walletType === WalletEnum.wander) {
handleArConnect();
break;
}
Expand All @@ -313,9 +313,9 @@ export function ArweaveProvider(props: ArweaveProviderProps) {
await global.window?.arweaveWallet?.connect(WALLET_PERMISSIONS as any);
setWalletAddress(await global.window.arweaveWallet.getActiveAddress());
setWallet(window.arweaveWallet);
setWalletType(WalletEnum.arConnect);
setWalletType(WalletEnum.wander);
setWalletModalVisible(false);
localStorage.setItem('walletType', WalletEnum.arConnect);
localStorage.setItem('walletType', WalletEnum.wander);
} catch (e: any) {
console.error(e);
}
Expand Down

0 comments on commit 9324c51

Please sign in to comment.