比特股BTS和BAR類Json-RPC接口

本文作者:陳進堅
個人博客:https://jian1098.github.io
CSDN博客:https://blog.csdn.net/c_jian
簡書:https://www.jianshu.com/u/8ba9ac5706b6
聯繫方式:[email protected]

參考文檔:https://dev.bitshares.works/en/master/api/wallet_api.html#

查詢節點信息

參數:無

{"jsonrpc": "2.0", "method": "get_dynamic_global_properties", "params": [], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "id": "2.1.0",
        "head_block_number": 35028,
        "head_block_id": "000088d4acd8537ebcd6237a20190f896d55cb6d",
        "time": "2019-09-19T05:49:45",
        "current_witness": "1.6.3",
        "next_maintenance_time": "2019-09-20T00:00:00",
        "last_budget_time": "2019-09-19T00:00:00",
        "witness_budget": 0,
        "accounts_registered_this_interval": 0,
        "recently_missed_count": 925001,
        "current_aslot": 3739147,
        "recent_slots_filled": "340282366920938463463374607431768211455",
        "dynamic_flags": 0,
        "last_irreversible_block_num": 35018
    }
}

通過區塊id查詢區塊信息

參數:區塊id

{"jsonrpc": "2.0", "method": "get_block", "params": [19868], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "previous": "00004d9b1abf0a3fa2103803ef1f9ff707e66f6b",
        "timestamp": "2019-09-04T08:10:15",
        "witness": "1.6.7",
        "transaction_merkle_root": "2522020e5fdb3b6e8faa49e0339b536872a72166",
        "extensions": [],
        "witness_signature": "2067895022b1f0af047fa71d4e4ca869db1d5d36a20aa5cbd693d3270a80b8c96e7b9db23c135d465ba470383ed11ab3b860e8f83a381f9d34049edb3c117edb48",
        "transactions": [
            {
                "ref_block_num": 19867,
                "ref_block_prefix": 1057668890,
                "expiration": "2019-09-04T08:10:40",
                "operations": [
                    [
                        0,
                        {
                            "fee": {
                                "amount": 2089843,
                                "asset_id": "1.3.0"
                            },
                            "from": "1.2.17",
                            "to": "1.2.18",
                            "amount": {
                                "amount": 100000,
                                "asset_id": "1.3.0"
                            },
                            "memo": {
                                "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                                "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                                "nonce": "505970742877495025",
                                "message": "ac61bc16cfb0e9c0db19758388a51214"
                            },
                            "extensions": []
                        }
                    ]
                ],
                "extensions": [],
                "signatures": [
                    "1f79cdabf4b7b2122c6becbee4dc7a42e07c053aa446fafd015eb351e24ade2f7a17df96aae62b28d71e9c465f8a732ae9a1417899f81ca1b6caefd9685a9a8301"
                ],
                "operation_results": [
                    [
                        0,
                        {}
                    ]
                ]
            }
        ],
        "block_id": "00004d9ce5e26a550f16dc940d655962d9a897fc",
        "signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
        "transaction_ids": [
            "4b64a76707e698c726a186a9e15b644560ae9a4d"
        ]
    }
}

通過賬號查詢交易歷史

參數:賬戶名,最小編號,最大返回數量,最大編號。編號從 1 開始。

{"jsonrpc": "2.0", "method": "get_relative_account_history", "params": ["nathan",1,2,100], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "memo": "",
            "description": "Transfer 1 BTS from nathan to alpha -- Unlock wallet to see memo.   (Fee: 20.89843 BTS)",
            "op": {
                "id": "1.11.52",
                "op": [
                    0,
                    {
                        "fee": {
                            "amount": 2089843,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 100000,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "505970742877495025",
                            "message": "ac61bc16cfb0e9c0db19758388a51214"
                        },
                        "extensions": []
                    }
                ],
                "result": [
                    0,
                    {}
                ],
                "block_num": 19868,
                "trx_in_block": 0,
                "op_in_trx": 0,
                "virtual_op": 0
            }
        },
        {
            "memo": "",
            "description": "Transfer 1.11111 BTS from nathan to alpha -- Unlock wallet to see memo.   (Fee: 20.89843 BTS)",
            "op": {
                "id": "1.11.51",
                "op": [
                    0,
                    {
                        "fee": {
                            "amount": 2089843,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 111111,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "11674897818616179291",
                            "message": "69cc001a11d3007923dc4d00d28cac1f"
                        },
                        "extensions": []
                    }
                ],
                "result": [
                    0,
                    {}
                ],
                "block_num": 19840,
                "trx_in_block": 0,
                "op_in_trx": 0,
                "virtual_op": 0
            }
        }
    ]
}

賬戶列表

參數:最頂層的賬戶名,獲取數量

{"jsonrpc": "2.0", "method": "list_accounts", "params": ["nathan",10], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        [
            "nathan",
            "1.2.17"
        ],
        [
            "null-account",
            "1.2.3"
        ],
        [
            "proxy-to-self",
            "1.2.5"
        ],
        [
            "relaxed-committee-account",
            "1.2.2"
        ],
        [
            "temp-account",
            "1.2.4"
        ],
        [
            "witness-account",
            "1.2.1"
        ]
    ]
}

查詢賬戶餘額

參數:賬戶名

{"jsonrpc": "2.0", "method": "list_account_balances", "params": ["nathan"], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "amount": "999918734664049",
            "asset_id": "1.3.0"
        }
    ]
}

通過賬戶名查詢賬戶id

參數:賬戶名

{"jsonrpc": "2.0", "method": "get_account_id", "params": ["nathan"], "id": 1}

返回:

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

通過賬戶id查詢賬戶信息

參數:賬戶id

{"jsonrpc": "2.0", "method": "get_object", "params": ["1.2.6","1.3.0"], "id": 1}

或者用另一個端口的另一個方法:http://47.56.168.231:11011,可同時查詢多個賬戶

