YOYOW平台接入概述

YOYOW 是基于区块链技术的媒体公链, 其目标是建立一个利用区块链技术,使用去中心化的共识方案为内容生产领域实现贡献定价和权益回报的网络,使内容生产者、内容投资者、内容筛选者和生态建设者都能得到合理的激励与回报。 YOYOW专注于底层技术与大的利益分配设定,把更大的自主权分配给接入平台与开发者,平台与开发者无需太多的区块链专业知识,就可以依托YOYOW,建立自己的区块链内容产品。

媒体平台的接入可以获得以下优势:

  • 实现当前业务+区块链的融合,引入合理的激励机制,有效提升用户积极性
  • 可轻松实现资产Token的发行,获得便利的Token变现渠道
  • 可直接获得YOYOW激励
  • 可共享YOYOW当前所有用户

YOYOW 生态简介:

用户角色:

在系统生态中,为了兼顾效率和公平,YOYOW设计了完善的用户体系,主要包括普通用户,平台,理事会,见证人。

普通用户:

普通用户是YOYOW网络的主要参与者,在YOYOW网络中,普通用户在各个平台共享统一的账号体系,拥有转账、选举等权限。

平台:

平台是一类特殊的用户,普通用户抵押一定的YOYO代币可称为平台。
普通用户通过 YOYOW 钱包对平台进行授权,授权平台使用其零钱权限,用于跨站点登陆、对内容评分、发布内容、评论等操作,普通用户也可以随时撤销授权。
接入后,平台可获得YOYOW网络的Token激励。

理事会:

理事会是YOYOW网络中的管理机构,负责发起议案和对议案进行投票表决。议案的内容主要为调整系统数十项可调参数,比如各种交易的费率,最高评分权重等,也包括区块生产间隔时间、区块奖励等。
理事会的人选由YOYOW用户投票产生,用户可随时撤票,来保证理事会决议真正体现多数持币人的意愿。

见证人:

见证人是区块的生产者,负责收集广播的各种交易并打包到区块中,因此见证人生产区块也可以获得相应的 YOYO 代币回报。
见证人包括主力见证人、后备见证人和矿工见证人。

在当前机制下,YOYOW用户可充分行使自己的权利。理事会与见证人均为投票产生,一切以票数说话。用户可通过投票选出愿意参与社区建设、愿意为社区做贡献的账号。同时,每次投票有效期90天,保证了理事会、见证人团队的新鲜活力。

密钥和资产:

密钥体系:

在区块链项目中,私钥是账号的重中之重。然而,当一个用户做任何操作都使用账号私钥签名的话,无疑极大的增加了账号的风险。对于YOYOW而言,考虑到不同权限不同的安全级别,设定了三级密钥体系:主控密钥资金密钥零钱密钥。主控密钥为最高权限密钥,不到不得已的时候不应该使用主控密钥;资金密钥可以操作余额;零钱密钥可以操作零钱,也可以用来发帖,点赞,登陆鉴权等。
通俗来讲:

  1. 主控密钥是核心,若其他低级别密钥丢失,可动用主控密钥重置更新。所以,务必妥善保存,丢失无法找回。
  2. 转账等资金操作,可以动用资金密钥。
  3. 用户授权给平台,只需要授予次级密钥(零钱权限),平台通过这个权限可以代理发帖、点赞及小额转账。

除了跟资产相关的三级密钥,还有一个备注密钥用来加密和查看交易的备注信息。

以上各组密钥,由一对公私钥对组成,公钥为以YYW开头的53个字符,私钥为51个字符。可以通过网页钱包查看各个密钥(详见:yoyow keys tutorial )。比如:

网页钱包密钥截图

资产类型:

YOYOW网络内有三类资产:YOYO代币用户发行资产(IOU),积分

YOYO代币:

在YOYOW的账户里,基础资产为YOYO 代币,有两处可进行存放:『余额』和『零钱』。

  • 余额』拥有较高的安全性,建议大额的YOYO在余额中存储。

  • 零钱』可理解为免密支付,进行小额的存储与转账,当用户授予零钱权限给平台 时,平台甚至可拥有操作”零钱” 的权限。

用户发行资产(IOU):

用户升级为平台账户后,可以发行自定义的资产:根据自身业务,创建在自己平台内流通的Token。后续会提供用户发行资产(IOU)与YOYO之间的便捷兑换方式,共享便捷的变现渠道。

积分:

积分是对YOYO持有者的奖励,当您的账号持有YOYO时,积分可随时间累积。积分积累有上限,您需要手动领取积分。

积分用途:

积分目前唯一用途是抵扣手续费。在支付手续费时,您可以选择通过积分进行抵扣。100积分等价于1 YOYO。 当您账户"余额"部分拥有一定数量的YOYO时,系统会自动为您积累积分。有最高积累上限。

积分使用方法:

积分需要手动领取,可手动将待领取积分领取至您的账户,也可以领取至其他联系人账户,作为奖励赠予。积分也可以租借给其他人使用。 YOYOW引入积分,可以减少普通用户小额手续费(内容发布,点赞等)的支出,增加用户使用的积极性。在其他区块链项目中,对于链上操作,都需要支付不同程度的手续费。 对于YOYOW来讲,此积分体系使用户免费操作成为了可能。

接入流程:

接入流程 接入流程图

注册账号:

申请YOYOW账号需要网页提交注册。网页访问https://wallet.yoyow.org/#/create-account,设置密码,YOYOW会自动返回账户名和账号私钥,账号名为数字UID(yoyo号),私钥为主控密钥。该私钥系统不会保存,且仅在注册成功时出现一次,拥有管理账户的最高权限,请妥善保存,不建议保存到电脑,网盘或云笔记里,可以写到多张纸条上,保存到几个较为稳妥的位置,保证不会丢失,不会泄露。

注册

注册成功

完成注册后,可以在『设置』 -- 『账号』里查看到自己的主控密钥,资金密钥,零钱密钥以及备注密钥。

升级为平台账号

普通账号需要升级成平台账号才能获得用户的授权,升级平台商目前需要抵押10000 YOYO的押金和1000 YOYO的手续费。该操作暂时通过yoyow的client端,通过接口执行create_platform操作,同时设定平台的名称,Token的符号以及相关的url地址和其他一些扩展信息,比如平台提供的api访问接口等。

具体抵押升级平台账号的操作,详见YOYOW中间件yoyow-middleware 的使用教程。

授权认证

YOYOW提供标准的OAuth的授权认证。YOYOW提供了中间件来方便平台进行接入,中间件中提供包括签名平台 (sign),签名验证( verify),以及签名平台返回二维码(signQR)等接口(详见:《yoyow-middleware》#Auth 相关)。平台可以通过SDK中sign或signQR接口生成绑定链接,verify接口验证用户授权。通过授权,平台可以获得用户的零钱管理权限以及登陆授权。
授权流程:

OAuth 流程

注:

  1. 考虑到安全问题,YOYOW中间件 SDK 强烈建议单独部署于内网机器中,不对外开放IP与端口。
  2. YOYOW中间件 SDK 需要零钱权限,使用时,记得修改配置文件中默认的零钱密钥和备注密钥。

资产发行

媒体可以根据需要发行自己的资产,资产的数量和汇率等可以由自己的需求设定。yoyow平台为设定的资产提供流通和交易的便利。
发行的资产暂时通过钱包客户端的create_asset函数操作,需要指定资产的总量,交易的手续费汇率,以及白名单和黑名单等设置。
详见:《YOYOW钱包API》#create_assets

用户激励

平台可根据自身业务需要,指定针对的激励计划。激励的标的,可以为YOYO 或 自己发行的token。
以币问为例,币问已接入YOYOW的网络中,在币问的平台中,系统奖励周期为一周,定期统计一周内用户发表的内容所获得的点赞、点赞能量和评论数等,计算出一个奖励值,根据用户的奖励值的比例,发放YOYO代币。根据用户的活跃度和内容贡献值,用户会有威望的属性,被威望较高的用户点赞,可获得更高的点赞能量,被点赞用户也会获得更高的奖励。 用户可以在网页钱包中将YOYOW提现到其他地方进行交易。
在YOYOW的SDK中提供了transfer操作,可以转出自己的资产(YOYO或者自己创建的资产)分发给平台用户。详见:《yoyow-middleware》#转账到指定用户 transfer

付费阅读/打赏

通过YOYOW网络,平台可方便的接入加密货币的打赏/付费阅读体系。
平台可以基于YOYO资产或自己发行的资产,鼓励用户之间转发交易,构建内容付费阅读和打赏的平台。YoYow提供的区块链服务可以保证用户之间的转发交易安全、不可篡改、公开透明,以此激励用户提供更高质量的内容。
在YOYOW的SDK中提供了transferFromUser,可以支持用户对用户通过平台转账(只可以转出零钱内存放的YOYO代理),同时将转账数据写入YOYOW链上。详见:《yoyow-middleware》#用户对用户通过平台转账

更多:

  1. YOYOW Node SDK :https://github.com/yoyow-org/yoyow-node-sdk.
  2. YOYOW Node SDK 中间件:https://github.com/yoyow-org/yoyow-node-sdk/tree/master/middleware.

联系我们: Yoyow.org

Instructions for Exchanges

We here describe how to interface your exchange with the YOYOW blockchain step-by-step.

Preparation

Hardware

The recommended hardware by now is a VPS with 2GB of RAM and 20GB HDD. Single core is OK.

Supported platforms:

  • Ubuntu 16.04 LTS 64 bit
  • Windows Servers 64 bit

We'll take Ubuntu as an example in this document.

Services

Disable the default time-syncing daemon (timedated) and install NTPD:

sudo timedatectl set-ntp false
sudo apt-get -y install ntp

Account

Register an account with https://wallet.yoyow.org. Instruction is here. Save your account ID number for later use.

Get the private keys of your account. Instruction is here. We'll need 3 keys for integration:

  • Active key: for transferring funds out
  • Secondary key: for collecting points to pay fees
  • Memo key: for encrypting/decrypting memos

Business Logic

An exchange uses an account (or more) for processing deposits/withdrawals.

  • Deposits: assign a unique identifier to every customer, for example salted hash of user ID. Every customer transfer funds to the exchange's account with different identifiers as memo, so the exchange can know a deposit is for which customer.
  • Withdrawals: transfer funds from the exchange's account to an account the customer requested, with an optional memo that the customer may have requested. An optional memo is needed, because some customers may want to withdraw funds to another exchange directly.

Installation

As of writing, only binaries are available for download (link). After downloaded, extract the files.

wget https://github.com/yoyow-org/yoyow-core/releases/download/v0.1.2-171026/yoyow20171026.tgz
tar xzf yoyow20171026.tgz
cd yoyow20171026

Start YOYOW Node

The node need to be always running. One way to archive this is to run it with screen. If you don't have screen, install it:

sudo apt-get -y install screen

Start the node inside screen:

screen -S yoyow_node
./yoyow_node --rpc-endpoint 127.0.0.1:8090

Note:

  1. Start the node with --rpc-endpoint so we can interact with it via RPC call. In the example the node will listen on address 127.0.0.1 and port 8090.
  2. The following parameters indicate how many history records are kept for each account. The default value is 1000. For exchanges, if there are more recharge and withdrawal records, consider setting a larger value, e.g.:
max-ops-per-account = 1000

modify to

max-ops-per-account = 1000000

It will retain one million data. Earlier data is deleted from memory and cannot be queried quickly (but still recorded on the chain).

  1. The following two parameters will greatly reduce the memory required for the operation, the principle is not to save the historical data index that is not related to the exchange account.
track-account = [25638]
partial-operations = true

Please replace "25638" with the account ID you need. Note: The default track-account in config.ini has a "#" symbol and needs to be deleted. If you need to monitor multiple accounts, use the following configuration:

track-account = [25638,25997]
partial-operations = true

The node then will download blocks from the p2p network. When it's done (in sync), in the console there will be new messages showing every 3 seconds, like these:

789216ms th_a       application.cpp:574           handle_block         ] Got block: #355797 00056dd54878c05849e2dcd731c9ee364398b0d2 time: 2017-09-18T19:13:09 latency: 216 ms from: 27662/init8  irreversible: 355787 (-10)
792527ms th_a       application.cpp:574           handle_block         ] Got block: #355798 00056dd613f39f1ad6c0c3fdb00a56c60f44ab1c time: 2017-09-18T19:13:12 latency: 526 ms from: 499381505/yoyo499381505  irreversible: 355788 (-10)

If need to terminate the node, press Ctrl+C, or send SIGINT or SIGTERM signal to the process, then wait for a while, the node will stop by itself.

Start YOYOW Client

First Run

Start another screen session, run yoyow_client inside:

screen -S yoyow_client
./yoyow_client -s ws://127.0.0.1:8090/ -H 127.0.0.1:8091

Note:

  1. Use -s option to connect the client to the node.
  2. Use -H option to start a HTTP-RPC service so we can interact with the client from another process, E.G. a script to process funds deposit/withdrawal.
  3. The node won't start listening on the RPC port until finished replaying, so please be patient in this case.
  4. You can connect multiple clients to one node, but don't use the same -H option.

For the first time when running yoyow_client, after connected to the node, it will show:

Please use the set_password method to initialize a new wallet before continuing
new >>>

So we set a password, it will be used to create and encrypt a wallet file:

new >>> set_password my-password
set_password my-password
null
locked >>>

When there is already a wallet file, if we run yoyow_client, it will show locked >>> as well.

Then we unlock the wallet:

locked >>> unlock my-password
unlock my-password
null
unlocked >>>

Now we import the 3 private keys into the client, they will be encrypted then saved in the wallet file. The syntax is:

import_key [account_ID] [wif_private_key]

Assume your account ID is 123456789, and you have the keys, we need to execute import_key command 3 times, one time for one key. For example:

unlocked >>> import_key 123456789 5Hqwx3xXMYZ55Pko9nzw34234234nXHcGfNQjNEL23424w7Py
import_key 123456789 5Hqwx3xXMYZ55Pko9nzw34234234nXHcGfNQjNEL23424w7Py
2993104ms th_a       wallet.cpp:820                save_wallet_file     ] saving wallet to file wallet.json
true
unlocked >>> import_key 123456789 5JKoYzQ4sYZoDYwreyrsfsd32466MsCFNoxRE23nExaRi6SY3
import_key 123456789 5JKoYzQ4sYZoDYwreyrsfsd32466MsCFNoxRE23nExaRi6SY3
2993104ms th_a       wallet.cpp:820                save_wallet_file     ] saving wallet to file wallet.json
true
unlocked >>> import_key 123456789 5HttjgBSb45368989etfhsserVtt69cWcExteq6RktpAYXNTT
import_key 123456789 5HttjgBSb45368989etfhsserVtt69cWcExteq6RktpAYXNTT
2993104ms th_a       wallet.cpp:820                save_wallet_file     ] saving wallet to file wallet.json
true
unlocked >>>

Command

We can check network status with info command:

