0

Can someone help me?
I did create Next js project with Solana transactions by Phantom
I use @solana/wallet-adapter-react for connection and functional in client side. Transactions are created in server side and are absolutely valid.

The essence of the error is that after the project build, the transaction stops working.
( https://i.stack.imgur.com/Rd4D2.png ) - dev version of Next js project. After approval the transaction is successful
( https://i.stack.imgur.com/PK8mE.png ) - production version (after next build) with same transaction

Error: Phantom - RPC Error: Something went wrong. {code: -32603, message: 'Something went wrong.'} Type: WalletSendTransactionError
( https://i.stack.imgur.com/4gOFX.png )


Main parts of code:

The format in which the transaction is sent [ server ]:

transaction.serialize({ requireAllSignatures: false }).toString('base64')
[ *transaction* = new web3.Transaction() ]

The client accepts the transaction, formats it and send [ client ]:

import { useConnection, useWallet } from '@solana/wallet-adapter-react'

const transaction = web3.Transaction.from(Buffer.from(t, 'base64'))
await sendTransaction(transaction, connection)

This simple code version works the same:

const tr = new Transaction().add(
  SystemProgram.transfer({
    fromPubkey: new PublicKey('....'),
    toPubkey: publicKey,
    lamports: 10000,
  }),
);
await sendTransaction(tr, connection)

List of all dependencies — ( https://i.stack.imgur.com/PfPvw.png )

0 Answers0