10
votes
How to use versioned transaction or address lookup table through solana web3?
Each address in a transaction instruction takes 32 bytes but when addresses are present in an on-chain LUT(short for Address Lookup Table), they can be referenced using a 1-byte index. A single LUT ...
7
votes
Accepted
How to properly "wait" for a transaction to confirm?
Transaction confirmation is a hard problem, which is why the current web3.js code can be very confusing!
The way it currently works is:
use signatureSubscribe in one promise, wait to get a ...
5
votes
Accepted
Can you combine transactions into one on the front end?
Something similar to this should suit your purposes:
let tx1 = await program.methods
.tallyVotes()
.accounts({
config: configPDA,
campaign: campaignPDA,
})
.signers([])
.instruction()...
5
votes
Solana RPC versioned transaction
Since VersionedTransaction are a fairly new, the docs and content for them is still in the works of being created. But, here is a snippet from an upcoming doc that explains how to create a ...
5
votes
Accepted
How to attach a memo note to a transaction with Phanton or cli wallet?
Phantom doesn't currently have that option.
With the CLI you can use the --with-memo <MEMO> flag.
solana transfer --with-memo <MEMO> <RECIPIENT_ADDRESS> <AMOUNT>
5
votes
Accepted
Blockhash not found when sending transaction
Most likely, the user is taking too long to sign the transaction, so by the time you send the transaction, the blockhash has expired. There's a few options to make this better:
The easiest is to get a ...
4
votes
How to increase the maximum encoded size of a VersionedTransaction?
The IPv6 MTU size limitation is 1280 bytes, which after some headers for Solana transactions you're left with 1232 bytes to work with. In the future this cap may be raised, but you are limited today.
...
4
votes
How to increase the maximum encoded size of a VersionedTransaction?
You can't increase the max size of a transaction, but with versioned transactions, you can reduce how much space each address takes up by using account lookup tables.
https://solanacookbook.com/guides/...
4
votes
Accepted
How to set Compute Limit and Compute Unit Price using Python
The idea is that the compute limit and compute limit price are instructions. And from the Jupiter API we already get a transactions object. Thus we have to add these priority fee instructions to the ...
3
votes
Accepted
Where are the addresses of the sender and receiver in TX info?
A transaction object can have multiple instructions of different types, such as createAccount, transfer etc. Since you're looking for a sender and receiver, I'd assume you need answer for transfer. ...
3
votes
Extract specific information from a transaction
In transaction.message you can find accountKeys those are the accounts for the postBalance and preBalance in order. This means the first preBalance and postBalance are for the first account in ...
3
votes
Accepted
can i send identical transaction without api ME
Yes, every ME transaction needs to get signed by NTYeYJ1wr4bpM5xo6zx5En44SvJFAd35zTxxNoERYqd as you can see on solscan. That means that you need to retrieve a partially signed transaction from ME via ...
3
votes
Accepted
Can someone explain why Anchor's ".signers([ ])" not does work with "sendTransaction" from useWallet()?
The sendTransaction method attempts to do -- too much. It should be used for simple/basic examples.
sendTransaction will sign and send the transaction, irrespective if it's being signed.
On line 4495:
...
3
votes
What is the best practice to sign and send multiple transaction at once in solana with one popup of phantom wallet?
In Solana, a Transaction can contain multiple instructions.
Here is an example of signing 2 instructions, 1 for adding compute budget, and another calling an Anchor program in same transaction.
import ...
3
votes
Check whether a user has made a payment or not
You can make a payment PDA and check whether it exists and has the data you want on it.
For example you could make a PDA with the seeds ["payment", walletID] and just 'init' the account. ...
3
votes
invalid value: continue signal on byte-three, expected a terminal signal on or before byte-three when sending a transaction
If anywone else has this issue i was using transaction.serializeMessage() instead of transaction.serialize()
3
votes
Accepted
sendAndConfirm transaction signers
This is because you're using baseaccount to pay state rent inside createInitializeMintInstruction.
3
votes
How would I write a transaction that would let me swap on raydium?
You can use use raydium SDK - https://github.com/raydium-io/raydium-sdk/blob/master/src/ammV3/ammV3.ts#L758
If you look for a optimized trading route, you can also use Jupiter SDK - https://station....
3
votes
Accepted
How to ensure that a transaction is successful?
All I had to do was check for the return value of the confirmTransaction
const result = await connection.confirmTransaction(...);
if (result.value.err) { /* log err due to failed tx */}
Thanks Josip!
...
3
votes
Can I batch sends in a Solana transaction?
in one signature and transaction, is it possible?
Yes, all of that is possible. But the question is not ideally suited to describe what is happening on the blockchain.
In Solana, transactions are one ...
2
votes
Send token x automatically to another address after receiving it
Assuming that by "listener" you mean something on-chain, somehow built into the functioning of Solana so that it takes effect automatically, then the answer is no, you cannot do that.
The ...
2
votes
Accepted
How do I add a note / memo to my Solana transactions using web3.js?
Answering my question to help others - there are to be two common ways to add comments to transactions:
The memo program
The memo app is a popular SPL app at the address
...
2
votes
Solana RPC versioned transaction
As the code states, a VersionedMessageis either a Message or a MessageV0, so you can create either of those types and use it as a VersionedMessage when creating your VersionedTransaction.
2
votes
What is the best way to handle multiple transactions having transaction size exceed 1232 bytes
Currently in case 1 your transactions will both be sent and will attempt to be executed whether either fails, effectively running them in parallel. The usual way to handle dependent transactions is to ...
2
votes
How to handle multiple transaction when transaction instruction is too long
Send and confirm the transactions in order. If there is an error sending one of the transactions, an exception will be thrown.
try {
for (const tx of txList) {
const txSig = await connection....
2
votes
How do I transfer the SOL on my token account?
The process is clunky, but to get the additional SOL out of a token account, you need to move the USDC to another account, close the account to retrieve everything, recreate the account, then move the ...
2
votes
Accepted
Send transaction at a specified future slot
Without an external service, this is not possible in most cases. You have a few options:
send your transaction a few slots before the one you want. This requires listening to slot updates on the ...
2
votes
skip_confirmation returning TXID
No. If you send a transaction with skip_confirmation as False and the transaction is not Processed, Confirmed, or Finalized (Depending on your setup) it will raise an error. If you don't want this to ...
2
votes
execute swap instruction using VersionedTransaction
Try increasing the compute limit for the transaction.
Solana cookbook reference: https://solanacookbook.com/references/basic-transactions.html#how-to-change-compute-budget-fee-priority-for-a-...
2
votes
Getting an error when attempting to send transactions to the TPU from a Rust client
Your client is trying to send to the old TPU port, which used to accept UDP. Now you must configure your client to use QUIC.
That code has changed a lot recently, so the easiest thing might be to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
send-transaction × 124transactions × 55
web3.js × 31
solana-program × 17
transaction × 17
sendtransactionerror × 11
spl-token × 10
wallet × 8
versionedtransactions × 8
anchor × 7
transfer × 7
python × 6
phantom × 6
solana-wallet-adapter × 6
rpc × 5
jsonrpc-api × 5
transaction-instructions × 5
swap × 5
signature × 4
raydium × 4
account × 3
instructions × 3
error × 3
sol × 3
api × 3