SophiaTX Developers logo

API Definitions

Introduction

While the alexandria_api.* calls are ready for use, all other API's methods are currently works in progress and may change, or be unsuitable for production use !!!

Best practice for application developers is to use one of the provided SDK’s depending on what language the application is writenn in.

If there is no such SDK, then use directly alexandria_api. In case there are some methods missing in alexandria_api, please create an issue here or use other API’s as the last option.

Supported Operations

An Operation is internal type that blockchain is working with. Every transaction consists of some static fields like “ref_block_num”, “expiration”, “signatures”, etc… that are always present + list of “operations” that may vary and actually express what is such transaction really supposed to write into blockchain.

Each type of operation express different data structure that can be sent into blockchain and saved or somehow change the blockchain state. The main API call to send transaction with user defined operations is: alexandria_api.broadcast_transaction
There are also simplified methods that enable this functionality as well but are more suited for testing than production development:
alexandria_api.send_and_sign_operation
alexandria_api.send_and_sign_transaction

All other alexandria_api method’s (except of a few helper method to create transaction, etc…) are ONLY FOR READING DATA from blockchain !!!

Final required format of the operations is always in "Example. op" section.
We provide simplified helper methods that return the required format of some of the supported operations, but applications should not call these methods at all as the format does not change. Instead, SDK should take care of that.

List of supported operations:

transfer

Helper API simplified call to create this operation in required format exists! See below!

alexandria_api.transfer

Transfers SOPHIATX from one account to another. API call creates "transfer" operation in requested json format.

