Package foundation.omni.rpc
Class OmniClient
- All Implemented Interfaces:
OmniClientRawTxSupport
,OmniProxyMethods
,AutoCloseable
,ChainTipClient
,ChainTipService
,AsyncSupport
,JsonRpcClient<JavaType>
,JsonRpcTransport<JavaType>
,RxJsonRpcClient
- Direct Known Subclasses:
OmniTestClient
Pure Java Bitcoin and Omni Core JSON-RPC client with camelCase method names.
For example, if the RPC is "omni_getbalance"
, then the corresponding method name is omniGetBalance(Address, CurrencyID)
.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.consensusj.jsonrpc.DefaultRpcClient
DefaultRpcClient.TransientErrorMapper<T>, DefaultRpcClient.TransportFactory
Nested classes/interfaces inherited from interface org.consensusj.jsonrpc.AsyncSupport
AsyncSupport.ThrowingSupplier<T>, AsyncSupport.TransientErrorFilter
-
Field Summary
Fields inherited from class org.consensusj.bitcoin.jsonrpc.BitcoinExtendedClient
DEFAULT_REGTEST_MINING_ADDRESS, defaultMaxConf, REGTEST_WALLET_NAME, stdRelayTxFee, stdTxFee, stdTxFeeSatoshis
Fields inherited from class org.consensusj.bitcoin.jsonrpc.BitcoinClient
BITCOIN_CORE_VERSION_DESC_DEFAULT, BITCOIN_CORE_VERSION_MIN
Fields inherited from class org.consensusj.jsonrpc.DefaultRpcClient
jsonRpcVersion, mapper
Fields inherited from interface foundation.omni.rpc.OmniProxyMethods
addressParser
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a client by readingbitcoin.conf
(Incubating)OmniClient
(SSLContext sslContext, org.bitcoinj.base.Network network, URI server, String rpcuser, String rpcpassword, boolean useZmq) OmniClient
(SSLContext sslContext, org.bitcoinj.base.Network network, URI server, String rpcuser, String rpcpassword, boolean useZmq, boolean isOmniProxy) OmniClient
(org.bitcoinj.base.Network network, URI server, String rpcuser, String rpcpassword) OmniClient
(org.bitcoinj.base.Network network, URI server, String rpcuser, String rpcpassword, boolean useZmq, boolean isOmniProxy) OmniClient
(RpcConfig config) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determine if remote server is an OmniProxy server.Check if server is running Omni CoreReturns pending and completed feature activations.Lists currently active crowdsales.Lists currently active offers on the distributed BTC/OMNI exchange.omniGetAllBalancesForAddress
(org.bitcoinj.base.Address address) Returns a sorted map of all token balances for a given address.omniGetAllBalancesForAddressAsList
(org.bitcoinj.base.Address address) Returns a list of all token balances for a given address.SortedMap
<org.bitcoinj.base.Address, BalanceEntry> omniGetAllBalancesForId
(CurrencyID currency) Returns a sorted map of address-balances for a given identifier.omniGetAllBalancesForIdAsList
(CurrencyID currency) Returns a list of address-balances for a given identifier.omniGetBalance
(org.bitcoinj.base.Address address, CurrencyID currency) Returns the balance for a given address and property.omniGetCrowdsale
(CurrencyID currency) Returns information about a crowdsale.omniGetFeeCache
(CurrencyID propertyid) Obtains the current amount of fees cached (pending distribution).omniGetFeeDistribution
(Integer distributionId) Obtains data for a past distribution of fees.omniGetFeeDistributions
(CurrencyID propertyId) Obtains data for past distributions of fees for a property.omniGetFeeShare
(org.bitcoinj.base.Address address, Ecosystem ecosystem) Obtains the current percentage share of fees addresses would receive if a distribution were to occur.omniGetFeeTrigger
(CurrencyID propertyId) Obtains the amount at which cached fees will be distributed.omniGetGrants
(CurrencyID propertyid) Returns information about granted and revoked units of managed tokens.Returns various state information of Omni Core and the Omni Layer protocol.omniGetOrderbook
(CurrencyID propertyForSale) Lists orders on the distributed token exchange with the given token for sale.omniGetOrderbook
(CurrencyID propertyForSale, CurrencyID propertyDesired) Lists orders on the distributed token exchange with the given token for sale, and token desired.omniGetProperty
(CurrencyID currency) Returns information about the specified currency, property, or token.omniGetSTO
(org.bitcoinj.base.Sha256Hash txid) Get information and recipients of a send-to-owners transaction.omniGetTrade
(org.bitcoinj.base.Sha256Hash txid) Returns information about an order on the distributed token exchange.omniGetTradeHistoryForAddress
(org.bitcoinj.base.Address address, Integer count, CurrencyID propertyId) omniGetTransaction
(org.bitcoinj.base.Sha256Hash txId) Returns information about an Omni Layer transaction.List
<org.bitcoinj.base.Sha256Hash> omniListBlockTransactions
(Integer blockIndex) Lists all Omni transactions in a block.Lists all currencies, smart properties and tokens.omniListTransactions
(String addressFilter, int count) omniListTransactions
(String addressFilter, Integer count, Integer skip, Integer startBlock, Integer endBlock) Return a list of wallet transactionsorg.bitcoinj.base.Sha256Hash
omniSend
(org.bitcoinj.base.Address fromAddress, org.bitcoinj.base.Address toAddress, CurrencyID currency, OmniValue amount) Creates and broadcasts a "simple send" transaction.org.bitcoinj.base.Sha256Hash
omniSendActivation
(org.bitcoinj.base.Address fromAddress, Short featureId, Integer block, Integer minVersion) Activates a protocol feature.org.bitcoinj.base.Sha256Hash
omniSendAll
(org.bitcoinj.base.Address fromAddress, org.bitcoinj.base.Address toAddress, Ecosystem ecosystem) Creates and broadcasts a "send all" transaction.org.bitcoinj.base.Sha256Hash
omniSendCancelAllTrades
(org.bitcoinj.base.Address fromAddress, Ecosystem ecosystem) Cancel all offers on the distributed token exchange with the given currency pair.org.bitcoinj.base.Sha256Hash
omniSendCancelTradesByPair
(org.bitcoinj.base.Address fromAddress, CurrencyID propertyForSale, CurrencyID propertyDesired) Cancel all offers on the distributed token exchange with the given currency pair.org.bitcoinj.base.Sha256Hash
omniSendCancelTradesByPrice
(org.bitcoinj.base.Address fromAddress, CurrencyID propertyForSale, OmniValue amountForSale, CurrencyID propertyDesired, OmniValue amountDesired) Cancel offers on the distributed token exchange with the specified price.org.bitcoinj.base.Sha256Hash
omniSendChangeIssuer
(org.bitcoinj.base.Address fromAddress, org.bitcoinj.base.Address toAddress, CurrencyID propertyId) Change the issuer on record of the given tokens.org.bitcoinj.base.Sha256Hash
omniSendCloseCrowdsale
(org.bitcoinj.base.Address fromAddress, CurrencyID propertyId) Manually close a crowdsale.org.bitcoinj.base.Sha256Hash
omniSendDExAccept
(org.bitcoinj.base.Address fromAddress, org.bitcoinj.base.Address toAddress, CurrencyID currencyId, OmniValue amount, Boolean override) Create and broadcast an accept order for the specified token and amount.org.bitcoinj.base.Sha256Hash
omniSendDExSell
(org.bitcoinj.base.Address fromAddress, CurrencyID currencyId, OmniValue amountForSale, org.bitcoinj.base.Coin amountDesired, Byte paymentWindow, org.bitcoinj.base.Coin commitmentFee, Byte action) Creates an offer on the traditional distributed exchange.org.bitcoinj.base.Sha256Hash
omniSendGrant
(org.bitcoinj.base.Address fromAddress, org.bitcoinj.base.Address toAddress, CurrencyID propertyId, OmniValue amount) Issue or grant new units of managed tokens.org.bitcoinj.base.Sha256Hash
omniSendIssuanceCrowdsale
(org.bitcoinj.base.Address fromAddress, Ecosystem ecosystem, PropertyType propertyType, CurrencyID previousId, String category, String subCategory, String name, String url, String data, CurrencyID propertyDesired, BigDecimal tokensPerUnit, Long deadline, Byte earlyBirdBonus, Byte issuerBonus) Create new tokens as crowdsale.org.bitcoinj.base.Sha256Hash
omniSendIssuanceFixed
(org.bitcoinj.base.Address fromAddress, Ecosystem ecosystem, PropertyType propertyType, CurrencyID previousId, String category, String subCategory, String name, String url, String data, OmniValue amount) Create new tokens with fixed supply.org.bitcoinj.base.Sha256Hash
omniSendIssuanceManaged
(org.bitcoinj.base.Address fromAddress, Ecosystem ecosystem, PropertyType propertyType, CurrencyID previousId, String category, String subCategory, String name, String url, String data) Create new tokens with manageable supply.org.bitcoinj.base.Sha256Hash
omniSendRawTx
(org.bitcoinj.base.Address fromAddress, String rawTxHex) Broadcasts a raw Omni Layer transaction.org.bitcoinj.base.Sha256Hash
omniSendRawTx
(org.bitcoinj.base.Address fromAddress, String rawTxHex, org.bitcoinj.base.Address referenceAddress) Broadcasts a raw Omni Layer transaction with reference address.org.bitcoinj.base.Sha256Hash
omniSendRevoke
(org.bitcoinj.base.Address fromAddress, CurrencyID propertyId, OmniValue amount) Revoke units of managed tokens.org.bitcoinj.base.Sha256Hash
omniSendSTO
(org.bitcoinj.base.Address fromAddress, CurrencyID currency, OmniValue amount) Creates and broadcasts a "send to owners" transaction.org.bitcoinj.base.Sha256Hash
omniSendToMany
(org.bitcoinj.base.Address fromAddress, CurrencyID currency, List<OmniOutput> mapping) Creates and broadcasts a "send to many" transaction.org.bitcoinj.base.Sha256Hash
omniSendTrade
(org.bitcoinj.base.Address fromAddress, CurrencyID propertyForSale, OmniValue amountForSale, CurrencyID propertyDesired, OmniValue amountDesired) Place a trade offer on the distributed token exchange.Methods inherited from class org.consensusj.bitcoin.rx.jsonrpc.RxBitcoinClient
chainTipPublisher, pollOnNewBlockAsync
Methods inherited from class org.consensusj.bitcoin.jsonrpc.BitcoinExtendedClient
clearMemPool, createRawTransaction, createRawTransaction, createSignedTransaction, createSignedTransaction, generateBlocks, getBitcoinBalance, getBitcoinBalance, getBitcoinBalance, getBlock, getBlockSubsidy, getDefaultMaxConf, getRegTestMiningAddress, getStdRelayTxFee, getStdTxFee, initRegTestWallet, listUnspentJ, listUnspentOutPoints, sendBitcoin, sendBitcoin, withWallet
Methods inherited from class org.consensusj.bitcoin.jsonrpc.BitcoinClient
addNode, close, commandExists, connectToServer, createRawTransaction, createWallet, createWallet, createWallet, dumpPrivKey, generateToAddress, generateToAddress, getAddedNodeInfo, getAddedNodeInfo, getAddressBalance, getAddressBalance, getAddressInfo, getAddressUtxos, getAddressUtxos, getBalance, getBalance, getBalance, getBestBlock, getBlock, getBlockAsync, getBlockChainInfo, getBlockChainInfoAsync, getBlockCount, getBlockHash, getBlockInfo, getChainTips, getChainTipsAsync, getCommands, getDefaultAsyncExecutor, getNetwork, getNetworkInfo, getNewAddress, getNewAddress, getRawTransaction, getRawTransactionInfo, getReceivedByAddress, getReceivedByAddress, getTransaction, getTransaction, getTxOut, getTxOut, getTxOutSetInfo, getZmqNotifications, getZmqNotificationsAsync, help, help, helpAsLines, helpAsMethodEntries, helpAsStream, importPrivKey, invalidateBlock, isAddressIndexEnabled, listAddressGroupings, listReceivedByAddress, listTransactions, listTransactions, listTransactions, listUnspent, listUnspent, listUnspent, listUnspent, listUnspent, listWallets, mapBitcoinTransientErrors, reconsiderBlock, sendFrom, sendMany, sendRawTransaction, sendRawTransaction, sendRawTransaction, sendRawTransaction, sendToAddress, sendToAddress, setTxFee, signRawTransactionWithWallet, stop, unloadWallet, unloadWallet, waitForBlock, waitForBlockchainInfoAsync, waitForConnected, waitForConnected, waitForServer, waitForServer, waitForServerAsync
Methods inherited from class org.consensusj.jsonrpc.DefaultRpcClient
collectionTypeForClasses, collectionTypeForClasses, defaultType, getJsonRpcVersion, getMapper, getServerURI, identityTransientErrorMapper, pollOnce, responseTypeFor, responseTypeFor, sendRequestForResponseAsync, sendRequestForResponseAsync, statusFromErrorResponse, temporarilyUnavailableResponse, typeForClass, waitForServer, waitForServer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.consensusj.jsonrpc.AsyncSupport
getDefaultAsyncExecutor, supplyAsync, supplyAsync
Methods inherited from interface org.consensusj.jsonrpc.JsonRpcClient
buildJsonRequest, buildJsonRequest, close, collectionTypeForClasses, collectionTypeForClasses, defaultType, getJsonRpcVersion, responseTypeFor, responseTypeFor, send, send, send, send, send, send, sendAsync, sendAsync, sendAsync, sendAsync, sendAsync, typeForClass
Methods inherited from interface org.consensusj.jsonrpc.JsonRpcTransport
getServerURI, sendRequestForResponse, sendRequestForResponseAsync, syncGet
Methods inherited from interface foundation.omni.rpc.OmniProxyMethods
omniProxyGetBalance, omniProxyGetBalances, omniProxyGetRichList, omniProxyGetRichListSync, omniProxyListProperties
Methods inherited from interface org.consensusj.rx.jsonrpc.RxJsonRpcClient
call, callAsync, pollOnce, pollOnceAsPublisher, pollOnceAsPublisher, pollOnceAsync
-
Constructor Details
-
OmniClient
public OmniClient()Construct a client by readingbitcoin.conf
(Incubating) -
OmniClient
-
OmniClient
-
OmniClient
public OmniClient(SSLContext sslContext, org.bitcoinj.base.Network network, URI server, String rpcuser, String rpcpassword, boolean useZmq) -
OmniClient
-
OmniClient
public OmniClient(SSLContext sslContext, org.bitcoinj.base.Network network, URI server, String rpcuser, String rpcpassword, boolean useZmq, boolean isOmniProxy)
-
-
Method Details
-
getOmniNetParams
-
isOmniServer
Check if server is running Omni Core- Returns:
- result is true if server is an Omni Core server, false otherwise
-
isOmniProxyServer
public boolean isOmniProxyServer()Description copied from interface:OmniProxyMethods
Determine if remote server is an OmniProxy server.- Specified by:
isOmniProxyServer
in interfaceOmniProxyMethods
- Returns:
- true of client was configured to talk to OmniProxy
-
omniGetInfo
Returns various state information of Omni Core and the Omni Layer protocol.- Returns:
- An object with state information
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniListProperties
Lists all currencies, smart properties and tokens.- Returns:
- A list with short information
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniGetProperty
Returns information about the specified currency, property, or token.- Parameters:
currency
- The identifier to look up- Returns:
- Omni Smart Property Info
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniGetCrowdsale
public Map<String,Object> omniGetCrowdsale(CurrencyID currency) throws JsonRpcException, IOException Returns information about a crowdsale.- Parameters:
currency
- The identifier of the crowdsale- Returns:
- An object with detailed information
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniGetActiveCrowdsales
Lists currently active crowdsales.- Returns:
- A list with information about active crowdsales
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniGetActiveDExSells
Lists currently active offers on the distributed BTC/OMNI exchange.- Returns:
- A list with information about the active offers
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniGetBalance
public BalanceEntry omniGetBalance(org.bitcoinj.base.Address address, CurrencyID currency) throws JsonRpcException, IOException Returns the balance for a given address and property.- Parameters:
address
- The address to look upcurrency
- The identifier of the token to look up- Returns:
- The available and reserved balance
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniGetAllBalancesForId
public SortedMap<org.bitcoinj.base.Address,BalanceEntry> omniGetAllBalancesForId(CurrencyID currency) throws JsonRpcException, IOException Returns a sorted map of address-balances for a given identifier.- Parameters:
currency
- The identifier of the token to look up- Returns:
- A Sorted Map indexed by addresses to available and reserved balances
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniGetAllBalancesForIdAsList
public List<AddressBalanceEntry> omniGetAllBalancesForIdAsList(CurrencyID currency) throws JsonRpcException, IOException Returns a list of address-balances for a given identifier.- Parameters:
currency
- The identifier of the token to look up- Returns:
- A list of address-balances
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniGetAllBalancesForAddress
public SortedMap<CurrencyID,BalanceEntry> omniGetAllBalancesForAddress(org.bitcoinj.base.Address address) throws JsonRpcException, IOException Returns a sorted map of all token balances for a given address.- Parameters:
address
- The address to look up- Returns:
- A Sorted Map indexed by currency/propertyid to available and reserved balances
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniGetAllBalancesForAddressAsList
public List<PropertyBalanceEntry> omniGetAllBalancesForAddressAsList(org.bitcoinj.base.Address address) throws JsonRpcException, IOException Returns a list of all token balances for a given address.- Parameters:
address
- The address to look up- Returns:
- A List of
PropertyBalanceEntry
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniGetTransaction
public OmniTransactionInfo omniGetTransaction(org.bitcoinj.base.Sha256Hash txId) throws JsonRpcException, IOException Returns information about an Omni Layer transaction.- Parameters:
txId
- The hash of the transaction to look up- Returns:
- Information about the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniListTransactions
- Throws:
JsonRpcException
IOException
-
omniListTransactions
public List<OmniTransactionInfo> omniListTransactions(String addressFilter, int count) throws JsonRpcException, IOException - Throws:
JsonRpcException
IOException
-
omniListTransactions
public List<OmniTransactionInfo> omniListTransactions(String addressFilter, Integer count, Integer skip, Integer startBlock, Integer endBlock) throws JsonRpcException, IOException Return a list of wallet transactions- Parameters:
addressFilter
- Return transactions matching this address, use "*" to return all transactions.count
- maximum transaction count to returnskip
- number to skipstartBlock
- starting blockendBlock
- ending block- Returns:
- a list of transaction info objects
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniListBlockTransactions
public List<org.bitcoinj.base.Sha256Hash> omniListBlockTransactions(Integer blockIndex) throws JsonRpcException, IOException Lists all Omni transactions in a block.- Parameters:
blockIndex
- The block height or block index- Returns:
- A list of transaction hashes
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniSendRawTx
public org.bitcoinj.base.Sha256Hash omniSendRawTx(org.bitcoinj.base.Address fromAddress, String rawTxHex) throws JsonRpcException, IOException Broadcasts a raw Omni Layer transaction.- Specified by:
omniSendRawTx
in interfaceOmniClientRawTxSupport
- Parameters:
fromAddress
- The address to send fromrawTxHex
- The hex-encoded raw transaction- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniSendRawTx
public org.bitcoinj.base.Sha256Hash omniSendRawTx(org.bitcoinj.base.Address fromAddress, String rawTxHex, org.bitcoinj.base.Address referenceAddress) throws JsonRpcException, IOException Broadcasts a raw Omni Layer transaction with reference address.- Specified by:
omniSendRawTx
in interfaceOmniClientRawTxSupport
- Parameters:
fromAddress
- The address to send fromrawTxHex
- The hex-encoded raw transactionreferenceAddress
- The reference address- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniSend
public org.bitcoinj.base.Sha256Hash omniSend(org.bitcoinj.base.Address fromAddress, org.bitcoinj.base.Address toAddress, CurrencyID currency, OmniValue amount) throws JsonRpcException, IOException Creates and broadcasts a "simple send" transaction.- Parameters:
fromAddress
- The address to spent fromtoAddress
- The address to send tocurrency
- The identifier of the token to transferamount
- The amount to transfer (Divisible/Indivisible type should match currency ID)- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniSendSTO
public org.bitcoinj.base.Sha256Hash omniSendSTO(org.bitcoinj.base.Address fromAddress, CurrencyID currency, OmniValue amount) throws JsonRpcException, IOException Creates and broadcasts a "send to owners" transaction.- Parameters:
fromAddress
- The address to spent fromcurrency
- The identifier of the token to distributeamount
- The amount to distribute- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniSendAll
public org.bitcoinj.base.Sha256Hash omniSendAll(org.bitcoinj.base.Address fromAddress, org.bitcoinj.base.Address toAddress, Ecosystem ecosystem) throws JsonRpcException, IOException Creates and broadcasts a "send all" transaction.- Parameters:
fromAddress
- The address to spent fromtoAddress
- The address to send toecosystem
- The ecosystem of the tokens to send- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendToMany
public org.bitcoinj.base.Sha256Hash omniSendToMany(org.bitcoinj.base.Address fromAddress, CurrencyID currency, List<OmniOutput> mapping) throws JsonRpcException, IOException Creates and broadcasts a "send to many" transaction.- Parameters:
fromAddress
- The address to spent fromcurrency
- The identifier of the token to distributemapping
- The receiving addresses and amounts as list of OmniOutput- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.12
-
omniSendDExSell
public org.bitcoinj.base.Sha256Hash omniSendDExSell(org.bitcoinj.base.Address fromAddress, CurrencyID currencyId, OmniValue amountForSale, org.bitcoinj.base.Coin amountDesired, Byte paymentWindow, org.bitcoinj.base.Coin commitmentFee, Byte action) throws JsonRpcException, IOException Creates an offer on the traditional distributed exchange.- Parameters:
fromAddress
- The addresscurrencyId
- The identifier of the currency for saleamountForSale
- The amount of currency (BigDecimal coins)amountDesired
- The amount of desired Bitcoin (in BTC)paymentWindow
- The payment window measured in blockscommitmentFee
- The minimum transaction fee required to be paid as commitment when accepting this offeraction
- The action applied to the offer (1 = new, 2 = update, 3 = cancel)- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendDExAccept
public org.bitcoinj.base.Sha256Hash omniSendDExAccept(org.bitcoinj.base.Address fromAddress, org.bitcoinj.base.Address toAddress, CurrencyID currencyId, OmniValue amount, Boolean override) throws JsonRpcException, IOException Create and broadcast an accept order for the specified token and amount.- Parameters:
fromAddress
- The address to send fromtoAddress
- The address of the sellercurrencyId
- The identifier of the token to purchaseamount
- The amount to acceptoverride
- Override minimum accept fee and payment window checks (use with caution!)- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendTrade
public org.bitcoinj.base.Sha256Hash omniSendTrade(org.bitcoinj.base.Address fromAddress, CurrencyID propertyForSale, OmniValue amountForSale, CurrencyID propertyDesired, OmniValue amountDesired) throws JsonRpcException, IOException Place a trade offer on the distributed token exchange.- Parameters:
fromAddress
- The address to trade withpropertyForSale
- The identifier of the tokens to list for saleamountForSale
- The amount of tokens to list for salepropertyDesired
- The identifier of the tokens desired in exchangeamountDesired
- The amount of tokens desired in exchange- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendCancelTradesByPrice
public org.bitcoinj.base.Sha256Hash omniSendCancelTradesByPrice(org.bitcoinj.base.Address fromAddress, CurrencyID propertyForSale, OmniValue amountForSale, CurrencyID propertyDesired, OmniValue amountDesired) throws JsonRpcException, IOException Cancel offers on the distributed token exchange with the specified price.- Parameters:
fromAddress
- The address to trade withpropertyForSale
- The identifier of the tokens to list for saleamountForSale
- The amount of tokens to list for salepropertyDesired
- The identifier of the tokens desired in exchangeamountDesired
- The amount of tokens desired in exchange- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendCancelTradesByPair
public org.bitcoinj.base.Sha256Hash omniSendCancelTradesByPair(org.bitcoinj.base.Address fromAddress, CurrencyID propertyForSale, CurrencyID propertyDesired) throws JsonRpcException, IOException Cancel all offers on the distributed token exchange with the given currency pair.- Parameters:
fromAddress
- The address to trade withpropertyForSale
- The identifier of the tokens listed for salepropertyDesired
- The identifier of the tokens desired in exchange- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendCancelAllTrades
public org.bitcoinj.base.Sha256Hash omniSendCancelAllTrades(org.bitcoinj.base.Address fromAddress, Ecosystem ecosystem) throws JsonRpcException, IOException Cancel all offers on the distributed token exchange with the given currency pair.- Parameters:
fromAddress
- The address to trade withecosystem
- The ecosystem of the offers to cancel: (1) main, (2) test- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendIssuanceFixed
public org.bitcoinj.base.Sha256Hash omniSendIssuanceFixed(org.bitcoinj.base.Address fromAddress, Ecosystem ecosystem, PropertyType propertyType, CurrencyID previousId, String category, String subCategory, String name, String url, String data, OmniValue amount) throws JsonRpcException, IOException Create new tokens with fixed supply.- Parameters:
fromAddress
- The address to send fromecosystem
- The ecosystem to create the tokens inpropertyType
- The type of the tokens to createpreviousId
- An identifier of a predecessor token (0 for new tokens)category
- A category for the new tokens (can be "")subCategory
- A subcategory for the new tokens (can be "")name
- The name of the new tokens to createurl
- An URL for further information about the new tokens (can be "")data
- A description for the new tokens (can be "")amount
- The number of tokens to create- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendIssuanceCrowdsale
public org.bitcoinj.base.Sha256Hash omniSendIssuanceCrowdsale(org.bitcoinj.base.Address fromAddress, Ecosystem ecosystem, PropertyType propertyType, CurrencyID previousId, String category, String subCategory, String name, String url, String data, CurrencyID propertyDesired, BigDecimal tokensPerUnit, Long deadline, Byte earlyBirdBonus, Byte issuerBonus) throws JsonRpcException, IOException Create new tokens as crowdsale.- Parameters:
fromAddress
- The address to send fromecosystem
- The ecosystem to create the tokens inpropertyType
- The type of the tokens to createpreviousId
- An identifier of a predecessor token (0 for new tokens)category
- A category for the new tokens (can be "")subCategory
- A subcategory for the new tokens (can be "")name
- The name of the new tokens to createurl
- An URL for further information about the new tokens (can be "")data
- A description for the new tokens (can be "")propertyDesired
- the identifier of a token eligible to participate in the crowdsaletokensPerUnit
- the amount of tokens granted per unit invested in the crowdsaledeadline
- the deadline of the crowdsale as Unix timestampearlyBirdBonus
- an early bird bonus for participants in percent per weekissuerBonus
- a percentage of tokens that will be granted to the issuer- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendCloseCrowdsale
public org.bitcoinj.base.Sha256Hash omniSendCloseCrowdsale(org.bitcoinj.base.Address fromAddress, CurrencyID propertyId) throws JsonRpcException, IOException Manually close a crowdsale.- Parameters:
fromAddress
- The address associated with the crowdsale to closepropertyId
- The identifier of the crowdsale to close- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendIssuanceManaged
public org.bitcoinj.base.Sha256Hash omniSendIssuanceManaged(org.bitcoinj.base.Address fromAddress, Ecosystem ecosystem, PropertyType propertyType, CurrencyID previousId, String category, String subCategory, String name, String url, String data) throws JsonRpcException, IOException Create new tokens with manageable supply.- Parameters:
fromAddress
- The address to send fromecosystem
- The ecosystem to create the tokens inpropertyType
- The type of the tokens to createpreviousId
- An identifier of a predecessor token (0 for new tokens)category
- A category for the new tokens (can be "")subCategory
- A subcategory for the new tokens (can be "")name
- The name of the new tokens to createurl
- An URL for further information about the new tokens (can be "")data
- A description for the new tokens (can be "")- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendGrant
public org.bitcoinj.base.Sha256Hash omniSendGrant(org.bitcoinj.base.Address fromAddress, org.bitcoinj.base.Address toAddress, CurrencyID propertyId, OmniValue amount) throws JsonRpcException, IOException Issue or grant new units of managed tokens.- Parameters:
fromAddress
- The address to send fromtoAddress
- The receiver of the tokenspropertyId
- The identifier of the tokens to grantamount
- The amount of tokens to create- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendRevoke
public org.bitcoinj.base.Sha256Hash omniSendRevoke(org.bitcoinj.base.Address fromAddress, CurrencyID propertyId, OmniValue amount) throws JsonRpcException, IOException Revoke units of managed tokens.- Parameters:
fromAddress
- The address to revoke the tokens frompropertyId
- The identifier of the tokens to revokeamount
- The amount of tokens to revoke- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendChangeIssuer
public org.bitcoinj.base.Sha256Hash omniSendChangeIssuer(org.bitcoinj.base.Address fromAddress, org.bitcoinj.base.Address toAddress, CurrencyID propertyId) throws JsonRpcException, IOException Change the issuer on record of the given tokens.- Parameters:
fromAddress
- The address associated with the tokenstoAddress
- The address to transfer administrative control topropertyId
- The identifier of the tokens- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniSendActivation
public org.bitcoinj.base.Sha256Hash omniSendActivation(org.bitcoinj.base.Address fromAddress, Short featureId, Integer block, Integer minVersion) throws JsonRpcException, IOException Activates a protocol feature.- Parameters:
fromAddress
- The address to send fromfeatureId
- The identifier of the feature to activateblock
- The activation blockminVersion
- The minimum supported client version- Returns:
- The hash of the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniGetSTO
public Map<String,Object> omniGetSTO(org.bitcoinj.base.Sha256Hash txid) throws JsonRpcException, IOException Get information and recipients of a send-to-owners transaction.- Parameters:
txid
- The hash of the transaction to lookup- Returns:
- Information about the transaction
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniGetTrade
public OmniTradeInfo omniGetTrade(org.bitcoinj.base.Sha256Hash txid) throws JsonRpcException, IOException Returns information about an order on the distributed token exchange.- Parameters:
txid
- The transaction hash of the order to look up- Returns:
- Information about the order, trade, and order matches
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniGetTradeHistoryForAddress
public List<OmniTradeInfo> omniGetTradeHistoryForAddress(org.bitcoinj.base.Address address, Integer count, CurrencyID propertyId) throws JsonRpcException, IOException - Throws:
JsonRpcException
IOException
-
omniGetOrderbook
public List<Map<String,Object>> omniGetOrderbook(CurrencyID propertyForSale) throws JsonRpcException, IOException Lists orders on the distributed token exchange with the given token for sale.- Parameters:
propertyForSale
- The identifier of the token for sale, used as filter- Returns:
- A list of orders
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniGetOrderbook
public List<Map<String,Object>> omniGetOrderbook(CurrencyID propertyForSale, CurrencyID propertyDesired) throws JsonRpcException, IOException Lists orders on the distributed token exchange with the given token for sale, and token desired.- Parameters:
propertyForSale
- The identifier of the token for sale, used as filterpropertyDesired
- The identifier of the token desired, used as filter- Returns:
- A list of orders
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniGetGrants
public List<Map<String,Object>> omniGetGrants(CurrencyID propertyid) throws JsonRpcException, IOException Returns information about granted and revoked units of managed tokens.- Parameters:
propertyid
- The identifier of the managed tokens to lookup- Returns:
- A list of grants and revokes
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-
omniGetActivations
public Map<String,List<Map<String, omniGetActivations() throws JsonRpcException, IOExceptionObject>>> Returns pending and completed feature activations.- Returns:
- Pending and complete feature activations
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.10
-
omniGetFeeCache
public List<Map<String,Object>> omniGetFeeCache(CurrencyID propertyid) throws JsonRpcException, IOException Obtains the current amount of fees cached (pending distribution). If a property ID is supplied the results will be filtered to show this property ID only. If no property ID is supplied the results will contain all properties that currently have fees cached pending distribution.- Parameters:
propertyid
- the identifier of the property to filter results on- Returns:
- A list of amounts of fees cached
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.11
-
omniGetFeeTrigger
public List<Map<String,Object>> omniGetFeeTrigger(CurrencyID propertyId) throws JsonRpcException, IOException Obtains the amount at which cached fees will be distributed. If a property ID is supplied the results will be filtered to show this property ID only. If no property ID is supplied the results will contain all properties.- Parameters:
propertyId
- the identifier of the property to filter results on- Returns:
- A list of amounts of fees required to trigger distribution
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.11
-
omniGetFeeDistribution
public Map<String,Object> omniGetFeeDistribution(Integer distributionId) throws JsonRpcException, IOException Obtains data for a past distribution of fees. A distribution ID must be supplied to identify the distribution to obtain data for.- Parameters:
distributionId
- the identifier of the distribution to obtain data for- Returns:
- Information about a fee distribution
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.11
-
omniGetFeeDistributions
public List<Map<String,Object>> omniGetFeeDistributions(CurrencyID propertyId) throws JsonRpcException, IOException Obtains data for past distributions of fees for a property. A property ID must be supplied to retrieve past distributions for.- Parameters:
propertyId
- the identifier of the property to retrieve past distributions for- Returns:
- A list of fee distributions
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error- Since:
- Omni Core 0.0.11
-