{"id":1,"method":"call","params":[0,"get_accounts",[["1.2.6"]]]}
{
    "id": 1,
    "result": [
        {
            "id": "1.2.6",
            "membership_expiration_date": "1969-12-31T23:59:59",
            "registrar": "1.2.6",
            "referrer": "1.2.6",
            "lifetime_referrer": "1.2.6",
            "network_fee_percentage": 2000,
            "lifetime_referrer_fee_percentage": 8000,
            "referrer_rewards_percentage": 0,
            "name": "init0",
            "owner": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                        1
                    ]
                ],
                "address_auths": []
            },
            "active": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                        1
                    ]
                ],
                "address_auths": []
            },
            "options": {
                "memo_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                "voting_account": "1.2.5",
                "num_witness": 0,
                "num_committee": 0,
                "votes": [],
                "extensions": []
            },
            "statistics": "2.6.6",
            "whitelisting_accounts": [],
            "blacklisting_accounts": [],
            "whitelisted_accounts": [],
            "blacklisted_accounts": [],
            "owner_special_authority": [
                0,
                {}
            ],
            "active_special_authority": [
                0,
                {}
            ],
            "top_n_control_flags": 0
        }
    ]
}

通過賬戶名查詢賬戶信息

參數:賬戶名

{"jsonrpc": "2.0", "method": "get_account", "params": ["nathan"], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "id": "1.2.17",
        "membership_expiration_date": "1969-12-31T23:59:59",
        "registrar": "1.2.17",
        "referrer": "1.2.17",
        "lifetime_referrer": "1.2.17",
        "network_fee_percentage": 2000,
        "lifetime_referrer_fee_percentage": 8000,
        "referrer_rewards_percentage": 0,
        "name": "nathan",
        "owner": {
            "weight_threshold": 1,
            "account_auths": [],
            "key_auths": [
                [
                    "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                    1
                ]
            ],
            "address_auths": []
        },
        "active": {
            "weight_threshold": 1,
            "account_auths": [],
            "key_auths": [
                [
                    "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                    1
                ]
            ],
            "address_auths": []
        },
        "options": {
            "memo_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
            "voting_account": "1.2.5",
            "num_witness": 0,
            "num_committee": 0,
            "votes": [
                "0:23",
                "0:24",
                "0:25",
                "0:26",
                "0:27",
                "0:28",
                "0:29"
            ],
            "extensions": []
        },
        "statistics": "2.6.17",
        "whitelisting_accounts": [],
        "blacklisting_accounts": [],
        "whitelisted_accounts": [],
        "blacklisted_accounts": [],
        "cashback_vb": "1.13.0",
        "owner_special_authority": [
            0,
            {}
        ],
        "active_special_authority": [
            0,
            {}
        ],
        "top_n_control_flags": 0
    }
}

解鎖錢包

參數:密碼

{"jsonrpc": "2.0", "method": "unlock", "params": ["supersecret"], "id": 1}

返回:

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

轉賬

參數:源賬戶名,目的賬戶名,金額,幣種,備註

{"jsonrpc": "2.0", "method": "transfer2", "params": ["nathan","alpha",10,"BTS","This is memo"], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        "a31884057f4c20724acb54c6817b709892a89de5",
        {
            "ref_block_num": 35238,
            "ref_block_prefix": 4037660452,
            "expiration": "2019-09-19T06:07:45",
            "operations": [
                [
                    0,
                    {
                        "fee": {
                            "amount": 2105468,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 1000000,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "14845433245050049736",
                            "message": "199b07f4622468588c88c88d9a4349b8842c2efbe535d99b74eba99e70e225f5"
                        },
                        "extensions": []
                    }
                ]
            ],
            "extensions": [],
            "signatures": [
                "200ecd4ddb9a9563b54f34e68ac218404ad8006a0b6efb5d8c118bb768542c787a7c7fbefecd41422702d94ce0f4890afd60311a55fb717801aad647d1b7df8d23"
            ]
        }
    ]
}

查詢資產詳情

參數:資產名

{"jsonrpc": "2.0", "method": "get_asset", "params": ["BTS"], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "id": "1.3.0",
        "symbol": "BTS",
        "precision": 5,
        "issuer": "1.2.3",
        "options": {
            "max_supply": "1000000000000000",
            "market_fee_percent": 0,
            "max_market_fee": "1000000000000000",
            "issuer_permissions": 0,
            "flags": 0,
            "core_exchange_rate": {
                "base": {
                    "amount": 1,
                    "asset_id": "1.3.0"
                },
                "quote": {
                    "amount": 1,
                    "asset_id": "1.3.0"
                }
            },
            "whitelist_authorities": [],
            "blacklist_authorities": [],
            "whitelist_markets": [],
            "blacklist_markets": [],
            "description": "",
            "extensions": {}
        },
        "dynamic_asset_data_id": "2.3.0"
    }
}

所有錢包列表

參數:無