unlocked >>> info
info
{
  "head_block_num": 377867,
  "head_block_id": "0005c40b41f6d79d762b1ff81c7affc7ae82a894",
  "head_block_time": "2017-09-18T19:37:39",
  "head_block_age": "0 second old",
  "last_irreversible_block_num": 377857,
  "chain_id": "3505e367fe6cde243f2a1c39bd8e58557e23271dd6cbf4b29a8dc8c44c9af8fe",
  "participation": "100.00000000000000000",
  "active_witnesses": [[
  ...
}

Command

We can get the details of a specified block with get_block command. The syntax is:

get_block [block_number]

For example:

unlocked >>> get_block 1

The get_full_account Command

We can check the account info with get_full_account command:

unlocked >>> get_full_account 123456789
get_full_account 123456789
{
  "account": {
    "uid": 123456789,
    ...
  },
  "statistics": {
    "owner": 123456789,
    "total_ops": 30220,
    "prepaid": 0,
    "csaf": 37424828,
    "core_balance": "44672014515",
    "core_leased_in": 0,
    ...

Note: the "statistics" data is useful for integration.

  • "csaf" is points, which will be used to pay transaction fees. Balances have 5 decimal digits in YOYOW, and the currency is YOYO, so "csaf": 37424828 means 374.24828 YOYO.
  • "core_balance" is balance of the account. "core_balance": "44672014515" means 446,720.14515 YOYO.
  • Please be aware numbers will be surrounded with quotation marks when bigger than 2^32, as shown above for core_balance but not for csaf.

Command

We can use the transfer command to transfer funds. The syntax is:

transfer [from] [to] [amount] YOYO [memo] [broadcast]

For example:

unlocked >>> transfer 123456789 987654321 1.2345 YOYO "thisismemo" true

Note:

  • amount can only have at most 5 decimal digits.
  • if set broadcast to true, the signed transaction will be broadcast to the p2p network. Use false for testing.

The get_transaction_id Command

We can use the get_transaction_id command to get the hash of a transaction. The syntax is:

get_transaction_id [transaction_in_json]

This command is useful for integration.

The get_relative_account_history Command

We can use the get_relative_account_history command to check our transaction history. The syntax is:

get_relative_account_history [account] [operation_type] [start] [limit] [end]

For example:

unlocked >>> get_relative_account_history 123456789 null 1 10 10
unlocked >>> get_relative_account_history 123456789 0 11 10 20

Note:

  • For operation_type, use null to get all operations, use 0 to get transfers only.
  • For end, use 0 to get the most recent records.
  • Result will be in range of [start, end]; if limit is smaller than the number of records in [start, end], the latest records will be returned.
  • Result is sorted in "latest first" order.

The collect_csaf Command

We can use the collect_csaf command to collect points which will be needed to pay transaction fees. The syntax is:

collect_csaf [from_account] [to_account] [amount] YOYO [broadcast]

For example:

unlocked >>> collect_csaf 123456789 123456789 10 YOYO true

Note:

  • If you have some YOYO in your account, it will accumulate points as time goes by. The accumulation speed has a linear relationship with account balance. Usually for exchanges the accumulated points should be enough to pay transaction fees.
  • Points need to be collected before can be used to pay transaction fees, so we have this command.
  • Although funds in balance can be used to pay transaction fees as well in the back end, current implementation of yoyow_client will only try to pay fees with points (except raw-transaction signing). If you don't have enough points in the account, most commands will fail. So it's important to keep a certain amount of points in the account.

How to Close

Press Ctrl+D if the client is running in Ubuntu.

Access the Client via HTTP-RPC

When HTTP-RPC is enabled, we can access the client via HTTP-RPC call. All commands are usable. For example:

curl -d '{"jsonrpc": "2.0", "method": "info", "params": [], "id": 1}' http://127.0.0.1:8091/rpc
curl -d '{"jsonrpc": "2.0", "method": "transfer", "params": [123456789,123456789,"1","YOYO",null,true], "id": 1}' http://127.0.0.1:8091/rpc
curl -d '{"jsonrpc": "2.0", "method": "get_relative_account_history", "params": [123456789,0,1,10,10], "id": 1}' http://127.0.0.1:8091/rpc

Note:

  • Use http as protocol
  • Request /rpc but not /
  • Not like the interactive CLI, the results of HTTP-RPC calls are formatted in json
  • In the request, amounts have 5 decimal digits; in the response, amounts have no decimal point, instead, amounts are multiplied by 10^5.

Process Deposits

Check Node Status

Get the last_irreversible_block_num data with the info command (via HTTP-RPC). Only blocks earlier than this block is reliable.

Check Account History

  1. Firstly, Use get_relative_account_history command/API to get the latest sequence number:
curl -d '{"jsonrpc": "2.0", "method": "get_relative_account_history", "params": [123456789,0,0,1,0], "id": 1}' http://127.0.0.1:8091/rpc

If the result, response["result"] is empty, means we have no deposit at all. If it's not empty, we get response["result"][0]["sequence"] as maximum_sequence.

If maximum_sequence is bigger than the last sequence we've saved, it means there are new records to be processed.

  1. Use get_relative_account_history command/API to check for new records. For example, if last recorded sequence is 100, and maximum_sequence is 200, we can check from 101, for at most 100 records, to 200:
curl -d '{"jsonrpc": "2.0", "method": "get_relative_account_history", "params": [123456789,0,101,100,200], "id": 1}' http://127.0.0.1:8091/rpc

The returned result, result=response["result"], is an array. If the array is empty, it means no new deposit. If it's not empty, the N'th record result[N] should be like:

    {
      "memo": "a1b2c3d4",
      "description": "Transfer 100 YOYO from 204501630 to 123456789 -- Memo: a1b2c3d4   (Fee: 0.20898 YOYO)",
      "sequence": 101,
      "op": {
        "op": [
          0,
          {
            "fee": {
              "total": {
                "amount": 20898,
                "asset_id": 0
              },
              "options": {
                "from_balance": {
                  "amount": 20898,
                  "asset_id": 0
                }
              }
            },
            "from": 204501630,
            "to": 123456789,
            "amount": {
              "amount": 10000000,
              "asset_id": 0
            },
            "memo": {
              "from": "YYW6U528P71X6V87765245356aPBPpDwwRp7urUiXYtFLHmrXRsN3u",
              "to": "YYW5eA89yqwerhdfghrjtr3452376trtyU6LD7a1kmvwYa5h51rDxr",
              "nonce": "3457645755345345",
              "message": "0938457345937abcdef3098945"
            },
            "extensions": {
              "from_balance": {
                "amount": 10000000,
                "asset_id": 0
              },
              "to_balance": {
                "amount": 10000000,
                "asset_id": 0
              }
            }
          }
        ],
        "result": [
          0,
          {
          }
        ],
        "block_timestamp": "2017-09-08T11:14:15",
        "block_num": 223355,
        "trx_in_block": 0,
        "op_in_trx": 0,
        "virtual_op": 8795
      }
    },
  • Get result[N]["op"]["block_num"], if it's smaller than last_irreversible_block_num, then it's reliable, need to be processed.
  • Get result[N]["op"]["op"][0], if it's 0, then it's a transfer. (Although it should always be 0 if we request transfers only)
  • Get result[N]["op"]["op"][1]["to"], if it's same as our account ID, then this transfer is a deposit
  • Check if result[N]["op"]["op"][1]["amount"]["asset_id"] is 0, means it's YOYO asset
  • Get result[N]["op"]["op"][1]["amount"]["amount"], it's the amount. Remember to add the decimal point (5 digits).
  • Get result[N]["memo"], it should have been decrypted already, it's an identifier to the customer, process it.
  • Save result[N]["sequence"] as last processed sequence
  • Get result[N]["op"]["trx_in_block"] for later use
  • Use get_block command/API to get this transfer's transaction ID/Hash (change the parameter to the block_num):
curl -d '{"jsonrpc": "2.0", "method": "get_block", "params": [160000], "id": 1}' http://127.0.0.1:8091/rpc

From the response, new_response, save new_response["result"]["transaction_ids"][trx_in_block] as the transaction ID/hash of this deposit for future use.

Note:

  • To be able to decrypt memo, the client need to be unlocked, and the memo private key need to be in the wallet.

Process Withdrawal Requests

Check Node Status

To be safe, we can only process withdrawal requests when node status is normal.

Check with the info command/API.

  • head_block_time should be no more than 15 seconds old
  • participation should be more than 80, which means 80% of block producers are online

Check Account Balance and Points

Check with the get_full_account command/API.

If points are not enough for paying transaction fee, collect more points with collect_csaf command/API.

Send funds

  1. Use the transfer command/API to send out funds.

Note: take care of decimal digits.

Save the returned json for future use.

  1. Get the transaction ID/hash with get_transaction_id command/API, save it for future use.

Re-check / Follow-up

Similar to the deposit processing steps, when found an outgoing transfer, save the transaction ID/hash, block number and etc for future use.

Trouble shooting

Every transaction has an expiration field. If the transaction hasn't been included in any block for some reason, and the timestamp of block whose number is last_irreversible_block_num is later than the expiration field of the transaction, the transaction won't be included in current chain, so it's safe to try to transfer again.

Sample Code

交易所对接指南(中文)

本文主要介绍交易所对接YOYOW主链的细则。

>准备工作

硬件设备

推荐的硬件配置:4GB内存,20G硬盘,单核CPU 即可

当前支持的平台:

  • Ubuntu 16.04 LTS 64 bit
  • Windows Servers 64 bit

下文以Ubuntu 16.04 为例进行介绍

服务

禁止掉默认的 time-syncing daemon(已过期) ,安装 NTPD:

sudo timedatectl set-ntp false
sudo apt-get -y install ntp

上注册一个YOYOW主网账号。指南请见:这里.

得到账号私钥。指南请见:这里. 我们总共需要3对密钥:

  • 资金密钥: 管理资金进出
  • 零钱密钥:用于收集积分来抵扣手续费
  • 备注密钥:用来加密/解密memos

基本逻辑

交易所可以使用一个或多个账号处理充值/提现。

  • 充值:给每个用户分配一个独立的、唯一的标识,如:用户在交易所平台ID,或对该ID进行hash 等. 任意用户在进行充值时,需在MEMO上填写该唯一标识。交易所因此可以知道此笔充值来自于哪位客户.
  • 提现:从交易所账号中转移资产到用户的账号中,MEMO功能也是必要的,因为用户可能的提现目标为另一家交易所。

安装

请在(此处)下载最新版的可执行文件。下载后,解压文件

https://github.com/yoyow-org/yoyow-core/releases/download/v0.2.1-180313/yoyow-node-v0.2.1-ubuntu-20180313.tgz
https://github.com/yoyow-org/yoyow-core/releases/download/v0.2.1-180313/yoyow-client-v0.2.1-ubuntu-20180313.tgz
tar xzf yoyow-node-v0.2.1-ubuntu-20180313.tgz
tar xzf yoyow-client-v0.2.1-ubuntu-20180313.tgz

启动YOYOW节点

节点程序yoyow_node需要持续运行,可选方案之一为使用screen,安装如下:

sudo apt-get -y install screen

通过 screen启动yoyow_node:

screen -S yoyow_node
./yoyow_node --rpc-endpoint 127.0.0.1:8090

注:

  1. 启动时使用 --rpc-endpoint ,我们就可以通过RPC对其进行调用. 在本例中yoyow_node将监听127.0.0.18090端口。
  2. 以下参数表示每账号保留多少条历史记录供查询,默认值是 1000 。 对交易所来说,如果充值、提现记录较多,可考虑设置成一个较大的值,比如:
max-ops-per-account = 1000

修改为

max-ops-per-account = 1000000

则会保留一百万条数据。更早的数据会从内存中被删除而无法快速查询(但仍然记录在链上)。

  1. 以下两个参数会大量减少运行需要的内存,原理是不保存与交易所账户无关的历史数据索引。
track-account = [25638]
partial-operations = true

请将 "25638" 替换成你需要的账户数字 ID 。 注: config.ini 里默认 track-account 前面有个“#”符号,需要删除。

如果需要监控多个账户,则使用如下配置:

track-account = [25638,25997]
partial-operations = true

节点程序会从P2P网络中下载数据,当数据下载完成后,console里会每3秒钟打印一则新的消息,示意如下:

789216ms th_a       application.cpp:574           handle_block         ] Got block: #355797 00056dd54878c05849e2dcd731c9ee364398b0d2 time: 2017-09-18T19:13:09 latency: 216 ms from: 27662/init8  irreversible: 355787 (-10)
792527ms th_a       application.cpp:574           handle_block         ] Got block: #355798 00056dd613f39f1ad6c0c3fdb00a56c60f44ab1c time: 2017-09-18T19:13:12 latency: 526 ms from: 499381505/yoyo499381505  irreversible: 355788 (-10)

如果需要终止节点程序,Ctrl + C 即可,或者发送 SIGINT or SIGTERM 信号给进程。执行后需要等待少许时间,节点会自动停止。

启动 YOYOW Client

初次使用

启动另一个screen ,在其中运行yoyow_client程序:

screen -S yoyow_client
./yoyow_client -s ws://127.0.0.1:8090/ -H 127.0.0.1:8091

注意:

  1. 使用 -s 来指定,连接到的节点程序的IP与端口
  2. 使用 -H 选项来开启一个HTTP-RPC服务,方便我们其他程序进行访问。如:单独处理充值/提现的脚本程序。
  3. yoyow_node 只有完成同步后,才会监听RPC端口,所以请耐心等待 yoyow_node 同步完成。
  4. 您可以启动多个client 连接同一个yoyow_node。但请注意不要使用相同的-H,会因为端口被占用而监听失败。

当第一次运行yoyow_client时,当其连接上node程序,会打印:

Please use the set_password method to initialize a new wallet before continuing
new >>>

我们需要按如下所示设置密码,程序会自动创建一个加密的钱包文件:

new >>> set_password my-password
set_password my-password
null
locked >>>

当已经存在钱包文件时,如果我们运行yoyow_client程序,它同样会显示locked >>>

此时我们需要解锁钱包:

locked >>> unlock my-password
unlock my-password
null
unlocked >>>

导入3对密钥至client,他们会被加密存储于钱包文件中,命令如下:

import_key [account_ID] [wif_private_key]

如: 您的账号ID是 123456789,且拥有了资金私钥零钱私钥备注私钥。需要执行import_key三次,每次导入1个私钥:

unlocked >>> import_key 123456789 5Hqwx3xXMYZ55Pko9nzw34234234nXHcGfNQjNEL23424w7Py
import_key 123456789 5Hqwx3xXMYZ55Pko9nzw34234234nXHcGfNQjNEL23424w7Py
2993104ms th_a       wallet.cpp:820                save_wallet_file     ] saving wallet to file wallet.json
true
unlocked >>> import_key 123456789 5JKoYzQ4sYZoDYwreyrsfsd32466MsCFNoxRE23nExaRi6SY3
import_key 123456789 5JKoYzQ4sYZoDYwreyrsfsd32466MsCFNoxRE23nExaRi6SY3
2993104ms th_a       wallet.cpp:820                save_wallet_file     ] saving wallet to file wallet.json
true
unlocked >>> import_key 123456789 5HttjgBSb45368989etfhsserVtt69cWcExteq6RktpAYXNTT
import_key 123456789 5HttjgBSb45368989etfhsserVtt69cWcExteq6RktpAYXNTT
2993104ms th_a       wallet.cpp:820                save_wallet_file     ] saving wallet to file wallet.json
true
unlocked >>>

命令: info

可以通过 info 命令,查看网络状态:

