class Lisk::Legacy
Implements raw legacy APIs of the Lisk Core pre-1.0.0 node.
Attributes
Public Class Methods
Public Instance Methods
Returns account information of an address. `GET /accounts?address=address`
# File lib/lisk/legacy.rb, line 55 def accounts address params = { :address => address } account = @client.query_get "accounts", params end
Get votes by account wallet address. `GET /accounts/delegates/?address=address`
# File lib/lisk/legacy.rb, line 303 def accounts_delegates address params = { :address => address } account = @client.query_get "accounts/delegates", params end
Returns delegate vote accounts by address. `GET /accounts/delegates?address=address`
# File lib/lisk/legacy.rb, line 62 def accounts_delegates_get_by_address address params = { :address => address } delegate = @client.query_get "accounts/delegates", params end
Vote for the selected delegates. Maximum of 33 delegates at once. `PUT /accounts/delegates`
# File lib/lisk/legacy.rb, line 69 def accounts_delegates_put votes delegate = @client.query_put "accounts/delegates", votes end
Returns the public key of the provided secret key. `POST /accounts/generatePublicKey`
# File lib/lisk/legacy.rb, line 48 def accounts_generate_public_key secret params = { :secret => secret } public_key = @client.query_post "accounts/generatePublicKey", params end
Request the balance of an account. `GET /accounts/getBalance?address=address`
# File lib/lisk/legacy.rb, line 34 def accounts_get_balance address params = { :address => address } balance = @client.query_get "accounts/getBalance", params end
Get the public key of an account. If the account does not exist the API call will return an error. `GET /accounts/getPublicKey?address=address`
# File lib/lisk/legacy.rb, line 41 def accounts_get_public_key address params = { :address => address } public_key = @client.query_get "accounts/getPublicKey", params end
Request information about an account. `POST /accounts/open`
# File lib/lisk/legacy.rb, line 22 def accounts_open secret params = { :secret => secret } account = @client.query_post "accounts/open", params if account["success"] return account["account"] else return nil end end
Gets all blocks by provided filter(s). `GET /blocks?generatorPublicKey=generatorPublicKey&height=height&previousBlock=previousBlock&totalAmount=totalAmount&totalFee=totalFee&limit=limit&offset=offset&orderBy=orderBy`
# File lib/lisk/legacy.rb, line 167 def blocks filter = nil blocks = @client.query_get "blocks", filter if blocks["success"] return blocks["blocks"] else return nil end end
Gets block by provided id. `GET /blocks/get?id=id`
# File lib/lisk/legacy.rb, line 178 def blocks_get_by_id id params = { :id => id } block = @client.query_get "blocks/get", params end
Get transaction fee for sending “normal” transactions. `GET /blocks/getFee`
# File lib/lisk/legacy.rb, line 185 def blocks_get_fee fee = @client.query_get "blocks/getFee" end
Get transaction fee for all types of transactions. `GET /blocks/getFees`
# File lib/lisk/legacy.rb, line 191 def blocks_get_fees fees = @client.query_get "blocks/getFees" end
Gets the blockchain height of the client. `GET /blocks/getHeight`
# File lib/lisk/legacy.rb, line 209 def blocks_get_height height = @client.query_get "blocks/getHeight" end
Gets the milestone of the blockchain on a client. `GET /blocks/getMilestone`
# File lib/lisk/legacy.rb, line 227 def blocks_get_milestone milestone = @client.query_get "blocks/getMilestone" end
Gets the nethash of the blockchain on a client. `GET /blocks/getNethash`
# File lib/lisk/legacy.rb, line 221 def blocks_get_nethash nethash = @client.query_get "blocks/getNethash" end
Gets the forging reward for blocks. `GET /blocks/getReward`
# File lib/lisk/legacy.rb, line 197 def blocks_get_reward reward = @client.query_get "blocks/getReward" end
Gets status of height, fee, milestone, blockreward and supply. `GET /blocks/getStatus`
# File lib/lisk/legacy.rb, line 215 def blocks_get_status status = @client.query_get "blocks/getStatus" end
Gets the total amount of Lisk in circulation `GET /blocks/getSupply`
# File lib/lisk/legacy.rb, line 203 def blocks_get_supply supply = @client.query_get "blocks/getSupply" end
`GET /dapps?category=category&name=name&type=type&link=link&limit=limit&offset=offset&orderBy=orderBy`
# File lib/lisk/legacy.rb, line 358 def dapps filter todo "#{self}::#{__method__} UNIMPLEMENTED" end
`GET /dapps/categories`
# File lib/lisk/legacy.rb, line 413 def dapps_categories todo "#{self}::#{__method__} UNIMPLEMENTED" end
`GET /dapps/get?id=id`
# File lib/lisk/legacy.rb, line 363 def dapps_get_by_id id todo "#{self}::#{__method__} UNIMPLEMENTED" end
`POST /dapps/install`
# File lib/lisk/legacy.rb, line 373 def dapps_install todo "#{self}::#{__method__} UNIMPLEMENTED" end
`GET /dapps/installed`
# File lib/lisk/legacy.rb, line 378 def dapps_installed todo "#{self}::#{__method__} UNIMPLEMENTED" end
`GET /dapps/installedIds`
# File lib/lisk/legacy.rb, line 383 def dapps_installed_ids todo "#{self}::#{__method__} UNIMPLEMENTED" end
`GET /dapps/installing`
# File lib/lisk/legacy.rb, line 398 def dapps_installing todo "#{self}::#{__method__} UNIMPLEMENTED" end
`POST /dapps/launch`
# File lib/lisk/legacy.rb, line 393 def dapps_launch todo "#{self}::#{__method__} UNIMPLEMENTED" end
`GET /dapps/launched`
# File lib/lisk/legacy.rb, line 408 def dapps_launched todo "#{self}::#{__method__} UNIMPLEMENTED" end
`PUT /dapps`
# File lib/lisk/legacy.rb, line 353 def dapps_put todo "#{self}::#{__method__} UNIMPLEMENTED" end
`GET /dapps/search?q=q&category=category&installed=installed`
# File lib/lisk/legacy.rb, line 368 def dapps_search query todo "#{self}::#{__method__} UNIMPLEMENTED" end
`POST /dapps/stop`
# File lib/lisk/legacy.rb, line 418 def dapps_stop todo "#{self}::#{__method__} UNIMPLEMENTED" end
`POST /dapps/uninstall`
# File lib/lisk/legacy.rb, line 388 def dapps_uninstall todo "#{self}::#{__method__} UNIMPLEMENTED" end
`GET /dapps/uninstalling`
# File lib/lisk/legacy.rb, line 403 def dapps_uninstalling todo "#{self}::#{__method__} UNIMPLEMENTED" end
Gets list of delegates by provided filter. `GET /delegates?limit=limit&offset=offset&orderBy=orderBy`
# File lib/lisk/legacy.rb, line 251 def delegates filter = nil delegates = @client.query_get "delegates", filter if delegates["success"] return delegates["delegates"] else return nil end end
Get total count of registered delegates. `GET /delegates/count`
# File lib/lisk/legacy.rb, line 297 def delegates_count count = @client.query_get "delegates/count" end
Disables forging for a delegate on the client node. `POST /delegates/forging/disable`
# File lib/lisk/legacy.rb, line 329 def delegates_forging_disable secret params = { :secret => secret } count = @client.query_post "delegates/forging/disable", params end
Enables forging for a delegate on the client node. `POST /delegates/forging/enable`
# File lib/lisk/legacy.rb, line 322 def delegates_forging_enable secret params = { :secret => secret } count = @client.query_post "delegates/forging/enable", params end
Get amount of Lisk forged by an account. `GET /delegates/forging/getForgedByAccount?generatorPublicKey=generatorPublicKey`
# File lib/lisk/legacy.rb, line 336 def delegates_forging_get_forged_by_account public_key params = { :generatorPublicKey => public_key } forged = @client.query_get "delegates/forging/getForgedByAccount", params end
Gets delegate by public key. `GET /delegates/get?publicKey=publicKey`
# File lib/lisk/legacy.rb, line 262 def delegates_get_by_key public_key params = { :publicKey => public_key } delegate = @client.query_get "delegates/get", params if delegate["success"] return delegate["delegate"] else return nil end end
Gets delegate by username. `GET /delegates/get?username=username`
# File lib/lisk/legacy.rb, line 274 def delegates_get_by_name user_name params = { :username => user_name } delegate = @client.query_get "delegates/get", params if delegate["success"] return delegate["delegate"] else return nil end end
Get next delegate lining up to forge. `GET /delegates/getNextForgers?limit=limit`
# File lib/lisk/legacy.rb, line 343 def delegates_get_next_forgers limit = 10 params = { :limit => limit } forgers = @client.query_get "delegates/getNextForgers", params end
Puts request to create a delegate. `PUT /delegates`
# File lib/lisk/legacy.rb, line 245 def delegates_put delegate delegate = @client.query_put "delegates", delegate end
Search for Delegates by “fuzzy” username. `GET /delegates/search?q=username&orderBy=producedblocks:desc`
# File lib/lisk/legacy.rb, line 286 def delegates_search query delegates = @client.query_get "delegates/search", query if delegates["success"] return delegates["delegates"] else return nil end end
Gets voters of delegate. `GET /delegates/voters?publicKey=publicKey`
# File lib/lisk/legacy.rb, line 310 def delegates_voters public_key params = { :publicKey => public_key } voters = @client.query_get "delegates/voters", params if voters["success"] return voters["accounts"] else return nil end end
Returns the sync status of the blockchain. `GET /loader/status/sync`
# File lib/lisk/legacy.rb, line 81 def loader_status status = @client.query_get "loader/status" end
Get the status of last received block. Returns true if block was received in the past 120 seconds. `GET /loader/status/ping`
# File lib/lisk/legacy.rb, line 88 def loader_status_ping ping = @client.query_get "loader/status/ping" end
Get the synchronization status of the client. `GET /loader/status`
# File lib/lisk/legacy.rb, line 75 def loader_status_sync sync = @client.query_get "loader/status/sync" end
Handles unimplemented methods
# File lib/lisk/legacy.rb, line 449 def method_missing name, *args, &block todo "#{self}::#{name} METHOD MISSING" end
Gets a list of accounts that belong to a multi-signature account. `GET /multisignatures/accounts?publicKey=publicKey`
# File lib/lisk/legacy.rb, line 430 def multisignatures_accounts public_key params = { :publicKey => public_key } accounts = @client.query_get "multisignatures/accounts", params end
Returns a list of multi-signature transactions that waiting for signature by publicKey. `GET /multisignatures/pending?publicKey=publicKey`
# File lib/lisk/legacy.rb, line 443 def multisignatures_pending public_key params = { :publicKey => public_key } transactions = @client.query_get "multisignatures/pending", params end
Create a multi-signature account. `PUT /multisignatures`
# File lib/lisk/legacy.rb, line 424 def multisignatures_put secrets transaction = @client.query_put "multisignatures", secrets end
Signs a transaction that is awaiting signature. `POST /multisignatures/sign`
# File lib/lisk/legacy.rb, line 437 def multisignatures_sign signature transaction = @client.query_post "multisignatures/sign", signature end
Gets list of peers. `GET /peers?state=state&os=os&version=version&limit=limit&offset=offset&orderBy=orderBy`
# File lib/lisk/legacy.rb, line 144 def peers filter = nil peers = @client.query_get "peers", filter if peers["success"] return peers["peers"] else return nil end end
Gets peer by IP address and port. `GET /peers/get?ip=ip&port=port`
# File lib/lisk/legacy.rb, line 155 def peers_get filter = nil peer = @client.query_get "peers/get", filter end
Gets version and build time. `GET /peers/version`
# File lib/lisk/legacy.rb, line 161 def peers_version version = @client.query_get "peers/version" end
Gets the second signature status of an account. `GET /signatures/fee`
# File lib/lisk/legacy.rb, line 233 def signatures_fee fee = @client.query_get "signatures/fee" end
Add a second signature to an account. `PUT /signatures`
# File lib/lisk/legacy.rb, line 239 def signatures_put secrets transaction = @client.query_put "signatures", secrets end
List of transactions matched by provided parameters. `GET /transactions?blockId=blockId&senderId=senderId&recipientId=recipientId&limit=limit&offset=offset&orderBy=field`
# File lib/lisk/legacy.rb, line 94 def transactions filter = nil transactions = @client.query_get "transactions", filter if transactions["success"] return transactions["transactions"] else return nil end end
Get transaction that matches the provided id. `GET /transactions/get?id=id`
# File lib/lisk/legacy.rb, line 111 def transactions_get_by_id id params = { :id => id } transaction = @client.query_get "transactions/get", params end
Send transaction to broadcast network. `PUT /transactions`
# File lib/lisk/legacy.rb, line 105 def transactions_put transaction transaction = @client.query_put "transactions", transaction end
Gets a list of queued transactions. `GET /transactions/queued`
# File lib/lisk/legacy.rb, line 131 def transactions_queued transaction = @client.query_get "transactions/queued" end
Get queued transaction that matches the provided id. `GET /transactions/queued/get?id=id`
# File lib/lisk/legacy.rb, line 137 def transactions_queued_get_by_id id params = { :id => id } transaction = @client.query_get "transactions/queued/get", params end
Gets a list of unconfirmed transactions. `GET /transactions/unconfirmed`
# File lib/lisk/legacy.rb, line 125 def transactions_unconfirmed transaction = @client.query_get "transactions/unconfirmed" end
Get unconfirmed transaction that matches the provided id. `GET /transactions/unconfirmed/get?id=id`
# File lib/lisk/legacy.rb, line 118 def transactions_unconfirmed_get_by_id id params = { :id => id } transaction = @client.query_get "transactions/unconfirmed/get", params end