metaplex-foundation / js-examples

Examples and Starter Kits using the new JS SDK
MIT License
79 stars 92 forks source link

is there any features with interaction with Panthom wallet ? #18

Closed bytesmix closed 1 year ago

bytesmix commented 2 years ago

I need to mint using panthom wallet not keypair directly. How can i handle this? please let me know.

nurav97 commented 1 year ago

https://solana-labs.github.io/wallet-adapter/

devfather commented 1 year ago

This is the base line requirements to use metaplex with the wallet adapter instead of the keypair. The if statement at the bottom is so that metaplex can establish a connection even if the wallet hasn't yet connected. Without that, it will throw an error when there isn't a connected wallet. This is NOT an end - end solution. It's merely demonstrating the minimum required imports. You will likely need to import other things in addition what I have listed below.

import { Connection } from "@solana/web3.js";
import { Metaplex, walletAdapterIdentity, guestIdentity } from "@metaplex-foundation/js";
import { useWallet } from "solana-wallets-vue";

const wallet = useWallet();
const connection = new Connection("endpoint url here");
const metaplex = Metaplex.make(connection).use(
  wallet?.wallet?.value?.adapter ? walletAdapterIdentity(wallet.wallet.value.adapter) : guestIdentity()
);
lorisleiva commented 1 year ago

Hi there 👋 There's an example available that illustrates how to use wallet adapters with the JS SDK.

https://github.com/metaplex-foundation/js-examples/tree/main/connect-wallet