Skip to main content
15 votes
Accepted

Uncaught ReferenceError: Buffer is not defined. Using Phantom Wallet, Solana and React to make a transaction

This is happening because the default bundler that comes with create react app(webpack 5) does not polyfill Buffer. The easiest way to fix this is including this code in your app: import * as buffer ...
acheron's user avatar
  • 2,699
7 votes

Get NFT transaction history

Alongside https://www.npmjs.com/package/@metaplex-foundation/js in retrieving the given NFT's information, you need to: Obtain the signatures for the account first. (Signatures are basically the Tx ...
Nicholas's user avatar
  • 481
7 votes
Accepted

Phantom wallet error - Transaction expired

This error most commonly results from a network mismatch between the wallet and the dapp. For instance, if you are developing a dapp on devnet, Phantom will also need to be set to devnet. If it is set ...
Brian Friel's user avatar
7 votes
Accepted

How to use the wallet standard?

Hi Sohrab :) If you're using @solana/wallet-adapter-react, there isn't really anything explicit you need to do to support the Wallet Standard. It's built in now, along with support for Mobile Wallet ...
Jordan's user avatar
  • 643
5 votes

How can I create a transaction that creates an NFT when signed by the user using Metaplex?

Don’t use the keypair identity in the frontend. Used the wallet adapter identity instead https://github.com/metaplex-foundation/js#walletadapteridentity import { walletAdapterIdentity } from "@...
Mark Sackerberg's user avatar
5 votes
Accepted

Transaction is not getting signed while using glow wallet from solana-wallet-adapters

The signTransaction API does not, and never did guarantee that the transaction will be signed in-place. You must use its return value. const signedTransaction = signTransaction(transaction); const ...
steveluscher's user avatar
  • 2,455
4 votes

Solana Package Breaking React App UX

Seems like a missing transient dependency. Consider installing it manually: with npm: npm i @ledgerhq/devices with yarn: yarn add @ledgerhq/devices If this is a new react app, will advice you using ...
C.OG's user avatar
  • 2,837
4 votes
Accepted

Wallet Adapter - WalletNotSelectedError while trying to connect wallet to dApp

connect() name could be misleading. This function connects to an adapter that the user has already chosen and authenticated with. WalletProvider only declares the supported adapters. Before you can ...
sohrab's user avatar
  • 1,781
4 votes

React Native build error when installing @solana/wallet-adapter "Module parse failed"

Your build problems stem from the fact that the version of React Native you're using runs code in a JavaScript environment that doesn't support BigInt, and BigInt is required by versions of @solana/...
steveluscher's user avatar
  • 2,455
4 votes

React Native build error when installing @solana/wallet-adapter "Module parse failed"

Two problems here: Your compiler looks like it's using a transform that turns 2n ** 64n into Math.pow(2n, 64n). This is actually illegal because Math.pow() does not support BigInt – only number. An ...
steveluscher's user avatar
  • 2,455
4 votes

How to bring up the wallet multi adapter select screen manually in a react app

import { useWalletModal } from '@solana/wallet-adapter-react-ui'; This gives you access to: const { setVisible } = useWalletModal(); … then you can call setVisible(true) to show the menu.
daoplays's user avatar
  • 587
3 votes
Accepted

Disconnect and Connect hook for WalletConnectButton

Since you're using React the easiest way to do this would be with a useEffect hook. import { useWallet } from '@solana/wallet-adapter-react'; import { useEffect, useState } from 'react'; export ...
Callum M's user avatar
  • 3,190
3 votes
Accepted

How to send a short message / memo to a specific address

You can add messages to transactions using the memo program. Here's an example of sending "Data to send in transaction" in Javascript: import { Connection, Keypair, SystemProgram, ...
Jacob Creech's user avatar
  • 3,874
3 votes

Generate keypair based on string longer than 32 bytes

Keypairs should only ever be created with bytes derived from cryptographically secure random sampling. For example, if you dig deep enough into the dependencies that anchor-py uses, you'll see it ...
HelmetFace's user avatar
  • 1,757
3 votes

Uncaught ReferenceError: Buffer is not defined. Using Phantom Wallet, Solana and React to make a transaction

Thanks for trying to help me. I managed to get my code working finally. I've to do a couple of things I want to share: FIRST: Make sure you've all these dev dependencies installed "...
Mario Enrique Yahuarcani Salin's user avatar
3 votes
Accepted

