[轉]OmniLayer / omnicore API 中文版


本文轉自:https://www.codetd.com/article/1692438

JSON-RPC API

Omni Core是Bitcoin Core的一個分支,其Omni協議功能支持作為頂層的新功能層添加。因此,與API的交互以與Bitcoin Core相同的方式(JSON-RPC)完成,只需使用額外的RPC即可使用Omni協議功能。

由於所有現有的比特幣核心功能都是Omni Core固有的,因此默認情況下RPC端口保持8332與每個比特幣核心一樣。如果您希望與比特幣核心一起運行Omni Core(例如,通過單獨的數據中心),則可以使用該-rpcport<port>選項提名替代端口號。

可以列出所有可用的命令"help",並且可以通過檢索關於特定命令的信息"help <command>"

請注意:本文件可能並不總是最新的。可能存在錯誤,遺漏或不准確之處。

交易創建

用於事務創建的RPC可用於創建和廣播Omni協議事務。

作為結果返回廣播事務的散列。

omn​​i_send

創建並廣播一個簡單的發送事務。

參數:

名稱 類型 存在 描述
fromaddress 需要 要發送的地址
toaddress 需要 接收者的地址
propertyid 需要 要發送的令牌的標識符
amount 需要 要發送的金額
redeemaddress 可選的 一個可以花費交易粉塵的地址(默認發件人)
referenceamount 可選的 發送給接收方的比特幣金額(默認情況下最小)

結果:

hash //(字符串)十六進制編碼的事務散列

例:

$ omnicore-cli  omn​​i_send   3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY   37FaKponF7zqoMLUjEiko25pDiuVH5YLEa ” 1  100.0 

omn​​i_senddexsell

在傳統的分布式OMNI / BTC交易平台上放置,更新或取消賣出報價。

參數:

