metaplex-foundation / metaplex

A directory of what the Metaplex Foundation works on!

Home Page:https://metaplex.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when signing with Phantom wallet: Caused By: Error: signature must be base58 encoded: [object Object]

yukosgiti opened this issue · comments

// inside jsx component
const connection = new Connection("https://api.devnet.solana.com/");
const metaplex = new Metaplex(connection, { cluster: "devnet" }).use(
  walletAdapterIdentity(wallet)
)
const handleClick = async (e: any) => {
    if (!metaplex || !wallet.publicKey) return;

    const { nft: collectionNft } = await metaplex.nfts().create({
      name: "Test,
      uri: "<pinata json url>",
      sellerFeeBasisPoints: 0,
      isCollection: true,
    });
    console.log({ collectionNft });
  };
);

When user signs with phantom walet I get the following error:

image

What's wierd is the transaction still happens on the chain

I was using an older version of solana wallet related libraries. When I updated them to be the latest it fixed all the problems

"@solana/wallet-adapter-base"
"@solana/wallet-adapter-react"
"@solana/wallet-adapter-react-ui"
"@solana/wallet-adapter-wallets"
"@solana/web3.js"
"@project-serum/anchor"