{"jsonrpc": "2.0", "method": "list_my_accounts", "params": [], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "id": "1.2.17",
            "membership_expiration_date": "1969-12-31T23:59:59",
            "registrar": "1.2.17",
            "referrer": "1.2.17",
            "lifetime_referrer": "1.2.17",
            "network_fee_percentage": 2000,
            "lifetime_referrer_fee_percentage": 8000,
            "referrer_rewards_percentage": 0,
            "name": "nathan",
            "owner": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                        1
                    ]
                ],
                "address_auths": []
            },
            "active": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                        1
                    ]
                ],
                "address_auths": []
            },
            "options": {
                "memo_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                "voting_account": "1.2.5",
                "num_witness": 0,
                "num_committee": 0,
                "votes": [
                    "0:23",
                    "0:24",
                    "0:25",
                    "0:26",
                    "0:27",
                    "0:28",
                    "0:29"
                ],
                "extensions": []
            },
            "statistics": "2.6.17",
            "whitelisting_accounts": [],
            "blacklisting_accounts": [],
            "whitelisted_accounts": [],
            "blacklisted_accounts": [],
            "cashback_vb": "1.13.0",
            "owner_special_authority": [
                0,
                {}
            ],
            "active_special_authority": [
                0,
                {}
            ],
            "top_n_control_flags": 0
        },
        {
            "id": "1.2.18",
            "membership_expiration_date": "1969-12-31T23:59:59",
            "registrar": "1.2.18",
            "referrer": "1.2.18",
            "lifetime_referrer": "1.2.18",
            "network_fee_percentage": 2000,
            "lifetime_referrer_fee_percentage": 8000,
            "referrer_rewards_percentage": 0,
            "name": "alpha",
            "owner": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                        1
                    ]
                ],
                "address_auths": []
            },
            "active": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                        1
                    ]
                ],
                "address_auths": []
            },
            "options": {
                "memo_key": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                "voting_account": "1.2.5",
                "num_witness": 0,
                "num_committee": 0,
                "votes": [],
                "extensions": []
            },
            "statistics": "2.6.18",
            "whitelisting_accounts": [],
            "blacklisting_accounts": [],
            "whitelisted_accounts": [],
            "blacklisted_accounts": [],
            "cashback_vb": "1.13.1",
            "owner_special_authority": [
                0,
                {}
            ],
            "active_special_authority": [
                0,
                {}
            ],
            "top_n_control_flags": 0
        },
        {
            "id": "1.2.19",
            "membership_expiration_date": "1969-12-31T23:59:59",
            "registrar": "1.2.19",
            "referrer": "1.2.19",
            "lifetime_referrer": "1.2.19",
            "network_fee_percentage": 2000,
            "lifetime_referrer_fee_percentage": 8000,
            "referrer_rewards_percentage": 0,
            "name": "com0",
            "owner": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS5ZYQtrYUPk5ELqJfygsJHnTJ9wDQmFZK4UXH8d6Txqsjg9MdBc",
                        1
                    ]
                ],
                "address_auths": []
            },
            "active": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS5arjFbgDWrqxhuqvvUGpLFCguse3ebKVC4XGcjUnDgdtNT22Dd",
                        1
                    ]
                ],
                "address_auths": []
            },
            "options": {
                "memo_key": "BTS67M2hU4tdqD53DdiUxsNaPrRehq3q8zvgVuwfVy1umu7EDqQLU",
                "voting_account": "1.2.5",
                "num_witness": 0,
                "num_committee": 0,
                "votes": [],
                "extensions": []
            },
            "statistics": "2.6.19",
            "whitelisting_accounts": [],
            "blacklisting_accounts": [],
            "whitelisted_accounts": [],
            "blacklisted_accounts": [],
            "cashback_vb": "1.13.2",
            "owner_special_authority": [
                0,
                {}
            ],
            "active_special_authority": [
                0,
                {}
            ],
            "top_n_control_flags": 0
        },
        {
            "id": "1.2.20",
            "membership_expiration_date": "1969-12-31T23:59:59",
            "registrar": "1.2.20",
            "referrer": "1.2.20",
            "lifetime_referrer": "1.2.20",
            "network_fee_percentage": 2000,
            "lifetime_referrer_fee_percentage": 8000,
            "referrer_rewards_percentage": 0,
            "name": "com1",
            "owner": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS7sKfFcj6KnKNnEeM7ojLXxJd9fhx9oDQduawBgTZsMicac1uqn",
                        1
                    ]
                ],
                "address_auths": []
            },
            "active": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS5rtEW3HgzB6jRTj6gDMprBwdHRcTF13fsydDjKFLEp1xurW74Z",
                        1
                    ]
                ],
                "address_auths": []
            },
            "options": {
                "memo_key": "BTS7kz2cGTXaoDk49fUXr88urAuLEek9gjXrMQw5gkQ7seLD3MSpt",
                "voting_account": "1.2.5",
                "num_witness": 0,
                "num_committee": 0,
                "votes": [],
                "extensions": []
            },
            "statistics": "2.6.20",
            "whitelisting_accounts": [],
            "blacklisting_accounts": [],
            "whitelisted_accounts": [],
            "blacklisted_accounts": [],
            "cashback_vb": "1.13.3",
            "owner_special_authority": [
                0,
                {}
            ],
            "active_special_authority": [
                0,
                {}
            ],
            "top_n_control_flags": 0
        },
        {
            "id": "1.2.21",
            "membership_expiration_date": "1969-12-31T23:59:59",
            "registrar": "1.2.21",
            "referrer": "1.2.21",
            "lifetime_referrer": "1.2.21",
            "network_fee_percentage": 2000,
            "lifetime_referrer_fee_percentage": 8000,
            "referrer_rewards_percentage": 0,
            "name": "com2",
            "owner": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS5yK72A2mSQdnfea7tZ3mbk8bMsg4NbH6nBVFDnAMywSCA6QXei",
                        1
                    ]
                ],
                "address_auths": []
            },
            "active": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS67QpKoWzsZCAEXNkWefxmmGerC2G8hdffQVUeDaf5BbDjDLWCK",
                        1
                    ]
                ],
                "address_auths": []
            },
            "options": {
                "memo_key": "BTS7r7hEmGLdgSuAb7UWZ27YfcFCj2xiUMeCewK5ZX7Xxa4pt9QAX",
                "voting_account": "1.2.5",
                "num_witness": 0,
                "num_committee": 0,
                "votes": [],
                "extensions": []
            },
            "statistics": "2.6.21",
            "whitelisting_accounts": [],
            "blacklisting_accounts": [],
            "whitelisted_accounts": [],
            "blacklisted_accounts": [],
            "cashback_vb": "1.13.4",
            "owner_special_authority": [
                0,
                {}
            ],
            "active_special_authority": [
                0,
                {}
            ],
            "top_n_control_flags": 0
        },
        {
            "id": "1.2.22",
            "membership_expiration_date": "1969-12-31T23:59:59",
            "registrar": "1.2.22",
            "referrer": "1.2.22",
            "lifetime_referrer": "1.2.22",
            "network_fee_percentage": 2000,
            "lifetime_referrer_fee_percentage": 8000,
            "referrer_rewards_percentage": 0,
            "name": "com3",
            "owner": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS4tVaEEqzfguMjddTEc2ax75b2qKFoVSvboUjnrtVQ3Y3etYKYy",
                        1
                    ]
                ],
                "address_auths": []
            },
            "active": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS8mPETTECzSvzSenVTqT8WM4zir7ggfVnEc2AfxxzB52AFeYoyX",
                        1
                    ]
                ],
                "address_auths": []
            },
            "options": {
                "memo_key": "BTS6jwUt27WTrrqQLqMvWHsD9HP83sqDhviuQKxAeD7HpoCjhXnds",
                "voting_account": "1.2.5",
                "num_witness": 0,
                "num_committee": 0,
                "votes": [],
                "extensions": []
            },
            "statistics": "2.6.22",
            "whitelisting_accounts": [],
            "blacklisting_accounts": [],
            "whitelisted_accounts": [],
            "blacklisted_accounts": [],
            "cashback_vb": "1.13.5",
            "owner_special_authority": [
                0,
                {}
            ],
            "active_special_authority": [
                0,
                {}
            ],
            "top_n_control_flags": 0
        },
        {
            "id": "1.2.23",
            "membership_expiration_date": "1969-12-31T23:59:59",
            "registrar": "1.2.23",
            "referrer": "1.2.23",
            "lifetime_referrer": "1.2.23",
            "network_fee_percentage": 2000,
            "lifetime_referrer_fee_percentage": 8000,
            "referrer_rewards_percentage": 0,
            "name": "com4",
            "owner": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS7zNF1rh2quabV6z7hsfojz9328ZUfTBURMRSvReExnFZ1sYsDp",
                        1
                    ]
                ],
                "address_auths": []
            },
            "active": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS7Fnb9TzMQXFsXegEk8rBzUPza8CUUXNFTVn1jWyWH6mX6TNNLv",
                        1
                    ]
                ],
                "address_auths": []
            },
            "options": {
                "memo_key": "BTS6eXTWMGVRyo7V5y3wev6WP5ekH6ULekwByXJMT7wFNGtF8Yb7k",
                "voting_account": "1.2.5",
                "num_witness": 0,
                "num_committee": 0,
                "votes": [],
                "extensions": []
            },
            "statistics": "2.6.23",
            "whitelisting_accounts": [],
            "blacklisting_accounts": [],
            "whitelisted_accounts": [],
            "blacklisted_accounts": [],
            "cashback_vb": "1.13.6",
            "owner_special_authority": [
                0,
                {}
            ],
            "active_special_authority": [
                0,
                {}
            ],
            "top_n_control_flags": 0
        },
        {
            "id": "1.2.24",
            "membership_expiration_date": "1969-12-31T23:59:59",
            "registrar": "1.2.24",
            "referrer": "1.2.24",
            "lifetime_referrer": "1.2.24",
            "network_fee_percentage": 2000,
            "lifetime_referrer_fee_percentage": 8000,
            "referrer_rewards_percentage": 0,
            "name": "com5",
            "owner": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS6TcrQC2biZKGyx8DAZETh4zsLiLcSciLuMKYNimqx6WkT22KKA",
                        1
                    ]
                ],
                "address_auths": []
            },
            "active": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS5jbkaqLgNvKZrDHAEAt3of9PmrU9UWyLKLP3arJFE34T4qvhbJ",
                        1
                    ]
                ],
                "address_auths": []
            },
            "options": {
                "memo_key": "BTS4zLb7M2hAcPBdEiDJQdA5FgYRg1yZeLNTdoARPZ5tk8WJpGAz6",
                "voting_account": "1.2.5",
                "num_witness": 0,
                "num_committee": 0,
                "votes": [],
                "extensions": []
            },
            "statistics": "2.6.24",
            "whitelisting_accounts": [],
            "blacklisting_accounts": [],
            "whitelisted_accounts": [],
            "blacklisted_accounts": [],
            "cashback_vb": "1.13.7",
            "owner_special_authority": [
                0,
                {}
            ],
            "active_special_authority": [
                0,
                {}
            ],
            "top_n_control_flags": 0
        },
        {
            "id": "1.2.25",
            "membership_expiration_date": "1969-12-31T23:59:59",
            "registrar": "1.2.25",
            "referrer": "1.2.25",
            "lifetime_referrer": "1.2.25",
            "network_fee_percentage": 2000,
            "lifetime_referrer_fee_percentage": 8000,
            "referrer_rewards_percentage": 0,
            "name": "com6",
            "owner": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS52ktNc48V9Rkw3cWU51hoMqHRRwk7mDHcrGTQAeRT9bMZzozWc",
                        1
                    ]
                ],
                "address_auths": []
            },
            "active": {
                "weight_threshold": 1,
                "account_auths": [],
                "key_auths": [
                    [
                        "BTS5dFvUh87J3PFU5z9BmuF4AFaLXv8TiXB9Cjdy9taNrVpxYUq1c",
                        1
                    ]
                ],
                "address_auths": []
            },
            "options": {
                "memo_key": "BTS5pLk575W7yRuHsUPEMvWqwUeKPhGPTanqEQRSzUHTTkD9FwNnp",
                "voting_account": "1.2.5",
                "num_witness": 0,
                "num_committee": 0,
                "votes": [],
                "extensions": []
            },
            "statistics": "2.6.25",
            "whitelisting_accounts": [],
            "blacklisting_accounts": [],
            "whitelisted_accounts": [],
            "blacklisted_accounts": [],
            "cashback_vb": "1.13.8",
            "owner_special_authority": [
                0,
                {}
            ],
            "active_special_authority": [
                0,
                {}
            ],
            "top_n_control_flags": 0
        }
    ]
}

見證人列表

參數:最頂層的賬戶名,最大數量

{"jsonrpc": "2.0", "method": "list_witnesses", "params": ["init0",10], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        [
            "init0",
            "1.6.1"
        ],
        [
            "init1",
            "1.6.2"
        ],
        [
            "init10",
            "1.6.11"
        ],
        [
            "init2",
            "1.6.3"
        ],
        [
            "init3",
            "1.6.4"
        ],
        [
            "init4",
            "1.6.5"
        ],
        [
            "init5",
            "1.6.6"
        ],
        [
            "init6",
            "1.6.7"
        ],
        [
            "init7",
            "1.6.8"
        ],
        [
            "init8",
            "1.6.9"
        ]
    ]
}

通過用戶名查詢見證人詳情

參數:見證人賬號

{"jsonrpc": "2.0", "method": "get_witness", "params": ["init0"], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "id": "1.6.1",
        "witness_account": "1.2.6",
        "last_aslot": 3741892,
        "signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
        "pay_vb": "1.13.11",
        "vote_id": "1:0",
        "total_votes": 0,
        "url": "",
        "total_missed": 0,
        "last_confirmed_block_num": 37773
    }
}

通過見證人id查詢見證人詳情

先查詢見證人的普通賬號id

{"jsonrpc": "2.0", "method": "get_object", "params": ["1.6.1"], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "id": "1.6.1",
            "witness_account": "1.2.6",
            "last_aslot": 4186995,
            "signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
            "pay_vb": "1.13.11",
            "vote_id": "1:0",
            "total_votes": "999925340001863",
            "url": "",
            "total_missed": 1,
            "last_confirmed_block_num": 482869
        }
    ]
}

