0

I'm receiving the following error message when trying to send a transaction, using the Wallet Adapter in Nextjs 13, with a Solita generated SDK.

Backpack & Phantom:

WalletSendTransactionError: Expected signatures length to be equal to the number of required signatures

Solflare:

failed to send transaction: io error: failed to fill whole buffer

It seems the Solita generated SDK doesn't assemble the transaction properly in Nextjs production mode, but works when running in yarn dev.

The code:

        const ixAccs: CreateInstructionAccounts = {
            payer: publicKey,
            // userProfile: publicKey,
            pot: pot,
            mintAccount: newSoapKeypair.publicKey,
            metadataAccount: metadataAddress,
            metadataProgram: TOKEN_METADATA_PROGRAM_ID
        }

        const ixArgs: CreateInstructionArgs = {
            soapTitle: name,
            soapSymbol: "SOAP",
            soapUri: jsonUri.toString()
        }

        const ix = createCreateInstruction(
            ixAccs,
            ixArgs,
            PROGRAM_ID
        )

        const {
            context: { slot: minContextSlot },
            value: { blockhash, lastValidBlockHeight }
        } = await connection.getLatestBlockhashAndContext();

        const transaction = new Transaction({
            feePayer: publicKey,
            lastValidBlockHeight,
            blockhash: blockhash
        }).add(ix)

        // Need to sign with the new soaps keypair
        transaction.partialSign(newSoapKeypair)

        console.log("Serialized TX: ", transaction.serialize({ requireAllSignatures: false }).toString('base64'))

        const signature = await sendTransaction(transaction, connection, { minContextSlot }).catch(e => {
            console.log("Error in sending transaction: ", e)
            notifySoapDismissed()
        });

In yarn dev mode working

yarn dev soap create tx screenshot


Serialized TX:  AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCFh5qclF82iepP/dcm9wOhflllcZMU1dUJ98rsPtfBR4MW9NHc8YW1H6kW6ddbKfY48TWn6a83OgRnxIi2KQGAgAGCQirdyoXOlom1fA2mZe9esbUX00sqGIKGOQL2tR1040DZ7X4UvYJZQqKcVtidvtNK/jRADhS5rRza+yciS9FWTo7LgNbIDLaGLGbmcsO02B02+cPVrXx2GpzIv7/lZ/bEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC3BlsePRfEU4nVJ/awTDzVi4bHMaoP21SbbRvAP4KUYFnpGM/kzuGS8Pc97Lm+ZfCKFv7b0JF7G+T7dgm8evqA0DtkOgd3NHnOznZk171SSYSoa/kmetJegavl5DykoFBqfVFxksXFEhjMlMPUrxf1ja7gibof1E49vZigAAAAAG3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqTRNRdAO9EWU24W0CACDP/9HPx/SbL1gFNTWe9gibpD0AQYIAAUBAgcECAOaARgeyCgFHAd3AwAAAGZzZAQAAABTT0FQfwAAAGh0dHBzOi8vc2hkdy1kcml2ZS5nZW5lc3lzZ28ubmV0LzRUMTZUUU5ubmMxeDk2YXZVUXpRWjlxSE1vNTRzUzR0c3VFVVcyYnVtSHR1Lzd5cXZxM014NnVBOG1SdHhZZmZaUnE3dlQ0bWJNdjZYaWJiMkxKeFNtQTdCLmpzb24=
index.tsx:247 Signature:  3Np62vUhPhdqEnGKKkpBNnoKKdphUJZKzLKhZc8FvX5pizMamYeFCUYtWJhYH7sjNNYVM3HA44CPsrKkdZrEXeD1
index.tsx:250 Soap minted. TX:  3Np62vUhPhdqEnGKKkpBNnoKKdphUJZKzLKhZc8FvX5pizMamYeFCUYtWJhYH7sjNNYVM3HA44CPsrKkdZrEXeD1

In yarn start, Next Production mode:

enter image description here

The same issue can be found here, without resolution.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.