Add SOL transfer support to SolanaWallet #48

Closed
opened 2026-07-27 14:42:27 +02:00 by minimons · 0 comments
Owner

Extend SolanaWallet so it can build standard Solana System Program transactions for sending SOL to another wallet.

Reuse the existing SolanaWallet.signTransaction(...) and SolanaBlockChain.sendTransaction(...) methods.

Add methods such as:

SolanaUnsignedTransaction buildSolanaTransferTransaction(
        ΩSolanaWalletIdΩ recipient,
        ΩSolanaAmountΩ amount
);

SolanaUnsignedTransaction buildSolanaTransferAllTransaction(
        ΩSolanaWalletIdΩ recipient
);

The task includes:

  • Add SolanaBlockChain.getLatestBlockhash().
  • Add SolanaBlockChain.getFeeForMessage(...).
  • Build legacy SOL transfer transactions locally in Java.
  • Use the current wallet as fee payer and signer.
  • Convert the transfer amount correctly to lamports.
  • For transfer all, calculate the exact transaction fee and transfer balance - fee, leaving the wallet empty.
  • Fail clearly if the balance cannot cover the transaction fee.

Acceptance criteria

  • A transfer for a specified amount can be built, signed and submitted.
  • A transfer all transaction can be built without hardcoding the fee.
  • Insufficient-balance cases are rejected clearly.
  • Relevant transaction-building tests are included.
Extend `SolanaWallet` so it can build standard Solana System Program transactions for sending SOL to another wallet. Reuse the existing `SolanaWallet.signTransaction(...)` and `SolanaBlockChain.sendTransaction(...)` methods. Add methods such as: ```java SolanaUnsignedTransaction buildSolanaTransferTransaction( ΩSolanaWalletIdΩ recipient, ΩSolanaAmountΩ amount ); SolanaUnsignedTransaction buildSolanaTransferAllTransaction( ΩSolanaWalletIdΩ recipient ); ``` The task includes: * Add `SolanaBlockChain.getLatestBlockhash()`. * Add `SolanaBlockChain.getFeeForMessage(...)`. * Build legacy SOL transfer transactions locally in Java. * Use the current wallet as fee payer and signer. * Convert the transfer amount correctly to lamports. * For `transfer all`, calculate the exact transaction fee and transfer `balance - fee`, leaving the wallet empty. * Fail clearly if the balance cannot cover the transaction fee. ## Acceptance criteria * A transfer for a specified amount can be built, signed and submitted. * A `transfer all` transaction can be built without hardcoding the fee. * Insufficient-balance cases are rejected clearly. * Relevant transaction-building tests are included.
minimons added the enhancement label 2026-07-27 14:42:27 +02:00
minimons self-assigned this 2026-07-27 14:42:27 +02:00
minimons added this to the AssetAZ project 2026-07-27 14:42:27 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: r35157/com_r35157_nenjim-hubd-impl_ref#48