得到見證人對應的witness_account,然後調用同一個方法,將witness_account作爲參數傳入即可

{"jsonrpc": "2.0", "method": "get_object", "params": ["1.2.6"], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "id": "1.2.6",
            "membership_expiration_date": "1969-12-31T23:59:59",
            "registrar": "1.2.6",
            "referrer": "1.2.6",
            "lifetime_referrer": "1.2.6",
            "network_fee_percentage": 2000,
            "lifetime_referrer_fee_percentage": 8000,
            "referrer_rewards_percentage": 0,
            "name": "init0",
            "top_n_control_flags": 0
        }
    ]
}

得到賬戶名name

委員會成員列表

參數:最頂層的賬戶名,最大數量

{"jsonrpc": "2.0", "method": "list_committee_members", "params": ["init0",10], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        [
            "init0",
            "1.5.0"
        ],
        [
            "init1",
            "1.5.1"
        ],
        [
            "init10",
            "1.5.10"
        ],
        [
            "init2",
            "1.5.2"
        ],
        [
            "init3",
            "1.5.3"
        ],
        [
            "init4",
            "1.5.4"
        ],
        [
            "init5",
            "1.5.5"
        ],
        [
            "init6",
            "1.5.6"
        ],
        [
            "init7",
            "1.5.7"
        ],
        [
            "init8",
            "1.5.8"
        ]
    ]
}

查詢委員會賬號詳情

參數:委員會成員賬號

{"jsonrpc": "2.0", "method": "get_committee_member", "params": ["init0"], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "id": "1.5.0",
        "committee_member_account": "1.2.6",
        "vote_id": "0:11",
        "total_votes": 0,
        "url": ""
    }
}

通過交易id查詢交易

鏈接:http://47.56.168.231/index/index/getTransaction?id=0dcdbe50a128deee41a18fe6788b5933a19211ba

參數:id = 交易id

返回:

{
    "code":0,
    "type":"transfer",
    "from":"nathan",
    "to":"alpha",
    "amount":"10000000000",
    "asset":"BTS",
    "fee":2105468,
    "fee_asset":"BTS",
    "memo":"here is the cash",
    "txid":"0dcdbe50a128deee41a18fe6788b5933a19211ba",
    "timestamp":"2019-09-03T03:17:10",
    "block":401
}

創建賬戶

獲取助記詞

參數:無

{"jsonrpc": "2.0", "method": "suggest_brain_key", "params": [], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "brain_priv_key": "IMPLIAL BURLY THYMY CAVITY GUNSHOP STOPE JAPE PENDA TOMBLET COUPLET RECENSE LUE ROTAL CIPPUS PRIER CODICES",
        "wif_priv_key": "5JjmpBny2216AGBXu6jCV9f15aH27fRrczN466MPRv3DarZiVFK",
        "pub_key": "BTS6UL7Q53kW15Tee78fLHZBcxN2Xzjf3bE8PGfYdA1pkZf5om7ks"
    }
}

用助記詞註冊賬號

參數:助記詞,新賬號名(8位以上字母開頭,至少一個數字,特殊字符只能是-),支付費用帳號,推薦人帳號,是否真實創建

例:創建賬號test-123,支付費用帳號和推薦人帳號是nathan

{"jsonrpc": "2.0", "method": "create_account_with_brain_key", "params": ["IMPLIAL BURLY THYMY CAVITY GUNSHOP STOPE JAPE PENDA TOMBLET COUPLET RECENSE LUE ROTAL CIPPUS PRIER CODICES","test-123","nathan","nathan",true], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ref_block_num": 29651,
        "ref_block_prefix": 2513231364,
        "expiration": "2019-09-30T07:28:55",
        "operations": [
            [
                5,
                {
                    "fee": {
                        "amount": 514355,
                        "asset_id": "1.3.0"
                    },
                    "registrar": "1.2.17",
                    "referrer": "1.2.17",
                    "referrer_percent": 0,
                    "name": "test-123",
                    "owner": {
                        "weight_threshold": 1,
                        "account_auths": [],
                        "key_auths": [
                            [
                                "BTS7kPRNM1yzvfKQBagMA6bQiwpAmaGBh6aP6mtr8h1YXX2nD3oWC",
                                1
                            ]
                        ],
                        "address_auths": []
                    },
                    "active": {
                        "weight_threshold": 1,
                        "account_auths": [],
                        "key_auths": [
                            [
                                "BTS85y6zRw4KKxWbbPyEbGGSuBvwXDAMJPoSqRmQvcGDPU3WWGqnP",
                                1
                            ]
                        ],
                        "address_auths": []
                    },
                    "options": {
                        "memo_key": "BTS7WX9CF4bbjkQHheLX4zMggYg6cXCJtPGT1it37dfGE8ctKKbC4",
                        "voting_account": "1.2.5",
                        "num_witness": 0,
                        "num_committee": 0,
                        "votes": [],
                        "extensions": []
                    },
                    "extensions": {}
                }
            ]
        ],
        "extensions": [],
        "signatures": [
            "206100580ba6369cb9d20ed4e1f4c05e61be2d60ca6fef4108e540947c4cd262007d45e2a295bc1eb89790ccc7802457955a035826fc0efeb21f63909192f7d3bb"
        ]
    }
}

