Omni Core is a fork of Bitcoin Core, with Omni Protocol feature
support added as a new layer of functionality on top. As such
interacting with the API is done in the same manner (JSON-RPC) as
Bitcoin Core, simply with additional RPCs available for utilizing Omni
Protocol features.
As all existing Bitcoin Core functionality is inherent to Omni Core, the RPC port by default remains as 8332
as per Bitcoin Core. If you wish to run Omni Core in tandem with
Bitcoin Core (eg. via a separate datadir) you may utilize the -rpcport<port> option to nominate an alternative port number.
All available commands can be listed with "help", and information about a specific command can be retrieved with "help <command>".
Please note: this document may not always be up-to-date. There may be errors, omissions or inaccuracies present.
Transaction creation
The RPCs for transaction creation can be used to create and broadcast Omni Protocol transactions.
A hash of the broadcasted transaction is returned as result.
omni_send
Create and broadcast a simple send transaction.
Arguments:
Name
Type
Presence
Description
fromaddress
string
required
the address to send from
toaddress
string
required
the address of the receiver
propertyid
number
required
the identifier of the tokens to send
amount
string
required
the amount to send
redeemaddress
string
optional
an address that can spend the transaction dust (sender by default)
referenceamount
string
optional
a bitcoin amount that is sent to the receiver (minimal by default)
Result:
"hash"// (string) the hex-encoded transaction hash
The RPCs for data retrieval can be used to get information about the state of the Omni ecosystem.
omni_getinfo
Returns various state information of the client and protocol.
Arguments:
None
Result:
Result:
{
"omnicoreversion_int": xxxxxxx, // (number) client version as integer"omnicoreversion":"x.x.x.x-xxx", // (string) client version"mastercoreversion":"x.x.x.x-xxx", // (string) client version (DEPRECIATED)"bitcoincoreversion":"x.x.x", // (string) Bitcoin Core version"commitinfo":"xxxxxxx", // (string) build commit identifier"block": nnnnnn, // (number) index of the last processed block"blocktime": nnnnnnnnnn, // (number) timestamp of the last processed block"blocktransactions": nnnn, // (number) Omni transactions found in the last processed block"totaltransactions": nnnnnnnn, // (number) Omni transactions processed in total"alerts": [ // (array of JSON objects) active protocol alert (if any)
{
"alerttype": n // (number) alert type as integer"alerttype":"xxx"// (string) alert type (can be "alertexpiringbyblock", "alertexpiringbyblocktime", "alertexpiringbyclientversion" or "error")"alertexpiry":"nnnnnnnnnn"// (string) expiration criteria (can refer to block height, timestamp or client verion)"alertmessage":"xxx"// (string) information about the alert
},
...
]
}
Example:
$ omnicore-cli "omni_getinfo"
omni_getbalance
Returns the token balance for a given address and property.
Arguments:
Name
Type
Presence
Description
address
string
required
the address
propertyid
number
required
the property identifier
Result:
{
"balance":"n.nnnnnnnn", // (string) the available balance of the address"reserved":"n.nnnnnnnn", // (string) the amount reserved by sell offers and accepts"frozen":"n.nnnnnnnn"// (string) the amount frozen by the issuer (applies to managed properties only)
}
Returns a list of token balances for a given currency or property identifier.
Arguments:
Name
Type
Presence
Description
propertyid
number
required
the property identifier
Result:
[ // (array of JSON objects)
{
"address":"address", // (string) the address"balance":"n.nnnnnnnn", // (string) the available balance of the address"reserved":"n.nnnnnnnn"// (string) the amount reserved by sell offers and accepts
},
...
]
Example:
$ omnicore-cli "omni_getallbalancesforid" 1
omni_getallbalancesforaddress
Returns a list of all token balances for a given address.
Arguments:
Name
Type
Presence
Description
address
string
required
the address
Result:
[ // (array of JSON objects)
{
"propertyid": n, // (number) the property identifier"balance":"n.nnnnnnnn", // (string) the available balance of the address"reserved":"n.nnnnnnnn"// (string) the amount reserved by sell offers and accepts
},
...
]
Get detailed information about an Omni transaction.
Arguments:
Name
Type
Presence
Description
txid
string
required
the hash of the transaction to lookup
Result:
{
"txid":"hash", // (string) the hex-encoded hash of the transaction"sendingaddress":"address", // (string) the Bitcoin address of the sender"referenceaddress":"address", // (string) a Bitcoin address used as reference (if any)"ismine":true|false, // (boolean) whether the transaction involes an address in the wallet"confirmations": nnnnnnnnnn, // (number) the number of transaction confirmations"fee":"n.nnnnnnnn", // (string) the transaction fee in bitcoins"blocktime": nnnnnnnnnn, // (number) the timestamp of the block that contains the transaction"valid":true|false, // (boolean) whether the transaction is valid"positioninblock": n, // (number) the position (index) of the transaction within the block"version": n, // (number) the transaction version"type_int": n, // (number) the transaction type as number"type":"type", // (string) the transaction type as string
[...] // (mixed) other transaction type specific properties
}
List wallet transactions, optionally filtered by an address and block boundaries.
Arguments:
Name
Type
Presence
Description
txid
string
optional
address filter (default: "*")
count
number
optional
show at most n transactions (default: 10)
skip
number
optional
skip the first n transactions (default: 0)
startblock
number
optional
first block to begin the search (default: 0)
endblock
number
optional
last block to include in the search (default: 999999)
Result:
[ // (array of JSON objects)
{
"txid":"hash", // (string) the hex-encoded hash of the transaction"sendingaddress":"address", // (string) the Bitcoin address of the sender"referenceaddress":"address", // (string) a Bitcoin address used as reference (if any)"ismine":true|false, // (boolean) whether the transaction involves an address in the wallet"confirmations": nnnnnnnnnn, // (number) the number of transaction confirmations"fee":"n.nnnnnnnn", // (string) the transaction fee in bitcoins"blocktime": nnnnnnnnnn, // (number) the timestamp of the block that contains the transaction"valid":true|false, // (boolean) whether the transaction is valid"positioninblock": n, // (number) the position (index) of the transaction within the block"version": n, // (number) the transaction version"type_int": n, // (number) the transaction type as number"type":"type", // (string) the transaction type as string
[...] // (mixed) other transaction type specific properties
},
...
]
Example:
$ omnicore-cli "omni_listtransactions"
omni_listblocktransactions
Lists all Omni transactions in a block.
Arguments:
Name
Type
Presence
Description
index
number
required
the block height or block index
Result:
[ // (array of string)"hash", // (string) the hash of the transaction...
]
Returns a list of unconfirmed Omni transactions, pending in the memory pool.
Note: the validity of pending transactions is uncertain, and the
state of the memory pool may change at any moment. It is recommended to
check transactions after confirmation, and pending transactions should
be considered as invalid.
Arguments:
Name
Type
Presence
Description
address
string
optional
filter results by address (default: "" for no filter)
Result:
[ // (array of JSON objects)
{
"txid":"hash", // (string) the hex-encoded hash of the transaction"sendingaddress":"address", // (string) the Bitcoin address of the sender"referenceaddress":"address", // (string) a Bitcoin address used as reference (if any)"ismine":true|false, // (boolean) whether the transaction involes an address in the wallet"fee":"n.nnnnnnnn", // (string) the transaction fee in bitcoins"version": n, // (number) the transaction version"type_int": n, // (number) the transaction type as number"type":"type", // (string) the transaction type as string
[...] // (mixed) other transaction type specific properties
},
...
]
Example:
$ omnicore-cli "omni_listpendingtransactions"
omni_getactivedexsells
Returns currently active offers on the distributed exchange.
Arguments:
Name
Type
Presence
Description
address
string
optional
address filter (default: include any)
Result:
[ // (array of JSON objects)
{
"txid":"hash", // (string) the hash of the transaction of this offer"propertyid": n, // (number) the identifier of the tokens for sale"seller":"address", // (string) the Bitcoin address of the seller"amountavailable":"n.nnnnnnnn", // (string) the number of tokens still listed for sale and currently available"bitcoindesired":"n.nnnnnnnn", // (string) the number of bitcoins desired in exchange"unitprice":"n.nnnnnnnn" , // (string) the unit price (BTC/token)"timelimit": nn, // (number) the time limit in blocks a buyer has to pay following a successful accept"minimumfee":"n.nnnnnnnn", // (string) the minimum mining fee a buyer has to pay to accept this offer"amountaccepted":"n.nnnnnnnn", // (string) the number of tokens currently reserved for pending "accept" orders"accepts": [ // (array of JSON objects) a list of pending "accept" orders
{
"buyer":"address", // (string) the Bitcoin address of the buyer"block": nnnnnn, // (number) the index of the block that contains the "accept" order"blocksleft": nn, // (number) the number of blocks left to pay"amount":"n.nnnnnnnn"// (string) the amount of tokens accepted and reserved"amounttopay":"n.nnnnnnnn"// (string) the amount in bitcoins needed finalize the trade
},
...
]
},
...
]
Example:
$ omnicore-cli "omni_getactivedexsells"
omni_listproperties
Lists all tokens or smart properties.
Arguments:
None
Result:
[ // (array of JSON objects)
{
"propertyid": n, // (number) the identifier of the tokens"name":"name", // (string) the name of the tokens"category":"category", // (string) the category used for the tokens"subcategory":"subcategory", // (string) the subcategory used for the tokens"data":"information", // (string) additional information or a description"url":"uri", // (string) an URI, for example pointing to a website"divisible":true|false// (boolean) whether the tokens are divisible
},
...
]
Example:
$ omnicore-cli "omni_listproperties"
omni_getproperty
Returns details for about the tokens or smart property to lookup.
Arguments:
Name
Type
Presence
Description
propertyid
number
required
the identifier of the tokens or property
Result:
{
"propertyid": n, // (number) the identifier"name":"name", // (string) the name of the tokens"category":"category", // (string) the category used for the tokens"subcategory":"subcategory", // (string) the subcategory used for the tokens"data":"information", // (string) additional information or a description"url":"uri", // (string) an URI, for example pointing to a website"divisible":true|false, // (boolean) whether the tokens are divisible"issuer":"address", // (string) the Bitcoin address of the issuer on record"creationtxid":"hash", // (string) the hex-encoded creation transaction hash"fixedissuance":true|false, // (boolean) whether the token supply is fixed"managedissuance":true|false, // (boolean) whether the token supply is managed by the issuer"freezingenabled":true|false, // (boolean) whether freezing is enabled for the property (managed properties only)"totaltokens":"n.nnnnnnnn"// (string) the total number of tokens in existence
}
Example:
$ omnicore-cli "omni_getproperty" 3
omni_getactivecrowdsales
Lists currently active crowdsales.
Arguments:
None
Result:
[ // (array of JSON objects)
{
"propertyid": n, // (number) the identifier of the crowdsale"name":"name", // (string) the name of the tokens issued via the crowdsale"issuer":"address", // (string) the Bitcoin address of the issuer on record"propertyiddesired": n, // (number) the identifier of the tokens eligible to participate in the crowdsale"tokensperunit":"n.nnnnnnnn", // (string) the amount of tokens granted per unit invested in the crowdsale"earlybonus": n, // (number) an early bird bonus for participants in percent per week"percenttoissuer": n, // (number) a percentage of tokens that will be granted to the issuer"starttime": nnnnnnnnnn, // (number) the start time of the of the crowdsale as Unix timestamp"deadline": nnnnnnnnnn // (number) the deadline of the crowdsale as Unix timestamp
},
...
]
Example:
$ omnicore-cli "omni_getactivecrowdsales"
omni_getcrowdsale
Returns information about a crowdsale.
Arguments:,
Name
Type
Presence
Description
propertyid
number
required
the identifier of the crowdsale
verbose
boolean
optional
list crowdsale participants (default: false)
Result:
{
"propertyid": n, // (number) the identifier of the crowdsale"name":"name", // (string) the name of the tokens issued via the crowdsale"active":true|false, // (boolean) whether the crowdsale is still active"issuer":"address", // (string) the Bitcoin address of the issuer on record"propertyiddesired": n, // (number) the identifier of the tokens eligible to participate in the crowdsale"tokensperunit":"n.nnnnnnnn", // (string) the amount of tokens granted per unit invested in the crowdsale"earlybonus": n, // (number) an early bird bonus for participants in percent per week"percenttoissuer": n, // (number) a percentage of tokens that will be granted to the issuer"starttime": nnnnnnnnnn, // (number) the start time of the of the crowdsale as Unix timestamp"deadline": nnnnnnnnnn, // (number) the deadline of the crowdsale as Unix timestamp"amountraised":"n.nnnnnnnn", // (string) the amount of tokens invested by participants"tokensissued":"n.nnnnnnnn", // (string) the total number of tokens issued via the crowdsale"addedissuertokens":"n.nnnnnnnn", // (string) the amount of tokens granted to the issuer as bonus"closedearly":true|false, // (boolean) whether the crowdsale ended early (if not active)"maxtokens":true|false, // (boolean) whether the crowdsale ended early due to reaching the limit of max. issuable tokens (if not active)"endedtime": nnnnnnnnnn, // (number) the time when the crowdsale ended (if closed early)"closetx":"hash", // (string) the hex-encoded hash of the transaction that closed the crowdsale (if closed manually)"participanttransactions": [ // (array of JSON objects) a list of crowdsale participations (if verbose=true)
{
"txid":"hash", // (string) the hex-encoded hash of participation transaction"amountsent":"n.nnnnnnnn", // (string) the amount of tokens invested by the participant"participanttokens":"n.nnnnnnnn", // (string) the tokens granted to the participant"issuertokens":"n.nnnnnnnn"// (string) the tokens granted to the issuer as bonus
},
...
]
}
Example:
$ omnicore-cli "omni_getcrowdsale" 3 true
omni_getgrants
Returns information about granted and revoked units of managed tokens.
Arguments:
None
Result:
{
"propertyid": n, // (number) the identifier of the managed tokens"name":"name", // (string) the name of the tokens"issuer":"address", // (string) the Bitcoin address of the issuer on record"creationtxid":"hash", // (string) the hex-encoded creation transaction hash"totaltokens":"n.nnnnnnnn", // (string) the total number of tokens in existence"issuances": [ // (array of JSON objects) a list of the granted and revoked tokens
{
"txid":"hash", // (string) the hash of the transaction that granted tokens"grant":"n.nnnnnnnn"// (string) the number of tokens granted by this transaction
},
{
"txid":"hash", // (string) the hash of the transaction that revoked tokens"grant":"n.nnnnnnnn"// (string) the number of tokens revoked by this transaction
},
...
]
}
Arguments:
Name
Type
Presence
Description
propertyid
number
required
the identifier of the managed tokens to lookup
Example:
$ omnicore-cli "omni_getgrants" 31
omni_getsto
Get information and recipients of a send-to-owners transaction.
Arguments:
Name
Type
Presence
Description
txid
string
required
the hash of the transaction to lookup
recipientfilter
string
optional
a filter for recipients (wallet by default, "*" for all)
Result:
{
"txid":"hash", // (string) the hex-encoded hash of the transaction"sendingaddress":"address", // (string) the Bitcoin address of the sender"ismine":true|false, // (boolean) whether the transaction involes an address in the wallet"confirmations": nnnnnnnnnn, // (number) the number of transaction confirmations"fee":"n.nnnnnnnn", // (string) the transaction fee in bitcoins"blocktime": nnnnnnnnnn, // (number) the timestamp of the block that contains the transaction"valid":true|false, // (boolean) whether the transaction is valid"positioninblock": n, // (number) the position (index) of the transaction within the block"version": n, // (number) the transaction version"type_int": n, // (number) the transaction type as number"type":"type", // (string) the transaction type as string"propertyid": n, // (number) the identifier of sent tokens"divisible":true|false, // (boolean) whether the sent tokens are divisible"amount":"n.nnnnnnnn", // (string) the number of tokens sent to owners"totalstofee":"n.nnnnnnnn", // (string) the fee paid by the sender, nominated in OMNI or TOMNI"recipients": [ // (array of JSON objects) a list of recipients
{
"address":"address", // (string) the Bitcoin address of the recipient"amount":"n.nnnnnnnn"// (string) the number of tokens sent to this recipient
},
...
]
}
Get detailed information and trade matches for orders on the distributed token exchange.
Arguments:
Name
Type
Presence
Description
txid
string
required
the hash of the order to lookup
Result:
{
"txid":"hash", // (string) the hex-encoded hash of the transaction of the order"sendingaddress":"address", // (string) the Bitcoin address of the trader"ismine":true|false, // (boolean) whether the order involes an address in the wallet"confirmations": nnnnnnnnnn, // (number) the number of transaction confirmations"fee":"n.nnnnnnnn", // (string) the transaction fee in bitcoins"blocktime": nnnnnnnnnn, // (number) the timestamp of the block that contains the transaction"valid":true|false, // (boolean) whether the transaction is valid"positioninblock": n, // (number) the position (index) of the transaction within the block"version": n, // (number) the transaction version"type_int": n, // (number) the transaction type as number"type":"type", // (string) the transaction type as string"propertyidforsale": n, // (number) the identifier of the tokens put up for sale"propertyidforsaleisdivisible":true|false, // (boolean) whether the tokens for sale are divisible"amountforsale":"n.nnnnnnnn", // (string) the amount of tokens initially offered"propertyiddesired": n, // (number) the identifier of the tokens desired in exchange"propertyiddesiredisdivisible":true|false, // (boolean) whether the desired tokens are divisible"amountdesired":"n.nnnnnnnn", // (string) the amount of tokens initially desired"unitprice":"n.nnnnnnnnnnn..."// (string) the unit price (shown in the property desired)"status":"status"// (string) the status of the order ("open", "cancelled", "filled", ...)"canceltxid":"hash", // (string) the hash of the transaction that cancelled the order (if cancelled)"matches": [ // (array of JSON objects) a list of matched orders and executed trades
{
"txid":"hash", // (string) the hash of the transaction that was matched against"block": nnnnnn, // (number) the index of the block that contains this transaction"address":"address", // (string) the Bitcoin address of the other trader"amountsold":"n.nnnnnnnn", // (string) the number of tokens sold in this trade"amountreceived":"n.nnnnnnnn"// (string) the number of tokens traded in exchange
},
...
]
}
List active offers on the distributed token exchange.
Arguments:
Name
Type
Presence
Description
propertyid
number
required
filter orders by propertyid for sale
propertyid
number
optional
filter orders by propertyid desired
Result:
[ // (array of JSON objects)
{
"address":"address", // (string) the Bitcoin address of the trader"txid":"hash", // (string) the hex-encoded hash of the transaction of the order"ecosystem":"main"|"test", // (string) the ecosytem in which the order was made (if "cancel-ecosystem")"propertyidforsale": n, // (number) the identifier of the tokens put up for sale"propertyidforsaleisdivisible":true|false, // (boolean) whether the tokens for sale are divisible"amountforsale":"n.nnnnnnnn", // (string) the amount of tokens initially offered"amountremaining":"n.nnnnnnnn", // (string) the amount of tokens still up for sale"propertyiddesired": n, // (number) the identifier of the tokens desired in exchange"propertyiddesiredisdivisible":true|false, // (boolean) whether the desired tokens are divisible"amountdesired":"n.nnnnnnnn", // (string) the amount of tokens initially desired"amounttofill":"n.nnnnnnnn", // (string) the amount of tokens still needed to fill the offer completely"action": n, // (number) the action of the transaction: (1) "trade", (2) "cancel-price", (3) "cancel-pair", (4) "cancel-ecosystem""block": nnnnnn, // (number) the index of the block that contains the transaction"blocktime": nnnnnnnnnn // (number) the timestamp of the block that contains the transaction
},
...
]
Example:
$ omnicore-cli "omni_getorderbook" 2
omni_gettradehistoryforpair
Retrieves the history of trades on the distributed token exchange for the specified market.
Arguments:
Name
Type
Presence
Description
propertyid
number
required
the first side of the traded pair
propertyid
number
required
the second side of the traded pair
count
number
optional
number of trades to retrieve (default: 10)
Result:
[ // (array of JSON objects)
{
"block": nnnnnn, // (number) the index of the block that contains the trade match"unitprice":"n.nnnnnnnnnnn..." , // (string) the unit price used to execute this trade (received/sold)"inverseprice":"n.nnnnnnnnnnn...", // (string) the inverse unit price (sold/received)"sellertxid":"hash", // (string) the hash of the transaction of the seller"address":"address", // (string) the Bitcoin address of the seller"amountsold":"n.nnnnnnnn", // (string) the number of tokens sold in this trade"amountreceived":"n.nnnnnnnn", // (string) the number of tokens traded in exchange"matchingtxid":"hash", // (string) the hash of the transaction that was matched against"matchingaddress":"address"// (string) the Bitcoin address of the other party of this trade
},
...
]
Retrieves the history of orders on the distributed exchange for the supplied address.
Arguments:
Name
Type
Presence
Description
address
string
required
address to retrieve history for
count
number
optional
number of orders to retrieve (default: 10)
propertyid
number
optional
filter by propertyid transacted (default: no filter)
Result:
[ // (array of JSON objects)
{
"txid":"hash", // (string) the hex-encoded hash of the transaction of the order"sendingaddress":"address", // (string) the Bitcoin address of the trader"ismine":true|false, // (boolean) whether the order involes an address in the wallet"confirmations": nnnnnnnnnn, // (number) the number of transaction confirmations"fee":"n.nnnnnnnn", // (string) the transaction fee in bitcoins"blocktime": nnnnnnnnnn, // (number) the timestamp of the block that contains the transaction"valid":true|false, // (boolean) whether the transaction is valid"positioninblock": n, // (number) the position (index) of the transaction within the block"version": n, // (number) the transaction version"type_int": n, // (number) the transaction type as number"type":"type", // (string) the transaction type as string"propertyidforsale": n, // (number) the identifier of the tokens put up for sale"propertyidforsaleisdivisible":true|false, // (boolean) whether the tokens for sale are divisible"amountforsale":"n.nnnnnnnn", // (string) the amount of tokens initially offered"propertyiddesired": n, // (number) the identifier of the tokens desired in exchange"propertyiddesiredisdivisible":true|false, // (boolean) whether the desired tokens are divisible"amountdesired":"n.nnnnnnnn", // (string) the amount of tokens initially desired"unitprice":"n.nnnnnnnnnnn..."// (string) the unit price (shown in the property desired)"status":"status"// (string) the status of the order ("open", "cancelled", "filled", ...)"canceltxid":"hash", // (string) the hash of the transaction that cancelled the order (if cancelled)"matches": [ // (array of JSON objects) a list of matched orders and executed trades
{
"txid":"hash", // (string) the hash of the transaction that was matched against"block": nnnnnn, // (number) the index of the block that contains this transaction"address":"address", // (string) the Bitcoin address of the other trader"amountsold":"n.nnnnnnnn", // (string) the number of tokens sold in this trade"amountreceived":"n.nnnnnnnn"// (string) the number of tokens traded in exchange
},
...
]
},
...
]
Returns pending and completed feature activations.
Result:
{
"pendingactivations": [ // (array of JSON objects) a list of pending feature activations
{
"featureid": n, // (number) the id of the feature"featurename":"xxxxxxxx", // (string) the name of the feature"activationblock": n, // (number) the block the feature will be activated"minimumversion": n // (number) the minimum client version needed to support this feature
},
...
]
"completedactivations": [ // (array of JSON objects) a list of completed feature activations
{
"featureid": n, // (number) the id of the feature"featurename":"xxxxxxxx", // (string) the name of the feature"activationblock": n, // (number) the block the feature will be activated"minimumversion": n // (number) the minimum client version needed to support this feature
},
...
]
}
Example:
$ omnicore-cli "omni_getactivations"
omni_getpayload
Get the payload for an Omni transaction.
Arguments:
Name
Type
Presence
Description
txid
string
required
the hash of the transaction to retrieve payload
Result:
{
"payload":"payloadmessage", // (string) the decoded Omni payload message"payloadsize": n // (number) the size of the payload
}
Returns a list of blocks containing Omni transactions for use in seed block filtering.
WARNING: The Exodus crowdsale is not stored in LevelDB, thus this is
currently only safe to use to generate seed blocks after block 255365.
Arguments:
Name
Type
Presence
Description
startblock
number
required
the first block to look for Omni transactions (inclusive)
endblock
number
required
the last block to look for Omni transactions (inclusive)
Result:
[ // (array of numbers) a list of seed blocks
nnnnnnn, // the block height of the seed block...
]
Example:
$ omnicore-cli "omni_getseedblocks" 290000 300000
omni_getcurrentconsensushash
Returns the consensus hash covering the state of the current block.
Arguments:
None
Result:
{
"block": nnnnnn, // (number) the index of the block this consensus hash applies to"blockhash":"hash", // (string) the hash of the corresponding block"consensushash":"hash"// (string) the consensus hash for the block
}
Example:
$ omnicore-cli "omni_getcurrentconsensushash"
Raw transactions
The RPCs for raw transactions/payloads can be used to decode or create raw Omni transactions.
omni_decodetransaction
Decodes an Omni transaction.
If the inputs of the transaction are not in the chain, then they must
be provided, because the transaction inputs are used to identify the
sender of a transaction.
A block height can be provided, which is used to determine the parsing rules.
Arguments:
Name
Type
Presence
Description
rawtx
string
required
the raw transaction to decode
prevtxs
string
optional
a JSON array of transaction inputs (default: none)
height
number
optional
the parsing block height (default: 0 for chain height)
The format of prevtxs is as following:
[
{
"txid":"hash", // (string, required) the transaction hash"vout": n, // (number, required) the output number"scriptPubKey":"hex", // (string, required) the output script"value":n.nnnnnnnn// (number, required) the output value
}
,...
]
Result:
{
"txid":"hash", // (string) the hex-encoded hash of the transaction"fee":"n.nnnnnnnn", // (string) the transaction fee in bitcoins"sendingaddress":"address", // (string) the Bitcoin address of the sender"referenceaddress":"address", // (string) a Bitcoin address used as reference (if any)"ismine":true|false, // (boolean) whether the transaction involes an address in the wallet"version": n, // (number) the transaction version"type_int": n, // (number) the transaction type as number"type":"type", // (string) the transaction type as string
[...] // (mixed) other transaction type specific properties
}
The provided inputs are not added to the transaction, but only used
to determine the change. It is assumed that the inputs were previously
added, for example via "createrawtransaction".
Optionally a position can be provided, where the change output should be inserted, starting with 0.
If the number of outputs is smaller than the position, then the change
output is added to the end. Change outputs should be inserted before
reference outputs, and as per default, the change output is added to
the`first position.
If the change amount would be considered as dust, then no change output is added.
Arguments:
Name
Type
Presence
Description
rawtx
string
required
the raw transaction to extend
prevtxs
string
required
a JSON array of transaction inputs
destination
string
required
the destination for the change
fee
number
required
the desired transaction fees
position
number
optional
the position of the change output (default: first position)
The format of prevtxs is as following:
[
{
"txid":"hash", // (string, required) the transaction hash"vout": n, // (number, required) the output number"scriptPubKey":"hex", // (string, required) the output script"value":n.nnnnnnnn// (number, required) the output value
}
,...
]
Result:
"rawtx"// (string) the hex-encoded modified raw transaction
The RPCs for the fee system can be used to obtain data about the fee system and fee distributions.
omni_getfeecache
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.
Arguments:
Name
Type
Presence
Description
propertyid
number
optional
the identifier of the property to filter results on
Result:
[ // (array of JSON objects)
{
"propertyid": nnnnnnn, // (number) the property id"cachedfees":"n.nnnnnnnn", // (string) the amount of fees cached for this property
},
...
]
Example:
$ omnicore-cli "omni_getfeecache" 31
omni_getfeetrigger
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.
Arguments:
Name
Type
Presence
Description
propertyid
number
optional
the identifier of the property to filter results on
Result:
[ // (array of JSON objects)
{
"propertyid": nnnnnnn, // (number) the property id"feetrigger":"n.nnnnnnnn", // (string) the amount of fees required to trigger distribution
},
...
]
Example:
$ omnicore-cli "omni_getfeetrigger" 31
omni_getfeeshare
Obtains the current percentage share of fees addresses would receive if a distribution were to occur.
If an address is supplied the results will be filtered to show this
address only. If no address is supplied the results will be filtered to
show wallet addresses only. If a wildcard is provided ("*") the results will contain all addresses that would receive a share.
If an ecosystem is supplied the results will reflect the fee share
for that ecosystem (main or test). If no ecosystem is supplied the
results will reflect the main ecosystem.
Arguments:
Name
Type
Presence
Description
address
string
optional
the address to filter results on
ecosystem
number
optional
the ecosystem to obtain the current percentage fee share (1 = main, 2 = test)
Result:
[ // (array of JSON objects)
{
"address":"address"// (string) the adress that would receive a share of fees"feeshare":"n.nnnn%", // (string) the percentage of fees this address will receive based on the current state
},
...
]
A distribution ID must be supplied to identify the distribution to obtain data for.
Arguments:
Name
Type
Presence
Description
distributionid
number
required
the identifier of the distribution to obtain data for
Result:
{
"distributionid": n, // (number) the distribution id"propertyid": n, // (number) the property id of the distributed tokens"block": n, // (number) the block the distribution occurred"amount":"n.nnnnnnnn", // (string) the amount that was distributed"recipients": [ // (array of JSON objects) a list of recipients
{
"address":"address", // (string) the address of the recipient"amount":"n.nnnnnnnn"// (string) the amount of fees received by the recipient
},
...
]
}
Example:
$ omnicore-cli "omni_getfeedistribution" 1
omni_getfeedistributions
Obtains data for past distributions of fees for a property.
A property ID must be supplied to retrieve past distributions for.
Arguments:
Name
Type
Presence
Description
propertyid
number
required
the identifier of the property to retrieve past distributions for
Result:
[ // (array of JSON objects)
{
"distributionid": n, // (number) the distribution id"propertyid": n, // (number) the property id of the distributed tokens"block": n, // (number) the block the distribution occurred"amount":"n.nnnnnnnn", // (string) the amount that was distributed"recipients": [ // (array of JSON objects) a list of recipients
{
"address":"address", // (string) the address of the recipient"amount":"n.nnnnnnnn"// (string) the amount of fees received by the recipient
},
...
]
},
...
]
Example:
$ omnicore-cli "omni_getfeedistributions" 31
Configuration
The RPCs for the configuration can be used to alter Omni Core settings.
omni_setautocommit
Sets the global flag that determines whether transactions are automatically committed and broadcasted.
Arguments:
Name
Type
Presence
Description
flag
boolean
required
the flag
Result:
true|false// (boolean) the updated flag status
Example:
$ omnicore-cli "omni_setautocommit"false
Depreciated API calls
To ensure backwards compatibility, depreciated RPCs are kept for at least one major version.
The following calls are replaced in Omni Core 0.0.10, and queries with the old command are forwarded.
send_MP by omni_send
sendtoowners_MP by omni_sendsto
sendrawtx_MP by omni_sendrawtx
getinfo_MP by omni_getinfo
getbalance_MP by omni_getbalance
getallbalancesforid_MP by omni_getallbalancesforid
getallbalancesforaddress_MP by omni_getallbalancesforaddress
gettransaction_MP by omni_gettransaction
listtransactions_MP by omni_listtransactions
listblocktransactions_MP by omni_listblocktransactions
getactivedexsells_MP by omni_getactivedexsells
listproperties_MP by omni_listproperties
getproperty_MP by omni_getproperty
getactivecrowdsales_MP by omni_getactivecrowdsales