49: Remove low-level SOL builders from wallet API
This commit is contained in:
@@ -88,44 +88,6 @@ public interface SolanaWallet {
|
|||||||
@NotNull ΩSolanaWalletIdΩ recipient
|
@NotNull ΩSolanaWalletIdΩ recipient
|
||||||
) throws IOException, InterruptedException;
|
) throws IOException, InterruptedException;
|
||||||
|
|
||||||
/**
|
|
||||||
* Builds an unsigned transaction that transfers a specific amount of SOL.
|
|
||||||
*
|
|
||||||
* <p>The current wallet is used as fee payer and required signer. This
|
|
||||||
* method does not sign or submit the transaction.</p>
|
|
||||||
*
|
|
||||||
* @param recipient the wallet that should receive the SOL
|
|
||||||
* @param amount the amount of SOL to transfer
|
|
||||||
* @return the unsigned serialized transfer transaction
|
|
||||||
* @throws IllegalArgumentException if the recipient or amount is invalid
|
|
||||||
* @throws IOException if a recent blockhash cannot be fetched
|
|
||||||
* @throws InterruptedException if the calling thread is interrupted
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
SolanaUnsignedTransaction buildSolanaTransferTransaction(
|
|
||||||
@NotNull ΩSolanaWalletIdΩ recipient,
|
|
||||||
@NotNull ΩSolanaAmountΩ amount
|
|
||||||
) throws IOException, InterruptedException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Builds an unsigned transaction that transfers the wallet's complete
|
|
||||||
* native SOL balance after paying the exact transaction fee.
|
|
||||||
*
|
|
||||||
* <p>The current wallet is used as fee payer and required signer. This
|
|
||||||
* method does not sign or submit the transaction.</p>
|
|
||||||
*
|
|
||||||
* @param recipient the wallet that should receive the SOL
|
|
||||||
* @return the unsigned serialized transfer transaction
|
|
||||||
* @throws IllegalArgumentException if the recipient is invalid
|
|
||||||
* @throws IllegalStateException if the balance cannot cover a transfer
|
|
||||||
* @throws IOException if the balance, blockhash or fee cannot be fetched
|
|
||||||
* @throws InterruptedException if the calling thread is interrupted
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
SolanaUnsignedTransaction buildSolanaTransferAllTransaction(
|
|
||||||
@NotNull ΩSolanaWalletIdΩ recipient
|
|
||||||
) throws IOException, InterruptedException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signs an unsigned Solana transaction.
|
* Signs an unsigned Solana transaction.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -86,28 +86,6 @@ public class SolanaWalletImpl implements SolanaWallet {
|
|||||||
return solanaBlockChain.sendTransaction(signedTransaction);
|
return solanaBlockChain.sendTransaction(signedTransaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public @NotNull SolanaUnsignedTransaction buildSolanaTransferTransaction(
|
|
||||||
@NotNull ΩSolanaWalletIdΩ recipient,
|
|
||||||
@NotNull ΩSolanaAmountΩ amount
|
|
||||||
) throws IOException, InterruptedException {
|
|
||||||
return solanaBlockChain.buildSolanaTransferTransaction(
|
|
||||||
address,
|
|
||||||
recipient,
|
|
||||||
amount
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public @NotNull SolanaUnsignedTransaction buildSolanaTransferAllTransaction(
|
|
||||||
@NotNull ΩSolanaWalletIdΩ recipient
|
|
||||||
) throws IOException, InterruptedException {
|
|
||||||
return solanaBlockChain.buildSolanaTransferAllTransaction(
|
|
||||||
address,
|
|
||||||
recipient
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull SolanaSignedTransaction signTransaction(
|
public @NotNull SolanaSignedTransaction signTransaction(
|
||||||
@NotNull SolanaUnsignedTransaction transaction
|
@NotNull SolanaUnsignedTransaction transaction
|
||||||
|
|||||||
Reference in New Issue
Block a user