賬戶

餘額和資產列表

參數:賬戶名

{"jsonrpc": "2.0", "method": "list_account_balances", "params": ["nathan"], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "amount": "999918734664049",
            "asset_id": "1.3.0"
        }
    ]
}

通過資產id查詢資產信息

參數:資產id

{"jsonrpc": "2.0", "method": "get_asset", "params": ["1.3.0"], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "id": "1.3.0",
        "symbol": "BTS",
        "precision": 5,
        "issuer": "1.2.3",
        "options": {
            "max_supply": "1000000000000000",
            "market_fee_percent": 0,
            "max_market_fee": "1000000000000000",
            "issuer_permissions": 0,
            "flags": 0,
            "core_exchange_rate": {
                "base": {
                    "amount": 1,
                    "asset_id": "1.3.0"
                },
                "quote": {
                    "amount": 1,
                    "asset_id": "1.3.0"
                }
            },
            "whitelist_authorities": [],
            "blacklist_authorities": [],
            "whitelist_markets": [],
            "blacklist_markets": [],
            "description": "",
            "extensions": {}
        },
        "dynamic_asset_data_id": "2.3.0"
    }
}

轉賬

參數:源賬戶名,要發往的賬戶名,金額,幣種,備註

{"jsonrpc": "2.0", "method": "transfer2", "params": ["nathan","alpha",10,"BTS","This is memo"], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        "a31884057f4c20724acb54c6817b709892a89de5",
        {
            "ref_block_num": 35238,
            "ref_block_prefix": 4037660452,
            "expiration": "2019-09-19T06:07:45",
            "operations": [
                [
                    0,
                    {
                        "fee": {
                            "amount": 2105468,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 1000000,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "14845433245050049736",
                            "message": "199b07f4622468588c88c88d9a4349b8842c2efbe535d99b74eba99e70e225f5"
                        },
                        "extensions": []
                    }
                ]
            ],
            "extensions": [],
            "signatures": [
                "200ecd4ddb9a9563b54f34e68ac218404ad8006a0b6efb5d8c118bb768542c787a7c7fbefecd41422702d94ce0f4890afd60311a55fb717801aad647d1b7df8d23"
            ]
        }
    ]
}

近期活動

參數:賬號名,獲取數量

{"jsonrpc": "2.0", "method": "get_account_history", "params": ["nathan",10], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "memo": "",
            "description": "Create Account 'test-123'   (Fee: 5.14355 BTS)",
            "op": {
                "id": "1.11.54",
                "op": [
                    5,
                    {
                        "fee": {
                            "amount": 514355,
                            "asset_id": "1.3.0"
                        },
                        "registrar": "1.2.17",
                        "referrer": "1.2.17",
                        "referrer_percent": 0,
                        "name": "test-123",
                        "owner": {
                            "weight_threshold": 1,
                            "account_auths": [],
                            "key_auths": [
                                [
                                    "BTS7kPRNM1yzvfKQBagMA6bQiwpAmaGBh6aP6mtr8h1YXX2nD3oWC",
                                    1
                                ]
                            ],
                            "address_auths": []
                        },
                        "active": {
                            "weight_threshold": 1,
                            "account_auths": [],
                            "key_auths": [
                                [
                                    "BTS85y6zRw4KKxWbbPyEbGGSuBvwXDAMJPoSqRmQvcGDPU3WWGqnP",
                                    1
                                ]
                            ],
                            "address_auths": []
                        },
                        "options": {
                            "memo_key": "BTS7WX9CF4bbjkQHheLX4zMggYg6cXCJtPGT1it37dfGE8ctKKbC4",
                            "voting_account": "1.2.5",
                            "num_witness": 0,
                            "num_committee": 0,
                            "votes": [],
                            "extensions": []
                        },
                        "extensions": {}
                    }
                ],
                "result": [
                    1,
                    "1.2.26"
                ],
                "block_num": 226260,
                "trx_in_block": 0,
                "op_in_trx": 0,
                "virtual_op": 0
            }
        },
        {
            "memo": "This is memo",
            "description": "Transfer 10 BTS from nathan to alpha -- Memo: This is memo   (Fee: 21.05468 BTS)",
            "op": {
                "id": "1.11.53",
                "op": [
                    0,
                    {
                        "fee": {
                            "amount": 2105468,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 1000000,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "14845433245050049736",
                            "message": "199b07f4622468588c88c88d9a4349b8842c2efbe535d99b74eba99e70e225f5"
                        },
                        "extensions": []
                    }
                ],
                "result": [
                    0,
                    {}
                ],
                "block_num": 35239,
                "trx_in_block": 0,
                "op_in_trx": 0,
                "virtual_op": 0
            }
        },
        {
            "memo": "1231456",
            "description": "Transfer 1 BTS from nathan to alpha -- Memo: 1231456   (Fee: 20.89843 BTS)",
            "op": {
                "id": "1.11.52",
                "op": [
                    0,
                    {
                        "fee": {
                            "amount": 2089843,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 100000,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "505970742877495025",
                            "message": "ac61bc16cfb0e9c0db19758388a51214"
                        },
                        "extensions": []
                    }
                ],
                "result": [
                    0,
                    {}
                ],
                "block_num": 19868,
                "trx_in_block": 0,
                "op_in_trx": 0,
                "virtual_op": 0
            }
        },
        {
            "memo": "22222",
            "description": "Transfer 1.11111 BTS from nathan to alpha -- Memo: 22222   (Fee: 20.89843 BTS)",
            "op": {
                "id": "1.11.51",
                "op": [
                    0,
                    {
                        "fee": {
                            "amount": 2089843,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 111111,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "11674897818616179291",
                            "message": "69cc001a11d3007923dc4d00d28cac1f"
                        },
                        "extensions": []
                    }
                ],
                "result": [
                    0,
                    {}
                ],
                "block_num": 19840,
                "trx_in_block": 0,
                "op_in_trx": 0,
                "virtual_op": 0
            }
        },
        {
            "memo": "1111",
            "description": "Transfer 1.11111 BTS from nathan to alpha -- Memo: 1111   (Fee: 20.89843 BTS)",
            "op": {
                "id": "1.11.50",
                "op": [
                    0,
                    {
                        "fee": {
                            "amount": 2089843,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 111111,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "9873457945687579511",
                            "message": "73a3be1a5879273ef17ef1704a09309a"
                        },
                        "extensions": []
                    }
                ],
                "result": [
                    0,
                    {}
                ],
                "block_num": 15444,
                "trx_in_block": 0,
                "op_in_trx": 0,
                "virtual_op": 0
            }
        },
        {
            "memo": "1111",
            "description": "Transfer 1.10000 BTS from nathan to alpha -- Memo: 1111   (Fee: 20.89843 BTS)",
            "op": {
                "id": "1.11.49",
                "op": [
                    0,
                    {
                        "fee": {
                            "amount": 2089843,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 110000,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "578028314678850645",
                            "message": "c8813ee24bc9f75054379b6597ebd32f"
                        },
                        "extensions": []
                    }
                ],
                "result": [
                    0,
                    {}
                ],
                "block_num": 15421,
                "trx_in_block": 0,
                "op_in_trx": 0,
                "virtual_op": 0
            }
        },
        {
            "memo": "1111",
            "description": "Transfer 1 BTS from nathan to alpha -- Memo: 1111   (Fee: 20.89843 BTS)",
            "op": {
                "id": "1.11.48",
                "op": [
                    0,
                    {
                        "fee": {
                            "amount": 2089843,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 100000,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "1226546660888413102",
                            "message": "f5ca6ac11b5a35c4b38cba6a29e8dbb6"
                        },
                        "extensions": []
                    }
                ],
                "result": [
                    0,
                    {}
                ],
                "block_num": 15394,
                "trx_in_block": 0,
                "op_in_trx": 0,
                "virtual_op": 0
            }
        },
        {
            "memo": "here is the cash",
            "description": "Transfer 10.11111 BTS from nathan to alpha -- Memo: here is the cash   (Fee: 21.05468 BTS)",
            "op": {
                "id": "1.11.47",
                "op": [
                    0,
                    {
                        "fee": {
                            "amount": 2105468,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 1011111,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "18160081259166631953",
                            "message": "81cc43710b389adbd4d56c40c1428b1729e08edff97ad4786e20e2caa4f0fb19"
                        },
                        "extensions": []
                    }
                ],
                "result": [
                    0,
                    {}
                ],
                "block_num": 15267,
                "trx_in_block": 0,
                "op_in_trx": 0,
                "virtual_op": 0
            }
        },
        {
            "memo": "here is the cash",
            "description": "Transfer 10.11100 BTS from nathan to alpha -- Memo: here is the cash   (Fee: 21.05468 BTS)",
            "op": {
                "id": "1.11.46",
                "op": [
                    0,
                    {
                        "fee": {
                            "amount": 2105468,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 1011100,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "7855845311644090944",
                            "message": "cbd9b0f5aa51d4a9fc1dc8f5338d16d3148fa68d9e917580cbe9d06e0df97f21"
                        },
                        "extensions": []
                    }
                ],
                "result": [
                    0,
                    {}
                ],
                "block_num": 15247,
                "trx_in_block": 0,
                "op_in_trx": 0,
                "virtual_op": 0
            }
        },
        {
            "memo": "test transfer2",
            "description": "Transfer 1 BTS from nathan to alpha -- Memo: test transfer2   (Fee: 21.05468 BTS)",
            "op": {
                "id": "1.11.45",
                "op": [
                    0,
                    {
                        "fee": {
                            "amount": 2105468,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.17",
                        "to": "1.2.18",
                        "amount": {
                            "amount": 100000,
                            "asset_id": "1.3.0"
                        },
                        "memo": {
                            "from": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                            "to": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                            "nonce": "7279384504810601963",
                            "message": "18df1913c8b10bb1e16722c6d170cbb5c865454db16e49a4eb9c9241840e77b9"
                        },
                        "extensions": []
                    }
                ],
                "result": [
                    0,
                    {}
                ],
                "block_num": 4344,
                "trx_in_block": 0,
                "op_in_trx": 0,
                "virtual_op": 0
            }
        }
    ]
}

查看指定類型的活動

參數:賬戶名,活動ID數組,開始下標,獲取數量

{"jsonrpc": "2.0", "method": "get_account_history_by_operations", "params": ["nathan",[0,5],1,1], "id": 2}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "total_count": 3,
        "result_count": 1,
        "details": [
            {
                "memo": "",
                "description": "Create Account 'alpha'   (Fee: 2000.14062 BTS)",
                "op": {
                    "id": "1.11.2",
                    "op": [
                        5,
                        {
                            "fee": {
                                "amount": 200014062,
                                "asset_id": "1.3.0"
                            },
                            "registrar": "1.2.17",
                            "referrer": "1.2.17",
                            "referrer_percent": 0,
                            "name": "alpha",
                            "owner": {
                                "weight_threshold": 1,
                                "account_auths": [],
                                "key_auths": [
                                    [
                                        "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                                        1
                                    ]
                                ],
                                "address_auths": []
                            },
                            "active": {
                                "weight_threshold": 1,
                                "account_auths": [],
                                "key_auths": [
                                    [
                                        "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                                        1
                                    ]
                                ],
                                "address_auths": []
                            },
                            "options": {
                                "memo_key": "BTS5VS9fuuzs5exawXmVxvM94fKjtJR6nRQQqbdStnXV8V4ihGExQ",
                                "voting_account": "1.2.5",
                                "num_witness": 0,
                                "num_committee": 0,
                                "votes": [],
                                "extensions": []
                            },
                            "extensions": {}
                        }
                    ],
                    "result": [
                        1,
                        "1.2.18"
                    ],
                    "block_num": 336,
                    "trx_in_block": 0,
                    "op_in_trx": 0,
                    "virtual_op": 0
                },
                "transaction_id": "0ab9dd21324f024194811d707dc33d2c82e061bf"
            }
        ]
    }
}