名稱 類型 存在 描述
fromaddress 需要 要發送的地址
propertyidforsale 需要 要列出待售的代幣的標識符(必須1OMNI2TOMNI
amountforsale 需要 要出售的代幣數量
amountdesired 需要 比特幣的數量
paymentwindow 需要 買方在成功接受訂單后必須支付的時間限制
minacceptfee 需要 買方必須支付接受報價的最低采礦費
action 需要 采取的行動(1對於新的優惠,2更新,3取消)

結果:

hash //(字符串)十六進制編碼的事務散列

例:

$ omnicore-cli  omn​​i_senddexsell   37FaKponF7zqoMLUjEiko25pDiuVH5YLEa ” 1  1.5   0.75 ” 25  0.0005 ” 1

omn​​i_senddexaccept

創建並廣播指定代幣和金額的接受優惠。

參數:

名稱 類型 存在 描述
fromaddress 需要 要發送的地址
toaddress 需要 賣方的地址
propertyid 需要 要購買的令牌的標識符
amount 需要 接受的金額
override 布爾 需要 重寫最低接受費用和支付窗口支票(謹慎使用!)

結果:

hash //(字符串)十六進制編碼的事務散列

例:

$ omnicore-cli  omn​​i_senddexaccept  \ “ 35URq1NN3xL6GeRKUP6vzaQVcxoJiiJKd8 “ 37FaKponF7zqoMLUjEiko25pDiuVH5YLEa ” 1 “ 15.0 

omn​​i_sendissuancecrowdsale

創建新的令牌作為crowdsale。

參數:

名稱 類型 存在 描述
fromaddress 需要 要發送的地址
ecosystem 需要 1主要生態系統,2測試生態系統)中創建令牌的生態系統
type 需要 要創建的令牌的類型:( 1對於不可分的令牌,2可分割的令牌)
previousid 需要 先前標記的標識符(0用於新的廣告銷售)
category 需要 新令牌的類別(可以""
subcategory 需要 新令牌的子類別(可以""
name 需要 要創建的新令牌的名稱
url 需要 有關新令牌的更多信息(可以""
data 需要 新令牌的描述(可以""
propertyiddesired 需要 有資格參與眾包的令牌的標識符
tokensperunit 需要 在眾包中投入的單位授予的令牌數量
deadline 需要 作為Unix時間戳的眾包期限
earlybonus 需要 為參與者提供每周百分比的早期獎金
issuerpercentage 需要 將授予發行人的代幣的百分比

結果:

hash //(字符串)十六進制編碼的事務散列

例:

$ omnicore-cli  omn​​i_sendissuancecrowdsale  \ “ 3JYd75REX3HXn1vAU83YuGfmiPXW7BpYXo ” 2 1 0 “ Companies “ Bitcoin Mining ” \ “ Quantum Miner ” 2 “ 100 ” 1483228800 30 2

omn​​i_sendissuancefixed

創建固定供應的新令牌。

參數:

名稱 類型 存在 描述
fromaddress 需要 要發送的地址
ecosystem 需要 1主要生態系統,2測試生態系統)中創建令牌的生態系統
type 需要 要創建的令牌的類型:( 1對於不可分的令牌,2可分割的令牌)
previousid 需要 先前令牌的標識符(0用於新令牌)
category 需要 新令牌的類別(可以""
subcategory 需要 新令牌的子類別(可以""
name 需要 要創建的新令牌的名稱
url 需要 有關新令牌的更多信息(可以""
data 需要 新令牌的描述(可以""
amount 需要 要創建的令牌的數量
tokensperunit 需要 在眾包中投入的單位授予的令牌數量
deadline 需要 作為Unix時間戳的眾包期限
earlybonus 需要 為參與者提供每周百分比的早期獎金
issuerpercentage 需要 將授予發行人的代幣的百分比

結果:

hash //(字符串)十六進制編碼的事務散列

例:

$ omnicore-cli  omn​​i_sendissuancefixed  \ “ 3Ck2kEGLJtZw9ENj2tameMCtS3HB7uRar3 ” 2 1 0 “ Companies “ Bitcoin Mining ” \ “ Quantum Miner “ 1000000 

omn​​i_sendissuancemanaged

使用可管理的供應創建新的令牌。

參數:

名稱 類型 存在 描述
fromaddress 需要 要發送的地址
ecosystem number required the ecosystem to create the tokens in (1 for main ecosystem, 2 for test ecosystem)
type number required the type of the tokens to create: (1 for indivisible tokens, 2 for divisible tokens)
previousid number required an identifier of a predecessor token (0 for new tokens)
category string required a category for the new tokens (can be "")
subcategory string required a subcategory for the new tokens (can be "")
name string required the name of the new tokens to create
url string required an URL for further information about the new tokens (can be "")
data string required a description for the new tokens (can be "")

Result:

"hash" // (string) the hex-encoded transaction hash

Example:

$ omnicore-cli "omni_sendissuancemanaged" \ "3HsJvhr9qzgRe3ss97b1QHs38rmaLExLcH" 2 1 0 "Companies" "Bitcoin Mining" "Quantum Miner" "" ""

omni_sendsto

Create and broadcast a send-to-owners transaction.

Arguments:

Name Type Presence Description
fromaddress string required the address to send from
propertyid number required the identifier of the tokens to distribute
amount string required the amount to distribute
redeemaddress string optional an address that can spend the transaction dust (sender by default)
distributionproperty number optional the identifier of the property holders to distribute to

Result:

"hash" // (string) the hex-encoded transaction hash

Example:

$ omnicore-cli "omni_sendsto" \ "32Z3tJccZuqQZ4PhJR2hxHC3tjgjA8cbqz" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 3 "5000"

omni_sendgrant

Issue or grant new units of managed tokens.

Arguments:

Name Type Presence Description
fromaddress string required the address to send from
toaddress string required the receiver of the tokens (sender by default, can be "")
propertyid number required the identifier of the tokens to grant
amount string required the amount of tokens to create
memo string optional a text note attached to this transaction (none by default)

Result:

"hash" // (string) the hex-encoded transaction hash

Example:

$ omnicore-cli "omni_sendgrant" "3HsJvhr9qzgRe3ss97b1QHs38rmaLExLcH" "" 51 "7000"

omni_sendrevoke

Revoke units of managed tokens.

Arguments:

Name Type Presence Description
fromaddress string required the address to send from
propertyid number required the identifier of the tokens to revoke
amount string required the amount of tokens to revoke
memo string optional a text note attached to this transaction (none by default)

Result:

"hash" // (string) the hex-encoded transaction hash

Example:

$ omnicore-cli  omn​​i_sendrevoke   3HsJvhr9qzgRe3ss97b1QHs38rmaLExLcH  ” 51  100 

omn​​i_sendclosecrowdsale

手動關閉眾包。

參數:

名稱 類型 存在 描述
fromaddress 需要 與眾包關聯的地址關閉
propertyid 需要 要關閉的眾包標識符

結果:

hash //(字符串)十六進制編碼的事務散列

例:

$ omnicore-cli  omn​​i_sendclosecrowdsale   3JYd75REX3HXn1vAU83YuGfmiPXW7BpYXo ” 70

omn​​i_sendtrade

在分布式令牌交換機上放置交易報價。

參數:

名稱 類型 存在 描述
fromaddress 需要 與之交易的地址
propertyidforsale 需要 標記的標識符以列出待售
amountforsale 需要 要出售的代幣數量
propertiddesired 需要 交換所需令牌的標識符
amountdesired 需要 交換所需的令牌數量

結果:

hash //(字符串)十六進制編碼的事務散列

例:

$ omnicore-cli  omn​​i_sendtrade   3BydPiSLPP3DR5cf726hDQ89fpqWLxPKLR ” 31  250.0 ” 1  10.0 

omn​​i_sendcanceltradesbyprice

以指定價格取消分發令牌交易所的優惠。

參數:

名稱 類型 存在 描述
fromaddress 需要 與之交易的地址
propertyidforsale 需要 待售的令牌的標識符
amountforsale 需要 要出售的代幣數量
propertiddesired 需要 交換所需令牌的標識符
amountdesired 需要 交換所需的令牌數量

結果:

hash //(字符串)十六進制編碼的事務散列

例:

$ omn​​icore-CLI  omn​​i_sendcanceltradesbyprice   3BydPiSLPP3DR5cf726hDQ89fpqWLxPKLR ” 31  100.0 ” 1  5.0 

omn​​i_sendcanceltradesbypair

使用給定的貨幣對取消分發令牌交易的所有優惠。

參數:

名稱 類型 存在 描述
fromaddress 需要 與之交易的地址
propertyidforsale 需要 待售的令牌的標識符
propertiddesired 需要 交換所需令牌的標識符

結果:

hash //(字符串)十六進制編碼的事務散列

例:

$ omnicore-cli "omni_sendcanceltradesbypair" "3BydPiSLPP3DR5cf726hDQ89fpqWLxPKLR" 1 31

omni_sendcancelalltrades

Cancel all offers on the distributed token exchange.

Arguments:

Name Type Presence Description
fromaddress string required the address to trade with
ecosystem number required the ecosystem of the offers to cancel (1 for main ecosystem, 2 for test ecosystem)

Result:

"hash" // (string) the hex-encoded transaction hash

Example:

$ omnicore-cli "omni_sendcancelalltrades" "3BydPiSLPP3DR5cf726hDQ89fpqWLxPKLR" 1

omni_sendchangeissuer

Change the issuer on record of the given tokens.

Arguments:

Name Type Presence Description
fromaddress string required the address associated with the tokens
toaddress string required the address to transfer administrative control to
propertyid number required the identifier of the tokens

Result:

"hash" // (string) the hex-encoded transaction hash

Example:

$ omnicore-cli "omni_sendchangeissuer" \ "1ARjWDkZ7kT9fwjPrjcQyvbXDkEySzKHwu" "3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs" 3

omni_sendall

Transfers all available tokens in the given ecosystem to the recipient.

Arguments:

Name Type Presence Description
fromaddress string required the address to send from
toaddress string required the address of the receiver
ecosystem number required the ecosystem of the tokens to send (1 for main ecosystem, 2 for test ecosystem)
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

Example:

$ omnicore-cli "omni_sendall" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 2

omni_sendenablefreezing

Enables address freezing for a centrally managed property.

Arguments:

Name Type Presence Description
fromaddress string required the address to send from (must be issuer of a managed property)
propertyid number required the identifier of the tokens

Result:

"hash" // (string) the hex-encoded transaction hash

Example:

$ omnicore-cli "omni_sendenablefreezing" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" 2

omni_senddisablefreezing

Disables address freezing for a centrally managed property.

IMPORTANT NOTE: Disabling freezing for a property will UNFREEZE all frozen addresses for that property!

Arguments:

Name Type Presence Description
fromaddress string required the address to send from (must be issuer of a managed property)
propertyid number required the identifier of the tokens

Result:

"hash" // (string) the hex-encoded transaction hash

Example:

$ omnicore-cli "omni_senddisablefreezing" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" 2

omni_sendfreeze

Freeze an address for a centrally managed token.

Note: Only the issuer may freeze tokens, and only if the token is of the managed type with the freezing option enabled.

Arguments:

Name Type Presence Description
fromaddress string required the address to send from (must be issuer of a managed property with freezing enabled
toaddress string required the address to freeze
propertyid number required the identifier of the tokens to freeze
amount string required the amount to freeze (note: currently unused, frozen addresses cannot transact the property)

Result:

"hash" // (string) the hex-encoded transaction hash

Example:

$ omnicore-cli "omni_sendfreeze" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" "3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs" 2 1000

omn​​i_sendunfreeze

解凍集中管理令牌的地址。

注意:只有發行人可以解凍令牌

參數:

名稱 類型 存在 描述
fromaddress 需要 要發送的地址(必須是已啟用凍結的托管財產的發行人
toaddress 需要 地址解凍
propertyid 需要 要解凍的標記的標識符
amount 需要 解凍量(注意:目前未使用

結果:

hash //(字符串)十六進制編碼的事務散列

例:

$ omnicore-cli  omn​​i_sendunfreeze   3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY   3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs ” 2 1000

omn​​i_sendrawtx

廣播原始的Omni Layer交易。

參數:

名稱 類型 存在 描述
fromaddress 需要 要發送的地址
rawtransaction 需要 十六進制編碼的原始事務
referenceaddress 可選的 一個參考地址(默認沒有)
redeemaddress 可選的 一個可以花費交易粉塵的地址(默認發件人)
referenceamount 可選的 發送給接收方的比特幣金額(默認情況下最小)

結果:

hash //(字符串)十六進制編碼的事務散列

例:

$ omnicore-cli  omn​​i_sendrawtx  \ “ 1MCHESTptvd2LnNp7wmr2sGTpRomteAkq8 “ 000000000000000100000000017d7840 ” \ “ 1EqTta1Rt8ixAA32DuC29oukbsSWU62qAV 

數據檢索

用於數據檢索的RPC可用於獲取有關Omni生態系統狀態的信息。

omn​​i_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) }

Example:

$ omnicore-cli "omni_getbalance", "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P" 1

omni_getallbalancesforid

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 }, ... ]

Example:

$ omnicore-cli "omni_getallbalancesforaddress" "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P"

omni_gettransaction

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 }

Example:

$ omnicore-cli "omni_gettransaction" "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"

omni_listtransactions

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 ... ]

Example:

$ omnicore-cli "omni_listblocktransactions" 279007

omni_listpendingtransactions

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)crowdsale的標識符 “ name “ name ”, //(字符串)通過crowdsale發布的標記的名稱 “ active true | 假, //(布爾值)的crowdsale是否仍然是活動的 “發行者“地址”,  propertyiddesired : n, //(數字)有資格參與眾包的令牌標識符 ” tokensperunit ” n.nnnnnnnn “, //(字符串)每個單位投入到眾包中的授予令牌數量 ” earlybonus : n, //(數字)為參與者提供的早期鳥類獎金,以每周百分比為單位 “百分比: n, //(數字)將授予發行人的代幣的百分比 “開始時間: NNNNNNNNNN, //(號碼)的所述crowdsale如Unix時間戳的開始時間 ”期限: NNNNNNNNNN, //(數)crowdsale如Unix時間戳的最后期限 ” amountraised ” n.nnnnnnnn “, //(字符串)參與者投入的令牌數量 “ tokensissued “ n.nnnnnnnn ”, //(字符串)通過眾包發布的令牌總數 “addedissuertokens ” n.nnnnnnnn //(字符串)令牌授予發行人的獎金數額 ” closedearly | 假, //(Boolean)將crowdsale是否提前結束了(如果不活動) ” maxtokens true | false, //(boolean)由於達到最大可發布標記的限制(如果不是活動的), “終止時間: nnnnnnnnnn, //(數字)當crowdsale結束(如果早關閉)時間 “ closetx “散列”, //(串),該關閉crowdsale交易的十六進制編碼的哈希值(如果手動關閉) “ participanttransactions : [ / /(JSON對象數組)眾包參與列表(如果verbose = true) { “ txid “ hash ”,  //(字符串)參與交易的十六進制編碼哈希 “ amountsent “ n.nnnnnnnn ”,  //(字符串)參與者投入的令牌數量 “ participanttokens “ n .nnnnnnnn “,  //(字符串)授予參與者的令牌 ” issuertokens ” n.nnnnnnnn // (串)授予發行人的代幣作為獎金 }, ... ] }

例:

$ omnicore-cli  omn​​i_getcrowdsale ” 3 true

omn​​i_getgrants

返回有關被管理令牌的已授權和已吊銷單位的信息。

參數:

沒有

結果:

{
   “ propertyid : n, //(數字)托管標記的標識符 “ name “ name ”, //(字符串)標記的名稱 “ issuer “ address ”, //(字符串)發行人的Bitcoin地址記錄為 “ creationtxid “ hash ”, //(字符串)十六進制編碼創建事務散列 “totaltokens “ n.nnnnnnnn ”, //(字符串)存在的令牌總數 “ issuances : [ //(JSON對象數組)列出授予和撤銷的令牌 { “ txid “ hash ”,  //(字符串)授予標記的事務的散列 “ grant “ n.nnnnnnnn //(字符串)此事務授予的標記數 }, { “ txid “ hash ”,  //(字符串)撤銷令牌的事務的散列 “ grant “ n.nnnnnnnn //(字符串)此事務撤消的令牌數量 }, ... ] }

參數:

名稱 類型 存在 描述
propertyid 需要 要查找的托管標記的標識符

例:

$ omnicore-cli  omn​​i_getgrants ” 31

omn​​i_getsto

獲取發送至所有者事務的信息和收件人。

參數:

名稱 類型 存在 描述
txid 需要 要查找的交易的散列
recipientfilter 可選的 收件人篩選器(默認"*"為所有錢包)

結果:

{
  "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 }, ... ] }

Example:

$ omnicore-cli "omni_getsto" "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" "*"

omni_gettrade

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 }, ... ] }

Example:

$ omnicore-cli "omni_gettrade" "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"

omni_getorderbook

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

檢索指定市場的分布式令牌交易所的交易歷史。

參數:

名稱 類型 存在 描述
propertyid 需要 交易對的第一面
propertyid 需要 交易對的第二面
count 可選的 交易數量檢索(默認值:10

結果:

[                                      //(JSON對象數組) { “塊: NNNNNN,  //(數)的塊的包含貿易匹配索引 “單價“ n.nnnnnnnnnnn ... ”,  //(字符串)用來執行這個交易的單位價格(接收/賣出) “ inverseprice “ n.nnnnnnnnnnn ... ”,  //(字符串)反向單位價格(出售/收到) “ sellertxid “ hash ”,  //(string)的賣方的交易的散列 “地址“地址”, //(string)的賣方的比特幣地址 “ amountsold “ n.nnnnnnnn ”, //(串)的令牌的數量出售在這個交易中 “ amountreceived “ n.nnnnnnnn ”, //(字符串)交易的交易所交易的代幣數量 “ matchingtxid “散列”, //(字符串)與 “ matchingaddress 匹配的事務的散列值“ address //(字符串)此交易另一方的比特幣地址 }, ... ]

例:

$ omnicore-cli  omn​​i_gettradehistoryforpair ” 1 12 500

omn​​i_gettradehistoryforaddress

檢索分發交換機上提供的地址的訂單歷史記錄。

參數:

名稱 類型 存在 描述
address 需要 地址來檢索歷史
count 可選的 訂單號來檢索(默認值:10
propertyid 可選的 通過propertyid進行過濾事務處理(默認:無過濾器)

結果:

[                                              //(JSON對象數組) { “ TxID添加“散”,  //(字符串)訂單的交易的十六進制編碼的哈希值 “ sendingaddress “地址”,  //(字符串)交易的比特幣地址 “ ismine | false,  //(boolean)訂單是否在錢包 “確認”中 輸入地址: nnnnnnnnnn,  //(數量)交易確認次數 “費用“ n.nnnnnnnn ”, //(字符串)比特幣交易費用 “ blocktime : nnnnnnnnnn, //(數字)包含交易的塊的時間戳 “有效true | false, //(boolean)事務是否有效 “ positioninblock : n, //(number)塊 “版本內事務的位置(索引): n, //(number)事務版本 “ type_int : n, //(數字)事務類型為數字 “ type “ type “, //(字符串)作為字符串 ” propertyidforsale 的交易類型: n, //(數字)出售的令牌的標識符 ”propertyidforsaleisdivisible true | false, //(布爾值)出售令牌是否可分割 ” amountforsale ” n.nnnnnnnn “, //(字符串)最初提供的令牌數量 ” propertyiddesired : n, //(number )交換 “ propertyiddesiredisdivisible 所需的令牌標識符true | false, //(布爾)期望的標記是否可以被整除 “ amountdesired “ n.nnnnnnnn ”, //(字符串)初始期望的標記數量 “ unitprice “ n.nnnnnnnnnnn ... //(字符串)單位價格(在所需屬性中顯示) “ status “ status //(字符串)訂單狀態(“打開”,“取消”,“填充”,...) “ canceltxid “哈希“, //(字符串)取消訂單的事務的散列(如果取消) “ matches : [  //(JSON對象數組)匹配訂單和執行交易的列表 { “ txid “ hash ”,  //(字符串)與 “ block 匹配的事務的散列: nnnnnn,  //(數字)包含此事務的 地址的索引“ address “ address ”,  //(string)的其它交易者的比特幣地址 “ amountsold “ n.nnnnnnnn ”,  //(字符串)在此交易中出售的令牌數量 “ amountreceived “ n.nnnnnnnn //(字符串)交換的令牌數量 }, ... ] }, ... ]

例:

$ omnicore-cli  omn​​i_gettradehistoryforaddress   1MCHESTptvd2LnNp7wmr2sGTpRomteAkq8 

omn​​i_getactivations

返回掛起和完成的功能激活。

結果:

{
   “ pendingactivations : [ //(JSON對象數組)未決特征的激活列表 { "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 }

Example:

$ omnicore-cli "omni_getactivations" "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"

omni_getseedblocks

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, //(數字)此共識散列應用於 “ blockhash 的塊的索引“ hash ”, //(字符串)相應塊的散列 “ consensushash “ hash //(字符串)塊的共識散列 }

例:

$ omnicore-cli  omn​​i_getcurrentconsensushash 

原始交易

原始交易/有效載荷的RPC可用於解碼或創建原始Omni交易。

omn​​i_decodetransaction

解碼Omni事務。

如果交易的輸入不在鏈中,則必須提供它們,因為交易輸入用於識別交易的發送者。

可以提供塊高度,用於確定解析規則。

參數:

名稱 類型 存在 描述
rawtx 需要 原始事務解碼
prevtxs 可選的 事務輸入的JSON數組(默認值:無)
height 可選的 解析塊高度(鏈高度的默認值為0)

格式prevtxs如下:

[
  {
    “ txid “ hash ”,  //(字符串,必需)事務散列 “ vout : n,  //(數字,必需)輸出數字 “ scriptPubKey “ hex ”,  //(字符串,必填)輸出腳本 “值ñ。nnnnnnnn //(數字,必需)輸出值 } ,... ]

結果:

{
   “ txid “ hash ”, //(字符串)交易的十六進制編碼散列 “ fee “ n.nnnnnnnn ”, //(字符串)比特幣交易費用 “ sendingaddress “地址”, //(字符串)發件人 “ referenceaddress 的比特幣地址“地址”, //(字符串)用作參考的比特幣地址(如果有的話) “ ismine true | false,  //(boolean)事務是否在錢包 “版本”中 輸入地址: n,  //(number)事務版本 “ type_int : n,  //(數字)事務類型為數字 “ type “ type ”,  //(字符串)交易類型為字符串 [ ... ]  //(混合)其他交易類型特定屬性 }

例:

$ omn​​icore-CLI  omn​​i_decodetransaction   010000000163af14ce6d477e1c793507e32a5b7696288fa89705c0d02a3f66beb3c \  5b8afee0100000000ffffffff02ac020000000000004751210261ea979f6a06f9dafe00fb1263ea0aca959875a7073556a088cdf \  adcd494b3752102a3fd0a8a067e06941e066f78d930bfc47746f097fcd3f7ab27db8ddf37168b6b52ae22020000000000001976a \  914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ac00000000 ” \ “ [{ \” TxID添加\ “:\” eeafb8c5b3be663f2ad0c00597a88f2896765b2ae30735791c7e476dce14af63 \ “ \” VOUT \”:1,\  scriptPubKey \”\“ 76a9149084c0bd89289bc025d0264f7f23148fb683d56c88ac \”\“ value \”:0.0001123}] 

omn​​i_createrawtx_opreturn

將類C(op-return)編碼的有效載荷添加到事務中。

如果未提供原始交易,則創建新的交易。

如果數據編碼失敗,那么事務不會被修改。

參數:

名稱 類型 存在 描述
rawtx 需要 原始交易延伸(可以null
payload 需要 要添加的十六進制編碼的有效載荷

結果:

“ rawtx //(字符串)十六進制編碼修改的原始事務

例:

$ omnicore-cli "omni_createrawtx_opreturn" "01000000000000000000" "00000000000000020000000006dac2c0"

omni_createrawtx_multisig

Adds a payload with class B (bare-multisig) encoding to the transaction.

If no raw transaction is provided, a new transaction is created.

If the data encoding fails, then the transaction is not modified.

Arguments:

Name Type Presence Description
rawtx string required the raw transaction to extend (can be null)
payload string required the hex-encoded payload to add
seed string required the seed for obfuscation
payload string required a public key or address for dust redemption

Result:

"rawtx" // (string) the hex-encoded modified raw transaction

Example:

$ omnicore-cli "omni_createrawtx_multisig" \ "0100000001a7a9402ecd77f3c9f745793c9ec805bfa2e14b89877581c734c774864247e6f50400000000ffffffff01aa0a00000 \  00000001976a9146d18edfe073d53f84dd491dae1379f8fb0dfe5d488ac00000000" \ "00000000000000020000000000989680" "1LifmeXYHeUe2qdKWBGVwfbUCMMrwYtoMm" \ "0252ce4bdd3ce38b4ebbc5a6e1343608230da508ff12d23d85b58c964204c4cef3"

omni_createrawtx_input

Adds a transaction input to the transaction.

If no raw transaction is provided, a new transaction is created.

Arguments:

Name Type Presence Description
rawtx string required the raw transaction to extend (can be null)
txid string required the hash of the input transaction
n number required the index of the transaction output used as input

Result:

"rawtx" // (string) the hex-encoded modified raw transaction

Example:

$ omnicore-cli "omni_createrawtx_input" \ "01000000000000000000" "b006729017df05eda586df9ad3f8ccfee5be340aadf88155b784d1fc0e8342ee" 0

omni_createrawtx_reference

Adds a reference output to the transaction.

If no raw transaction is provided, a new transaction is created.

The output value is set to at least the dust threshold.

Arguments:

Name Type Presence Description
rawtx string required the raw transaction to extend (can be null)
destination string required the reference address or destination
amount number optional the optional reference amount (minimal by default)

Result:

"rawtx" // (string) the hex-encoded modified raw transaction

Example:

$ omnicore-cli "omni_createrawtx_reference" \ "0100000001a7a9402ecd77f3c9f745793c9ec805bfa2e14b89877581c734c774864247e6f50400000000ffffffff03aa0a00000  00000001976a9146d18edfe073d53f84dd491dae1379f8fb0dfe5d488ac5c0d0000000000004751210252ce4bdd3ce38b4ebbc5a  6e1343608230da508ff12d23d85b58c964204c4cef3210294cc195fc096f87d0f813a337ae7e5f961b1c8a18f1f8604a909b3a51  21f065b52aeaa0a0000000000001976a914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ac00000000" \ "1CE8bBr1dYZRMnpmyYsFEoexa1YoPz2mfB" \ 0.005

omni_createrawtx_change

Adds a change output to the transaction.

提供的輸入不會被添加到事務中,而只會用於確定更改。假定輸入是以前添加的,例如通過"createrawtransaction"

可選地,可以提供一個位置,其中應該插入變化輸出,從開始0。如果輸出的數量小於該位置,則更改輸出將添加到結尾。更改輸出應插入到參考輸出之前,並按照默認值將更改輸出添加到“第一個位置”。

如果更改量將被視為灰塵,則不會添加更改輸出。

參數:

名稱 類型 存在 描述
rawtx 需要 原始交易延伸
prevtxs 需要 事務輸入的JSON數組
destination 需要 變化的目的地
fee 需要 所需的交易費用
position 可選的 更改輸出的位置(默認:第一個位置)

格式prevtxs如下:

[
  {
    “ txid “ hash ”,  //(字符串,必需)事務散列 “ vout : n,  //(數字,必需)輸出數字 “ scriptPubKey “ hex ”,  //(字符串,必填)輸出腳本 “值ñ。nnnnnnnn //(數字,必需)輸出值 } ,... ]

結果:

“ rawtx //(字符串)十六進制編碼修改的原始事務

例:

$ omn​​icore-CLI  omn​​i_createrawtx_change  \ “ 0100000001b15ee60431ef57ec682790dec5a3c0d83a0c360633ea8308fbf6d5fc10a779670400000000ffffffff025c0d00000 \  000000047512102f3e471222bb57a7d416c82bf81c627bfcd2bdc47f36e763ae69935bba4601ece21021580b888ff56feb27f17f \  08802ebed26258c23697d6a462d43fc13b565fda2dd52aeaa0a0000000000001976a914946cb2e08075bcbaf157e47bcb67eb2b2 \  339d24288ac00000000 ” \ “ [{ \” TxID添加\ “:\” 6779a710fcd5f6fb0883ea3306360c3ad8c0a3c5de902768ec57ef3104e65eb1 \ “ \”vout “:4,\\  scriptPubKey \”\“ 76a9147b25205fd98d462880a3e5b0541235831ae959e588ac \”\“ value \”:0.00068257}} “ \  1CE8bBr1dYZRMnpmyYsFEoexa1YoPz2mfB “ 0.000035 1

omn​​i_createpayload_simplesend

為簡單的發送事務創建有效負載。

參數:

名稱 類型 存在 描述
propertyid 需要 要發送的令牌的標識符
amount 需要 要發送的金額

結果:

“ payload //(字符串)十六進制編碼的有效載荷

例:

$ omnicore-cli  omn​​i_createpayload_simplesend ” 1  100.0 

omni_createpayload_sendall

Create the payload for a send all transaction.

Arguments:

Name Type Presence Description
ecosystem number required the ecosystem of the tokens to send (1 for main ecosystem, 2 for test ecosystem)

Result:

"payload" // (string) the hex-encoded payload

Example:

$ omnicore-cli "omni_createpayload_sendall" 2

omni_createpayload_dexsell

Create a payload to place, update or cancel a sell offer on the traditional distributed OMNI/BTC exchange.

Arguments:

Name Type Presence Description
propertyidforsale number required the identifier of the tokens to list for sale (must be 1 for OMNI or 2 for TOMNI)
amountforsale string required the amount of tokens to list for sale
amountdesired string required the amount of bitcoins desired
paymentwindow number required a time limit in blocks a buyer has to pay following a successful accepting order
minacceptfee string required a minimum mining fee a buyer has to pay to accept the offer
action number required the action to take (1 for new offers, 2 to update", 3 to cancel)

Result:

"payload" // (string) the hex-encoded payload

Example:

$ omnicore-cli "omni_createpayload_dexsell" 1 "1.5" "0.75" 25 "0.0005" 1

omni_createpayload_dexaccept

Create the payload for an accept offer for the specified token and amount.

Arguments:

Name Type Presence Description
propertyid number required the identifier of the token to purchase
amount string required the amount to accept

Result:

"payload" // (string) the hex-encoded payload

Example:

$ omnicore-cli "omni_createpayload_dexaccept" 1 "15.0"

omni_createpayload_sto

Creates the payload for a send-to-owners transaction.

Arguments:

Name Type Presence Description
propertyid number required the identifier of the token to distribute
amount string required the amount to distribute
distributionproperty number optional the identifier of the property holders to distribute to

Result:

"payload" // (string) the hex-encoded payload

Example:

$ omnicore-cli "omni_createpayload_sto" 3 "5000"

omni_createpayload_issuancefixed

Creates the payload for a new tokens issuance with fixed supply.

Arguments:

Name Type Presence Description
ecosystem number required the ecosystem to create the tokens in (1 for main ecosystem, 2 for test ecosystem)
type number required the type of the tokens to create: (1 for indivisible tokens, 2 for divisible tokens)
previousid number required an identifier of a predecessor token (use 0 for new tokens)
category string required a category for the new tokens (can be "")
subcategory string required a subcategory for the new tokens (can be "")
name string required the name of the new tokens to create
url string required an URL for further information about the new tokens (can be "")
data string required a description for the new tokens (can be "")
amount string required the number of tokens to create

Result:

"payload" // (string) the hex-encoded payload

Example:

$ omnicore-cli "omni_createpayload_issuancefixed" 2 1 0 "Companies" "Bitcoin Mining" "Quantum Miner" "" "" "1000000"

omni_createpayload_issuancecrowdsale

Creates the payload for a new tokens issuance with crowdsale.

Arguments:

Name Type Presence Description
ecosystem number required the ecosystem to create the tokens in (1 for main ecosystem, 2 for test ecosystem)
type number required the type of the tokens to create: (1 for indivisible tokens, 2 for divisible tokens)
previousid number required an identifier of a predecessor token (use 0 for new tokens)
category string required a category for the new tokens (can be "")
subcategory string required a subcategory for the new tokens (can be "")
name string required the name of the new tokens to create
url string required an URL for further information about the new tokens (can be "")
data string required a description for the new tokens (can be "")
propertyiddesired number required the identifier of a token eligible to participate in the crowdsale
tokensperunit string required the amount of tokens granted per unit invested in the crowdsale
deadline number required the deadline of the crowdsale as Unix timestamp
earlybonus number required an early bird bonus for participants in percent per week
issuerpercentage number required a percentage of tokens that will be granted to the issuer

Result:

"payload" // (string) the hex-encoded payload

Example:

$ omnicore-cli "omni_createpayload_issuancecrowdsale" 2 1 0 "Companies" "Bitcoin Mining" "Quantum Miner" "" "" 2 "100" 1483228800 30 2

omni_createpayload_issuancemanaged

Creates the payload for a new tokens issuance with manageable supply.

Arguments:

Name Type Presence Description
ecosystem number required the ecosystem to create the tokens in (1 for main ecosystem, 2 for test ecosystem)
type number required the type of the tokens to create: (1 for indivisible tokens, 2 for divisible tokens)
previousid number required an identifier of a predecessor token (use 0 for new tokens)
category string required a category for the new tokens (can be "")
subcategory string required a subcategory for the new tokens (can be "")
name string required the name of the new tokens to create
url string required an URL for further information about the new tokens (can be "")
data string required a description for the new tokens (can be "")

Result:

"payload" // (string) the hex-encoded payload

Example:

$ omnicore-cli "omni_createpayload_issuancemanaged" 2 1 0 "Companies" "Bitcoin Mining" "Quantum Miner" "" ""

omni_createpayload_closecrowdsale

Creates the payload to manually close a crowdsale.

Arguments:

Name Type Presence Description
propertyid number required the identifier of the crowdsale to close

Result:

"payload" // (string) the hex-encoded payload

Example:

$ omnicore-cli "omni_createpayload_closecrowdsale" 70

omni_createpayload_grant

Creates the payload to issue or grant new units of managed tokens.

Arguments:

Name Type Presence Description
propertyid number required the identifier of the tokens to grant
amount string required the amount of tokens to create
memo string optional a text note attached to this transaction (none by default)

Result:

"payload" // (string) the hex-encoded payload

Example:

$ omnicore-cli "omni_createpayload_grant" 51 "7000"

omni_createpayload_revoke

Creates the payload to revoke units of managed tokens.

Arguments:

Name Type Presence Description
propertyid number required the identifier of the tokens to revoke
amount string required the amount of tokens to revoke
memo string optional a text note attached to this transaction (none by default)

Result:

"payload" // (string) the hex-encoded payload

Example:

$ omnicore-cli "omni_createpayload_revoke" 51 "100"

omni_createpayload_changeissuer

Creates the payload to change the issuer on record of the given tokens.

Arguments:

Name Type Presence Description
propertyid number required the identifier of the tokens

Result:

"payload" // (string) the hex-encoded payload

Example:

$ omnicore-cli "omni_createpayload_changeissuer" 3

omni_createpayload_trade

Creates the payload to place a trade offer on the distributed token exchange.

Arguments:

Name Type Presence Description
propertyidforsale number required the identifier of the tokens to list for sale
amountforsale string required the amount of tokens to list for sale
propertyiddesired number required the identifier of the tokens desired in exchange
amountdesired string required the amount of tokens desired in exchange

Result:

"payload" // (string) the hex-encoded payload

Example:

$ omnicore-cli  omn​​i_createpayload_trade ” 31  250.0 ” 1  10.0 

omn​​i_createpayload_canceltradesbyprice

創建有效負載以取消具有指定價​​格的分布式令牌交換機上的報價。

參數:

名稱 類型 存在 描述
propertyidforsale 需要 標記的標識符以列出待售
amountforsale 需要 要出售的代幣數量
propertyiddesired 需要 交換所需令牌的標識符
amountdesired 需要 交換所需的令牌數量

結果:

“ payload //(字符串)十六進制編碼的有效載荷

例:

$ omnicore-cli  omn​​i_createpayload_canceltradesbyprice ” 31  100.0 ” 1  5.0 

omn​​i_createpayload_canceltradesbypair

創建有效負載以取消使用給定貨幣對的分布式令牌交換所有報價。

參數:

名稱 類型 存在 描述
propertyidforsale 需要 標記的標識符以列出待售
propertyiddesired 需要 交換所需令牌的標識符

結果:

“ payload //(字符串)十六進制編碼的有效載荷

例:

$ omnicore-cli  omn​​i_createpayload_canceltradesbypair ” 1 31

omn​​i_createpayload_cancelalltrades

創建有效負載以取消使用給定貨幣對的分布式令牌交換所有報價。

參數:

名稱 類型 存在 描述
ecosystem 需要 提供的生態系統取消(主要生態系統1個,測試生態系統2個)

結果:

“ payload //(字符串)十六進制編碼的有效載荷

例:

$ omnicore-cli  omn​​i_createpayload_cancelalltrades ” 1

費用制度

收費系統的RPC可用於獲取有關費用制度和費用分配的數據。

omn​​i_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.

如果提供地址,則結果將被過濾以僅顯示該地址。如果未提供地址,則結果將被過濾以僅顯示錢包地址。如果提供了通配符("*"),則結果將包含將接收共享的所有地址。

如果提供生態系統,結果將反映該生態系統(主要或測試)的費用份額。如果沒有生態系統供應,結果將反映主要生態系統。

參數:

名稱 類型 存在 描述
address 可選的 要過濾結果的地址
ecosystem 可選的 生態系統獲得當前百分比費用份額(1 =主,2 =測試)

結果:

[                                   //(JSON對象數組) { “地址“地址//(字符串)ADRESS,將收到的費用份額 “ feeshare “ n.nnnn%”,  //(字符串)費用的百分比這個地址可以接收基於當前狀態 }, ... ]

例:

$ omnicore-cli  omn​​i_getfeeshare   1CE8bBr1dYZRMnpmyYsFEoexa1YoPz2mfB ” 1

omn​​i_getfeedistribution

獲取過去的費用分配數據。

必須提供分配ID以識別分配以獲取數據。

參數:

名稱 類型 存在 描述
distributionid 需要 要獲取數據的分布的標識符

結果:

{
   “ distributionid : n, //(數字)分配ID “ propertyid : n, //(數字)分配的令牌的屬性ID “ block : n, //(數字)發生分配的塊 “金額” n.nnnnnnnn “, //(字符串)分配金額 ” recipients : [ // (JSON對象數組)收件人列表 { “地址“地址”,  //(字符串)收件人地址 “金額“ n.nnnnnnnn //(字符串)收件人收到的費用金額 }, ... ] }

例:

$ omnicore-cli  omn​​i_getfeedistribution ” 1

omn​​i_getfeedistributions

獲取過去物業費用分布的數據。

必須提供屬性ID才能檢索過去的分配。

參數:

名稱 類型 存在 描述
propertyid 需要 要檢索過去分布的屬性的標識符

結果:

[                                   //(JSON對象數組) { “ distributionid : N,  //(數)分布ID “物業ID : N,  //(號碼)的分布式令牌屬性id “塊: N,  //(號碼)發生的分布的塊 “量” n.nnnnnnnn “,  //(字符串)分配的金額 ” recipients : [  // (JSON對象數組)收件人列表 { “地址“地址”,  //(字符串)收件人地址 “金額“ n.nnnnnnnn //(字符串)收件人收到的費用金額 }, ... ] }, ... ]

例:

$ omnicore-cli  omn​​i_getfeedistributions ” 31

組態

用於配置的RPC可用於更改Omni Core設置。

omn​​i_setautocommit

設置確定事務是否自動提交和廣播的全局標志。

參數:

名稱 類型 存在 描述
flag 布爾 需要 國旗

結果:

true | //(布爾)更新的標志狀態

例:

$ omnicore-cli  omn​​i_setautocommit   false

折舊的API調用

為確保向后兼容,折舊的RPC至少保留一個主要版本。

以下調用在Omni Core 0.0.10中被替換,並且使用舊命令的查詢被轉發。

  • send_MP 通過 omni_send
  • sendtoowners_MP 通過 omni_sendsto
  • sendrawtx_MP 通過 omni_sendrawtx
  • getinfo_MP 通過 omni_getinfo
  • getbalance_MP 通過 omni_getbalance
  • getallbalancesforid_MP 通過 omni_getallbalancesforid
  • getallbalancesforaddress_MP 通過 omni_getallbalancesforaddress
  • gettransaction_MP 通過 omni_gettransaction
  • listtransactions_MP 通過 omni_listtransactions
  • listblocktransactions_MP 通過 omni_listblocktransactions
  • getactivedexsells_MP 通過 omni_getactivedexsells
  • listproperties_MP 通過 omni_listproperties
  • getproperty_MP 通過 omni_getproperty
  • getactivecrowdsales_MP 通過 omni_getactivecrowdsales
  • getcrowdsale_MP 通過 omni_getcrowdsale
  • getgrants_MP 通過 omni_getgrants
  • getsto_MP通過omni_getstoomni_gettransaction

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM