@rango-dev/signer-solana v0.27.0
@rango-dev/signer-solana
Summary
Signer for Rango Solana Transactions
Currecntly all Rango Solana transactions are Versioned (and serialized), only Solana Wrapper is already using the legacy format. (which is used only for SOL <-> WSol routes)
Versioned Transaction Sign Flow Overview:
Get connection and recent blockhash
const connection = new Connection(SOLANA_RPC_URL, { commitment: 'confirmed', disableRetryOnRateLimit: false, }); const latestBlock = await connection.getLatestBlockhash('confirmed');
Prepare the transaction
const transaction = VersionedTransaction.deserialize( new Uint8Array(tx.serializedMessage) ); transaction.message.recentBlockhash = recentBlockhash;
Simulate the transaction
const { value } = await connection.simulateTransaction(transaction, { replaceRecentBlockhash: true, commitment: 'processed', });
Sign the transaction
const signedTransaction = await solanaProvider.signTransaction( solanaWeb3Transaction ); const serializedTransaction = Buffer.from(signedTransaction.serialize());
Send and confirm the transaction (similar to jupiter suggested code)
const { txId, txResponse } = await transactionSenderAndConfirmationWaiter({ connection, serializedTransaction, blockhashWithExpiryBlockHeight: { blockhash: latestBlock.blockhash, lastValidBlockHeight: latestBlock.lastValidBlockHeight, }, }); ```
3 days ago
4 days ago
17 days ago
18 days ago
18 days ago
25 days ago
25 days ago
3 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
9 months ago
9 months ago
9 months ago
7 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
6 months ago
6 months ago
6 months ago
9 months ago
9 months ago
7 months ago
6 months ago
9 months ago
7 months ago
7 months ago
7 months ago
10 months ago
10 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago