Package foundation.omni.txsigner
Class OmniKeychainSendingService
java.lang.Object
foundation.omni.txsigner.OmniKeychainSendingService
- All Implemented Interfaces:
OmniSendingService
A service to sign and send Omni Transactions (similar to functionality in Omni Core). Uses a local HD Keychain
(via
OmniKeychainSigningService
) and a local or remote JSON-RPC server OmniClient
to provide
this service.-
Constructor Summary
ConstructorsConstructorDescriptionOmniKeychainSendingService
(OmniClient client, OmniKeychainSigningService signingService) -
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture
<org.bitcoinj.base.Sha256Hash> bitcoinSend
(org.bitcoinj.base.Address toAddress, org.bitcoinj.base.Coin amount) createBitcoinSigningRequest
(org.bitcoinj.base.Address fromAddress, List<? super TransactionInputData> inputUtxos, List<TransactionOutputData> outputs, org.bitcoinj.base.Address changeAddress) getInputsFor
(org.bitcoinj.base.Address fromAddress) Fetch inputs for an addressCompletableFuture
<org.bitcoinj.base.Sha256Hash> omniSend
(UnsignedTxSimpleSend simpleSend) Sign and Send an Omni Simple Send transactionCompletableFuture
<org.bitcoinj.base.Sha256Hash> omniSend
(org.bitcoinj.base.Address fromAddress, org.bitcoinj.base.Address toAddress, CurrencyID currency, OmniValue amount) Find inputs, Sign and Send an Omni Simple Send transactionCompletableFuture
<org.bitcoinj.base.Sha256Hash> sendRawTransactionAsync
(org.bitcoinj.core.Transaction tx) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface foundation.omni.txsigner.OmniSendingService
assembleSimpleSend
-
Constructor Details
-
OmniKeychainSendingService
-
-
Method Details
-
bitcoinSend
public CompletableFuture<org.bitcoinj.base.Sha256Hash> bitcoinSend(org.bitcoinj.base.Address toAddress, org.bitcoinj.base.Coin amount) throws IOException - Throws:
IOException
-
createBitcoinSigningRequest
public SigningRequest createBitcoinSigningRequest(org.bitcoinj.base.Address fromAddress, List<? super TransactionInputData> inputUtxos, List<TransactionOutputData> outputs, org.bitcoinj.base.Address changeAddress) -
omniSend
public CompletableFuture<org.bitcoinj.base.Sha256Hash> omniSend(org.bitcoinj.base.Address fromAddress, org.bitcoinj.base.Address toAddress, CurrencyID currency, OmniValue amount) throws IOException Find inputs, Sign and Send an Omni Simple Send transactionThis method is compatible with the Omni Core
omni_send
JSON-RPC method and if made available from a JSON-RPC server should work equivalently. (The last two, optional arguments are not currently implemented.)- Specified by:
omniSend
in interfaceOmniSendingService
- Parameters:
fromAddress
- Omni address sending fundstoAddress
- Omni address receiving fundscurrency
- Currency typeamount
- amount- Returns:
- A future for the transaction hash
- Throws:
IOException
- A failure occurred fetching inputs or broadcasting the transaction
-
omniSend
public CompletableFuture<org.bitcoinj.base.Sha256Hash> omniSend(UnsignedTxSimpleSend simpleSend) throws IOException Sign and Send an Omni Simple Send transaction- Specified by:
omniSend
in interfaceOmniSendingService
- Parameters:
simpleSend
- An object holding all the parameters (including UTXO inputs) for a simple send transaction- Returns:
- A future for the transaction hash
- Throws:
IOException
- A failure occurred fetching broadcasting the transaction
-
getInputsFor
public List<TransactionInputData> getInputsFor(org.bitcoinj.base.Address fromAddress) throws IOException Fetch inputs for an address- Specified by:
getInputsFor
in interfaceOmniSendingService
- Parameters:
fromAddress
- Address with zero or more UTXOs- Returns:
- a list of all UTXOs for this address
- Throws:
IOException
- if an error occurred fetching inputs
-
sendRawTransactionAsync
public CompletableFuture<org.bitcoinj.base.Sha256Hash> sendRawTransactionAsync(org.bitcoinj.core.Transaction tx) - Specified by:
sendRawTransactionAsync
in interfaceOmniSendingService
-