unlocked >>> info
info
{
  "head_block_num": 377867,
  "head_block_id": "0005c40b41f6d79d762b1ff81c7affc7ae82a894",
  "head_block_time": "2017-09-18T19:37:39",
  "head_block_age": "0 second old",
  "last_irreversible_block_num": 377857,
  "chain_id": "3505e367fe6cde243f2a1c39bd8e58557e23271dd6cbf4b29a8dc8c44c9af8fe",
  "participation": "100.00000000000000000",
  "active_witnesses": [[
  ...
}

命令: get_block

可通过 get_block 查看某个具体块号的相信信息. 格式如下:

get_block [block_number]

如:

unlocked >>> get_block 1

命令: get_full_account

可通过 get_full_account 命令查看某账号详细信息:

unlocked >>> get_full_account 123456789
get_full_account 123456789
{
  "account": {
    "uid": 123456789,
    ...
  },
  "statistics": {
    "owner": 123456789,
    "total_ops": 30220,
    "prepaid": 0,
    "csaf": 37424828,
    "core_balance": "44672014515",
    "core_leased_in": 0,
    ...

注: 对于接入来讲,"statistics" 数据部分比较有用

  • "csaf" 是『积分』,通过持有YOYOW产生,可以用来抵扣等额的手续费。YOYOW资产的精度为5,单位为YOYO,所以"csaf": 37424828 意味着可抵扣 374.24828 YOYO等额的手续费.
  • "core_balance" 是账号资产的『余额』. "core_balance": "44672014515" 意为该账号余额有 446,720.14515 YOYO.
  • 请留意:若返回值内的数字大于2^32,将会有引号将其引住。如上例中core_balance的值有引号而csaf的值没有

命令 transfer

transfer 命令可以用来转移资产,格式如下:

transfer [from] [to] [amount] YOYO [memo] [broadcast]

如:

unlocked >>> transfer 123456789 987654321 1.2345 YOYO "thisismemo" true

Note:

  • amount 最多只能有5位精度.
  • 如果设置 broadcasttrue, 则签名过的交易会被广播至P2P网络;若为 false 则用来测试,不广播。

命令: get_transaction_id

可以使用 get_transaction_id 命令得到一笔交易的hash值. 格式如下:

get_transaction_id [transaction_in_json]

这个命令在接入中也是很有用的.

命令: get_relative_account_history

可以使用 get_relative_account_history 命令来查看某账号的操作历史,格式如下:

get_relative_account_history [account] [operation_type] [start] [limit] [end]

如:

unlocked >>> get_relative_account_history 123456789 null 1 10 10
unlocked >>> get_relative_account_history 123456789 0 11 10 20

注:

  • 对于 operation_type, 值为 null 时,则返回所有操作类型;为 0 时可获得所有transfer操作.
  • 对于 end, 值为 0 时,可得到最多的最近操作记录.
  • 返回结果的数量会在end - start 范围之内;如果limit值比end - start 要小,则返回满足的条件的最新操作记录。
  • 返回结果的排序方式为: 最新的优先

命令: collect_csaf

可以使用 collect_csaf 命令来收集积分,可用于抵扣各操作的手续费。格式如下:

collect_csaf [from_account] [to_account] [amount] YOYO [broadcast]

如:

unlocked >>> collect_csaf 123456789 123456789 10 YOYO true

注:

  • 如果该账号内有一定数量的YOYO,它将随着时间自动积累积分。积累的速度与账号余额间呈线性关系。通常对于交易所而言,积累的积分足够支付日常手续费用。
  • 积分需要通过该命令领取后才能使用
  • 尽管在底层实现上,账号里的资产(如余额、零钱)同样可以用来支付手续费,但是当前yoyow_client的实现上会只尝试进行积分抵扣手续费(raw-transaction signing除外).如果账号中没有足够的积分,多数的命令会失败。所以保持账号中一定数量的积分是很有必要的。

如何关闭

在Ubuntu下,可以Ctrl + D 来关闭client

通过 HTTP-RPC 接入Client

当 HTTP-RPC 开启的时候,我们可以通过HTTP-RPC 来连接client。所有的上述命令都是可用的,如:

curl -d '{"jsonrpc": "2.0", "method": "info", "params": [], "id": 1}' http://127.0.0.1:8091/rpc
curl -d '{"jsonrpc": "2.0", "method": "transfer", "params": [123456789,123456789,"1","YOYO",null,true], "id": 1}' http://127.0.0.1:8091/rpc
curl -d '{"jsonrpc": "2.0", "method": "get_relative_account_history", "params": [123456789,0,1,10,10], "id": 1}' http://127.0.0.1:8091/rpc

注:

  • 使用 http 协议
  • 请求 /rpc 路径,而不是 /
  • 与交互式CLI不同,HTTP-RPC调用采用json格式
  • 在所有request中,amount 的精度都是5;在response里,amount没有小数点,其数值被乘以了10^5
  • 金额的传入,金额建议使用字符串。建议使用普通的小数格式,比如"12345.6789",如果使用科学计数法的格式比如1.23456789E4这种可能会有问题

处理充值

检查节点状态

通过info命令,得到last_irreversible_block_num.在这个值之前的区块才是可信区块

检查账号历史

  1. 首先,使用 get_relative_account_history 命令/API 来得到最新的 sequence number:
curl -d '{"jsonrpc": "2.0", "method": "get_relative_account_history", "params": [123456789,0,0,1,0], "id": 1}' http://127.0.0.1:8091/rpc

在返回值中,如果response["result"]为空,则意为该账号下目前没有充值进来;若不为空,则,可以取response["result"][0]["sequence"]作为maximum_sequence

如果maximum_sequence比上次存储的最新sequence值更大,则意为有最新的充值记录需要处理

  1. 使用get_relative_account_history命令/API 来检查最新记录。如: 如自行记录的sequence 值为100,maximum_sequence 为200,则我们可以从101开始,请求100个记录,至200结束,参考命令如下:
curl -d '{"jsonrpc": "2.0", "method": "get_relative_account_history", "params": [123456789,0,101,100,200], "id": 1}' http://127.0.0.1:8091/rpc

返回值中, result=response["result"], 则result为数组. 若数组为空,则意味着没有最新的充值请求。若不为空, 则数组的第N个元素 result[N] 格式应该如下:

    {
      "memo": "a1b2c3d4",
      "description": "Transfer 100 YOYO from 204501630 to 123456789 -- Memo: a1b2c3d4   (Fee: 0.20898 YOYO)",
      "sequence": 101,
      "op": {
        "op": [
          0,
          {
            "fee": {
              "total": {
                "amount": 20898,
                "asset_id": 0
              },
              "options": {
                "from_balance": {
                  "amount": 20898,
                  "asset_id": 0
                }
              }
            },
            "from": 204501630,
            "to": 123456789,
            "amount": {
              "amount": 10000000,
              "asset_id": 0
            },
            "memo": {
              "from": "YYW6U528P71X6V87765245356aPBPpDwwRp7urUiXYtFLHmrXRsN3u",
              "to": "YYW5eA89yqwerhdfghrjtr3452376trtyU6LD7a1kmvwYa5h51rDxr",
              "nonce": "3457645755345345",
              "message": "0938457345937abcdef3098945"
            },
            "extensions": {
              "from_balance": {
                "amount": 10000000,
                "asset_id": 0
              },
              "to_balance": {
                "amount": 10000000,
                "asset_id": 0
              }
            }
          }
        ],
        "result": [
          0,
          {
          }
        ],
        "block_timestamp": "2017-09-08T11:14:15",
        "block_num": 223355,
        "trx_in_block": 0,
        "op_in_trx": 0,
        "virtual_op": 8795
      }
    },
  • result[N]["op"]["block_num"], 若比 last_irreversible_block_num小, 意味着是可信的, 需要被处理.
  • result[N]["op"]["op"][0], 如 == 0, 则是一个transfer请求. (实际上肯定会等于0,因为请求参数里已约定只取transfer记录)
  • result[N]["op"]["op"][1]["to"], 验证是否与自身account ID 相同。若相同,即为一个充值请求。
  • result[N]["op"]["op"][1]["amount"]["asset_id"] 验证其是否 == 0, 若是,即表示该资产为YOYO
  • result[N]["op"]["op"][1]["amount"]["amount"], 该值为充值数量. 切记:该数字精度为5.
  • result[N]["memo"], 为该转账记录的MEMO信息。此处已经被解密过了,它可以用来作为充值客户的识别符。
  • 保存 result[N]["sequence"] 作为最新的sequence序号,下一次循环时需使用。
  • 保存 result[N]["op"]["trx_in_block"] 留作后续使用。
  • 使用 get_block 命令/API 来获取此次转账的txid ,如下:(记得修改params值为 block_num):
curl -d '{"jsonrpc": "2.0", "method": "get_block", "params": [160000], "id": 1}' http://127.0.0.1:8091/rpc

记录返回值为 new_response, 保存 new_response["result"]["transaction_ids"][trx_in_block] 作为本次充值的txid 留作后用.

注:

  • 为了保证可以正确解密MEMO,client 需要出于 unlocked状态。同时,memo private key 需要已导入至钱包中

处理提现强求

检查节点状态

安全起见,我们只在节点状态正常的情况下处理提现。 通过info命令/API来检验。

  • head_block_time 应当在15秒以内
  • participation 应大于 80, 意味着80%的区块生产者在线且状态正常。

检查账号资产与积分

使用 get_full_account 命令/API.

如果积分不足以支付网络手续费,请使用collect_csaf命令/API 领取更多积分。

发送资产

  1. 使用 transfer 命令/API 来发送资产.

注: 请注意资产精度.

保存返回的json值供后续使用.

  1. 获取txid通过 get_transaction_id 命令/API, 保存供后续使用.

Re-check / Follow-up

类似于充值的步骤,当发现一个新的transfer,保存txid,block num等信息供后续使用。

故障排查

每笔交易都有expiration字段。如果某笔交易因为某种原因,没有被打包到任意块中,且不可逆区块(last_irreversible_block_num)的时间戳比交易的expiration字段还要晚。则该笔交易不会打包在当前这条链上,此时尝试重新转账是安全的。

示例代码

节点API说明

节点连接方式

测试环境:

websocket 接口地址: ws://47.52.155.181:10011
jsonrpc 接口地址: http://47.52.155.181:10011/rpc

正式环境:

websocket 接口地址:ws://139.198.1.234:9000
jsonrpc 接口地址: http://139.198.1.234:9000/rpc
使用wscat连接, wscat安装方法
wscat -c ws://47.52.155.181:10011
使用curl post data 连接
curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_accounts_by_uid", "250926091"], "id": 1}' http://47.52.155.181:10011/rpc

API分类

YOYOW的API分类与BTS类似,以下重点介绍database api和history api。 在通过websocket 请求时,参数为一个json字符串,格式如下:

{"id":1, "method":"call", "params":[API等级,"函数名",[具体参数]]}

在使用时,需要填写API等级,函数名,和具体参数3项,其中API等级可以通过websocket 发送

{"id":2, "method":"call", "params":[1,"history",[]]}

来获取。比如以上请求会返回:

{
  "id": 2,
  "jsonrpc": "2.0",
  "result": 2
}

其中result 为 2,代表着使用history api 时,API等级需要填写2.(注意:不一定每个YOYOW节点都返回同样的配置,这取决于每个节点对暴露API的限制)

database的API默认可以直接通过指定API等级为0来调用,也可以使用通过

{"id":2, "method":"call", "params":[1,"database",[]]}

查询到的result的值来调用。

database API

1.1.1 get_required_signatures

根据给定的交易(可能已包含签名),和给定的备用公钥集合,返回与签署该交易有关的 3 个集合:

备用公钥集合的一个可用子集,可以用来签署该交易
可能还需要的公钥(不在签名中,也不在备用公钥集合中)
交易中已包含的多余签名

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

trx: 交易,可能已包含签名
available_keys: 公钥的数组 例如:["YYW5eDSFYeiqyFRajfPP8tTZMm7fUeyc7H65zmnHtDW4SQJdwqTBD"]

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0,"get_required_signatures",[{"operations":[[0,{"fee":{"total":{"amount":100000,"asset_id":0}},"from":250926091,"to":223331844,"amount":{"amount":100000,"asset_id":0},"extensions":{}}]]}, ["YYW5eDSFYeiqyFRajfPP8tTZM7mfUeyc7H65zmnHtDW4SQJdwqTBD"]]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_accounts_by_uid", [{"operations":[[0,{"fee":{"total":{"amount":100000,"asset_id":0}},"from":250926091,"to":223331844,"amount":{"amount":100000,"asset_id":0},"extensions":{}}]]}, ["YYW5eDSFYeiqyFRajfPP8tTZM7mfUeyc7H65zmnHtDW4SQJdwqTBD"]]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    [
      [
        "YYW5eDSFYeiqyFRajfPP8tTZM7mfUeyc7H65zmnHtDW4SQJdwqTBD"
      ],  //备用公钥集合的一个可用子集,可以用来签署该交易
      [
        "YYW6fU7Th8uESW9FZnpkhYaTUwtSvn3f2TQxFVA3ef2SSiwdZES71",
        "YYW7UoNSEQAUPvnvoBRVKyPAD9845esnpiK6MgHinsn5yqr5UgT5W"
      ] //还需要的公钥(不在签名中,也不在备用公钥集合中)
    ],
    []  // 交易中已包含的多余签名
  ]
}

1.1.2 get_accounts_by_uid

根据 uid 返回多个账号信息。数量必须 <= 1000。

如果该 uid 不存在,对应位置结果为 null 。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

account_uids: uid数组,长度小于1000 例如:["250926091"]

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0,"get_accounts_by_uid",[["250926091"]]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_accounts_by_uid", [["250926091"]]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
    {
        "id": "1.2.1378",
        "uid": 250926091,
        "name": "yoyo250926091",
        "owner":
        {
            "weight_threshold": 1,
            "account_uid_auths": [],
            "key_auths": [
                ["YYW7UoNSEQAUPvnvoBRVKyPAD9845esnpiK6MgHinsn5yqr5UgT5W", 1]
            ]
        },
        "active":
        {
            "weight_threshold": 1,
            "account_uid_auths": [],
            "key_auths": [
                ["YYW6fU7Th8uESW9FZnpkhYaTUwtSvn3f2TQxFVA3ef2SSiwdZES71", 1]
            ]
        },
        "secondary":
        {
            "weight_threshold": 1,
            "account_uid_auths": [],
            "key_auths": [
                ["YYW5eDSFYeiqyFRajfPP8tTZM7mfUeyc7H65zmnHtDW4SQJdwqTBD", 1]
            ]
        },
        "memo_key": "YYW7SpC4QLY1LRRxFQ2hbYHdAyQo88L8qnPJcDJkiRMugcnFGUGvo",
        "reg_info":
        {
            "registrar": 206336051,
            "referrer": 25997,
            "registrar_percent": 0,
            "referrer_percent": 0,
            "allowance_per_article":
            {
                "amount": 0,
                "asset_id": 0
            },
            "max_share_per_article":
            {
                "amount": 0,
                "asset_id": 0
            },
            "max_share_total":
            {
                "amount": 0,
                "asset_id": 0
            },
            "buyout_percent": 10000
        },
        "can_post": true,
        "can_reply": false,
        "can_rate": false,
        "is_full_member": true,
        "is_registrar": false,
        "is_admin": false,
        "create_time": "2018-04-03T08:21:00",
        "last_update_time": "2018-04-03T08:21:00",
        "active_data": "{}",
        "secondary_data": "{}",
        "statistics": "2.5.1378"
    }]
}

1.1.3 get_account_balances

根据 uid和资产类型查询资产余额。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

uid: uid,例如:"250926091"
assets: 资产种类id的列表,0代表核心资产。例如:[0,1]。如果该值为空([]) 则返回该账户里的所有资产余额

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0,"get_account_balances",["250926091", [0,1]]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_account_balances", ["250926091", [0,1]]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
    {
        "amount": 1099970704,
        "asset_id": 0
    },
    {
        "amount": 0,
        "asset_id": 1
    }]
}

1.1.4 get_post

根据平台所有者 uid 、发帖者 uid 、帖子 pid 返回帖子信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

platform_owner: 平台owner的id
poster_uid: poster的id
post_pid: post的id 例如:1

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0,"get_post",["223331844",223331844,0,1]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_post", [["250926091"]]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "id": "1.7.14",
    "platform": 223331844,
    "poster": 223331844,
    "post_pid": 1,
    "hash_value": "asdfasdfasdfasdf",
    "extra_data": "{}",
    "title": "post a",
    "body": "post b",
    "create_time": "2018-05-03T12:40:39",
    "last_update_time": "2018-05-03T12:40:39"
  }
}

1.1.5 get_posts_by_platform_poster

根据平台所有者 uid 、 发帖者 uid 、发帖时间段 查询帖子列表。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

platform_owner: 平台owner的id
poster_uid: poster的id。poster_uid可以为 null ,此时查询所有用户的帖子。
create_time_range: 限制时间段,由两个时间点组成,先后不限,查询范围为 最早时间 < 发帖时间 <= 最晚时间
limit: 限制条数,不能超过 100

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0,"get_posts_by_platform_poster",[223331844, null, ["2018-04-03T12:42:36","2018-05-03T12:42:36"], 100]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_accounts_by_uid", [223331844, null, ["2018-04-03T12:42:36","2018-05-03T12:42:36"], 100]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

结果按时间排序,最新的排最前。时间相同的,按实际入块顺序,后入块的排在前面。

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "id": "1.7.14",
      "platform": 223331844,
      "poster": 223331844,
      "post_pid": 1,
      "hash_value": "asdfasdfasdfasdf",
      "extra_data": "{}",
      "title": "post a",
      "body": "post b",
      "create_time": "2018-05-03T12:40:39",
      "last_update_time": "2018-05-03T12:40:39"
    }
  ]
}

1.1.6 get_required_fee_data

给定一组操作,返回操作需要的手续费信息。该 API 只支持核心资产。

其中,

required_fee_data
{
   account_uid_type fee_payer_uid; // 付费人 uid
   int64_t          min_fee;       // 最低总费用,单位是核心资产去掉小数点后的值(与 asset 类型用法相同);
   int64_t          min_real_fee;  // 最低真实费用(不能用币天抵扣的部分),单位同上
};

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

ops: uid数组,长度小于1000 例如:["250926091"]

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "get_required_fee_data", [[[0,{"fee":{"total":{"amount":200000,"asset_id":0},"options":{"from_balance":{"amount":200000,"asset_id":0}}},"from":236542328,"to":228984329,"amount":{"amount":100000,"asset_id":0},"extensions":{"from_balance":{"amount":100000,"asset_id":0},"to_balance":{"amount":100000,"asset_id":0}}}]]]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_required_fee_data", [[[0,{"fee":{"total":{"amount":200000,"asset_id":0},"options":{"from_balance":{"amount":200000,"asset_id":0}}},"from":236542328,"to":228984329,"amount":{"amount":100000,"asset_id":0},"extensions":{"from_balance":{"amount":100000,"asset_id":0},"to_balance":{"amount":100000,"asset_id":0}}}]]]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "fee_payer_uid": 236542328,
      "min_fee": 20000,
      "min_real_fee": 0
    }
  ]
}

1.1.7 get_full_accounts_by_uid

根据一组账户 uid 获取对应信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

uids: uid数组,长度小于1000 例如:["250926091"]
options: options 数组

Options 数组可以有如下参数

{
optional fetch_account_object;
optional fetch_statistics;
optional fetch_csaf_leases_in;
optional fetch_csaf_leases_out;
optional fetch_voter_object;
optional fetch_witness_object;
optional fetch_witness_votes;
optional fetch_committee_member_object;
optional fetch_committee_member_votes;
optional fetch_platform_object;
optional fetch_platform_votes;
optional fetch_assets;
optional fetch_balances;
}

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "get_full_accounts_by_uid", [["250926091"],{}]]}

{"id":1, "method":"call", "params":[0, "get_full_accounts_by_uid", [["223331844"],{"fetch_assets": true}]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_full_accounts_by_uid", [["250926091"],{}]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        [250926091,
        {
            "account":
            {
                "id": "0.0.0",
                "uid": 0,
                "name": "",
                "owner":
                {
                    "weight_threshold": 0,
                    "account_uid_auths": [],
                    "key_auths": []
                },
                "active":
                {
                    "weight_threshold": 0,
                    "account_uid_auths": [],
                    "key_auths": []
                },
                "secondary":
                {
                    "weight_threshold": 0,
                    "account_uid_auths": [],
                    "key_auths": []
                },
                "memo_key": "YYW1111111111111111111111111111111114T1Anm",
                "reg_info":
                {
                    "registrar": 1264,
                    "referrer": 1264,
                    "registrar_percent": 0,
                    "referrer_percent": 0,
                    "allowance_per_article":
                    {
                        "amount": 0,
                        "asset_id": 0
                    },
                    "max_share_per_article":
                    {
                        "amount": 0,
                        "asset_id": 0
                    },
                    "max_share_total":
                    {
                        "amount": 0,
                        "asset_id": 0
                    },
                    "buyout_percent": 10000
                },
                "can_post": true,
                "can_reply": false,
                "can_rate": false,
                "is_full_member": false,
                "is_registrar": false,
                "is_admin": false,
                "create_time": "1970-01-01T00:00:00",
                "last_update_time": "1970-01-01T00:00:00",
                "active_data": "{}",
                "secondary_data": "{}",
                "statistics": "2.5.0"
            },
            "statistics":
            {
                "id": "0.0.0",
                "owner": 31120496,
                "total_ops": 0,
                "removed_ops": 0,
                "prepaid": 0,
                "csaf": 0,
                "core_balance": 0,
                "core_leased_in": 0,
                "core_leased_out": 0,
                "average_coins": 0,
                "average_coins_last_update": "1970-01-01T00:00:00",
                "coin_seconds_earned": "0",
                "coin_seconds_earned_last_update": "1970-01-01T00:00:00",
                "total_witness_pledge": 0,
                "releasing_witness_pledge": 0,
                "witness_pledge_release_block_number": 4294967295,
                "last_witness_sequence": 0,
                "uncollected_witness_pay": 0,
                "witness_last_confirmed_block_num": 0,
                "witness_last_aslot": 0,
                "witness_total_produced": 0,
                "witness_total_missed": 0,
                "witness_last_reported_block_num": 0,
                "witness_total_reported": 0,
                "total_committee_member_pledge": 0,
                "releasing_committee_member_pledge": 0,
                "committee_member_pledge_release_block_number": 4294967295,
                "last_committee_member_sequence": 0,
                "can_vote": true,
                "is_voter": false,
                "last_voter_sequence": 0,
                "last_platform_sequence": 0,
                "total_platform_pledge": 0,
                "releasing_platform_pledge": 0,
                "platform_pledge_release_block_number": 4294967295,
                "last_post_sequence": 0
            },
            "csaf_leases_in": [],
            "csaf_leases_out": [],
            "witness_votes": [],
            "committee_member_votes": []
        }]
    ]
}