投票

投票給超級節點

需要支付費用,所有必須要有餘額

參數:投票賬號,超級節點賬號,投票(true)或取消投票(false),是否廣播交易

{"jsonrpc": "2.0", "method": "vote_for_witness", "params": ["nathan","init0",true,true], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ref_block_num": 38663,
        "ref_block_prefix": 336266918,
        "expiration": "2019-10-08T10:04:55",
        "operations": [
            [
                6,
                {
                    "fee": {
                        "amount": 2008398,
                        "asset_id": "1.3.0"
                    },
                    "account": "1.2.17",
                    "new_options": {
                        "memo_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                        "voting_account": "1.2.5",
                        "num_witness": 0,
                        "num_committee": 0,
                        "votes": [
                            "1:0",
                            "0:23",
                            "0:24",
                            "0:25",
                            "0:26",
                            "0:27",
                            "0:28",
                            "0:29"
                        ],
                        "extensions": []
                    },
                    "extensions": {}
                }
            ]
        ],
        "extensions": [],
        "signatures": [
            "1f64b5c1e6c61a56068fb32e280669f5c6d6a14f6b04cf6116a804c06dd86cfc0f335cb1ab8242daeadd0f88caa05f25a193ec7fa94ef3074d1afad2d6c368347c"
        ]
    }
}

投票給理事會成員

需要支付費用,所有必須要有餘額

參數:投票賬號,理事會成員賬號,投票(true)或取消投票(false),是否廣播交易

{"jsonrpc": "2.0", "method": "vote_for_committee_member", "params": ["nathan","init0",true,true], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ref_block_num": 38687,
        "ref_block_prefix": 1350493683,
        "expiration": "2019-10-08T10:06:55",
        "operations": [
            [
                6,
                {
                    "fee": {
                        "amount": 2008789,
                        "asset_id": "1.3.0"
                    },
                    "account": "1.2.17",
                    "new_options": {
                        "memo_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
                        "voting_account": "1.2.5",
                        "num_witness": 0,
                        "num_committee": 0,
                        "votes": [
                            "1:0",
                            "0:11",
                            "0:23",
                            "0:24",
                            "0:25",
                            "0:26",
                            "0:27",
                            "0:28",
                            "0:29"
                        ],
                        "extensions": []
                    },
                    "extensions": {}
                }
            ]
        ],
        "extensions": [],
        "signatures": [
            "1f108b1f4155b2f50f994cb4f9665435f198037969e5e8242bdfb8b688715b69a728fecdf6edc575e56aee7e2b1b745d3e2160ffb026dad3dbf7c498ef77b551b3"
        ]
    }
}

資產

資產列表

參數:列表中第一個資產的符號(可以是空),獲取數量(最大100)

{"jsonrpc": "2.0", "method": "list_assets", "params": ["",10], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "id": "1.3.0",
            "symbol": "BTS",
            "precision": 5,
            "issuer": "1.2.3",
            "options": {
                "max_supply": "1000000000000000",
                "market_fee_percent": 0,
                "max_market_fee": "1000000000000000",
                "issuer_permissions": 0,
                "flags": 0,
                "core_exchange_rate": {
                    "base": {
                        "amount": 1,
                        "asset_id": "1.3.0"
                    },
                    "quote": {
                        "amount": 1,
                        "asset_id": "1.3.0"
                    }
                },
                "whitelist_authorities": [],
                "blacklist_authorities": [],
                "whitelist_markets": [],
                "blacklist_markets": [],
                "description": "",
                "extensions": {}
            },
            "dynamic_asset_data_id": "2.3.0"
        }
    ]
}

創建資產

暫無

查詢見證人詳情

參數:見證人賬號

{"jsonrpc": "2.0", "method": "get_witness", "params": ["init0"], "id": 1}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "id": "1.6.1",
        "witness_account": "1.2.6",
        "last_aslot": 3741892,
        "signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
        "pay_vb": "1.13.11",
        "vote_id": "1:0",
        "total_votes": 0,
        "url": "",
        "total_missed": 0,
        "last_confirmed_block_num": 37773
    }
}

活動id對照表

ID 活動命令 備註
0 transfer_operation 轉賬
1 limit_order_create_operation
2 limit_order_cancel_operation
3 call_order_update_operation
4 fill_order_operation
5 account_create_operation 創建賬戶
6 account_update_operation 更新賬戶
7 account_whitelist_operation
8 account_upgrade_operation 升級賬號
9 account_transfer_operation
10 asset_create_operation 創建資產
11 asset_update_operation
12 asset_update_bitasset_operation
13 asset_update_feed_producers_operation
14 asset_issue_operation
15 asset_reserve_operation
16 asset_fund_fee_pool_operation
17 asset_settle_operation
18 asset_global_settle_operation
19 asset_publish_feed_operation
20 witness_create_operation 創建見證人
21 witness_update_operation
22 proposal_create_operation
23 proposal_update_operation
24 proposal_delete_operation
25 withdraw_permission_create_operation
26 withdraw_permission_update_operation
27 withdraw_permission_claim_operation
28 withdraw_permission_delete_operation
29 committee_member_create_operation 創建理事會成員
30 committee_member_update_operation
31 committee_member_update_global_paramet
32 vesting_balance_create_operation
33 vesting_balance_withdraw_operation
34 worker_create_operation
35 custom_operation
36 assert_operation
37 balance_claim_operation 導入餘額
38 override_transfer_operation
39 transfer_to_blind_operation
40 blind_transfer_operation
41 transfer_from_blind_operation
42 asset_settle_cancel_operation
43 asset_claim_fees_operation
44 fba_distribute_operation
45 bid_collateral_operation
46 execute_bid_operation
47 asset_claim_pool_operation
48 asset_update_issuer_operation
49 custom_authority_create_operation
50 custom_authority_update_operation
51 custom_authority_delete_operation
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章