Skip to content

Commit

Permalink
Merge pull request #57 from punky-lab/wyy-12
Browse files Browse the repository at this point in the history
 fix - wallet bug
  • Loading branch information
FrozenArcher authored Dec 16, 2024
2 parents 7890576 + abfdd94 commit d1f9aac
Show file tree
Hide file tree
Showing 4 changed files with 792 additions and 4,571 deletions.
37 changes: 4 additions & 33 deletions components/wallet/jupiter/jupiter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,18 @@ import {
UnifiedWalletProvider,
WalletAdapterNetwork,
} from "@jup-ag/wallet-adapter";
import {
SolflareWalletAdapter,
TrustWalletAdapter,
WalletConnectWalletAdapter,
NightlyWalletAdapter,
} from "@solana/wallet-adapter-wallets";

import { useMemo } from "react";
import {
metadata,
WalletAdapterWithMutableSupportedTransactionVersions,
} from "./something";
import { NightlyWalletAdapter } from "@solana/wallet-adapter-nightly";
import { SolflareWalletAdapter } from "@solana/wallet-adapter-solflare";


export const JupiterWalletConnect = () => {
const wallets: Adapter[] = useMemo(() => {
const walletConnectWalletAdapter: WalletAdapterWithMutableSupportedTransactionVersions<BaseSignerWalletAdapter> | null =
(() => {
const adapter: WalletAdapterWithMutableSupportedTransactionVersions<BaseSignerWalletAdapter> =
new WalletConnectWalletAdapter({
network: WalletAdapterNetwork.Mainnet,
options: {
relayUrl: "wss://relay.walletconnect.com",
projectId: metadata.walletConnectProjectId,
metadata: {
name: metadata.name,
description: metadata.description,
url: metadata.url,
icons: metadata.iconUrls,
},
},
});

// While sometimes supported, it mostly isn't. Should this be dynamic in the wallet-adapter instead?
adapter.supportedTransactionVersions = new Set(["legacy"]);
return adapter;
})();

return [
new NightlyWalletAdapter(),
new SolflareWalletAdapter(),
new TrustWalletAdapter(),
walletConnectWalletAdapter,
].filter((item) => item && item.name && item.icon) as Adapter[];
}, []);

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
"@react-spring/web": "^9.7.5",
"@solana/spl-token": "^0.4.9",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/wallet-adapter-nightly": "^0.1.16",
"@solana/wallet-adapter-react": "^0.15.35",
"@solana/wallet-adapter-react-ui": "^0.9.35",
"@solana/wallet-adapter-wallets": "^0.19.32",
"@solana/wallet-adapter-solflare": "^0.6.28",
"@solana/web3.js": "^1.95.8",
"@telegram-apps/react-router-integration": "^1.0.0",
"@telegram-apps/sdk-react": "^1.1.3",
Expand Down
2 changes: 1 addition & 1 deletion solana/game/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function useGameProgram(): { program: Program | undefined } {

const anchorProvider = new AnchorProvider(
connection,
wallet,
wallet as any,
AnchorProvider.defaultOptions()
);

Expand Down
Loading

0 comments on commit d1f9aac

Please sign in to comment.