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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Extend
SolanaWalletso it can build standard Solana System Program transactions for sending SOL to another wallet.Reuse the existing
SolanaWallet.signTransaction(...)andSolanaBlockChain.sendTransaction(...)methods.Add methods such as:
The task includes:
SolanaBlockChain.getLatestBlockhash().SolanaBlockChain.getFeeForMessage(...).transfer all, calculate the exact transaction fee and transferbalance - fee, leaving the wallet empty.Acceptance criteria
transfer alltransaction can be built without hardcoding the fee.