返回字段说明

返回 map 中 full_account 的结构定义为:

full_account
{
   account;                   // 账户基本信息
   statistics;                // 账户动态信息
   csaf_leases_in;            // 手续费币龄借入明细
   csaf_leases_out;           // 手续费币龄借出明细
   voter;                     // 账户投票信息汇总
   witness;                   // 见证人信息
   witness_votes;             // 见证人投票明细(投出票)
   committee_member;          // 候选理事信息
   committee_member_votes;    // 理事会选举投票明细(投出票)
   platform;                  // 该账户拥有的平台信息
   platform_votes;            // 平台投票明细(投出票)
   assets;                    // 该账户为资产发行人的资产类型 id 清单
   balances;                  // 余额表

};

1.1.8 get_witness_by_account

给定一个账户的 uid ,返回对应的见证人信息

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

account: uid数组,长度小于1000 例如:["250926091"]

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0,"get_witness_by_account",["132826789"]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_witness_by_account", ["132826789"], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result":
    {
        "id": "1.5.31",
        "account": 132826789,
        "name": "yoyo132826789",
        "sequence": 1,
        "is_valid": true,
        "signing_key": "YYW1111111111111111111111111111111114T1Anm",
        "pledge": "7500000000",
        "pledge_last_update": "2017-09-05T11:39:03",
        "average_pledge": "7500000000",
        "average_pledge_last_update": "2017-09-06T12:05:36",
        "average_pledge_next_update_block": 4294967295,
        "total_votes": 719683655,
        "by_pledge_position": "0",
        "by_pledge_position_last_update": "0",
        "by_pledge_scheduled_time": "45370982250075664161773192435",
        "by_vote_position": "0",
        "by_vote_position_last_update": "0",
        "by_vote_scheduled_time": "472822140789228182032488184547",
        "last_confirmed_block_num": 8168,
        "last_aslot": 8599,
        "total_produced": 25,
        "total_missed": 0,
        "url": ""
    }
}

返回字段说明

只有当 options 中对应选项为 true 时,返回结果中才包含对应字段数据。 其中,币龄借入明细、借出明细只返回前 100 条

如果 uid 不存在,则返回 map 中没有相应 uid 。

1.1.9 get_witnesses

给定一组 uid ,返回对应的见证人信息

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

account_uids: uid数组,例如:[132826789,25997]

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "get_witnesses", [[132826789,25997]]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_witnesses", [[132826789,25997]]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
    {
        "id": "1.5.31",
        "account": 132826789,
        "name": "yoyo132826789",
        "sequence": 1,
        "is_valid": true,
        "signing_key": "YYW1111111111111111111111111111111114T1Anm",
        "pledge": "7500000000",
        "pledge_last_update": "2017-09-05T11:39:03",
        "average_pledge": "7500000000",
        "average_pledge_last_update": "2017-09-06T12:05:36",
        "average_pledge_next_update_block": 4294967295,
        "total_votes": 719683655,
        "by_pledge_position": "0",
        "by_pledge_position_last_update": "0",
        "by_pledge_scheduled_time": "45370982250075664161773192435",
        "by_vote_position": "0",
        "by_vote_position_last_update": "0",
        "by_vote_scheduled_time": "472822140789228182032488184547",
        "last_confirmed_block_num": 8168,
        "last_aslot": 8599,
        "total_produced": 25,
        "total_missed": 0,
        "url": ""
    },
    {
        "id": "1.5.1",
        "account": 25997,
        "name": "init1",
        "sequence": 1,
        "is_valid": true,
        "signing_key": "YYW71suPihtG7jJAGiVBCkd63ECHYebQaPa894oy3r54zk3eM1itt",
        "pledge": 1000000000,
        "pledge_last_update": "2017-09-12T21:02:45",
        "average_pledge": 1000000000,
        "average_pledge_last_update": "2017-09-13T21:20:30",
        "average_pledge_next_update_block": 4294967295,
        "total_votes": 0,
        "by_pledge_position": "0",
        "by_pledge_position_last_update": "0",
        "by_pledge_scheduled_time": "340282366580656096882718510549",
        "by_vote_position": "0",
        "by_vote_position_last_update": "0",
        "by_vote_scheduled_time": "340282366920938463463374607431768211455",
        "last_confirmed_block_num": 5937330,
        "last_aslot": 6308879,
        "total_produced": 513249,
        "total_missed": 32165,
        "url": ""
    }]
}

1.1.10 lookup_witnesses

列出当前有效的见证人清单。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

lower_bound_uid: 以此作为起始 uid 开始查询,设为 0 则从头开始查
limit: 返回数量限制,最多不能超过 101
ops: 排序类型; 取值范围[0,1,2]。 0:按uid由大到小排序;1:按得票数从多到少排序;2:按抵押从多到少排序

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "lookup_witnesses", [0,2,1]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "lookup_witnesses", [0,2,1]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
    {
        "id": "1.5.31",
        "account": 132826789,
        "name": "yoyo132826789",
        "sequence": 1,
        "is_valid": true,
        "signing_key": "YYW1111111111111111111111111111111114T1Anm",
        "pledge": "7500000000",
        "pledge_last_update": "2017-09-05T11:39:03",
        "average_pledge": "7500000000",
        "average_pledge_last_update": "2017-09-06T12:05:36",
        "average_pledge_next_update_block": 4294967295,
        "total_votes": 701297305,
        "by_pledge_position": "0",
        "by_pledge_position_last_update": "0",
        "by_pledge_scheduled_time": "45370982250075664161773192435",
        "by_vote_position": "0",
        "by_vote_position_last_update": "0",
        "by_vote_scheduled_time": "485218414514968154552378399456",
        "last_confirmed_block_num": 8168,
        "last_aslot": 8599,
        "total_produced": 25,
        "total_missed": 0,
        "url": ""
    },
    {
        "id": "1.5.1",
        "account": 25997,
        "name": "init1",
        "sequence": 1,
        "is_valid": true,
        "signing_key": "YYW71suPihtG7jJAGiVBCkd63ECHYebQaPa894oy3r54zk3eM1itt",
        "pledge": 1000000000,
        "pledge_last_update": "2017-09-12T21:02:45",
        "average_pledge": 1000000000,
        "average_pledge_last_update": "2017-09-13T21:20:30",
        "average_pledge_next_update_block": 4294967295,
        "total_votes": 0,
        "by_pledge_position": "0",
        "by_pledge_position_last_update": "0",
        "by_pledge_scheduled_time": "340282366580656096882718510549",
        "by_vote_position": "0",
        "by_vote_position_last_update": "0",
        "by_vote_scheduled_time": "340282366920938463463374607431768211455",
        "last_confirmed_block_num": 5935462,
        "last_aslot": 6307011,
        "total_produced": 513079,
        "total_missed": 32165,
        "url": ""
    }]
}

1.1.11 get_committee_member_by_account

给定一个 uid ,返回对应的候选理事信息

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

account: uid 例如:"250926091"

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "get_committee_member_by_account", [25997]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_committee_member_by_account", [25997], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result":
    {
        "id": "1.4.0",
        "account": 25997,
        "name": "init1",
        "sequence": 1,
        "is_valid": true,
        "pledge": 0,
        "total_votes": 0,
        "url": ""
    }
}

1.1.12 get_committee_members

根据一组账户 uid 获取对应信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

committee_member_uids: uid数组 例如:[25997,26264]

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "get_committee_members", [[25997,26264]]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_committee_members", [[25997,26264]]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
    {
        "id": "1.4.0",
        "account": 25997,
        "name": "init1",
        "sequence": 1,
        "is_valid": true,
        "pledge": 0,
        "total_votes": 0,
        "url": ""
    },
    {
        "id": "1.4.1",
        "account": 26264,
        "name": "init2",
        "sequence": 1,
        "is_valid": true,
        "pledge": 0,
        "total_votes": 0,
        "url": ""
    }]
}

1.1.13 lookup_committee_members

列出当前有效的候选理事清单

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

lower_bound_uid: 以此作为起始 uid 开始查询,设为 0 则从头开始查
limit: 返回数量限制,最多不能超过 101
ops: 排序类型取值范围[0,1,2]。 0:按uid由大到小排序;1:按得票数从多到少排序;2:按抵押从多到少排序

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "lookup_committee_members", [0,2,1]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "lookup_committee_members", [0,2,1]], "id": 1}'

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
    {
        "id": "1.4.0",
        "account": 25997,
        "name": "init1",
        "sequence": 1,
        "is_valid": true,
        "pledge": 0,
        "total_votes": 0,
        "url": ""
    },
    {
        "id": "1.4.1",
        "account": 26264,
        "name": "init2",
        "sequence": 1,
        "is_valid": true,
        "pledge": 0,
        "total_votes": 0,
        "url": ""
    }]
}

1.1.14 list_committee_proposals

列出所有尚未成功执行的理事会提案,包含正在投票表决的、已表决通过但还没到执行时间的。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "list_committee_proposals", []]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "list_committee_proposals", []], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": []
}

1.1.15 lookup_accounts_by_name

根据名称查找账号UID。 普通账户名称目前为yoyo+uid

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

lower_bound_name: 以此作为起始名称开始查询,设为空串则从头开始查
limit: 返回数量限制,最多不能超过 1001

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "lookup_accounts_by_name", ["",2]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "lookup_accounts_by_name", ["",2]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        ["abit", 209414065],
        ["agaoye", 209415129]
    ]
}

1.1.16 get_platform_by_account

给定一个 uid ,返回对应的账户拥有的平台信息

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

account: 一个账户 uid

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "get_platform_by_account", [224006453]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_platform_by_account", [224006453]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "id": "1.6.4",
    "owner": 224006453,
    "name": "dwgMarket",
    "sequence": 1,
    "is_valid": true,
    "total_votes": 0,
    "url": "www.cad1688.com",
    "pledge": 1000000000,
    "pledge_last_update": "2018-04-04T08:38:24",
    "average_pledge": 0,
    "average_pledge_last_update": "2018-04-04T08:38:24",
    "average_pledge_next_update_block": 5712088,
    "extra_data": "{}",
    "create_time": "2018-04-04T08:38:24",
    "last_update_time": "1970-01-01T00:00:00"
  }
}

1.1.17 get_platforms

给定一组 uid ,返回对应的平台信息,uid为平台的所有者id

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

account_uids: uid 列表 [224006453,217895094]

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "get_platforms", [[224006453,217895094]]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_platforms", [[224006453,217895094]]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
    {
        "id": "1.6.4",
        "owner": 224006453,
        "name": "dwgMarket",
        "sequence": 1,
        "is_valid": true,
        "total_votes": 0,
        "url": "www.cad1688.com",
        "pledge": 1000000000,
        "pledge_last_update": "2018-04-04T08:38:24",
        "average_pledge": 0,
        "average_pledge_last_update": "2018-04-04T08:38:24",
        "average_pledge_next_update_block": 5712088,
        "extra_data": "{}",
        "create_time": "2018-04-04T08:38:24",
        "last_update_time": "1970-01-01T00:00:00"
    },
    {
        "id": "1.6.0",
        "owner": 217895094,
        "name": "test-yoyow",
        "sequence": 1,
        "is_valid": true,
        "total_votes": 0,
        "url": "http://demo.yoyow.org/",
        "pledge": 1000000000,
        "pledge_last_update": "2018-02-10T01:03:57",
        "average_pledge": 176601774,
        "average_pledge_last_update": "2018-02-11T06:49:12",
        "average_pledge_next_update_block": 4562164,
        "extra_data": "{\"login\":\"http://192.168.1.184:8280/login\"}",
        "create_time": "2018-02-10T01:03:57",
        "last_update_time": "2018-02-11T06:49:12"
    }]
}

1.1.18 lookup_platforms

按平台拥有者进行查询,列出当前有效的平台清单。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

lower_bound_uid: 以此作为起始 uid 开始查询,设为 0 则从头开始查
limit: 返回数量限制,最多不能超过 101
ops: 排序类型取值范围[0,1,2]。 0:按uid由大到小排序;1:按得票数从多到少排序;2:按抵押从多到少排序

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "lookup_platforms", [0,2,1]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "lookup_platforms", [0,2,1]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
    {
        "id": "1.6.0",
        "owner": 217895094,
        "name": "test-yoyow",
        "sequence": 1,
        "is_valid": true,
        "total_votes": 0,
        "url": "http://demo.yoyow.org/",
        "pledge": 1000000000,
        "pledge_last_update": "2018-02-10T01:03:57",
        "average_pledge": 176601774,
        "average_pledge_last_update": "2018-02-11T06:49:12",
        "average_pledge_next_update_block": 4562164,
        "extra_data": "{\"login\":\"http://192.168.1.184:8280/login\"}",
        "create_time": "2018-02-10T01:03:57",
        "last_update_time": "2018-02-11T06:49:12"
    },
    {
        "id": "1.6.4",
        "owner": 224006453,
        "name": "dwgMarket",
        "sequence": 1,
        "is_valid": true,
        "total_votes": 0,
        "url": "www.cad1688.com",
        "pledge": 1000000000,
        "pledge_last_update": "2018-04-04T08:38:24",
        "average_pledge": 0,
        "average_pledge_last_update": "2018-04-04T08:38:24",
        "average_pledge_next_update_block": 5712088,
        "extra_data": "{}",
        "create_time": "2018-04-04T08:38:24",
        "last_update_time": "1970-01-01T00:00:00"
    }]
}

1.1.19 get_platform_count

返回平台总数量

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "get_platform_count", []]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_platform_count", []], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": 5
}

1.1.20 get_assets

给定一组资产 id ,返回对应的资产的详细信息。

参数: asset_ids 一组资产 id

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

asset_ids: 资产id数组,暂时只要核心资产YOYO,例如: [0]

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "get_assets", [[0]]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_assets", [[0]]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "id": "1.3.0",
      "asset_id": 0,
      "symbol": "YOYO",
      "precision": 5,
      "issuer": 1264,
      "options": {
        "max_supply": "200000000000000",
        "market_fee_percent": 0,
        "max_market_fee": "1000000000000000",
        "issuer_permissions": 0,
        "flags": 0,
        "whitelist_authorities": [],
        "blacklist_authorities": [],
        "whitelist_markets": [],
        "blacklist_markets": [],
        "description": ""
      },
      "dynamic_asset_data_id": "2.2.0",
      "dynamic_asset_data": {
        "id": "2.2.0",
        "asset_id": 0,
        "current_supply": "106899730634997",
        "accumulated_fees": 0
      }
    }
  ]
}

返回结果中的 dynamic_asset_data 字段包括资产动态数据明细。

1.1.21 list_assets

分页查询资产详细信息。返回结果按资产代码的 ASCII 码顺序排序。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

lower_bound_symbol: 以此作为起始代码开始查询
limit: 返回数量限制,最多不能超过 101

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "list_assets", ["YOY",4]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "list_assets", ["YOY",4]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "id": "1.3.91",
      "asset_id": 91,
      "symbol": "YOYES",
      "precision": 2,
      "issuer": 215074501,
      "options": {
        "max_supply": 1200,
        "market_fee_percent": 0,
        "max_market_fee": 1200,
        "issuer_permissions": 79,
        "flags": 0,
        "whitelist_authorities": [],
        "blacklist_authorities": [],
        "whitelist_markets": [],
        "blacklist_markets": [],
        "description": ""
      },
      "dynamic_asset_data_id": "2.2.91",
      "dynamic_asset_data": {
        "id": "2.2.91",
        "asset_id": 91,
        "current_supply": 0,
        "accumulated_fees": 0
      }
    },
    {
      "id": "1.3.130",
      "asset_id": 130,
      "symbol": "YOYIO",
      "precision": 2,
      "issuer": 254208024,
      "options": {
        "max_supply": 1258000000,
        "market_fee_percent": 0,
        "max_market_fee": 1258000000,
        "issuer_permissions": 79,
        "flags": 0,
        "whitelist_authorities": [],
        "blacklist_authorities": [],
        "whitelist_markets": [],
        "blacklist_markets": [],
        "description": "环保节能"
      },
      "dynamic_asset_data_id": "2.2.130",
      "dynamic_asset_data": {
        "id": "2.2.130",
        "asset_id": 130,
        "current_supply": 1258000000,
        "accumulated_fees": 0
      }
    },
    {
      "id": "1.3.0",
      "asset_id": 0,
      "symbol": "YOYO",
      "precision": 5,
      "issuer": 1264,
      "options": {
        "max_supply": "200000000000000",
        "market_fee_percent": 0,
        "max_market_fee": "1000000000000000",
        "issuer_permissions": 0,
        "flags": 0,
        "whitelist_authorities": [],
        "blacklist_authorities": [],
        "whitelist_markets": [],
        "blacklist_markets": [],
        "description": ""
      },
      "dynamic_asset_data_id": "2.2.0",
      "dynamic_asset_data": {
        "id": "2.2.0",
        "asset_id": 0,
        "current_supply": "106899950291573",
        "accumulated_fees": 0
      }
    },
    {
      "id": "1.3.2",
      "asset_id": 2,
      "symbol": "YOYOW",
      "precision": 5,
      "issuer": 25638,
      "options": {
        "max_supply": "1000000000000",
        "market_fee_percent": 0,
        "max_market_fee": "1000000000000",
        "issuer_permissions": 79,
        "flags": 0,
        "whitelist_authorities": [],
        "blacklist_authorities": [],
        "whitelist_markets": [],
        "blacklist_markets": [],
        "description": ""
      },
      "dynamic_asset_data_id": "2.2.2",
      "dynamic_asset_data": {
        "id": "2.2.2",
        "asset_id": 2,
        "current_supply": 0,
        "accumulated_fees": 0
      }
    }
  ]
}

1.1.22 lookup_asset_symbols

给定一组资产代码或 id ,返回对应的资产的详细信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

symbols_or_ids: 数组形式,要检索的资产的符号代码或ID,例如:["YOYO"] 或者 [0]

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[0, "lookup_asset_symbols", [[0]]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "lookup_asset_symbols", [[0]]], "id": 1}' http://47.52.155.181:10011/rpc
curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "lookup_asset_symbols", [["YOYO"]]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "id": "1.3.0",
      "asset_id": 0,
      "symbol": "YOYO",
      "precision": 5,
      "issuer": 1264,
      "options": {
        "max_supply": "200000000000000",
        "market_fee_percent": 0,
        "max_market_fee": "1000000000000000",
        "issuer_permissions": 0,
        "flags": 0,
        "whitelist_authorities": [],
        "blacklist_authorities": [],
        "whitelist_markets": [],
        "blacklist_markets": [],
        "description": ""
      },
      "dynamic_asset_data_id": "2.2.0",
      "dynamic_asset_data": {
        "id": "2.2.0",
        "asset_id": 0,
        "current_supply": "106900048605605",
        "accumulated_fees": 0
      }
    }
  ]
}

History API

1.2.1 get_relative_account_history

获取账户历史。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

访问授权限制

请求参数

account: 可以是 uid 或者账户昵称
op_type: 限制操作类型,参见操作类型。值为 null 时,则返回所有操作类型;为 0 时可获得所有transfer操作.
start: 查询起始编号(sequence number)
limit: 返回结果总数
end: 值为 0 时,可得到最多的最近操作记录.

返回结果的数量会在end - start 范围之内;如果limit值比end - start 要小,则返回满足limit条件的最新操作记录。 返回结果的排序方式为: 最新的优先

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://47.52.155.181:10011
{"id":1, "method":"call", "params":[2, "get_relative_account_history", [223331844, null, 1,3,10]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_relative_account_history", [223331844, null, 1,3,10]], "id": 1}' http://47.52.155.181:10011/rpc

返回结果

返回列表中每条数据是 pair 类型,pair 中第一个元素为该条记录在该账号历史中的序列号(sequence),第二个元素为具体操作

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    [
      10,
      {
        "id": "1.12.48157",
        "op": [
          0,
          {
            "fee": {
              "total": {
                "amount": 20000,
                "asset_id": 0
              },
              "options": {
                "from_csaf": {
                  "amount": 20000,
                  "asset_id": 0
                }
              }
            },
            "from": 217895094,
            "to": 223331844,
            "amount": {
              "amount": "200000000000",
              "asset_id": 0
            },
            "extensions": {
              "from_balance": {
                "amount": "200000000000",
                "asset_id": 0
              },
              "to_balance": {
                "amount": "200000000000",
                "asset_id": 0
              }
            }
          }
        ],
        "result": [
          0,
          {}
        ],
        "block_timestamp": "2018-05-02T09:24:30",
        "block_num": 6515279,
        "trx_in_block": 0,
        "op_in_trx": 0,
        "virtual_op": 2715
      }
    ],
    [
      9,
      {
        "id": "1.12.47189",
        "op": [
          22,
          {
            "fee": {
              "total": {
                "amount": 200000,
                "asset_id": 0
              },
              "options": {
                "from_csaf": {
                  "amount": 200000,
                  "asset_id": 0
                }
              }
            },
            "voter": 236542328,
            "platform_to_add": [
              223331844
            ],
            "platform_to_remove": []
          }
        ],
        "result": [
          0,
          {}
        ],
        "block_timestamp": "2018-04-16T08:14:57",
        "block_num": 6053313,
        "trx_in_block": 0,
        "op_in_trx": 0,
        "virtual_op": 1157
      }
    ],
    [
      8,
      {
        "id": "1.12.47149",
        "op": [
          22,
          {
            "fee": {
              "total": {
                "amount": 200000,
                "asset_id": 0
              },
              "options": {
                "from_csaf": {
                  "amount": 200000,
                  "asset_id": 0
                }
              }
            },
            "voter": 250926091,
            "platform_to_add": [
              223331844
            ],
            "platform_to_remove": []
          }
        ],
        "result": [
          0,
          {}
        ],
        "block_timestamp": "2018-04-16T03:19:36",
        "block_num": 6049807,
        "trx_in_block": 0,
        "op_in_trx": 0,
        "virtual_op": 1117
      }
    ]
  ]
}

钱包API说明

钱包连接方式

下载方式:

测试网络钱包地址

正式网络钱包地址

启动方式:

wallet的使用:

可以通过交互的命令行,也可以通过websocket和http的接口。 参考 交易指南

./yoyow_client -s ws://127.0.0.1:8090/ -r 0.0.0.0:8091 -H 127.0.0.1:8093

注意:

使用 -s 来指定,连接到的节点程序的IP与端口;
使用 -r 选项来开启一个websocket接口;
使用 -H 选项来开启一个HTTP-RPC服务,方便我们其他程序进行访问。如:单独处理充值/提现的脚本程序。
yoyow_node 只有完成同步后,才会监听RPC端口,所以请耐心等待 yoyow_node 同步完成。
您可以启动多个client 连接同一个yoyow_node。但请注意不要使用相同的-H,会因为端口被占用而监听失败。

在本文档的测试用例中,均使用本机地址。

websocket 接口地址: ws://localhost:8091

http rpc接口地址: http://localhost:8093

连接方法如下:

1. 使用wscat连接 websocket 接口:

wscat -c ws://localhost:8091

2. 使用curl 连接 websocket 接口:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_accounts_by_uid", [["250926091"]]], "id": 1}' http://localhost:8091

3. 使用curl 连接 http 接口:

curl --data '{"method": "call", "params": [0, "get_accounts_by_uid", [["250926091"]]], "id": 1}' http://localhost:8093

备注:websocket和http接口的区别:websocket接口同样可以使用curl获取数据,会遵循jsonrpc格式,请求和返回的json数据均需携带{"jsonrpc": "2.0"}。http 的接口不需携带{"jsonrpc": "2.0"}的标签。

2.1 工具类 API

2.1.1 calculate_account_uid

给定一个数,计算出对应的账户 uid

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

n: 数字

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{{"id":1, "method":"call", "params":[0,"calculate_account_uid",[12]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0,"calculate_account_uid",[12]], "id": 1}' http://localhost:8093

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": 3106
}

2.1.2 suggest_brain_key

随机生成一个脑密钥,根据脑密钥得出一对公私钥

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0,"suggest_brain_key",[]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0,"suggest_brain_key",[]], "id": 1}' http://localhost:8091

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "brain_priv_key": "DERIC GIANTRY ALODY TELAR TIRR BOILER BULLIT REACTOR BANISH FLOCCUS SLIPPER PELANOS WEALTHY SOLE RESCRUB RELIMIT",
    "wif_priv_key": "5JXK8jhtJM8jKXcpBHeWahzkfZ9c7ske31TkMR7eMeq1uWirYVD",
    "pub_key": "YYW7jcmGpu6KEUE352VtGB9PTo38Nut5qxXitfSgG6cDmAvxz2yin"
  }
}

2.1.3 get_transaction_id

返回给定交易的 tx id (交易 ID ,或称交易哈希)

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

trx: JSON格式的完整交易

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0,"get_transaction_id",[{"operations":[[0,{"fee":{"total":{"amount":100000,"asset_id":0}},"from":250926091,"to":223331844,"amount":{"amount":100000,"asset_id":0},"extensions":{}}]]}]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0,"suggest_brain_key",[{"operations":[[0,{"fee":{"total":{"amount":100000,"asset_id":0}},"from":250926091,"to":223331844,"amount":{"amount":100000,"asset_id":0},"extensions":{}}]]}]], "id": 1}' http://localhost:8091

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "5ea3a6ee9f030472f83fb436836b602a3a5ed6a5"
}

2.2 查询类 API

2.2.1 get_account

获取账户基本信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

account_name_or_id: uid或者账户昵称name,例如:"250926091"

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0,"get_account",[250926091]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0,"get_account",[250926091]], "id": 1}' http://localhost:8091

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "id": "1.2.1378",
    "uid": 250926091,
    "name": "yoyo250926091",
    "owner": {
      "weight_threshold": 1,
      "account_uid_auths": [],
      "key_auths": [
        [
          "YYW7UoNSEQAUPvnvoBRVKyPAD9845esnpiK6MgHinsn5yqr5UgT5W",
          1
        ]
      ]
    },
    "active": {
      "weight_threshold": 1,
      "account_uid_auths": [],
      "key_auths": [
        [
          "YYW6fU7Th8uESW9FZnpkhYaTUwtSvn3f2TQxFVA3ef2SSiwdZES71",
          1
        ]
      ]
    },
    "secondary": {
      "weight_threshold": 1,
      "account_uid_auths": [],
      "key_auths": [
        [
          "YYW5eDSFYeiqyFRajfPP8tTZM7mfUeyc7H65zmnHtDW4SQJdwqTBD",
          1
        ]
      ]
    },
    "memo_key": "YYW7SpC4QLY1LRRxFQ2hbYHdAyQo88L8qnPJcDJkiRMugcnFGUGvo",
    "reg_info": {
      "registrar": 206336051,
      "referrer": 25997,
      "registrar_percent": 0,
      "referrer_percent": 0,
      "allowance_per_article": {
        "amount": 0,
        "asset_id": 0
      },
      "max_share_per_article": {
        "amount": 0,
        "asset_id": 0
      },
      "max_share_total": {
        "amount": 0,
        "asset_id": 0
      },
      "buyout_percent": 10000
    },
    "can_post": true,
    "can_reply": false,
    "can_rate": false,
    "is_full_member": true,
    "is_registrar": false,
    "is_admin": false,
    "create_time": "2018-04-03T08:21:00",
    "last_update_time": "2018-04-03T08:21:00",
    "active_data": "{}",
    "secondary_data": "{}",
    "statistics": "2.5.1378"
  }
}

2.2.2 get_full_account

获取账户详细信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

account_name_or_id: uid或者账户昵称name,例如:"250926091"

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0,"get_full_account",[["250926091"]]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_full_account", [["250926091"]]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "account": {
      "id": "1.2.1378",
      "uid": 250926091,
      "name": "yoyo250926091",
      "owner": {
        "weight_threshold": 1,
        "account_uid_auths": [],
        "key_auths": [
          [
            "YYW7UoNSEQAUPvnvoBRVKyPAD9845esnpiK6MgHinsn5yqr5UgT5W",
            1
          ]
        ]
      },
      "active": {
        "weight_threshold": 1,
        "account_uid_auths": [],
        "key_auths": [
          [
            "YYW6fU7Th8uESW9FZnpkhYaTUwtSvn3f2TQxFVA3ef2SSiwdZES71",
            1
          ]
        ]
      },
      "secondary": {
        "weight_threshold": 1,
        "account_uid_auths": [],
        "key_auths": [
          [
            "YYW5eDSFYeiqyFRajfPP8tTZM7mfUeyc7H65zmnHtDW4SQJdwqTBD",
            1
          ]
        ]
      },
      "memo_key": "YYW7SpC4QLY1LRRxFQ2hbYHdAyQo88L8qnPJcDJkiRMugcnFGUGvo",
      "reg_info": {
        "registrar": 206336051,
        "referrer": 25997,
        "registrar_percent": 0,
        "referrer_percent": 0,
        "allowance_per_article": {
          "amount": 0,
          "asset_id": 0
        },
        "max_share_per_article": {
          "amount": 0,
          "asset_id": 0
        },
        "max_share_total": {
          "amount": 0,
          "asset_id": 0
        },
        "buyout_percent": 10000
      },
      "can_post": true,
      "can_reply": false,
      "can_rate": false,
      "is_full_member": true,
      "is_registrar": false,
      "is_admin": false,
      "create_time": "2018-04-03T08:21:00",
      "last_update_time": "2018-04-03T08:21:00",
      "active_data": "{}",
      "secondary_data": "{}",
      "statistics": "2.5.1378"
    },
    "statistics": {
      "id": "2.5.1378",
      "owner": 250926091,
      "total_ops": 11,
      "removed_ops": 0,
      "prepaid": 0,
      "csaf": 4200683,
      "core_balance": 1098850704,
      "core_leased_in": 0,
      "core_leased_out": 0,
      "average_coins": 1099970604,
      "average_coins_last_update": "2018-04-12T12:56:00",
      "coin_seconds_earned": "136484730731520",
      "coin_seconds_earned_last_update": "2018-04-12T12:56:00",
      "total_witness_pledge": 0,
      "releasing_witness_pledge": 0,
      "witness_pledge_release_block_number": 4294967295,
      "last_witness_sequence": 0,
      "uncollected_witness_pay": 0,
      "witness_last_confirmed_block_num": 0,
      "witness_last_aslot": 0,
      "witness_total_produced": 0,
      "witness_total_missed": 0,
      "witness_last_reported_block_num": 0,
      "witness_total_reported": 0,
      "total_committee_member_pledge": 0,
      "releasing_committee_member_pledge": 0,
      "committee_member_pledge_release_block_number": 4294967295,
      "last_committee_member_sequence": 0,
      "can_vote": true,
      "is_voter": false,
      "last_voter_sequence": 1,
      "last_platform_sequence": 1,
      "total_platform_pledge": 1000000000,
      "releasing_platform_pledge": 0,
      "platform_pledge_release_block_number": 4294967295,
      "last_post_sequence": 0
    },
    "csaf_leases_in": [],
    "csaf_leases_out": [],
    "witness_votes": [],
    "committee_member_votes": []
  }
}

2.2.3 get_relative_account_history

获取账户历史。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

account: 可以是 uid 或者账户昵称
op_type: 限制操作类型,参见操作类型。值为 null 时,则返回所有操作类型;为 0 时可获得所有transfer操作.
start: 查询起始编号(sequence number)
limit: 返回结果总数
end: 值为 0 时,可得到最多的最近操作记录.

返回结果的数量会在end - start 范围之内;如果limit值比end - start 要小,则返回满足limit条件的最新操作记录。 返回结果的排序方式为: 最新的优先

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0,"get_relative_account_history",["250926091",null,10,10,0]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0,"get_relative_account_history",["250926091",null,10,10,0]], "id": 1}' http://localhost:8091

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "memo": "",
      "description": "Transfer 1.20000 YOYO from 250926091 to 209414065   (Fee: 0.20000 YOYO)",
      "sequence": 11,
      "op": {
        "id": "1.12.46722",
        "op": [
          0,
          {
            "fee": {
              "total": {
                "amount": 20000,
                "asset_id": 0
              },
              "options": {
                "from_csaf": {
                  "amount": 20000,
                  "asset_id": 0
                }
              }
            },
            "from": 250926091,
            "to": 209414065,
            "amount": {
              "amount": 120000,
              "asset_id": 0
            }
          }
        ],
        "result": [
          0,
          {}
        ],
        "block_timestamp": "2018-04-12T12:56:21",
        "block_num": 5946192,
        "trx_in_block": 0,
        "op_in_trx": 0,
        "virtual_op": 690
      }
    },
    {
      "memo": "",
      "description": "Transfer 10 YOYO from 250926091 to 209414065   (Fee: 0.20000 YOYO)",
      "sequence": 10,
      "op": {
        "id": "1.12.46721",
        "op": [
          0,
          {
            "fee": {
              "total": {
                "amount": 20000,
                "asset_id": 0
              },
              "options": {
                "from_csaf": {
                  "amount": 20000,
                  "asset_id": 0
                }
              }
            },
            "from": 250926091,
            "to": 209414065,
            "amount": {
              "amount": 1000000,
              "asset_id": 0
            }
          }
        ],
        "result": [
          0,
          {}
        ],
        "block_timestamp": "2018-04-12T12:55:57",
        "block_num": 5946184,
        "trx_in_block": 0,
        "op_in_trx": 0,
        "virtual_op": 689
      }
    }
  ]
}

2.2.4 list_account_balances

获取账户余额。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

account: uid或者账户昵称name,例如:"250926091"

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0,"list_account_balances",["250926091"]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0,"list_account_balances",["250926091"]], "id": 1}' http://localhost:8091

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "amount": 1098850704,
      "asset_id": 0
    }
  ]
}

2.2.5 list_accounts_by_name

根据名称查找账号UID。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

lowerbound: 以此作为起始名称开始查询,设为空串则从头开始查
limit: 返回数量限制,最多不能超过 1001

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0,"list_accounts_by_name",["yoyo",10]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0,"list_accounts_by_name",["yoyo",10]], "id": 1}' http://localhost:8091

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    [
      "yoyo10007071",
      10007071
    ],
    [
      "yoyo100090928",
      100090928
    ],
    [
      "yoyo100361976",
      100361976
    ],
    [
      "yoyo100459405",
      100459405
    ],
    [
      "yoyo100501159",
      100501159
    ],
    [
      "yoyo100583445",
      100583445
    ],
    [
      "yoyo100603302",
      100603302
    ],
    [
      "yoyo100735531",
      100735531
    ],
    [
      "yoyo10124233",
      10124233
    ],
    [
      "yoyo101530854",
      101530854
    ]
  ]
}

2.2.6 get_witness

获取见证人信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

owner_account: 参数可以是 uid 或者账户昵称。

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0,"get_witness",["132826789"]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0,"get_witness",["132826789"]], "id": 1}' http://localhost:8091

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "id": "1.5.31",
    "account": 132826789,
    "name": "yoyo132826789",
    "sequence": 1,
    "is_valid": true,
    "signing_key": "YYW1111111111111111111111111111111114T1Anm",
    "pledge": "7500000000",
    "pledge_last_update": "2017-09-05T11:39:03",
    "average_pledge": "7500000000",
    "average_pledge_last_update": "2017-09-06T12:05:36",
    "average_pledge_next_update_block": 4294967295,
    "total_votes": 1023267564,
    "by_pledge_position": "0",
    "by_pledge_position_last_update": "0",
    "by_pledge_scheduled_time": "45370982250075664161773192435",
    "by_vote_position": "0",
    "by_vote_position_last_update": "0",
    "by_vote_scheduled_time": "332544857826054970738151567847",
    "last_confirmed_block_num": 8168,
    "last_aslot": 8599,
    "total_produced": 25,
    "total_missed": 0,
    "url": ""
  }
}

2.2.7 list_witnesses

查询指定借出人的币龄租借(借出)清单。

结果按借入人 uid 从小到大排序

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

lower_bound: 以此作为起始 uid 开始查询,设为 0 则从头开始查
limit: 返回数量限制,最多不能超过 101
ops: 排序类型。取值范围[0,1,2]。 0:按uid由大到小排序;1:按得票数从多到少排序;2:按抵押从多到少排序

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0,"list_witnesses",["132"]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0,"list_witnesses",["132"]], "id": 1}' http://localhost:8091

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "id": "1.5.1",
      "account": 25997,
      "name": "init1",
      "sequence": 1,
      "is_valid": true,
      "signing_key": "YYW71suPihtG7jJAGiVBCkd63ECHYebQaPa894oy3r54zk3eM1itt",
      "pledge": 1000000000,
      "pledge_last_update": "2017-09-12T21:02:45",
      "average_pledge": 1000000000,
      "average_pledge_last_update": "2017-09-13T21:20:30",
      "average_pledge_next_update_block": 4294967295,
      "total_votes": 0,
      "by_pledge_position": "0",
      "by_pledge_position_last_update": "0",
      "by_pledge_scheduled_time": "340282366580656096882718510549",
      "by_vote_position": "0",
      "by_vote_position_last_update": "0",
      "by_vote_scheduled_time": "340282366920938463463374607431768211455",
      "last_confirmed_block_num": 5994633,
      "last_aslot": 6366418,
      "total_produced": 518458,
      "total_missed": 32186,
      "url": ""
    },
    {
      "id": "1.5.2",
      "account": 26264,
      "name": "init2",
      "sequence": 1,
      "is_valid": true,
      "signing_key": "YYW71suPihtG7jJAGiVBCkd63ECHYebQaPa894oy3r54zk3eM1itt",
      "pledge": 1000000000,
      "pledge_last_update": "2017-09-12T21:02:51",
      "average_pledge": 1000000000,
      "average_pledge_last_update": "2017-09-13T21:20:36",
      "average_pledge_next_update_block": 4294967295,
      "total_votes": 0,
      "by_pledge_position": "0",
      "by_pledge_position_last_update": "0",
      "by_pledge_scheduled_time": "340282366580656096882718510549",
      "by_vote_position": "0",
      "by_vote_position_last_update": "0",
      "by_vote_scheduled_time": "340282366920938463463374607431768211455",
      "last_confirmed_block_num": 5994632,
      "last_aslot": 6366417,
      "total_produced": 518439,
      "total_missed": 32198,
      "url": ""
    },
    {
      "id": "1.5.3",
      "account": 26460,
      "name": "init3",
      "sequence": 1,
      "is_valid": true,
      "signing_key": "YYW71suPihtG7jJAGiVBCkd63ECHYebQaPa894oy3r54zk3eM1itt",
      "pledge": 1000000000,
      "pledge_last_update": "2017-09-12T21:02:54",
      "average_pledge": 1000000000,
      "average_pledge_last_update": "2017-09-13T21:20:39",
      "average_pledge_next_update_block": 4294967295,
      "total_votes": 0,
      "by_pledge_position": "0",
      "by_pledge_position_last_update": "0",
      "by_pledge_scheduled_time": "340282366580656096882718510549",
      "by_vote_position": "0",
      "by_vote_position_last_update": "0",
      "by_vote_scheduled_time": "340282366920938463463374607431768211455",
      "last_confirmed_block_num": 5994636,
      "last_aslot": 6366421,
      "total_produced": 518427,
      "total_missed": 32161,
      "url": ""
    },
    {
      "id": "1.5.4",
      "account": 26861,
      "name": "init4",
      "sequence": 1,
      "is_valid": true,
      "signing_key": "YYW71suPihtG7jJAGiVBCkd63ECHYebQaPa894oy3r54zk3eM1itt",
      "pledge": 1000000000,
      "pledge_last_update": "2017-09-12T21:03:00",
      "average_pledge": 1000000000,
      "average_pledge_last_update": "2017-09-13T21:20:45",
      "average_pledge_next_update_block": 4294967295,
      "total_votes": 0,
      "by_pledge_position": "0",
      "by_pledge_position_last_update": "0",
      "by_pledge_scheduled_time": "340282366580656096882718510549",
      "by_vote_position": "0",
      "by_vote_position_last_update": "0",
      "by_vote_scheduled_time": "340282366920938463463374607431768211455",
      "last_confirmed_block_num": 5994640,
      "last_aslot": 6366425,
      "total_produced": 518441,
      "total_missed": 32137,
      "url": ""
    },
    {
      "id": "1.5.5",
      "account": 27027,
      "name": "init5",
      "sequence": 1,
      "is_valid": true,
      "signing_key": "YYW71suPihtG7jJAGiVBCkd63ECHYebQaPa894oy3r54zk3eM1itt",
      "pledge": 1000000000,
      "pledge_last_update": "2017-09-12T21:05:15",
      "average_pledge": 1000000000,
      "average_pledge_last_update": "2017-09-13T21:23:00",
      "average_pledge_next_update_block": 4294967295,
      "total_votes": 0,
      "by_pledge_position": "0",
      "by_pledge_position_last_update": "0",
      "by_pledge_scheduled_time": "340282366580656096882718510549",
      "by_vote_position": "0",
      "by_vote_position_last_update": "0",
      "by_vote_scheduled_time": "340282366920938463463374607431768211455",
      "last_confirmed_block_num": 5994639,
      "last_aslot": 6366424,
      "total_produced": 518387,
      "total_missed": 32190,
      "url": ""
    }
  ]
}

2.2.8 get_committee_member

获取理事成员信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

owner_account: uid 或者账户昵称。 例如:"25997"

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0,"get_committee_member",["25997"]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0,"get_committee_member",["25997"]], "id": 1}' http://localhost:8091

返回结果

{

"id": 1, "jsonrpc": "2.0", "result": {

"id": "1.4.0", "account": 25997, "name": "init1", "sequence": 1, "is_valid": true, "pledge": 0, "total_votes": 567814657, "url": ""

}

}

2.2.9 list_committee_members

列出当前有效的候选理事清单。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

lower_bound: 以此作为起始 uid 开始查询,设为 0 则从头开始查
limit: 返回数量限制,最多不能超过 101
ops: 排序类型。取值范围[0,1,2]。 0:按uid由大到小排序;1:按得票数从多到少排序;2:按抵押从多到少排序

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0,"list_committee_members",[0,5,1]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0,"list_committee_members",[0,5,1]], "id": 1}' http://localhost:8091

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "id": "1.4.0",
      "account": 25997,
      "name": "init1",
      "sequence": 1,
      "is_valid": true,
      "pledge": 0,
      "total_votes": 567814657,
      "url": ""
    },
    {
      "id": "1.4.1",
      "account": 26264,
      "name": "init2",
      "sequence": 1,
      "is_valid": true,
      "pledge": 0,
      "total_votes": 0,
      "url": ""
    },
    {
      "id": "1.4.2",
      "account": 26460,
      "name": "init3",
      "sequence": 1,
      "is_valid": true,
      "pledge": 0,
      "total_votes": 0,
      "url": ""
    },
    {
      "id": "1.4.3",
      "account": 26861,
      "name": "init4",
      "sequence": 1,
      "is_valid": true,
      "pledge": 0,
      "total_votes": 0,
      "url": ""
    },
    {
      "id": "1.4.4",
      "account": 27027,
      "name": "init5",
      "sequence": 1,
      "is_valid": true,
      "pledge": 0,
      "total_votes": 0,
      "url": ""
    }
  ]
}

2.2.10 list_committee_proposals

列出所有尚未成功执行的理事会提案,包含正在投票表决的、已表决通过但还没到执行时间的。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "list_committee_proposals", []]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "list_committee_proposals", []], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": []
}

2.2.11 get_platform_count

获取网络上平台的总数量

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "get_platform_count", []]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "get_platform_count", []], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": 6
}

2.2.12 get_platform

根据平台所有人(owner)账号,获取平台对象信息

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

owner_account: 平台所有人账号

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "get_platform", ["250926091"]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "update_committee_account", [0, "get_platform", ["250926091"]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "id": "1.6.3",
    "owner": 250926091,
    "name": "NoPlatform",
    "sequence": 1,
    "is_valid": true,
    "total_votes": 0,
    "url": "www.example2.com",
    "pledge": 1000000000,
    "pledge_last_update": "2018-04-03T09:30:48",
    "average_pledge": 396825,
    "average_pledge_last_update": "2018-04-03T09:34:48",
    "average_pledge_next_update_block": 5684416,
    "extra_data": "{}",
    "create_time": "2018-04-03T09:30:48",
    "last_update_time": "2018-04-03T09:34:48"
  }
}

2.2.13 list_platforms

按平台拥有者进行查询,列出当前有效的平台清单。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

lowerbound: 以此作为起始 uid 开始查询,设为 0 则从头开始查
limit: 返回数量限制,最多不能超过 100
order_by: 排序类型。取值范围[0,1,2]。 0:按uid由大到小排序;1:按得票数从多到少排序;2:按抵押从多到少排序

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "list_platforms", [0,5,1]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "list_platforms", [0, "list_platforms", [0,5,1]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "id": "1.6.0",
      "owner": 217895094,
      "name": "test-yoyow",
      "sequence": 1,
      "is_valid": true,
      "total_votes": 0,
      "url": "http://demo.yoyow.org/",
      "pledge": 1000000000,
      "pledge_last_update": "2018-02-10T01:03:57",
      "average_pledge": 176601774,
      "average_pledge_last_update": "2018-02-11T06:49:12",
      "average_pledge_next_update_block": 4562164,
      "extra_data": "{\"login\":\"http://demo.yoyow.org:3000/authLogin\"}",
      "create_time": "2018-02-10T01:03:57",
      "last_update_time": "2018-02-11T06:49:12"
    },
    {
      "id": "1.6.5",
      "owner": 223331844,
      "name": "baidu",
      "sequence": 1,
      "is_valid": true,
      "total_votes": 0,
      "url": "",
      "pledge": 1000000000,
      "pledge_last_update": "2018-04-16T02:52:36",
      "average_pledge": 0,
      "average_pledge_last_update": "2018-04-16T02:52:36",
      "average_pledge_next_update_block": 6050467,
      "extra_data": "",
      "create_time": "2018-04-16T02:52:36",
      "last_update_time": "1970-01-01T00:00:00"
    },
    {
      "id": "1.6.4",
      "owner": 224006453,
      "name": "dwgMarket",
      "sequence": 1,
      "is_valid": true,
      "total_votes": 0,
      "url": "www.cad1688.com",
      "pledge": 1000000000,
      "pledge_last_update": "2018-04-04T08:38:24",
      "average_pledge": 0,
      "average_pledge_last_update": "2018-04-04T08:38:24",
      "average_pledge_next_update_block": 5712088,
      "extra_data": "{}",
      "create_time": "2018-04-04T08:38:24",
      "last_update_time": "1970-01-01T00:00:00"
    }
  ]
}

2.2.14 get_asset

根据给定的资产代码或者 id ,返回资产详细信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

asset_name_or_id: 资产符号或者资产id

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "get_asset", [ 3]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "get_asset", [ 3]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": "1.3.3",
  "asset_id": 3,
  "symbol": "WOWO",
  "precision": 4,
  "issuer": 223331844,
  "options": {
    "max_supply": "1000000000000000",
    "market_fee_percent": 0,
    "max_market_fee": "1000000000000000",
    "issuer_permissions": 79,
    "flags": 0,
    "whitelist_authorities": [],
    "blacklist_authorities": [],
    "whitelist_markets": [],
    "blacklist_markets": [],
    "description": ""
  },
  "dynamic_asset_data_id": "2.3.3"
}

2.2.15 list_assets

分页查询资产详细信息。

返回结果按资产代码的 ASCII 码顺序排序

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "list_assets", ["YOY", 4]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "list_assets", ["YOY", 4]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "id": "1.3.91",
      "asset_id": 91,
      "symbol": "YOYES",
      "precision": 2,
      "issuer": 215074501,
      "options": {
        "max_supply": 1200,
        "market_fee_percent": 0,
        "max_market_fee": 1200,
        "issuer_permissions": 79,
        "flags": 0,
        "whitelist_authorities": [],
        "blacklist_authorities": [],
        "whitelist_markets": [],
        "blacklist_markets": [],
        "description": "卢俊义"
      },
      "dynamic_asset_data_id": "2.2.91",
      "dynamic_asset_data": {
        "id": "2.2.91",
        "asset_id": 91,
        "current_supply": 0,
        "accumulated_fees": 0
      }
    },
    {
      "id": "1.3.130",
      "asset_id": 130,
      "symbol": "YOYIO",
      "precision": 2,
      "issuer": 254208024,
      "options": {
        "max_supply": 1258000000,
        "market_fee_percent": 0,
        "max_market_fee": 1258000000,
        "issuer_permissions": 79,
        "flags": 0,
        "whitelist_authorities": [],
        "blacklist_authorities": [],
        "whitelist_markets": [],
        "blacklist_markets": [],
        "description": "环保节能"
      },
      "dynamic_asset_data_id": "2.2.130",
      "dynamic_asset_data": {
        "id": "2.2.130",
        "asset_id": 130,
        "current_supply": 1258000000,
        "accumulated_fees": 0
      }
    },
    {
      "id": "1.3.0",
      "asset_id": 0,
      "symbol": "YOYO",
      "precision": 5,
      "issuer": 1264,
      "options": {
        "max_supply": "200000000000000",
        "market_fee_percent": 0,
        "max_market_fee": "1000000000000000",
        "issuer_permissions": 0,
        "flags": 0,
        "whitelist_authorities": [],
        "blacklist_authorities": [],
        "whitelist_markets": [],
        "blacklist_markets": [],
        "description": ""
      },
      "dynamic_asset_data_id": "2.2.0",
      "dynamic_asset_data": {
        "id": "2.2.0",
        "asset_id": 0,
        "current_supply": "106901076031525",
        "accumulated_fees": 0
      }
    },
    {
      "id": "1.3.2",
      "asset_id": 2,
      "symbol": "YOYOW",
      "precision": 5,
      "issuer": 25638,
      "options": {
        "max_supply": "1000000000000",
        "market_fee_percent": 0,
        "max_market_fee": "1000000000000",
        "issuer_permissions": 79,
        "flags": 0,
        "whitelist_authorities": [],
        "blacklist_authorities": [],
        "whitelist_markets": [],
        "blacklist_markets": [],
        "description": ""
      },
      "dynamic_asset_data_id": "2.2.2",
      "dynamic_asset_data": {
        "id": "2.2.2",
        "asset_id": 2,
        "current_supply": 0,
        "accumulated_fees": 0
      }
    }
  ]
}

2.3 钱包/私钥管理类 API

2.3.1 save_wallet_file

保存钱包文件,会保存到yoyo_client的执行文件夹下

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

wallet需要处于unlock状态

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

wallet_filename: 字符串,为备份的文件名。

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "save_wallet_file", ["t3.json"]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "save_wallet_file", ["t3.json"]], "id": 1}' http://localhost:8091/rpc

返回结果

{
    "id": 1,
    "jsonrpc": "2.0",
    "result":null
}

2.3.2 set_password

设置钱包密码

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

wallet需要处于new或者unlocked状态

new状态为wallet第一次运行,未曾设置password的状态。

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

password: 密码字符串 例如:"1234"

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "set_password", ["1234"]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "set_password", ["1234"]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": null
}

2.3.3 unlock

解锁钱包

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

wallet处于locked状态

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

password: 密码字符串 例如:"1234"

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "unlock", ["1234"]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "unlock", ["1234"]], "id": 1}'

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": null
}

2.3.4 lock

锁定钱包

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "lock", []]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "lock", []], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": null
}

2.3.5 import_key

将一个私钥导入钱包,并指定一个相关账号。私钥和账号并不一定要有关联。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

wallet需要处于unlocked状态

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

account_name_or_id: 账号 uid 或者昵称
wif_key: 私钥字符串

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "lock", []]}{"id":1, "method":"call", "params":[0, "import_key", ["250926091","5JLaW7u3EC4vVLbTmLo1XeSBGiTeRtqER1UsoLtYbFNnBafgPKG"]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "lock", []]}{"id":1, "method":"call", "params":[0, "import_key", ["250926091","5JLaW7u3EC4vVLbTmLo1XeSBGiTeRtqER1UsoLtYbFNnBafgPKG"]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": true
}

2.3.6 dump_private_keys

列出钱包内所有私钥及对应公钥。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

wallet需要处于unlocked状态

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "dump_private_keys",[]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "dump_private_keys",[]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    [
      "YYW5eDSFYeiqyFRajfPP8tTZM7mfUeyc7H65zmnHtDW4SQJdwqTBD",
      "5HvABsnYU1U7misWHq9mc6mE8QovBiy8H5rVZc3zKztgZsPfFMB"
    ],
    [
      "YYW6fU7Th8uESW9FZnpkhYaTUwtSvn3f2TQxFVA3ef2SSiwdZES71",
      "5JLaW7u3EC4vVLbTmLo1XeSBGiTeRtqER1UsoLtYbFNnBafgPKG"
    ]
  ]
}