Request:

  • from - sender account
  • to - recipient account
  • amount - amount of SPHTX tokens to be transfered
  • memo - custom note

  • Result:

  • op - operation "transfer" created in required json format.

  • Query Parameters JSON
    {
      "from": "",
      "to": "",
      "amount": "0.000000 SPHTX",
      "memo": ""
    }
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "transfer",
        {
          "fee": "0.000000 SPHTX",
          "from": "",
          "to": "",
          "amount": "0.000000SPHTX",
          "memo": ""
        }
      ]
    }
    
    Real Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.transfer", "params": {"from": "7HLPQ1kpnAIWawkAEgcoN4I7qJY", "to": "YWV2w-Q5eB3e0gt_nKS1m85sc0U", "amount": "1000.000000 SPHTX","memo": "some note"}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "jsonrpc": "2.0",
      "result": {
        "op": [
          "transfer",
          {
            "fee": "0.000000 SPHTX",
            "from": "user1",
            "to": "7HLPQ1kpnAIWawkAEgcoN4I7qJY",
            "amount": "1000.000000 SPHTX",
            "memo": "some note"
          }
        ]
      },
      "id": 1
    }'
    

    transfer_to_vesting

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.transfer_to_vesting

    Transfer SPHTX into a vesting fund represented by vesting shares (VESTS). VESTS are required to vesting for a minimum of one coin year and can be withdrawn once a week over a two year withdraw period. VESTS are protected against dilution up until 90% of SPHTX is vesting.
    API call creates "transfer_to_vesting" operation in requested json format.

    Request:

  • from - account the SPHTX is coming from i.e. "account_name"
  • to - account getting the VESTS i.e. "account_name"
  • amount - amount of SPHTX to vest i.e. "100.00 SPHTX"

  • Result:

  • op - operation "transfer_to_vesting" created in required json format.

  • Query Parameters JSON
    {"from": "", "to": "", "amount": "0.000000 SPHTX"}
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "transfer_to_vesting",
        {
          "fee": "0.000000 SPHTX",
          "from": "",
          "to": "",
          "amount": "0.000000SPHTX"
        }
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.transfer_to_vesting", "params": {"from":"","to":"","amount":"0.000000 SPHTX"}, "id": 1}' https://API_URL
    

    withdraw_vesting

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.withdraw_vesting

    Set up a vesting withdraw request. The request is fulfilled once a week over the next two year (104 weeks).
    API call creates "withdraw_vesting" operation in requested json format.

    Request:

  • from - account the VESTS are withdrawn from i.e. "account_name".
  • vesting_shares The amount of VESTS to withdraw over the next two years. Each week (amount/104) shares are withdrawn and deposited back as SPHTX. i.e. "10.000000 VESTS".

  • Result:

  • op - operation "withdraw_vesting" created in required json format.

  • Query Parameters JSON
    {"from": "", "vesting_shares": "0.000000 SPHTX"}
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "withdraw_vesting",
        {
          "fee": "0.000000 SPHTX",
          "account": "",
          "vesting_shares": "0.000000SPHTX"
        }
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.withdraw_vesting", "params": {"from":"","vesting_shares":"0.000000 SPHTX"}, "id": 1}' https://API_URL
    

    transfer_from_promotion_pool

    Recovers funds from the promotion pool. Only initminer can do that.

    Example Op.
    "{\"op\":[\"transfer_from_promotion_pool\",{...}]}"
    

    account_create

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.create_account

    Creates new account in blockchain.
    API call creates operation ‘account_create’ in required json format

    Request

  • creator - existing account. It can be later used to regenerate private key of created account
  • name_seed - seed name of the new account
  • json_meta - any data related to the new account
  • owner - owner public key. Paired private key has full control over this account
  • active - active public key. Paired private key has restricted control over this account
  • memo - memo public key. It is used for encrypting messages meant to be read only by this account. Paired private is used fot decrypting

  • Response

  • op - operation "account_create" created in required json format

  • Query Parameters JSON
    {
      "creator": "",
      "name_seed": "",
      "json_meta": "",
      "owner": "SPH1111111111111111111111111111111114T1Anm",
      "active": "SPH1111111111111111111111111111111114T1Anm",
      "memo": "SPH1111111111111111111111111111111114T1Anm"
    }
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "account_create",
        {
          "fee": "0.000000 SPHTX",
          "creator": "",
          "name_seed": "",
          "owner": {
            "weight_threshold": 0,
            "account_auths": [],
            "key_auths": []
          },
          "active": {
            "weight_threshold": 0,
            "account_auths": [],
            "key_auths": []
          },
          "memo_key": "SPH1111111111111111111111111111111114T1Anm",
          "json_metadata": ""
        }
      ]
    }
    
    Real Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.create_account", "params": {"creator": "user1","name_seed": "sophiatx_user","json_meta": "{\"data\":\"anything related to the sophiatx_user\"}","owner": "SPH7qASF1CfENDRWdKC5gQCktydRQM2aY3i1d9wFdu1fjpURgTxiw","active": "SPH5ekkeER1xi3EDoxoggo2ruMgPazKsGa8Pj44qrD326oDk5rgKP","memo": "SPH4vtSio7iGMggFboydFjgRZknPEH1BExcN3r4rjb9iznJQr7Mqy"}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "jsonrpc": "2.0",
      "result": {
        "op": [
          "account_create",
          {
            "fee": "0.000000 SPHTX",
            "creator": "user1",
            "name_seed": "sophiatx_user",
            "owner": {
              "weight_threshold": 1,
              "account_auths": [],
              "key_auths": [
                [
                  "SPH7qASF1CfENDRWdKC5gQCktydRQM2aY3i1d9wFdu1fjpURgTxiw",
                  1
                ]
              ]
            },
            "active": {
              "weight_threshold": 1,
              "account_auths": [],
              "key_auths": [
                [
                  "SPH5ekkeER1xi3EDoxoggo2ruMgPazKsGa8Pj44qrD326oDk5rgKP",
                  1
                ]
              ]
            },
            "memo_key": "SPH4vtSio7iGMggFboydFjgRZknPEH1BExcN3r4rjb9iznJQr7Mqy",
            "json_metadata": "{\"data\":\"anything related to the sophiatx_user\"}"
          }
        ]
      },
      "id": 1
    }'
    

    account_update

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.update_account

    Updates existing account in blockchain.
    API call creates "account_update" operation in requested json format. Updates the keys of an existing account.

    Request:

  • account_name - name of the account i.e. "account_name"
  • json_meta - new JSON Metadata to be associated with the account
  • owner - new public owner key for the account
  • active - new public active key for the account
  • memo - new public memo key for the account

  • Result:

  • op - operation "account_update" created in required json format.

  • Query Parameters JSON
    {
      "account_name": "",
      "json_meta": "",
      "owner": "SPH1111111111111111111111111111111114T1Anm",
      "active": "SPH1111111111111111111111111111111114T1Anm",
      "memo": "SPH1111111111111111111111111111111114T1Anm"
    }
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "account_update",
        {
          "fee": "0.000000 SPHTX",
          "account": "",
          "memo_key": "SPH1111111111111111111111111111111114T1Anm",
          "json_metadata": ""
        }
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.update_account", "params": {"account_name":"","json_meta":"","owner":"SPH1111111111111111111111111111111114T1Anm","active":"SPH1111111111111111111111111111111114T1Anm","memo":"SPH1111111111111111111111111111111114T1Anm"}, "id": 1}' https://API_URL
    

    account_delete

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.delete_account

    Deletes existing account in blockchain.
    API call creates “account_delete” operation in requested json format.

    Request:

  • account_name - name of the account to be deleted

  • Response:

  • op - operation "account_delete" created in required json format.

  • Query Parameters JSON
    {"account_name": ""}
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "account_delete",
        {"fee": "0.000000 SPHTX", "account": ""}
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.delete_account", "params": {"account_name":""}, "id": 1}' https://API_URL
    

    request_account_recovery

    All account recovery requests come from a listed recovery account. This is secure based on the assumption that only a trusted account should be a recovery account. It is the responsibility of the recovery account to verify the identity of the account holder of the account to recover by whichever means they have agreed upon. The blockchain assumes identity has been verified when this operation is broadcast.

    This operation creates an account recovery request which the account to recover has 24 hours to respond to before the request expires and is invalidated.

    There can only be one active recovery request per account at any one time. Pushing this operation for an account to recover when it already has an active request will either update the request to a new new owner authority and extend the request expiration to 24 hours from the current head block time or it will delete the request. To cancel a request, simply set the weight threshold of the new owner authority to 0, making it an open authority.

    Additionally, the new owner authority must be satisfiable. In other words, the sum of the key weights must be greater than or equal to the weight threshold.

    This operation only needs to be signed by the the recovery account. The account to recover confirms its identity to the blockchain in the recover account operation.

    Notes

  • recovery_account - The recovery account is listed as the recovery account on the account to recover.
  • account_to_recover - The account to recover. This is likely due to a compromised owner authority.
  • new_owner_authority - The new owner authority the account to recover wishes to have. This is secret known by the account to recover and will be confirmed in a recover_account.

  • Example Op.
    {
      "op": [
        "request_account_recovery",
        {
          "recovery_account": "sophiatx",
          "account_to_recover": "alice",
          "new_owner_authority": {
            "weight_threshold": 1,
            "account_auths": [],
            "key_auths": [
              [
                "STM6LYxj96zdypHYqgDdD6Nyh2NxerN3P1Mp3ddNm7gci63nfrSuZ",
                1
              ]
            ]
          },
          "extensions": []
        }
      ]
    }
    

    recover_account

    Recover an account to a new authority using a previous authority and verification of the recovery account as proof of identity. This operation can only succeed if there was a recovery request sent by the account’s recover account.

    In order to recover the account, the account holder must provide proof of past ownership and proof of identity to the recovery account. Being able to satisfy an owner authority that was used in the past 30 days is sufficient to prove past ownership. The get_owner_history function in the database API returns past owner authorities that are valid for account recovery.

    Proving identity is an off chain contract between the account holder and the recovery account. The recovery request contains a new authority which must be satisfied by the account holder to regain control. The actual process of verifying authority may become complicated, but that is an application level concern, not a blockchain concern.

    This operation requires both the past and future owner authorities in the operation because neither of them can be derived from the current chain state. The operation must be signed by keys that satisfy both the new owner authority and the recent owner authority. Failing either fails the operation entirely.

    If a recovery request was made inadvertantly, the account holder should contact the recovery account to have the request deleted.

    The two setp combination of the account recovery request and recover is safe because the recovery account never has access to secrets of the account to recover. They simply act as an on chain endorsement of off chain identity. In other systems, a fork would be required to enforce such off chain state. Additionally, an account cannot be permanently recovered to the wrong account. While any owner authority from the past 30 days can be used, including a compromised authority, the account can be continually recovered until the recovery account is confident a combination of uncompromised authorities were used to recover the account. The actual process of verifying authority may become complicated, but that is an application level concern, not the blockchain’s concern.

    Example Op.
    {
      "op": [
        "recover_account",
        {
          "account_to_recover": "alice",
          "new_owner_authority": {
            "weight_threshold": 1,
            "account_auths": [],
            "key_auths": [
              [
                "STM7j3nhkhHTpXqLEvdx2yEGhQeeorTcxSV6WDL2DZGxwUxYGrHvh",
                1
              ]
            ]
          },
          "recent_owner_authority": {
            "weight_threshold": 1,
            "account_auths": [],
            "key_auths": [
              [
                "STM78Xth94gNxp8nmByFV2vNAhg9bsSdviJ6fQXUTFikySLK3uTxC",
                1
              ]
            ]
          },
          "extensions": []
        }
      ]
    }
    

    change_recovery_account

    Each account lists another account as their recovery account. The recovery account has the ability to create account_recovery_requests for the account to recover. An account can change their recovery account at any time with a 30 day delay. This delay is to prevent an attacker from changing the recovery account to a malicious account during an attack. These 30 days match the 30 days that an owner authority is valid for recovery purposes.

    On account creation the recovery account is set either to the creator of the account (The account that pays the creation fee and is a signer on the transaction) or to the empty string if the account was mined. An account with no recovery has the top voted witness as a recovery account, at the time the recover request is created. Note - This does mean the effective recovery account of an account with no listed recovery account can change at any time as witness vote weights. The top voted witness is explicitly the most trusted witness according to stake.

    Example Op.
    {
      "op": [
        "change_recovery_account",
        {
          "account_to_recover": "alice",
          "new_recovery_account": "bob",
          "extensions": []
        }
      ]
    }
    

    reset_account

    This operation allows recovery_accoutn to change account_to_reset’s owner authority to new_owner_authority after 60 days of inactivity.

    Example Op.
    {
      "op": [
        "reset_account",
        {
          "reset_account": "alice",
          "account_to_reset": "bob",
          "new_owner_authority": {
            "weight_threshold": 1,
            "account_auths": [],
            "key_auths": [
              [
                "STM7j3nhkhHTpXqLEvdx2yEGhQeeorTcxSV6WDL2DZGxwUxYGrHvh",
                1
              ]
            ]
          }
        }
      ]
    }
    

    set_reset_account

    This operation allows ‘account’ owner to control which account has the power to execute the ‘reset_account_operation’ after 60 days.

    Example Op.
    {
      "op": [
        "set_reset_account",
        {
          "account": "alice",
          "current_reset_account": "bob",
          "reset_account": "sophiatx"
        }
      ]
    }
    

    application_create

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.create_application

    Creates custom application in blockchain
    . API call returns “application_create” operation in required format. There is a fee associated with account creation that is paid by the creator. The current account creation fee can be found with the ‘info’ alexandria command.

    Request

  • author - account creating the new application i.e. "account_name"
  • app_name - unique name for new application
  • url - url of the new application
  • meta_data - meta data of new application
  • price_param - price parameter that specifies billing for the app

  • Response

  • op - "application_create" operation in required format

  • Query Parameters JSON
    {
      "author": "",
      "app_name": "",
      "url": "",
      "meta_data": "",
      "price_param": 0
    }
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "application_create",
        {
          "fee": "0.000000 SPHTX",
          "author": "",
          "name": "",
          "url": "",
          "metadata": "",
          "price_param": 0
        }
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.create_application", "params": {"author":"","app_name":"","url":"","meta_data":"","price_param":0}, "id": 1}' https://API_URL
    

    application_update

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.update_application

    Updates custom application in blockchain
    . API call returns "application_update" operation in requested json format. Updates existing application object.

    Request:

  • author - author of application i.e. "account_name"
  • app_name - name of app that will be updated
  • new_author - new author i.e. "account_name"
  • url - updated url
  • meta_data - updated meta data
  • price_param - updated price param

  • Result:

  • op - operation "application_update" created in required json format.

  • Query Parameters JSON
    {
      "author": "",
      "app_name": "",
      "new_author": "",
      "url": "",
      "meta_data": "",
      "price_param": 0
    }
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "application_update",
        {
          "fee": "0.000000 SPHTX",
          "author": "",
          "name": "",
          "url": "",
          "metadata": ""
        }
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.update_application", "params": {"author":"","app_name":"","new_author":"","url":"","meta_data":"","price_param":0}, "id": 1}' https://API_URL
    

    application_delete

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.delete_application

    Deletes custom application in blockchain
    . API call returns “application_delete” operation in required format. Request

  • author - author of application that will be deleted i.e. "account_name"
  • app_name - name of app that will be deleted
  • Response

  • op - "application_delete" operation in required format

  • Query Parameters JSON
    {"author": "", "app_name": ""}
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "application_delete",
        {
          "fee": "0.000000 SPHTX",
          "author": "",
          "name": ""
        }
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.delete_application", "params": {"author":"","app_name":""}, "id": 1}' https://API_URL
    

    buy_application

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.buy_application

    Buys custom application in blockchain
    . API call returns “buy_application” operation in required format.

    Request

  • buyer - buyer of application i.e. "account_name"
  • app_id - id of application that buyer will buy

  • Response

  • op - "buy_application" operation in required format

  • Query Parameters JSON
    {"buyer": "", "app_id": 0}
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "buy_application",
        {
          "fee": "0.000000 SPHTX",
          "buyer": "",
          "app_id": 0
        }
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.buy_application", "params": {"buyer":"","app_id":0}, "id": 1}' https://API_URL
    

    cancel_application_buying

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.cancel_application_buying

    Cancel custom application buying in blockchain
    . API call returns “cancel_application_buying” operation in required format.

    Request

  • app_owner - owner of bought application i.e. "account_name"
  • buyer - buyer of application i.e. "account_name"
  • app_id - id of application that buyer will buy

  • Response

  • op - "cancel_application_buying" operation in required format

  • Query Parameters JSON
    {"app_owner": "", "buyer": "", "app_id": 0}
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "cancel_application_buying",
        {
          "fee": "0.000000 SPHTX",
          "app_owner": "",
          "buyer": "",
          "app_id": 0
        }
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.cancel_application_buying", "params": {"app_owner":"","buyer":"","app_id":0}, "id": 1}' https://API_URL
    

    custom_binary

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.make_custom_binary_operation

    Saves custom binary data in blockchain
    . API call returns "custom_binary" operation in requested json format. Request:

  • app_id - application-specific id
  • from - sender account
  • to - recipients accounts
  • data - data in base64 format
  • Result:

  • op - operation "custom_binary" created in required json format. Important - "data" field inside operation is in hex format

  • Query Parameters JSON
    {"app_id": 0, "from": "", "to": [], "data": ""}
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "custom_binary",
        {
          "fee": "0.000000 SPHTX",
          "sender": "",
          "recipients": [],
          "app_id": 0,
          "data": ""
        }
      ]
    }
    
    Real Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.make_custom_binary_operation", "params": {"app_id": 10, "from": "user1", "to": ["user2", "user3"], "data": "SGVsbG8gU29waGlhVFg="}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "op": [
        "custom_binary",
        {
          "fee": "0.000000 SPHTX",
          "sender": "user1",
          "recipients": ["user2", "user3"],
          "app_id": 10,
          "data": "48656c6c6f20536f706869615458"
        }
      ]
    }'
    

    custom_json

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.make_custom_json_operation

    Saves custom json data in blockchain
    . API call returns "custom_json" operation in requested json format.

    Request:

  • app_id - application-specific id
  • from - sender account
  • to - recipients accounts
  • data - any valid data json data
  • Result:

  • op - operation "custom_json" created in required json format.

  • Query Parameters JSON
    {"app_id": 0, "from": "", "to": [], "json": ""}
    
    Example Op. (& Expected Response JSON)
    {"op": []}
    
    Real Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.make_custom_json_operation", "params": {"app_id": 10, "from": "user1", "to": ["user2", "user3"], "json": "{\"data\":\"any valid json data\"}"}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "op": [
        "custom_json",
        {
          "fee": "0.000000 SPHTX",
          "sender": "user1",
          "recipients": ["user2", "user3"],
          "app_id": 10,
          "json": "{\"data\":\"any valid json data\"}"
        }
      ]
    }'
    

    sponsor_fees

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.sponsor_account_fees

    Sets up sponsoring account for another account fees
    . API call returns "sponsor_fees" operation in requested json format.

    Request

  • sponsoring_account - account name that will sponsor fees
  • sponsored_account - account that will be sponsored
  • is_sponsoring - true or false if you want to enable/disable this operation

  • Response

  • op - creates \"sponsor_fees\" operation

  • Query Parameters JSON
    {
      "sponsoring_account": "",
      "sponsored_account": "",
      "is_sponsoring": false
    }
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "sponsor_fees",
        {
          "fee": "0.000000 SPHTX",
          "sponsor": "",
          "sponsored": "",
          "is_sponsoring": false
        }
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.sponsor_account_fees", "params": {"sponsoring_account":"","sponsored_account":"","is_sponsoring":false}, "id": 1}' https://API_URL
    

    witness_stop

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.stop_witness

    Stops witness.
    . API call returns "witness_stop" operation in requested json format. Stop being a witness,effectively deleting the witness object owned by the given account.

    Request

  • witness_name - name of the witness account i.e. "account_name"

  • Response

  • op - creates \"witness_stop\" operation

  • Query Parameters JSON
    {"witness_account_name": ""}
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "witness_stop",
        {"fee": "0.000000 SPHTX", "owner": ""}
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.stop_witness", "params": {"witness_account_name":""}, "id": 1}' https://API_URL
    

    witness_update

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.update_witness

    Updates witness.
    . API call returns "witness_update" operation in requested json format. Updates a witness object owned by the given account.

    Request:

  • witness_name - the name of the witness account.
  • url - url containing some information about the witness. The empty string makes it remain the same.
  • block_signing_key - new block signing public key. The empty string disables block production.
  • props - chain properties the witness is voting on.

  • Result:

  • op - operation "witness_update" created in required json format.

  • Query Parameters JSON
    {
      "witness_account_name": "",
      "url": "",
      "block_signing_key": "SPH1111111111111111111111111111111114T1Anm",
      "props": {
        "account_creation_fee": "0.000000 SPHTX",
        "maximum_block_size": 262144,
        "price_feeds": []
      }
    }
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "witness_update",
        {
          "fee": "0.000000 SPHTX",
          "owner": "",
          "url": "",
          "block_signing_key": "SPH1111111111111111111111111111111114T1Anm",
          "props": {
            "account_creation_fee": "0.000000SPHTX",
            "maximum_block_size": 262144,
            "price_feeds": []
          }
        }
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.update_witness", "params": {"witness_account_name":"","url":"","block_signing_key":"SPH1111111111111111111111111111111114T1Anm","props":{"account_creation_fee":"0.000000 SPHTX","maximum_block_size":262144,"price_feeds":[]}}, "id": 1}' https://API_URL
    

    account_witness_proxy

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.set_voting_proxy

    Sets the voting proxy for an account. If a user does not wish to take an active part in voting,they can choose to allow another account to vote their stake. Setting a vote proxy does not remove your previous votes from the blockchain, they remain there but are ignored. If you later null out your vote proxy, your previous votes will take effect again. This setting can be changed at any time.
    API call returns "account_witness_proxy" operation in requested json format.

    Request

  • account_to_modify - the name or id of the account to update i.e. "account_name"
  • proxy - the name of account that should proxy to or empty string to have no proxy

  • Response

  • op - creates \"account_witness_proxy\" operation

  • Query Parameters JSON
    {"account_to_modify": "", "proxy": ""}
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "account_witness_proxy",
        {
          "fee": "0.000000 SPHTX",
          "account": "",
          "proxy": ""
        }
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.set_voting_proxy", "params": {"account_to_modify":"","proxy":""}, "id": 1}' https://API_URL
    

    witness_set_properties

    Replaces the witness_update which was not easily extendable. While it is recommended to use witness_set_properties, witness_update will continue to work

    Example Op.
    {
      "op": [
        "witness_set_properties",
        {
          "owner": "alice",
          "props": {
            "account_creation_fee": "0.000 SPHTX",
            "account_subsidy_budget": 10000,
            "account_subsidy_decay": 330782,
            "maximum_block_size": 65536,
            "sbd_interest_rate": "0.000 SPHTX",
            "sbd_exchange_rate": {
              "base": "0.000 SBD",
              "quote": "0.000 SPHTX"
            },
            "url": "68747470733A2F2F737465656D69742E636F6D",
            "new_signing_key": "25688bbe7b1204f26e40be054c8b2ff1997eec6d4e7be6a105aab8a0e6f11c616d7cb6066"
          },
          "extensions": []
        }
      ]
    }
    

    admin_witness_update

    Add description.
    This opertion can be used only in private nets.

    Example Op.
    {"op": ["add name", {}]}
    

    account_witness_vote

    Helper API simplified call to create this operation in required format exists! See below!

    alexandria_api.vote_for_witness

    Creates "account_witness_vote" operation in requested json format. Vote for a witness to become a block producer. By default an account has not voted positively or negatively for a witness. The account can either vote for with positively votes or against with negative votes. The vote will remain until updated with another vote. Vote strength is determined by the accounts vesting shares.

    Request:

  • account_to_vote_with - account voting for a witness i.e. "account_name".
  • witness_to_vote_for - witness that is being voted for i.e. "account_name".
  • approve - true if the account is voting for the account to be able to be a block produce.

  • Result:

  • op - operation "account_witness_vote" created in required json format.

  • Query Parameters JSON
    {
      "voting_account": "",
      "witness_to_vote_for": "",
      "approve": false
    }
    
    Example Op. (& Expected Response JSON)
    {
      "op": [
        "account_witness_vote",
        {
          "fee": "0.000000 SPHTX",
          "account": "",
          "witness": "",
          "approve": true
        }
      ]
    }
    
    Default (Incomplete params values) Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.vote_for_witness", "params": {"voting_account":"","witness_to_vote_for":"","approve":false}, "id": 1}' https://API_URL
    

    feed_publish

    Feeds can only be published by the top N witnesses which are included in every round and are used to define the exchange rate between sophiatx and the fiat currencies.

    Represents quotation of the relative value of asset against another asset. Similar to "currency pair" used to determine value of currencies.

    For example:
    1 SPHTX / 1.25 USD where:
    1 SPHTX is an asset specified as a base
    1.25 USD us an asset specified as a quote

    can determine value of SPHTX against USD.

    Example Op.
    {
      "op": [
        "feed_publish",
        {
          "publisher": "user1",
          "exchange_rate": {
            "base": {"amount": 1, "symbol": "SPHTX"},
            "quote": {"amount": 1.25, "symbol": "USD"}
          }
        }
      ]
    }
    

    escrow_transfer

    The purpose of this operation is to enable someone to send money contingently to another individual. The funds leave the from account and go into a temporary balance where they are held until from releases it to to or to refunds it to from.

    In the event of a dispute the agent can divide the funds between the to/from account. Disputes can be raised any time before or on the dispute deadline time, after the escrow has been approved by all parties.

    This operation only creates a proposed escrow transfer. Both the agent and to must agree to the terms of the arrangement by approving the escrow.

    The escrow agent is paid the fee on approval of all parties. It is up to the escrow agent to determine the fee.

    Escrow transactions are uniquely identified by ‘from’ and ‘escrow_id’, the ‘escrow_id’ is defined by the sender.

    Example Op.
    {
      "op": [
        "escrow_transfer",
        {
          "from": "alice",
          "to": "bob",
          "sophiatx_amount": {"amount": "1.000000", "symbol": "SPHTX"},
          "escrow_id": 23456789,
          "agent": "charlie",
          "escrow_fee": {"amount": "0.1", "symbol": "USD"},
          "json_meta": "{}",
          "ratification_deadline": "2017-02-26T11:22:39",
          "escrow_expiration": "2017-02-28T11:22:39"
        }
      ]
    }
    

    escrow_approve

    The agent and to accounts must approve an escrow transaction for it to be valid on the blockchain. Once a part approves the escrow, they cannot revoke their approval. Subsequent escrow approve operations, regardless of the approval, will be rejected.

    Example Op.
    {
      "op": [
        "escrow_approve",
        {
          "from": "alice",
          "to": "bob",
          "agent": "charlie",
          "who": "charlie",
          "escrow_id": 59102208,
          "approve": true
        }
      ]
    }
    

    escrow_dispute

    If either the sender or receiver of an escrow payment has an issue, they can raise it for dispute. Once a payment is in dispute, the agent has authority over who gets what.

    Example Op.
    {
      "op": [
        "escrow_dispute",
        {
          "from": "alice",
          "to": "bob",
          "agent": "charlie",
          "who": "alice",
          "escrow_id": 72526562
        }
      ]
    }
    

    escrow_release

    This operation can be used by anyone associated with the escrow transfer to release funds if they have permission.

    The permission scheme is as follows

  • If there is no dispute and escrow has not expired, either party can release funds to the other.
  • If escrow expires and there is no dispute, either party can release funds to either party.
  • If there is a dispute regardless of expiration, the agent can release funds to either party following whichever agreement was in place between the parties.

  • Example Op.
    {
      "op": [
        "escrow_release",
        {
          "from": "alice",
          "to": "bob",
          "agent": "charlie",
          "who": "charlie",
          "receiver": "bob",
          "escrow_id": 72526562,
          "sbd_amount": {
            "amount": "5000",
            "precision": 3,
            "nai": "@@000000013"
          },
          "steem_amount": {
            "amount": "0",
            "precision": 3,
            "nai": "@@000000021"
          }
        }
      ]
    }
    

    Alexandria Api

    Most of the alexandria_api method’s are just for reading data from blockchain. How to actually write data into blockchain, see Supported operations.

    List of supported calls:


    alexandria_api.info

    Returns info about the current state of the blockchain

    Query Parameters JSON
    {}
    
    Expected Response JSON
    {
      "info": {
        "head_block_number": 175238,
        "head_block_id": "0002ac86e5ffc83ed0d1a3a8823dfd40c5a10171",
        "time": "2018-11-13T13:19:18",
        "current_witness": "initminer",
        "current_supply": "350076100.030352 SPHTX",
        "total_vesting_shares": "20895.823972 VESTS",
        "witness_required_vesting": "250000.000000 VESTS",
        "maximum_block_size": 262144,
        "current_aslot": 3429986,
        "recent_slots_filled": "340282366920938463463374607431768211455",
        "participation_count": 128,
        "last_irreversible_block_num": 175187,
        "average_block_size": 25,
        "witness_majority_version": "0.0.0",
        "hardfork_version": "1.0.0",
        "head_block_age": "2 seconds old",
        "participation": "100.00000000000000000",
        "median_sbd1_price": {
          "base": "0.000000 SPHTX",
          "quote": "0.000000 SPHTX"
        },
        "median_sbd2_price": {
          "base": "0.000000 SPHTX",
          "quote": "0.000000 SPHTX"
        },
        "median_sbd3_price": {
          "base": "0.000000 SPHTX",
          "quote": "0.000000 SPHTX"
        },
        "median_sbd4_price": {
          "base": "0.000000 SPHTX",
          "quote": "0.000000 SPHTX"
        },
        "median_sbd5_price": {
          "base": "0.000000 SPHTX",
          "quote": "0.000000 SPHTX"
        },
        "account_creation_fee": "0.000000 SPHTX"
      }
    }
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.info", "params": {}, "id": 1}' https://API_URL
    

    alexandria_api.about

    Returns info such as client version, git version of graphene/fc, version of boost, openssl.

    Query Parameters JSON
    {}
    
    Expected Response JSON
    {
      "about": {
        "blockchain_version": "1.0.0",
        "client_version": "1.0.0-260-gd3032b2",
        "sophiatx_revision": "d3032b2840d0c5838df512532f98b28a2ce491e6",
        "sophiatx_revision_age": "11 days ago",
        "fc_revision": "b2b6ed37e8172eeddd3e167cba13a3aac83f409c",
        "fc_revision_age": "14 days ago",
        "compile_date": "compiled on Nov 12 2018 at 16:25:29",
        "boost_version": "1.67",
        "openssl_version": "OpenSSL 1.1.1  11 Sep 2018",
        "build": "linux 64-bit",
        "server_blockchain_version": "1.0.0",
        "server_sophiatx_revision": "d3032b2840d0c5838df512532f98b28a2ce491e6",
        "server_fc_revision": "b2b6ed37e8172eeddd3e167cba13a3aac83f409c",
        "chain_id": "f8174877749eb3b8ba9202be14c2179c265e72de93f7c9dcd1d943dd03664352"
      }
    }
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.about", "params": {}, "id": 1}' https://API_URL
    

    alexandria_api.get_version

    Returns the versions of blockchain, SophiaTX, and FC.

    Query Parameters JSON
    {}
    
    Expected Response JSON
    {
      "version_info": {
        "blockchain_version": "1.0.0",
        "sophiatx_revision": "0000000000000000000000000000000000000000",
        "fc_revision": "",
        "chain_id": "000000000000000000000000000000000000000000000000000000000000000000000000"
      }
    }
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.get_version", "params": {}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "jsonrpc": "2.0",
      "result": {
        "version_info": {
          "blockchain_version": "1.0.0",
          "sophiatx_revision": "d3032b2840d0c5838df512532f98b28a2ce491e6",
          "fc_revision": "b2b6ed37e8172eeddd3e167cba13a3aac83f409c",
          "chain_id": "f8174877749eb3b8ba9202be14c2179c265e72de93f7c9dcd1d943dd03664352"
        }
      },
      "id": 1
    }'
    

    alexandria_api.get_dynamic_global_properties

    Returns the current dynamic global properties. See Understanding Dynamic Global Properties

    Query Parameters JSON
    {}
    
    Expected Response JSON
    {
      "properties": {
        "head_block_number": 0,
        "head_block_id": "0000000000000000000000000000000000000000",
        "time": "1970-01-01T00:00:00",
        "current_witness": "",
        "current_supply": "0.000000 SPHTX",
        "total_vesting_shares": "0.000000 VESTS",
        "witness_required_vesting": "0.000000 VESTS",
        "maximum_block_size": 0,
        "current_aslot": 0,
        "recent_slots_filled": "0",
        "participation_count": 0,
        "last_irreversible_block_num": 0,
        "average_block_size": 0
      }
    }
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.get_dynamic_global_properties", "params": {}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "jsonrpc": "2.0",
      "result": {
        "properties": {
          "head_block_number": 58019,
          "head_block_id": "0000e2a396fb66a55ae156bf48ce26105b984826",
          "time": "1970-01-01T00:00:00",
          "current_witness": "initminer",
          "current_supply": "350015744.660303 SPHTX",
          "total_vesting_shares": "4169.375986 VESTS",
          "witness_required_vesting": "250000.000000 VESTS",
          "maximum_block_size": 262144,
          "current_aslot": 7835941,
          "recent_slots_filled": "340282366920938463463374607431768211455",
          "participation_count": 128,
          "last_irreversible_block_num": 57968,
          "average_block_size": 49
        }
      },
      "id": 1
    }'
    

    alexandria_api.get_key_references

    Returns all accounts that have the key associated with their owner or active authorities.

    Request

  • keys - public keys

  • Response

  • accounts - accounts associated with input public keys

  • Query Parameters JSON
    {
      "keys": [
        "SPH53jwLxn81x9TNir88SHGEtbtrrU5h3Pf4cyoehY22xw4Xg3zyk"
      ]
    }
    
    Expected Response JSON
    {"accounts": [["dsgrjxA6FHQA2CV4W-vezsaYrQQ"]]}
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.get_key_references", "params": {"keys":["SPH53jwLxn81x9TNir88SHGEtbtrrU5h3Pf4cyoehY22xw4Xg3zyk"]}, "id": 1}' https://API_URL
    

    alexandria_api.account_exist

    Check if account exists

    Request

  • account_name

  • Response

  • account_exist - true if provided account exists, otherwise false

  • Query Parameters JSON
    {"account_name": ""}
    
    Expected Response JSON
    {"account_exist": false}
    

    alexandria_api.add_fee

    Add custom fee to the operation

    Request

  • op - Operation where the fee is added
  • fee - Fee to be added

  • Response

  • op - operation with adjusted fee

  • Query Parameters JSON
    {
      "op": [
        "transfer",
        {
          "fee": "0.000000 SPHTX",
          "from": "",
          "to": "",
          "amount": "0.000000 SPHTX",
          "memo": ""
        }
      ],
      "fee": "0.000000 SPHTX"
    }
    
    Expected Response JSON
    {
      "op": [
        "transfer",
        {
          "fee": "0.000000 SPHTX",
          "from": "",
          "to": "",
          "amount": "0.000000 SPHTX",
          "memo": ""
        }
      ]
    }
    

    alexandria_api.add_signature

    Adds signature to the provided transaction

    Request

  • tx - unsigned transaction
  • signature - signature that will be add to transaction

  • Response

  • signed_tx - signed transaction

  • Query Parameters JSON
    {
      "tx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      },
      "signature": "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
    }
    
    Expected Response JSON
    {
      "signed_tx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      }
    }
    

    alexandria_api.broadcast_transaction

    Broadcasts a transaction into the network and waits for it to be processed synchronously.

    There are 4 previous steps that needs to be done before broadcast is called.
    All of them can and should be done locally, not on the blockchain side !!! For inspiration, see

  • alexandria_api.create_simple_transaction
  • alexandria_api.get_transaction_digest
  • alexandria_api.sign_digest
  • alexandria_api.add_siganture
  • or

  • alexandria_api.send_and_sign_operation
  • that combines all the previous calls into one.

    Request

  • tx - signed transaction

  • Response

  • tx - broadcasted transaction with block information that it is included in

  • Query Parameters JSON
    {
      "tx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      }
    }
    
    Expected Response JSON
    {
      "tx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": [],
        "transaction_id": "0000000000000000000000000000000000000000",
        "block_num": 0,
        "transaction_num": 0
      }
    }
    

    alexandria_api.calculate_fee

    Returns required fee for the given operation.

    Request

  • op - operation to be evaluated
  • symbol - symbol of the fee paying currency

  • Response

  • fee - calculated required fee

  • Query Parameters JSON
    {
      "op": [
        "transfer",
        {
          "fee": "0.000000 SPHTX",
          "from": "",
          "to": "",
          "amount": "0.000000 SPHTX",
          "memo": ""
        }
      ],
      "symbol": "SPHTX"
    }
    
    Expected Response JSON
    {"fee": "0.000000 SPHTX"}
    

    alexandria_api.create_simple_authority

    Creates simple authority from provided public key.

    Request

  • pub_key

  • Response

  • simple_authority

  • Query Parameters JSON
    {
      "pub_key": "SPH1111111111111111111111111111111114T1Anm"
    }
    
    Expected Response JSON
    {
      "simple_authority": {
        "weight_threshold": 0,
        "account_auths": [],
        "key_auths": []
      }
    }
    

    alexandria_api.create_simple_managed_authority

    Creates simple managed authority from provided account name.

    Request

  • managing_account - i.e. "account_name"

  • Response

  • simple_managed_authority

  • Query Parameters JSON
    {"managing_account": ""}
    
    Expected Response JSON
    {
      "simple_managed_authority": {
        "weight_threshold": 0,
        "account_auths": [],
        "key_auths": []
      }
    }
    

    alexandria_api.create_simple_multisig_authority

    Creates simple multisig authority from provided public keys.

    Request

  • pub_keys - list of public keys
  • required_signatures - number of required signatures

  • Response

  • simple_multisig_authority

  • Query Parameters JSON
    {"pub_keys": [], "required_signatures": 0}
    
    Expected Response JSON
    {
      "simple_multisig_authority": {
        "weight_threshold": 0,
        "account_auths": [],
        "key_auths": []
      }
    }
    

    alexandria_api.create_simple_multisig_managed_authority

    Creates simple multisig managed authority from provided account_name.

    Request

  • managing_accounts - vector of accounts i.e. ["account_name"]
  • required_signatures - number of required signatures

  • Response

  • simple_multisig_managed_authority

  • Query Parameters JSON
    {
      "managing_accounts": [],
      "required_signatures": 0
    }
    
    Expected Response JSON
    {
      "simple_multisig_managed_authority": {
        "weight_threshold": 0,
        "account_auths": [],
        "key_auths": []
      }
    }
    

    alexandria_api.create_simple_transaction

    Creates transaction in requirded format from provided single operation.

    Request

  • op - operation that should be in this transaction

  • Response

  • simple_tx - created transaction with provided operation

  • Query Parameters JSON
    {
      "op": [
        "custom_json",
        {
          "fee": "0.000000 SPHTX",
          "sender": "user1",
          "recipients": ["user2", "user3"],
          "app_id": 10,
          "json": "{\"data\":\"any valid json data\"}"
        }
      ]
    }
    
    Expected Response JSON
    {
      "simple_tx": {
        "ref_block_num": 3701,
        "ref_block_prefix": 914684397,
        "expiration": "2019-04-04T13:24:15",
        "operations": [
          [
            "custom_json",
            {
              "fee": "0.010000 SPHTX",
              "sender": "user1",
              "recipients": ["user2", "user3"],
              "app_id": 10,
              "json": "{\"data\":\"any valid json data\"}"
            }
          ]
        ],
        "extensions": [],
        "signatures": []
      }
    }
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.create_simple_transaction", "params": {"op":["custom_json",{"fee":"0.000000 SPHTX","sender":"user1","recipients":["user2","user3"],"app_id":10,"json":"{\"data\":\"any valid json data\"}"}]}, "id": 1}' https://API_URL
    

    alexandria_api.create_transaction

    Creates transaction in requirded format from provided list of operations.

    Request

  • op_vec - list of operations that should be in this transaction

  • Response

  • simple_tx - created transaction with provided operations

  • Query Parameters JSON
    {"op_vec": []}
    
    Expected Response JSON
    {
      "tx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      }
    }
    

    alexandria_api.custom_object_subscription

    Query Parameters JSON
    {
      "return_id": 0,
      "app_id": 0,
      "account_name": "",
      "search_type": "",
      "start": 0
    }
    
    Expected Response JSON
    {"subscription": 0}
    

    alexandria_api.decrypt_data

    Decrypts provided data.

    Request

  • data - data to be decrypted
  • public_key - public key of sender
  • private_key - private key of recipient

  • Response

  • decrypted_data - decrypted data

  • Query Parameters JSON
    {
      "data": "",
      "public_key": "SPH1111111111111111111111111111111114T1Anm",
      "private_key": ""
    }
    
    Expected Response JSON
    {"decrypted_data": ""}
    

    alexandria_api.encrypt_data

    Encrypts provided data.

    Request

  • data - data to be encrypted
  • public_key - public key of sender
  • private_key - private key of recipient

  • Response

  • encrypted_data - decrypted data

  • Query Parameters JSON
    {
      "data": "",
      "public_key": "SPH1111111111111111111111111111111114T1Anm",
      "private_key": ""
    }
    
    Expected Response JSON
    {"encrypted_data": ""}
    

    alexandria_api.fiat_to_sphtx

    Converts the given amount of fiat to sphtx.

    Request

  • fiat - amount to be converted

  • Response

  • sphtx - amount of SPHTX if conversion is possible,or returns back fiat if not.

  • Query Parameters JSON
    {"fiat": "0.000000 EUR"}
    
    Expected Response JSON
    {"sphtx": "0.000000 SPHTX"}
    

    alexandria_api.to_base64

    Encodes data to base64.

    Request

  • data - data to encoded

  • Response

  • base64_str - encoded data.

  • Query Parameters JSON
    {"data": ""}
    
    Expected Response JSON
    {"base64_str": ""}
    

    alexandria_api.from_base64

    Decodes data from base64.

    Request

  • data - data to decoded

  • Response

  • str - decoded data.

  • Query Parameters JSON
    {"data": ""}
    
    Expected Response JSON
    {"str": ""}
    

    alexandria_api.generate_key_pair

    Generates public/private key pair.

    This functionality should be done locally in SDK and not remotely !!!

    Response

  • key_pair - generated pair of keys.

  • Query Parameters JSON
    {}
    
    Expected Response JSON
    {
      "key_pair": {
        "pub_key": "SPH1111111111111111111111111111111114T1Anm",
        "wif_priv_key": ""
      }
    }
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.generate_key_pair", "params": {}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "jsonrpc": "2.0",
      "result": {
        "key_pair": {
          "pub_key": "SPH59JiJ8xruCD1HdRAGJemfMnUwr5KUm8dJXYe6R5fFdkD3UhsU7",
          "wif_priv_key": "5KEAAt3W2nrc61ZMkrLLbqSK9wqi8N3Afrr1sWDb7Q7xd9CPHz7"
        }
      },
      "id": 1
    }'
    

    alexandria_api.generate_key_pair_from_brain_key

    Generates public/private key pair based on brain key.

    This functionality should be done locally in SDK and not remotely !!!

    Request

  • brain_key - brain key for generating key pair

  • Response

  • key_pair - generated pair of keys.

  • Query Parameters JSON
    {"brain_key": ""}
    
    Expected Response JSON
    {
      "key_pair": {
        "pub_key": "SPH1111111111111111111111111111111114T1Anm",
        "wif_priv_key": ""
      }
    }
    

    alexandria_api.get_account_name_from_seed

    Returns account name saved in blockchain based on human-readable seed name.

    In all further transactions that write data into blockchain, real blockchain account name must be used. !!!

    Request

  • seed - seed/human-readble account name

  • Response

  • account_name - real account name saved in blockchain.

  • Query Parameters JSON
    {"seed": ""}
    
    Expected Response JSON
    {"account_name": ""}
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.get_account_name_from_seed", "params": {"seed" : "sophiatx_user"}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "jsonrpc": "2.0",
      "result": {"account_name": "7HLPQ1kpnAIWawkAEgcoN4I7qJY"},
      "id": 1
    }'
    

    alexandria_api.get_account

    Returns account info specified by name. Either seed name or blockchain real account name can be used.

    Request

  • account_name - name of the account to provide information about i.e. "account_name"

  • Response

  • account - public account info stored in the blockchain.

  • Query Parameters JSON
    {"account_name": ""}
    
    Expected Response JSON
    {
      "account": [
        {
          "id": 0,
          "name": "",
          "owner": {
            "weight_threshold": 0,
            "account_auths": [],
            "key_auths": []
          },
          "active": {
            "weight_threshold": 0,
            "account_auths": [],
            "key_auths": []
          },
          "memo_key": "",
          "json_metadata": "{}",
          "voting_proxy": "",
          "balance": "0.000000 SPHTX",
          "vesting_shares": "0.000000 VESTS",
          "vesting_withdraw_rate": "0.000000 VESTS",
          "to_withdraw": 0,
          "witness_votes": [],
          "sponsored_accounts": [],
          "sponsoring_account": ""
        }
      ]
    }
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.get_account", "params": {"account_name" : "sophiatx_user"}, "id": 1}' https://API_URL
    
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.get_account", "params": {"account_name" : "7HLPQ1kpnAIWawkAEgcoN4I7qJY"}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "jsonrpc": "2.0",
      "result": {
        "account": [
          {
            "id": 50,
            "name": "7HLPQ1kpnAIWawkAEgcoN4I7qJY",
            "owner": {
              "weight_threshold": 1,
              "account_auths": [],
              "key_auths": [
                [
                  "SPH7qASF1CfENDRWdKC5gQCktydRQM2aY3i1d9wFdu1fjpURgTxiw",
                  1
                ]
              ]
            },
            "active": {
              "weight_threshold": 1,
              "account_auths": [],
              "key_auths": [
                [
                  "SPH5ekkeER1xi3EDoxoggo2ruMgPazKsGa8Pj44qrD326oDk5rgKP",
                  1
                ]
              ]
            },
            "memo_key": "SPH4vtSio7iGMggFboydFjgRZknPEH1BExcN3r4rjb9iznJQr7Mqy",
            "json_metadata": "{\"data\":\"anything related to the sophiatx_user\"}",
            "voting_proxy": "",
            "balance": "0.000000 SPHTX",
            "vesting_shares": "0.000000 VESTS",
            "vesting_withdraw_rate": "0.000000 VESTS",
            "to_withdraw": 0,
            "witness_votes": [],
            "sponsored_accounts": [],
            "sponsoring_account": ""
          }
        ]
      },
      "id": 1
    }'
    
    '{
      "jsonrpc": "2.0",
      "result": {
        "account": [
          {
            "id": 50,
            "name": "7HLPQ1kpnAIWawkAEgcoN4I7qJY",
            "owner": {
              "weight_threshold": 1,
              "account_auths": [],
              "key_auths": [
                [
                  "SPH7qASF1CfENDRWdKC5gQCktydRQM2aY3i1d9wFdu1fjpURgTxiw",
                  1
                ]
              ]
            },
            "active": {
              "weight_threshold": 1,
              "account_auths": [],
              "key_auths": [
                [
                  "SPH5ekkeER1xi3EDoxoggo2ruMgPazKsGa8Pj44qrD326oDk5rgKP",
                  1
                ]
              ]
            },
            "memo_key": "SPH4vtSio7iGMggFboydFjgRZknPEH1BExcN3r4rjb9iznJQr7Mqy",
            "json_metadata": "{\"data\":\"anything related to the sophiatx_user\"}",
            "voting_proxy": "",
            "balance": "0.000000 SPHTX",
            "vesting_shares": "0.000000 VESTS",
            "vesting_withdraw_rate": "0.000000 VESTS",
            "to_withdraw": 0,
            "witness_votes": [],
            "sponsored_accounts": [],
            "sponsoring_account": ""
          }
        ]
      },
      "id": 1
    }'
    

    alexandria_api.get_accounts

    Returns accounts info specified by names. Either seed names or blockchain real account names can be used.

    Request

  • account_names - list of account names to provide information about

  • Response

  • accounts - public accounts info stored in the blockchain.

  • Query Parameters JSON
    {
      "account_names": [
        "dsgrjxA6FHQA2CV4W-vezsaYrQQ",
        "ayp1dsJTvH13b8k_4aXTZC5rp5g"
      ]
    }
    
    Expected Response JSON
    {
      "accounts": [
        {
          "id": 0,
          "name": "",
          "owner": {
            "weight_threshold": 0,
            "account_auths": [],
            "key_auths": []
          },
          "active": {
            "weight_threshold": 0,
            "account_auths": [],
            "key_auths": []
          },
          "memo_key": "",
          "json_metadata": "{}",
          "voting_proxy": "",
          "balance": "0.000000 SPHTX",
          "vesting_shares": "0.000000 VESTS",
          "vesting_withdraw_rate": "0.000000 VESTS",
          "to_withdraw": 0,
          "witness_votes": [],
          "sponsored_accounts": [],
          "sponsoring_account": "",
          "vesting_balance": "0.000000 SPHTX",
          "transfer_history": [],
          "other_history": []
        }
      ]
    }
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.get_accounts", "params": {"account_names":["dsgrjxA6FHQA2CV4W-vezsaYrQQ", "ayp1dsJTvH13b8k_4aXTZC5rp5g"]}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "jsonrpc": "2.0",
      "result": {
        "accounts": [
          {
            "id": 44,
            "name": "dsgrjxA6FHQA2CV4W-vezsaYrQQ",
            "owner": {
              "weight_threshold": 1,
              "account_auths": [],
              "key_auths": [
                [
                  "SPH53jwLxn81x9TNir88SHGEtbtrrU5h3Pf4cyoehY22xw4Xg3zyk",
                  1
                ]
              ]
            },
            "active": {
              "weight_threshold": 1,
              "account_auths": [],
              "key_auths": [
                [
                  "SPH5exSMJE8QyFbHjtigobia2pGZj88eRG3nj3Te7XFWVLfB6JewS",
                  1
                ]
              ]
            },
            "memo_key": "SPH8eAn9t5ryjarx88uvXvFoysBYqaRLNhpTNFgqdBWjSHLoonypi",
            "json_metadata": "{}",
            "voting_proxy": "",
            "balance": "0.000000 SPHTX",
            "vesting_shares": "0.000000 VESTS",
            "vesting_withdraw_rate": "0.000000 VESTS",
            "to_withdraw": 0,
            "witness_votes": [],
            "sponsored_accounts": [],
            "sponsoring_account": "",
            "vesting_balance": "0.000000 SPHTX",
            "transfer_history": [],
            "other_history": []
          },
          {
            "id": 45,
            "name": "ayp1dsJTvH13b8k_4aXTZC5rp5g",
            "owner": {
              "weight_threshold": 1,
              "account_auths": [],
              "key_auths": [
                [
                  "SPH5enokWABeJzdtyTKJ7psxv3ex85PcschmGugNX38ioUSiJy9nk",
                  1
                ]
              ]
            },
            "active": {
              "weight_threshold": 1,
              "account_auths": [],
              "key_auths": [
                [
                  "SPH4ycHC92BWtYWQyDKc5v2331z4HQ1VTQcVMic76ZE2CrwCG7h1X",
                  1
                ]
              ]
            },
            "memo_key": "SPH7s5uMfDoKwPXiczxp23j7SaAvWBDvZNak3aNegLaB6SPEp1S3u",
            "json_metadata": "{}",
            "voting_proxy": "",
            "balance": "0.000000 SPHTX",
            "vesting_shares": "0.000000 VESTS",
            "vesting_withdraw_rate": "0.000000 VESTS",
            "to_withdraw": 0,
            "witness_votes": [],
            "sponsored_accounts": [],
            "sponsoring_account": "",
            "vesting_balance": "0.000000 SPHTX",
            "transfer_history": [],
            "other_history": []
          }
        ]
      },
      "id": 1
    }'
    

    alexandria_api.get_account_balance

    Returns account balance in SOPHIATX_SATOSHIS.
    1 SPHTX = 1000 000 SOPHIATX_SATOSHIS

    Request

  • account_name - account name to provide balance of

  • Response

  • account_balance - account balande in SOPHIATX_SATOSHIS.

  • Query Parameters JSON
    {"account_name": ""}
    
    Expected Response JSON
    {"account_balance": 0}
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.get_account_balance", "params": {"account_name":"7HLPQ1kpnAIWawkAEgcoN4I7qJY"}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "jsonrpc": "2.0",
      "result": {"account_balance": 1000000000},
      "id": 1
    }'
    

    alexandria_api.get_account_history

    Returns a history of all operations for a given account. Account operations have sequence numbers from 0 to N where N is the most recent operation. This method returns operations in the range [from-limit,from]

    Request

  • account - account whose history will be returned
  • from - the absolute sequence number,-1 means most recent,limit is the number of operations before from.
  • limit - the maximum number of items that can be queried (0 to 1000],must be less than from

  • Response

  • account_history - history of all operations.

  • Query Parameters JSON
    {"account": "", "start": 0, "limit": 0}
    
    Expected Response JSON
    {"account_history": []}
    

    alexandria_api.get_active_authority

    Returns active authority for given account

    Request

  • account_name - account name i.e. "account_name"

  • Response

  • active_authority

  • Query Parameters JSON
    {"account_name": ""}
    
    Expected Response JSON
    {
      "active_authority": {
        "weight_threshold": 0,
        "account_auths": [],
        "key_auths": []
      }
    }
    

    alexandria_api.get_active_witnesses

    Returns the list of witnesses producing blocks in the current round (51 Blocks).

    Response

  • active_witnesses

  • Query Parameters JSON
    {}
    
    Expected Response JSON
    {"active_witnesses": []}
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.get_active_witnesses", "params": {}, "id": 1}' https://API_URL
    

    alexandria_api.get_application_buyings

    Gets all app buyings by app_name or buyer.

    Request

  • name - application id or buyers name i.e. "account_name"
  • search_type - one of "by_buyer","by_app_id"
  • count - number of items to retrieve

  • Response

  • application_buyings

  • Query Parameters JSON
    {"name": "", "search_type": "", "count": 0}
    
    Expected Response JSON
    {"application_buyings": []}
    

    alexandria_api.get_applications

    Gets all application objects.

    Request

  • names - list of applications names

  • Response

  • applications

  • Query Parameters JSON
    {"names": []}
    
    Expected Response JSON
    {"applications": []}
    

    alexandria_api.get_applications_by_ids

    Gets all application objects by their id’s.

    Request

  • ids - list of applications id'ss

  • Response

  • applications

  • Query Parameters JSON
    {"ids": []}
    
    Expected Response JSON
    {"applications": []}
    

    alexandria_api.get_block

    Returns the details of a block based on a block num.

    Request

  • block_num - number/height of block

  • Response

  • block - block info

  • Query Parameters JSON
    {"num": 0}
    
    Expected Response JSON
    {
      "block": {
        "previous": "0000e11cfaab5a841cc6f33b6d94efd58d186800",
        "timestamp": "1970-01-01T00:00:00",
        "witness": "",
        "transaction_merkle_root": "0000000000000000000000000000000000000000",
        "extensions": [],
        "witness_signature": "",
        "transactions": [],
        "block_id": "0000000000000000000000000000000000000000",
        "signing_key": "SPH1111111111111111111111111111111114T1Anm",
        "transaction_ids": []
      }
    }
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.get_block", "params": {"num":57629}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "jsonrpc": "2.0",
      "result": {
        "block": {
          "previous": "0000000000000000000000000000000000000000",
          "timestamp": "2019-04-15T12:37:33",
          "witness": "",
          "transaction_merkle_root": "0000000000000000000000000000000000000000",
          "extensions": [],
          "witness_signature": "1f56ee79e72e287ed205775c9caf02c805516e28513da8963ecf9ab26d84c5e4bd400553054fb4e51d7c3e2254e4075afd0c9b740f0fcc07869b7419c6af485d86",
          "transactions": [],
          "block_id": "0000e11dcd83233a6d0c8ec43ecaf1626115f86e",
          "signing_key": "SPH6LLegbAgLAy28EHrffBVuANFWcFgmqRMW13wBmTExqFE9SCkg4",
          "transaction_ids": []
        }
      },
      "id": 1
    }'
    

    alexandria_api.get_ops_in_block

    Returns all operations contained in a block based on a block num.

    Request

  • block_num - number/height of block
  • only_virtual - whether to only return virtual operations

  • Response

  • ops_in_block - operations included in block

  • Query Parameters JSON
    {"block_num": 0, "only_virtual": false}
    
    Expected Response JSON
    {"ops_in_block": []}
    

    alexandria_api.get_feed_history

    Returns the current price feed history for specified symbol.

    Request

  • symbol - symbol, for which price feed history is returned.
    Possible values - EUR/USD/CNY/GBP

  • Response

  • feed_history

  • Query Parameters JSON
    {"symbol": ""}
    
    Expected Response JSON
    {
      "feed_history": {
        "id": 0,
        "current_median_price": {
          "base": "0.000000 SPHTX",
          "quote": "0.000000 SPHTX"
        },
        "price_history": []
      }
    }
    

    alexandria_api.get_memo_key

    Returns public memo key for given account.

    Request

  • account_name - account name i.e. "account_name"

  • Response

  • memo_key

  • Query Parameters JSON
    {"account_name": ""}
    
    Expected Response JSON
    {
      "memo_key": "SPH1111111111111111111111111111111114T1Anm"
    }
    

    alexandria_api.get_owner_authority

    Returns public memo key for given account.

    Request

  • account_name - account name i.e. "account_name"

  • Response

  • owner_authority

  • Query Parameters JSON
    {"account_name": ""}
    
    Expected Response JSON
    {
      "owner_authority": {
        "weight_threshold": 0,
        "account_auths": [],
        "key_auths": []
      }
    }
    

    alexandria_api.get_owner_history

    Returns the owner history of an account.

    Request

  • account_name - account name i.e. "account_name"

  • Response

  • owner_history

  • Query Parameters JSON
    {"account": ""}
    
    Expected Response JSON
    {"owner_history": []}
    

    alexandria_api.get_public_key

    Returns paired public key to provided private key.

    Request

  • private_key

  • Response

  • public_key

  • Query Parameters JSON
    {"private_key": ""}
    
    Expected Response JSON
    {
      "public_key": "SPH1111111111111111111111111111111114T1Anm"
    }
    

    alexandria_api.get_received_documents

    Returns custom json or binary documents that were saved into blockchain filtered by app_id and search_type

    Request

  • app_id - general filter
  • account_name - name of account used in search_type filters
  • search type (_reverse in search_types will be deleted in next version)
    • by_sender_reverse
    • by_recipient_reverse
    • by_sender_datetime_reverse
    • by_recipient_datetime_reverse
  • start - index of starting element
  • count - max number of elements to be returned

  • Response

  • received_documents - list of received documents filtered by app_id and search_type

  • Query Parameters JSON
    {
      "app_id": 0,
      "account_name": "",
      "search_type": "",
      "start": 0,
      "count": 10
    }
    
    Expected Response JSON
    {"received_documents": []}
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.get_received_documents", "params": {"app_id": 2,"account_name": "user2","search_type": "by_sender_reverse","start": "0","count": 10}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "received_documents": [
        [
          1,
          {
            "id": 4,
            "sender": "user1",
            "recipients": ["user2"],
            "app_id": 1,
            "data": "{\"data\":\"app 1 data\"}",
            "received": "2019-04-05T08:39:42",
            "binary": false
          }
        ],
        [
          2,
          {
            "id": 5,
            "sender": "user1",
            "recipients": ["user2"],
            "app_id": 1,
            "data": "{\"data\":\"app 1 data idx 2\"}",
            "received": "2019-04-05T08:39:54",
            "binary": false
          }
        ],
        [
          3,
          {
            "id": 6,
            "sender": "user1",
            "recipients": ["user2"],
            "app_id": 1,
            "data": "{\"data\":\"app 1 data idx 3\"}",
            "received": "2019-04-05T08:40:00",
            "binary": false
          }
        ]
      ]
    }'
    

    alexandria_api.get_required_signatures

    Returns list of public keys (authorities) required for signing provided transaction.

    Request

  • tx

  • Response

  • required_signatures

  • Query Parameters JSON
    {
      "tx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      }
    }
    
    Expected Response JSON
    {"required_signatures": []}
    

    alexandria_api.get_transaction

    Returns the details of a transaction based on a transaction id.

    Request

  • tx_id - transaction id

  • Response

  • tx - transaction info

  • Query Parameters JSON
    {
      "tx_id": "0000000000000000000000000000000000000000"
    }
    
    Expected Response JSON
    {
      "tx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": [],
        "transaction_id": "0000000000000000000000000000000000000000",
        "block_num": 0,
        "transaction_num": 0
      }
    }
    

    alexandria_api.get_transaction_digest

    Returns calculated digest of provided transaction.

    Request

  • tx - transaction

  • Response

  • tx_digest - calculated digest

  • Query Parameters JSON
    {
      "tx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      }
    }
    
    Expected Response JSON
    {
      "tx_digest": "0000000000000000000000000000000000000000000000000000000000000000"
    }
    

    alexandria_api.get_transaction_id

    Returns calculated transaction id based on provided transaction in json.

    Request

  • tx - transaction

  • Response

  • tx_id - calculated transaction id

  • Query Parameters JSON
    {
      "tx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      }
    }
    
    Expected Response JSON
    {
      "tx_id": "0000000000000000000000000000000000000000"
    }
    

    alexandria_api.get_vesting_balance

    Returns vestig balance for given account in SOPHIATX_SATOSHIS.

    Request

  • account_name - account name i.e. "account_name"

  • Response

  • vesting_balance - in SOPHIATX_SATOSHIS

  • Query Parameters JSON
    {"account_name": ""}
    
    Expected Response JSON
    {"vesting_balance": 0}
    

    alexandria_api.get_witness

    Returns information about the given witness..

    Request

  • owner_account - name or id of the witness account owner i.e. "account_name",or the id of the witness

  • Response

  • witness(optional) - information about the witness stored in the block chain

  • Query Parameters JSON
    {"owner_account": ""}
    
    Expected Response JSON
    {}
    

    alexandria_api.list_witnesses

    Returns all witnesses registered in the blockchain. This returns a list of all account names that own witnesses and the associated witness id, sorted by name. This lists witnesses whether they are currently voted in or not.

    Request

  • start -
  • limit -
  • order -

  • Response

  • witnesses - information about the witnesses stored in the blockchain

  • Query Parameters JSON
    {"start": "", "limit": 0, "order": ""}
    
    Expected Response JSON
    {"witnesses": []}
    

    alexandria_api.list_witnesses_by_vote

    Returns current witnesses by vote.

    Query Parameters JSON
    {"name": "", "limit": 0}
    
    Expected Response JSON
    {"witnesses_by_vote": []}
    

    alexandria_api.send_and_sign_operation

    Creates transaction based on provided operation, signs it and broadcasts it to the network

    This functionality should be done locally in SDK and not remotely !!! Only alexandria_api.broadcast_transaction should be called remotely. See "Internal steps" below.

    Request

  • op - any of the supported operations(TODO add link to supported operations)
  • pk - sender private key

  • Response

  • signed_tx - signed, created and broadcasted transaction

  • Internal steps make by this call are equivalent to:

  • tx = alexandria_api.create_simple_transaction(request.op)
  • digest = alexandria_api.get_transaction_digest(tx)
  • signed_digest = alexandria_api.sign_digest(digest, request.pk)
  • signed_tx = alexandria_api.add_siganture(tx, signed_digest)
  • result.signed_tx = alexandria_api.broadcast_transaction(signed_tx)

  • Query Parameters JSON
    {"op": [], "pk": ""}
    
    Expected Response JSON
    {
      "signed_tx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": [],
        "transaction_id": "0000000000000000000000000000000000000000",
        "block_num": 0,
        "transaction_num": 0
      }
    }
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.send_and_sign_operation", "params": {"op":["custom_json",{"fee":"0.000000 SPHTX","sender":"user1","recipients":["user2","user3"],"app_id":10,"json":"{\"data\":\"any valid json data\"}"}],"pk":"sender PRIVATE KEY"}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "signed_tx": {
        "ref_block_num": 2230,
        "ref_block_prefix": 331838658,
        "expiration": "2019-04-04T12:10:42",
        "operations": [
          [
            "custom_json",
            {
              "fee": "0.010000 SPHTX",
              "sender": "user1",
              "recipients": ["user2", "user3"],
              "app_id": 10,
              "json": "{\"data\":\"any valid json data\"}"
            }
          ]
        ],
        "extensions": [],
        "signatures": [
          "1f5f304dd4d478f498fb4e42f3abf75fb6e7b0f3d5da9a42068c36127374ce6bab64628c0fe22a4a7ff78d2b8a7176e8738a3ee7920f4c0787cbd4125755300154"
        ],
        "transaction_id": "dacf80351711e1049bccf0d804b5556ca8282c17",
        "block_num": 2231,
        "transaction_num": 0
      }
    }'
    

    alexandria_api.send_and_sign_transaction

    Signs provided transaction and broadcasts it to network

    Such transaction can be created by call alexandria_api.create_simple_transaction(…)

    This functionality should be done locally in SDK and not remotely !!! Only alexandria_api.broadcast_transaction should be called remotely. See "Internal steps" below.

    Request

  • tx - unsigned transaction
  • pk - sender private key

  • Response

  • signed_tx - signed, created and broadcasted transaction

  • Internal steps make by this call are equivalent to:

  • digest = alexandria_api.get_transaction_digest(tx)
  • signed_digest = alexandria_api.sign_digest(digest, request.pk)
  • signed_tx = alexandria_api.add_siganture(tx, signed_digest)
  • result.signed_tx = alexandria_api.broadcast_transaction(signed_tx)

  • Query Parameters JSON
    {
      "tx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      },
      "pk": ""
    }
    
    Expected Response JSON
    {
      "signed_tx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": [""],
        "transaction_id": "0000000000000000000000000000000000000000",
        "block_num": 0,
        "transaction_num": 0
      }
    }
    
    Example curl
    curl -s --data '{"jsonrpc": "2.0", "method": "alexandria_api.send_and_sign_transaction", "params": {"tx":{"ref_block_num":3701,"ref_block_prefix":914684397,"expiration":"2019-04-04T13:30:15","operations":[["custom_json",{"fee":"0.010000 SPHTX","sender":"user1","recipients":["user2","user3"],"app_id":10,"json":"{\"data\":\"any valid json data\"}"}]],"extensions":[],"signatures":[]},"pk":"sender PRIVATE KEY"}, "id": 1}' https://API_URL
    
    Response curl
    '{
      "signed_tx": {
        "ref_block_num": 3701,
        "ref_block_prefix": 914684397,
        "expiration": "2019-04-04T13:30:15",
        "operations": [
          [
            "custom_json",
            {
              "fee": "0.010000 SPHTX",
              "sender": "user1",
              "recipients": ["user2", "user3"],
              "app_id": 10,
              "json": "{\"data\":\"any valid json data\"}"
            }
          ]
        ],
        "extensions": [],
        "signatures": [
          "203cd5873cba28262b2972245b2524341750cc8c1b67dc8fe5307f87c9aac8f8276365ac22002f91e8468c8160fa0343f5b1a5ca53a62464a4d9560a2a9173953d"
        ],
        "transaction_id": "8b9afcccdf8bed9484fadd56eaa3bd744a13f819",
        "block_num": 3782,
        "transaction_num": 0
      }
    }'
    

    alexandria_api.sign_digest

    Signs digest with provided private key.

    Request:

  • digest - digest of transaction
  • pk - private key for signing (in WIF format)

  • Result:

  • signed_digest - signed digest.

  • Query Parameters JSON
    {
      "digest": "0000000000000000000000000000000000000000000000000000000000000000",
      "pk": ""
    }
    
    Expected Response JSON
    {
      "signed_digest": "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
    }
    

    alexandria_api.verify_signature

    Verifies signature of the provided digest based on provided publi key

    Request:

  • digest - digest corresponding to signature.
  • pub_key - public key corresponding to private_key,that signed digest.
  • signature - signature to be verified.

  • Result:

  • signature_valid - true if signature is valid, otherwise false.

  • Query Parameters JSON
    {
      "digest": "0000000000000000000000000000000000000000000000000000000000000000",
      "pub_key": "SPH1111111111111111111111111111111114T1Anm",
      "signature": "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
    }
    
    Expected Response JSON
    {"signature_valid": false}
    

    Database Api

    List of supported calls:


    Used to query information about accounts, transactions, and blockchain data. These AppBase API methods are still under development and subject to change.

    database_api.get_active_witnesses

    Returns the list of active witnesses.

    Query Parameters JSON
    {}
    
    Expected Response JSON
    {"witnesses": []}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"database_api.get_active_witnesses", "id":1}' https://API_URL
    

    database_api.get_config

    Returns information about compile-time constants. Some properties may not be present. See: Understanding Configuration Values

    Query Parameters JSON
    {}
    
    Expected Response JSON
    {}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"database_api.get_config", "id":1}' https://API_URL
    

    database_api.get_current_price_feed

    Returns the current price feed.

    Query Parameters JSON
    {"symbol": "SPHTX"}
    
    Expected Response JSON
    {
      "base": "0.000000 SPHTX",
      "quote": "0.000000 SPHTX"
    }
    

    database_api.get_dynamic_global_properties

    Returns the current dynamic global properties. See: Understanding Dynamic Global Properties

    Query Parameters JSON
    {}
    
    Expected Response JSON
    {
      "id": 0,
      "head_block_number": 0,
      "head_block_id": "0000000000000000000000000000000000000000",
      "time": "1970-01-01T00:00:00",
      "current_witness": "",
      "current_supply": "0.000000 SPHTX",
      "total_vesting_shares": "0.000000 VESTS",
      "total_reward_fund": "0.000000 SPHTX",
      "maximum_block_size": 0,
      "current_aslot": 0,
      "witness_required_vesting": "250000.000000 SPHTX",
      "recent_slots_filled": "0",
      "participation_count": 0,
      "last_irreversible_block_num": 0
    }
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"database_api.get_dynamic_global_properties", "id":1}' https://API_URL
    

    database_api.get_feed_history

    Returns the history of price feed values.

    Query Parameters JSON
    {"symbol": "SPHTX"}
    
    Expected Response JSON
    {
      "id": 0,
      "symbol": "SPHTX",
      "current_median_history": {
        "base": "0.000000 SPHTX",
        "quote": "0.000000 SPHTX"
      },
      "price_history": []
    }
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"database_api.get_feed_history", "id":1}' https://API_URL
    

    database_api.get_hardfork_properties

    Returns the current properties about the blockchain’s hardforks.

    Query Parameters JSON
    {}
    
    Expected Response JSON
    {
      "id": 0,
      "processed_hardforks": [],
      "last_hardfork": 0,
      "current_hardfork_version": "0.0.0",
      "next_hardfork": "0.0.0",
      "next_hardfork_time": "1970-01-01T00:00:00"
    }
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"database_api.get_hardfork_properties", "id":1}' https://API_URL
    

    database_api.get_potential_signatures

    This method will return the set of all public keys that could possibly sign for a given transaction.

    Query Parameters JSON
    {
      "trx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      }
    }
    
    Expected Response JSON
    {"keys": []}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"database_api.get_potential_signatures", "params":{"trx":{"ref_block_num":1097,"ref_block_prefix":2181793527,"expiration":"2016-03-24T18:00:21","operations":[{"type":"pow_operation","value":{"worker_account":"cloop3","block_id":"00000449f7860b82b4fbe2f317c670e9f01d6d9a","nonce":3899,"work":{"worker":"STM7P5TDnA87Pj9T4mf6YHrhzjC1KbPZpNxLWCcVcHxNYXakpoT4F","input":"ae8e7c677119d22385f8c48026fee7aad7bba693bf788d7f27047f40b47738c0","signature":"1f38fe9a3f9989f84bd94aa5bbc88beaf09b67f825aa4450cf5105d111149ba6db560b582c7dbb026c7fc9c2eb5051815a72b17f6896ed59d3851d9a0f9883ca7a","work":"000e7b209d58f2e64b36e9bf12b999c6c7af168cc3fc41eb7f8a4bf796c174c3"},"props":{"account_creation_fee":{"amount":"100000","precision":3,"nai":"@@000000021"},"maximum_block_size":131072,"sbd_interest_rate":1000}}}],"extensions":[],"signatures":[]}}, "id":1}' https://API_URL
    

    database_api.get_required_signatures

    This API will 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.

    Query Parameters JSON
    {
      "trx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      },
      "available_keys": []
    }
    
    Expected Response JSON
    {"keys": []}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"database_api.get_required_signatures", "params":{"trx":{"ref_block_num":1097,"ref_block_prefix":2181793527,"expiration":"2016-03-24T18:00:21","operations":[{"type":"pow_operation","value":{"worker_account":"cloop3","block_id":"00000449f7860b82b4fbe2f317c670e9f01d6d9a","nonce":3899,"work":{"worker":"STM7P5TDnA87Pj9T4mf6YHrhzjC1KbPZpNxLWCcVcHxNYXakpoT4F","input":"ae8e7c677119d22385f8c48026fee7aad7bba693bf788d7f27047f40b47738c0","signature":"1f38fe9a3f9989f84bd94aa5bbc88beaf09b67f825aa4450cf5105d111149ba6db560b582c7dbb026c7fc9c2eb5051815a72b17f6896ed59d3851d9a0f9883ca7a","work":"000e7b209d58f2e64b36e9bf12b999c6c7af168cc3fc41eb7f8a4bf796c174c3"},"props":{"account_creation_fee":{"amount":"100000","precision":3,"nai":"@@000000021"},"maximum_block_size":131072,"sbd_interest_rate":1000}}}],"extensions":[],"signatures":[]},"available_keys":[]}, "id":1}' https://API_URL
    

    database_api.get_transaction_hex

    Returns a hexdump of the serialized binary form of a transaction.

    Query Parameters JSON
    {
      "trx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      }
    }
    
    Expected Response JSON
    {"hex": ""}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"database_api.get_transaction_hex", "params":{"trx":{"ref_block_num":1097,"ref_block_prefix":2181793527,"expiration":"2016-03-24T18:00:21","operations":[{"type":"pow_operation","value":{"worker_account":"cloop3","block_id":"00000449f7860b82b4fbe2f317c670e9f01d6d9a","nonce":3899,"work":{"worker":"STM7P5TDnA87Pj9T4mf6YHrhzjC1KbPZpNxLWCcVcHxNYXakpoT4F","input":"ae8e7c677119d22385f8c48026fee7aad7bba693bf788d7f27047f40b47738c0","signature":"1f38fe9a3f9989f84bd94aa5bbc88beaf09b67f825aa4450cf5105d111149ba6db560b582c7dbb026c7fc9c2eb5051815a72b17f6896ed59d3851d9a0f9883ca7a","work":"000e7b209d58f2e64b36e9bf12b999c6c7af168cc3fc41eb7f8a4bf796c174c3"},"props":{"account_creation_fee":{"amount":"100000","precision":3,"nai":"@@000000021"},"maximum_block_size":131072,"sbd_interest_rate":1000}}}],"extensions":[],"signatures":[]}}, "id":1}' https://API_URL
    

    database_api.get_witness_schedule

    Returns the current witness schedule.

    Query Parameters JSON
    {}
    
    Expected Response JSON
    {
      "id": 0,
      "current_virtual_time": "0",
      "next_shuffle_block_num": 0,
      "current_shuffled_witnesses": [],
      "num_scheduled_witnesses": 0,
      "top19_weight": 0,
      "timeshare_weight": 0,
      "witness_pay_normalization_factor": 0,
      "median_props": {
        "account_creation_fee": "0.000000 SPHTX",
        "maximum_block_size": 262144,
        "price_feeds": []
      },
      "majority_version": "0.0.0",
      "max_voted_witnesses": 83,
      "max_runner_witnesses": 80,
      "hardfork_required_witnesses": 72
    }
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"database_api.get_witness_schedule", "id":1}' https://API_URL
    

    database_api.list_account_recovery_requests

    Returns a list of account recovery requests.

    Query Parameters JSON
    {"start": null, "limit": 0, "order": "by_name"}
    
    Expected Response JSON
    {"requests": []}
    

    database_api.list_accounts

    Returns a list of accounts.

    Query Parameters JSON
    {"start": null, "limit": 0, "order": "by_name"}
    
    Expected Response JSON
    {"accounts": []}
    

    database_api.list_change_recovery_account_requests

    Returns a list of recovery account change requests.

    Query Parameters JSON
    {"start": null, "limit": 0, "order": "by_name"}
    
    Expected Response JSON
    {"requests": []}
    

    database_api.list_escrows

    Returns a list of escrows.

    Query Parameters JSON
    {"start": null, "limit": 0, "order": "by_name"}
    
    Expected Response JSON
    {"escrows": []}
    

    database_api.list_owner_histories

    Returns a list of owner authority histories.

    Query Parameters JSON
    {"start": null, "limit": 0}
    
    Expected Response JSON
    {"owner_auths": []}
    

    database_api.list_witness_votes

    Returns a list of witness votes.

    Query Parameters JSON
    {"start": null, "limit": 0, "order": "by_name"}
    
    Expected Response JSON
    {"votes": []}
    

    database_api.list_witnesses

    Returns the list of witnesses.

    Query Parameters JSON
    {"start": null, "limit": 0, "order": "by_name"}
    
    Expected Response JSON
    {"witnesses": []}
    

    database_api.verify_account_authority

    Not Implemented

    Query Parameters JSON
    {"account": "", "signers": []}
    
    Expected Response JSON
    {"valid": false}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"database_api.verify_account_authority", "params":{"account":"initminer","signers":["STM7Q2rLBqzPzFeteQZewv9Lu3NLE69fZoLeL6YK59t7UmssCBNTU"]}, "id":1}' https://API_URL
    

    database_api.verify_authority

    Returns true if the transaction has all of the required signatures.

    Query Parameters JSON
    {
      "trx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      }
    }
    
    Expected Response JSON
    {"valid": false}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"database_api.verify_authority", "params":{"trx":{"ref_block_num":1097,"ref_block_prefix":2181793527,"expiration":"2016-03-24T18:00:21","operations":[{"type":"pow_operation","value":{"worker_account":"cloop3","block_id":"00000449f7860b82b4fbe2f317c670e9f01d6d9a","nonce":3899,"work":{"worker":"STM7P5TDnA87Pj9T4mf6YHrhzjC1KbPZpNxLWCcVcHxNYXakpoT4F","input":"ae8e7c677119d22385f8c48026fee7aad7bba693bf788d7f27047f40b47738c0","signature":"1f38fe9a3f9989f84bd94aa5bbc88beaf09b67f825aa4450cf5105d111149ba6db560b582c7dbb026c7fc9c2eb5051815a72b17f6896ed59d3851d9a0f9883ca7a","work":"000e7b209d58f2e64b36e9bf12b999c6c7af168cc3fc41eb7f8a4bf796c174c3"},"props":{"account_creation_fee":{"amount":"100000","precision":3,"nai":"@@000000021"},"maximum_block_size":131072,"sbd_interest_rate":1000}}}],"extensions":[],"signatures":[]}}, "id":1}' https://API_URL
    

    database_api.verify_signatures

    This is a general purpose API that checks signatures against accounts for an arbitrary sha256 hash using the existing authority structures.

    Query Parameters JSON
    {
      "hash": "0000000000000000000000000000000000000000000000000000000000000000",
      "signatures": [],
      "required_owner": [],
      "required_active": [],
      "required_other": []
    }
    
    Expected Response JSON
    {"valid": false}
    

    database_api.get_application_buyings

    Query Parameters JSON
    {"start": null, "limit": 0, "search_type": ""}
    
    Expected Response JSON
    {"application_buyings": []}
    

    database_api.get_burned_balance

    Query Parameters JSON
    {}
    
    Expected Response JSON
    "0.000000 SPHTX"
    

    database_api.get_promotion_pool_balance

    Query Parameters JSON
    {}
    
    Expected Response JSON
    "0.000000 SPHTX"
    

    database_api.list_applications

    Query Parameters JSON
    {"start": null, "limit": 0, "order": "by_name"}
    
    Expected Response JSON
    {"applications": []}
    

    database_api.find_account_recovery_requests

    Returns a list of account recovery requests.

    Query Parameters JSON
    {"accounts": []}
    
    Expected Response JSON
    {"requests": []}
    

    database_api.find_accounts

    Search for accounts.

    Query Parameters JSON
    {"accounts": []}
    
    Expected Response JSON
    {"accounts": []}
    

    database_api.find_change_recovery_account_requests

    Returns a list of requests to change the recovery account.

    Query Parameters JSON
    {"accounts": []}
    
    Expected Response JSON
    {"requests": []}
    

    database_api.find_escrows

    Returns a list of escrows.

    Query Parameters JSON
    {"from": ""}
    
    Expected Response JSON
    {"escrows": []}
    

    database_api.find_owner_histories

    Returns owner authority history.

    Query Parameters JSON
    {"owner": ""}
    
    Expected Response JSON
    {"owner_auths": []}
    

    database_api.find_witnesses

    Search for witnesses.

    Query Parameters JSON
    {"owners": []}
    
    Expected Response JSON
    {"witnesses": []}
    

    Jsonrpc

    List of supported calls:


    Used to lookup information about the JSON RPC API. These AppBase API methods are still under development and subject to change.

    jsonrpc.get_methods

    Returns a list of methods supported by the JSON RPC API.

    Query Parameters JSON
    {}
    
    Expected Response JSON
    []
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"jsonrpc.get_methods", "id":1}' https://API_URL
    

    jsonrpc.get_signature

    Returns the signature information for a JSON RPC method including the arguments and expected response JSON.

    Query Parameters JSON
    {"method": ""}
    
    Expected Response JSON
    {"args": null, "ret": null}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"jsonrpc.get_signature", "params":{"method":"jsonrpc.get_methods"}, "id":1}' https://API_URL
    
    curl -s --data '{"jsonrpc":"2.0", "method":"jsonrpc.get_signature", "params":{"method":"jsonrpc.get_signature"}, "id":1}' https://API_URL
    
    curl -s --data '{"jsonrpc":"2.0", "method":"jsonrpc.get_signature", "params":{"method":"condenser_api.get_dynamic_global_properties"}, "id":1}' https://API_URL
    
    curl -s --data '{"jsonrpc":"2.0", "method":"jsonrpc.get_signature", "params":{"method":"database_api.get_dynamic_global_properties"}, "id":1}' https://API_URL
    

    Network Broadcast Api

    List of supported calls:


    Used to broadcast transactions and blocks. These AppBase API methods are still under development and subject to change.

    Also see: Blockchain Ops

    network_broadcast_api.broadcast_block

    Used to broadcast a block.

    Query Parameters JSON
    {
      "block": {
        "previous": "0000000000000000000000000000000000000000",
        "timestamp": "1970-01-01T00:00:00",
        "witness": "",
        "transaction_merkle_root": "0000000000000000000000000000000000000000",
        "extensions": [],
        "witness_signature": "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "transactions": []
      }
    }
    
    Expected Response JSON
    {}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"network_broadcast_api.broadcast_block", "params":{"block":{"previous":"0000000000000000000000000000000000000000","timestamp":"1970-01-01T00:00:00","witness":"","transaction_merkle_root":"0000000000000000000000000000000000000000","extensions":[],"witness_signature":"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","transactions":[]}}, "id":1}' https://API_URL
    

    network_broadcast_api.broadcast_transaction

    Used to broadcast a transaction.

    Query Parameters JSON
    {
      "trx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      },
      "max_block_age": -1
    }
    
    Expected Response JSON
    {}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"network_broadcast_api.broadcast_transaction", "params":{"trx":{"ref_block_num":1097,"ref_block_prefix":2181793527,"expiration":"2016-03-24T18:00:21","operations":[{"type":"vote_operation","value":{"voter":"initminer","author":"alice","permlink":"a-post-by-alice","weight":10000}}],"extensions":[],"signatures":[]},"max_block_age":50}, "id":1}' https://API_URL
    
    curl -s --data '{"jsonrpc":"2.0", "method":"network_broadcast_api.broadcast_transaction", "params":{"trx":{"ref_block_num":1097,"ref_block_prefix":2181793527,"expiration":"2016-03-24T18:00:21","operations":[{"type":"pow_operation","value":{"worker_account":"cloop3","block_id":"00000449f7860b82b4fbe2f317c670e9f01d6d9a","nonce":3899,"work":{"worker":"STM7P5TDnA87Pj9T4mf6YHrhzjC1KbPZpNxLWCcVcHxNYXakpoT4F","input":"ae8e7c677119d22385f8c48026fee7aad7bba693bf788d7f27047f40b47738c0","signature":"1f38fe9a3f9989f84bd94aa5bbc88beaf09b67f825aa4450cf5105d111149ba6db560b582c7dbb026c7fc9c2eb5051815a72b17f6896ed59d3851d9a0f9883ca7a","work":"000e7b209d58f2e64b36e9bf12b999c6c7af168cc3fc41eb7f8a4bf796c174c3"},"props":{"account_creation_fee":{"amount":"100000","precision":3,"nai":"@@000000021"},"maximum_block_size":131072,"sbd_interest_rate":1000}}}],"extensions":[],"signatures":[]},"max_block_age":50}, "id":1}' https://API_URL
    

    network_broadcast_api.broadcast_transaction_synchronous

    Used to broadcast a transaction and waits for it to be processed synchronously.

    Query Parameters JSON
    {
      "trx": {
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "expiration": "1970-01-01T00:00:00",
        "operations": [],
        "extensions": [],
        "signatures": []
      },
      "max_block_age": -1
    }
    
    Expected Response JSON
    {
      "id": "0000000000000000000000000000000000000000",
      "block_num": 0,
      "trx_num": 0,
      "expired": false
    }
    

    Account History Api

    List of supported calls:


    Used to lookup account history information. These AppBase API methods are still under development and subject to change.

    account_history_api.get_account_history

    Returns a history of all operations for a given account.

    Query Parameters JSON
    {
      "account": "",
      "start": -1,
      "limit": 1000,
      "reverse_order": false
    }
    
    Expected Response JSON
    {"history": []}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_account_history", "params":{"account":"initminer", "start":1000, "limit":1000}, "id":1}' https://API_URL
    
    curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_account_history", "params":{"account":"initminer", "start":-1, "limit":10000}, "id":1}' https://API_URL
    

    account_history_api.get_ops_in_block

    Returns all operations contained in a block.

    Query Parameters JSON
    {"block_num": 0, "only_virtual": false}
    
    Expected Response JSON
    {"ops": []}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_ops_in_block", "params":{"block_num":1,"only_virtual":false}, "id":1}' https://API_URL
    
    curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_ops_in_block", "params":{"block_num":5443322,"only_virtual":true}, "id":1}' https://API_URL
    

    account_history_api.get_transaction

    Returns the details of a transaction based on a transaction id.

    Query Parameters JSON
    {"id": "0000000000000000000000000000000000000000"}
    
    Expected Response JSON
    {
      "ref_block_num": 0,
      "ref_block_prefix": 0,
      "expiration": "1970-01-01T00:00:00",
      "operations": [],
      "extensions": [],
      "signatures": [],
      "transaction_id": "0000000000000000000000000000000000000000",
      "block_num": 0,
      "transaction_num": 0
    }
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_transaction", "params":{"id":"6fde0190a97835ea6d9e651293e90c89911f933c"}, "id":1}' https://API_URL
    

    Block Api

    List of supported calls:


    Used to query values related to the block plugin. These AppBase API methods are still under development and subject to change.

    block_api.get_block

    Retrieve a full, signed block of the referenced block, or null if no matching block was found.

    Parameters:

    block_num (int)  
    1 Queries the very first block.
    8675309 Queries block number 8,675,309.
    62396745 Queries block number 62,396,745.
    Query Parameters JSON
    {"block_num": 0}
    
    Expected Response JSON
    {}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"block_api.get_block", "params":{"block_num":1}, "id":1}' https://API_URL
    
    curl -s --data '{"jsonrpc":"2.0", "method":"block_api.get_block", "params":{"block_num":8675309}, "id":1}' https://API_URL
    
    curl -s --data '{"jsonrpc":"2.0", "method":"block_api.get_block", "params":{"block_num":62396745}, "id":1}' https://API_URL
    

    block_api.get_block_header

    Retrieve a block header of the referenced block, or null if no matching block was found.

    Parameters:

    block_num (int)  
    1 Queries the block headers for the very first block.
    8675309 Queries block headers for block number 8,675,309.
    62396745 Queries block headers for block number 62,396,745.
    Query Parameters JSON
    {"block_num": 0}
    
    Expected Response JSON
    {}
    
    Example curl
    curl -s --data '{"jsonrpc":"2.0", "method":"block_api.get_block_header", "params":{"block_num":1}, "id":1}' https://API_URL
    
    curl -s --data '{"jsonrpc":"2.0", "method":"block_api.get_block_header", "params":{"block_num":8675309}, "id":1}' https://API_URL
    
    curl -s --data '{"jsonrpc":"2.0", "method":"block_api.get_block_header", "params":{"block_num":62396745}, "id":1}' https://API_URL
    

    Chain Api

    List of supported calls:


    chain_api.push_block

    Query Parameters JSON
    {
      "block": {
        "previous": "0000000000000000000000000000000000000000",
        "timestamp": "1970-01-01T00:00:00",
        "witness": "",
        "transaction_merkle_root": "0000000000000000000000000000000000000000",
        "extensions": [],
        "witness_signature": "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "transactions": []
      },
      "currently_syncing": false
    }
    
    Expected Response JSON
    {"success": false}
    

    chain_api.push_transaction

    Query Parameters JSON
    {
      "ref_block_num": 0,
      "ref_block_prefix": 0,
      "expiration": "1970-01-01T00:00:00",
      "operations": [],
      "extensions": [],
      "signatures": []
    }
    
    Expected Response JSON
    {"success": false}
    

    Custom Api

    List of supported calls:


    custom_api.get_app_custom_messages

    Query Parameters JSON
    {"app_id": 0, "start": 0, "limit": 0}
    
    Expected Response JSON
    []
    

    custom_api.get_received_document

    Query Parameters JSON
    {"id": 0}
    
    Expected Response JSON
    {
      "id": 0,
      "sender": "",
      "recipients": [],
      "app_id": 0,
      "data": "",
      "received": "1970-01-01T00:00:00",
      "binary": true
    }
    

    custom_api.list_received_documents

    Search types:
    by_sender
    by_recipient
    by_sender_datetime
    by_recipient_datetime
    by_sender_reverse
    by_recipient_reverse
    by_sender_datetime_reverse
    by_recipient_datetime_reverse

    Query Parameters JSON
    {
      "app_id": 0,
      "account_name": "",
      "search_type": "",
      "start": "",
      "count": 0
    }
    
    Expected Response JSON
    []
    

    Subscribe Api

    List of supported calls:


    subscribe_api.custom_object_subscription

    Query Parameters JSON
    {
      "return_id": 0,
      "app_id": 0,
      "account_name": "",
      "search_type": "",
      "start": 0
    }
    
    Expected Response JSON
    0