-
Describe your issue or question:
-
Which platform or framework are you using (e.g., React, Vue, Android, iOS, Unity, Node, etc.)? Node.js
-
Which Web3Auth/ Embedded Wallet SDK (SDK Name and version) are you using? @web3auth/node-sdk ^5.0.0
-
What is not working as expected? signer.signTransactions()
-
-
Code snippets: Include the portion of your code that is causing problems. PrivateBin link to the script: index.js
-
Exact error and logs: Copy any error messages or console logs. See line 67 in the script from the PrivateBin link above.
-
Package details: Note versions for Web3Auth/MetaMask Embedded Wallets and any related packages. @web3auth/base ^9.7.0, @solana/web3.js ^1.98.4 and @solana/spl-token ^0.4.14
Hi loic — thanks for the clear report, this helps a lot. I see you’re reporting a SolanaError when calling signer.signTransactions() while trying to create an SPL token account. From your message I pulled these details:
- SDK Details: MetaMask Embedded Wallets (Web3Auth)
- Web3Auth / Embedded SDK version: @web3auth/node-sdk ^5.0.0 (plus @web3auth/base ^9.7.0)
- Platform / Framework: Node.js
- Solana libs: @solana/web3.js ^1.98.4, @solana/spl-token ^0.4.14
- Code link you provided: privatebin link to index.js (you mentioned error at line 67)
To help the support team reproduce and resolve this quickly, please provide only the missing / relevant items below (you may already have some in the PrivateBin file — paste them here if easier):
- Exact error text / stack trace you see in the Node console (copy/paste). You referenced line 67, but I can’t open the PrivateBin — I need the error message here.
- The initialization & login snippet you use for Web3Auth / MetaMask Embedded (how you instantiate the wallet object and any login/connect call).
- The snippet where you build the transaction(s) and call signer.signTransactions() (or signTransaction/signAllTransactions) — include how many transactions you pass and their types (Transaction object vs serialized bytes).
- Which cluster are you targeting (devnet / testnet / mainnet) and the RPC endpoint.
- Any Node console logs around the call, and whether you’re setting feePayer and recentBlockhash on the Transaction(s).
Why I ask / likely causes and quick checks you can try now
- Common causes for SolanaError when signing transactions:
- The Transaction has no recentBlockhash or feePayer set — the wallet will often require these before signing. Fix: set tx.feePayer and tx.recentBlockhash = (await connection.getLatestBlockhash()).blockhash.
- Passing the wrong type to the signer (e.g., serialized Uint8Array instead of Transaction objects, or mixing signed/unsigned txs). Ensure you pass Transaction instances (or the exact shape your signer expects).
- Using the wrong signer method for your wallet (some wallets expose signTransaction or signAllTransactions rather than signTransactions). Check the wallet API you have from Web3Auth / Embedded SDK.
- The payer / signer publicKey is not set or the wallet is not fully authenticated/connected.
Suggested minimal example pattern (Node + @solana/web3.js) — ensure your code follows these steps:
- build Transaction: let tx = new Transaction().add(…instructions…);
- set fee payer and recentBlockhash: tx.feePayer = payerPublicKey; tx.recentBlockhash = (await connection.getLatestBlockhash()).blockhash;
- sign via wallet API (method name depends on implementation):
- if your signer supports signTransaction: signed = await signer.signTransaction(tx);
- if signAllTransactions / signTransactions accepts an array: signedArray = await signer.signAllTransactions([tx]);
- send: await connection.sendRawTransaction(signed.serialize());
Helpful docs
- MetaMask docs: https://docs.metamask.io/
- Web3Auth docs (Node / Solana examples): Introduction | Documentation | Web3Auth
- Solana Transaction basics: https://docs.solana.com/developing/programming-model/transactions
If you can paste the three short things requested above (exact console error, the init/login code, and the transaction + signer call), I’ll read them and give a targeted fix (or a patch you can copy/paste). If you prefer, paste the relevant section of your PrivateBin file directly here.
Note: This response was generated by an AI bot and may require further verification. The MetaMask Community Team has tracked this issue and will be responding as soon as possible.
Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. MetaMask Developer Office Hours
New PrivateBin link to the script: index.js, because the old one is about to expire.
Again a new PrivateBin link to the script: index.js, because the old one is about to expire.
Also the first one already expired.
Hey @loic
I think this is particularly an SNS issue. From our end you get the Solana Wallet housing your private key after which all the RPC and transaction calls will be done from the provider. You can have a look at this app where I have tried to register a new SNS Domain: web3auth-examples/other/sns-example/src/components/sns.tsx at main · Web3Auth/web3auth-examples · GitHub
I assume by SNS, we’re talking about the Solana Name Service.
But why would we need this to sign a transaction, isn’t there a better solution to solve this issue?
As it would be an inefficient solution to register an SNS for every single transaction.
Again a new PrivateBin link to the script: index.js, because the old one is about to expire.
Also the first two already expired.
Sorry for mistaking minting an SPL token as an SNS particular operation, since I thought you might be facing issues there.
Have you checked our other Sign Transaction examples?
This particularly is using our hooks, the SNS example I shared also did something similar only. The problem you are facing here is not related to Web3Auth. You can directly use our hooks to get the signer and public key
I think there’s some confusion though, since we don’t use React. We used Embedded Wallets SDK for Node.js.
We also get following errors for this: first error and solution suggestion of the first error
@yashovardhan Any updates yet?