2.3.7 list_my_accounts_cached

列出钱包文件中所有缓存的账户(导入私钥时指定的账户)的信息。

注:该缓存信息不一定与链上数据同步。要想进行同步,请重新打开钱包文件。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

wallet需要处于unlocked状态

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "list_my_accounts_cached",[]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "list_my_accounts_cached",[]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "id": "1.2.1378",
      "uid": 250926091,
      "name": "yoyo250926091",
      "owner": {
        "weight_threshold": 1,
        "account_uid_auths": [],
        "key_auths": [
          [
            "YYW7UoNSEQAUPvnvoBRVKyPAD9845esnpiK6MgHinsn5yqr5UgT5W",
            1
          ]
        ]
      },
      "active": {
        "weight_threshold": 1,
        "account_uid_auths": [],
        "key_auths": [
          [
            "YYW6fU7Th8uESW9FZnpkhYaTUwtSvn3f2TQxFVA3ef2SSiwdZES71",
            1
          ]
        ]
      },
      "secondary": {
        "weight_threshold": 1,
        "account_uid_auths": [],
        "key_auths": [
          [
            "YYW5eDSFYeiqyFRajfPP8tTZM7mfUeyc7H65zmnHtDW4SQJdwqTBD",
            1
          ]
        ]
      },
      "memo_key": "YYW7SpC4QLY1LRRxFQ2hbYHdAyQo88L8qnPJcDJkiRMugcnFGUGvo",
      "reg_info": {
        "registrar": 206336051,
        "referrer": 25997,
        "registrar_percent": 0,
        "referrer_percent": 0,
        "allowance_per_article": {
          "amount": 0,
          "asset_id": 0
        },
        "max_share_per_article": {
          "amount": 0,
          "asset_id": 0
        },
        "max_share_total": {
          "amount": 0,
          "asset_id": 0
        },
        "buyout_percent": 10000
      },
      "can_post": true,
      "can_reply": false,
      "can_rate": false,
      "is_full_member": true,
      "is_registrar": false,
      "is_admin": false,
      "create_time": "2018-04-03T08:21:00",
      "last_update_time": "2018-04-03T08:21:00",
      "active_data": "{}",
      "secondary_data": "{}",
      "statistics": "2.5.1378"
    }
  ]
}

2.4 操作/交易类 API

以下操作涉及密钥权限的,需要导入相关的私钥,同时,保证wallet需处于解锁(unlocked)状态

2.4.1 transfer

根据uid列表 查询平台

支持格式

JSON

请求方式

WebSocket; JSON-RPC

.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z">所需密钥权限

需要转出人active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

from: 转出人(UID或昵称)
to: 转入人(UID或昵称)
amount: 金额,如果金额为小数建议使用字符串传参
asset_symbol: 币种, 资产类型,当前只有"YOYO"
memo: 备注(不带备注的话用空串"")
broadcast: 是否广播,true or false

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "transfer",[250926091, 209414065, "10", "YOYO", "feho", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "transfer",[250926091, 209414065, "10", "YOYO", "feho", true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 57170,
    "ref_block_prefix": 852086171,
    "expiration": "2018-04-15T03:18:33",
    "operations": [
      [
        0,
        {
          "fee": {
            "total": {
              "amount": 20898,
              "asset_id": 0
            },
            "options": {
              "from_csaf": {
                "amount": 20898,
                "asset_id": 0
              }
            }
          },
          "from": 250926091,
          "to": 209414065,
          "amount": {
            "amount": 1000000,
            "asset_id": 0
          },
          "memo": {
            "from": "YYW7SpC4QLY1LRRxFQ2hbYHdAyQo88L8qnPJcDJkiRMugcnFGUGvo",
            "to": "YYW8PK8NtXW6JjtxqPV8QTgw4ejPEg4FgVeNV1maZDGzzNoEbgmr2",
            "nonce": "7783743918290282490",
            "message": "4468a7f3a5ac7fbf8125856381673030"
          }
        }
      ]
    ],
    "signatures": [
      "1f0a075215760089cf879b67ee6ba0aaaffa9408cd48c9040eee562909a8d67f5f7bbbb6401aabc69c00cd5d212f65b41204651f33442dc5b5b0056ce38f06c10e"
    ]
  }
}

2.4.2 create_witness

创建见证人。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要见证人所有者的active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

owner_account: 账号(UID或昵称)
block_signing_key: 出块签名公钥,
pledge_amount: 抵押金额
pledge_asset_symbol: 抵押币种(YOYO)
url: 介绍链接
broadcast: 是否广播

其中:签名公钥为 YYW1111111111111111111111111111111114T1Anm 表示暂时离线

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "create_witness", ["223331844", "YYW1111111111111111111111111111111114T1Anm","1000000", "YOYO", "http://www.yoyow.org", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "create_witness", ["223331844", "YYW1111111111111111111111111111111114T1Anm","100", "YOYO", "http://www.yoyow.org", true]], "id": 1}' http://localhost:8091/rpc

返回结果

::
{

"ref_block_num": 58457, "ref_block_prefix": 2372452101, "expiration": "2018-05-03T11:28:36", "operations": [[

13,{
"fee": {
"total": {
"amount": 100000000, "asset_id": 0

}

}, "account": 223331844, "block_signing_key": "YYW1111111111111111111111111111111114T1Anm", "pledge": {

"amount": "100000000000", "asset_id": 0

}, "url": "http://www.yoyow.org"

}

]

], "signatures": [

"202857a37e91889a1c6124a2e3405eff00647b315aa55db7989334e187a5a92c1f0cb4bb00531fa525e53f26403e8bd323a9e46f8289b0039ed2caeb951f70eb28"

]

}

2.4.3 update_witness

修改见证人信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要见证人所有者的active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

witness_account: 账号(UID或昵称)
block_signing_key: 新的出块签名公钥,不需修改则输入 null
pledge_amount: 新的抵押金额,不需修改则输入 null
pledge_asset_symbol: 新的抵押币种(YOYO),不需修改则输入 null
url: 新的介绍链接,不需修改则输入 null
broadcast: 是否广播

其中,抵押金额和币种必须同时出现或者同时不出现,目前币种只能是 YOYO

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "update_witness", ["223331844", null,"100345", "YOYO", null, true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "update_witness", ["223331844", null,"100345", "YOYO", null, true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 13103,
    "ref_block_prefix": 3050749194,
    "expiration": "2018-05-04T04:17:42",
    "operations": [
      [
        14,
        {
          "fee": {
            "total": {
              "amount": 1000000,
              "asset_id": 0
            },
            "options": {
              "from_csaf": {
                "amount": 1000000,
                "asset_id": 0
              }
            }
          },
          "account": 223331844,
          "new_pledge": {
            "amount": "10034500000",
            "asset_id": 0
          }
        }
      ]
    ],
    "signatures": [
      "1f6503a1e7dd15d1d9d5fe9cdaddddea39acf40071bd5621458b9abf3e0c8709f63fedfac89adc571fcc8af20fe6beb9f94d93d47256d3170b314e87153492357e"
    ]
  }
}

2.4.4 create_committee_member

创建候选理事身份。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

owner_account: 账号(UID或昵称)
pledge_amount: 抵押金额
pledge_asset_symbol: 抵押币种(YOYO)
url: 介绍链接
broadcast: 是否广播

注意事项

查询到的资产实际只有YOYO可用。

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "create_committee_member", ["223331844","1000", "YOYO", "http://www.yoyow.org", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "create_committee_member", ["223331844","1000", "YOYO", "http://www.yoyow.org", true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 13153,
    "ref_block_prefix": 1417310192,
    "expiration": "2018-05-04T04:20:12",
    "operations": [
      [
        8,
        {
          "fee": {
            "total": {
              "amount": 10000000,
              "asset_id": 0
            }
          },
          "account": 223331844,
          "pledge": {
            "amount": 100000000,
            "asset_id": 0
          },
          "url": "http://www.yoyow.org"
        }
      ]
    ],
    "signatures": [
      "1f2b34fe5e2437be46d83ec2f0f4482e1b5df509131131c41eeb16e484df5e4ea96df19f82be294433bc751e84d6dcc28073e758ad7de1ca48c4b36fb2d41b2def"
    ]
  }
}

2.4.5 update_committee_member

修改候选理事信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

committee_member_account: 账号(UID或昵称)
pledge_amount: 新的抵押金额,不需修改则输入 null
pledge_asset_symbol: 新的抵押币种(YOYO),不需修改则输入 null
url: 新的介绍链接,不需修改则输入 null
broadcast: 是否广播

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "update_committee_member", ["223331844", "10234", "YOYO", null, true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "update_committee_account", ["250926091","10000", "YOYO", null, true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 13189,
    "ref_block_prefix": 2763581564,
    "expiration": "2018-05-04T04:22:00",
    "operations": [
      [
        9,
        {
          "fee": {
            "total": {
              "amount": 1000000,
              "asset_id": 0
            },
            "options": {
              "from_csaf": {
                "amount": 1000000,
                "asset_id": 0
              }
            }
          },
          "account": 223331844,
          "new_pledge": {
            "amount": 1023400000,
            "asset_id": 0
          }
        }
      ]
    ],
    "signatures": [
      "20506ea2aadb44a57ae4bb60c71b0c2002f89410d4941ed83d3323c4bed2f883ee4d045c9a326e331b49770db32799c63b854a67dd4ff998b74f6b457cb7d9157e"
    ]
  }
}

2.4.6 set_voting_proxy

设置投票代理。

账户A设置账户B为投票代理,则B的投票对象得到的票数为A的有效票数+B的有效票数。 A 称之为委托人,B 称之为代理人

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要委托人账号的active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

account_to_modify: 委托人账号(UID或昵称)
voting_account: 代理人账号(用UID或昵称设置代理,null为取消代理)
broadcast: 是否广播

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "set_voting_proxy", ["250926091", "abit", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "set_voting_proxy", ["250926091", "abit", true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 18995,
    "ref_block_prefix": 2835940919,
    "expiration": "2018-04-16T02:06:36",
    "operations": [
      [
        5,
        {
          "fee": {
            "total": {
              "amount": 100000,
              "asset_id": 0
            },
            "options": {
              "from_csaf": {
                "amount": 100000,
                "asset_id": 0
              }
            }
          },
          "voter": 223331844,
          "proxy": 250926091
        }
      ]
    ],
    "signatures": [
      "1f793459c8c7e06e80b2b34d2d13a0fb46e5d4f839953f6fae96af16acf389b51c534c35d2f85fe5d9f8e7316b1bb66941c2591e31afe7e5bbfee8802877ad7af0"
    ]
  }
}

2.4.7 update_witness_votes

见证人投票。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要投票人的active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

voting_account: 账号(UID或昵称)
witnesses_to_add: 增加支持的见证人清单(UID或昵称)
witnesses_to_remove: 移除支持的见证人清单(UID或昵称)
broadcast: 是否广播

witnesses_to_add和witnesses_to_remove两个清单可以都为空"[]",表示刷新投票意向。

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "update_witness_votes", ["250926091", "abit", [], true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "update_witness_votes", ["250926091", "abit", [], true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 18961,
    "ref_block_prefix": 1229162670,
    "expiration": "2018-04-16T02:04:54",
    "operations": [
      [
        15,
        {
          "fee": {
            "total": {
              "amount": 200000,
              "asset_id": 0
            },
            "options": {
              "from_csaf": {
                "amount": 200000,
                "asset_id": 0
              }
            }
          },
          "voter": 250926091,
          "witnesses_to_add": [
            209414065
          ],
          "witnesses_to_remove": []
        }
      ]
    ],
    "signatures": [
      "206badbed989fcf01c93a2eda807976bae29f2e95ca2dcaa83f645be6c3bffcbc178199f4e4816801643cc9ee158fc4e8f450c2082763ac163e1b875bfb82f3a25"
    ]
  }
}

2.4.8 update_committee_member_votes

理事会选举投票。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要投票人的active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

voting_account: 投票人账号(UID或昵称)
committee_members_to_add: 数组,增加支持的候选理事清单(UID或昵称)
committee_members_to_remove: 数组,移除支持的候选理事清单(UID或昵称)
broadcast: 是否广播

committee_members_to_add,committee_members_to_remove两个清单可以都为空"[]",表示刷新投票意向。

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "update_committee_member_votes", ["250926091", ["init1"], [],  true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "update_committee_member_votes", ["250926091", ["init1"], [],  true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 19152,
    "ref_block_prefix": 1139468448,
    "expiration": "2018-04-16T02:14:27",
    "operations": [
      [
        10,
        {
          "fee": {
            "total": {
              "amount": 100000,
              "asset_id": 0
            },
            "options": {
              "from_csaf": {
                "amount": 100000,
                "asset_id": 0
              }
            }
          },
          "voter": 250926091,
          "committee_members_to_add": [
            25997
          ],
          "committee_members_to_remove": []
        }
      ]
    ],
    "signatures": [
      "1f35562e4301c20f293977ffe27399ccf961fc3d5c0c9d928730ed5af03af24637599e30d070032bae887d9db3201c891b1c362dd0324e8bd9b02064d679a65be3"
    ]
  }
}

2.4.9 collect_csaf_with_time

领取积分,需指定时间参数,领取积累到指定时间的积分。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要领取者的Secondary key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

from: 领取账号(UID或昵称)
to: 接收账号(UID或昵称)
amount: 领取金额
asset_symbol: 领取币种( 币种只能是 YOYO )
time: 指定时间,例如:"2018-04-16T02:44:00" ,该时间为UTC时间,且不得早于当前链上新出块的时间5分钟。
broadcast: 是否广播

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "collect_csaf_with_time", ["223331844", "223331844", "0.5", "YOYO", "2018-04-16T02:44:00" true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "collect_csaf_with_time", ["223331844", "223331844", "0.5", "YOYO", "2018-04-16T02:44:00" true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 19813,
    "ref_block_prefix": 1809327617,
    "expiration": "2018-04-16T02:47:30",
    "operations": [
      [
        6,
        {
          "fee": {
            "total": {
              "amount": 100000,
              "asset_id": 0
            },
            "options": {
              "from_csaf": {
                "amount": 100000,
                "asset_id": 0
              }
            }
          },
          "from": 223331844,
          "to": 223331844,
          "amount": {
            "amount": 50000,
            "asset_id": 0
          },
          "time": "2018-04-16T02:44:00"
        }
      ]
    ],
    "signatures": [
      "1f250855fcc4e4ef093c14990411b1cfd41f97de43447e1b6a21cbe26eb95f6c9671b7c0d5ba4365d76018d277086c34c1d73a1f90c817f4d073852c6f041daf72",
      "2061c58d04a7ad9f60af1f145c837f57475d3d1785754527753b1144c1bef445240faa079b5927956be10693711b392b7a52fb55439addacbcee94a40e61f13f84"
    ]
  }
}

2.4.10 collect_csaf

领取积分,领取积累到当前时间(分钟)的积分。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要领取者的Secondary key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

from: 领取账号(UID或昵称)
to: 接收账号(UID或昵称)
amount: 领取金额
asset_symbol: 领取币种( 币种只能是 YOYO )
broadcast: 是否广播

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "collect_csaf", ["250926091", "250926091", 1, "YOYO", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "collect_csaf", ["250926091", "250926091", 1, "YOYO", true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 19646,
    "ref_block_prefix": 555752677,
    "expiration": "2018-04-16T02:39:09",
    "operations": [
      [
        6,
        {
          "fee": {
            "total": {
              "amount": 100000,
              "asset_id": 0
            },
            "options": {
              "from_csaf": {
                "amount": 100000,
                "asset_id": 0
              }
            }
          },
          "from": 250926091,
          "to": 250926091,
          "amount": {
            "amount": 100000,
            "asset_id": 0
          },
          "time": "2018-04-16T02:37:00"
        }
      ]
    ],
    "signatures": [
      "203a417b25f10110d8143d7476976abbcbb3490f13432630366e5b0d1d8d7580573c8595e93109af4a55282756b8b4916ae055147cceae1bc7b85f2b0a7f2fa042",
      "2054d3b25618ddaeae499297a483d5490bac77f35bac7dd850645400d7f8001a2265cd997ff62db54740e9fcda52b0bbbaf5aa6d12d3fbcd65a71e2ccf6baa1e1a"
    ]
  }
}

2.4.11 create_platform

创建平台

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要申请者的Active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

owner_account: 创建者账号
name: 平台名称
pledge_amount: 抵押数量,当前不得少于10000 YOYO
pledge_asset_symbol: 抵押币种(YOYO)
url: 平台链接
extra_data: 平台额外数据
broadcast: 是否广播

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "create_platform", ["223331844", "baidu", "10000", "YOYO", "", "", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "create_platform", ["223331844", "baidu", "10000", "YOYO", "", "", true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 19954,
    "ref_block_prefix": 1357577324,
    "expiration": "2018-04-16T02:54:33",
    "operations": [
      [
        20,
        {
          "fee": {
            "total": {
              "amount": 100007811,
              "asset_id": 0
            }
          },
          "account": 223331844,
          "pledge": {
            "amount": 1000000000,
            "asset_id": 0
          },
          "name": "baidu",
          "url": "",
          "extra_data": ""
        }
      ]
    ],
    "signatures": [
      "20534af4af03c6d4001c797dde6ac438a6b3d31c77b94cb8e4b6519e681a289c69370057de58412bb5e3ba8320ab975d33012bb92b20509e3daee6582affce8e80"
    ]
  }
}

2.4.12 update_platform

修改平台信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