mpl-token-metadata is breaks The React app

There seems to be something wrong with the application you are using. I just created a sample application that successfully imports createMetadataAccountV3 from @metaplex-foundation/mpl-token-metadata....
beeman's user avatar
  • 958
3 votes

Tx sign: WalletSendTransactionError: Unexpected error

Is systemProgram: PROGRAM_ID, the system program ID - 11111111111111111111111111111111? import { SystemProgram } from "@solana/web3.js"; const instructone: TransactionInstruction = await ...
Jimii's user avatar
  • 3,770
2 votes

Get NFT transaction history

You can try using Helius's "Parse Transactions(s)" API that returns parsed transactions. You can include up to 100 transaction signatures in a single request. And there's a free tier you can ...
john's user avatar
  • 7,487
2 votes

How to immediately get NFT metadata after mint using candy machine v2?

You would have to wait until the transaction has been finalized e.g. with connection.confirmTransaction before trying to read the metadata from chain.
Mark Sackerberg's user avatar
2 votes

Phantom wallet extension not detected using @solana/wallet-adapter-react

so i managed to figure out a work around with the help of @moraispgsi from https://github.com/solana-labs/wallet-adapter/issues/412 seems like there's a need to specify the exact folder to import from ...
naynim's user avatar
  • 41
2 votes
Accepted

Generate keypair based on string longer than 32 bytes

I think the other answer is inaccurate. I won't downvote it though as it's a good attempt to answer the question. What you're looking for is a key derivation function. PBKDF2 or scrypt are well known ...
mikemaccana's user avatar
  • 2,140
2 votes
Accepted

Can I use @solana/wallet-adapter with react JS?

This is a webpack issue. You are using the old versions of the packages which aren't compatible with Ledger. Use this directory as a starter for your React app: https://github.com/solana-labs/wallet-...
0xShuk's user avatar
  • 1,951
2 votes

Solflare web wallet

Problem is solved with the new Mobile Wallet Adapter : https://github.com/solana-labs/wallet-adapter/issues/604 It connects directly to the wallet app without asking to connect either to web wallet or ...
Flo's user avatar
  • 53
2 votes
Accepted

Conflicting package versions when installing @solana packages

I'm going to add my comment as the answer to this: It looks like the solution to my problem is using npm/yarn aliases with a command such as yarn add @solana/spl-token-next@npm:@solana/spl-token. This ...
pepeIKO's user avatar
  • 396
2 votes
Accepted

Keeping your personal rpc endpoint address private in a react front end hosted by Netlify

You can never make an endpoint private in frontends when people are using it(it will log on the networks tab of developer tools). You should instead contact your RPC provider and only allow requests ...
acheron's user avatar
  • 2,699
2 votes

I need help with changing the contents of a page once a wallet has been connected

If you are using Solana Wallet Adapter. You can use useWallet() which returns null when you are not connected. const HomePage = () => { const wallet = useWallet(); ... if (!wallet) ...
vicyyn's user avatar
  • 4,095
2 votes

How to flag inefficient funds Spl-tokens candy machine v3 metaplex js

There are a few ways to do this. Generally, you'll need to find the associated token account (the user's account that hold's the token, which is derived from the user's wallet address and the mint ...
AMilz's user avatar
  • 1,566
2 votes

Display Updated Wallet Balance After Transaction Confirmed

figured out a solution with onAccountChange https://solana-labs.github.io/solana-web3.js/classes/Connection.html#onAccountChange here's my solution https://github.com/Unboxed-Software/solana-send-sol-...
bwnnwtt's user avatar
  • 21
2 votes

Is phantom wallet provides hooks

It seems like you are looking for Solana Wallet Adapter. You can easily add wallet connect feature using the Solana wallet adapter and it includes all popular wallets like Phantom, Solflare, Backpack, ...
Syed Aabis Akhtar's user avatar
2 votes
Accepted

Having trouble executing my custom program transaction on devnet/testnet

0x65 means thats there is no fallback function. This means thats your function identifier is wrong. So its searching for a fallback, but there is none defined in the program. I think in your case it ...
Jonas H.'s user avatar
  • 5,787

Only top scored, non community-wiki answers of a minimum length are eligible