[转]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需要要发送的地址
ecosystemnumberrequiredthe ecosystem to create the tokens in (1 for main ecosystem, 2 for test ecosystem)
typenumberrequiredthe type of the tokens to create: (1 for indivisible tokens, 2 for divisible tokens)
previousidnumberrequiredan identifier of a predecessor token (0 for new tokens)
categorystringrequireda category for the new tokens (can be "")
subcategorystringrequireda subcategory for the new tokens (can be "")
namestringrequiredthe name of the new tokens to create
urlstringrequiredan URL for further information about the new tokens (can be "")
datastringrequireda 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:

NameTypePresenceDescription
fromaddressstringrequiredthe address to send from
propertyidnumberrequiredthe identifier of the tokens to distribute
amountstringrequiredthe amount to distribute
redeemaddressstringoptionalan address that can spend the transaction dust (sender by default)
distributionpropertynumberoptionalthe 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:

NameTypePresenceDescription
fromaddressstringrequiredthe address to send from
toaddressstringrequiredthe receiver of the tokens (sender by default, can be "")
propertyidnumberrequiredthe identifier of the tokens to grant
amountstringrequiredthe amount of tokens to create
memostringoptionala 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:

NameTypePresenceDescription
fromaddressstringrequiredthe address to send from
propertyidnumberrequiredthe identifier of the tokens to revoke
amountstringrequiredthe amount of tokens to revoke
memostringoptionala 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:

NameTypePresenceDescription
fromaddressstringrequiredthe address to trade with
ecosystemnumberrequiredthe 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:

NameTypePresenceDescription
fromaddressstringrequiredthe address associated with the tokens
toaddressstringrequiredthe address to transfer administrative control to
propertyidnumberrequiredthe 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:

NameTypePresenceDescription
fromaddressstringrequiredthe address to send from
toaddressstringrequiredthe address of the receiver
ecosystemnumberrequiredthe ecosystem of the tokens to send (1 for main ecosystem, 2 for test ecosystem)
redeemaddressstringoptionalan address that can spend the transaction dust (sender by default)
referenceamountstringoptionala 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:

NameTypePresenceDescription
fromaddressstringrequiredthe address to send from (must be issuer of a managed property)
propertyidnumberrequiredthe 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:

NameTypePresenceDescription
fromaddressstringrequiredthe address to send from (must be issuer of a managed property)
propertyidnumberrequiredthe 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:

NameTypePresenceDescription
fromaddressstringrequiredthe address to send from (must be issuer of a managed property with freezing enabled
toaddressstringrequiredthe address to freeze
propertyidnumberrequiredthe identifier of the tokens to freeze
amountstringrequiredthe 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:

NameTypePresenceDescription
addressstringrequiredthe address
propertyidnumberrequiredthe 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:

NameTypePresenceDescription
propertyidnumberrequiredthe 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:

NameTypePresenceDescription
addressstringrequiredthe 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:

NameTypePresenceDescription
txidstringrequiredthe 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:

NameTypePresenceDescription
txidstringoptionaladdress filter (default: "*")
countnumberoptionalshow at most n transactions (default: 10)
skipnumberoptionalskip the first n transactions (default: 0)
startblocknumberoptionalfirst block to begin the search (default: 0)
endblocknumberoptionallast 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:

NameTypePresenceDescription
indexnumberrequiredthe 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:

NameTypePresenceDescription
addressstringoptionalfilter 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:

NameTypePresenceDescription
addressstringoptionaladdress 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:

NameTypePresenceDescription
propertyidnumberrequiredthe 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:,

NameTypePresenceDescription
propertyidnumberrequiredthe identifier of the crowdsale
verbosebooleanoptionallist 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 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值