platform_account: 账号(UID或昵称)
name: 新的平台名称,不需修改则输入 null
pledge_amount: 新的抵押金额,不需修改则输入 null
pledge_asset_symbol: 新的抵押币种(YOYO),不需修改则输入 null
url: 新的介绍链接,不需修改则输入 null
extra_data: 新的平台额外数据
broadcast: 是否广播

注: 抵押金额和币种必须同时出现或者同时不出现,目前币种只能是 YOYO。 抵押金额为 0 则为关闭平台

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "update_platform", ["223331844", "NUUUU", null, null, "http://www.example.com", "http://www.example.com", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "update_platform", ["223331844", "NUUUU", null, null, "http://www.example.com", "http://www.example.com", true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 20262,
    "ref_block_prefix": 1534083365,
    "expiration": "2018-04-16T03:09:57",
    "operations": [
      [
        21,
        {
          "fee": {
            "total": {
              "amount": 1053709,
              "asset_id": 0
            },
            "options": {
              "from_csaf": {
                "amount": 1053709,
                "asset_id": 0
              }
            }
          },
          "account": 223331844,
          "new_name": "NUUUU",
          "new_url": "http://www.example.com",
          "new_extra_data": "http://www.example.com"
        }
      ]
    ],
    "signatures": [
      "202e8e53a7e58d4b60c7bf7b0d3f8076a6c9b8f7c472c48e61463cff68228e2cf643404bf954f1c7596deb05630942c95057ff397f31753bff069e5754894efcad"
    ]
  }
}

2.4.13 update_platform_votes

为平台投票

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要投票者的Active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

voting_account: 投票人账号(UID或昵称)
platforms_to_add: 增加支持的平台清单(UID或昵称)
platforms_to_remove: 移除支持的平台清单(UID或昵称)
broadcast: 是否广播

latforms_to_add,platforms_to_remove 两个清单可以都为空,表示刷新投票意向。

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "update_platform_votes", ["250926091", ["223331844"], [], true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "update_platform_votes", ["250926091", ["223331844"], [], true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 20494,
    "ref_block_prefix": 3288350547,
    "expiration": "2018-04-16T03:21:33",
    "operations": [
      [
        22,
        {
          "fee": {
            "total": {
              "amount": 200000,
              "asset_id": 0
            },
            "options": {
              "from_csaf": {
                "amount": 200000,
                "asset_id": 0
              }
            }
          },
          "voter": 250926091,
          "platform_to_add": [
            223331844
          ],
          "platform_to_remove": []
        }
      ]
    ],
    "signatures": [
      "20274d50cf4905fe072e3257632335546c386721f2d608cf3939316f7167ddbea55a28616cc790b00aea5bc89b6649e56c04c8121f50a97c2ca4b3f587ac5e922e"
    ]
  }
}

2.4.14 account_auth_platform

账户对平台授权。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

主控密钥

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

account: 授权账号(UID或昵称)
platform_owner: 平台所有者账号(UID或昵称)
broadcast: 是否广播

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "account_auth_platform", ["250926091", "223331844", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "account_auth_platform", ["250926091", "223331844", true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 26612,
    "ref_block_prefix": 1858930703,
    "expiration": "2018-07-05T02:34:57",
    "operations": [
      [
        23,
        {
          "fee": {
            "total": {
              "amount": 10000,
              "asset_id": 0
            },
            "options": {
              "from_csaf": {
                "amount": 10000,
                "asset_id": 0
              }
            }
          },
          "uid": 223331844,
          "platform": 250926091
        }
      ]
    ],
    "signatures": [
      "200ee643c33b074ad002bc6f4b477ff48dbee76bd3aa1c3c5b3a4c064b1f39581e61f93e957128c1c20737eafa2e09c56f6d0f97468676cfa2a15d04f50da0774c"
    ]
  }
}

2.4.15 account_cancel_auth_platform

账户取消对平台授权。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

主控密钥

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

account: 授权账号(UID或昵称)
platform_owner: 平台所有者账号(UID或昵称)
broadcast: 是否广播

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "account_cancel_auth_platform", ["250926091", "223331844", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "account_cancel_auth_platform", ["250926091", "223331844", true], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 26736,
    "ref_block_prefix": 2510951750,
    "expiration": "2018-07-05T02:41:09",
    "operations": [
      [
        24,
        {
          "fee": {
            "total": {
              "amount": 10000,
              "asset_id": 0
            },
            "options": {
              "from_csaf": {
                "amount": 10000,
                "asset_id": 0
              }
            }
          },
          "uid": 223331844,
          "platform": 250926091
        }
      ]
    ],
    "signatures": [
      "2021240ab7c321fad009693c8a598363aa840fcde0f07cc54d72b8c3b7d6e116d4357127328faea805aff7d632fb0a09e2ce6ac203d4a97b2dd30c139548939d38"
    ]
  }
}

2.4.16 create_asset

创建资产,目前需要300000 YOYO

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要申请者的Active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

issuer: 创建人UID
symbol: 要创建资产的符号
precision: 精度(保留几位小数)
common: 选项,详见下文选项参数结构
initial_supply: 初始流通量为整型表示,即:实际金额 = initial_supply / ( 10 ^ precision )
broadcast: 是否广播

其中选项参数结构

asset_options {
      // 该资产在任何给定时间可能存在的最大供应量。 这可以和 GRAPHENE_MAX_SHARE_SUPPLY 一样大
      // 特别说明:该最大供应量为最小单位Token的数量,比如发行的最大供应量为30000,精度设为2,则实际的供应量为30000/(10^2)=300个Token,最小的交易单位为0.01。
      max_supply = GRAPHENE_MAX_SHARE_SUPPLY;
      // 当这个资产在市场上交易时,这个交易总额的百分比将被提取并支付给发行人。 这是一个固定点值,代表百分之一百,即在此字段中值为100意味着此资产的市场交易收取1%的费用。(预留字段,暂未使用,必须为 0 )
      market_fee_percent = 0;
      // 以交易量的 market_fee_percent计算的市场费用限制为此值。 (预留字段,暂未使用,必须为 0 )
      max_market_fee = GRAPHENE_MAX_SHARE_SUPPLY;

      // 发行人有权更新的标志(可用标志有:charge_market_fee|white_list|override_authority|transfer_restricted|disable_confidential)
      issuer_permissions = UIA_ASSET_ISSUER_PERMISSION_MASK;
      // 此权限上的当前活动标志
      flags = 0;

      // 一组维护白名单的账户可以使用此资产。 如果whitelist_authorities不为空,则只有whitelist_authorities中的帐户才可以持有,使用或转让资产。
      whitelist_authorities;
      // 一组维护黑名单以查询此资产的帐户。 如果设置了标志&white_list,则如果这些帐户中没有一个帐户出现在其account_object :: blacklisting_accounts字段中,
      // 则该帐户只能在此资产中发送,接收,交易等。 如果该帐户被列入黑名单,即使该资产也列入白名单,该用户也不能在该资产中进行交易。
      blacklist_authorities;

      // 定义该资产可能在市场上交易的资产
      whitelist_markets;
      // 定义该资产不得在市场上交易的资产,不得重叠白名单
      blacklist_markets;

      // 描述该资产的含义/目的的数据,费用将按照描述的大小进行收费。
      string description;
   };

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "create_asset", ["250926091","TOTOTO", 4, {"max_supply":300000,"market_fee_percent":0,"max_market_fee":0,"issuer_permissions":4}, 200000, true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "create_asset", ["250926091","TOTOTO", 4, {"max_supply":300000,"market_fee_percent":0,"max_market_fee":0,"issuer_permissions":4}, 200000, true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "ref_block_num": 57735,
  "ref_block_prefix": 998946957,
  "expiration": "2018-07-06T04:31:06",
  "operations": [[
      25,{
        "fee": {
          "total": {
            "amount": 50000000,
            "asset_id": 0
          }
        },
        "issuer": 250926091,
        "symbol": "TOTOTO",
        "precision": 4,
        "common_options": {
          "max_supply": 300000,
          "market_fee_percent": 0,
          "max_market_fee": 0,
          "issuer_permissions": 4,
          "flags": 0,
          "whitelist_authorities": [],
          "blacklist_authorities": [],
          "whitelist_markets": [],
          "blacklist_markets": [],
          "description": ""
        },
        "extensions": {
          "initial_supply": 200000
        }
      }
    ]
  ],
  "signatures": [
    "1f32dc80319019ff0c5eff27c9d1e15c7371fcc2825969b8e42a6429fb44c2ac3a75344b382e00c9f7f4af06600b0aff93aa380bf81b94f62b1abe0bfc807fcb6f"
  ]
}

2.4.17 update_asset

更新资产信息。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要资产所有者的Active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

symbol: 资产符号
new_issuer: 新的资产所有人
new_options: 新的资产选项(见create_asset 中的 common参数结构),不需修改则输入 null
broadcast: 是否广播

注意事项

只有资产发行人才能使用这个功能。

只有当前流通量为零时,才能修改精度。

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "update_asset", ["WOWO", null, {"max_supply":"2000000000"}, true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "update_asset", ["WOWO", null, {"max_supply":"2000000000"}, true]]}, "id": 1}' http://localhost:8091/rpc

返回结果

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "ref_block_num": 12862,
    "ref_block_prefix": 653302827,
    "expiration": "2018-05-04T04:05:39",
    "operations": [
      [
        26,
        {
          "fee": {
            "total": {
              "amount": 50000000,
              "asset_id": 0
            }
          },
          "issuer": 223331844,
          "asset_to_update": 3,
          "new_options": {
            "max_supply": 2000000000,
            "market_fee_percent": 0,
            "max_market_fee": "1000000000000000",
            "issuer_permissions": 79,
            "flags": 0,
            "whitelist_authorities": [],
            "blacklist_authorities": [],
            "whitelist_markets": [],
            "blacklist_markets": [],
            "description": ""
          }
        }
      ]
    ],
    "signatures": [
      "2030b2b084ab8e47bc2da5c863475776eac2cde1feba4cb3575eb7a7e86f96c9594a9778280c740098a5eec26f84b57993d925d2630c1a3dc31395c9938a676089"
    ]
  }
}

2.4.18 enable_allowed_assets

账户主动启用或停用账户端资产白名单。

该白名单默认为停用状态,停用白名单即 账户可以发送和接收任何资产。

白名单处于启用状态时,该账户只能发送和接收名单内的资产,同时可使用 update_allowed_assets 命令更新白名单。

从停用状态变更为启用状态时,白名单中默认只有“核心资产”,即 YOYO 。

从启用状态停用白名单后,数据清除。重新启用时需重新添加需要的资产。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要资产所有者的Active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

account: 账号(UID或昵称)
enable: 是否启用( true 为启用, false 为停用 )
broadcast: 是否广播

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "enable_allowed_assets", ["250926091", false, true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "issue_asset", "250926091", false, true]], "id": 1}' http://localhost:8091/rpc

返回结果

::
{

"ref_block_num": 56000, "ref_block_prefix": 3273656390, "expiration": "2018-07-06T03:04:21", "operations": [[

34,{
"fee": {
"total": {
"amount": 100000, "asset_id": 0

}, "options": {

"from_csaf": {
"amount": 100000, "asset_id": 0

}

}

}, "account": 250926091, "enable": false

}

]

], "signatures": [

"1f7e06ed28f6017e9a25ee1d165ec1aae330fb87abc9486c264c30f7de2e8d2369077509d61d96df016fbeec55bbd541532b90f35bf2e18278c87369fa87d7158b"

]

}

2.4.19 update_allowed_assets

更新账户端资产白名单。

只有白名单处于开启状态时,才能更新。 不能移除 YOYO 。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要资产所有者的Active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

account: 账号(UID或昵称)
assets_to_add: 添加到白名单的资产清单(资产代码或 id )
assets_to_remove: 从白名单移除的资产清单(资产代码或 id )
broadcast: 是否广播

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "issue_asset", ["250926091", "100000", "WOWO", "memo", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "issue_asset", ["250926091", "100000", "WOWO", "memo", true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "ref_block_num": 56441,
  "ref_block_prefix": 3725987382,
  "expiration": "2018-07-06T03:26:24",
  "operations": [[
      35,{
        "fee": {
          "total": {
            "amount": 200000,
            "asset_id": 0
          },
          "options": {
            "from_csaf": {
              "amount": 200000,
              "asset_id": 0
            }
          }
        },
        "account": 250926091,
        "assets_to_add": [
          3
        ],
        "assets_to_remove": []
      }
    ]
  ],
  "signatures": [
    "200f4362763eef9a5f0de6c461d2dcde77e665ae5ac2d462c89dd1f4ba22b35b7b21662e306d1e52c530815983f284d79b3191ebd4d3fea43f135aff4e21fe39a3",
    "1f199078220bf0d6c2fcf28e0bd4fbf9afc1eb7db241997173a469d88d538d36c03c3299136cf42a030810c5adf250be990029391c0ad7ae8268e5bee4850f07bd"
  ]
}

2.4.20 issue_asset

分配发行的资产给某个账号

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要资产所有者的Active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

to_account: 发行到的目标账号
amount: 数量
symbol: 资产符号
memo: 备注
broadcast: 是否广播

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "issue_asset", ["250926091", "100000", "WOWO", "memo", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "issue_asset", ["250926091", "100000", "WOWO", "memo", true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "ref_block_num": 55598,
  "ref_block_prefix": 1065296620,
  "expiration": "2018-05-03T09:05:39",
  "operations": [[
      27,{
        "fee": {
          "total": {
            "amount": 2008984,
            "asset_id": 0
          }
        },
        "issuer": 223331844,
        "asset_to_issue": {
          "amount": 1000000000,
          "asset_id": 3
        },
        "issue_to_account": 250926091,
        "memo": {
          "from": "YYW8EeMDaSmDg8zLXL272kcm4W7vUF4c4tBkfQpV7N79PBjgGjkDN",
          "to": "YYW7SpC4QLY1LRRxFQ2hbYHdAyQo88L8qnPJcDJkiRMugcnFGUGvo",
          "nonce": "3388232258004121975",
          "message": "fc712e427e57aae3d6819e3427b7f90a"
        }
      }
    ]
  ],
  "signatures": [
    "205e29664c74590e1af73aa645374dc25f2900758e5213a3120fdf285d7940d5e66339311a97513cf78bd794916619f5813c940a9e7bc4b942fbd9fed49a2a7d27"
  ]
}

2.4.21 reserve_asset

销毁自己账户中指定数量的指定资产。 操作完成后,该资产类型的流通总量相应减少。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要资产所有者的Active key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

from: 账号(UID或昵称)
amount: 金额
symbol: 币种(资产代码)
broadcast: 是否广播

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "reserve_asset", ["250926091", "1000", "WOWO", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "reserve_asset", ["250926091", "1000", "WOWO", true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "ref_block_num": 56703,
  "ref_block_prefix": 1905534427,
  "expiration": "2018-07-06T03:39:30",
  "operations": [[
      28,{
        "fee": {
          "total": {
            "amount": 10000,
            "asset_id": 0
          },
          "options": {
            "from_csaf": {
              "amount": 10000,
              "asset_id": 0
            }
          }
        },
        "payer": 250926091,
        "amount_to_reserve": {
          "amount": 10000000,
          "asset_id": 3
        }
      }
    ]
  ],
  "signatures": [
    "1f6a2f416a525ae4754a98388cb4464f60f1b77659c5a742d8b76a80d581484ce5681c24aa51c7379acaa8247df49d962cb28b5910e179a7de9c8a48e49fe7cc5a"
  ]
}

2.4.22 override_transfer

强制转账。资产发行人强制某账户将一定数量资产转到另一账户。

只有资产发行人才能使用这个功能。

备注用发行人备注私钥加密,转入人可解密备注,转出人不可解密。

支持格式

JSON

请求方式

WebSocket; JSON-RPC

所需密钥权限

需要资产发行人的Active key和memo key

访问授权限制

访问级别: 普通接口
频次限制: 是

请求参数

from: 转出人(UID或昵称)
to: 转入人(UID或昵称)
amount: 金额
symbol: 币种(资产代码)
memo: 备注(不带备注的话用空串"")
broadcast: 是否广播

注意事项

调用样例及调试工具

WebSocket:

wscat -c ws://localhost:8091
{"id":1, "method":"call", "params":[0, "override_transfer", ["216494599", "250926091", 2, "SOSO", "memo", true]]}

JSON-RPC:

curl --data '{"jsonrpc": "2.0", "method": "call", "params":[0, "override_transfer", ["216494599", "250926091", 2, "SOSO", "memo", true]], "id": 1}' http://localhost:8091/rpc

返回结果

{
  "ref_block_num": 61983,
  "ref_block_prefix": 2781522721,
  "expiration": "2018-07-06T08:03:30",
  "operations": [[
      30,{
        "fee": {
          "total": {
            "amount": 2008984,
            "asset_id": 0
          },
          "options": {
            "from_csaf": {
              "amount": 2008984,
              "asset_id": 0
            }
          }
        },
        "issuer": 223331844,
        "from": 216494599,
        "to": 250926091,
        "amount": {
          "amount": 20000,
          "asset_id": 283
        },
        "memo": {
          "from": "YYW5jiVsASqAyUibUb8awgDapFqfjQJo3SfvTEPJHxir8r3ggVtZU",
          "to": "YYW8Z8rtp7oEZFJi7Ar9HC4r4d15jXCVTQ2CAosjSnkSFdbc74GJ3",
          "nonce": "9585190871224727019",
          "message": "b0e7b1997c2142125c0369c4304a33c1"
        }
      }
    ]
  ],
  "signatures": [
    "20008db33ea71863fc7f4b97763a34e96e8b9d87714b1445d33c34a6b7bb3015c14d0a130c1ee74946c19b5e992c02249872e1bf601ca24380ebef22e5119a2894"
  ]
}