├── README.md ├── blockchain_api.md └── wallet_api.md /README.md: -------------------------------------------------------------------------------- 1 | ### DECENT Bootstrap 2 | 3 | [1. DECENT Core Installation Guide](https://github.com/DECENTfoundation/DECENT-Network/blob/master/README.md) 4 | 5 | [2. DECENT Wallet API](https://github.com/unin/unin-decent/blob/master/wallet_api.md) 6 | 7 | [3. DECENT Blockchain API](https://github.com/unin/unin-decent/blob/master/blockchain_api.md) 8 | -------------------------------------------------------------------------------- /blockchain_api.md: -------------------------------------------------------------------------------- 1 | # DECENT Blockchain API Document 2 | 3 | 4 | 5 | - [1. Introduction](#1-introduction) 6 | - [1.1 How to call blockchain API](#11-how-to-call-blockchain-api) 7 | - [1.1.1 HTTP Calls](#111-http-calls) 8 | - [1.1.2 WebSocket Calls](#112-websocket-calls) 9 | - [1.2 Category](#12-category) 10 | - [2 API Definition](#2-api-definition) 11 | - [2.1 Login APIs](#21-login-apis) 12 | - [LOGIN](#login) 13 | - [login](#login) 14 | - [REGISTRATION](#registration) 15 | - [network_broadcast](#networkbroadcast) 16 | - [database](#database) 17 | - [history](#history) 18 | - [network_node](#networknode) 19 | - [crypto](#crypto) 20 | - [debug](#debug) 21 | - [messaging](#messaging) 22 | - [2.2 Database APIs](#22-database-apis) 23 | - [Subscriptions](#subscriptions) 24 | - [set_subscribe_callback](#setsubscribecallback) 25 | - [set_pending_transaction_callback](#setpendingtransactioncallback) 26 | - [set_block_applied_callback](#setblockappliedcallback) 27 | - [cancel_all_subscriptions](#cancelallsubscriptions) 28 | - [get_subscription](#getsubscription) 29 | - [list_active_subscriptions_by_consumer](#listactivesubscriptionsbyconsumer) 30 | - [list_subscriptions_by_consumer](#listsubscriptionsbyconsumer) 31 | - [list_active_subscriptions_by_author](#listactivesubscriptionsbyauthor) 32 | - [list_subscriptions_by_author](#listsubscriptionsbyauthor) 33 | - [Blocks and transactions](#blocks-and-transactions) 34 | - [get_block_header](#getblockheader) 35 | - [get_block](#getblock) 36 | - [get_transaction](#gettransaction) 37 | - [get_recent_transaction_by_id](#getrecenttransactionbyid) 38 | - [GLOBALS](#globals) 39 | - [get_chain_properties](#getchainproperties) 40 | - [get_global_properties](#getglobalproperties) 41 | - [get_config](#getconfig) 42 | - [get_chain_id](#getchainid) 43 | - [get_dynamic_global_properties](#getdynamicglobalproperties) 44 | - [KEYS](#keys) 45 | - [get_key_references](#getkeyreferences) 46 | - [generate_content_keys](#generatecontentkeys) 47 | - [restore_encryption_key](#restoreencryptionkey) 48 | - [ACCOUNTS](#accounts) 49 | - [get_accounts](#getaccounts) 50 | - [get_full_accounts](#getfullaccounts) 51 | - [get_account_by_name](#getaccountbyname) 52 | - [get_account_references](#getaccountreferences) 53 | - [lookup_account_names](#lookupaccountnames) 54 | - [lookup_accounts](#lookupaccounts) 55 | - [get_account_count](#getaccountcount) 56 | - [BALANCES](#balances) 57 | - [get_account_balances](#getaccountbalances) 58 | - [get_named_account_balances](#getnamedaccountbalances) 59 | - [get_vesting_balances](#getvestingbalances) 60 | - [ASSETS](#assets) 61 | - [get_assets](#getassets) 62 | - [list_assets](#listassets) 63 | - [lookup_asset_symbols](#lookupassetsymbols) 64 | - [get_real_supply](#getrealsupply) 65 | - [MINERS](#miners) 66 | - [get_miners](#getminers) 67 | - [get_miner_by_account](#getminerbyaccount) 68 | - [lookup_miner_accounts](#lookupmineraccounts) 69 | - [get_miner_count](#getminercount) 70 | - [VOTES](#votes) 71 | - [lookup_vote_ids](#lookupvoteids) 72 | - [AUTHORITY & VALIDATION](#authority-validation) 73 | - [get_transaction_hex](#gettransactionhex) 74 | - [get_required_signatures](#getrequiredsignatures) 75 | - [get_potential_signatures](#getpotentialsignatures) 76 | - [verify_authority](#verifyauthority) 77 | - [verify_account_authority](#verifyaccountauthority) 78 | - [validate_transaction](#validatetransaction) 79 | - [get_required_fees](#getrequiredfees) 80 | - [PROPOSED TRANSACTIONS](#proposed-transactions) 81 | - [get_proposed_transactions](#getproposedtransactions) 82 | - [BLOCK](#block) 83 | - [head_block_time](#headblocktime) 84 | - [get_new_asset_per_block](#getnewassetperblock) 85 | - [get_asset_per_block_by_block_num](#getassetperblockbyblocknum) 86 | - [get_time_to_maint_by_block_time](#gettimetomaintbyblocktime) 87 | - [CONTENTS](#contents) 88 | - [set_content_update_callback](#setcontentupdatecallback) 89 | - [get_content](#getcontent) 90 | - [search_content](#searchcontent) 91 | - [get_feeds_by_miner](#getfeedsbyminer) 92 | - [PUBLISHERS & SEEDERS](#publishers-seeders) 93 | - [list_publishing_managers](#listpublishingmanagers) 94 | - [list_publishers_by_price](#listpublishersbyprice) 95 | - [list_seeders_by_upload](#listseedersbyupload) 96 | - [list_seeders_by_region](#listseedersbyregion) 97 | - [list_seeders_by_rating](#listseedersbyrating) 98 | - [get_seeder](#getseeder) 99 | - [BUYINGS](#buyings) 100 | - [get_open_buyings](#getopenbuyings) 101 | - [get_open_buyings_by_URI](#getopenbuyingsbyuri) 102 | - [get_open_buyings_by_consumer](#getopenbuyingsbyconsumer) 103 | - [get_buying_by_consumer_URI](#getbuyingbyconsumeruri) 104 | - [get_buying_history_objects_by_consumer](#getbuyinghistoryobjectsbyconsumer) 105 | - [get_buying_objects_by_consumer](#getbuyingobjectsbyconsumer) 106 | - [DCT](#dct) 107 | - [price_to_dct](#pricetodct) 108 | - [2.3 History APIs](#23-history-apis) 109 | - [ACCOUNTS](#accounts) 110 | - [get_account_history](#getaccounthistory) 111 | - [get_relative_account_history](#getrelativeaccounthistory) 112 | - [2.4 Network Broadcast APIs](#24-network-broadcast-apis) 113 | - [TRANSACTIONS](#transactions) 114 | - [broadcast_transaction](#broadcasttransaction) 115 | - [broadcast_transaction_with_callback](#broadcasttransactionwithcallback) 116 | - [BLOCK](#block) 117 | - [broadcast_block](#broadcastblock) 118 | - [2.5 Network Node APIs](#25-network-node-apis) 119 | - [OBTAIN NETWORK INFORMATION](#obtain-network-information) 120 | - [get_info](#getinfo) 121 | - [get_connected_peers](#getconnectedpeers) 122 | - [get_potential_peers](#getpotentialpeers) 123 | - [get_advanced_node_parameters](#getadvancednodeparameters) 124 | - [CHANGE NETWORK SETTINGS](#change-network-settings) 125 | - [add_node](#addnode) 126 | - [set_advanced_node_parameters](#setadvancednodeparameters) 127 | - [seeding_startup](#seedingstartup) 128 | 129 | 130 | 131 | # 1. Introduction 132 | 133 | ## 1.1 How to call blockchain API 134 | 135 | ### 1.1.1 HTTP Calls 136 | 137 | HTTP call are only supported by database APIs. Starting decentd will by default expose port 8090 as HTTP endpoint. These APIs can be called via any HTTP Client or compatible SDK for multiple programming languages. 138 | 139 | Both request and response of these APIs are JSON formated. The request must follow JSON-RPC 2.0 specifications, including four base elements: 140 | 141 | 1. id (any integer specified, simply to remark the sequence of API call) 142 | 2. method (the name of API to be revoked) 143 | 3. params (a list of parameters of this API) 144 | 145 | **request:** 146 | `` > { 147 | "jsonrpc": "2.0", 148 | "method": "head_block_time", 149 | "params": [], 150 | "id": 1 151 | }`` 152 | 153 | **response:** 154 | `` < { 155 | "id": 1, 156 | "result": "2017-10-06T10:49:35" 157 | }`` 158 | 159 | 160 | ### 1.1.2 WebSocket Calls 161 | 162 | APIs of all categories, e.g. database, login, network_node, network_broadcast, can be called via WebSocket. Starting decentd will by default expose port 8090 as WebSocket endpoint. These APIs can be called via any Websocket Client or compatible SDK for multiple programming languages. 163 | 164 | Both request and response of these APIs are JSON formated. The request must follow JSON-RPC 2.0 specifications, including four base elements: 165 | 166 | 1. id (any integer specified, simply to remark the sequence of API call) 167 | 2. method (always "call" in our case) 168 | 3. params (a list of parameters, the first element is "API identifier", the second element is the name of API to be revoked) 169 | 170 | **request:** 171 | `` > { 172 | "id": 10, 173 | "method": "call", 174 | "params": [ 175 | 1, 176 | "messaging", 177 | [] 178 | ] 179 | }`` 180 | 181 | **response:** 182 | `` < { 183 | "id": 1, 184 | "result": 8 185 | }`` 186 | 187 | 188 | 189 | ## 1.2 Category 190 | 191 | 192 | 1. Login 193 | **Description:** A series of APIs to login to the RPC server and get API identifiers. 194 | **Identifier:** 1 195 | **Protocol:** WebSocket 196 | 197 | 2. Database 198 | **Description:** A series of APIs to query data from DECENT network which is visible to anyone. 199 | **Identifier:** 0 200 | **Protocol:** WebSocket, HTTP 201 | 202 | 3. history 203 | **Description:** A series of APIs to query historical data related to the account. 204 | **Identifier:** An integer greater than 1, depends on sequence of invoke. 205 | **Protocol:** WebSocket 206 | 207 | 4. network_broadcast 208 | **Description:** A series of APIs to broadcast state to the network. 209 | **Identifier:** An integer greater than 1, depends on sequence of invoke. 210 | **Protocol:** WebSocket 211 | 212 | 5. network_node 213 | **Description:** A series of APIs to manage network nodes. 214 | **Identifier:** An integer greater than 1, depends on sequence of invoke. 215 | **Protocol:** WebSocket 216 | 217 | 218 | 219 | 220 | # 2 API Definition 221 | 222 | ## 2.1 Login APIs 223 | 224 | ### LOGIN 225 | 226 | #### login 227 | **Description:** Login to RPC server in current session. 228 | **Parameters:** 229 | 230 | | name | type | desc | 231 | | -------- | -------- | -------- | 232 | | user | string | ... | 233 | | password | string | ... | 234 | 235 | **Returns:** response status 236 | **Example:** 237 | `` > { 238 | "id": 10, 239 | "method": "call", 240 | "params": [ 241 | 1, 242 | "login", 243 | [ 244 | "myusername", 245 | "mypassword" 246 | ] 247 | ] 248 | } `` 249 | 250 | `` < { 251 | "id": 10, 252 | "result": true 253 | }`` 254 | 255 | ---- 256 | 257 | ### REGISTRATION 258 | 259 | #### network_broadcast 260 | **Description:** Get network_broadcast API identifier. 261 | **Returns:** response status 262 | **Example:** 263 | `` > { 264 | "id": 10, 265 | "method": "call", 266 | "params": [ 267 | 1, 268 | "network_broadcast", 269 | [] 270 | ] 271 | } `` 272 | 273 | `` < { 274 | "id": 1, 275 | "result": 2 276 | }`` 277 | 278 | ---- 279 | 280 | #### database 281 | **Description:** Get database API identifier. 282 | **Returns:** response status 283 | **Example:** 284 | `` > { 285 | "id": 10, 286 | "method": "call", 287 | "params": [ 288 | 1, 289 | "database", 290 | [] 291 | ] 292 | }`` 293 | 294 | `` < { 295 | "id": 1, 296 | "result": 3 297 | }`` 298 | 299 | ---- 300 | 301 | #### history 302 | **Description:** Get history API identifier. 303 | **Returns:** response status 304 | **Example:** 305 | `` > { 306 | "id": 10, 307 | "method": "call", 308 | "params": [ 309 | 1, 310 | "history", 311 | [] 312 | ] 313 | }`` 314 | 315 | `` < { 316 | "id": 1, 317 | "result": 4 318 | }`` 319 | 320 | ---- 321 | 322 | #### network_node 323 | **Description:** Get network_node API identifier. 324 | **Returns:** response status 325 | **Example:** 326 | `` > { 327 | "id": 10, 328 | "method": "call", 329 | "params": [ 330 | 1, 331 | "network_node", 332 | [] 333 | ] 334 | }`` 335 | 336 | `` < { 337 | "id": 1, 338 | "result": 5 339 | }`` 340 | 341 | ---- 342 | 343 | #### crypto 344 | **Description:** Get network_broadcast API identifier. 345 | **Returns:** response status 346 | **Example:** 347 | `` > { 348 | "id": 10, 349 | "method": "call", 350 | "params": [ 351 | 1, 352 | "crypto", 353 | [] 354 | ] 355 | }`` 356 | 357 | `` < { 358 | "id": 1, 359 | "result": 6 360 | }`` 361 | 362 | ---- 363 | 364 | #### debug 365 | **Description:** Get debug API identifier. 366 | **Returns:** response status 367 | **Example:** 368 | `` > { 369 | "id": 10, 370 | "method": "call", 371 | "params": [ 372 | 1, 373 | "debug", 374 | [] 375 | ] 376 | }`` 377 | 378 | `` < { 379 | "id": 1, 380 | "result": 7 381 | }`` 382 | 383 | ---- 384 | 385 | #### messaging 386 | **Description:** Get messaging API identifier. 387 | **Returns:** response status 388 | **Example:** 389 | `` > { 390 | "id": 10, 391 | "method": "call", 392 | "params": [ 393 | 1, 394 | "messaging", 395 | [] 396 | ] 397 | }`` 398 | 399 | `` < { 400 | "id": 1, 401 | "result": 8 402 | }`` 403 | 404 | ---- 405 | 406 | ## 2.2 Database APIs 407 | 408 | ### Subscriptions 409 | 410 | #### set_subscribe_callback 411 | **Description:** Set callback function when subscribe. 412 | **Parameters:** 413 | 414 | | name | type | desc | 415 | | -------- | -------- | -------- | 416 | | cb | confirmation_callback | callback confirmation | 417 | | clear_filter | bool | ... | 418 | 419 | **Returns:** response status 420 | 421 | ---- 422 | 423 | #### set_pending_transaction_callback 424 | **Description:** Set callback function when pending transaction. 425 | **Parameters:** 426 | 427 | | name | type | desc | 428 | | -------- | -------- | -------- | 429 | | cb | confirmation_callback | callback confirmation | 430 | 431 | **Returns**: response status 432 | 433 | ---- 434 | 435 | #### set_block_applied_callback 436 | **Method:** set_block_applied_callback 437 | **Description:** set callback function when block applied 438 | **Parameters:** 439 | 440 | | name | type | desc | 441 | | -------- | -------- | -------- | 442 | | cb | confirmation_callback | callback confirmation | 443 | 444 | **Returns**: response status 445 | 446 | ---- 447 | 448 | #### cancel_all_subscriptions 449 | **Description:** Stop receiving any notifications. 450 | **Returns:** response status 451 | **Note:** This unsubscribes from all subscribed markets and objects. 452 | 453 | ---- 454 | 455 | #### get_subscription 456 | **Description:** Query for a subscription object by ID. 457 | **Parameters:** 458 | 459 | | name | type | desc | 460 | | -------- | -------- | -------- | 461 | | sid | subscription_id_type | ID of the subscription to retrieve | 462 | 463 | **Returns:** subscription object 464 | 465 | ---- 466 | 467 | #### list_active_subscriptions_by_consumer 468 | **Description:** Query for a list of active (not expired) subscriptions to account (consumer). 469 | **Parameters:** 470 | 471 | | name | type | desc | 472 | | -------- | -------- | -------- | 473 | | account | account_id_type | account ID | 474 | | count | uint32_t | maximum number of subscription objects to fetch (must not exceed 100) | 475 | 476 | **Returns:** list of subscription object 477 | 478 | ---- 479 | 480 | #### list_subscriptions_by_consumer 481 | **Description:** Query for a list of subscriptions subscribed to account (consumer). 482 | **Parameters:** 483 | 484 | | name | type | desc | 485 | | -------- | -------- | -------- | 486 | | account | account_id_type | account ID | 487 | | count | uint32_t | maximum number of subscription objects to fetch (must not exceed 100) | 488 | 489 | **Returns:** list of subscription object 490 | 491 | ---- 492 | 493 | #### list_active_subscriptions_by_author 494 | **Description:** Query for a list of active (not expired) subscriptions to account (author). 495 | **Parameters:** 496 | 497 | | name | type | desc | 498 | | -------- | -------- | -------- | 499 | | account | account_id_type | account ID | 500 | | count | uint32_t | maximum number of subscription objects to fetch (must not exceed 100) | 501 | 502 | **Returns:** list of subscription object 503 | 504 | ---- 505 | 506 | #### list_subscriptions_by_author 507 | **Description:** Query for a list of subscriptions subscribed to account. (author) 508 | **Parameters:** 509 | 510 | | name | type | desc | 511 | | -------- | -------- | -------- | 512 | | account | account_id_type | account ID | 513 | | count | uint32_t | maximum number of subscription objects to fetch (must not exceed 100) | 514 | 515 | **Returns:** list of subscription object 516 | 517 | ---- 518 | 519 | ### Blocks and transactions 520 | 521 | #### get_block_header 522 | **Description:** Retrieve block header. 523 | **Parameters:** 524 | 525 | | name | type | desc | 526 | | -------- | -------- | -------- | 527 | | block_num | uint32_t | height of the block whose header should be returned | 528 | 529 | **Returns:** header of the referenced block 530 | **Example:** 531 | `` > { 532 | "jsonrpc": "2.0", 533 | "method": "get_block_header", 534 | "params": [1658953], 535 | "id": 1 536 | }`` 537 | 538 | `` < {"id": 1, 539 | "result": { 540 | "previous": "0019504822e648793fbdc842f541b7bb468de492", 541 | "timestamp": "2017-10-06T08:32:50", 542 | "miner": "1.4.165", 543 | "transaction_merkle_root": "0000000000000000000000000000000000000000", 544 | "extensions": [] 545 | } 546 | }`` 547 | 548 | ---- 549 | 550 | #### get_block 551 | **Description:** Retrieve a full, signed block. 552 | **Parameters:** 553 | 554 | | name | type | desc | 555 | | -------- | -------- | -------- | 556 | | block_num | uint32_t | height of the block to be returned | 557 | 558 | **Returns:** referenced block 559 | **Example:** 560 | `` > { 561 | "jsonrpc": "2.0", 562 | "method": "get_block", 563 | "params": [1658953], 564 | "id": 1 565 | }`` 566 | 567 | `` > { 568 | "id": 1, 569 | "result": { 570 | "previous": "0019504822e648793fbdc842f541b7bb468de492", 571 | "timestamp": "2017-10-06T08:32:50", 572 | "miner": "1.4.165", 573 | "transaction_merkle_root": "0000000000000000000000000000000000000000", 574 | "extensions": [], 575 | "miner_signature": "1f5f0450e22edcd78fb87a7ad03cb91d26553215e0eff185bc6416addc6b202f01286adab94022f309d9cebd3a1c9c9d838ce148e4121b011db6889e5ea94a27c9", 576 | "transactions": [] 577 | } 578 | }`` 579 | 580 | ---- 581 | 582 | #### get_transaction 583 | **Description:** Fetch an individual transaction. 584 | **Parameters:** 585 | 586 | | name | type | desc | 587 | | -------- | -------- | -------- | 588 | | block_num | uint32_t | ID of the block | 589 | | trx_in_block | uint32_t | the position of the transaction within the block | 590 | 591 | **Returns:** referenced transaction 592 | **Example:** 593 | `` > { 594 | "jsonrpc": "2.0", 595 | "method": "get_transaction", 596 | "params": [1660536, 1], 597 | "id": 1 598 | }`` 599 | 600 | `` < ...`` 601 | 602 | ---- 603 | 604 | #### get_recent_transaction_by_id 605 | **Description:** If the transaction has not expired, this method will return the transaction for the given ID or it will return NULL if it is not known. Just because it is not known does not mean it wasn’t included in the blockchain. 606 | **Parameters:** 607 | 608 | | name | type | desc | 609 | | -------- | -------- | -------- | 610 | | id | string | ID of the transaction to retrieve | 611 | 612 | **Returns:** referenced transaction 613 | **Example:** 614 | `` > { 615 | "jsonrpc": "2.0", 616 | "method": "get_recent_transaction_by_id", 617 | "params": ["1"], 618 | "id": 1 619 | }`` 620 | 621 | `` < { 622 | "id": 1, 623 | "result": null 624 | }`` 625 | 626 | ---- 627 | 628 | ### GLOBALS 629 | 630 | 631 | #### get_chain_properties 632 | **Description:** Retrieve the chain_property_object associated with the chain. 633 | **Returns:** properties associated with current chain 634 | **Example:** 635 | `` > { 636 | "jsonrpc": "2.0", 637 | "method": "get_chain_properties", 638 | "params": [], 639 | "id": 1 640 | }`` 641 | 642 | `` > { 643 | "id": 1, 644 | "result": { 645 | "id": "2.9.0", 646 | "chain_id": "4777b283f8006237590c67a5001fb62e14fdfd2c0f5f5afb55e687ae8082d483", 647 | "immutable_parameters": { 648 | "min_miner_count": 11, 649 | "num_special_accounts": 0, 650 | "num_special_assets": 0 651 | } 652 | } 653 | }`` 654 | 655 | ---- 656 | 657 | #### get_global_properties 658 | **Description:** Retrieve the current global_property_object. 659 | **Returns:** global properties 660 | **Example:** 661 | `` > { 662 | "jsonrpc": "2.0", 663 | "method": "get_global_properties", 664 | "params": [], 665 | "id": 1 666 | }`` 667 | 668 | `` > ...`` 669 | 670 | ---- 671 | 672 | #### get_config 673 | **Description:** Retrieve compile-time constants. 674 | **Returns:** configurations 675 | **Example:** 676 | `` > { 677 | "jsonrpc": "2.0", 678 | "method": "get_config", 679 | "params": [], 680 | "id": 1 681 | }`` 682 | 683 | `` < { 684 | "id": 1, 685 | "result": { 686 | "GRAPHENE_SYMBOL": "DCT", 687 | "GRAPHENE_ADDRESS_PREFIX": "DCT", 688 | "GRAPHENE_MIN_ACCOUNT_NAME_LENGTH": 5, 689 | "GRAPHENE_MAX_ACCOUNT_NAME_LENGTH": 63, ... 690 | } 691 | }`` 692 | 693 | ---- 694 | 695 | #### get_chain_id 696 | **Description:** Get the chain ID. 697 | **Returns:** chain ID 698 | **Example:** 699 | `` > { 700 | "jsonrpc": "2.0", 701 | "method": "get_chain_id", 702 | "params": [], 703 | "id": 1 704 | }`` 705 | 706 | `` < { 707 | "id": 1, 708 | "result": "4777b283f8006237590c67a5001fb62e14fdfd2c0f5f5afb55e687ae8082d483" 709 | }`` 710 | 711 | ---- 712 | 713 | #### get_dynamic_global_properties 714 | **Description:** Retrieve the current dynamic_global_property_object. 715 | **Returns:** dynamic global properties 716 | **Example:** 717 | `` > { 718 | "jsonrpc": "2.0", 719 | "method": "get_dynamic_global_properties", 720 | "params": [], 721 | "id": 1 722 | }`` 723 | 724 | `` > { 725 | "id": 1, 726 | "result": { 727 | "id": "2.1.0", 728 | "head_block_number": 1660805, 729 | "head_block_id": "0019578573bc1e4952ed2050758dd4ec950805d0", 730 | "time": "2017-10-06T11:07:10", ... 731 | } 732 | }`` 733 | 734 | ---- 735 | 736 | ### KEYS 737 | 738 | #### get_key_references 739 | **Description:** Query for all accounts that refer to the key in their owner or active authorities. 740 | **Parameters:** 741 | 742 | | name | type | desc | 743 | | -------- | -------- | -------- | 744 | | key | vector<public_key_type> | list of public keys | 745 | 746 | **Returns:** list of account IDs 747 | **Example:** 748 | `` > { 749 | "jsonrpc": "2.0", 750 | "method": "get_key_references", 751 | "params": [["DCT7e15SHKeWhNZfidDdi8D515bQ13XFirog4XjYwnkznLL", "DCT7e15SHKeWi8D515bQ13xUuHFrXFirog4XjYwnkznLL"]], 752 | "id": 1 753 | }`` 754 | 755 | `` < { 756 | "id": 1, 757 | "result": [ 758 | [ 759 | "1.2.5548" 760 | ], 761 | [ 762 | "1.2.5549" 763 | ] 764 | ] 765 | }`` 766 | 767 | ---- 768 | 769 | #### generate_content_keys 770 | **Description:** Generate keys for new content submission. 771 | **Parameters:** 772 | 773 | | name | type | desc | 774 | | -------- | -------- | -------- | 775 | | seeders | vector<account_id_type> | list of seeder account IDs | 776 | 777 | **Returns:** generated key and particles 778 | 779 | ---- 780 | 781 | #### restore_encryption_key 782 | **Description:** Restores AES key. 783 | **Parameters:** 784 | 785 | | name | type | desc | 786 | | -------- | -------- | -------- | 787 | | el_gamal_priv_key_string | DIntegerString | private key | 788 | | buying | buying_id_type | buying ID | 789 | 790 | **Returns:** AES key 791 | 792 | ---- 793 | 794 | ### ACCOUNTS 795 | 796 | #### get_accounts 797 | **Description:** Get a list of accounts by ID. 798 | **Parameters:** 799 | 800 | | name | type | desc | 801 | | -------- | -------- | -------- | 802 | | account_ids | vector<account_id_type> | IDs of the accounts to retrieve | 803 | 804 | **Returns:** list of accounts 805 | **Example:** 806 | `` > { 807 | "jsonrpc": "2.0", 808 | "method": "get_accounts", 809 | "params": [["1.2.5548"]], 810 | "id": 1 811 | }`` 812 | 813 | `` < { 814 | "id": 1, 815 | "result": [ 816 | { 817 | "id": "1.2.5548", 818 | "registrar": "1.2.21", 819 | "name": "u24e69b70a09e16b0dab800e26d947dfd", 820 | "owner": { 821 | "weight_threshold": 1, 822 | "account_auths": [], 823 | "key_auths": [ 824 | [ 825 | "DCT7e15SHKeWhNZfidDdi8D515bQ13xUuHFrXFirog4XjYwnkznLL", 826 | 1 827 | ] 828 | ] 829 | }, ... 830 | }`` 831 | **Note:** This function has semantics identical to get_objects 832 | 833 | ---- 834 | 835 | #### get_full_accounts 836 | **Description:** Retrieve all objects relevant to the specified accounts and subscribe to updates. 837 | **Parameters:** 838 | 839 | | name | type | desc | 840 | | -------- | -------- | -------- | 841 | | names_or_ids | vector<string | the name or ID of an account to retrieve | 842 | | subscribe | bool | true to subscribe to updates | 843 | 844 | **Returns:** map of string from name or id to the account 845 | **Example:** 846 | `` > { 847 | "jsonrpc": "2.0", 848 | "method": "get_full_accounts", 849 | "params": [["1.2.5548"], false ], 850 | "id": 1 851 | }`` 852 | 853 | `` < { 854 | "id": 1, 855 | "result": [ 856 | [ 857 | "1.2.5548", 858 | { 859 | "account": { 860 | "id": "1.2.5548", 861 | "registrar": "1.2.21", ... 862 | }`` 863 | 864 | ---- 865 | 866 | #### get_account_by_name 867 | **Description:** Query for an account by name. 868 | **Parameters:** 869 | 870 | | name | type | desc | 871 | | -------- | -------- | -------- | 872 | | name | string | name of the account to retrieve | 873 | 874 | **Returns:** referenced account 875 | **Example:** 876 | `` > { 877 | "jsonrpc": "2.0", 878 | "method": "get_account_by_name", 879 | "params": ["u24e69b70a09e16b0dab800e26d947dfd"], 880 | "id": 1 881 | }`` 882 | 883 | `` < { 884 | "id": 1, 885 | "result": { 886 | "id": "1.2.5548", 887 | "registrar": "1.2.21", ... 888 | }`` 889 | 890 | ---- 891 | 892 | #### get_account_references 893 | **Description:** Query for all accounts that refer to the account id in their owner or active authorities. 894 | **Parameters:** 895 | 896 | | name | type | desc | 897 | | -------- | -------- | -------- | 898 | | account_id | string | account ID to be searched | 899 | 900 | **Returns:** list of account IDs 901 | **Example:** 902 | `` > { 903 | "jsonrpc": "2.0", 904 | "method": "get_account_references", 905 | "params": ["1.2.5548"], 906 | "id": 1 907 | }`` 908 | 909 | `` < { 910 | "id": 1, 911 | "result": [] 912 | }`` 913 | 914 | ---- 915 | 916 | #### lookup_account_names 917 | **Description:** Get a list of accounts by name. 918 | **Parameters:** 919 | 920 | | name | type | desc | 921 | | -------- | -------- | -------- | 922 | | account_names | vector<string> | names of the accounts to retrieve | 923 | 924 | **Returns:** list of accounts 925 | **Example:** 926 | `` > { 927 | "jsonrpc": "2.0", 928 | "method": "lookup_account_names", 929 | "params": [["u24e69b70a09e16b0dab800e26d947dfd"]], 930 | "id": 1 931 | }`` 932 | 933 | `` < { 934 | "id": 1, 935 | "result": [ 936 | { 937 | "id": "1.2.5548", 938 | "registrar": "1.2.21", ... 939 | }`` 940 | **Note:** This function has semantics identical to get_objects. 941 | 942 | ---- 943 | 944 | #### lookup_accounts 945 | **Description:** Get names and IDs for registered accounts. 946 | **Parameters:** 947 | 948 | | name | type | desc | 949 | | -------- | -------- | -------- | 950 | | lower_bound_name | string | lower bound of the first name to return | 951 | | limit | uint32_t | maximum number of results to return (must not exceed 10000) | 952 | 953 | **Returns:** map of account name to ID 954 | **Example:** 955 | `` > { 956 | "jsonrpc": "2.0", 957 | "method": "lookup_accounts", 958 | "params": ["a", 100 ], 959 | "id": 1 960 | }`` 961 | 962 | `` < { 963 | "id": 1, 964 | "result": [ 965 | [ 966 | "aaaa-jesus-saves", 967 | "1.2.3083" 968 | ], 969 | [ 970 | "aaaaaaaaaaaaaaaa", 971 | "1.2.3169" 972 | ], 973 | [ 974 | "abcde", 975 | "1.2.3547" 976 | ], 977 | [ 978 | "adilminer", 979 | "1.2.3495" 980 | ], 981 | [ 982 | "adsactly", 983 | "1.2.3062" 984 | ], 985 | [ 986 | "adult", 987 | "1.2.3164" 988 | ], 989 | [ 990 | "agoric.systems", 991 | "1.2.2713" 992 | ], 993 | [ 994 | "alcurex", 995 | "1.2.3072" 996 | ], 997 | [ 998 | "alexalexrus", 999 | "1.2.4753" 1000 | ], 1001 | [ 1002 | "alexfff17", 1003 | "1.2.3227" 1004 | ] 1005 | ] 1006 | }`` 1007 | 1008 | ---- 1009 | 1010 | #### get_account_count 1011 | **Description:** Get the total number of accounts registered with the blockchain. 1012 | **Returns:** number of registered account 1013 | **Example:** 1014 | `` > { 1015 | "jsonrpc": "2.0", 1016 | "method": "get_account_count", 1017 | "params": [], 1018 | "id": 1 1019 | }`` 1020 | 1021 | `` < { 1022 | "id": 1, 1023 | "result": 6655 1024 | }`` 1025 | 1026 | ---- 1027 | 1028 | ### BALANCES 1029 | 1030 | #### get_account_balances 1031 | **Description:** Get an account’s balances in various assets. 1032 | **Parameters:** 1033 | 1034 | | name | type | desc | 1035 | | -------- | -------- | -------- | 1036 | | id | account_id_type | ID of the account to get balances for | 1037 | | assets | flat_set<asset_id_type> | IDs of the assets to get balances of; if empty, get all assets account has a balance in | 1038 | 1039 | **Returns:** list account balance 1040 | **Example:** 1041 | `` > { 1042 | "jsonrpc": "2.0", 1043 | "method": "get_account_balances", 1044 | "params": ["1.2.5548", [] ], 1045 | "id": 1 1046 | }`` 1047 | 1048 | `` < { 1049 | "id": 1, 1050 | "result": [ 1051 | { 1052 | "amount": 500000, 1053 | "asset_id": "1.3.0" 1054 | } 1055 | ] 1056 | }`` 1057 | 1058 | ---- 1059 | 1060 | #### get_named_account_balances 1061 | **Description:** Semantically equivalent to get_account_balances, but takes a name instead of an ID. 1062 | **Parameters:** 1063 | 1064 | | name | type | desc | 1065 | | -------- | -------- | -------- | 1066 | | name | string | name of the account to get balances for IDs of the assets to get balances of; if empty, get all assets account has a balance in | 1067 | | assets | flat_set<asset_id_type> | IDs of the assets to get balances of; if empty, get all assets account has a balance in | 1068 | 1069 | **Returns:** account balance 1070 | **Example:** 1071 | `` > { 1072 | "jsonrpc": "2.0", 1073 | "method": "get_named_account_balances", 1074 | "params": ["u24e69b70a09e16b0dab800e26d947dfd", [] ], 1075 | "id": 1 1076 | }`` 1077 | 1078 | `` < { 1079 | "id": 1, 1080 | "result": [ 1081 | { 1082 | "amount": 500000, 1083 | "asset_id": "1.3.0" 1084 | } 1085 | ] 1086 | }`` 1087 | 1088 | ---- 1089 | 1090 | #### get_vesting_balances 1091 | **Description:** Query for vesting balance. 1092 | **Parameters:** 1093 | 1094 | | name | type | desc | 1095 | | -------- | -------- | -------- | 1096 | | account_id | account_id_type | ... | 1097 | 1098 | **Returns:** vesting balance 1099 | **Example:** 1100 | `` > { 1101 | "jsonrpc": "2.0", 1102 | "method": "get_vesting_balances", 1103 | "params": ["1.2.5548"], 1104 | "id": 1 1105 | }`` 1106 | 1107 | `` < { 1108 | "id": 1, 1109 | "result": [] 1110 | }`` 1111 | 1112 | ---- 1113 | 1114 | ### ASSETS 1115 | 1116 | #### get_assets 1117 | **Description:** Get a list of assets by ID. 1118 | **Parameters:** 1119 | 1120 | | name | type | desc | 1121 | | -------- | -------- | -------- | 1122 | | asset_ids | vector<asset_id_type> | IDs of the assets to retrieve | 1123 | 1124 | **Returns:** list of assets 1125 | **Example:** 1126 | `` > { 1127 | "jsonrpc": "2.0", 1128 | "method": "get_assets", 1129 | "params": [["1.3.2"]], 1130 | "id": 1 1131 | }`` 1132 | 1133 | `` < { 1134 | "id": 1, 1135 | "result": [ 1136 | { 1137 | "id": "1.3.2", 1138 | "symbol": "EUR", 1139 | "precision": 4, 1140 | "issuer": "1.2.20", 1141 | "description": "Euro", 1142 | "max_supply": 0, 1143 | "monitored_asset_opts": { 1144 | "feeds": [ 1145 | [ 1146 | "1.2.1948", 1147 | [ 1148 | "2017-10-05T19:05:05", 1149 | { 1150 | "core_exchange_rate": { 1151 | "base": { 1152 | "amount": 543964203, 1153 | "asset_id": "1.3.2" 1154 | }, 1155 | "quote": { 1156 | "amount": "10000000000000", 1157 | "asset_id": "1.3.0" 1158 | } 1159 | } 1160 | } 1161 | ] 1162 | ], 1163 | [ 1164 | "1.2.2044", 1165 | [ 1166 | "2017-09-28T12:17:50", 1167 | { 1168 | "core_exchange_rate": { 1169 | "base": { 1170 | "amount": "5339529209", 1171 | "asset_id": "1.3.2" 1172 | }, 1173 | "quote": { 1174 | "amount": "100000000000000", 1175 | "asset_id": "1.3.0" 1176 | } 1177 | } 1178 | } 1179 | ] 1180 | ], 1181 | [ 1182 | "1.2.2064", 1183 | [ 1184 | "2017-09-11T13:00:00", 1185 | { 1186 | "core_exchange_rate": { 1187 | "base": { 1188 | "amount": "5751964929", 1189 | "asset_id": "1.3.2" 1190 | }, 1191 | "quote": { 1192 | "amount": "10000000000", 1193 | "asset_id": "1.3.0" 1194 | } 1195 | } 1196 | } 1197 | ] 1198 | ], ... 1199 | ] 1200 | }`` 1201 | 1202 | **Note:** This function has semantics identical to get_objects. 1203 | 1204 | ---- 1205 | 1206 | #### list_assets 1207 | **Description:** Get assets alphabetically by symbol name. 1208 | **Parameters:** 1209 | 1210 | | name | type | desc | 1211 | | -------- | -------- | -------- | 1212 | | lower_bound_symbol | string | lower bound of symbol names to retrieve | 1213 | | limit | uint32_t | maximum number of assets to fetch (must not exceed 100) | 1214 | 1215 | **Returns:** list of assets 1216 | **Example:** 1217 | `` > { 1218 | "jsonrpc": "2.0", 1219 | "method": "list_assets", 1220 | "params": ["DCT", 2], 1221 | "id": 1 1222 | }`` 1223 | 1224 | `` < { 1225 | "id": 1, 1226 | "result": [ 1227 | { 1228 | "id": "1.3.0", 1229 | "symbol": "DCT", 1230 | "precision": 8, 1231 | "issuer": "1.2.1", 1232 | "description": "", 1233 | "max_supply": "7319777577456900", 1234 | "dynamic_asset_data_id": "2.3.0" 1235 | }, ... 1236 | ] 1237 | }`` 1238 | 1239 | ---- 1240 | 1241 | #### lookup_asset_symbols 1242 | **Description:** Get a list of assets by symbol. 1243 | 1244 | **Parameters:** 1245 | 1246 | | name | type | desc | 1247 | | -------- | -------- | -------- | 1248 | | symbols_or_ids | vector<string> | symbols or stringified IDs of the assets to retrieve | 1249 | 1250 | **Returns:** list of assets 1251 | **Example:** 1252 | `` > { 1253 | "jsonrpc": "2.0", 1254 | "method": "lookup_asset_symbols", 1255 | "params": [["1.3.0", "1.3.1", "1.3.2"]], 1256 | "id": 1 1257 | }`` 1258 | 1259 | `` < { 1260 | "id": 1, 1261 | "result": [ 1262 | { 1263 | "id": "1.3.0", 1264 | "symbol": "DCT", 1265 | "precision": 8, 1266 | "issuer": "1.2.1", 1267 | "description": "", 1268 | "max_supply": "7319777577456900", 1269 | "dynamic_asset_data_id": "2.3.0" 1270 | }, ... 1271 | ] 1272 | }`` 1273 | 1274 | **Note:** This function has semantics identical to get_objects. 1275 | 1276 | ---- 1277 | 1278 | #### get_real_supply 1279 | **Description:** query for current core asset supply. 1280 | **Returns:** number of assets 1281 | 1282 | ---- 1283 | 1284 | ### MINERS 1285 | 1286 | #### get_miners 1287 | **Description:** Get a list of miners by ID. 1288 | **Parameters:** 1289 | 1290 | | name | type | desc | 1291 | | -------- | -------- | -------- | 1292 | | miner_ids | vector<miner_id_type> | IDs of the miners to retrieve | 1293 | 1294 | **Returns:** list of miners 1295 | 1296 | ---- 1297 | 1298 | #### get_miner_by_account 1299 | **Description:** Get the miner owned by a given account. 1300 | **Parameters:** 1301 | 1302 | | name | type | desc | 1303 | | -------- | -------- | -------- | 1304 | | account | account_id_type | the ID of the account whose miner should be retrieved | 1305 | 1306 | **Returns:** the miner information 1307 | **Example:** 1308 | `` > { 1309 | "jsonrpc": "2.0", 1310 | "method": "get_miner_by_account", 1311 | "params": ["1.2.5548"], 1312 | "id": 1 1313 | }`` 1314 | 1315 | `` < { 1316 | "id": 1, 1317 | "result": null 1318 | }`` 1319 | 1320 | ---- 1321 | 1322 | #### lookup_miner_accounts 1323 | **Description:** Get names and IDs for registered miners. 1324 | **Parameters:** 1325 | 1326 | | name | type | desc | 1327 | | -------- | -------- | -------- | 1328 | | lower_bound_name | string | lower bound of the first name to return | 1329 | | limit | uint32_t | maximum number of results to return (must not exceed 1000) | 1330 | 1331 | 1332 | Returns: map of names to IDs of miners 1333 | Example: 1334 | `` > { 1335 | "jsonrpc": "2.0", 1336 | "method": "get_miner_by_account", 1337 | "params": ["1.2.1", 10 ], 1338 | "id": 1 1339 | }`` 1340 | 1341 | `` < { 1342 | "id": 1, 1343 | "result": null 1344 | }`` 1345 | 1346 | ---- 1347 | 1348 | #### get_miner_count 1349 | **Description:** Get the total number of miners registered with the blockchain. 1350 | **Returns:** the number of miners 1351 | **Example:** 1352 | `` > { 1353 | "jsonrpc": "2.0", 1354 | "method": "get_miner_count", 1355 | "params": [], 1356 | "id": 1 1357 | }`` 1358 | 1359 | `` < { 1360 | "id": 1, 1361 | "result": 11 1362 | }`` 1363 | 1364 | ---- 1365 | 1366 | ### VOTES 1367 | 1368 | #### lookup_vote_ids 1369 | **Description:** Given a set of votes, return the objects they are voting for. 1370 | **Parameters:** 1371 | 1372 | | name | type | desc | 1373 | | -------- | -------- | -------- | 1374 | | votes | vector<vote_id_type> | set of votes, the results will be in the same order as the votes | 1375 | 1376 | **Returns:** voting objects 1377 | **Example:** 1378 | `` > { 1379 | "jsonrpc": "2.0", 1380 | "method": "lookup_vote_ids", 1381 | "params": [[""]], 1382 | "id": 1 1383 | }`` 1384 | 1385 | `` < { 1386 | "id": 1, 1387 | "result": [ 1388 | { 1389 | "id": "1.4.1", 1390 | "miner_account": "1.2.4", 1391 | "last_aslot": 730169, 1392 | "signing_key": "DCT7WajG3BUdorEndqQLtWvYM3xyGjtE9yhxhNDFGqsBoSDc1s35g", 1393 | "vote_id": "0:0", 1394 | "total_votes": 0, 1395 | "url": "", 1396 | "total_missed": 65923, 1397 | "last_confirmed_block_num": 4998 1398 | } 1399 | ] 1400 | }`` 1401 | **Note:** This will be a mixture of committee_member_object, witness_objects, and worker_objects. The results will be in the same order as the votes. Null will be returned for any vote ids that are not found. 1402 | 1403 | ---- 1404 | 1405 | ### AUTHORITY & VALIDATION 1406 | 1407 | #### get_transaction_hex 1408 | **Description:** Get a hexdump of the serialized binary form of a transaction. 1409 | **Parameters:** 1410 | 1411 | | name | type | desc | 1412 | | -------- | -------- | -------- | 1413 | | trx | signed_transaction | ... | 1414 | 1415 | * _object trx 1416 | { 1417 | _int_ ref_block_num, 1418 | _int_ ref_block_prefix, 1419 | _int_ expiration, 1420 | _list of string_ operations, 1421 | _string_ extensions 1422 | } 1423 | 1424 | **Returns:** hexdump binary 1425 | 1426 | ---- 1427 | 1428 | #### get_required_signatures 1429 | **Description:** Take a partially signed transaction and a set of public keys that the owner has the ability to sign for and return the minimal subset of public keys that should add signatures to the transaction. 1430 | 1431 | | name | type | desc | 1432 | | -------- | -------- | -------- | 1433 | | trx | signed_transaction | ... | 1434 | | available_keys | string | set of available public keys | 1435 | 1436 | * _object trx_ 1437 | { 1438 | _int_ ref_block_num, 1439 | _int_ ref_block_prefix, 1440 | _int_ expiration, 1441 | _list of string_ operations, 1442 | _string_ extensions 1443 | } 1444 | 1445 | **Returns:** set of public keys 1446 | 1447 | ---- 1448 | 1449 | #### get_potential_signatures 1450 | **Description:** Return the set of all public keys that could possibly sign for a given transaction. This call can be used by wallets to filter their set of public keys to just the relevant subset prior to calling get_required_signatures to get the minimum subset. 1451 | **Parameters:** 1452 | 1453 | | name | type | desc | 1454 | | -------- | -------- | -------- | 1455 | | trx | signed_transaction | ... | 1456 | 1457 | * _object trx_ 1458 | { 1459 | _int_ ref_block_num, 1460 | _int_ ref_block_prefix, 1461 | _int_ expiration, 1462 | _list of string_ operations, 1463 | _string_ extensions 1464 | } 1465 | 1466 | **Returns:** set of public keys 1467 | 1468 | ---- 1469 | 1470 | #### verify_authority 1471 | **Description:** Verify if a transaction has all of the required signatures. 1472 | **Parameters:** 1473 | 1474 | | name | type | desc | 1475 | | -------- | -------- | -------- | 1476 | | trx | signed_transaction | ... | 1477 | 1478 | * _object trx_ 1479 | { 1480 | _int_ ref_block_num, 1481 | _int_ ref_block_prefix, 1482 | _int_ expiration, 1483 | _list of string_ operations, 1484 | _string_ extensions 1485 | } 1486 | 1487 | **Returns:** bool 1488 | 1489 | ---- 1490 | 1491 | #### verify_account_authority 1492 | **Description:** Verify if a signers have enough authority to authorize an account. 1493 | **Parameters:** 1494 | 1495 | | name | type | desc | 1496 | | -------- | -------- | -------- | 1497 | | name_or_id | string | the name or id of the account | 1498 | | signers | flat_set<public_key_type> | Set of public keys | 1499 | 1500 | **Returns:** bool 1501 | 1502 | ---- 1503 | 1504 | #### validate_transaction 1505 | **Description:** Validates a transaction against the current state without broadcasting it on the network. 1506 | **Parameters:** 1507 | 1508 | | name | type | desc | 1509 | | -------- | -------- | -------- | 1510 | | trx | signed_transaction | ... | 1511 | 1512 | * _object trx_ 1513 | { 1514 | _int_ ref_block_num, 1515 | _int_ ref_block_prefix, 1516 | _int_ expiration, 1517 | _list of string_ operations, 1518 | _string_ extensions 1519 | } 1520 | 1521 | **Returns:** bool 1522 | 1523 | ---- 1524 | 1525 | #### get_required_fees 1526 | **Description:** For each operation calculate the required fee in the specified asset type, if the asset type does not have a valid core_exchange_rate. 1527 | **Parameters:** 1528 | 1529 | | name | type | desc | 1530 | | -------- | -------- | -------- | 1531 | | ops | vector<operation> | the set of operations | 1532 | | id | asset_id_type | the asset ID | 1533 | 1534 | **Returns:** map of asset type and fee 1535 | 1536 | ---- 1537 | 1538 | ### PROPOSED TRANSACTIONS 1539 | 1540 | #### get_proposed_transactions 1541 | **Description:** Get proposed transactions relevant to the specified account id. 1542 | **Parameters:** 1543 | 1544 | | name | type | desc | 1545 | | -------- | -------- | -------- | 1546 | | id | account_id_type | the account ID | 1547 | 1548 | 1549 | **Returns:** set of proposed transactions 1550 | 1551 | ---- 1552 | 1553 | ### BLOCK 1554 | 1555 | #### head_block_time 1556 | **Description:** Retrieve datetime of the last local block. 1557 | **Returns:** referenced block 1558 | **Example:** 1559 | `` > { 1560 | "jsonrpc": "2.0", 1561 | "method": "head_block_time", 1562 | "params": [], 1563 | "id": 1 1564 | }`` 1565 | 1566 | `` < { 1567 | "id": 1, 1568 | "result": "2017-10-06T10:49:35" 1569 | }`` 1570 | 1571 | ---- 1572 | 1573 | #### get_new_asset_per_block 1574 | **Description:** Retrieve the number of asset per block. 1575 | **Returns:** the number of asset per block 1576 | **Example:** 1577 | `` > { 1578 | "jsonrpc": "2.0", 1579 | "method": "get_new_asset_per_block", 1580 | "params": [], 1581 | "id": 1 1582 | }`` 1583 | 1584 | ``{ 1585 | "id": 1, 1586 | "result": 37000000 1587 | }`` 1588 | 1589 | ---- 1590 | 1591 | #### get_asset_per_block_by_block_num 1592 | **Description:** Retrieve the number of asset for given block number. 1593 | **Parameters:** 1594 | 1595 | | name | type | desc | 1596 | | -------- | -------- | -------- | 1597 | | block_num | uint32_t | ID of the block | 1598 | 1599 | **Returns:** the number of asset for given block number 1600 | **Example:** 1601 | `` > { 1602 | "jsonrpc": "2.0", 1603 | "method": "get_asset_per_block_by_block_num", 1604 | "params": [1658953], 1605 | "id": 1 1606 | }`` 1607 | 1608 | `` > { 1609 | "id": 1, 1610 | "result": 37000000 1611 | }`` 1612 | 1613 | ---- 1614 | 1615 | #### get_time_to_maint_by_block_time 1616 | **Description:** get time for maintenance for given datetime 1617 | **Parameters:** 1618 | 1619 | | name | type | desc | 1620 | | -------- | -------- | -------- | 1621 | | datetime | string | date and time specified | 1622 | 1623 | **Returns:** the number of asset for given block number 1624 | **Example:** 1625 | `` > { 1626 | "jsonrpc": "2.0", 1627 | "method": "get_time_to_maint_by_block_time", 1628 | "params": ["2017-10-06T09:12:54"], 1629 | "id": 1 1630 | }`` 1631 | 1632 | `` > { 1633 | "id": 1, 1634 | "result": { 1635 | "time_to_maint": 86400, 1636 | "from_accumulated_fees": 677352801, 1637 | "block_interval": 5 1638 | } 1639 | }`` 1640 | 1641 | ---- 1642 | 1643 | ### CONTENTS 1644 | 1645 | #### set_content_update_callback 1646 | **Description:** Set callback function on content update. 1647 | **Parameters:** 1648 | 1649 | | name | type | desc | 1650 | | -------- | -------- | -------- | 1651 | | URI | string | content that are monitored | 1652 | | cb | confirmation_callback | callback confirmation | 1653 | 1654 | **Returns:** response status 1655 | 1656 | ---- 1657 | 1658 | #### get_content 1659 | **Description:** Retrieve a content by URI. 1660 | **Parameters:** 1661 | 1662 | | name | type | desc | 1663 | | -------- | -------- | -------- | 1664 | | URI | string | URI of the content to retrieve | 1665 | 1666 | **Returns:** content object 1667 | 1668 | ---- 1669 | 1670 | #### search_content 1671 | **Description:** Search for term in contents (author, title and description). 1672 | **Parameters:** 1673 | 1674 | | name | type | desc | 1675 | | -------- | -------- | -------- | 1676 | | term | string | search term | 1677 | | order | string | ordering field | 1678 | | user | string | content owner | 1679 | | region | string | two letter region code | 1680 | | id | object_id_type | the id of content object to start searching from | 1681 | | type | string |the application and content type to be filtered | 1682 | | count | uint32_t | maximum number of contents to fetch (must not exceed 100) | 1683 | 1684 | **Returns:** content objects 1685 | 1686 | ---- 1687 | 1688 | #### get_feeds_by_miner 1689 | 1690 | ---- 1691 | 1692 | ### PUBLISHERS & SEEDERS 1693 | 1694 | #### list_publishing_managers 1695 | **Description:** Query for a list of accounts holding publishing manager status. 1696 | **Parameters:** 1697 | 1698 | | name | type | desc | 1699 | | -------- | -------- | -------- | 1700 | | lower_bound_name | string | the name of the first account to return, if the named account does not exist, the list will start at the account that comes after lower bound | 1701 | | limit | uint32_t | the maximum number of accounts to return (must not exceed 100) | 1702 | 1703 | **Returns:** list of accounts 1704 | 1705 | ---- 1706 | 1707 | #### list_publishers_by_price 1708 | **Description:** Query for a list of seeders by price (in decreasing order). 1709 | **Parameters:** 1710 | 1711 | | name | type | desc | 1712 | | -------- | -------- | -------- | 1713 | | count | uint32_t | maximum number of seeders to retrieve | 1714 | 1715 | **Returns:** list of seeders 1716 | 1717 | ---- 1718 | 1719 | #### list_seeders_by_upload 1720 | **Description:** Query for a list of seeders by total upload (in decreasing order). 1721 | **Parameters:** 1722 | 1723 | | name | type | desc | 1724 | | -------- | -------- | -------- | 1725 | | count | uint32_t | maximum number of seeders to retrieve | 1726 | 1727 | **Returns:** list of seeders 1728 | 1729 | ---- 1730 | 1731 | #### list_seeders_by_region 1732 | **Description:** Query for a list of seeders by region (in decreasing order). 1733 | **Parameters:** 1734 | 1735 | | name | type | desc | 1736 | | -------- | -------- | -------- | 1737 | | count | uint32_t | maximum number of seeders to retrieve | 1738 | 1739 | **Returns:** list of seeders 1740 | 1741 | ---- 1742 | 1743 | #### list_seeders_by_rating 1744 | **Description:** Query for a list of seeders by rating (in decreasing order). 1745 | **Parameters:** 1746 | 1747 | | name | type | desc | 1748 | | -------- | -------- | -------- | 1749 | | count | uint32_t | maximum number of seeders to retrieve | 1750 | 1751 | **Returns:** list of seeders 1752 | 1753 | ---- 1754 | 1755 | #### get_seeder 1756 | Description: Query for a seeder by ID. 1757 | **Parameters:** 1758 | 1759 | | name | type | desc | 1760 | | -------- | -------- | -------- | 1761 | | ID | account_id_type | ID of the seeder to retrieve | 1762 | 1763 | **Returns:** seeder object 1764 | 1765 | ---- 1766 | 1767 | ### BUYINGS 1768 | 1769 | #### get_open_buyings 1770 | **Description:** Query for a list of open buying. 1771 | **Returns:** list of buying objects 1772 | 1773 | ---- 1774 | 1775 | #### get_open_buyings_by_URI 1776 | **Description:** Query for a list of open buying by URI. 1777 | **Parameters:** 1778 | 1779 | | name | type | desc | 1780 | | -------- | -------- | -------- | 1781 | | URI | string | URI of the buying to retrieve | 1782 | 1783 | **Returns:** list of buying objects 1784 | 1785 | ---- 1786 | 1787 | #### get_open_buyings_by_consumer 1788 | **Description:** Query for a list of open buying by consumer. 1789 | **Parameters:** 1790 | 1791 | | name | type | desc | 1792 | | -------- | -------- | -------- | 1793 | | consumer | account_id_type | consumer of the buying to retrieve | 1794 | 1795 | **Returns:** list of buying objects 1796 | 1797 | ---- 1798 | 1799 | #### get_buying_by_consumer_URI 1800 | **Description:** Query for a list of open buying by consumer and URI. 1801 | **Parameters:** 1802 | 1803 | | name | type | desc | 1804 | | -------- | -------- | -------- | 1805 | | consumer | account_id_type | consumer of the buying to retrieve | 1806 | | URI | string | URI of the buying to retrieve | 1807 | 1808 | **Returns:** list of buying objects 1809 | 1810 | ---- 1811 | 1812 | #### get_buying_history_objects_by_consumer 1813 | **Description:** Query for history buying objects by consumer. 1814 | **Parameters:** 1815 | 1816 | | name | type | desc | 1817 | | -------- | -------- | -------- | 1818 | | consumer | account_id_type | consumer of the buying to retrieve | 1819 | 1820 | **Returns:** list of buying objects 1821 | 1822 | ---- 1823 | 1824 | #### get_buying_objects_by_consumer 1825 | **Description:** Query for buying objects (open or history) by consumer. 1826 | **Parameters:** 1827 | 1828 | | name | type | desc | 1829 | | -------- | -------- | -------- | 1830 | | consumer | account_id_type | consumer of the buying to retrieve | 1831 | | order | string | ordering field | 1832 | | id | object_id_type | the id of buying object to start searching from | 1833 | | term | string | search term | 1834 | | count | uint32_t | maximum number of contents to fetch (must not exceed 100) | 1835 | 1836 | **Returns:** list of buying objects 1837 | 1838 | ---- 1839 | 1840 | ### DCT 1841 | 1842 | #### price_to_dct 1843 | **Description:** Converts price denominated in Monitored asset into DCT, using actual price feed. 1844 | **Parameters:** 1845 | 1846 | | name | type | desc | 1847 | | -------- | -------- | -------- | 1848 | | price | asset | price in DCT or monitored asset | 1849 | 1850 | **Returns:** price 1851 | 1852 | ---- 1853 | 1854 | ## 2.3 History APIs 1855 | 1856 | ### ACCOUNTS 1857 | 1858 | #### get_account_history 1859 | **Description:** Get operations relevant to the specificed account. 1860 | **Parameters:** 1861 | 1862 | | name | type | desc | 1863 | | -------- | -------- | -------- | 1864 | | account | account_id_type | account ID | 1865 | | order | string | ... | 1866 | | stop | operation_history_id_type | ID of the earliest operation to retrieve | 1867 | | limit | unsigned | maximum number of operations to retrieve (must not exceed 100) | 1868 | | start | operation_history_id_type | ID of the most recent operation to retrieve | 1869 | 1870 | 1871 | **Returns:** list of historical operations 1872 | **Example:** 1873 | `` > { 1874 | "jsonrpc": "2.0", 1875 | "method": "search_account_history", 1876 | "params": ["1.2.5548", "asc", "2.0.0", 10], 1877 | "id": 5 1878 | }`` 1879 | 1880 | `` < { 1881 | "id": 1, 1882 | "result": [ 1883 | { 1884 | "id": "2.17.23193", 1885 | "m_from_account": "1.2.21", 1886 | "m_to_account": "1.2.5548", 1887 | "m_operation_type": 0, 1888 | "m_transaction_amount": { 1889 | "amount": 500000, 1890 | "asset_id": "1.3.0" 1891 | }, ... 1892 | }`` 1893 | 1894 | ---- 1895 | 1896 | #### get_relative_account_history 1897 | **Description:** Query for historical operations relevant to given account. 1898 | **Parameters:** 1899 | 1900 | | name | type | desc | 1901 | | -------- | -------- | -------- | 1902 | | account | account_id_type | account ID | 1903 | | stop | operation_history_id_type | sequence number of earliest operation, 0 is default and will query 'limit' number of operations | 1904 | | limit | unsigned | maximum number of operations to retrieve (must not exceed 100) | 1905 | | start | operation_history_id_type | sequence number of the most recent operation to retrieve, 0 is default, which will start querying from the most recent operation | 1906 | 1907 | **Returns:** list of historical operations 1908 | 1909 | ---- 1910 | 1911 | ## 2.4 Network Broadcast APIs 1912 | 1913 | ### TRANSACTIONS 1914 | 1915 | #### broadcast_transaction 1916 | **Description:** Broadcast a transaction to the network. 1917 | **Parameters:** 1918 | 1919 | | name | type | desc | 1920 | | -------- | -------- | -------- | 1921 | | trx | signed_transaction | the transaction to broadcast | 1922 | 1923 | * _object trx 1924 | { 1925 | _int_ ref_block_num, 1926 | _int_ ref_block_prefix, 1927 | _int_ expiration, 1928 | _list of string_ operations, 1929 | _string_ extensions 1930 | } 1931 | 1932 | **Returns:** response status 1933 | 1934 | ---- 1935 | 1936 | #### broadcast_transaction_with_callback 1937 | **Description:** This version of broadcast transaction registers a callback method that will be called when the transaction is included into a block. The callback method includes the transaction id, block number, and transaction number in the block. 1938 | **Parameters:** 1939 | 1940 | | name | type | desc | 1941 | | -------- | -------- | -------- | 1942 | | cb | confirmation_callback | callback confirmation | 1943 | | trx | signed_transaction | transaction object | 1944 | 1945 | * _object transaction_ 1946 | { 1947 | _int_ ref_block_num, 1948 | _int_ ref_block_prefix, 1949 | _int_ expiration, 1950 | _list of string_ operations, 1951 | _string_ extensions 1952 | } 1953 | 1954 | **Returns:** response status 1955 | 1956 | ---- 1957 | 1958 | ### BLOCK 1959 | 1960 | #### broadcast_block 1961 | **Description:** Broadcast a block to the network. 1962 | **Parameters:** 1963 | 1964 | | name | type | desc | 1965 | | -------- | -------- | -------- | 1966 | | b | signed_block | block object | 1967 | 1968 | * _object block_ 1969 | { 1970 | _list of object transaction_ {_int_ ref_block_num, _int_ ref_block_prefix, _int_ expiration, _list of string_ operations, _string_ extensions } 1971 | _string_ signature_type, 1972 | _string_ block_id_type, 1973 | _string_ timestamp, 1974 | _string_ miner, 1975 | _string_ transaction_merkle_root, 1976 | _string_ extensions 1977 | } 1978 | 1979 | **Returns:** response status 1980 | 1981 | ---- 1982 | 1983 | ## 2.5 Network Node APIs 1984 | 1985 | ### OBTAIN NETWORK INFORMATION 1986 | 1987 | #### get_info 1988 | **Description:** Retrieve general network information. 1989 | **Returns:** network information 1990 | **Example:** 1991 | `` > { 1992 | "id": 2, 1993 | "method": "call", 1994 | "params": [ 1995 | 4, 1996 | "get_info", 1997 | [] 1998 | ] 1999 | }`` 2000 | 2001 | `` < { 2002 | "id": 2, 2003 | "result": { 2004 | "listening_on": "0.0.0.0:39435", 2005 | "node_public_key": "03a588497d473fa2ed85c7b8f50125f0a3433d4bcee432302c32db408208f987e8", 2006 | "node_id": "f38b89d5dafbd09f55e3fd1a195ef600c1d9d09a3290c9906f38d86b4d165c6dff", 2007 | "firewalled": "firewalled", 2008 | "connection_count": 0 2009 | } 2010 | }`` 2011 | 2012 | ---- 2013 | 2014 | #### get_connected_peers 2015 | **Description:** Get status of all current connections to peers. 2016 | **Returns:** list of connected peers 2017 | **Example:** 2018 | `` > { 2019 | "id": 2, 2020 | "method": "call", 2021 | "params": [ 2022 | 4, 2023 | "get_connected_peers", 2024 | [ 2025 | "" 2026 | ] 2027 | ] 2028 | }`` 2029 | 2030 | `` < { 2031 | "id": 2, 2032 | "result": null 2033 | }`` 2034 | 2035 | ---- 2036 | 2037 | #### get_potential_peers 2038 | **Description:** Return list of potential peers. 2039 | **Returns:** list of potential peers 2040 | **Example:** 2041 | `` > { 2042 | "id": 2, 2043 | "method": "call", 2044 | "params": [ 2045 | 4, 2046 | "get_potential_peers", 2047 | [ 2048 | "" 2049 | ] 2050 | ] 2051 | }`` 2052 | 2053 | `` < { 2054 | "id": 2, 2055 | "result": [ 2056 | { 2057 | "endpoint": "45.32.154.218:40000", 2058 | "last_seen_time": "1970-01-01T00:00:00", 2059 | "last_connection_disposition": "last_connection_failed", 2060 | "last_connection_attempt_time": "2017-10-11T02:37:03", 2061 | "number_of_successful_connection_attempts": 0, 2062 | "number_of_failed_connection_attempts": 86, 2063 | "last_error": { 2064 | "code": 0, 2065 | "name": "exception", 2066 | "message": "unspecified", 2067 | "stack": [ 2068 | { 2069 | "context": { 2070 | "level": "error", 2071 | "file": "asio.cpp", 2072 | "line": 60, 2073 | "method": "error_handler", 2074 | "hostname": "", 2075 | "thread_name": "asio", 2076 | "timestamp": "2017-10-11T02:37:06" 2077 | }, 2078 | "format": "${message} ", 2079 | "data": { 2080 | "message": "No route to host" 2081 | } 2082 | } 2083 | ] 2084 | } 2085 | }, ... 2086 | ] 2087 | }`` 2088 | 2089 | ---- 2090 | 2091 | #### get_advanced_node_parameters 2092 | **Description:** Get advanced node parameters, such as desired and max number of connections. 2093 | **Returns:** node parameters 2094 | **Example:** 2095 | `` > { 2096 | "id": 2, 2097 | "method": "call", 2098 | "params": [ 2099 | 4, 2100 | "get_advanced_node_parameters", 2101 | [ 2102 | "" 2103 | ] 2104 | ] 2105 | }`` 2106 | 2107 | `` < { 2108 | "id": 2, 2109 | "result": { 2110 | "peer_connection_retry_timeout": 30, 2111 | "desired_number_of_connections": 20, 2112 | "maximum_number_of_connections": 200, 2113 | "maximum_number_of_blocks_to_handle_at_one_time": 200, 2114 | "maximum_number_of_sync_blocks_to_prefetch": 2000, 2115 | "maximum_blocks_per_peer_during_syncing": 200 2116 | } 2117 | }`` 2118 | 2119 | ---- 2120 | 2121 | ### CHANGE NETWORK SETTINGS 2122 | 2123 | #### add_node 2124 | **Description:** Connect to a new peer. 2125 | **Parameters:** 2126 | 2127 | | name | type | desc | 2128 | | -------- | -------- | -------- | 2129 | | ep | endpoint | the IP:Port of the peer to connect to | 2130 | 2131 | **Returns:** response status 2132 | **Example:** 2133 | `` > { 2134 | "id": 2, 2135 | "method": "call", 2136 | "params": [ 2137 | 4, 2138 | "add_node", 2139 | [ 2140 | "66.70.188.105:40000" 2141 | ] 2142 | ] 2143 | }`` 2144 | 2145 | `` < { 2146 | "id": 2, 2147 | "result": null 2148 | }`` 2149 | 2150 | ---- 2151 | 2152 | #### set_advanced_node_parameters 2153 | **Description:** Set advanced node parameters. 2154 | **Parameters:** 2155 | 2156 | | name | type | desc | 2157 | | -------- | -------- | -------- | 2158 | | params | variant_object | a JSON object containing the name/value pairs for the parameters to set 2159 | 2160 | * _object params 2161 | { 2162 | _int_ peer_connection_retry_timeout, 2163 | _int_ desired_number_of_connections, 2164 | _int_ maximum_number_of_connections, 2165 | _int_ maximum_number_of_blocks_to_handle_at_one_time, 2166 | _int_ maximum_number_of_sync_blocks_to_prefetch, 2167 | _int_ maximum_blocks_per_peer_during_syncing 2168 | } 2169 | 2170 | **Returns:** response status 2171 | **Example:** 2172 | `` > { 2173 | "id": 2, 2174 | "method": "call", 2175 | "params": [ 2176 | 4, 2177 | "set_advanced_node_parameters", 2178 | [ 2179 | { 2180 | "peer_connection_retry_timeout": 30, 2181 | "desired_number_of_connections": 20, 2182 | "maximum_number_of_connections": 200, 2183 | "maximum_number_of_blocks_to_handle_at_one_time": 200, 2184 | "maximum_number_of_sync_blocks_to_prefetch": 2000, 2185 | "maximum_blocks_per_peer_during_syncing": 200 2186 | } 2187 | ] 2188 | ] 2189 | }`` 2190 | 2191 | `` < { 2192 | "id": 2, 2193 | "result": null 2194 | }`` 2195 | 2196 | ---- 2197 | 2198 | #### seeding_startup 2199 | **Description:** Start seeding plugin from running application. 2200 | **Parameters:** 2201 | 2202 | | name | type | desc | 2203 | | -------- | -------- | -------- | 2204 | | account_id | account_id_type | ID of account controlling this seeder | 2205 | | content_private_key | DInteger | El Gamal content private key | 2206 | | seeder_private_key | private_key | private key of the account controlling this seeder | 2207 | | free_space | uint64_t | allocated disk space (in MegaBytes) | 2208 | | seeding_price | uint32_t | price per MegaBytes | 2209 | | packages_path | string | packages storage path | 2210 | 2211 | **Returns:** response status 2212 | 2213 | ---- 2214 | -------------------------------------------------------------------------------- /wallet_api.md: -------------------------------------------------------------------------------- 1 | # DECENT Wallet API Document 2 | 3 | 4 | 5 | - [1. Introduction](#1-introduction) 6 | - [1.1 How to call wallet API](#11-how-to-call-wallet-api) 7 | - [1.1.1 HTTP Calls](#111-http-calls) 8 | - [1.1.2 WebSocket Calls](#112-websocket-calls) 9 | - [2. API Definition](#2-api-definition) 10 | - [2.1 General APIs](#21-general-apis) 11 | - [GENERAL](#general) 12 | - [help](#help) 13 | - [gethelp](#gethelp) 14 | - [info](#info) 15 | - [about](#about) 16 | - [network_add_nodes](#networkaddnodes) 17 | - [network_get_connected_peers](#networkgetconnectedpeers) 18 | - [2.2 Wallet APIs](#22-wallet-apis) 19 | - [WALLET](#wallet) 20 | - [is_new](#isnew) 21 | - [is_locked](#islocked) 22 | - [lock](#lock) 23 | - [unlock](#unlock) 24 | - [set_password](#setpassword) 25 | - [dump_private_keys](#dumpprivatekeys) 26 | - [import_key](#importkey) 27 | - [import_accounts](#importaccounts) 28 | - [import_account_keys](#importaccountkeys) 29 | - [suggest_brain_key](#suggestbrainkey) 30 | - [get_private_key](#getprivatekey) 31 | - [load_wallet_file](#loadwalletfile) 32 | - [normalize_brain_key](#normalizebrainkey) 33 | - [save_wallet_file](#savewalletfile) 34 | - [2.2 Account APIs](#22-account-apis) 35 | - [ACCOUNT](#account) 36 | - [list_my_accounts](#listmyaccounts) 37 | - [list_accounts](#listaccounts) 38 | - [list_account_balances](#listaccountbalances) 39 | - [register_account](#registeraccount) 40 | - [create_account_with_brain_key](#createaccountwithbrainkey) 41 | - [transfer](#transfer) 42 | - [transfer2](#transfer2) 43 | - [get_transaction_id](#gettransactionid) 44 | - [get_vesting_balances](#getvestingbalances) 45 | - [withdraw_vesting](#withdrawvesting) 46 | - [get_account](#getaccount) 47 | - [get_account_id](#getaccountid) 48 | - [get_account_history](#getaccounthistory) 49 | - [approve_proposal](#approveproposal) 50 | - [2.3 Asset APIs](#23-asset-apis) 51 | - [ASSET](#asset) 52 | - [list_assets](#listassets) 53 | - [publish_asset_feed](#publishassetfeed) 54 | - [issue_asset](#issueasset) 55 | - [get_asset](#getasset) 56 | - [reserve_asset](#reserveasset) 57 | - [2.4 Inspection APIs](#24-inspection-apis) 58 | - [INSPECTION](#inspection) 59 | - [get_block](#getblock) 60 | - [get_account_count](#getaccountcount) 61 | - [get_global_properties](#getglobalproperties) 62 | - [get_dynamic_global_properties](#getdynamicglobalproperties) 63 | - [get_object](#getobject) 64 | - [2.5 TRANSACTION APIs](#25-transaction-apis) 65 | - [TRANSACTION BUILDER](#transaction-builder) 66 | - [begin_builder_transaction](#beginbuildertransaction) 67 | - [add_operation_to_builder_transaction](#addoperationtobuildertransaction) 68 | - [replace_operation_in_builder_transaction](#replaceoperationinbuildertransaction) 69 | - [set_fees_on_builder_transaction](#setfeesonbuildertransaction) 70 | - [preview_builder_transaction](#previewbuildertransaction) 71 | - [sign_builder_transaction](#signbuildertransaction) 72 | - [propose_builder_transaction](#proposebuildertransaction) 73 | - [propose_builder_transaction2](#proposebuildertransaction2) 74 | - [remove_builder_transaction](#removebuildertransaction) 75 | - [serialize_transaction](#serializetransaction) 76 | - [sign_transaction](#signtransaction) 77 | - [get_prototype_operation](#getprototypeoperation) 78 | - [2.6 OTHERS](#26-others) 79 | - [UNCLASSIFIED](#unclassified) 80 | - [claim_fees](#claimfees) 81 | - [content_cancellation](#contentcancellation) 82 | - [create_miner](#createminer) 83 | - [create_monitored_asset](#createmonitoredasset) 84 | - [create_package](#createpackage) 85 | - [create_user_issued_asset](#createuserissuedasset) 86 | - [dbg_generate_blocks](#dbggenerateblocks) 87 | - [dbg_make_mia](#dbgmakemia) 88 | - [dbg_push_blocks](#dbgpushblocks) 89 | - [dbg_stream_json_objects](#dbgstreamjsonobjects) 90 | - [dbg_update_object](#dbgupdateobject) 91 | - [download_content](#downloadcontent) 92 | - [download_package](#downloadpackage) 93 | - [extract_package](#extractpackage) 94 | - [flood_network](#floodnetwork) 95 | - [fund_asset_pools](#fundassetpools) 96 | - [generate_brain_key_el_gamal_key](#generatebrainkeyelgamalkey) 97 | - [generate_el_gamal_keys](#generateelgamalkeys) 98 | - [generate_encryption_key](#generateencryptionkey) 99 | - [get_author_and_co_authors_by_URI](#getauthorandcoauthorsbyuri) 100 | - [get_brain_key_info](#getbrainkeyinfo) 101 | - [get_buying_by_consumer_URI](#getbuyingbyconsumeruri) 102 | - [get_buying_history_objects_by_consumer](#getbuyinghistoryobjectsbyconsumer) 103 | - [get_content](#getcontent) 104 | - [get_download_status](#getdownloadstatus) 105 | - [get_el_gammal_key](#getelgammalkey) 106 | - [get_feeds_by_miner](#getfeedsbyminer) 107 | - [get_message_objects](#getmessageobjects) 108 | - [get_messages](#getmessages) 109 | - [get_miner](#getminer) 110 | - [get_monitored_asset_data](#getmonitoredassetdata) 111 | - [get_open_buyings](#getopenbuyings) 112 | - [get_open_buyings_by_URI](#getopenbuyingsbyuri) 113 | - [get_open_buyings_by_consumer](#getopenbuyingsbyconsumer) 114 | - [get_proposed_transactions](#getproposedtransactions) 115 | - [get_real_supply](#getrealsupply) 116 | - [head_block_time](#headblocktime) 117 | - [leave_rating_and_comment](#leaveratingandcomment) 118 | - [list_active_subscriptions_by_author](#listactivesubscriptionsbyauthor) 119 | - [list_active_subscriptions_by_consumer](#listactivesubscriptionsbyconsumer) 120 | - [list_miners](#listminers) 121 | - [list_publishers_by_price](#listpublishersbyprice) 122 | - [list_publishing_managers](#listpublishingmanagers) 123 | - [list_seeders_by_rating](#listseedersbyrating) 124 | - [list_seeders_by_region](#listseedersbyregion) 125 | - [list_seeders_by_upload](#listseedersbyupload) 126 | - [list_subscriptions_by_author](#listsubscriptionsbyauthor) 127 | - [list_subscriptions_by_consumer](#listsubscriptionsbyconsumer) 128 | - [price_to_dct](#pricetodct) 129 | - [propose_fee_change](#proposefeechange) 130 | - [propose_parameter_change](#proposeparameterchange) 131 | - [propose_transfer](#proposetransfer) 132 | - [remove_package](#removepackage) 133 | - [request_to_buy](#requesttobuy) 134 | - [restore_encryption_key](#restoreencryptionkey) 135 | - [search_account_history](#searchaccounthistory) 136 | - [search_accounts](#searchaccounts) 137 | - [search_content](#searchcontent) 138 | - [search_feedback](#searchfeedback) 139 | - [search_my_purchases](#searchmypurchases) 140 | - [search_user_content](#searchusercontent) 141 | - [seeding_startup](#seedingstartup) 142 | - [send_message](#sendmessage) 143 | - [set_automatic_renewal_of_subscription](#setautomaticrenewalofsubscription) 144 | - [set_desired_miner_count](#setdesiredminercount) 145 | - [set_publishing_manager](#setpublishingmanager) 146 | - [set_publishing_right](#setpublishingright) 147 | - [set_subscription](#setsubscription) 148 | - [set_transfer_logs](#settransferlogs) 149 | - [set_voting_proxy](#setvotingproxy) 150 | - [sign_buffer](#signbuffer) 151 | - [submit_content](#submitcontent) 152 | - [submit_content_async](#submitcontentasync) 153 | - [subscribe_by_author](#subscribebyauthor) 154 | - [subscribe_to_author](#subscribetoauthor) 155 | - [update_miner](#updateminer) 156 | - [update_monitored_asset](#updatemonitoredasset) 157 | - [update_user_issued_asset](#updateuserissuedasset) 158 | - [upload_package](#uploadpackage) 159 | - [verify_signature](#verifysignature) 160 | - [vote_for_miner](#voteforminer) 161 | 162 | 163 | 164 | # 1. Introduction 165 | 166 | ## 1.1 How to call wallet API 167 | 168 | ### 1.1.1 HTTP Calls 169 | 170 | HTTP call are only supported by those wallet APIs that do not require login. No HTTP endpoint will be opend by default. You can expose HTTP endpoint for wallet APIs by command: 171 | 172 | > cli_wallet --rpc-http-endpoint="127.0.0.1:8081" 173 | 174 | You can specify IP and port for your HTTP connection. These APIs can be called via any HTTP Client or compatible SDK for multiple programming languages. 175 | 176 | Both request and response of these APIs are JSON formated. The request must follow JSON-RPC 2.0 specifications, including three base elements: 177 | 178 | 1. id (any integer specified, simply to remark the sequence of API call) 179 | 2. method (the name of API to be revoked) 180 | 3. params (a list of parameters of this API) 181 | 182 | **request:** 183 | `` > { 184 | "method": "info", 185 | "params": [""], 186 | "id": 1 187 | }`` 188 | 189 | **response:** 190 | `` < { 191 | "id": 1, 192 | "result": { 193 | "head_block_num": 0, 194 | "head_block_id": "0000000000000000000000000000000000000000", 195 | "head_block_age": "25 weeks old", 196 | "next_maintenance_time": "47 years ago", 197 | "chain_id": "4777b283f8006237590c67a5001fb62e14fdfd2c0f5f5afb55e687ae8082d483", 198 | "participation": "100.00000000000000000", 199 | "active_miners": [ 200 | "1.4.1", 201 | "1.4.2", 202 | "1.4.3", 203 | "1.4.4", 204 | "1.4.5", 205 | "1.4.6", 206 | "1.4.7", 207 | "1.4.8", 208 | "1.4.9", 209 | "1.4.10", 210 | "1.4.11" 211 | ] 212 | } 213 | }`` 214 | 215 | 216 | ### 1.1.2 WebSocket Calls 217 | 218 | WebSocket call are only supported by those wallet APIs that do not require login. No WebSocket endpoint will be opend by default. You can expose HTTP endpoint for wallet APIs by command: 219 | 220 | > cli_wallet --rpc-endpoint="127.0.0.1:8082" 221 | 222 | You can specify IP and port for your WebSocket connection. These APIs can be called via any WebSocket Client or compatible SDK for multiple programming languages. 223 | 224 | Both request and response of these APIs are JSON formated. The request must follow JSON-RPC 2.0 specifications, including three base elements: 225 | 226 | 1. id (any integer specified, simply to remark the sequence of API call) 227 | 2. method (the name of API to be revoked) 228 | 3. params (a list of parameters of this API) 229 | 230 | **request:** 231 | `` > { 232 | "method": "is_locked", 233 | "params": [], 234 | "id": 2 235 | }`` 236 | 237 | **response:** 238 | `` { 239 | "id": 2, 240 | "result": false 241 | }`` 242 | 243 | 244 | # 2. API Definition 245 | 246 | ## 2.1 General APIs 247 | 248 | ### GENERAL 249 | 250 | #### help 251 | **Description:** Returns a list of all commands supported by the wallet API. 252 | **Parameters:** 253 | **Returns:** multi-line string 254 | **Note:** This lists each command, along with its arguments and return types. For more detailed help on a single command, use get_help(). 255 | 256 | ---- 257 | 258 | #### gethelp 259 | **Description:** Returns detailed help on a single API command. 260 | **Parameters:** 261 | 262 | | name | type | desc | 263 | | -------- | -------- | -------- | 264 | | method | string | the name of the API command you want help with | 265 | 266 | **Returns:** multi-line string 267 | 268 | ---- 269 | 270 | #### info 271 | **Description:** Get current blockchain info. 272 | **Parameters:** 273 | **Returns:** JSON object 274 | 275 | ---- 276 | 277 | #### about 278 | **Description:** Returns info such as client version, git version of graphene/fc, version of boost, openssl. 279 | **Parameters:** 280 | **Returns:** JSON object 281 | 282 | ---- 283 | 284 | #### network_add_nodes 285 | **Description:** Add network nodes. 286 | **Parameters:** 287 | 288 | | name | type | desc | 289 | | -------- | -------- | -------- | 290 | | nodes | vector | network nodes to be added | 291 | 292 | **Returns:** void 293 | 294 | ---- 295 | 296 | #### network_get_connected_peers 297 | **Description:** Get connected peers. 298 | **Parameters:** 299 | **Returns:** vector<variant> 300 | 301 | ---- 302 | 303 | ## 2.2 Wallet APIs 304 | 305 | ### WALLET 306 | 307 | #### is_new 308 | **Description:** Checks whether the wallet has just been created and has not yet had a password set. 309 | **Parameters:** 310 | **Returns:** bool 311 | **Note:** Calling set_password will transition the wallet to the locked state. 312 | 313 | ---- 314 | 315 | #### is_locked 316 | **Description:** Checks whether the wallet is locked (is unable to use its private keys). 317 | **Parameters:** 318 | **Returns:** bool 319 | **Note:** This state can be changed by calling lock() or unlock(). 320 | 321 | ---- 322 | 323 | #### lock 324 | **Description:** Locks the wallet immediately. 325 | **Parameters:** 326 | **Returns:** void 327 | 328 | ---- 329 | 330 | #### unlock 331 | **Description:** Unlocks the wallet. 332 | **Parameters:** 333 | 334 | | name | type | desc | 335 | | -------- | -------- | -------- | 336 | | password | string | the password previously set with set_password() | 337 | 338 | 339 | **Returns:** void 340 | **Note:** 341 | The wallet remains unlocked until the 'lock' is called or the program exits. 342 | 343 | ---- 344 | 345 | #### set_password 346 | **Description:** Sets a new password on the wallet. 347 | **Parameters:** 348 | 349 | | name | type | desc | 350 | | -------- | -------- | -------- | 351 | | password | string | password to set | 352 | 353 | **Returns:** void 354 | **Note:** 355 | The wallet must be either 'new' or 'unlocked' to execute this command. 356 | 357 | ---- 358 | 359 | #### dump_private_keys 360 | **Description:** Dumps all private keys owned by the wallet. 361 | **Parameters:** 362 | **Returns:** a map containing the private keys, indexed by their public key 363 | **Note:** The keys are printed in WIF format. You can import these keys into another wallet using import_key(). 364 | 365 | ---- 366 | 367 | #### import_key 368 | **Description:** Imports the private key for an existing account. 369 | **Parameters:** 370 | 371 | | name | type | desc | 372 | | -------- | -------- | -------- | 373 | | account_name_or_id | string | the account owning the key | 374 | | wif_key | string | the private key in WIF format | 375 | 376 | **Returns:** bool 377 | **Note:** The private key must match either an owner key or an active key for the named account. 378 | 379 | ---- 380 | 381 | #### import_accounts 382 | **Description:** Get mapped account names to boolean values indicating whether the account was successfully imported. 383 | **Parameters:** 384 | 385 | | name | type | desc | 386 | | -------- | -------- | -------- | 387 | | filename | string | the filename of the wallet JSON file | 388 | | password | string | user's password to the wallet | 389 | 390 | **Returns:** map of account names and boolean values 391 | 392 | ---- 393 | 394 | #### import_account_keys 395 | **Description:** Check whether the keys were imported. 396 | **Parameters:** 397 | 398 | | name | type | desc | 399 | | -------- | -------- | -------- | 400 | | filename | string | the filename of the wallet JSON file | 401 | | password | string | user's password to the wallet | 402 | | src_account_name | string | name of the source account | 403 | | dest_account_name | string | name of the destination account | 404 | 405 | **Returns:** bool 406 | 407 | ---- 408 | 409 | #### suggest_brain_key 410 | **Description:** Suggests a safe brain key to use for creating your account. create_account_with_brain_key() requires you to specify a ‘brain key’, a long passphrase that provides enough entropy to generate cyrptographic keys. This function will suggest a suitably random string that should be easy to write down (and, with effort, memorize). 411 | **Parameters:** 412 | **Returns:** string 413 | 414 | ---- 415 | 416 | #### get_private_key 417 | **Description:** Get the WIF private key corresponding to a public key. The private key must already be in the wallet. 418 | **Parameters:** 419 | 420 | | name | type | desc | 421 | | -------- | -------- | -------- | 422 | | pubkey | public_key_type | public key | 423 | 424 | **Returns:** string 425 | 426 | ---- 427 | 428 | #### load_wallet_file 429 | **Description:** Loads a specified Graphene wallet. 430 | **Parameters:** 431 | 432 | | name | type | desc | 433 | | -------- | -------- | -------- | 434 | | wallet_filename | string | the filename of the wallet JSON file to load. If wallet_filename is empty, it reloads the existing wallet file | 435 | 436 | **Returns:** bool 437 | **Note:** 438 | The current wallet is closed before the new wallet is loaded. This does not change the filename that will be used for future wallet writes, so this may cause you to overwrite your original wallet unless you also call set_wallet_filename(). 439 | 440 | ---- 441 | 442 | #### normalize_brain_key 443 | **Description:** Transforms a brain key to reduce the chance of errors when re-entering the key from memory. 444 | **Parameters:** 445 | 446 | | name | type | desc | 447 | | -------- | -------- | -------- | 448 | | s | string | the brain key as supplied by the user | 449 | 450 | **Returns:** string 451 | **Note:** 452 | This takes a user-supplied brain key and normalizes it into the form used 453 | for generating private keys. In particular, this upper-cases all ASCII 454 | characters and collapses multiple spaces into one. 455 | 456 | ---- 457 | 458 | #### save_wallet_file 459 | **Description:** Save wallet file. 460 | **Parameters:** 461 | 462 | | name | type | desc | 463 | | -------- | -------- | -------- | 464 | | wallet_filename | | the filename of the new wallet JSON file to create or overwrite, if 'wallet_filename' is empty, save to the current filename | 465 | 466 | **Returns:** void 467 | 468 | ---- 469 | 470 | ## 2.2 Account APIs 471 | 472 | ### ACCOUNT 473 | 474 | #### list_my_accounts 475 | **Description:** Get a list of my account objects. 476 | **Parameters:** 477 | **Returns:** vector<account_object> 478 | 479 | ---- 480 | 481 | #### list_accounts 482 | **Description:** Get a list of accounts mapping account names to account ids. 483 | **Parameters:** 484 | 485 | | name | type | desc | 486 | | -------- | -------- | -------- | 487 | | lowerbound | string | the name of the first account to return. If the named account does not exist, the list will start at the account that comes after 'lowerbound' | 488 | | limit | uint32_t | the maximum number of accounts to return (max: 1000) | 489 | 490 | 491 | **Returns:** map<string, account_id_type> 492 | **Note:** 493 | Use the 'lowerbound' and limit parameters to page through the list. To 494 | retrieve all accounts, start by setting 'lowerbound' to the empty string 495 | '""', and then each iteration, pass the last account name returned as the 496 | 'lowerbound' for the next 'list_accounts()' call. 497 | 498 | ---- 499 | 500 | #### list_account_balances 501 | **Description:** Get a list of the given account's balances. 502 | **Parameters:** 503 | 504 | | name | type | desc | 505 | | -------- | -------- | -------- | 506 | | id | string | the name or id of the account whose balances you want | 507 | 508 | **Returns:** vector<asset> 509 | 510 | ---- 511 | 512 | #### register_account 513 | **Description:** Registers a third party’s account on the blockckain. 514 | **Parameters:** 515 | 516 | | name | type | desc | 517 | | -------- | -------- | -------- | 518 | | name | string | the name of the account, must be unique on the blockchain. Shorter names are more expensive to register; the rules are still in flux, but in general names of more than 8 characters with at least one digit will be cheap | 519 | | owner | public_key_type | the owner key for the new account | 520 | | active | public_key_type | the active key for the new account | 521 | | registrar_account | string | the account which will pay the fee to register the user | 522 | | referrer_percent | uint32_t | the percentage (0 - 100) of the new user’s transaction fees not claimed by the blockchain that will be distributed to the referrer; the rest will be sent to the registrar. Will be multiplied by GRAPHENE_1_PERCENT when constructing the transaction | 523 | | broadcast | bool | true to broadcast the transaction on the network | 524 | TBD 525 | 526 | **Returns:** signed transaction object 527 | **Note:** This function is used to register an account for which you do not own the private keys. When acting as a registrar, an end user will generate their own private keys and send you the public keys. The registrar will use this function to register the account on behalf of the end user. 528 | 529 | ---- 530 | 531 | #### create_account_with_brain_key 532 | **Description:** Creates a new account and registers it on the blockchain. 533 | **Parameters:** 534 | 535 | | name | type | desc | 536 | | -------- | -------- | -------- | 537 | | brain_key | string | the brain key used for generating the account’s private keys | 538 | | account_name | string | the name of the account, must be unique on the blockchain. Shorter names are more expensive to register; the rules are still in flux, but in general names of more than 8 characters with at least one digit will be cheap | 539 | | registrar_account | string | the account which will pay the fee to register the user | 540 | | broadcast | bool | true to broadcast the transaction on the network | 541 | 542 | **Returns:** signed transaction object 543 | 544 | ---- 545 | 546 | #### transfer 547 | **Description:** Transfer an amount from one account to another. 548 | **Parameters:** 549 | 550 | | name | type | desc | 551 | | -------- | -------- | -------- | 552 | | from | string | the name or id of the account sending the funds | 553 | | to | string | the name or id of the account receiving the funds | 554 | | amount | string | the amount to send (in nominal units to send half of a BTS, specify 0.5) | 555 | | asset_symbol | string | the symbol or id of the asset to send | 556 | | memo | string | a memo to attach to the transaction. The memo will be encrypted in the transaction and readable for the receiver. There is no length limit other than the limit imposed by maximum transaction size, but transaction increase with transaction size | 557 | | broadcast | bool | true to broadcast the transaction on the network | 558 | 559 | TBDTBDTBD 560 | 561 | **Returns:** signed transaction object 562 | 563 | ---- 564 | 565 | #### transfer2 566 | **Description:** This method works just like transfer, except it always broadcasts and returns the transaction ID along with the signed transaction. 567 | **Parameters:** 568 | 569 | | name | type | desc | 570 | | -------- | -------- | -------- | 571 | | from | string | the name or id of the account sending the funds | 572 | | to | string | the name or id of the account receiving the funds | 573 | | amount | string | the amount to send (in nominal units to send half of a BTS, specify 0.5) | 574 | | asset_symbol | string | the symbol or id of the asset to send | 575 | | memo | string | a memo to attach to the transaction. The memo will be encrypted in the transaction and readable for the receiver. There is no length limit other than the limit imposed by maximum transaction size, but transaction increase with transaction size | 576 | | broadcast | bool | true to broadcast the transaction on the network | 577 | 578 | **Returns:** pair of transaction id and signed transaction object 579 | 580 | ---- 581 | 582 | #### get_transaction_id 583 | **Description:** convert a JSON transaction to its transactin ID. 584 | **Parameters:** 585 | 586 | | name | type | desc | 587 | | -------- | -------- | -------- | 588 | | trx | signed_transaction | signed transaction | 589 | 590 | **Returns:** string 591 | 592 | ---- 593 | 594 | #### get_vesting_balances 595 | **Description:** Get information about a vesting balance object. 596 | **Parameters:** 597 | 598 | | name | type | desc | 599 | | -------- | -------- | -------- | 600 | | account_name | string | an account name, account ID, or vesting balance object ID | 601 | 602 | **Returns:** vector<vesting_balance_object_with_info> 603 | 604 | ---- 605 | 606 | #### withdraw_vesting 607 | **Description:** Withdraw a vesting balance. 608 | **Parameters:** 609 | 610 | | name | type | desc | 611 | | -------- | -------- | -------- | 612 | | miner_name | string | The account name of the witness, also accepts account ID or vesting balance ID | 613 | | amount | string | The amount to withdraw | 614 | | asset_symbol | string | The symbol of the asset to withdraw | 615 | | broadcast | bool | true if you wish to broadcast the transaction | 616 | 617 | **Returns:** signed_transaction 618 | 619 | ---- 620 | 621 | #### get_account 622 | **Description:** Returns information about the given account. 623 | **Parameters:** 624 | 625 | | name | type | desc | 626 | | -------- | -------- | -------- | 627 | | account_name_or_id | string | the name or id of the account to provide information about | 628 | 629 | **Returns:** account object 630 | 631 | ---- 632 | 633 | #### get_account_id 634 | **Description:** Lookup the id of a named account. 635 | **Parameters:** 636 | 637 | | name | type | desc | 638 | | -------- | -------- | -------- | 639 | | account_name_or_id | string | the name of the account to look up | 640 | 641 | **Returns:** account id 642 | 643 | ---- 644 | 645 | #### get_account_history 646 | **Description:** Returns the most recent operations on the named account. 647 | **Parameters:** 648 | 649 | | name | type | desc | 650 | | -------- | -------- | -------- | 651 | | name | string | the name or id of the account | 652 | | limit | int | the number of entries to return (starting from the most recent) (max 100) | 653 | 654 | **Returns:** vector<operation_detail> 655 | **Note:** This returns a list of operation history objects, which describe activity on the account. 656 | 657 | ---- 658 | 659 | #### approve_proposal 660 | **Description:** Approve or disapprove a proposal. 661 | **Parameters:** 662 | 663 | | name | type | desc | 664 | | -------- | -------- | -------- | 665 | | fee_paying_account | string | the account paying the fee for the op | 666 | | proposal_id | string | the proposal to modify | 667 | | delta | approval_delta | Members contain approvals to create or remove. In JSON you can leave empty members undefined | 668 | | broadcast | bool | true if you wish to broadcast the transaction | 669 | 670 | **Returns:** signed transaction 671 | 672 | ---- 673 | 674 | ## 2.3 Asset APIs 675 | 676 | ### ASSET 677 | 678 | #### list_assets 679 | **Description:** Lists all assets registered on the blockchain. 680 | **Parameters:** 681 | 682 | | name | type | desc | 683 | | -------- | -------- | -------- | 684 | | lowerbound | string | the symbol of the first asset to include in the list | 685 | | limit | uint32_t | the maximum number of assets to return (max: 100) | 686 | 687 | 688 | **Returns:** vector of asset object 689 | **Note:** To list all assets, pass the empty string "" for the lowerbound to start at the beginning of the list, and iterate as necessary. 690 | 691 | ---- 692 | 693 | #### publish_asset_feed 694 | **Description:** Publishes a price feed for the named asset. 695 | **Parameters:** 696 | 697 | | name | type | desc | 698 | | -------- | -------- | -------- | 699 | | publishing_account | string | the account publishing the price feed | 700 | | symbol | string | the name or id of the asset whose feed we're publishing | 701 | | feed | price_feed | the price_feed object for particular market-issued asset | 702 | | broadcast | bool | true to broadcast the transaction on the network | 703 | 704 | 705 | **Returns:** signed_transaction 706 | **Note:** 707 | Price feed providers use this command to publish their price feeds for market-issued assets. A price feed is used to tune the market for a particular market-issued asset. For each value in the feed, the median across all committee_member feeds for that asset is calculated and the market for the asset is configured with the median of that value. 708 | The feed object in this command contains three prices: a call price limit, a short price limit, and a settlement price. The call limit price is structured as (collateral asset) / (debt asset) and the short limit price is structured as (asset for sale) / (collateral asset). Note that the asset IDs are opposite to eachother, so if we’re publishing a feed for USD, the call limit price will be CORE/USD and the short limit price will be USD/CORE. The settlement price may be flipped either direction, as long as it is a ratio between the market-issued asset and its collateral. 709 | 710 | ---- 711 | 712 | #### issue_asset 713 | **Description:** Issue new shares of an asset. 714 | **Parameters:** 715 | 716 | | name | type | desc | 717 | | -------- | -------- | -------- | 718 | | to_account | string | the name or id of the account to receive the new shares | 719 | | amount | string | the amount to issue, in nominal units | 720 | | symbol | string | the ticker symbol of the asset to issue | 721 | | memo | string | a memo to include in the transaction, readable by the recipient | 722 | | broadcast | bool | true to broadcast the transaction on the network | 723 | 724 | **Returns:** signed transaction object 725 | 726 | ---- 727 | 728 | #### get_asset 729 | **Description:** Returns information about the given asset. 730 | **Parameters:** 731 | 732 | | name | type | desc | 733 | | -------- | -------- | -------- | 734 | | asset_name_or_id | string | the symbol or id of the asset in question | 735 | 736 | **Returns:** asset object 737 | 738 | ---- 739 | 740 | #### reserve_asset 741 | **Description:** Burns the given user-issued asset. 742 | **Parameters:** 743 | 744 | | name | type | desc | 745 | | -------- | -------- | -------- | 746 | | from | string | the account containing the asset you wish to burn | 747 | | amount | string | the amount to burn, in nominal units | 748 | | symbol | string | the name or id of the asset to burn | 749 | | broadcast | bool | true to broadcast the transaction on the network | 750 | 751 | 752 | **Returns:** signed_transaction 753 | **Note:** This command burns the user-issued asset to reduce the amount in circulation. you cannot burn market-issued assets. 754 | 755 | ---- 756 | 757 | ## 2.4 Inspection APIs 758 | 759 | ### INSPECTION 760 | 761 | #### get_block 762 | **Description:** Get the referenced block with info. 763 | **Parameters:** 764 | 765 | | name | type | desc | 766 | | -------- | -------- | -------- | 767 | | num | uint32_t | ID of the block | 768 | 769 | **Returns:** signed block object 770 | 771 | ---- 772 | 773 | #### get_account_count 774 | **Description:** Returns the number of accounts registered on the blockchain. 775 | **Parameters:** 776 | **Returns:** uint64_t 777 | 778 | ---- 779 | 780 | #### get_global_properties 781 | **Description:** Returns the block chain’s slowly-changing settings. This object contains all of the properties of the blockchain that are fixed or that change only once per maintenance interval (daily) such as the current list of witnesses, committee_members, block interval, etc. 782 | **Parameters:** 783 | **Returns:** global properties object 784 | **Note:** get_dynamic_global_properties() for frequently changing properties 785 | 786 | ---- 787 | 788 | #### get_dynamic_global_properties 789 | **Description:** Returns the block chain’s rapidly-changing properties. The returned object contains information that changes every block interval such as the head block number, the next witness, etc. 790 | **Parameters:** 791 | **Returns:** dynami global properties object 792 | 793 | ---- 794 | 795 | #### get_object 796 | **Description:** Returns the blockchain object corresponding to the given id. 797 | **Parameters:** 798 | 799 | | name | type | desc | 800 | | -------- | -------- | -------- | 801 | | id | object_id_type | the id of the object to return | 802 | 803 | **Returns:** the requested object 804 | **Note:** 805 | This generic function can be used to retrieve any object from the blockchain that is assigned an ID. Certain types of objects have specialized convenience functions to return their objects e.g., assets have get_asset(), accounts have get_account(), but this function will work for any object. 806 | 807 | ---- 808 | 809 | ## 2.5 TRANSACTION APIs 810 | 811 | ### TRANSACTION BUILDER 812 | 813 | #### begin_builder_transaction 814 | **Description:** Begin builder transaction. 815 | **Parameters:** 816 | **Returns:** transaction handle 817 | 818 | ---- 819 | 820 | #### add_operation_to_builder_transaction 821 | **Description:** Add an operation to builder transaction. 822 | **Parameters:** 823 | 824 | | name | type | desc | 825 | | -------- | -------- | -------- | 826 | | transaction_handle | transaction_handle_type | ... | 827 | | operation | operation | ... | 828 | 829 | **Returns:** void 830 | 831 | ---- 832 | 833 | #### replace_operation_in_builder_transaction 834 | **Description:** Replace operation in a builder transaction. 835 | **Parameters:** 836 | 837 | | name | type | desc | 838 | | -------- | -------- | -------- | 839 | | handle | transaction_handle_type | ... | 840 | | operation_index | unsigned | ... | 841 | | new_op | operation | ... | 842 | 843 | **Returns:** void 844 | 845 | ---- 846 | 847 | #### set_fees_on_builder_transaction 848 | **Description:** Set builder transaction fees. 849 | **Parameters:** 850 | 851 | | name | type | desc | 852 | | -------- | -------- | -------- | 853 | | handle | transaction_handle_type | handle of the transaction | 854 | | fee_asset | string | ... | 855 | 856 | **Returns:** asset object 857 | 858 | ---- 859 | 860 | #### preview_builder_transaction 861 | **Description:** Preview builder transaction. 862 | **Parameters:** 863 | 864 | | name | type | desc | 865 | | -------- | -------- | -------- | 866 | | handle | transaction_handle_type | ... | 867 | 868 | **Returns:** transaction object 869 | 870 | ---- 871 | 872 | #### sign_builder_transaction 873 | **Description:** Sign builder transaction. 874 | **Parameters:** 875 | 876 | | name | type | desc | 877 | | -------- | -------- | -------- | 878 | | transaction_handle | transaction_handle_type | ... | 879 | | broadcast | bool | true to broadcast the transaction on the network | 880 | 881 | **Returns:** signed transaction object 882 | 883 | ---- 884 | 885 | #### propose_builder_transaction 886 | **Description:** Propose builder transaction. 887 | **Parameters:** 888 | 889 | | name | type | desc | 890 | | -------- | -------- | -------- | 891 | | handle | transaction_handle_type | ... | 892 | | expiration | time_point_sec | ... | 893 | | review_period_seconds | uint32_t | ... | 894 | | broadcast | bool | true to broadcast the transaction on the network | 895 | 896 | **Returns:** signed transaction object 897 | 898 | ---- 899 | 900 | #### propose_builder_transaction2 901 | **Description:** Propose builder transaction. 902 | **Parameters:** 903 | 904 | | name | type | desc | 905 | | -------- | -------- | -------- | 906 | | handle | transaction_handle_type | ... | 907 | | account_name_or_id | string | ... | 908 | | expiration | time_point_sec | ... | 909 | | review_period_seconds | uint32_t | ... | 910 | | broadcast | bool | true to broadcast the transaction on the network | 911 | 912 | **Returns:** void 913 | 914 | ---- 915 | 916 | #### remove_builder_transaction 917 | **Description:** Remove builder transactions. 918 | **Synopsis:** 919 | > remove_builder_transaction <handle> 920 | 921 | **Parameters:** 922 | 923 | | name | type | desc | 924 | | -------- | -------- | -------- | 925 | | handle | transaction_handle_type | transaction handle | 926 | 927 | **Returns:** void 928 | 929 | ---- 930 | 931 | #### serialize_transaction 932 | **Description:** Converts a signed_transaction in JSON form to its binary representation. 933 | **Parameters:** 934 | 935 | | name | type | desc | 936 | | -------- | -------- | -------- | 937 | | tx | signed_transaction | the transaction to serialize | 938 | 939 | **Returns:** signed_transaction 940 | **Note:** It will not be hex encoded, this returns a raw string that may have null characters embedded in it 941 | 942 | ---- 943 | 944 | #### sign_transaction 945 | **Description:** Signs a transaction. 946 | **Parameters:** 947 | 948 | | name | type | desc | 949 | | -------- | -------- | -------- | 950 | | tx | signed_transaction | the unsigned transaction | 951 | | broadcast | bool | true if you wish to broadcast the transaction | 952 | 953 | **Returns:** signed_transaction 954 | **Note:** Given a fully-formed transaction that is only lacking signatures, this signs the transaction with the necessary keys and optionally broadcasts the transaction. 955 | 956 | ---- 957 | 958 | #### get_prototype_operation 959 | **Description:** Returns an uninitialized object representing a given blockchain operation. 960 | **Parameters:** 961 | 962 | | name | type | desc | 963 | | -------- | -------- | -------- | 964 | | operation_type | string | the type of operation to return, must be one of the operations defined in graphene/chain/operations.hpp (e.g., "global_parameters_update_operation") | 965 | 966 | **Returns:** a default-constructed operation of the given type 967 | **Note:** 968 | This returns a default-initialized object of the given type; it can be used during early development of the wallet when we don’t yet have custom commands for creating all of the operations the blockchain supports. 969 | Any operation the blockchain supports can be created using the transaction builder’s add_operation_to_builder_transaction() , but to do that from the CLI you need to know what the JSON form of the operation looks like. This will give you a template you can fill in. It’s better than nothing. 970 | 971 | ---- 972 | 973 | ## 2.6 OTHERS 974 | 975 | ### UNCLASSIFIED 976 | 977 | #### claim_fees 978 | **Description:** Transfers accumulated assets from pools back to the issuer's balance. 979 | **Parameters:** 980 | 981 | | name | type | desc | 982 | | -------- | -------- | -------- | 983 | | uia_amount | string | the amount of "this" asset to claim, in nominal units | 984 | | uia_symbol | string | the name or id of the asset to claim | 985 | | dct_amount | string | the amount of DCT asset to claim, in nominal units | 986 | * dct_symbol: the name or id of the DCT asset to claim (type: string) 987 | * broadcast: true to broadcast the transaction on the network (type: 988 | bool) 989 | 990 | **Returns:** transaction_handle_type 991 | 992 | ---- 993 | 994 | #### content_cancellation 995 | **Description:** Cancel content. 996 | **Parameters:** 997 | 998 | | name | type | desc | 999 | | -------- | -------- | -------- | 1000 | | author | string | the author of the content | 1001 | | URI | string | the URI of the content | 1002 | | broadcast | bool | true to broadcast the transaction on the network | 1003 | 1004 | **Returns:** signed_transaction 1005 | 1006 | ---- 1007 | 1008 | #### create_miner 1009 | **Description:** Create a minor. 1010 | **Parameters:** 1011 | 1012 | | name | type | desc | 1013 | | -------- | -------- | -------- | 1014 | | owner_account | string | the name or id of the account which is creating the miner | 1015 | | url | string | a URL to include in the miner record in the blockchain, clients may display this when showing a list of miners | 1016 | | broadcast | bool | true to broadcast the transaction on the network | 1017 | 1018 | **Returns:** signed_transaction 1019 | 1020 | ---- 1021 | 1022 | #### create_monitored_asset 1023 | **Description:** Create monitored assets. 1024 | **Parameters:** 1025 | 1026 | | name | type | desc | 1027 | | -------- | -------- | -------- | 1028 | | issuer | string | ... | 1029 | | symbol | string | ... | 1030 | | precision | uint8_t | the number of digits after the decimal point | 1031 | | feed_lifetime_sec | uint32_t | ... | 1032 | | minimum_feeds | uint32_t | ... | 1033 | | broadcast | bool | ... | 1034 | 1035 | **Returns:** signed_transaction 1036 | 1037 | ---- 1038 | 1039 | #### create_package 1040 | **Description:** Get package hash (ripemd160 hash of package content) and content custody data. 1041 | **Parameters:** 1042 | 1043 | | name | type | desc | 1044 | | -------- | -------- | -------- | 1045 | | content_dir | string | directory containing all content that should be packed | 1046 | | samples_dir | string | directory containing samples of content | 1047 | | aes_key | DInteger | AES key for encryption | 1048 | 1049 | **Returns:** std::pair<string, decent::encrypt::CustodyData> 1050 | 1051 | ---- 1052 | 1053 | #### create_user_issued_asset 1054 | **Description:** Create user issued asset. 1055 | **Parameters:** 1056 | 1057 | | name | type | desc | 1058 | | -------- | -------- | -------- | 1059 | | issuer | string | the name or id of the account who will pay the fee and become the issuer of the new asset | 1060 | | symbol | string | the ticker symbol of the new asset | 1061 | | precision | uint8_t | the number of digits of precision to the right of the decimal point, must be less than or equal to 12 | 1062 | | description | string | asset description, maximal length is 1000 chars | 1063 | | max_supply | uint64_t | the maximum supply of this asset which may exist at any given time | 1064 | | core_exchange_rate | price | core_exchange_rate technically needs to store the asset ID of this new asset, since this ID is not known at the time this operation is created, create this price as though the new asset has instance ID 1, and the chain will overwrite it with the new asset's ID | 1065 | | is_exchangeable | bool | true to allow implicit conversion of this asset to/from core asset | 1066 | | broadcast | bool | true to broadcast the transaction on the network | 1067 | 1068 | **Returns:** signed_transaction 1069 | 1070 | ---- 1071 | 1072 | #### dbg_generate_blocks 1073 | **Description:** Generate blocks (debug). 1074 | **Parameters:** 1075 | 1076 | | name | type | desc | 1077 | | -------- | -------- | -------- | 1078 | | debug_wif_key | string | ... | 1079 | | count | uint32_t | ... | 1080 | 1081 | **Returns:** void 1082 | 1083 | ---- 1084 | 1085 | #### dbg_make_mia 1086 | **Description:** Make mia (debug). 1087 | **Parameters:** 1088 | 1089 | | name | type | desc | 1090 | | -------- | -------- | -------- | 1091 | | creator | string | ... | 1092 | | symbol | string | ... | 1093 | 1094 | **Returns:** 1095 | 1096 | void dbg_make_mia(string creator, string symbol) 1097 | 1098 | ---- 1099 | 1100 | #### dbg_push_blocks 1101 | **Description:** Push blocks (debug). 1102 | **Parameters:** 1103 | 1104 | | name | type | desc | 1105 | | -------- | -------- | -------- | 1106 | | src_filename | string | ... | 1107 | | count | uint32_t | ... | 1108 | 1109 | **Returns:** void 1110 | 1111 | ---- 1112 | 1113 | #### dbg_stream_json_objects 1114 | **Description:** Stream JSON objects (debug). 1115 | **Parameters:** 1116 | 1117 | | name | type | desc | 1118 | | -------- | -------- | -------- | 1119 | | filename | string | ... | 1120 | 1121 | **Returns:** void 1122 | 1123 | ---- 1124 | 1125 | #### dbg_update_object 1126 | **Description:** Update object (debug). 1127 | **Parameters:** 1128 | 1129 | | name | type | desc | 1130 | | -------- | -------- | -------- | 1131 | | update | variant_object | ... | 1132 | 1133 | **Returns:** void 1134 | 1135 | ---- 1136 | 1137 | #### download_content 1138 | **Description:** Download content. 1139 | **Parameters:** 1140 | 1141 | | name | type | desc | 1142 | | -------- | -------- | -------- | 1143 | | consumer | string | consumer of the content | 1144 | | URI | string | the URI of the content | 1145 | | region_code_from | string | two letter region code | 1146 | | broadcast | bool | true to broadcast the transaction on the network | 1147 | 1148 | **Returns:** void 1149 | 1150 | ---- 1151 | 1152 | #### download_package 1153 | **Description:** Download package. 1154 | **Parameters:** 1155 | 1156 | | name | type | desc | 1157 | | -------- | -------- | -------- | 1158 | | url | string | magnet or IPFS URL of package | 1159 | 1160 | **Returns:** void 1161 | 1162 | ---- 1163 | 1164 | #### extract_package 1165 | **Description:** Extract packages. 1166 | **Parameters:** 1167 | 1168 | | name | type | desc | 1169 | | -------- | -------- | -------- | 1170 | | package_hash | string | hash of package that needs to be extracted | 1171 | | output_dir | string | directory where extracted files will be created | 1172 | | aes_key | DInteger | AES key for decryption | 1173 | 1174 | **Returns:** void 1175 | 1176 | ---- 1177 | 1178 | #### flood_network 1179 | **Description:** Flood network. 1180 | **Parameters:** 1181 | 1182 | | name | type | desc | 1183 | | -------- | -------- | -------- | 1184 | | prefix | string | ... | 1185 | | number_of_transactions | uint32_t | ... | 1186 | 1187 | **Returns:** void 1188 | 1189 | ---- 1190 | 1191 | #### fund_asset_pools 1192 | **Description:** Pay into the pools for the given asset. 1193 | **Parameters:** 1194 | 1195 | | name | type | desc | 1196 | | -------- | -------- | -------- | 1197 | | from | string | the name or id of the account sending the core asset | 1198 | | uia_amount | string | the amount of "this" asset to deposit | 1199 | | uia_symbol | string | the name or id of the asset whose pool you wish to fund | 1200 | | dct_amount | string | the amount of the core asset to deposit | 1201 | | dct_symbol | string | the name or id of the DCT asset | 1202 | | broadcast | bool | true to broadcast the transaction on the network | 1203 | 1204 | 1205 | **Returns:** signed_transaction 1206 | **Note:** 1207 | User-issued assets can optionally have a pool of the core asset which is 1208 | automatically used to pay transaction fees for any transaction using that 1209 | asset (using the asset's core exchange rate). 1210 | Allows anyone to deposit core/asset into pools. This pool are used when 1211 | conversion between assets is needed (paying fees, paying for a content in 1212 | different asset). 1213 | 1214 | ---- 1215 | 1216 | #### generate_brain_key_el_gamal_key 1217 | **Description:** Generate brain key. 1218 | **Parameters:** 1219 | **Returns:** pair<brain_key_info, el_gamal_key_pair> 1220 | 1221 | ---- 1222 | 1223 | #### generate_el_gamal_keys 1224 | **Description:** Generate ElGamal keys. 1225 | **Parameters:** 1226 | **Returns:** el_gamal_key_pair 1227 | 1228 | ---- 1229 | 1230 | #### generate_encryption_key 1231 | **Description:** Generate encryption key. 1232 | **Parameters:** 1233 | **Returns:** DInteger 1234 | 1235 | ---- 1236 | 1237 | #### get_author_and_co_authors_by_URI 1238 | **Description:** Get the autor of the content and the list of co-authors. 1239 | **Parameters:** 1240 | 1241 | | name | type | desc | 1242 | | -------- | -------- | -------- | 1243 | | URI | string | URI of the content | 1244 | 1245 | **Returns:** pair<account_id_type, vector<account_id_type>> 1246 | 1247 | ---- 1248 | 1249 | #### get_brain_key_info 1250 | **Description:** Get brain key info. 1251 | **Parameters:** 1252 | 1253 | | name | type | desc | 1254 | | -------- | -------- | -------- | 1255 | | brain_key | string | the brain key to be used for calculation | 1256 | 1257 | **Returns:** brain_key_info 1258 | 1259 | ---- 1260 | 1261 | #### get_buying_by_consumer_URI 1262 | **Description:** Get buying objects corresponding to the provided consumer. 1263 | **Parameters:** 1264 | 1265 | | name | type | desc | 1266 | | -------- | -------- | -------- | 1267 | | account_id_or_name | string | consumer of the buying to retrieve | 1268 | | URI | string | URI of the buying to retrieve | 1269 | 1270 | **Returns:** optional<buying_object> 1271 | 1272 | ---- 1273 | 1274 | #### get_buying_history_objects_by_consumer 1275 | **Description:** Get history buying objects corresponding to the provided consumer. 1276 | **Parameters:** 1277 | 1278 | | name | type | desc | 1279 | | -------- | -------- | -------- | 1280 | | account_id_or_name | string | consumer of the buyings to retrieve | 1281 | 1282 | **Returns:** vector<buying_object> 1283 | 1284 | ---- 1285 | 1286 | #### get_content 1287 | **Description:** Get the content corresponding to the provided URI. 1288 | **Parameters:** 1289 | 1290 | | name | type | desc | 1291 | | -------- | -------- | -------- | 1292 | | URI | string | URI of the content to retrieve | 1293 | 1294 | **Returns:** optional<content_object> 1295 | 1296 | ---- 1297 | 1298 | #### get_download_status 1299 | **Description:** Get download status. 1300 | **Parameters:** 1301 | 1302 | | name | type | desc | 1303 | | -------- | -------- | -------- | 1304 | | consumer | string | consumer of the content | 1305 | | URI | string | the URI of the content | 1306 | 1307 | **Returns:** optional<content_download_status> 1308 | 1309 | ---- 1310 | 1311 | #### get_el_gammal_key 1312 | **Description:** Get pair of ElGamal keys. 1313 | **Parameters:** 1314 | 1315 | | name | type | desc | 1316 | | -------- | -------- | -------- | 1317 | | consumer | string | ... | 1318 | 1319 | **Returns:** el_gamal_key_pair_str 1320 | 1321 | get_el_gammal_key(string const & consumer) 1322 | 1323 | ---- 1324 | 1325 | #### get_feeds_by_miner 1326 | **Description:** Get list of price feeds published by the miner. 1327 | **Parameters:** 1328 | 1329 | | name | type | desc | 1330 | | -------- | -------- | -------- | 1331 | | account_name_or_id | string | the name or id of the account | 1332 | | count | uint32_t | maximum number of price feeds to fetch (must not exceed 100) | 1333 | **Returns:** multimap<time_point_sec, price_feed> 1334 | 1335 | ---- 1336 | 1337 | #### get_message_objects 1338 | **Description:** Get vector of message objects. 1339 | **Parameters:** 1340 | 1341 | | name | type | desc | 1342 | | -------- | -------- | -------- | 1343 | | receiver | string | name of message receiver | 1344 | | max_count | uint32_t | maximal number of last messages to be displayed | 1345 | 1346 | **Returns:** vector<message_object> 1347 | 1348 | ---- 1349 | 1350 | #### get_messages 1351 | **Description:** Get vector of message objects. 1352 | **Parameters:** 1353 | 1354 | | name | type | desc | 1355 | | -------- | -------- | -------- | 1356 | | receiver | string | name of message receiver | 1357 | | max_count | uint32_t | maximal number of last messages to be displayed | 1358 | 1359 | **Returns:** vector 1360 | 1361 | ---- 1362 | 1363 | #### get_miner 1364 | **Description:** Get the information about the miner stored in the blockchain. 1365 | **Parameters:** 1366 | 1367 | | name | type | desc | 1368 | | -------- | -------- | -------- | 1369 | | owner_account | string | the name or id of the miner account owner, or the id of the miner | 1370 | 1371 | **Returns:** miner_object 1372 | 1373 | ---- 1374 | 1375 | #### get_monitored_asset_data 1376 | **Description:** Get the BitAsset-specific data for this asset. 1377 | **Parameters:** 1378 | 1379 | | name | type | desc | 1380 | | -------- | -------- | -------- | 1381 | | asset_name_or_id | string | the symbol or id of the BitAsset in question | 1382 | 1383 | **Returns:** monitored_asset_options 1384 | 1385 | ---- 1386 | 1387 | #### get_open_buyings 1388 | **Description:** Get open buying objects. 1389 | **Returns:** vector<buying_object> 1390 | 1391 | ---- 1392 | 1393 | #### get_open_buyings_by_URI 1394 | **Description:** Get open buyings corresponding to the provided URI. 1395 | **Parameters:** 1396 | 1397 | | name | type | desc | 1398 | | -------- | -------- | -------- | 1399 | | URI | string | URI of the buyings to retrieve | 1400 | 1401 | **Returns:** vector<buying_object> 1402 | 1403 | ---- 1404 | 1405 | #### get_open_buyings_by_consumer 1406 | **Description:** Get open buyings corresponding to the provided consumer. 1407 | **Parameters:** 1408 | 1409 | | name | type | desc | 1410 | | -------- | -------- | -------- | 1411 | | account_id_or_name | string | consumer of the buyings to retrieve | 1412 | 1413 | **Returns:** vector 1414 | 1415 | ---- 1416 | 1417 | #### get_proposed_transactions 1418 | **Description:** Get list of proposed transactions. 1419 | **Parameters:** 1420 | 1421 | | name | type | desc | 1422 | | -------- | -------- | -------- | 1423 | | account_or_id | string | ... | 1424 | 1425 | **Returns:** vector 1426 | 1427 | ---- 1428 | 1429 | #### get_real_supply 1430 | **Description:** Get current supply of the core asset. 1431 | **Parameters:** 1432 | **Returns:** real_supply 1433 | 1434 | ---- 1435 | 1436 | #### head_block_time 1437 | **Description:** Get the head block time. 1438 | **Parameters:** 1439 | **Returns:** fc::time_point_sec 1440 | 1441 | ---- 1442 | 1443 | #### leave_rating_and_comment 1444 | **Description:** Rate and comment. 1445 | **Parameters:** 1446 | 1447 | | name | type | desc | 1448 | | -------- | -------- | -------- | 1449 | | consumer | string | consumer giving the rating | 1450 | | URI | string |the URI of the content | 1451 | | rating | uint64_t | ... | 1452 | | comment | string | ... | 1453 | | broadcast | bool | true to broadcast the transaction on the network | 1454 | 1455 | **Returns:** void 1456 | 1457 | ---- 1458 | 1459 | #### list_active_subscriptions_by_author 1460 | **Description:** Get list of active subscription objects corresponding to the provided author. 1461 | **Parameters:** 1462 | 1463 | | name | type | desc | 1464 | | -------- | -------- | -------- | 1465 | | account_id_or_name | string | the name or id of the author | 1466 | | count | uint32_t | maximum number of subscriptions to fetch (must not exceed 100) | 1467 | 1468 | **Returns:** vector<subscription_object> 1469 | 1470 | ---- 1471 | 1472 | #### list_active_subscriptions_by_consumer 1473 | **Description:** Get list of active subscription objects corresponding to the provided consumer. 1474 | **Parameters:** 1475 | 1476 | | name | type | desc | 1477 | | -------- | -------- | -------- | 1478 | | account_id_or_name | string | the name or id of the consumer | 1479 | | count | uint32_t | maximum number of subscriptions to fetch (must not exceed 100) | 1480 | 1481 | **Returns:** vector<subscription_object> 1482 | 1483 | ---- 1484 | 1485 | #### list_miners 1486 | **Description:** Get a list of miners mapping miner names to miner ids. 1487 | **Parameters:** 1488 | 1489 | | name | type | desc | 1490 | | -------- | -------- | -------- | 1491 | | lowerbound | string | the name of the first miner to return. If the named miner does not exist, the list will start at the miner that comes after 'lowerbound' | 1492 | | limit | uint32_t | the maximum number of miners to return (max: 1000) | 1493 | 1494 | 1495 | **Returns:** map<string, miner_id_type> 1496 | **Note:** 1497 | Use the 'lowerbound' and limit parameters to page through the list. To 1498 | retrieve all miners, start by setting 'lowerbound' to the empty string 1499 | '""', and then each iteration, pass the last miner name returned as the 1500 | 'lowerbound' for the next 'list_miners()' call. 1501 | 1502 | ---- 1503 | 1504 | #### list_publishers_by_price 1505 | **Description:** List publishers by price. 1506 | **Parameters:** 1507 | 1508 | | name | type | desc | 1509 | | -------- | -------- | -------- | 1510 | | count | uint32_t | maximum number of seeders to retrieve | 1511 | 1512 | **Returns:** vector<seeder_object> 1513 | 1514 | 1515 | 1516 | #### list_publishing_managers 1517 | **Description:** Get list of publishing managers 1518 | **Parameters:** 1519 | 1520 | | name | type | desc | 1521 | | -------- | -------- | -------- | 1522 | | lower_bound_name | string | the name of the first account to return, if the named account does not exist, the list will start at the account that comes after 'lowerbound' | 1523 | | limit | uint32_t | the maximum number of accounts to return (max: 100) | 1524 | 1525 | 1526 | **Returns:** vector<account_id_type> 1527 | 1528 | ---- 1529 | 1530 | #### list_seeders_by_rating 1531 | **Description:** Get list of seeders by rating. 1532 | **Parameters:** 1533 | 1534 | | name | type | desc | 1535 | | -------- | -------- | -------- | 1536 | | count | uint32_t | maximum number of seeders to retrieve | 1537 | 1538 | **Returns:** vector<seeder_object> 1539 | 1540 | ---- 1541 | 1542 | #### list_seeders_by_region 1543 | **Description:** Get list of seeders by region. 1544 | **Parameters:** 1545 | 1546 | | name | type | desc | 1547 | | -------- | -------- | -------- | 1548 | | region_code | string | region code of seeders to retrieve | 1549 | 1550 | **Returns:** vector<seeder_object> 1551 | 1552 | ---- 1553 | 1554 | 1555 | #### list_seeders_by_upload 1556 | **Description:** Get list of seeders by upload. 1557 | **Parameters:** 1558 | 1559 | | name | type | desc | 1560 | | -------- | -------- | -------- | 1561 | | count | uint32_t | maximum number of seeders to retrieve | 1562 | 1563 | **Returns:** optional<vector<seeder_object>> 1564 | 1565 | ---- 1566 | 1567 | #### list_subscriptions_by_author 1568 | **Description:** Get list of subscription objects corresponding to the provided author. 1569 | **Parameters:** 1570 | 1571 | | name | type | desc | 1572 | | -------- | -------- | -------- | 1573 | | account_id_or_name | string | the name or id of the author | 1574 | | count | uint32_t | maximum number of subscriptions to fetch (must not exceed 100) | 1575 | 1576 | 1577 | **Returns:** vector<subscription_object> 1578 | 1579 | ---- 1580 | 1581 | #### list_subscriptions_by_consumer 1582 | **Description:** Get list of subscription objects corresponding to the provided consumer. 1583 | **Parameters:** 1584 | 1585 | | name | type | desc | 1586 | | -------- | -------- | -------- | 1587 | | account_id_or_name | string | the name or id of the consumer | 1588 | | count | uint32_t | maximum number of subscriptions to fetch (must not exceed 100) | 1589 | **Returns:** vector<subscription_object> 1590 | 1591 | ---- 1592 | 1593 | #### price_to_dct 1594 | **Description:** Get price in DCT. 1595 | **Parameters:** 1596 | 1597 | | name | type | desc | 1598 | | -------- | -------- | -------- | 1599 | | price | asset | asset in DCT, monitored asset or user issued asset | 1600 | 1601 | **Returns:** asset 1602 | 1603 | ---- 1604 | 1605 | #### propose_fee_change 1606 | **Description:** Get the signed version of the transaction. 1607 | **Parameters:** 1608 | 1609 | | name | type | desc | 1610 | | -------- | -------- | -------- | 1611 | | proposing_account | string | the account paying the fee to propose the transaction | 1612 | | expiration_time | time_point_sec | Timestamp specifying when the proposal will either take effect or expire | 1613 | | changed_values | variant_object | map of operation type to new fee, operations may be specified by name or ID, the "scale" key changes the scale | 1614 | | broadcast | bool | true if you wish to broadcast the transaction | 1615 | 1616 | **Returns:** signed_transaction 1617 | 1618 | ---- 1619 | 1620 | #### propose_parameter_change 1621 | **Description:** Get the signed version of the transaction. 1622 | **Parameters:** 1623 | 1624 | | name | type | desc | 1625 | | -------- | -------- | -------- | 1626 | | proposing_account | string | the account paying the fee to propose the transaction | 1627 | | expiration_time | time_point_sec | Timestamp specifying when the proposal will either take effect or expire | 1628 | | changed_values | variant_object | the values to change; all other chain parameters are filled in with default values | 1629 | | broadcast | bool | true if you wish to broadcast the transaction | 1630 | 1631 | 1632 | **Returns:** signed_transaction 1633 | 1634 | ---- 1635 | 1636 | #### propose_transfer 1637 | **Description:** Propose a transfer transaction. 1638 | **Parameters:** 1639 | 1640 | | name | type | desc | 1641 | | -------- | -------- | -------- | 1642 | | proposer | string | ... | 1643 | | from | string | the name or id of the account sending the funds | 1644 | | to | string | the name or id of the account receiving the funds | 1645 | | amount | string | the amount to send (in nominal units - to send half of a BTS, specify 0.5) | 1646 | | asset_symbol | string | the symbol or id of the asset to send | 1647 | | memo | string | a memo to attach to the transaction, which will be encrypted in the transaction and readable for the receiver. There is no length limit other than the limit imposed by maximum transaction size, but transaction increase with transaction size | 1648 | | expiration | time_point_sec | expiration time | 1649 | 1650 | **Returns:** void 1651 | 1652 | ---- 1653 | 1654 | #### remove_package 1655 | **Description:** Remove packages. 1656 | **Parameters:** 1657 | 1658 | | name | type | desc | 1659 | | -------- | -------- | -------- | 1660 | | package_hash | string | Hash of package that needs to be removed | 1661 | 1662 | **Returns:** void 1663 | 1664 | ---- 1665 | 1666 | #### request_to_buy 1667 | **Description:** Request to buy content. 1668 | **Parameters:** 1669 | 1670 | | name | type | desc | 1671 | | -------- | -------- | -------- | 1672 | | consumer | string | consumer of the content | 1673 | | URI | string | the URI of the content | 1674 | | price_asset_name | string | ticker symbol of the asset which will be used to buy content | 1675 | | price_amount | string | the price of the content | 1676 | | str_region_code_from | string | two letter region code | 1677 | | broadcast | bool | true to broadcast the transaction on the network | 1678 | 1679 | 1680 | **Returns:** signed_transaction 1681 | 1682 | ---- 1683 | 1684 | #### restore_encryption_key 1685 | **Description:** Restored AES key from particles. 1686 | **Parameters:** 1687 | 1688 | | name | type | desc | 1689 | | -------- | -------- | -------- | 1690 | | account | string | consumers account id or name | 1691 | | buying | buying_id_type | the buying object containing key particles | 1692 | 1693 | **Returns:** DInteger 1694 | 1695 | ---- 1696 | 1697 | #### search_account_history 1698 | **Description:** Get a list of transaction detail object, which describe activity 1699 | on the account. 1700 | **Parameters:** 1701 | 1702 | | name | type | desc | 1703 | | -------- | -------- | -------- | 1704 | | account_name | string | the name or id of the account | 1705 | | order | string | sort data by field | 1706 | | id | string | object_id to start searching from | 1707 | | limit | int | the number of entries to return (starting from the most recent) (max 100) | 1708 | 1709 | **Returns:** vector<class transaction_detail_object> 1710 | 1711 | ---- 1712 | 1713 | #### search_accounts 1714 | **Description:** Get map of account names to corresponding ID. 1715 | **Parameters:** 1716 | 1717 | | name | type | desc | 1718 | | -------- | -------- | -------- | 1719 | | term | string | will try to partially match account name or id | 1720 | | limit | uint32_t | maximum number of results to return (must not exceed 1000) | 1721 | | order | string | sort data by field | 1722 | | id | string | object_id to start searching from | 1723 | 1724 | 1725 | **Returns:** vector<account_object> 1726 | 1727 | ---- 1728 | 1729 | #### search_content 1730 | **Description:** Search for content. 1731 | **Parameters:** 1732 | 1733 | | name | type | desc | 1734 | | -------- | -------- | -------- | 1735 | | term | string | search term | 1736 | | order | string | order field | 1737 | | user | string | content owner | 1738 | | region_code | string | two letter region code | 1739 | | id | string | the id of content object to start searching from | 1740 | | type | string | the application and content type to be filtered | 1741 | | count | uint32_t | maximum number of contents to fetch (must not exceed 100) | 1742 | 1743 | 1744 | **Returns:** vector>content_summary> 1745 | 1746 | ---- 1747 | 1748 | #### search_feedback 1749 | **Description:** Search for feedbacks. 1750 | **Parameters:** 1751 | 1752 | | name | type | desc | 1753 | | -------- | -------- | -------- | 1754 | | user | string | feedback author | 1755 | | URI | string | the content object URI | 1756 | | id | string | the id of feedback object to start searching from | 1757 | | count | uint32_t | maximum number of feedbacks to fetch | 1758 | 1759 | **Returns:** vector<rating_object_ex> 1760 | 1761 | ---- 1762 | 1763 | #### search_my_purchases 1764 | **Description:** Search for historical purchases. 1765 | **Parameters:** 1766 | 1767 | | name | type | desc | 1768 | | -------- | -------- | -------- | 1769 | | account_id_or_name | string | consumer of the buyings to retrieve | 1770 | | term | string | search term to look up in Title and Description | 1771 | | order | string | sort data by field | 1772 | | id | string | object_id to start searching from | 1773 | | count | uint32_t | maximum number of contents to fetch (must not exceed 100) | 1774 | 1775 | 1776 | **Returns:** vector<buying_object_ex> 1777 | 1778 | ---- 1779 | 1780 | #### search_user_content 1781 | **Description:** Search for user content. 1782 | **Parameters:** 1783 | 1784 | | name | type | desc | 1785 | | -------- | -------- | -------- | 1786 | | user | string | content owner | 1787 | | term | string | search term | 1788 | | order | string | order field | 1789 | | region_code | string | two letter region code | 1790 | | id | string | the id of content object to start searching from | 1791 | | type | string | the application and content type to be filtered | 1792 | | count | uint32_t| maximum number of contents to fetch (must not exceed 100) | 1793 | 1794 | **Returns:** vector<content_summary> 1795 | 1796 | ---- 1797 | 1798 | #### seeding_startup 1799 | **Description:** Startup seeding. 1800 | **Parameters:** 1801 | 1802 | | name | type | desc | 1803 | | -------- | -------- | -------- | 1804 | | account_id_type_or_name | string | name or ID of account controlling this seeder | 1805 | | content_private_key | DInteger | El Gamal content private key | 1806 | | seeder_private_key | string | private key of the account controlling this seeder | 1807 | | free_space | uint64_t | allocated disk space in MegaBytes | 1808 | | seeding_price | uint32_t | price per MegaByte | 1809 | | packages_path | string | packages storage path | 1810 | | region_code | string | optional ISO 3166-1 alpha-2 two-letter region code | 1811 | 1812 | **Returns:** void 1813 | 1814 | ---- 1815 | 1816 | #### send_message 1817 | **Description:** Send messages. 1818 | **Parameters:** 1819 | 1820 | | name | type | desc | 1821 | | -------- | -------- | -------- | 1822 | | from | string | ... | 1823 | | to | string | ... | 1824 | | text | string | message to send | 1825 | | broadcast | bool | true to broadcast the transaction on the network | 1826 | 1827 | **Returns:** signed_transaction 1828 | 1829 | ---- 1830 | 1831 | #### set_automatic_renewal_of_subscription 1832 | **Description:** Set automatic renewal of subscription. 1833 | **Parameters:** 1834 | 1835 | | name | type | desc | 1836 | | -------- | -------- | -------- | 1837 | | account_id_or_name | string | the name or id of the account to update | 1838 | | subscription_id | subscription_id_type | the ID of the subscription | 1839 | | automatic_renewal | bool | true if account (consumer) wants to allow automatic renewal of subscription, false otherwise | 1840 | | broadcast | bool | true if you wish to broadcast the transaction | 1841 | 1842 | **Returns:** signed_transaction 1843 | 1844 | ---- 1845 | 1846 | #### set_desired_miner_count 1847 | **Description:** Set desired number of miners. 1848 | **Parameters:** 1849 | 1850 | | name | type | desc | 1851 | | -------- | -------- | -------- | 1852 | | account_to_modify | string | the name or id of the account to update | 1853 | | desired_number_of_miners | uint16_t | ... | 1854 | | broadcast | bool | true if you wish to broadcast the transaction | 1855 | 1856 | **Returns:** signed_transaction 1857 | **Note:** 1858 | Each account can voice their opinion on how many miners there should be in 1859 | the active miner list. These are independent of each other. You must vote 1860 | your approval of at least as many miners as you claim there should be (you 1861 | can't say that there should be 20 miners but only vote for 10). 1862 | 1863 | There are maximum values for each set in the blockchain parameters 1864 | (currently defaulting to 1001). 1865 | 1866 | ---- 1867 | 1868 | #### set_publishing_manager 1869 | **Description:** Set publishing manager. 1870 | **Parameters:** 1871 | 1872 | | name | type | desc | 1873 | | -------- | -------- | -------- | 1874 | | from | string | account ( DECENT account ) giving/removing status of the publishing manager | 1875 | | to | vector<string> | list of accounts getting status of the publishing manager | 1876 | | is_allowed | bool | true to give the status, false to remove it | 1877 | | broadcast | bool | true to broadcast the transaction on the network | 1878 | 1879 | **Returns:** signed_transaction 1880 | 1881 | ---- 1882 | 1883 | #### set_publishing_right 1884 | **Description:** Set publishing authorities. 1885 | **Parameters:** 1886 | 1887 | | name | type | desc | 1888 | | -------- | -------- | -------- | 1889 | | from | string | account giving/removing right to publish a content | 1890 | | to | vector≶string> | list of accounts getting right to publish a content | 1891 | | is_allowed | bool | true to give the right, false to remove it | 1892 | | broadcast | bool | true to broadcast the transaction on the network | 1893 | 1894 | **Returns:** signed_transaction 1895 | 1896 | ---- 1897 | 1898 | #### set_subscription 1899 | **Description:** Set account subscription. 1900 | **Parameters:** 1901 | 1902 | | name | type | desc | 1903 | | -------- | -------- | -------- | 1904 | | account | string | the name or id of the account to update | 1905 | | allow_subscription | bool | true if account (author) wants to allow subscription, false otherwise | 1906 | | subscription_period | uint32_t | duration of subscription in days | 1907 | | price_amount | string | price for subscription per one subscription period | 1908 | | price_asset_symbol | string | ticker symbol of the asset which will be used to buy subscription | 1909 | | broadcast | bool | true if you wish to broadcast the transaction | 1910 | 1911 | **Returns:** signed_transaction 1912 | 1913 | ---- 1914 | 1915 | #### set_transfer_logs 1916 | **Description:** Enable or disable transfer logs. 1917 | **Parameters:** 1918 | 1919 | | name | type | desc | 1920 | | -------- | -------- | -------- | 1921 | | enable | bool | true to enable transfer logs, false to otherwise | 1922 | 1923 | **Returns:** void 1924 | 1925 | ---- 1926 | 1927 | #### set_voting_proxy 1928 | **Description:** Set voting proxy. 1929 | **Parameters:** 1930 | 1931 | | name | type | desc | 1932 | | -------- | -------- | -------- | 1933 | | account_to_modify | string | the name or id of the account to update | 1934 | | voting_account | optional≶string> | the name or id of an account authorized to vote account_to_modify's shares, or null to vote your own shares | 1935 | | broadcast | bool | true if you wish to broadcast the transaction | 1936 | 1937 | 1938 | **Returns:** signed_transaction 1939 | **Note:** 1940 | If a user does not wish to take an active part in voting, they can choose 1941 | to allow another account to vote their stake. Setting a vote proxy does not remove your previous votes from the 1942 | blockchain, they remain there but are ignored. If you later null out your 1943 | vote proxy, your previous votes will take effect again. This setting can be changed at any time. 1944 | 1945 | ---- 1946 | 1947 | #### sign_buffer 1948 | **Description:** Sign buffer. 1949 | **Parameters:** 1950 | 1951 | | name | type | desc | 1952 | | -------- | -------- | -------- | 1953 | | str_buffer | string | the buffer to be signed | 1954 | | str_brainkey | string | derives the private key used for signature | 1955 | 1956 | **Returns:** string 1957 | 1958 | ---- 1959 | 1960 | #### submit_content 1961 | **Description:** Submit content to blockchain. 1962 | **Parameters:** 1963 | 1964 | | name | type | desc | 1965 | | -------- | -------- | -------- | 1966 | | author | string | the author of the content | 1967 | | co_authors | vector<pair<string,uint32_t>> | the co-authors' account name or ID mapped to corresponding payment split based on basis points | 1968 | | URI | string | the URI of the content | 1969 | | price_amounts | vector<regional_price_info> | the price of the content per regions | 1970 | | size | uint64_t | the size of the content | 1971 | | hash | ripemd160 | the Hash of the package | 1972 | | seeders | vector<account_id_type> | list of the seeders, which will publish the content | 1973 | | quorum | uint32_t | defines number of seeders needed to restore the encryption key | 1974 | | expiration | time_point_sec | the expiration time of the content. The content is available to buy till it's expiration time | 1975 | | publishing_fee_asset | string | ticker symbol of the asset which will be used to publish content | 1976 | | publishing_fee_amount | string | publishing price | 1977 | | synopsis | string | the description of the content | 1978 | | secret | DInteger | the AES key used to encrypt and decrypt the content | 1979 | | cd | CustodyData | custody data | 1980 | | broadcast | bool | true to broadcast the transaction on the network | 1981 | 1982 | **Returns:** signed_transaction 1983 | 1984 | ---- 1985 | 1986 | #### submit_content_async 1987 | **Description:** Submit content asynchronously. 1988 | **Parameters:** 1989 | 1990 | | name | type | desc | 1991 | | -------- | -------- | -------- | 1992 | | author | string | the author of the content | 1993 | | co_authors | vector<pair<string, uint32_t>> | the co-authors' account name or ID mapped to corresponding payment split based on basis points | 1994 | | content_dir | string | path to the directory containing all content that should be packed | 1995 | | samples_dir | string | path to the directory containing samples of content | 1996 | | protocol | string | protocol for uploading package (e.g. "ipfs") | 1997 | | price_amounts | vector<regional_price_info> | the prices of the content per regions | 1998 | | seeders | vector<account_id_type> | list of the seeders, which will publish the content | 1999 | | expiration | time_point_sec | the expiration time of the content | 2000 | | synopsis | string | the description of the content | 2001 | 2002 | **Returns:** void 2003 | 2004 | ---- 2005 | 2006 | #### subscribe_by_author 2007 | **Description:** Obtain subscription from the author. 2008 | **Parameters:** 2009 | 2010 | | name | type | desc | 2011 | | -------- | -------- | -------- | 2012 | | from | string | the account obtaining subscription from the author | 2013 | | to | string | the name or id of the author | 2014 | | broadcast | bool | true if you wish to broadcast the transaction | 2015 | 2016 | **Returns:** signed_transaction 2017 | 2018 | ---- 2019 | 2020 | #### subscribe_to_author 2021 | **Description:** Subscribe the consumer to the author. 2022 | **Parameters:** 2023 | 2024 | | name | type | desc | 2025 | | -------- | -------- | -------- | 2026 | | from | string | account who wants subscription to author | 2027 | | to | string | the author you wish to subscribe to | 2028 | | price_amount | string | price for the subscription | 2029 | | price_asset_symbol | string | symbol of the asset which will be used to buy subscription (must be DCT token) | 2030 | | broadcast | bool | true if you wish to broadcast the transaction | 2031 | 2032 | **Returns:** signed_transaction 2033 | 2034 | ---- 2035 | 2036 | #### update_miner 2037 | **Description:** Update miner settings. 2038 | **Parameters:** 2039 | 2040 | | name | type | desc | 2041 | | -------- | -------- | -------- | 2042 | | miner_name | string | the name of the miner's owner account, also accepts the ID of the owner account or the ID of the miner | 2043 | | url | string | same as for create_miner, empty string makes it remain the same | 2044 | | block_signing_key | string | the new block signing public key, empty string makes it remain the same | 2045 | | broadcast | bool | true if you wish to broadcast the transaction | 2046 | 2047 | **Returns:** signed_transaction 2048 | 2049 | ---- 2050 | 2051 | #### update_monitored_asset 2052 | **Description:** Update monitored asset. 2053 | **Parameters:** 2054 | 2055 | | name | type | desc | 2056 | | -------- | -------- | -------- | 2057 | | symbol | string | the name or id of the asset to update, which must be a market-issued asset | 2058 | | description | string | asset description | 2059 | | feed_lifetime_sec | uint32_t | time before a price feed expires | 2060 | | minimum_feeds | uint8_t | minimum number of unexpired feeds required to extract a median feed from | 2061 | | broadcast | bool | true to broadcast the transaction on the network | 2062 | 2063 | **Returns:** signed_transaction 2064 | **Note:** 2065 | Monitored assets have some options which are not relevant to other asset 2066 | types. This operation is used to update those options and an existing 2067 | monitored asset. 2068 | 2069 | ---- 2070 | 2071 | #### update_user_issued_asset 2072 | **Description:** Update user issued asset. 2073 | **Parameters:** 2074 | 2075 | | name | type | desc | 2076 | | -------- | -------- | -------- | 2077 | | symbol | string | the name or id of the asset to update, which must be a market-issued asset | 2078 | | new_issuer | string | if the asset is to be given a new issuer, specify his ID here | 2079 | | description | string | asset description | 2080 | | max_supply | uint64_t | the maximum supply of this asset which may exist at any given time | 2081 | | core_exchange_rate | price | price used to convert non-core asset to core asset | 2082 | | is_exchangeable | bool | true to allow implicit conversion of this asset to/from core asset | 2083 | | broadcast | bool | true to broadcast the transaction on the network | 2084 | 2085 | **Returns:** signed_transaction 2086 | **Note:** 2087 | User issued assets have some options which are not relevant to other asset 2088 | types. This operation is used to update those options an an existing user 2089 | issues asset. 2090 | 2091 | ---- 2092 | 2093 | #### upload_package 2094 | **Description:** Upload packages. 2095 | **Parameters:** 2096 | 2097 | | name | type | desc | 2098 | | -------- | -------- | -------- | 2099 | | package_hash | string | Hash of package that needs to be extracted | 2100 | | protocol | string | protocol for uploading package (IPFS) | 2101 | 2102 | **Returns:** string 2103 | 2104 | ---- 2105 | 2106 | #### verify_signature 2107 | **Description:** Verify a signature. 2108 | **Parameters:** 2109 | 2110 | | name | type | desc | 2111 | | -------- | -------- | -------- | 2112 | | str_buffer | string | the original buffer | 2113 | | str_publickey | string | the public key used for verification | 2114 | | str_signature | string | the signed buffer | 2115 | 2116 | **Returns:** bool 2117 | 2118 | ---- 2119 | 2120 | #### vote_for_miner 2121 | **Description:** Vote for a miner. 2122 | **Parameters:** 2123 | 2124 | | name | type | desc | 2125 | | -------- | -------- | -------- | 2126 | | voting_account | string | the name or id of the account who is voting with their shares | 2127 | | miner | string | the name or id of the miner' owner account | 2128 | | approve | bool | true if you wish to vote in favor of that miner, false to remove your vote in favor of that miner | 2129 | | broadcast | bool | true if you wish to broadcast the transaction | 2130 | 2131 | 2132 | **Returns:** signed_transaction 2133 | **Note:** 2134 | An account can publish a list of all miners they approve of. This command 2135 | allows you to add or remove miners from this list. Each account's vote is 2136 | weighted according to the number of shares of the core asset owned by that 2137 | account at the time the votes are tallied. 2138 | 2139 | ---- 2140 | --------------------------------------------------------------------------------