Full Code of LiskHQ/lisk-js for AI

master ecf1114006b4 cached
203 files
781.4 KB
216.7k tokens
170 symbols
1 requests
Download .txt
Showing preview only (841K chars total). Download the full file or copy to clipboard to get everything.
Repository: LiskHQ/lisk-js
Branch: master
Commit: ecf1114006b4
Files: 203
Total size: 781.4 KB

Directory structure:
gitextract_nwrllr62/

├── .editorconfig
├── .gitignore
├── .lintstagedrc.json
├── .nvmrc
├── Jenkinsfile
├── Jenkinsfile.nightly
├── LICENSE
├── docs/
│   ├── CODE_OF_CONDUCT.md
│   ├── CONTRIBUTING.md
│   ├── ISSUE_TEMPLATE.md
│   └── PULL_REQUEST_TEMPLATE.md
├── lerna.json
├── package.json
├── packages/
│   ├── lisk-api-client/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── api_client.ts
│   │   │   ├── api_method.ts
│   │   │   ├── api_resource.ts
│   │   │   ├── api_types.ts
│   │   │   ├── constants.ts
│   │   │   ├── errors.ts
│   │   │   ├── index.ts
│   │   │   ├── resources/
│   │   │   │   ├── accounts.ts
│   │   │   │   ├── blocks.ts
│   │   │   │   ├── dapps.ts
│   │   │   │   ├── delegates.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── node.ts
│   │   │   │   ├── peers.ts
│   │   │   │   ├── signatures.ts
│   │   │   │   ├── transactions.ts
│   │   │   │   ├── voters.ts
│   │   │   │   └── votes.ts
│   │   │   └── utils.ts
│   │   └── test/
│   │       ├── _global_hooks.ts
│   │       ├── _setup.ts
│   │       ├── api_client.ts
│   │       ├── api_method.ts
│   │       ├── api_resource.ts
│   │       ├── constants.ts
│   │       ├── errors.ts
│   │       ├── index.ts
│   │       ├── mocha.opts
│   │       ├── resources/
│   │       │   ├── accounts.ts
│   │       │   ├── blocks.ts
│   │       │   ├── dapps.ts
│   │       │   ├── delegates.ts
│   │       │   ├── node.ts
│   │       │   ├── peers.ts
│   │       │   ├── signatures.ts
│   │       │   ├── transactions.ts
│   │       │   ├── voters.ts
│   │       │   └── votes.ts
│   │       └── utils.ts
│   ├── lisk-client/
│   │   ├── README.md
│   │   ├── index.html
│   │   ├── package.json
│   │   ├── scripts/
│   │   │   ├── prestart.sh
│   │   │   └── start.sh
│   │   ├── src/
│   │   │   └── index.ts
│   │   └── test/
│   │       ├── _setup.ts
│   │       └── index.ts
│   ├── lisk-constants/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── package.json
│   │   ├── src/
│   │   │   └── index.ts
│   │   └── test/
│   │       ├── _setup.ts
│   │       └── index.ts
│   ├── lisk-cryptography/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── benchmark/
│   │   │   └── nacl.js
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── buffer.ts
│   │   │   ├── constants.ts
│   │   │   ├── convert.ts
│   │   │   ├── encrypt.ts
│   │   │   ├── hash.ts
│   │   │   ├── index.ts
│   │   │   ├── keys.ts
│   │   │   ├── nacl/
│   │   │   │   ├── fast.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── nacl_types.ts
│   │   │   │   └── slow.ts
│   │   │   └── sign.ts
│   │   ├── test/
│   │   │   ├── _global_hooks.ts
│   │   │   ├── _setup.ts
│   │   │   ├── buffer.ts
│   │   │   ├── convert.ts
│   │   │   ├── encrypt.ts
│   │   │   ├── hash.ts
│   │   │   ├── helpers/
│   │   │   │   └── index.ts
│   │   │   ├── index.ts
│   │   │   ├── keys.ts
│   │   │   ├── mocha.opts
│   │   │   ├── nacl/
│   │   │   │   ├── index.ts
│   │   │   │   └── nacl.ts
│   │   │   ├── sign.ts
│   │   │   └── tsconfig.json
│   │   └── types/
│   │       ├── browserify-bignum/
│   │       │   └── index.d.ts
│   │       ├── buffer-reverse/
│   │       │   └── index.d.ts
│   │       ├── sodium-native/
│   │       │   └── index.d.ts
│   │       └── varuint-bitcoin/
│   │           └── index.d.ts
│   ├── lisk-elements/
│   │   ├── README.md
│   │   ├── index.html
│   │   ├── package.json
│   │   ├── scripts/
│   │   │   ├── prestart.sh
│   │   │   └── start.sh
│   │   ├── src/
│   │   │   └── index.ts
│   │   └── test/
│   │       ├── _setup.ts
│   │       └── index.ts
│   ├── lisk-passphrase/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── index.ts
│   │   │   └── validation.ts
│   │   └── test/
│   │       ├── _setup.ts
│   │       ├── index.ts
│   │       └── validation.ts
│   └── lisk-transactions/
│       ├── LICENSE
│       ├── README.md
│       ├── fixtures/
│       │   ├── invalid_transactions.json
│       │   └── transactions.json
│       ├── package.json
│       ├── src/
│       │   ├── 0_transfer.ts
│       │   ├── 1_register_second_passphrase.ts
│       │   ├── 2_register_delegate.ts
│       │   ├── 3_cast_votes.ts
│       │   ├── 4_register_multisignature_account.ts
│       │   ├── 5_create_dapp.ts
│       │   ├── constants.ts
│       │   ├── create_signature_object.ts
│       │   ├── index.ts
│       │   ├── transaction_types.ts
│       │   └── utils/
│       │       ├── format.ts
│       │       ├── get_address_and_public_key_from_recipient_data.ts
│       │       ├── get_transaction_bytes.ts
│       │       ├── get_transaction_hash.ts
│       │       ├── get_transaction_id.ts
│       │       ├── index.ts
│       │       ├── prepare_transaction.ts
│       │       ├── sign_and_verify.ts
│       │       ├── sign_raw_transaction.ts
│       │       ├── time.ts
│       │       └── validation/
│       │           ├── index.ts
│       │           ├── schema.ts
│       │           ├── validate_transaction.ts
│       │           ├── validation.ts
│       │           └── validator.ts
│       ├── test/
│       │   ├── 0_transfer.ts
│       │   ├── 1_register_second_passphrase.ts
│       │   ├── 2_register_delegate.ts
│       │   ├── 3_cast_votes.ts
│       │   ├── 4_register_multisignature_account.ts
│       │   ├── 5_create_dapp.ts
│       │   ├── _global_hooks.ts
│       │   ├── _setup.ts
│       │   ├── constants.ts
│       │   ├── create_signature_object.ts
│       │   ├── index.ts
│       │   ├── mocha.opts
│       │   ├── tsconfig.json
│       │   └── utils/
│       │       ├── format.ts
│       │       ├── get_transaction_bytes.ts
│       │       ├── get_transaction_hash.ts
│       │       ├── get_transaction_id.ts
│       │       ├── index.ts
│       │       ├── prepare_transaction.ts
│       │       ├── sign_and_verify.ts
│       │       ├── sign_raw_transaction.ts
│       │       ├── time.ts
│       │       └── validation/
│       │           ├── validate_transaction.ts
│       │           ├── validation.ts
│       │           └── validator.ts
│       └── types/
│           ├── ajv-merge-patch/
│           │   └── index.d.ts
│           └── browserify-bignum/
│               └── index.d.ts
├── scripts/
│   └── init.sh
├── templates/
│   ├── .npmignore.tmpl
│   ├── .npmrc.tmpl
│   ├── .nycrc-ts.tmpl
│   ├── .prettierignore.tmpl
│   ├── .prettierrc.json.tmpl
│   ├── browsertest.tmpl/
│   │   ├── .eslintrc.json
│   │   ├── browsertest.html
│   │   ├── browsertest.min.html
│   │   ├── run_tests.js
│   │   └── setup.js
│   ├── cypress.json.tmpl
│   ├── cypress.tmpl/
│   │   └── integration/
│   │       └── index.js
│   ├── mocha.opts.ts.tmpl
│   ├── scripts.tmpl/
│   │   └── clean.sh
│   ├── tsconfig-test.json.tmpl
│   ├── tsconfig.browsertest.json.tmpl
│   ├── tsconfig.json.tmpl
│   ├── tslint-test.json.tmpl
│   └── tslint.json.tmpl
├── tsconfig.json
├── tslint.json
├── tslint.test.json
└── types/
    ├── chai/
    │   └── index.d.ts
    ├── globals/
    │   └── index.d.ts
    └── json/
        └── index.d.ts

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true


================================================
FILE: .gitignore
================================================
# General
.DS_Store
*.swp
*.orig

# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
test/.coverage-unit

# nyc test coverage
.nyc_output

# cypress media
templates/cypress.tmpl/screenshots/
templates/cypress.tmpl/videos/
templates/cypress.tmpl/plugins/
templates/cypress.tmpl/support/
cypress/screenshots
cypress/videos
cypress/plugins

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# IDE directories
.idea
tmp
.vscode

# Distribution folders
dist-node/
dist-browser/
browsertest.build/
browsertest/package.json
browsertest/browsertest.js
browsertest/browsertest.min.js
browsertest/src
browsertest/test

# Unsupported lock files
yarn.lock


================================================
FILE: .lintstagedrc.json
================================================
{
	"*.{ts,js}": ["prettier --write", "git add"]
}


================================================
FILE: .nvmrc
================================================
8.12.0


================================================
FILE: Jenkinsfile
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
@Library('lisk-jenkins') _
pipeline {
	agent { node { label 'lisk-elements' } }
	stages {
		stage('Cancel previous running PR') {
			steps {
				script{
					if (env.CHANGE_ID) {
						// This is a Pull Request
						cancelPreviousBuild()
					}
				}
			}
		}
		stage('Install dependencies') {
			steps {
				script {
					cache_file = restoreCache("package.json")
				}
				nvm(getNodejsVersion()) {
					sh 'npm install --verbose'
				}
				script {
					saveCache(cache_file, './node_modules', 10)
					sh '''
					if [ ! -f "/home/lisk/.cache/Cypress/$(jq -r .devDependencies.cypress ./packages/lisk-constants/package.json)/Cypress/Cypress" ]; then
						./packages/lisk-constants/node_modules/.bin/cypress install --force
					fi
					'''
				}
			}
		}
		stage('Build') {
			steps {
				nvm(getNodejsVersion()) {
					sh 'npm run build'
				}
			}
		}
		stage('Run lint') {
			steps {
				ansiColor('xterm') {
					nvm(getNodejsVersion()) {
						sh 'npm run lint'
					}
				}
			}
		}
		stage('Run tests') {
			steps {
				ansiColor('xterm') {
					nvm(getNodejsVersion()) {
						sh 'npm run test'
					}
				}
			}
		}
		stage('Run node tests') {
			steps {
				ansiColor('xterm') {
					nvm(getNodejsVersion()) {
						sh 'npm run test:node'
					}
				}
			}
		}
		stage('Run browser tests') {
			steps {
				nvm(getNodejsVersion()) {
					sh '''
					npm run build:browsertest
					npm run test:browser
					'''
				}
			}
		}
	}
	post {
		success {
			script {
				build_info = getBuildInfo()
				liskSlackSend('good', "Recovery: build ${build_info} was successful.")
			}
			deleteDir()
			githubNotify context: 'continuous-integration/jenkins/lisk-elements', description: 'The build passed.', status: 'SUCCESS'
		}
		failure {
			script {
				build_info = getBuildInfo()
				liskSlackSend('danger', "Build ${build_info} failed (<${env.BUILD_URL}/console|console>, <${env.BUILD_URL}/changes|changes>)\n")
			}
			archiveArtifacts allowEmptyArchive: true, artifacts: 'cypress/screenshots/'
			githubNotify context: 'continuous-integration/jenkins/lisk-elements', description: 'The build failed.', status: 'FAILURE'
		}
		aborted {
			githubNotify context: 'continuous-integration/jenkins/lisk-elements', description: 'The build was aborted.', status: 'ERROR'
		}
	}
}


================================================
FILE: Jenkinsfile.nightly
================================================
pipeline {
	agent { node { label 'lisk-elements' } }
	stages {
		stage('Cache dependencies') {
			steps {
				nvm(getNodejsVersion()) {
					sh 'npm install --verbose'
				}
				script {
					sh '''
					BRANCH=${CHANGE_TARGET:-${BRANCH_NAME:-development}}
					if [ ! -d ~/cache/$BRANCH ]; then
						mkdir ~/cache/$BRANCH
					fi
					rsync -axl --delete ./node_modules ~/cache/$BRANCH/
					'''
				}
			}
		}
	}
	post {
		success {
			deleteDir()
		}
	}
}


================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    {one line to give the program's name and a brief idea of what it does.}
    Copyright (C) {year}  {name of author}

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    {project}  Copyright (C) {year}  {fullname}
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.


================================================
FILE: docs/CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
  advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
  address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
  professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [info@lisk.io](mailto:info@lisk.io). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct/

[homepage]: https://www.contributor-covenant.org


================================================
FILE: docs/CONTRIBUTING.md
================================================
# Contributing to Lisk Elements

First off, thanks for taking the time to contribute! :raised_hands:

The following is a set of guidelines for contributing to Lisk Elements, which are hosted in the [LiskHQ Organization](https://github.com/LiskHQ) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.

#### Table Of Contents

1. [Code of Conduct](#code-of-conduct)

1. [Help! I don't want to read this whole thing, I just have one question. :mag_right:](#help!-i-dont-want-to-read-this-whole-thing-i-just-have-a-question)

1. [How Can I Contribute?](#how-can-i-contribute)
	1. [Reporting Bugs](#reporting-bugs)
	1. [Suggesting Enhancements](#suggesting-enhancements)
	1. [Pull Requests](#pull-requests)

1. [Styleguides](#styleguides)
	1. [Git Commit Messages](#git-commit-messages)
	1. [JavaScript Styleguide](#javascript-styleguide)

## Code of Conduct

This project and everyone participating in it is governed by the [Lisk Elements Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [info@lisk.io](mailto:info@lisk.io).

## Project License

Every repository within LiskHQ comes with a LICENSE file. Please read it carefully before commiting your code to one of the repositories.


## Help! I don't want to read this whole thing, I just have a question. :mag_right:

Lisk is an open-source decentralized project, there are many ways and platforms to get help. These are some of them:

* [Discuss and Ask on Reddit](https://www.reddit.com/r/Lisk/)
* [Lisk FAQ](https://docs.lisk.io/docs/faq)

If you prefer to chat with LiskHQ and other developers directly:

* [Join the LiskHQ Gitter](https://gitter.im/LiskHQ/lisk)
* Even though Gitter is a chat service, sometimes it takes several hours for community members to respond &mdash; please be patient!

## How Can I Contribute?

LiskHQ uses GitHub as its sole source of truth. Everything happens here. Lightcurve employees who contribute to Lisk are expected to do so in the same way as everyone else. In other words, this document applies equally to all contributors.

### `master` is unsafe for production use

We will do our best to keep `master` in good shape, with tests passing at all times. But in order to move fast, we will make API changes that your application might not be compatible with. We will do our best to communicate these changes and always version appropriately so you can lock into a specific, stable version.

### Pull Requests

Broadly speaking, we conform to the git flow branching model. For a description of this model, see [this introduction](https://datasift.github.io/gitflow/IntroducingGitFlow.html).

In case you've never submitted a pull request (PR) via GitHub before, please read [this short tutorial](https://help.github.com/articles/creating-a-pull-request). If you've submitted a PR before, there should be nothing surprising about our procedures for Lisk.

*Before* submitting a pull request, please make sure the following is done:

1. Fork the repo.
1. If you are creating a pull request that addresses a specific issue, take a look at the projects that issue is a part of (in the right-hand sidebar). Most issues will be a part of a project for a specific version, such as "Version 1.0.0". If this is the case, create your branch from the relevant version branch, e.g. `1.0.0`, and submit your pull request against that branch as a base. Otherwise, create your branch from master.
1. Add tests to the code you have contributed! All new code must come with complete test coverage. End all files with a newline. In general, your code should conform to the rules listed in the .editorconfig file. There are plugins for most editors/IDEs to do this for you automatically. Update the README for the changes that adhere to your new code.
1. Ensure the test and linting suite passes (`npm run prepush` runs both). Follow the JavaScript styleguide from Airbnb with the lisk extension.
1. Submit a pull request via GitHub. Include issue numbers in the PR title, at the end with: Description - Closes #IssueNumber. Also mention the #IssueNumber in the Comment, to easier browse to the issue.
1. Check that Jenkins CI tests pass (pull request turns green). First time contributors will need to wait for a trusted team member to start Jenkins CI on a Pull Request.

### Reporting Bugs

This section guides you through submitting a bug report for Lisk Elements. Following these guidelines helps maintainers and the community understand your report :pencil:, reproduce the behavior :computer: :computer:, and find related reports :mag_right:.

Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](ISSUE_TEMPLATE.md), the information it asks for helps us resolve issues faster.

> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.

#### Before Submitting A Bug Report

* **Check the [FAQs](https://docs.lisk.io/docs/faq)** for a list of common questions and problems.
* **Determine [which repository the problem should be reported in](https://github.com/LiskHQ)**.
* **Perform a [cursory search](https://github.com/search?utf8=%E2%9C%93&q=+is%3Aissue+org%3ALiskHQ&type=)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.

#### How Do I Submit A (Good) Bug Report?

Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined [which repository](https://github.com/LiskHQ) your bug is related to, create an issue on that repository and provide the following information by filling in [the template](ISSUE_TEMPLATE.md).

Explain the problem and include additional details to help maintainers reproduce the problem:

* **Use a clear and descriptive title** for the issue to identify the problem.
* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you started Lisk Elements, e.g. with Node.js or in the Browser (which one? which version?), or how you started Lisk Elements otherwise. When listing steps, **don't just say what you did, but explain how you did it**. For example, if you have used an API model provide the configuration you have chosen and the functions you have executed. **Make sure to erase sensitive information from the configuration or details you are passing - NEVER SHARE YOUR SECRET PASSPHRASES OR PRIVATE KEYS**.
* **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
* **Explain which behavior you expected to see instead and why.**
* **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem. You can use [this tool](http://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
* **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.

Provide more context by answering these questions:

* **Did the problem start happening recently** (e.g. after updating to a new version of Lisk Elements, Lisk or any other repository) or was this always a problem?
* If the problem started happening recently, **can you reproduce the problem in an older version of Lisk Elements?** What's the most recent version in which the problem doesn't happen? You can download older versions of Lisk Elements from [the releases page](https://github.com/LiskHQ/lisk-elements/releases).
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.

### Suggesting Enhancements

This section guides you through submitting an enhancement suggestion for Lisk Elements, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion :pencil: and find related suggestions :mag_right:.

 When you are creating an enhancement suggestion, please include as many details as possible. Fill in [the template](ISSUE_TEMPLATE.md), including the steps that you imagine you would take if the feature you're requesting existed.

#### How Do I Submit A (Good) Enhancement Suggestion?

Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined [which repository](https://github.com/LiskHQ) your enhancement suggestion is related to, create an issue on that repository and provide the following information:

* **Use a clear and descriptive title** for the issue to identify the suggestion.
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
* **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
* **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of Lisk Elements which the suggestion is related to. You can use [this tool](http://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
* **Explain why this enhancement would be useful** to most Lisk and Lisk Elements users.
* **Specify which version of Lisk and Lisk Elements you're using.**
* **Specify the name and version of the OS you're using.**

## Styleguides

### Git Commit Messages

* Use the present tense ("Add feature" not "Added feature")
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
* Limit the first line to 72 characters or less
* Reference issues and pull requests liberally after the first line
* Consider starting the commit message with an applicable emoji:
	* :seedling: `:seedling:` when adding a new feature
	* :bug: `:bug:` when fixing a bug
	* :books: `:books:` when adding or updating documentation
	* :nail_care: `:nail_care:` when making changes to code style (e.g. lint settings)
	* :recycle: `:recycle:` when refactoring code
	* :fire: `:fire:` when removing code or files (including dependencies)
	* :racehorse: `:racehorse:` when improving performance
	* :white_check_mark: `:white_check_mark:` when adding or updating tests
	* :construction_worker: `:construction_worker:` when updating the build process
	* :bowtie: `:bowtie:` when updating CI
	* :house: `:house:` when performing chores
	* :new: `:new:` when adding a new dependency
	* :arrow_up: `:arrow_up:` when upgrading a dependency
	* :arrow_down: `:arrow_down:` when downgrading a dependency
	* :back: `:back:` when reverting changes

### JavaScript Styleguide

On Lisk Elements we are using [ESLint](https://eslint.org/).
Our JavaScript style expands [Airbnb's](https://github.com/airbnb/javascript) style. You can get more details here: https://github.com/LiskHQ/eslint-config-lisk-base

These contribution guidelines were inspired by and are based on Atom's contribution guidelines. They were modified for the purposes of this repository. https://github.com/atom/atom/blob/master/CONTRIBUTING.md - Copyright (c) 2011-2017 GitHub Inc. (MIT)


================================================
FILE: docs/ISSUE_TEMPLATE.md
================================================
### Expected behavior

### Actual behavior

### Steps to reproduce

### Which version(s) does this affect? (Environment, OS, etc...)


================================================
FILE: docs/PULL_REQUEST_TEMPLATE.md
================================================
### What was the problem?

### How did I fix it?

### How to test it?

### Review checklist

* The PR resolves #INSERT_ISSUE_NUMBER
* All new code is covered with unit tests
* All new code was formatted with Prettier
* Linting passes
* Tests pass
* Commit messages follow the [commit guidelines](CONTRIBUTING.md#git-commit-messages)
* Documentation has been added/updated


================================================
FILE: lerna.json
================================================
{
	"lerna": "2.11.0",
	"packages": ["packages/*"],
	"version": "independent",
	"stream": true
}


================================================
FILE: package.json
================================================
{
	"name": "lisk-elements-monorepo",
	"private": true,
	"version": "1.0.0",
	"description": "Reusable packages for use with the Lisk ecosystem",
	"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
	"license": "GPL-3.0",
	"keywords": [
		"lisk",
		"blockchain"
	],
	"homepage": "https://github.com/LiskHQ/lisk-elements#readme",
	"repository": {
		"type": "git",
		"url": "git+https://github.com/LiskHQ/lisk-elements.git"
	},
	"bugs": {
		"url": "https://github.com/LiskHQ/lisk-elements/issues"
	},
	"engines": {
		"node": ">=8.10 <=10",
		"npm": ">=3 <=6"
	},
	"scripts": {
		"bootstrap": "lerna bootstrap",
		"clean": "lerna run clean",
		"clean:node_modules": "lerna clean --yes",
		"format": "npm run format:root && lerna run format",
		"format:root": "prettier types/**/*.ts --write",
		"lint": "npm run lint:root && lerna run lint",
		"lint:fix": "npm run lint:root -- --fix && lerna run lint:fix",
		"lint:root": "tslint -p tsconfig.json types/**/*.ts",
		"test": "lerna run test",
		"test:node": "lerna run test:node",
		"test:browser": "lerna run test:browser",
		"build": "lerna run build",
		"build:browsertest": "lerna run build:browsertest",
		"cover": "lerna run cover",
		"init": "./scripts/init.sh",
		"postinstall": "npm run bootstrap",
		"precommit": "lint-staged && npm run lint",
		"prepush": "npm run lint && npm test"
	},
	"devDependencies": {
		"@types/node": "10.12.0",
		"@types/sinon": "5.0.5",
		"husky": "0.14.3",
		"lerna": "3.4.1",
		"lint-staged": "7.3.0",
		"prettier": "1.14.2",
		"tslint": "5.11.0",
		"tslint-config-prettier": "1.15.0",
		"tslint-immutable": "4.7.0",
		"typescript": "3.1.1"
	},
	"dependencies": {}
}


================================================
FILE: packages/lisk-api-client/LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    {one line to give the program's name and a brief idea of what it does.}
    Copyright (C) {year}  {name of author}

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    {project}  Copyright (C) {year}  {fullname}
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.


================================================
FILE: packages/lisk-api-client/README.md
================================================
# @liskhq/lisk-api-client
@liskhq/lisk-api-client is containing an API client for the Lisk network

## Installation

```sh
$ npm install --save @liskhq/lisk-api-client
```

## License

Copyright © 2016-2018 Lisk Foundation

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the [GNU General Public License](https://github.com/LiskHQ/lisk-elements/tree/master/LICENSE) along with this program.  If not, see <http://www.gnu.org/licenses/>.

***

This program also incorporates work previously released with lisk-js `v0.5.2` (and earlier) versions under the [MIT License](https://opensource.org/licenses/MIT). To comply with the requirements of that license, the following permission notice, applicable to those parts of the code only, is included below:

Copyright © 2016-2017 Lisk Foundation

Copyright © 2015 Crypti

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


[Lisk Core GitHub]: https://github.com/LiskHQ/lisk
[Lisk documentation site]: https://lisk.io/documentation/lisk-elements


================================================
FILE: packages/lisk-api-client/package.json
================================================
{
	"name": "@liskhq/lisk-api-client",
	"version": "2.0.0",
	"description": "An API client for the Lisk network",
	"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
	"license": "GPL-3.0",
	"keywords": [
		"lisk",
		"blockchain"
	],
	"homepage": "https://github.com/LiskHQ/lisk-elements/tree/master/packages/lisk-api-client#readme",
	"repository": {
		"type": "git",
		"url": "git+https://github.com/LiskHQ/lisk-elements.git"
	},
	"bugs": {
		"url": "https://github.com/LiskHQ/lisk-elements/issues"
	},
	"engines": {
		"node": ">=8.10 <=10",
		"npm": ">=5"
	},
	"main": "dist-node/index.js",
	"scripts": {
		"transpile": "tsc",
		"transpile:browsertest": "tsc -p tsconfig.browsertest.json",
		"browserify": "browserify ./dist-node/index.js -o ./dist-browser/index.js -s liskAPIClient",
		"browserify:browsertest": "browserify ./browsertest.build/test/*.js ./browsertest.build/test/**/*.js -o ./browsertest.build/browsertest.js -s liskAPIClient",
		"uglify": "uglifyjs -nm -o ./dist-browser/index.min.js ./dist-browser/index.js",
		"uglify:browsertest": "uglifyjs -o ./browsertest.build/browsertest.min.js ./browsertest.build/browsertest.js",
		"clean": "./scripts/clean.sh",
		"format": "prettier --write \"*.{ts,js,json}\" \"{src,test}/**/*.{ts,js,json}\"",
		"lint": "tslint --format verbose --project .",
		"lint:fix": "npm run lint -- --fix",
		"test": "TS_NODE_PROJECT=./test/tsconfig.json nyc mocha test/{,/**/}/*.ts",
		"test:watch": "npm test -- --watch",
		"test:watch:min": "npm run test:watch -- --reporter=min",
		"test:node": "npm run build:check",
		"serve:start": "http-server -p 11541 ./browsertest &",
		"serve:stop": "kill $(lsof -t -i:11541) || true",
		"pretest:browser": "npm run serve:stop && npm run build:browsertest && npm run serve:start",
		"test:browser": "wait-on http://localhost:11541 && cypress run --config baseUrl=http://localhost:11541 --env ROOT_DIR=\"${PWD##*/}\"",
		"posttest:browser": "npm run serve:stop",
		"cover": "if [ -z $JENKINS_HOME ]; then npm run cover:local; else npm run cover:ci; fi",
		"cover:base": "nyc report",
		"cover:local": "npm run cover:base -- --reporter=html --reporter=text",
		"cover:ci": "npm run cover:base -- --reporter=text",
		"build:browsertest": "npm run transpile:browsertest && npm run browserify:browsertest && npm run uglify:browsertest",
		"postbuild:browsertest": "rm -r browsertest.build/src browsertest.build/test",
		"prebuild:node": "rm -r dist-node/* || mkdir dist-node || true",
		"build:node": "npm run transpile",
		"prebuild:browser": "rm ./dist-browser/index.js ./dist-browser/index.min.js || true",
		"build:browser": "npm run build:node && npm run browserify && npm run uglify",
		"prebuild": "npm run prebuild:browser",
		"build": "npm run build:browser",
		"build:check": "node -e \"require('./dist-node')\"",
		"prepublishOnly": "npm run lint && npm test && npm run build && npm run build:check"
	},
	"dependencies": {
		"@types/node": "10.10.1",
		"@types/verror": "1.10.3",
		"axios": "0.18.0",
		"verror": "1.10.0"
	},
	"devDependencies": {
		"@types/chai": "4.1.5",
		"@types/chai-as-promised": "7.1.0",
		"@types/expect": "1.20.3",
		"@types/jquery": "3.3.9",
		"@types/mocha": "5.2.5",
		"@types/sinon": "5.0.5",
		"@types/sinon-chai": "3.2.0",
		"browserify": "16.2.2",
		"chai": "4.1.2",
		"chai-as-promised": "7.1.1",
		"cypress": "3.1.0",
		"http-server": "0.11.1",
		"mocha": "5.2.0",
		"nyc": "13.0.1",
		"prettier": "1.14.2",
		"sinon": "6.2.0",
		"sinon-chai": "3.2.0",
		"source-map-support": "0.5.9",
		"ts-node": "7.0.1",
		"tsconfig-paths": "3.6.0",
		"tslint": "5.11.0",
		"tslint-config-prettier": "1.15.0",
		"tslint-immutable": "4.7.0",
		"typescript": "3.0.3",
		"uglify-es": "3.3.9",
		"wait-on": "3.0.1"
	}
}


================================================
FILE: packages/lisk-api-client/src/api_client.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import * as os from 'os';
import { HashMap, InitOptions } from './api_types';
import * as constants from './constants';
import { AccountsResource } from './resources/accounts';
import { BlocksResource } from './resources/blocks';
import { DappsResource } from './resources/dapps';
import { DelegatesResource } from './resources/delegates';
import { NodeResource } from './resources/node';
import { PeersResource } from './resources/peers';
import { SignaturesResource } from './resources/signatures';
import { TransactionsResource } from './resources/transactions';
import { VotersResource } from './resources/voters';
import { VotesResource } from './resources/votes';

const defaultOptions = {
	bannedNodes: [],
	randomizeNodes: true,
};

const commonHeaders: HashMap = {
	Accept: 'application/json',
	'Content-Type': 'application/json',
};

const getClientHeaders = (clientOptions: ClientOptions): HashMap => {
	const { name = '????', version = '????', engine = '????' } = clientOptions;

	const liskElementsInformation =
		'LiskElements/1.0 (+https://github.com/LiskHQ/lisk-elements)';
	const locale: string | undefined =
		process.env.LC_ALL ||
		process.env.LC_MESSAGES ||
		process.env.LANG ||
		process.env.LANGUAGE;
	const systemInformation = `${os.platform()} ${os.release()}; ${os.arch()}${
		locale ? `; ${locale}` : ''
	}`;

	return {
		'User-Agent': `${name}/${version} (${engine}) ${liskElementsInformation} ${systemInformation}`,
	};
};

export interface ClientOptions {
	readonly engine?: string;
	readonly name?: string;
	readonly version?: string;
}

export class APIClient {
	public static get constants(): typeof constants {
		return constants;
	}

	public static createMainnetAPIClient(options?: InitOptions): APIClient {
		return new APIClient(constants.MAINNET_NODES, {
			nethash: constants.MAINNET_NETHASH,
			...options,
		});
	}

	public static createTestnetAPIClient(options?: InitOptions): APIClient {
		return new APIClient(constants.TESTNET_NODES, {
			nethash: constants.TESTNET_NETHASH,
			...options,
		});
	}

	public accounts: AccountsResource;
	public bannedNodes!: ReadonlyArray<string>;
	public blocks: BlocksResource;
	public currentNode!: string;
	public dapps: DappsResource;
	public delegates: DelegatesResource;
	public headers!: HashMap;
	public node: NodeResource;
	public nodes!: ReadonlyArray<string>;
	public peers: PeersResource;
	public randomizeNodes!: boolean;
	public signatures: SignaturesResource;
	public transactions: TransactionsResource;
	public voters: VotersResource;
	public votes: VotesResource;

	public constructor(
		nodes: ReadonlyArray<string>,
		providedOptions: InitOptions = {},
	) {
		this.initialize(nodes, providedOptions);
		this.accounts = new AccountsResource(this);
		this.blocks = new BlocksResource(this);
		this.dapps = new DappsResource(this);
		this.delegates = new DelegatesResource(this);
		this.node = new NodeResource(this);
		this.peers = new PeersResource(this);
		this.signatures = new SignaturesResource(this);
		this.transactions = new TransactionsResource(this);
		this.voters = new VotersResource(this);
		this.votes = new VotesResource(this);
	}

	public banActiveNode(): boolean {
		return this.banNode(this.currentNode);
	}

	public banActiveNodeAndSelect(): boolean {
		const banned = this.banActiveNode();
		if (banned) {
			this.currentNode = this.getNewNode();
		}

		return banned;
	}

	public banNode(node: string): boolean {
		if (!this.isBanned(node)) {
			this.bannedNodes = [...this.bannedNodes, node];

			return true;
		}

		return false;
	}

	public getNewNode(): string {
		const nodes = this.nodes.filter(
			(node: string): boolean => !this.isBanned(node),
		);

		if (nodes.length === 0) {
			throw new Error('Cannot get new node: all nodes have been banned.');
		}

		const randomIndex = Math.floor(Math.random() * nodes.length);

		return nodes[randomIndex];
	}

	public hasAvailableNodes(): boolean {
		return this.nodes.some((node: string): boolean => !this.isBanned(node));
	}

	public initialize(
		nodes: ReadonlyArray<string>,
		providedOptions: InitOptions = {},
	): void {
		if (!Array.isArray(nodes) || nodes.length <= 0) {
			throw new Error('APIClient requires nodes for initialization.');
		}

		if (typeof providedOptions !== 'object' || Array.isArray(providedOptions)) {
			throw new Error(
				'APIClient takes an optional object as the second parameter.',
			);
		}

		const options: InitOptions = { ...defaultOptions, ...providedOptions };

		this.headers = {
			...commonHeaders,
			...(options.nethash ? { nethash: options.nethash } : {}),
			...(options.client ? getClientHeaders(options.client) : {}),
		};

		this.nodes = nodes;
		this.bannedNodes = [...(options.bannedNodes || [])];
		this.currentNode = options.node || this.getNewNode();
		this.randomizeNodes = options.randomizeNodes !== false;
	}

	public isBanned(node: string): boolean {
		return this.bannedNodes.includes(node);
	}
}


================================================
FILE: packages/lisk-api-client/src/api_method.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { AxiosRequestConfig } from 'axios';
import {
	APIHandler,
	APIResponse,
	HashMap,
	RequestConfig,
	Resource,
} from './api_types';
import { GET } from './constants';
import { solveURLParams, toQueryString } from './utils';

// Bind to resource class
export const apiMethod = (options: RequestConfig = {}): APIHandler =>
	async function apiHandler(
		this: Resource,
		// tslint:disable-next-line readonly-array
		...args: Array<number | string | object>
	): Promise<APIResponse> {
		const {
			method = GET,
			path = '',
			urlParams = [],
			validator,
			defaultData = {},
			retry = false,
		} = options;

		if (urlParams.length > 0 && args.length < urlParams.length) {
			return Promise.reject(
				new Error(
					`This endpoint must be supplied with the following parameters: ${urlParams.toString()}`,
				),
			);
		}

		const data = {
			...defaultData,
			...(args.length > urlParams.length &&
			typeof args[urlParams.length] === 'object'
				? (args[urlParams.length] as object)
				: {}),
		};

		if (validator) {
			try {
				validator(data);
			} catch (err) {
				return Promise.reject(err);
			}
		}

		const resolvedURLObject = urlParams.reduce(
			// tslint:disable-next-line no-inferred-empty-object-type
			(accumulator: HashMap, param: string, i: number): HashMap => {
				const value = args[i];
				if (typeof value !== 'string' && typeof value !== 'number') {
					throw new Error('Parameter must be a string or a number');
				}

				return {
					...accumulator,
					[param]: typeof value === 'number' ? value.toString() : value,
				};
			},
			{},
		);

		const requestData: AxiosRequestConfig = {
			headers: this.headers,
			method,
			url: solveURLParams(`${this.resourcePath}${path}`, resolvedURLObject),
		};

		if (Object.keys(data).length > 0) {
			if (method === GET) {
				requestData.url += `?${toQueryString(data)}`;
			} else {
				requestData.data = data;
			}
		}

		return this.request(requestData, retry);
	};


================================================
FILE: packages/lisk-api-client/src/api_resource.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import Axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
import { APIClient } from './api_client';
import { APIErrorResponse, APIResponse, HashMap } from './api_types';
import { APIError } from './errors';

const API_RECONNECT_MAX_RETRY_COUNT = 3;

const REQUEST_RETRY_TIMEOUT = 1000;

export class APIResource {
	public apiClient: APIClient;
	public path: string;

	public constructor(apiClient: APIClient) {
		this.apiClient = apiClient;
		this.path = '';
	}

	public get headers(): HashMap {
		return this.apiClient.headers;
	}

	public get resourcePath(): string {
		return `${this.apiClient.currentNode}/api${this.path}`;
	}

	public async handleRetry(
		error: Error,
		req: AxiosRequestConfig,
		retryCount: number,
	): Promise<APIResponse> {
		if (this.apiClient.hasAvailableNodes()) {
			return new Promise<APIResponse>(resolve =>
				setTimeout(resolve, REQUEST_RETRY_TIMEOUT),
			).then(
				async (): Promise<APIResponse> => {
					if (retryCount > API_RECONNECT_MAX_RETRY_COUNT) {
						throw error;
					}
					if (this.apiClient.randomizeNodes) {
						this.apiClient.banActiveNodeAndSelect();
					}

					return this.request(req, true, retryCount + 1);
				},
			);
		}

		return Promise.reject(error);
	}

	public async request(
		req: AxiosRequestConfig,
		retry: boolean,
		retryCount: number = 1,
	): Promise<APIResponse> {
		const request = Axios.request(req)
			.then((res: AxiosResponse) => res.data)
			.catch(
				(error: AxiosError): void => {
					if (error.response) {
						const { status } = error.response;
						if (error.response.data) {
							const {
								error: errorString,
								errors,
								message,
							}: APIErrorResponse = error.response.data;
							throw new APIError(
								message || errorString || 'An unknown error has occurred.',
								status,
								errors,
							);
						}
						throw new APIError('An unknown error has occurred.', status);
					}
					throw error;
				},
			);

		if (retry) {
			return request.catch(async (err: Error) =>
				this.handleRetry(err, req, retryCount),
			);
		}

		return request;
	}
}


================================================
FILE: packages/lisk-api-client/src/api_types.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
/* tslint:disable no-mixed-interface */
export type APIHandler = (
	// tslint:disable-next-line readonly-array
	...args: Array<number | string | object>
) => Promise<APIResponse>;

export interface APIResponse {
	readonly data: unknown;
	readonly links: object;
	readonly meta: object;
}

export interface APIErrorResponse {
	readonly error?: string;
	readonly errors?: ReadonlyArray<APIErrorContents>;
	readonly message?: string;
}

export interface APIErrorContents {
	readonly code?: string;
	readonly message?: string;
}

export interface HashMap {
	readonly [key: string]: string;
}

export interface InitOptions {
	readonly bannedNodes?: ReadonlyArray<string>;
	readonly client?: object;
	readonly nethash?: string;
	readonly node?: string;
	readonly randomizeNodes?: boolean;
}

export interface RequestConfig {
	readonly defaultData?: object;
	readonly method?: string;
	readonly path?: string;
	readonly retry?: boolean;
	readonly urlParams?: ReadonlyArray<string>;
	readonly validator?: (data: { readonly needed?: string }) => void;
}

export interface Resource {
	readonly headers: HashMap;
	readonly path: string;
	readonly request: (data: object, retry: boolean) => Promise<APIResponse>;
	readonly resourcePath: string;
}


================================================
FILE: packages/lisk-api-client/src/constants.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
export const GET = 'GET';
export const POST = 'POST';
export const PUT = 'PUT';

export const TESTNET_NETHASH =
	'da3ed6a45429278bac2666961289ca17ad86595d33b31037615d4b8e8f158bba';
export const MAINNET_NETHASH =
	'ed14889723f24ecc54871d058d98ce91ff2f973192075c0155ba2b7b70ad2511';

export const TESTNET_NODES: ReadonlyArray<string> = [
	'https://testnet.lisk.io:443',
];
export const MAINNET_NODES: ReadonlyArray<string> = [
	'https://node01.lisk.io:443',
	'https://node02.lisk.io:443',
	'https://node03.lisk.io:443',
	'https://node04.lisk.io:443',
	'https://node05.lisk.io:443',
	'https://node06.lisk.io:443',
	'https://node07.lisk.io:443',
	'https://node08.lisk.io:443',
];


================================================
FILE: packages/lisk-api-client/src/errors.ts
================================================
import { VError } from 'verror';

const defaultErrorNo = 500;

export interface APIErrorData {
	readonly code?: string;
	readonly message?: string;
}

export class APIError extends VError {
	public errno: number;
	public errors?: ReadonlyArray<APIErrorData>;

	public constructor(
		message: string = '',
		errno: number = defaultErrorNo,
		errors?: ReadonlyArray<APIErrorData>,
	) {
		super(message);
		this.name = 'APIError';
		this.errno = errno;
		this.errors = errors;
	}
}


================================================
FILE: packages/lisk-api-client/src/index.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
export * from './api_client';


================================================
FILE: packages/lisk-api-client/src/resources/accounts.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { APIClient } from '../api_client';
import { apiMethod } from '../api_method';
import { APIResource } from '../api_resource';
import { APIHandler } from '../api_types';
import { GET } from '../constants';

export class AccountsResource extends APIResource {
	public get: APIHandler;
	public getMultisignatureGroups: APIHandler;
	public getMultisignatureMemberships: APIHandler;
	public path: string;

	public constructor(apiClient: APIClient) {
		super(apiClient);
		this.path = '/accounts';

		this.get = apiMethod({
			method: GET,
		}).bind(this);

		this.getMultisignatureGroups = apiMethod({
			method: GET,
			path: '/{address}/multisignature_groups',
			urlParams: ['address'],
		}).bind(this);

		this.getMultisignatureMemberships = apiMethod({
			method: GET,
			path: '/{address}/multisignature_memberships',
			urlParams: ['address'],
		}).bind(this);
	}
}


================================================
FILE: packages/lisk-api-client/src/resources/blocks.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { APIClient } from '../api_client';
import { apiMethod } from '../api_method';
import { APIResource } from '../api_resource';
import { APIHandler } from '../api_types';
import { GET } from '../constants';

export class BlocksResource extends APIResource {
	public get: APIHandler;
	public path: string;

	public constructor(apiClient: APIClient) {
		super(apiClient);
		this.path = '/blocks';

		this.get = apiMethod({
			method: GET,
		}).bind(this);
	}
}


================================================
FILE: packages/lisk-api-client/src/resources/dapps.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { APIClient } from '../api_client';
import { apiMethod } from '../api_method';
import { APIResource } from '../api_resource';
import { APIHandler } from '../api_types';
import { GET } from '../constants';

export class DappsResource extends APIResource {
	public get: APIHandler;
	public path: string;

	public constructor(apiClient: APIClient) {
		super(apiClient);
		this.path = '/dapps';

		this.get = apiMethod({
			method: GET,
		}).bind(this);
	}
}


================================================
FILE: packages/lisk-api-client/src/resources/delegates.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { APIClient } from '../api_client';
import { apiMethod } from '../api_method';
import { APIResource } from '../api_resource';
import { APIHandler } from '../api_types';
import { GET } from '../constants';

export class DelegatesResource extends APIResource {
	public get: APIHandler;
	public getForgers: APIHandler;
	public getForgingStatistics: APIHandler;
	public getStandby: APIHandler;
	public path: string;

	public constructor(apiClient: APIClient) {
		super(apiClient);
		this.path = '/delegates';

		this.get = apiMethod({
			defaultData: {
				sort: 'rank:asc',
			},
			method: GET,
		}).bind(this);

		this.getStandby = apiMethod({
			defaultData: {
				offset: 101,
				sort: 'rank:asc',
			},
			method: GET,
		}).bind(this);

		this.getForgers = apiMethod({
			method: GET,
			path: '/forgers',
		}).bind(this);

		this.getForgingStatistics = apiMethod({
			method: GET,
			path: '/{address}/forging_statistics',
			urlParams: ['address'],
		}).bind(this);
	}
}


================================================
FILE: packages/lisk-api-client/src/resources/index.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
export { default as AccountsResource } from './accounts';
export { default as BlocksResource } from './blocks';
export { default as DappsResource } from './dapps';
export { default as DelegatesResource } from './delegates';
export { default as NodeResource } from './node';
export { default as PeersResource } from './peers';
export { default as SignaturesResource } from './signatures';
export { default as TransactionsResource } from './transactions';
export { default as VotersResource } from './voters';
export { default as VotesResource } from './votes';


================================================
FILE: packages/lisk-api-client/src/resources/node.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { APIClient } from '../api_client';
import { apiMethod } from '../api_method';
import { APIResource } from '../api_resource';
import { APIHandler } from '../api_types';
import { GET, PUT } from '../constants';

export class NodeResource extends APIResource {
	public getConstants: APIHandler;
	public getForgingStatus: APIHandler;
	public getStatus: APIHandler;
	public getTransactions: APIHandler;
	public path: string;
	public updateForgingStatus: APIHandler;

	public constructor(apiClient: APIClient) {
		super(apiClient);
		this.path = '/node';

		this.getConstants = apiMethod({
			method: GET,
			path: '/constants',
		}).bind(this);

		this.getStatus = apiMethod({
			method: GET,
			path: '/status',
		}).bind(this);

		this.getForgingStatus = apiMethod({
			method: GET,
			path: '/status/forging',
		}).bind(this);

		this.updateForgingStatus = apiMethod({
			method: PUT,
			path: '/status/forging',
		}).bind(this);

		this.getTransactions = apiMethod({
			method: GET,
			path: '/transactions/{state}',
			urlParams: ['state'],
		}).bind(this);
	}
}


================================================
FILE: packages/lisk-api-client/src/resources/peers.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { APIClient } from '../api_client';
import { apiMethod } from '../api_method';
import { APIResource } from '../api_resource';
import { APIHandler } from '../api_types';
import { GET } from '../constants';

export class PeersResource extends APIResource {
	public get: APIHandler;
	public path: string;

	public constructor(apiClient: APIClient) {
		super(apiClient);
		this.path = '/peers';

		this.get = apiMethod({
			method: GET,
		}).bind(this);
	}
}


================================================
FILE: packages/lisk-api-client/src/resources/signatures.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { APIClient } from '../api_client';
import { apiMethod } from '../api_method';
import { APIResource } from '../api_resource';
import { APIHandler } from '../api_types';
import { POST } from '../constants';

export class SignaturesResource extends APIResource {
	public broadcast: APIHandler;
	public path: string;

	public constructor(apiClient: APIClient) {
		super(apiClient);
		this.path = '/signatures';

		this.broadcast = apiMethod({
			method: POST,
		}).bind(this);
	}
}


================================================
FILE: packages/lisk-api-client/src/resources/transactions.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { APIClient } from '../api_client';
import { apiMethod } from '../api_method';
import { APIResource } from '../api_resource';
import { APIHandler } from '../api_types';
import { GET, POST } from '../constants';

export class TransactionsResource extends APIResource {
	public broadcast: APIHandler;
	public get: APIHandler;
	public path: string;
	public constructor(apiClient: APIClient) {
		super(apiClient);
		this.path = '/transactions';

		this.get = apiMethod({
			method: GET,
		}).bind(this);

		this.broadcast = apiMethod({
			method: POST,
		}).bind(this);
	}
}


================================================
FILE: packages/lisk-api-client/src/resources/voters.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { APIClient } from '../api_client';
import { apiMethod } from '../api_method';
import { APIResource } from '../api_resource';
import { APIHandler } from '../api_types';
import { GET } from '../constants';

export class VotersResource extends APIResource {
	public get: APIHandler;
	public path: string;

	public constructor(apiClient: APIClient) {
		super(apiClient);
		this.path = '/voters';

		this.get = apiMethod({
			method: GET,
		}).bind(this);
	}
}


================================================
FILE: packages/lisk-api-client/src/resources/votes.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { APIClient } from '../api_client';
import { apiMethod } from '../api_method';
import { APIResource } from '../api_resource';
import { APIHandler } from '../api_types';
import { GET } from '../constants';

export class VotesResource extends APIResource {
	public get: APIHandler;
	public path: string;

	public constructor(apiClient: APIClient) {
		super(apiClient);
		this.path = '/votes';
		this.get = apiMethod({
			method: GET,
		}).bind(this);
	}
}


================================================
FILE: packages/lisk-api-client/src/utils.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { HashMap } from './api_types';

export const toQueryString = (obj: HashMap): string => {
	const parts = Object.keys(obj).reduce(
		(
			accumulator: ReadonlyArray<string>,
			key: string,
		): ReadonlyArray<string> => [
			...accumulator,
			`${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`,
		],
		[],
	);

	return parts.join('&');
};

const urlParamRegex = /{[^}]+}/;
export const solveURLParams = (url: string, params: HashMap = {}): string => {
	if (Object.keys(params).length === 0) {
		if (url.match(urlParamRegex) !== null) {
			throw new Error('URL is not completely solved');
		}

		return url;
	}
	const solvedURL = Object.keys(params).reduce(
		(accumulator: string, key: string): string =>
			accumulator.replace(`{${key}}`, params[key]),
		url,
	);

	if (solvedURL.match(urlParamRegex) !== null) {
		throw new Error('URL is not completely solved');
	}

	return encodeURI(solvedURL);
};


================================================
FILE: packages/lisk-api-client/test/_global_hooks.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
afterEach(() => {
	return sandbox.restore();
});


================================================
FILE: packages/lisk-api-client/test/_setup.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import 'chai/register-expect';
import sinonChai from 'sinon-chai';
import sinon from 'sinon';

process.env.NODE_ENV = 'test';

[sinonChai, chaiAsPromised].forEach(plugin => chai.use(plugin));

global.sandbox = sinon.createSandbox({
	useFakeTimers: true,
});


================================================
FILE: packages/lisk-api-client/test/api_client.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import os from 'os';
import { APIClient } from '../src/api_client';

describe('APIClient module', () => {
	const mainnetHash =
		'ed14889723f24ecc54871d058d98ce91ff2f973192075c0155ba2b7b70ad2511';
	const mainnetNodes: ReadonlyArray<string> = [
		'https://node01.lisk.io:443',
		'https://node02.lisk.io:443',
		'https://node03.lisk.io:443',
		'https://node04.lisk.io:443',
		'https://node05.lisk.io:443',
		'https://node06.lisk.io:443',
		'https://node07.lisk.io:443',
		'https://node08.lisk.io:443',
	];
	const testnetHash =
		'da3ed6a45429278bac2666961289ca17ad86595d33b31037615d4b8e8f158bba';
	const testnetNodes: ReadonlyArray<string> = ['https://testnet.lisk.io:443'];
	const locale =
		process.env.LC_ALL ||
		process.env.LC_MESSAGES ||
		process.env.LANG ||
		process.env.LANGUAGE;
	const platformInfo = `${os.platform()} ${os.release()}; ${os.arch()}${
		locale ? `; ${locale}` : ''
	}`;
	const baseUserAgent = `LiskElements/1.0 (+https://github.com/LiskHQ/lisk-elements) ${platformInfo}`;
	const customUserAgent = `LiskHub/5.0 (+https://github.com/LiskHQ/lisk-hub) ${baseUserAgent}`;
	const defaultHeaders = {
		Accept: 'application/json',
		'Content-Type': 'application/json',
	};

	const customHeaders = {
		Accept: 'application/json',
		'Content-Type': 'application/json',
		'User-Agent': customUserAgent,
		nethash: testnetHash,
	};

	const localNode = 'http://localhost:7000';
	const externalNode = 'https://googIe.com:8080';
	const sslNode = 'https://external.lisk.io:443';
	const externalTestnetNode = 'http://testnet.lisk.io';
	const defaultNodes: ReadonlyArray<string> = [
		localNode,
		externalNode,
		sslNode,
	];
	const defaultSelectedNode = 'selected_node';

	let apiClient: APIClient;

	beforeEach(() => {
		apiClient = new APIClient(defaultNodes);
		return Promise.resolve();
	});

	describe('#constructor', () => {
		let initializeStub: () => void;

		beforeEach(() => {
			initializeStub = sandbox.stub(APIClient.prototype, 'initialize');
			return Promise.resolve();
		});

		it('should create a new instance of APIClient', () => {
			return expect(apiClient)
				.to.be.an('object')
				.and.be.instanceof(APIClient);
		});

		it('should call initialize with the nodes and default options', () => {
			apiClient = new APIClient(defaultNodes);
			return expect(initializeStub).to.be.calledWithExactly(defaultNodes, {});
		});

		it('should call initialize with the nodes and provided options', () => {
			const providedOptions = {
				nethash:
					'0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef',
			};
			apiClient = new APIClient(defaultNodes, providedOptions);
			return expect(initializeStub).to.be.calledWithExactly(
				defaultNodes,
				providedOptions,
			);
		});
	});

	describe('#createMainnetAPIClient', () => {
		let client: APIClient;
		beforeEach(() => {
			client = APIClient.createMainnetAPIClient();
			return Promise.resolve();
		});

		it('should return APIClient instance', () => {
			return expect(client).to.be.instanceof(APIClient);
		});

		it('should contain mainnet nodes', () => {
			return expect(client.nodes).to.eql(mainnetNodes);
		});

		it('should be set to mainnet hash', () => {
			return expect(client.headers.nethash).to.equal(mainnetHash);
		});
	});

	describe('#createTestnetAPIClient', () => {
		let client: APIClient;
		beforeEach(() => {
			client = APIClient.createTestnetAPIClient();
			return Promise.resolve();
		});

		it('should return APIClient instance', () => {
			return expect(client).to.be.instanceof(APIClient);
		});

		it('should contain testnet nodes', () => {
			return expect(client.nodes).to.eql(testnetNodes);
		});

		it('should be set to testnet hash', () => {
			return expect(client.headers.nethash).to.equal(testnetHash);
		});
	});

	describe('#constants', () => {
		it('should expose API constants', () => {
			return expect(APIClient.constants).to.be.an('object');
		});
	});

	describe('#initialize', () => {
		it('should throw an error if no arguments are passed to constructor', () => {
			return expect(apiClient.initialize.bind(apiClient)).to.throw(
				Error,
				'APIClient requires nodes for initialization.',
			);
		});

		it('should throw an error if first argument passed to constructor is not array', () => {
			return expect(apiClient.initialize.bind(apiClient, 'non-array')).to.throw(
				Error,
				'APIClient requires nodes for initialization.',
			);
		});

		it('should throw an error if first argument passed to constructor is empty array', () => {
			return expect(apiClient.initialize.bind(apiClient, [])).to.throw(
				Error,
				'APIClient requires nodes for initialization.',
			);
		});

		it('should throw an error if second argument passed to constructor is a string', () => {
			return expect(
				apiClient.initialize.bind(apiClient, defaultNodes, 'option string'),
			).to.throw(
				Error,
				'APIClient takes an optional object as the second parameter.',
			);
		});

		it('should throw an error if second argument passed to constructor is an array', () => {
			return expect(
				apiClient.initialize.bind(apiClient, defaultNodes, []),
			).to.throw(
				Error,
				'APIClient takes an optional object as the second parameter.',
			);
		});

		describe('headers', () => {
			it('should set with passed nethash, with default options', () => {
				return expect(apiClient)
					.to.have.property('headers')
					.and.eql(defaultHeaders);
			});

			it('should set custom headers with supplied options', () => {
				apiClient = new APIClient(defaultNodes, {
					nethash: testnetHash,
					client: {
						name: 'LiskHub',
						version: '5.0',
						engine: '+https://github.com/LiskHQ/lisk-hub',
					},
				});
				return expect(apiClient)
					.to.have.property('headers')
					.and.eql(customHeaders);
			});

			it('should not set User-Agent header when client options were not given', () => {
				apiClient = new APIClient(defaultNodes, {
					nethash: testnetHash,
				});
				return expect(apiClient.headers).to.not.have.property('User-Agent');
			});
		});

		describe('nodes', () => {
			it('should have nodes supplied to constructor', () => {
				return expect(apiClient)
					.to.have.property('nodes')
					.and.equal(defaultNodes);
			});
		});

		describe('bannedNodes', () => {
			it('should set empty array if no option is passed', () => {
				return expect(apiClient)
					.to.have.property('bannedNodes')
					.be.eql([]);
			});

			it('should set bannedNodes when passed as an option', () => {
				const bannedNodes = ['a', 'b'];
				apiClient = new APIClient(defaultNodes, { bannedNodes });
				return expect(apiClient)
					.to.have.property('bannedNodes')
					.be.eql(bannedNodes);
			});
		});

		describe('currentNode', () => {
			it('should set with random node with initialized setup if no node is specified by options', () => {
				return expect(apiClient).to.have.property('currentNode').and.not.be
					.empty;
			});

			it('should set with supplied node if node is specified by options', () => {
				apiClient = new APIClient(defaultNodes, {
					node: externalTestnetNode,
				});
				return expect(apiClient)
					.to.have.property('currentNode')
					.and.equal(externalTestnetNode);
			});
		});

		describe('randomizeNodes', () => {
			it('should set randomizeNodes to true when randomizeNodes not explicitly set', () => {
				apiClient = new APIClient(defaultNodes, {
					randomizeNodes: undefined,
				});
				return expect(apiClient).to.have.property('randomizeNodes').be.true;
			});

			it('should set randomizeNodes to true on initialization when passed as an option', () => {
				apiClient = new APIClient(defaultNodes, {
					randomizeNodes: true,
				});
				return expect(apiClient).to.have.property('randomizeNodes').be.true;
			});

			it('should set randomizeNodes to false on initialization when passed as an option', () => {
				apiClient = new APIClient(defaultNodes, {
					randomizeNodes: false,
				});
				return expect(apiClient).to.have.property('randomizeNodes').be.false;
			});
		});
	});

	describe('#getNewNode', () => {
		it('should throw an error if all relevant nodes are banned', () => {
			apiClient.bannedNodes = [...defaultNodes];
			return expect(apiClient.getNewNode.bind(apiClient)).to.throw(
				'Cannot get new node: all nodes have been banned.',
			);
		});

		it('should return a node', () => {
			const result = apiClient.getNewNode();
			return expect(defaultNodes).to.contain(result);
		});

		it('should randomly select the node', () => {
			const firstResult = apiClient.getNewNode();
			let nextResult = apiClient.getNewNode();
			// Test will almost certainly time out if not random
			while (nextResult === firstResult) {
				nextResult = apiClient.getNewNode();
			}
			return Promise.resolve();
		});
	});

	describe('#banNode', () => {
		it('should add node to banned nodes', () => {
			const banned = apiClient.banNode(localNode);
			expect(banned).to.be.true;
			return expect(apiClient.isBanned(localNode)).to.be.true;
		});

		it('should not duplicate a banned node', () => {
			const bannedNodes = [localNode];
			apiClient.bannedNodes = bannedNodes;
			const banned = apiClient.banNode(localNode);

			expect(banned).to.be.false;
			return expect(apiClient.bannedNodes).to.be.eql(bannedNodes);
		});
	});

	describe('#banActiveNode', () => {
		let currentNode: string;

		beforeEach(() => {
			({ currentNode } = apiClient);
			return Promise.resolve();
		});

		it('should add current node to banned nodes', () => {
			const banned = apiClient.banActiveNode();
			expect(banned).to.be.true;
			return expect(apiClient.isBanned(currentNode)).to.be.true;
		});

		it('should not duplicate a banned node', () => {
			const bannedNodes = [currentNode];
			apiClient.bannedNodes = bannedNodes;
			const banned = apiClient.banActiveNode();

			expect(banned).to.be.false;
			return expect(apiClient.bannedNodes).to.be.eql(bannedNodes);
		});
	});

	describe('#banActiveNodeAndSelect', () => {
		let currentNode: string;
		let getNewNodeStub: () => string;

		beforeEach(() => {
			({ currentNode } = apiClient);
			getNewNodeStub = sandbox
				.stub(apiClient, 'getNewNode')
				.returns(defaultSelectedNode);
			return Promise.resolve();
		});

		it('should call ban current node', () => {
			apiClient.banActiveNodeAndSelect();
			return expect(apiClient.isBanned(currentNode)).to.be.true;
		});

		it('should call selectNewNode when the node is banned', () => {
			apiClient.banActiveNodeAndSelect();
			return expect(getNewNodeStub).to.be.calledOnce;
		});

		it('should not call selectNewNode when the node is not banned', () => {
			const bannedNodes = [currentNode];
			apiClient.bannedNodes = bannedNodes;
			apiClient.banActiveNodeAndSelect();
			return expect(getNewNodeStub).not.to.be.called;
		});
	});

	describe('#isBanned', () => {
		it('should return true when provided node is banned', () => {
			apiClient.bannedNodes = [...apiClient.bannedNodes, localNode];
			return expect(apiClient.isBanned(localNode)).to.be.true;
		});

		it('should return false when provided node is not banned', () => {
			return expect(apiClient.isBanned(localNode)).to.be.false;
		});
	});

	describe('#hasAvailableNodes', () => {
		it('should return false without nodes left', () => {
			apiClient.bannedNodes = [...defaultNodes];
			const result = apiClient.hasAvailableNodes();
			return expect(result).to.be.false;
		});

		it('should return true if nodes are available', () => {
			const result = apiClient.hasAvailableNodes();
			return expect(result).to.be.true;
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/api_method.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { apiMethod } from '../src/api_method';
import { Resource, APIHandler } from '../src/api_types';

describe('API method module', () => {
	const GET = 'GET';
	const POST = 'POST';
	const defaultBasePath = 'http://localhost:1234/api';
	const defaultResourcePath = '/resources';
	const defaultFullPath = `${defaultBasePath}${defaultResourcePath}`;
	const defaultHeaders = {
		'Content-Type': 'application/json',
		nethash: 'mainnetHash',
		os: 'lisk-elements-api',
		version: '1.0.0',
		minVersion: '>=0.5.0',
		port: '443',
	};
	const errorArgumentNumber =
		'This endpoint must be supplied with the following parameters: related,id';
	const firstURLParam = 'r-123';
	const secondURLParam = 123;
	let resource: Resource;
	let requestResult: object;
	let handler: APIHandler;
	let validationError: Error;

	beforeEach(() => {
		requestResult = { success: true, sendRequest: true };
		resource = {
			path: defaultResourcePath,
			resourcePath: defaultFullPath,
			headers: defaultHeaders,
			request: sandbox.stub().resolves(requestResult),
		};
		validationError = new Error('No data');
		return Promise.resolve();
	});

	describe('#apiMethod', () => {
		describe('when no parameters are passed', () => {
			beforeEach(() => {
				handler = apiMethod().bind(resource);

				return Promise.resolve();
			});

			it('should return function', () => {
				return expect(handler).to.be.a('function');
			});

			it('should request GET with default URL', () => {
				return handler().then(() => {
					expect(resource.request).to.be.calledOnce;
					return expect(resource.request).to.be.calledWithExactly(
						{
							method: GET,
							url: defaultFullPath,
							headers: defaultHeaders,
						},
						false,
					);
				});
			});
		});

		describe('when initialized with POST / parameters', () => {
			const parameterStringError = 'Parameter must be a string or a number';

			beforeEach(() => {
				handler = apiMethod({
					method: POST,
					path: '/{related}/ids/{id}',
					urlParams: ['related', 'id'],
					validator: data => {
						if (!data.needed) {
							throw validationError;
						}
					},
					defaultData: {
						sort: 'id',
					},
					retry: true,
				}).bind(resource);
				return Promise.resolve();
			});

			it('should return function', () => {
				return expect(handler).to.be.a('function');
			});

			it('should be rejected with error without param', () => {
				return expect(handler()).to.be.rejectedWith(Error, errorArgumentNumber);
			});

			it('should be rejected with error without enough param', () => {
				return expect(handler(firstURLParam)).to.be.rejectedWith(
					Error,
					errorArgumentNumber,
				);
			});

			it('should throw an error if input is not a string or a number', () => {
				return expect(
					handler({ num: 3 }, secondURLParam, { needed: true }),
				).to.be.rejectedWith(Error, parameterStringError);
			});

			it('should be rejected with no data', () => {
				return expect(
					handler(firstURLParam, secondURLParam),
				).to.be.rejectedWith(validationError);
			});

			it('should call request with the given data', () => {
				return handler(firstURLParam, secondURLParam, { needed: true }).then(
					() => {
						expect(resource.request).to.be.calledOnce;
						return expect(resource.request).to.be.calledWithExactly(
							{
								method: POST,
								url: `${defaultFullPath}/${firstURLParam}/ids/${secondURLParam}`,
								headers: defaultHeaders,
								data: {
									needed: true,
									sort: 'id',
								},
							},
							true,
						);
					},
				);
			});
		});

		describe('when initialized with GET / parameters', () => {
			beforeEach(() => {
				handler = apiMethod({
					method: GET,
					path: '/{related}/ids/{id}',
					urlParams: ['related', 'id'],
					validator: data => {
						if (!data.needed) {
							throw validationError;
						}
					},
					defaultData: {
						sort: 'id',
					},
				}).bind(resource);
				return Promise.resolve();
			});

			it('should return a function', () => {
				return expect(handler).to.be.a('function');
			});

			it('should be rejected with error without parameters', () => {
				return expect(handler()).to.be.rejectedWith(Error, errorArgumentNumber);
			});

			it('should be rejected with error without enough parameters', () => {
				return expect(handler(firstURLParam)).to.be.rejectedWith(
					Error,
					errorArgumentNumber,
				);
			});

			it('should be rejected with no data', () => {
				return expect(
					handler(firstURLParam, secondURLParam),
				).to.be.rejectedWith(validationError);
			});

			it('should be request with the given data', () => {
				return handler(firstURLParam, secondURLParam, { needed: true }).then(
					() => {
						expect(resource.request).to.be.calledOnce;
						return expect(resource.request).to.be.calledWithExactly(
							{
								method: GET,
								url: `${defaultFullPath}/${firstURLParam}/ids/${secondURLParam}?sort=id&needed=true`,
								headers: defaultHeaders,
							},
							false,
						);
					},
				);
			});
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/api_resource.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { APIClient } from '../src/api_client';
import { APIResource } from '../src/api_resource';
import sinon from 'sinon';
// Required for stub
const axios = require('axios');

describe('API resource module', () => {
	const GET = 'GET';
	const defaultBasePath = 'http://localhost:1234';
	const defaultResourcePath = '/resources';
	const defaultFullPath = `${defaultBasePath}/api${defaultResourcePath}`;
	const defaultHeaders = {
		Accept: 'application/json',
		'Content-Type': 'application/json',
		nethash: 'mainnetHash',
		os: 'lisk-elements-api',
		version: '1.0.0',
		minVersion: '>=0.5.0',
		port: '443',
	};
	const defaultRequest = {
		method: GET,
		url: defaultFullPath,
		headers: defaultHeaders,
	};

	const sendRequestResult = {
		data: [],
		body: {},
		limit: 0,
	};

	interface FakeAPIClient {
		headers: object;
		currentNode: string;
		hasAvailableNodes: () => boolean | void;
		randomizeNodes: boolean;
		banActiveNodeAndSelect: () => void;
	}

	let resource: APIResource;
	let apiClient: FakeAPIClient;

	beforeEach(() => {
		apiClient = {
			headers: { ...defaultHeaders },
			currentNode: defaultBasePath,
			hasAvailableNodes: () => true,
			randomizeNodes: false,
			banActiveNodeAndSelect: sandbox.stub(),
		};
		resource = new APIResource(apiClient as APIClient);
		return Promise.resolve();
	});

	describe('#constructor', () => {
		it('should create an API resource instance', () => {
			return expect(resource).to.be.instanceOf(APIResource);
		});
	});

	describe('get headers', () => {
		it('should return header set to apiClient', () => {
			return expect(resource.headers).to.eql(defaultHeaders);
		});
	});

	describe('get resourcePath', () => {
		it('should return the resource’s full path', () => {
			return expect(resource.resourcePath).to.equal(`${defaultBasePath}/api`);
		});

		it('should return the resource’s full path with set path', () => {
			resource.path = defaultResourcePath;
			return expect(resource.resourcePath).to.equal(
				`${defaultBasePath}/api${defaultResourcePath}`,
			);
		});
	});

	describe('#request', () => {
		let requestStub: sinon.SinonStub;
		let handleRetryStub: () => Promise<void>;

		beforeEach(() => {
			requestStub = sandbox.stub(axios, 'request').resolves({
				status: 200,
				data: sendRequestResult,
			});
			handleRetryStub = sandbox.stub(resource, 'handleRetry');
			return Promise.resolve();
		});

		it('should make a request to API without calling retry', () => {
			return resource.request(defaultRequest, false).then(res => {
				expect(requestStub).to.be.calledOnce;
				expect(requestStub).to.be.calledWithExactly(defaultRequest);
				expect(handleRetryStub).not.to.be.called;
				return expect(res).to.eql(sendRequestResult);
			});
		});

		it('should make a request to API without calling retry when it succeeds', () => {
			return resource.request(defaultRequest, true).then(res => {
				expect(requestStub).to.be.calledOnce;
				expect(requestStub).to.be.calledWithExactly(defaultRequest);
				expect(handleRetryStub).not.to.be.called;
				return expect(res).to.eql(sendRequestResult);
			});
		});

		describe('when response status is greater than 300', () => {
			it('should reject with errno if status code is supplied', () => {
				const statusCode = 300;
				requestStub.rejects({
					response: {
						status: statusCode,
						data: undefined,
					},
				});

				return resource.request(defaultRequest, false).catch(err => {
					return expect(err.errno).to.equal(statusCode);
				});
			});

			it('should reject with "An unknown error has occured." message if there is no data is supplied', () => {
				const statusCode = 300;
				requestStub.rejects({
					response: {
						status: statusCode,
						data: undefined,
					},
				});

				return resource.request(defaultRequest, false).catch(err => {
					return expect(err.message).to.equal('An unknown error has occurred.');
				});
			});

			it('should reject with "An unknown error has occured." message if there is no message is supplied', () => {
				const statusCode = 300;
				requestStub.rejects({
					response: {
						status: statusCode,
						data: sendRequestResult,
					},
				});

				return resource.request(defaultRequest, false).catch(err => {
					return expect(err.message).to.equal('An unknown error has occurred.');
				});
			});

			it('should reject with error message from server if message is supplied', () => {
				const serverErrorMessage = 'validation error';
				const statusCode = 300;
				requestStub.rejects({
					response: {
						status: statusCode,
						data: { message: serverErrorMessage },
					},
				});

				return resource.request(defaultRequest, false).catch(err => {
					return expect(err.message).to.eql(serverErrorMessage);
				});
			});

			it('should reject with error message from server if message is undefined and error is supplied', () => {
				const serverErrorMessage = 'error from server';
				const statusCode = 300;
				requestStub.rejects({
					response: {
						status: statusCode,
						data: { message: undefined, error: serverErrorMessage },
					},
				});

				return resource.request(defaultRequest, false).catch(err => {
					return expect(err.message).to.eql(serverErrorMessage);
				});
			});

			it('should reject with errors from server if errors are supplied', () => {
				const serverErrorMessage = 'validation error';
				const statusCode = 300;
				const errors = [
					{
						code: 'error_code_1',
						message: 'message1',
					},
					{
						code: 'error_code_2',
						message: 'message2',
					},
				];
				requestStub.rejects({
					response: {
						status: statusCode,
						data: { message: serverErrorMessage, errors },
					},
				});

				return resource.request(defaultRequest, false).catch(err => {
					return expect(err.errors).to.eql(errors);
				});
			});

			it('should reject with error if client rejects with plain error', () => {
				const clientError = new Error('client error');
				requestStub.rejects(clientError);
				return resource.request(defaultRequest, false).catch(err => {
					return expect(err).to.eql(clientError);
				});
			});

			it('should make a request to API with calling retry', () => {
				const statusCode = 300;
				requestStub.rejects({
					response: {
						status: statusCode,
						data: sendRequestResult,
					},
				});
				return resource.request(defaultRequest, true).catch(() => {
					expect(requestStub).to.be.calledOnce;
					return expect(handleRetryStub).to.be.calledOnce;
				});
			});
		});
	});

	describe('#handleRetry', () => {
		let requestStub: sinon.SinonStub;
		let defaultError: Error;
		beforeEach(() => {
			defaultError = new Error('could not connect to a node');
			requestStub = sandbox
				.stub(resource, 'request')
				.returns(Promise.resolve(sendRequestResult.body));
			return Promise.resolve();
		});

		describe('when there is available node', () => {
			let clock: sinon.SinonFakeTimers;

			beforeEach(() => {
				clock = sinon.useFakeTimers();
				apiClient.hasAvailableNodes = () => true;
				return Promise.resolve();
			});

			afterEach(() => {
				return clock.restore();
			});

			it('should call banActiveNode when randomizeNodes is true', () => {
				apiClient.randomizeNodes = true;
				const req = resource.handleRetry(defaultError, defaultRequest, 1);
				clock.tick(1000);
				return req.then(res => {
					expect(apiClient.banActiveNodeAndSelect).to.be.calledOnce;
					expect(requestStub).to.be.calledWith(defaultRequest, true);
					return expect(res).to.be.eql(sendRequestResult.body);
				});
			});

			it('should not call ban active node when randomizeNodes is false', () => {
				apiClient.randomizeNodes = false;
				const req = resource.handleRetry(defaultError, defaultRequest, 1);
				clock.tick(1000);
				return req.then(res => {
					expect(apiClient.banActiveNodeAndSelect).not.to.be.called;
					expect(requestStub).to.be.calledWith(defaultRequest, true);
					return expect(res).to.be.eql(sendRequestResult.body);
				});
			});

			it('should throw an error when randomizeNodes is false and the maximum retry count has been reached', () => {
				apiClient.randomizeNodes = false;
				const req = resource.handleRetry(defaultError, defaultRequest, 4);
				clock.tick(1000);
				return expect(req).to.be.rejectedWith(defaultError);
			});
		});

		describe('when there is no available node', () => {
			beforeEach(() => {
				apiClient.hasAvailableNodes = () => false;
				return Promise.resolve();
			});

			it('should throw an error that is the same as input error', () => {
				const res = resource.handleRetry(defaultError, defaultRequest, 1);
				return expect(res).to.be.rejectedWith(defaultError);
			});
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/constants.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { GET, POST, PUT, TESTNET_NODES, MAINNET_NODES } from '../src/constants';

describe('api constants module', () => {
	it('GET should be a string', () => {
		return expect(GET).to.be.a('string');
	});

	it('POST should be a string', () => {
		return expect(POST).to.be.a('string');
	});

	it('PUT should be a string', () => {
		return expect(PUT).to.be.a('string');
	});

	it('TESTNET_NODES should be an array of strings', () => {
		expect(TESTNET_NODES).to.be.an('array');
		return TESTNET_NODES.forEach(node => expect(node).to.be.a('string'));
	});

	it('MAINNET_NODES should be an array of strings', () => {
		expect(MAINNET_NODES).to.be.an('array');
		return MAINNET_NODES.forEach(node => expect(node).to.be.a('string'));
	});
});


================================================
FILE: packages/lisk-api-client/test/errors.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { APIError, APIErrorData } from '../src/errors';

describe('api errors module', () => {
	let apiError: APIError;
	const defaultMessage = 'this is an error';
	const defaultErrno = 401;

	beforeEach(() => {
		apiError = new APIError();
		return Promise.resolve();
	});

	describe('#constructor', () => {
		it('should create a new instance of APIError', () => {
			return expect(apiError)
				.to.be.an('object')
				.and.be.instanceof(APIError);
		});

		it('should set error name to `APIError`', () => {
			return expect(apiError.name).to.eql('APIError');
		});

		it('should set error message to empty string by default', () => {
			return expect(apiError.message).to.eql('');
		});

		it('should set errno to 500 by default', () => {
			return expect(apiError.errno).to.eql(500);
		});

		describe('when passed errno', () => {
			beforeEach(() => {
				apiError = new APIError(defaultMessage, defaultErrno);
				return Promise.resolve();
			});

			it('should set error message when passed through first argument', () => {
				return expect(apiError.message).to.eql(defaultMessage);
			});

			it('should set errno when passed through second argument', () => {
				return expect(apiError.errno).to.eql(defaultErrno);
			});
		});

		describe('when passed errno and errors', () => {
			const errors = [
				{
					code: 'error_code_1',
					message: 'message1',
				},
				{
					code: 'error_code_2',
					message: 'message2',
				},
			];

			beforeEach(() => {
				apiError = new APIError(defaultMessage, defaultErrno, errors);
				return Promise.resolve();
			});

			it('should set error message when passed through first argument', () => {
				return expect(apiError.message).to.eql(defaultMessage);
			});

			it('should set errno when passed through second argument', () => {
				return expect(apiError.errno).to.eql(defaultErrno);
			});

			it('should set errors when passed through third argument', () => {
				expect(apiError.errors).to.have.lengthOf(2);
				const errorData = apiError.errors as ReadonlyArray<APIErrorData>;
				expect(errorData[0].code).to.equal(errors[0].code);
				return expect(errorData[0].message).to.equal(errors[0].message);
			});
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/index.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { APIClient } from '../src';
import { expect } from 'chai';

describe('api client', () => {
	describe('exports', () => {
		it('should have APIClient as a function', () => {
			return expect(APIClient).to.be.a('function');
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/mocha.opts
================================================
--recursive
--require ts-node/register
--require tsconfig-paths/register
--require source-map-support/register
--require ./test/_setup.ts
--file ./test/_global_hooks.ts
--watch-extensions ts


================================================
FILE: packages/lisk-api-client/test/resources/accounts.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { APIClient } from '../../src/api_client';
import { APIResource } from '../../src/api_resource';
import { AccountsResource } from '../../src/resources/accounts';

describe('AccountsResource', () => {
	const defaultBasePath = 'http://localhost:1234';
	const path = '/accounts';

	let apiClient: APIClient;
	let resource: APIResource;

	beforeEach(() => {
		apiClient = new APIClient([defaultBasePath]);
		resource = new AccountsResource(apiClient);
		return Promise.resolve();
	});

	describe('#constructor', () => {
		it('should be instance of APIResource', () => {
			return expect(resource).to.be.instanceOf(APIResource);
		});

		it('should have correct full path', () => {
			return expect(resource.resourcePath).to.eql(
				`${defaultBasePath}/api${path}`,
			);
		});

		it('should set resource path', () => {
			return expect(resource.path).to.equal(path);
		});

		it('should have a "get" function', () => {
			return expect(resource)
				.to.have.property('get')
				.which.is.a('function');
		});

		it('should have a "getMultisignatureGroups" function', () => {
			return expect(resource)
				.to.have.property('getMultisignatureGroups')
				.which.is.a('function');
		});

		it('should have a "getMultisignatureMemberships" function', () => {
			return expect(resource)
				.to.have.property('getMultisignatureMemberships')
				.which.is.a('function');
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/resources/blocks.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { APIClient } from '../../src/api_client';
import { APIResource } from '../../src/api_resource';
import { BlocksResource } from '../../src/resources/blocks';

describe('BlocksResource', () => {
	const defaultBasePath = 'http://localhost:1234';
	const path = '/blocks';

	let apiClient: APIClient;
	let resource: APIResource;

	beforeEach(() => {
		apiClient = new APIClient([defaultBasePath]);
		resource = new BlocksResource(apiClient);
		return Promise.resolve();
	});

	describe('#constructor', () => {
		it('should be instance of APIResource', () => {
			return expect(resource).to.be.instanceOf(APIResource);
		});

		it('should have correct full path', () => {
			return expect(resource.resourcePath).to.eql(
				`${defaultBasePath}/api${path}`,
			);
		});

		it('should set resource path', () => {
			return expect(resource.path).to.equal(path);
		});

		it('should have a "get" function', () => {
			return expect(resource)
				.to.have.property('get')
				.which.is.a('function');
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/resources/dapps.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { APIClient } from '../../src/api_client';
import { APIResource } from '../../src/api_resource';
import { DappsResource } from '../../src/resources/dapps';

describe('DappsResource', () => {
	const defaultBasePath = 'http://localhost:1234';
	const path = '/dapps';

	let apiClient: APIClient;
	let resource: APIResource;

	beforeEach(() => {
		apiClient = new APIClient([defaultBasePath]);
		resource = new DappsResource(apiClient);
		return Promise.resolve();
	});

	describe('#constructor', () => {
		it('should be instance of APIResource', () => {
			return expect(resource).to.be.instanceOf(APIResource);
		});

		it('should have correct full path', () => {
			return expect(resource.resourcePath).to.eql(
				`${defaultBasePath}/api${path}`,
			);
		});

		it('should set resource path', () => {
			return expect(resource.path).to.equal(path);
		});

		it('should have a "get" function', () => {
			return expect(resource)
				.to.have.property('get')
				.which.is.a('function');
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/resources/delegates.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { APIClient } from '../../src/api_client';
import { APIResource } from '../../src/api_resource';
import { DelegatesResource } from '../../src/resources/delegates';

describe('DelegatesResource', () => {
	const defaultBasePath = 'http://localhost:1234';
	const path = '/delegates';

	let apiClient: APIClient;
	let resource: APIResource;

	beforeEach(() => {
		apiClient = new APIClient([defaultBasePath]);
		resource = new DelegatesResource(apiClient);
		return Promise.resolve();
	});

	describe('#constructor', () => {
		it('should be instance of APIResource', () => {
			return expect(resource).to.be.instanceOf(APIResource);
		});

		it('should have correct full path', () => {
			return expect(resource.resourcePath).to.eql(
				`${defaultBasePath}/api${path}`,
			);
		});

		it('should set resource path', () => {
			return expect(resource.path).to.equal(path);
		});

		it('should have a "get" function', () => {
			return expect(resource)
				.to.have.property('get')
				.which.is.a('function');
		});

		it('should have a "getStandby" function', () => {
			return expect(resource)
				.to.have.property('getStandby')
				.which.is.a('function');
		});

		it('should have a "getForgers" function', () => {
			return expect(resource)
				.to.have.property('getForgers')
				.which.is.a('function');
		});

		it('should have a "getForgingStatistics" function', () => {
			return expect(resource)
				.to.have.property('getForgingStatistics')
				.which.is.a('function');
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/resources/node.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { APIClient } from '../../src/api_client';
import { APIResource } from '../../src/api_resource';
import { NodeResource } from '../../src/resources/node';

describe('NodeResource', () => {
	const defaultBasePath = 'http://localhost:1234';
	const path = '/node';

	let apiClient: APIClient;
	let resource: APIResource;

	beforeEach(() => {
		apiClient = new APIClient([defaultBasePath]);
		resource = new NodeResource(apiClient);
		return Promise.resolve();
	});

	describe('#constructor', () => {
		it('should be instance of APIResource', () => {
			return expect(resource).to.be.instanceOf(APIResource);
		});

		it('should have correct full path', () => {
			return expect(resource.resourcePath).to.eql(
				`${defaultBasePath}/api${path}`,
			);
		});

		it('should set resource path', () => {
			return expect(resource.path).to.equal(path);
		});

		it('should have a "getConstants" function', () => {
			return expect(resource)
				.to.have.property('getConstants')
				.which.is.a('function');
		});

		it('should have a "getStatus" function', () => {
			return expect(resource)
				.to.have.property('getStatus')
				.which.is.a('function');
		});

		it('should have a "getForgingStatus" function', () => {
			return expect(resource)
				.to.have.property('getForgingStatus')
				.which.is.a('function');
		});

		it('should have a "updateForgingStatus" function', () => {
			return expect(resource)
				.to.have.property('updateForgingStatus')
				.which.is.a('function');
		});

		it('should have a "getTransactions" function', () => {
			return expect(resource)
				.to.have.property('getTransactions')
				.which.is.a('function');
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/resources/peers.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { APIClient } from '../../src/api_client';
import { APIResource } from '../../src/api_resource';
import { PeersResource } from '../../src/resources/peers';

describe('PeersResource', () => {
	const defaultBasePath = 'http://localhost:1234';
	const path = '/peers';

	let apiClient: APIClient;
	let resource: APIResource;

	beforeEach(() => {
		apiClient = new APIClient([defaultBasePath]);
		resource = new PeersResource(apiClient);
		return Promise.resolve();
	});

	describe('#constructor', () => {
		it('should be instance of APIResource', () => {
			return expect(resource).to.be.instanceOf(APIResource);
		});

		it('should have correct full path', () => {
			return expect(resource.resourcePath).to.eql(
				`${defaultBasePath}/api${path}`,
			);
		});

		it('should set resource path', () => {
			return expect(resource.path).to.equal(path);
		});

		it('should have a "get" function', () => {
			return expect(resource)
				.to.have.property('get')
				.which.is.a('function');
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/resources/signatures.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { APIClient } from '../../src/api_client';
import { APIResource } from '../../src/api_resource';
import { SignaturesResource } from '../../src/resources/signatures';

describe('SignaturesResource', () => {
	const defaultBasePath = 'http://localhost:1234';
	const path = '/signatures';

	let apiClient: APIClient;
	let resource: APIResource;

	beforeEach(() => {
		apiClient = new APIClient([defaultBasePath]);
		resource = new SignaturesResource(apiClient);
		return Promise.resolve();
	});

	describe('#constructor', () => {
		it('should be instance of APIResource', () => {
			return expect(resource).to.be.instanceOf(APIResource);
		});

		it('should have correct full path', () => {
			return expect(resource.resourcePath).to.eql(
				`${defaultBasePath}/api${path}`,
			);
		});

		it('should set resource path', () => {
			return expect(resource.path).to.equal(path);
		});

		it('should have a "broadcast" function', () => {
			return expect(resource)
				.to.have.property('broadcast')
				.which.is.a('function');
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/resources/transactions.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { APIClient } from '../../src/api_client';
import { APIResource } from '../../src/api_resource';
import { TransactionsResource } from '../../src/resources/transactions';

describe('TransactionsResource', () => {
	const defaultBasePath = 'http://localhost:1234';
	const path = '/transactions';

	let apiClient: APIClient;
	let resource: APIResource;

	beforeEach(() => {
		apiClient = new APIClient([defaultBasePath]);
		resource = new TransactionsResource(apiClient);
		return Promise.resolve();
	});

	describe('#constructor', () => {
		it('should be instance of APIResource', () => {
			return expect(resource).to.be.instanceOf(APIResource);
		});

		it('should have correct full path', () => {
			return expect(resource.resourcePath).to.eql(
				`${defaultBasePath}/api${path}`,
			);
		});

		it('should set resource path', () => {
			return expect(resource.path).to.equal(path);
		});

		it('should have a "get" function', () => {
			return expect(resource)
				.to.have.property('get')
				.which.is.a('function');
		});

		it('should have a "broadcast" function', () => {
			return expect(resource)
				.to.have.property('broadcast')
				.which.is.a('function');
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/resources/voters.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { APIClient } from '../../src/api_client';
import { APIResource } from '../../src/api_resource';
import { VotersResource } from '../../src/resources/voters';

describe('VotersResource', () => {
	const defaultBasePath = 'http://localhost:1234';
	const path = '/voters';

	let apiClient: APIClient;
	let resource: APIResource;

	beforeEach(() => {
		apiClient = new APIClient([defaultBasePath]);
		resource = new VotersResource(apiClient);
		return Promise.resolve();
	});

	describe('#constructor', () => {
		it('should be instance of APIResource', () => {
			return expect(resource).to.be.instanceOf(APIResource);
		});

		it('should have correct full path', () => {
			return expect(resource.resourcePath).to.eql(
				`${defaultBasePath}/api${path}`,
			);
		});

		it('should set resource path', () => {
			return expect(resource.path).to.equal(path);
		});

		it('should have a "get" function', () => {
			return expect(resource)
				.to.have.property('get')
				.which.is.a('function');
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/resources/votes.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { APIClient } from '../../src/api_client';
import { APIResource } from '../../src/api_resource';
import { VotesResource } from '../../src/resources/votes';

describe('VotesResource', () => {
	const defaultBasePath = 'http://localhost:1234';
	const path = '/votes';

	let apiClient: APIClient;
	let resource: APIResource;

	beforeEach(() => {
		apiClient = new APIClient([defaultBasePath]);
		resource = new VotesResource(apiClient);
		return Promise.resolve();
	});

	describe('#constructor', () => {
		it('should be instance of APIResource', () => {
			return expect(resource).to.be.instanceOf(APIResource);
		});

		it('should have correct full path', () => {
			return expect(resource.resourcePath).to.eql(
				`${defaultBasePath}/api${path}`,
			);
		});

		it('should set resource path', () => {
			return expect(resource.path).to.equal(path);
		});

		it('should have a "get" function', () => {
			return expect(resource)
				.to.have.property('get')
				.which.is.a('function');
		});
	});
});


================================================
FILE: packages/lisk-api-client/test/utils.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import { toQueryString, solveURLParams } from '../src/utils';

describe('api utils module', () => {
	const defaultURL = 'http://localhost:8080/api/resources';

	describe('#toQueryString', () => {
		it('should create a query string from an object', () => {
			const queryString = toQueryString({
				key1: 'value1',
				key2: 'value2',
				key3: 'value3',
			});
			return expect(queryString).to.be.equal(
				'key1=value1&key2=value2&key3=value3',
			);
		});

		it('should escape invalid special characters', () => {
			const queryString = toQueryString({
				'key:/;?': 'value:/;?',
			});
			return expect(queryString).to.be.equal(
				'key%3A%2F%3B%3F=value%3A%2F%3B%3F',
			);
		});
	});

	describe('#solveURLParams', () => {
		it('should return original URL with no param', () => {
			const solvedURL = solveURLParams(defaultURL);
			return expect(solvedURL).to.be.equal(defaultURL);
		});

		it('should throw error if url has variable but no param', () => {
			return expect(solveURLParams.bind(null, `${defaultURL}/{id}`)).to.throw(
				Error,
				'URL is not completely solved',
			);
		});

		it('should throw error if url has variable but not matching params', () => {
			return expect(
				solveURLParams.bind(null, `${defaultURL}/{id}`, { accountId: '123' }),
			).to.throw(Error, 'URL is not completely solved');
		});

		it('should replace variable with correct id', () => {
			const solvedURL = solveURLParams(`${defaultURL}/{id}`, {
				id: '456',
				accountId: '123',
			});
			return expect(solvedURL).to.be.equal(`${defaultURL}/456`);
		});

		it('should replace multiple variables with correct id and accountId', () => {
			const solvedURL = solveURLParams(`${defaultURL}/{accountId}/{id}`, {
				id: '456',
				accountId: '123',
			});
			return expect(solvedURL).to.be.equal(`${defaultURL}/123/456`);
		});

		it('should replace variable with correct id and encode special characters', () => {
			const solvedURL = solveURLParams(`${defaultURL}/{id}`, {
				id: '456ß1234sd',
				accountId: '123',
			});
			return expect(solvedURL).to.be.equal(`${defaultURL}/456%C3%9F1234sd`);
		});
	});
});


================================================
FILE: packages/lisk-client/README.md
================================================
# @liskhq/lisk-client

A default set of Elements for use by clients of the Lisk network

## Installation

### Installation via npm

Add Lisk Client as a dependency of your project:

```sh
$ npm install --save @liskhq/lisk-client
```

Import using ES6 modules syntax:

```js
import lisk from '@liskhq/lisk-client';
```

Or using Node.js modules:

```js
const lisk = require('@liskhq/lisk-client');
```

Or import specific namespaced functionality:

```js
import { APIClient, transactions } from '@liskhq/lisk-client';
// or
const { APIClient, transactions } = require('@liskhq/lisk-client');
```

### Installation via CDN

Include the following script using the following HTML. The `lisk` variable will be exposed.

```html
<script src="https://js.lisk.io/lisk-client-1.1.0.js"></script>
```

Or minified:

```html
<script src="https://js.lisk.io/lisk-client-1.1.0.min.js"></script>
```

## Packages

| Package                                                 |                                                      Version                                                      | Description                                                        |
| ------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------: | ------------------------------------------------------------------ |
| [@liskhq/lisk-api-client](../lisk-api-client)     |  [![](https://img.shields.io/badge/npm-v2.0.0-green.svg)](https://www.npmjs.com/package/@liskhq/lisk-api-client)  | An API client for the Lisk network                                 |
| [@liskhq/lisk-constants](../lisk-constants)       |  [![](https://img.shields.io/badge/npm-v1.2.0-green.svg)](https://www.npmjs.com/package/@liskhq/lisk-constants)   | General constants for use with Lisk-related software               |
| [@liskhq/lisk-cryptography](../lisk-cryptography) | [![](https://img.shields.io/badge/npm-v2.0.0-green.svg)](https://www.npmjs.com/package/@liskhq/lisk-cryptography) | General cryptographic functions for use with Lisk-related software |
| [@liskhq/lisk-passphrase](../lisk-passphrase)     |  [![](https://img.shields.io/badge/npm-v2.0.0-green.svg)](https://www.npmjs.com/package/@liskhq/lisk-passphrase)  | Mnemonic passphrase helpers for use with Lisk-related software     |
| [@liskhq/lisk-transactions](../lisk-transactions) | [![](https://img.shields.io/badge/npm-v2.0.0-green.svg)](https://www.npmjs.com/package/@liskhq/lisk-transactions) | Everything related to transactions according to the Lisk protocol  |

## License

Copyright © 2016-2018 Lisk Foundation

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the [GNU General Public License](https://github.com/LiskHQ/lisk-elements/tree/master/LICENSE) along with this program.  If not, see <http://www.gnu.org/licenses/>.

***

This program also incorporates work previously released with lisk-js `v0.5.2` (and earlier) versions under the [MIT License](https://opensource.org/licenses/MIT). To comply with the requirements of that license, the following permission notice, applicable to those parts of the code only, is included below:

Copyright © 2016-2017 Lisk Foundation

Copyright © 2015 Crypti

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


[Lisk Core GitHub]: https://github.com/LiskHQ/lisk
[Lisk documentation site]: https://lisk.io/documentation/lisk-elements


================================================
FILE: packages/lisk-client/index.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
Open the console to get started with Lisk Client.
<div id="output"></div>

<script src="dist-browser/lisk-client.min.js"></script>

</body>
</html>


================================================
FILE: packages/lisk-client/package.json
================================================
{
	"name": "@liskhq/lisk-client",
	"version": "2.0.0",
	"description": "A default set of Elements for use by clients of the Lisk network",
	"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
	"license": "GPL-3.0",
	"keywords": [
		"lisk",
		"blockchain"
	],
	"homepage": "https://github.com/LiskHQ/lisk-elements/tree/master/packages/lisk-client#readme",
	"repository": {
		"type": "git",
		"url": "git+https://github.com/LiskHQ/lisk-elements.git"
	},
	"bugs": {
		"url": "https://github.com/LiskHQ/lisk-elements/issues"
	},
	"engines": {
		"node": ">=8.10 <=10",
		"npm": ">=5"
	},
	"main": "dist-node/index.js",
	"scripts": {
		"prestart": "./scripts/prestart.sh",
		"start": "./scripts/start.sh",
		"transpile": "tsc",
		"transpile:browsertest": "tsc -p tsconfig.browsertest.json",
		"browserify": "browserify ./dist-node/index.js -o ./dist-browser/index.js -s lisk",
		"browserify:browsertest": "browserify ./browsertest.build/test/*.js -o ./browsertest.build/browsertest.js -s lisk",
		"uglify": "uglifyjs -nm -o ./dist-browser/index.min.js ./dist-browser/index.js",
		"uglify:browsertest": "uglifyjs -o ./browsertest.build/browsertest.min.js ./browsertest.build/browsertest.js",
		"clean": "./scripts/clean.sh",
		"format": "prettier --write \"*.{js,json}\" \"{src,test}/**/*.{js,json}\"",
		"lint": "tslint --format verbose --project .",
		"lint:fix": "npm run lint -- --fix",
		"test": "TS_NODE_PROJECT=./test/tsconfig.json nyc mocha test/**/*.ts test/**/**/*.ts",
		"test:watch": "npm test -- --watch",
		"test:watch:min": "npm run test:watch -- --reporter=min",
		"test:node": "npm run build:check",
		"serve:start": "http-server -p 11546 ./browsertest &",
		"serve:stop": "kill $(lsof -t -i:11546) || true",
		"pretest:browser": "npm run serve:stop && npm run build:browsertest && npm run serve:start",
		"test:browser": "wait-on http://localhost:11546 && cypress run --config baseUrl=http://localhost:11546 --env ROOT_DIR=\"${PWD##*/}\"",
		"posttest:browser": "npm run serve:stop",
		"cover": "if [ -z $JENKINS_HOME ]; then npm run cover:local; else npm run cover:ci; fi",
		"cover:base": "NODE_ENV=test nyc report",
		"cover:local": "npm run cover:base -- --reporter=html --reporter=text",
		"cover:ci": "npm run cover:base -- --reporter=text",
		"build:browsertest": "npm run transpile:browsertest && npm run browserify:browsertest && npm run uglify:browsertest",
		"postbuild:browsertest": "rm -r browsertest.build/src browsertest.build/test",
		"prebuild:node": "rm -r dist-node/* || mkdir dist-node || true",
		"build:node": "npm run transpile",
		"prebuild:browser": "rm ./dist-browser/index.js ./dist-browser/index.min.js || true",
		"build:browser": "npm run build:node && npm run browserify && npm run uglify",
		"prebuild": "npm run prebuild:browser",
		"build": "npm run build:browser",
		"build:check": "node -e \"require('./dist-node')\"",
		"prepublishOnly": "npm run lint && npm test && npm run build && npm run build:check"
	},
	"dependencies": {
		"@liskhq/lisk-api-client": "2.0.0",
		"@liskhq/lisk-constants": "1.2.0",
		"@liskhq/lisk-cryptography": "2.0.0",
		"@liskhq/lisk-passphrase": "2.0.0",
		"@liskhq/lisk-transactions": "2.0.0",
		"@types/node": "10.10.1"
	},
	"devDependencies": {
		"@types/chai": "4.1.5",
		"@types/expect": "1.20.3",
		"@types/jquery": "3.3.22",
		"@types/mocha": "5.2.5",
		"browserify": "16.2.2",
		"chai": "4.1.2",
		"cypress": "3.1.0",
		"http-server": "0.11.1",
		"mocha": "5.2.0",
		"nyc": "13.0.1",
		"prettier": "1.14.2",
		"source-map-support": "0.5.9",
		"ts-node": "7.0.1",
		"tsconfig-paths": "3.6.0",
		"tslint": "5.11.0",
		"tslint-config-prettier": "1.15.0",
		"tslint-immutable": "4.7.0",
		"typescript": "3.0.3",
		"uglify-es": "3.3.9",
		"wait-on": "3.0.1"
	}
}


================================================
FILE: packages/lisk-client/scripts/prestart.sh
================================================
read -r -p $'\e[96mDo you want to build Lisk Client first? [y/N]\e[0m ' should_build
if [[ $should_build =~ ^[Yy]$ ]]
then
	npm run build:node
fi


================================================
FILE: packages/lisk-client/scripts/start.sh
================================================
node -i -e "global.lisk = require('./dist-node').default; console.log('\\x1b[34m', 'The global \`lisk\` was initialised', '\\x1b[0m')"


================================================
FILE: packages/lisk-client/src/index.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { APIClient as APIClientModule } from '@liskhq/lisk-api-client';
import * as constantsModule from '@liskhq/lisk-constants';
import * as cryptographyModule from '@liskhq/lisk-cryptography';
import * as passphraseModule from '@liskhq/lisk-passphrase';
import * as transactionModule from '@liskhq/lisk-transactions';

// tslint:disable-next-line variable-name
export const APIClient = APIClientModule;
export const constants = constantsModule;
export const cryptography = cryptographyModule;
export const passphrase = passphraseModule;
export const transaction = transactionModule;

// tslint:disable-next-line no-default-export
export default {
	APIClient,
	constants,
	cryptography,
	passphrase,
	transaction,
};


================================================
FILE: packages/lisk-client/test/_setup.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import 'chai/register-expect';

process.env.NODE_ENV = 'test';


================================================
FILE: packages/lisk-client/test/index.ts
================================================
/*
 * Copyright © 2018 Lisk Foundation
 *
 * See the LICENSE file at the top-level directory of this distribution
 * for licensing information.
 *
 * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
 * no part of this software, including this file, may be copied, modified,
 * propagated, or distributed except according to the terms contained in the
 * LICENSE file.
 *
 * Removal or modification of this copyright notice is prohibited.
 *
 */
import { expect } from 'chai';
import {
	APIClient,
	constants,
	cryptography,
	passphrase,
	transaction,
} from '../src';

describe('lisk-client', () => {
	it('APIClient should be a function', () => {
		return expect(APIClient).to.be.a('function');
	});

	it('constants should be an object', () => {
		return expect(constants).to.be.an('object');
	});

	it('cryptography should be an object', () => {
		return expect(cryptograp
Download .txt
gitextract_nwrllr62/

├── .editorconfig
├── .gitignore
├── .lintstagedrc.json
├── .nvmrc
├── Jenkinsfile
├── Jenkinsfile.nightly
├── LICENSE
├── docs/
│   ├── CODE_OF_CONDUCT.md
│   ├── CONTRIBUTING.md
│   ├── ISSUE_TEMPLATE.md
│   └── PULL_REQUEST_TEMPLATE.md
├── lerna.json
├── package.json
├── packages/
│   ├── lisk-api-client/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── api_client.ts
│   │   │   ├── api_method.ts
│   │   │   ├── api_resource.ts
│   │   │   ├── api_types.ts
│   │   │   ├── constants.ts
│   │   │   ├── errors.ts
│   │   │   ├── index.ts
│   │   │   ├── resources/
│   │   │   │   ├── accounts.ts
│   │   │   │   ├── blocks.ts
│   │   │   │   ├── dapps.ts
│   │   │   │   ├── delegates.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── node.ts
│   │   │   │   ├── peers.ts
│   │   │   │   ├── signatures.ts
│   │   │   │   ├── transactions.ts
│   │   │   │   ├── voters.ts
│   │   │   │   └── votes.ts
│   │   │   └── utils.ts
│   │   └── test/
│   │       ├── _global_hooks.ts
│   │       ├── _setup.ts
│   │       ├── api_client.ts
│   │       ├── api_method.ts
│   │       ├── api_resource.ts
│   │       ├── constants.ts
│   │       ├── errors.ts
│   │       ├── index.ts
│   │       ├── mocha.opts
│   │       ├── resources/
│   │       │   ├── accounts.ts
│   │       │   ├── blocks.ts
│   │       │   ├── dapps.ts
│   │       │   ├── delegates.ts
│   │       │   ├── node.ts
│   │       │   ├── peers.ts
│   │       │   ├── signatures.ts
│   │       │   ├── transactions.ts
│   │       │   ├── voters.ts
│   │       │   └── votes.ts
│   │       └── utils.ts
│   ├── lisk-client/
│   │   ├── README.md
│   │   ├── index.html
│   │   ├── package.json
│   │   ├── scripts/
│   │   │   ├── prestart.sh
│   │   │   └── start.sh
│   │   ├── src/
│   │   │   └── index.ts
│   │   └── test/
│   │       ├── _setup.ts
│   │       └── index.ts
│   ├── lisk-constants/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── package.json
│   │   ├── src/
│   │   │   └── index.ts
│   │   └── test/
│   │       ├── _setup.ts
│   │       └── index.ts
│   ├── lisk-cryptography/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── benchmark/
│   │   │   └── nacl.js
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── buffer.ts
│   │   │   ├── constants.ts
│   │   │   ├── convert.ts
│   │   │   ├── encrypt.ts
│   │   │   ├── hash.ts
│   │   │   ├── index.ts
│   │   │   ├── keys.ts
│   │   │   ├── nacl/
│   │   │   │   ├── fast.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── nacl_types.ts
│   │   │   │   └── slow.ts
│   │   │   └── sign.ts
│   │   ├── test/
│   │   │   ├── _global_hooks.ts
│   │   │   ├── _setup.ts
│   │   │   ├── buffer.ts
│   │   │   ├── convert.ts
│   │   │   ├── encrypt.ts
│   │   │   ├── hash.ts
│   │   │   ├── helpers/
│   │   │   │   └── index.ts
│   │   │   ├── index.ts
│   │   │   ├── keys.ts
│   │   │   ├── mocha.opts
│   │   │   ├── nacl/
│   │   │   │   ├── index.ts
│   │   │   │   └── nacl.ts
│   │   │   ├── sign.ts
│   │   │   └── tsconfig.json
│   │   └── types/
│   │       ├── browserify-bignum/
│   │       │   └── index.d.ts
│   │       ├── buffer-reverse/
│   │       │   └── index.d.ts
│   │       ├── sodium-native/
│   │       │   └── index.d.ts
│   │       └── varuint-bitcoin/
│   │           └── index.d.ts
│   ├── lisk-elements/
│   │   ├── README.md
│   │   ├── index.html
│   │   ├── package.json
│   │   ├── scripts/
│   │   │   ├── prestart.sh
│   │   │   └── start.sh
│   │   ├── src/
│   │   │   └── index.ts
│   │   └── test/
│   │       ├── _setup.ts
│   │       └── index.ts
│   ├── lisk-passphrase/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── index.ts
│   │   │   └── validation.ts
│   │   └── test/
│   │       ├── _setup.ts
│   │       ├── index.ts
│   │       └── validation.ts
│   └── lisk-transactions/
│       ├── LICENSE
│       ├── README.md
│       ├── fixtures/
│       │   ├── invalid_transactions.json
│       │   └── transactions.json
│       ├── package.json
│       ├── src/
│       │   ├── 0_transfer.ts
│       │   ├── 1_register_second_passphrase.ts
│       │   ├── 2_register_delegate.ts
│       │   ├── 3_cast_votes.ts
│       │   ├── 4_register_multisignature_account.ts
│       │   ├── 5_create_dapp.ts
│       │   ├── constants.ts
│       │   ├── create_signature_object.ts
│       │   ├── index.ts
│       │   ├── transaction_types.ts
│       │   └── utils/
│       │       ├── format.ts
│       │       ├── get_address_and_public_key_from_recipient_data.ts
│       │       ├── get_transaction_bytes.ts
│       │       ├── get_transaction_hash.ts
│       │       ├── get_transaction_id.ts
│       │       ├── index.ts
│       │       ├── prepare_transaction.ts
│       │       ├── sign_and_verify.ts
│       │       ├── sign_raw_transaction.ts
│       │       ├── time.ts
│       │       └── validation/
│       │           ├── index.ts
│       │           ├── schema.ts
│       │           ├── validate_transaction.ts
│       │           ├── validation.ts
│       │           └── validator.ts
│       ├── test/
│       │   ├── 0_transfer.ts
│       │   ├── 1_register_second_passphrase.ts
│       │   ├── 2_register_delegate.ts
│       │   ├── 3_cast_votes.ts
│       │   ├── 4_register_multisignature_account.ts
│       │   ├── 5_create_dapp.ts
│       │   ├── _global_hooks.ts
│       │   ├── _setup.ts
│       │   ├── constants.ts
│       │   ├── create_signature_object.ts
│       │   ├── index.ts
│       │   ├── mocha.opts
│       │   ├── tsconfig.json
│       │   └── utils/
│       │       ├── format.ts
│       │       ├── get_transaction_bytes.ts
│       │       ├── get_transaction_hash.ts
│       │       ├── get_transaction_id.ts
│       │       ├── index.ts
│       │       ├── prepare_transaction.ts
│       │       ├── sign_and_verify.ts
│       │       ├── sign_raw_transaction.ts
│       │       ├── time.ts
│       │       └── validation/
│       │           ├── validate_transaction.ts
│       │           ├── validation.ts
│       │           └── validator.ts
│       └── types/
│           ├── ajv-merge-patch/
│           │   └── index.d.ts
│           └── browserify-bignum/
│               └── index.d.ts
├── scripts/
│   └── init.sh
├── templates/
│   ├── .npmignore.tmpl
│   ├── .npmrc.tmpl
│   ├── .nycrc-ts.tmpl
│   ├── .prettierignore.tmpl
│   ├── .prettierrc.json.tmpl
│   ├── browsertest.tmpl/
│   │   ├── .eslintrc.json
│   │   ├── browsertest.html
│   │   ├── browsertest.min.html
│   │   ├── run_tests.js
│   │   └── setup.js
│   ├── cypress.json.tmpl
│   ├── cypress.tmpl/
│   │   └── integration/
│   │       └── index.js
│   ├── mocha.opts.ts.tmpl
│   ├── scripts.tmpl/
│   │   └── clean.sh
│   ├── tsconfig-test.json.tmpl
│   ├── tsconfig.browsertest.json.tmpl
│   ├── tsconfig.json.tmpl
│   ├── tslint-test.json.tmpl
│   └── tslint.json.tmpl
├── tsconfig.json
├── tslint.json
├── tslint.test.json
└── types/
    ├── chai/
    │   └── index.d.ts
    ├── globals/
    │   └── index.d.ts
    └── json/
        └── index.d.ts
Download .txt
SYMBOL INDEX (170 symbols across 47 files)

FILE: packages/lisk-api-client/src/api_client.ts
  type ClientOptions (line 58) | interface ClientOptions {
  class APIClient (line 64) | class APIClient {
    method constants (line 65) | public static get constants(): typeof constants {
    method createMainnetAPIClient (line 69) | public static createMainnetAPIClient(options?: InitOptions): APIClient {
    method createTestnetAPIClient (line 76) | public static createTestnetAPIClient(options?: InitOptions): APIClient {
    method constructor (line 99) | public constructor(
    method banActiveNode (line 116) | public banActiveNode(): boolean {
    method banActiveNodeAndSelect (line 120) | public banActiveNodeAndSelect(): boolean {
    method banNode (line 129) | public banNode(node: string): boolean {
    method getNewNode (line 139) | public getNewNode(): string {
    method hasAvailableNodes (line 153) | public hasAvailableNodes(): boolean {
    method initialize (line 157) | public initialize(
    method isBanned (line 185) | public isBanned(node: string): boolean {

FILE: packages/lisk-api-client/src/api_resource.ts
  constant API_RECONNECT_MAX_RETRY_COUNT (line 20) | const API_RECONNECT_MAX_RETRY_COUNT = 3;
  constant REQUEST_RETRY_TIMEOUT (line 22) | const REQUEST_RETRY_TIMEOUT = 1000;
  class APIResource (line 24) | class APIResource {
    method constructor (line 28) | public constructor(apiClient: APIClient) {
    method headers (line 33) | public get headers(): HashMap {
    method resourcePath (line 37) | public get resourcePath(): string {
    method handleRetry (line 41) | public async handleRetry(
    method request (line 66) | public async request(

FILE: packages/lisk-api-client/src/api_types.ts
  type APIHandler (line 16) | type APIHandler = (
  type APIResponse (line 21) | interface APIResponse {
  type APIErrorResponse (line 27) | interface APIErrorResponse {
  type APIErrorContents (line 33) | interface APIErrorContents {
  type HashMap (line 38) | interface HashMap {
  type InitOptions (line 42) | interface InitOptions {
  type RequestConfig (line 50) | interface RequestConfig {
  type Resource (line 59) | interface Resource {

FILE: packages/lisk-api-client/src/constants.ts
  constant GET (line 15) | const GET = 'GET';
  constant POST (line 16) | const POST = 'POST';
  constant PUT (line 17) | const PUT = 'PUT';
  constant TESTNET_NETHASH (line 19) | const TESTNET_NETHASH =
  constant MAINNET_NETHASH (line 21) | const MAINNET_NETHASH =
  constant TESTNET_NODES (line 24) | const TESTNET_NODES: ReadonlyArray<string> = [
  constant MAINNET_NODES (line 27) | const MAINNET_NODES: ReadonlyArray<string> = [

FILE: packages/lisk-api-client/src/errors.ts
  type APIErrorData (line 5) | interface APIErrorData {
  class APIError (line 10) | class APIError extends VError {
    method constructor (line 14) | public constructor(

FILE: packages/lisk-api-client/src/resources/accounts.ts
  class AccountsResource (line 21) | class AccountsResource extends APIResource {
    method constructor (line 27) | public constructor(apiClient: APIClient) {

FILE: packages/lisk-api-client/src/resources/blocks.ts
  class BlocksResource (line 21) | class BlocksResource extends APIResource {
    method constructor (line 25) | public constructor(apiClient: APIClient) {

FILE: packages/lisk-api-client/src/resources/dapps.ts
  class DappsResource (line 21) | class DappsResource extends APIResource {
    method constructor (line 25) | public constructor(apiClient: APIClient) {

FILE: packages/lisk-api-client/src/resources/delegates.ts
  class DelegatesResource (line 21) | class DelegatesResource extends APIResource {
    method constructor (line 28) | public constructor(apiClient: APIClient) {

FILE: packages/lisk-api-client/src/resources/node.ts
  class NodeResource (line 21) | class NodeResource extends APIResource {
    method constructor (line 29) | public constructor(apiClient: APIClient) {

FILE: packages/lisk-api-client/src/resources/peers.ts
  class PeersResource (line 21) | class PeersResource extends APIResource {
    method constructor (line 25) | public constructor(apiClient: APIClient) {

FILE: packages/lisk-api-client/src/resources/signatures.ts
  class SignaturesResource (line 21) | class SignaturesResource extends APIResource {
    method constructor (line 25) | public constructor(apiClient: APIClient) {

FILE: packages/lisk-api-client/src/resources/transactions.ts
  class TransactionsResource (line 21) | class TransactionsResource extends APIResource {
    method constructor (line 25) | public constructor(apiClient: APIClient) {

FILE: packages/lisk-api-client/src/resources/voters.ts
  class VotersResource (line 21) | class VotersResource extends APIResource {
    method constructor (line 25) | public constructor(apiClient: APIClient) {

FILE: packages/lisk-api-client/src/resources/votes.ts
  class VotesResource (line 21) | class VotesResource extends APIResource {
    method constructor (line 25) | public constructor(apiClient: APIClient) {

FILE: packages/lisk-api-client/test/api_resource.ts
  type FakeAPIClient (line 48) | interface FakeAPIClient {

FILE: packages/lisk-constants/src/index.ts
  constant EPOCH_TIME (line 16) | const EPOCH_TIME = new Date(Date.UTC(2016, 4, 24, 17, 0, 0, 0));
  constant EPOCH_TIME_MILLISECONDS (line 17) | const EPOCH_TIME_MILLISECONDS = EPOCH_TIME.getTime();
  constant MS_FACTOR (line 18) | const MS_FACTOR = 1000;
  constant EPOCH_TIME_SECONDS (line 19) | const EPOCH_TIME_SECONDS = Math.floor(EPOCH_TIME.getTime() / MS_FACTOR);
  constant MAX_EIGHT_BYTE_NUMBER (line 23) | const MAX_EIGHT_BYTE_NUMBER = '18446744073709551615';
  constant MAX_ADDRESS_NUMBER (line 25) | const MAX_ADDRESS_NUMBER = MAX_EIGHT_BYTE_NUMBER;
  constant MAX_TRANSACTION_ID (line 26) | const MAX_TRANSACTION_ID = MAX_EIGHT_BYTE_NUMBER;
  constant MAX_TRANSACTION_AMOUNT (line 28) | const MAX_TRANSACTION_AMOUNT = '9223372036854775807';
  constant SIGNED_MESSAGE_PREFIX (line 30) | const SIGNED_MESSAGE_PREFIX = 'Lisk Signed Message:\n';
  constant TESTNET_NETHASH (line 32) | const TESTNET_NETHASH =
  constant MAINNET_NETHASH (line 34) | const MAINNET_NETHASH =

FILE: packages/lisk-cryptography/src/constants.ts
  constant SIGNED_MESSAGE_PREFIX (line 15) | const SIGNED_MESSAGE_PREFIX = 'Lisk Signed Message:\n';

FILE: packages/lisk-cryptography/src/encrypt.ts
  constant PBKDF2_ITERATIONS (line 21) | const PBKDF2_ITERATIONS = 1e6;
  constant PBKDF2_KEYLEN (line 22) | const PBKDF2_KEYLEN = 32;
  constant PBKDF2_HASH_FUNCTION (line 23) | const PBKDF2_HASH_FUNCTION = 'sha256';
  constant ENCRYPTION_VERSION (line 24) | const ENCRYPTION_VERSION = '1';
  type EncryptedMessageWithNonce (line 26) | interface EncryptedMessageWithNonce {
  type EncryptedPassphraseObject (line 132) | interface EncryptedPassphraseObject {

FILE: packages/lisk-cryptography/src/keys.ts
  type KeypairBytes (line 20) | interface KeypairBytes {
  type Keypair (line 25) | interface Keypair {

FILE: packages/lisk-cryptography/src/nacl/index.ts
  constant NACL_SIGN_PUBLICKEY_LENGTH (line 33) | const NACL_SIGN_PUBLICKEY_LENGTH = 32;
  constant NACL_SIGN_SIGNATURE_LENGTH (line 35) | const NACL_SIGN_SIGNATURE_LENGTH = 64;

FILE: packages/lisk-cryptography/src/nacl/nacl_types.ts
  type NaclInterface (line 3) | interface NaclInterface {

FILE: packages/lisk-cryptography/src/sign.ts
  constant SIGNED_MESSAGE_PREFIX_BYTES (line 36) | const SIGNED_MESSAGE_PREFIX_BYTES = Buffer.from(SIGNED_MESSAGE_PREFIX, '...
  constant SIGNED_MESSAGE_PREFIX_LENGTH (line 37) | const SIGNED_MESSAGE_PREFIX_LENGTH = encodeVarInt(SIGNED_MESSAGE_PREFIX....
  type SignedMessageWithOnePassphrase (line 39) | interface SignedMessageWithOnePassphrase {
  type SignedMessageWithTwoPassphrases (line 99) | interface SignedMessageWithTwoPassphrases {
  type SingleOrDoubleSignedMessage (line 178) | interface SingleOrDoubleSignedMessage {

FILE: packages/lisk-cryptography/test/nacl/index.ts
  type naclLibrary (line 29) | interface naclLibrary extends NaclInterface {

FILE: packages/lisk-cryptography/test/nacl/nacl.ts
  type library (line 53) | interface library {

FILE: packages/lisk-cryptography/types/browserify-bignum/index.d.ts
  class BigNum (line 5) | class BigNum {
  type BigNumCompatible (line 115) | type BigNumCompatible = BigNum | number | string;
  type BufferOptions (line 117) | interface BufferOptions {

FILE: packages/lisk-passphrase/src/validation.ts
  type PassphraseRegularExpression (line 17) | interface PassphraseRegularExpression {
  type PassphraseError (line 21) | interface PassphraseError {

FILE: packages/lisk-transactions/src/0_transfer.ts
  type TransferInputs (line 37) | interface TransferInputs {

FILE: packages/lisk-transactions/src/1_register_second_passphrase.ts
  type SecondPassphraseInputs (line 23) | interface SecondPassphraseInputs {

FILE: packages/lisk-transactions/src/2_register_delegate.ts
  type RegisterDelegateInputs (line 19) | interface RegisterDelegateInputs {

FILE: packages/lisk-transactions/src/3_cast_votes.ts
  type CastVoteInputs (line 25) | interface CastVoteInputs {
  type VotesObject (line 33) | interface VotesObject {

FILE: packages/lisk-transactions/src/4_register_multisignature_account.ts
  type RegisterMultisignatureInputs (line 33) | interface RegisterMultisignatureInputs {

FILE: packages/lisk-transactions/src/5_create_dapp.ts
  type DappOptions (line 19) | interface DappOptions {
  type DappInputs (line 29) | interface DappInputs {

FILE: packages/lisk-transactions/src/constants.ts
  constant FIXED_POINT (line 16) | const FIXED_POINT = 10 ** 8;
  constant TRANSFER_FEE (line 18) | const TRANSFER_FEE = FIXED_POINT * 0.1;
  constant IN_TRANSFER_FEE (line 19) | const IN_TRANSFER_FEE = FIXED_POINT * 0.1;
  constant OUT_TRANSFER_FEE (line 20) | const OUT_TRANSFER_FEE = FIXED_POINT * 0.1;
  constant SIGNATURE_FEE (line 21) | const SIGNATURE_FEE = FIXED_POINT * 5;
  constant DELEGATE_FEE (line 22) | const DELEGATE_FEE = FIXED_POINT * 25;
  constant VOTE_FEE (line 23) | const VOTE_FEE = FIXED_POINT * 1;
  constant MULTISIGNATURE_FEE (line 24) | const MULTISIGNATURE_FEE = FIXED_POINT * 5;
  constant MULTISIGNATURE_MAX_LIFETIME (line 25) | const MULTISIGNATURE_MAX_LIFETIME = 72;
  constant MULTISIGNATURE_MIN_LIFETIME (line 26) | const MULTISIGNATURE_MIN_LIFETIME = 1;
  constant MULTISIGNATURE_MAX_KEYSGROUP (line 27) | const MULTISIGNATURE_MAX_KEYSGROUP = 15;
  constant MULTISIGNATURE_MIN_KEYSGROUP (line 28) | const MULTISIGNATURE_MIN_KEYSGROUP = 1;
  constant DAPP_FEE (line 29) | const DAPP_FEE = FIXED_POINT * 25;
  constant USERNAME_MAX_LENGTH (line 30) | const USERNAME_MAX_LENGTH = 20;
  constant BYTESIZES (line 32) | const BYTESIZES = {
  constant EPOCH_TIME (line 43) | const EPOCH_TIME = new Date(Date.UTC(2016, 4, 24, 17, 0, 0, 0));
  constant EPOCH_TIME_MILLISECONDS (line 44) | const EPOCH_TIME_MILLISECONDS = EPOCH_TIME.getTime();
  constant MS_FACTOR (line 45) | const MS_FACTOR = 1000;
  constant EPOCH_TIME_SECONDS (line 46) | const EPOCH_TIME_SECONDS = Math.floor(EPOCH_TIME.getTime() / MS_FACTOR);
  constant MAX_EIGHT_BYTE_NUMBER (line 50) | const MAX_EIGHT_BYTE_NUMBER = '18446744073709551615';
  constant MAX_ADDRESS_NUMBER (line 52) | const MAX_ADDRESS_NUMBER = MAX_EIGHT_BYTE_NUMBER;
  constant MAX_TRANSACTION_ID (line 53) | const MAX_TRANSACTION_ID = MAX_EIGHT_BYTE_NUMBER;
  constant MAX_TRANSACTION_AMOUNT (line 55) | const MAX_TRANSACTION_AMOUNT = '9223372036854775807';

FILE: packages/lisk-transactions/src/create_signature_object.ts
  type SignatureObject (line 19) | interface SignatureObject {

FILE: packages/lisk-transactions/src/transaction_types.ts
  type BaseTransaction (line 15) | interface BaseTransaction {
  type Partial (line 32) | type Partial<T> = { [P in keyof T]?: T[P] };
  type PartialTransaction (line 34) | type PartialTransaction = Partial<BaseTransaction>;
  type TransactionAsset (line 36) | type TransactionAsset =
  type TransferTransaction (line 46) | interface TransferTransaction extends BaseTransaction {
  type TransferAsset (line 50) | interface TransferAsset {
  type SecondSignatureTransaction (line 54) | interface SecondSignatureTransaction extends BaseTransaction {
  type SecondSignatureAsset (line 58) | interface SecondSignatureAsset {
  type DelegateTransaction (line 64) | interface DelegateTransaction extends BaseTransaction {
  type DelegateAsset (line 68) | interface DelegateAsset {
  type VoteTransaction (line 74) | interface VoteTransaction extends BaseTransaction {
  type VoteAsset (line 78) | interface VoteAsset {
  type MultiSignatureTransaction (line 82) | interface MultiSignatureTransaction extends BaseTransaction {
  type MultiSignatureAsset (line 86) | interface MultiSignatureAsset {
  type DappTransaction (line 94) | interface DappTransaction extends BaseTransaction {
  type DappAsset (line 98) | interface DappAsset {
  type InTransferTransaction (line 110) | interface InTransferTransaction extends BaseTransaction {
  type InTransferAsset (line 114) | interface InTransferAsset {
  type OutTransferTransaction (line 120) | interface OutTransferTransaction extends BaseTransaction {
  type OutTransferAsset (line 124) | interface OutTransferAsset {

FILE: packages/lisk-transactions/src/utils/format.ts
  constant BASE_10 (line 19) | const BASE_10 = 10;
  constant LISK_MAX_DECIMAL_POINTS (line 20) | const LISK_MAX_DECIMAL_POINTS = 8;

FILE: packages/lisk-transactions/src/utils/get_address_and_public_key_from_recipient_data.ts
  type RecipientIdAndPublicKey (line 17) | interface RecipientIdAndPublicKey {

FILE: packages/lisk-transactions/src/utils/get_transaction_bytes.ts
  constant DAPP_TYPE_LENGTH (line 113) | const DAPP_TYPE_LENGTH = 4;
  constant DAPP_CATEGORY_LENGTH (line 114) | const DAPP_CATEGORY_LENGTH = 4;
  constant REQUIRED_TRANSACTION_PARAMETERS (line 184) | const REQUIRED_TRANSACTION_PARAMETERS: ReadonlyArray<string> = [

FILE: packages/lisk-transactions/src/utils/sign_raw_transaction.ts
  type SignRawTransactionInput (line 20) | interface SignRawTransactionInput {

FILE: packages/lisk-transactions/src/utils/time.ts
  constant MS_TIME (line 18) | const MS_TIME = 1000;

FILE: packages/lisk-transactions/src/utils/validation/validate_transaction.ts
  constant TRANSACTION_TYPE_MULTI_SIGNATURE (line 23) | const TRANSACTION_TYPE_MULTI_SIGNATURE = 4;
  type ValidationResult (line 43) | interface ValidationResult {

FILE: packages/lisk-transactions/src/utils/validation/validation.ts
  constant MAX_PUBLIC_KEY_LENGTH (line 27) | const MAX_PUBLIC_KEY_LENGTH = 32;
  constant MIN_ADDRESS_LENGTH (line 67) | const MIN_ADDRESS_LENGTH = 2;
  constant MAX_ADDRESS_LENGTH (line 68) | const MAX_ADDRESS_LENGTH = 22;
  constant BASE_TEN (line 69) | const BASE_TEN = 10;

FILE: packages/lisk-transactions/types/browserify-bignum/index.d.ts
  class BigNum (line 5) | class BigNum {
  type BigNumCompatible (line 115) | type BigNumCompatible = BigNum | number | string;
  type BufferOptions (line 117) | interface BufferOptions {

FILE: templates/cypress.tmpl/integration/index.js
  constant ROOT_DIR (line 15) | const ROOT_DIR = Cypress.env('ROOT_DIR');
  constant FORCE_RELOAD (line 16) | const FORCE_RELOAD = true;

FILE: types/chai/index.d.ts
  type ChaiStatic (line 5) | interface ChaiStatic {
  type Assert (line 12) | interface Assert {
  type TypeComparison (line 15) | interface TypeComparison {

FILE: types/globals/index.d.ts
  type Global (line 6) | interface Global {
Condensed preview — 203 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (882K chars).
[
  {
    "path": ".editorconfig",
    "chars": 129,
    "preview": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_style = tab\ninsert_final_newline = true\ntrim_trailing_whitespac"
  },
  {
    "path": ".gitignore",
    "chars": 1088,
    "preview": "# General\n.DS_Store\n*.swp\n*.orig\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for in"
  },
  {
    "path": ".lintstagedrc.json",
    "chars": 50,
    "preview": "{\n\t\"*.{ts,js}\": [\"prettier --write\", \"git add\"]\n}\n"
  },
  {
    "path": ".nvmrc",
    "chars": 7,
    "preview": "8.12.0\n"
  },
  {
    "path": "Jenkinsfile",
    "chars": 2761,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "Jenkinsfile.nightly",
    "chars": 460,
    "preview": "pipeline {\n\tagent { node { label 'lisk-elements' } }\n\tstages {\n\t\tstage('Cache dependencies') {\n\t\t\tsteps {\n\t\t\t\tnvm(getNod"
  },
  {
    "path": "LICENSE",
    "chars": 35141,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "docs/CODE_OF_CONDUCT.md",
    "chars": 3205,
    "preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
  },
  {
    "path": "docs/CONTRIBUTING.md",
    "chars": 12295,
    "preview": "# Contributing to Lisk Elements\n\nFirst off, thanks for taking the time to contribute! :raised_hands:\n\nThe following is a"
  },
  {
    "path": "docs/ISSUE_TEMPLATE.md",
    "chars": 133,
    "preview": "### Expected behavior\n\n### Actual behavior\n\n### Steps to reproduce\n\n### Which version(s) does this affect? (Environment,"
  },
  {
    "path": "docs/PULL_REQUEST_TEMPLATE.md",
    "chars": 372,
    "preview": "### What was the problem?\n\n### How did I fix it?\n\n### How to test it?\n\n### Review checklist\n\n* The PR resolves #INSERT_I"
  },
  {
    "path": "lerna.json",
    "chars": 96,
    "preview": "{\n\t\"lerna\": \"2.11.0\",\n\t\"packages\": [\"packages/*\"],\n\t\"version\": \"independent\",\n\t\"stream\": true\n}\n"
  },
  {
    "path": "package.json",
    "chars": 1684,
    "preview": "{\n\t\"name\": \"lisk-elements-monorepo\",\n\t\"private\": true,\n\t\"version\": \"1.0.0\",\n\t\"description\": \"Reusable packages for use w"
  },
  {
    "path": "packages/lisk-api-client/LICENSE",
    "chars": 35141,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "packages/lisk-api-client/README.md",
    "chars": 2424,
    "preview": "# @liskhq/lisk-api-client\n@liskhq/lisk-api-client is containing an API client for the Lisk network\n\n## Installation\n\n```"
  },
  {
    "path": "packages/lisk-api-client/package.json",
    "chars": 3761,
    "preview": "{\n\t\"name\": \"@liskhq/lisk-api-client\",\n\t\"version\": \"2.0.0\",\n\t\"description\": \"An API client for the Lisk network\",\n\t\"autho"
  },
  {
    "path": "packages/lisk-api-client/src/api_client.ts",
    "chars": 5409,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/api_method.ts",
    "chars": 2441,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/api_resource.ts",
    "chars": 2588,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/api_types.ts",
    "chars": 1713,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/constants.ts",
    "chars": 1154,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/errors.ts",
    "chars": 479,
    "preview": "import { VError } from 'verror';\n\nconst defaultErrorNo = 500;\n\nexport interface APIErrorData {\n\treadonly code?: string;\n"
  },
  {
    "path": "packages/lisk-api-client/src/index.ts",
    "chars": 508,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/resources/accounts.ts",
    "chars": 1353,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/resources/blocks.ts",
    "chars": 942,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/resources/dapps.ts",
    "chars": 940,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/resources/delegates.ts",
    "chars": 1461,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/resources/index.ts",
    "chars": 1038,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/resources/node.ts",
    "chars": 1549,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/resources/peers.ts",
    "chars": 940,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/resources/signatures.ts",
    "chars": 964,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/resources/transactions.ts",
    "chars": 1056,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/resources/voters.ts",
    "chars": 942,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/resources/votes.ts",
    "chars": 939,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/src/utils.ts",
    "chars": 1397,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/_global_hooks.ts",
    "chars": 527,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/_setup.ts",
    "chars": 808,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/api_client.ts",
    "chars": 12034,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/api_method.ts",
    "chars": 5567,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/api_resource.ts",
    "chars": 9211,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/constants.ts",
    "chars": 1249,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/errors.ts",
    "chars": 2700,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/index.ts",
    "chars": 722,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/mocha.opts",
    "chars": 191,
    "preview": "--recursive\n--require ts-node/register\n--require tsconfig-paths/register\n--require source-map-support/register\n--require"
  },
  {
    "path": "packages/lisk-api-client/test/resources/accounts.ts",
    "chars": 1896,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/resources/blocks.ts",
    "chars": 1522,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/resources/dapps.ts",
    "chars": 1517,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/resources/delegates.ts",
    "chars": 2010,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/resources/node.ts",
    "chars": 2172,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/resources/peers.ts",
    "chars": 1517,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/resources/signatures.ts",
    "chars": 1554,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/resources/transactions.ts",
    "chars": 1701,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/resources/voters.ts",
    "chars": 1522,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/resources/votes.ts",
    "chars": 1517,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-api-client/test/utils.ts",
    "chars": 2627,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-client/README.md",
    "chars": 4837,
    "preview": "# @liskhq/lisk-client\n\nA default set of Elements for use by clients of the Lisk network\n\n## Installation\n\n### Installati"
  },
  {
    "path": "packages/lisk-client/index.html",
    "chars": 255,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>Title</title>\n</head>\n<body>\nOpen the cons"
  },
  {
    "path": "packages/lisk-client/package.json",
    "chars": 3772,
    "preview": "{\n\t\"name\": \"@liskhq/lisk-client\",\n\t\"version\": \"2.0.0\",\n\t\"description\": \"A default set of Elements for use by clients of "
  },
  {
    "path": "packages/lisk-client/scripts/prestart.sh",
    "chars": 146,
    "preview": "read -r -p $'\\e[96mDo you want to build Lisk Client first? [y/N]\\e[0m ' should_build\nif [[ $should_build =~ ^[Yy]$ ]]\nth"
  },
  {
    "path": "packages/lisk-client/scripts/start.sh",
    "chars": 135,
    "preview": "node -i -e \"global.lisk = require('./dist-node').default; console.log('\\\\x1b[34m', 'The global \\`lisk\\` was initialised'"
  },
  {
    "path": "packages/lisk-client/src/index.ts",
    "chars": 1197,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-client/test/_setup.ts",
    "chars": 541,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-client/test/index.ts",
    "chars": 1141,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-constants/.gitignore",
    "chars": 42,
    "preview": "# Compiled files\nsrc/**/*.js\ntest/**/*.js\n"
  },
  {
    "path": "packages/lisk-constants/LICENSE",
    "chars": 35141,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "packages/lisk-constants/README.md",
    "chars": 2432,
    "preview": "# lisk-constants\n\n@liskhq/lisk-constants is containing general constants for use with Lisk-related software\n\n## Installa"
  },
  {
    "path": "packages/lisk-constants/package.json",
    "chars": 3664,
    "preview": "{\n\t\"name\": \"@liskhq/lisk-constants\",\n\t\"version\": \"1.2.0\",\n\t\"description\": \"General constants for use with Lisk-related s"
  },
  {
    "path": "packages/lisk-constants/src/index.ts",
    "chars": 1456,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-constants/test/_setup.ts",
    "chars": 1212,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-constants/test/index.ts",
    "chars": 1797,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/LICENSE",
    "chars": 35141,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "packages/lisk-cryptography/README.md",
    "chars": 3367,
    "preview": "# @liskhq/lisk-cryptography\n\n@liskhq/lisk-cryptography is containing general cryptographic functions for use with Lisk-r"
  },
  {
    "path": "packages/lisk-cryptography/benchmark/nacl.js",
    "chars": 4469,
    "preview": "/*\n* Copyright © 2018 Lisk Foundation\n*\n* See the LICENSE file at the top-level directory of this distribution\n* for lic"
  },
  {
    "path": "packages/lisk-cryptography/package.json",
    "chars": 3741,
    "preview": "{\n\t\"name\": \"@liskhq/lisk-cryptography\",\n\t\"version\": \"2.0.0\",\n\t\"description\": \"General cryptographic functions for use wi"
  },
  {
    "path": "packages/lisk-cryptography/src/buffer.ts",
    "chars": 1475,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/src/constants.ts",
    "chars": 541,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/src/convert.ts",
    "chars": 3651,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/src/encrypt.ts",
    "chars": 5669,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/src/hash.ts",
    "chars": 1312,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/src/index.ts",
    "chars": 696,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/src/keys.ts",
    "chars": 1907,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/src/nacl/fast.ts",
    "chars": 2450,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/src/nacl/index.ts",
    "chars": 1148,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/src/nacl/nacl_types.ts",
    "chars": 597,
    "preview": "import { KeypairBytes } from '../keys';\n\nexport interface NaclInterface {\n\tbox(\n\t\tmessageInBytes: Buffer,\n\t\tnonceInBytes"
  },
  {
    "path": "packages/lisk-cryptography/src/nacl/slow.ts",
    "chars": 1860,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/src/sign.ts",
    "chars": 7210,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/test/_global_hooks.ts",
    "chars": 49,
    "preview": "afterEach(() => {\n\treturn sandbox.restore();\n});\n"
  },
  {
    "path": "packages/lisk-cryptography/test/_setup.ts",
    "chars": 1336,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/test/buffer.ts",
    "chars": 3811,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/test/convert.ts",
    "chars": 9868,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/test/encrypt.ts",
    "chars": 13090,
    "preview": "/** Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for l"
  },
  {
    "path": "packages/lisk-cryptography/test/hash.ts",
    "chars": 1961,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/test/helpers/index.ts",
    "chars": 611,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/test/index.ts",
    "chars": 690,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/test/keys.ts",
    "chars": 3930,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/test/mocha.opts",
    "chars": 191,
    "preview": "--recursive\n--require ts-node/register\n--require tsconfig-paths/register\n--require source-map-support/register\n--require"
  },
  {
    "path": "packages/lisk-cryptography/test/nacl/index.ts",
    "chars": 4049,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/test/nacl/nacl.ts",
    "chars": 7580,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/test/sign.ts",
    "chars": 12865,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-cryptography/test/tsconfig.json",
    "chars": 239,
    "preview": "{\n\t\"extends\": \"../tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"baseUrl\": \".\",\n\t\t\"declaration\": false,\n\t\t\"target\": \"es2017\",\n\t\t\"ty"
  },
  {
    "path": "packages/lisk-cryptography/types/browserify-bignum/index.d.ts",
    "chars": 8117,
    "preview": "/* tslint:disable:only-arrow-functions member-access readonly-keyword no-any */\n/// <reference types=\"node\" />\n\ndeclare "
  },
  {
    "path": "packages/lisk-cryptography/types/buffer-reverse/index.d.ts",
    "chars": 125,
    "preview": "// tslint:disable only-arrow-functions\ndeclare module 'buffer-reverse' {\n\texport default function(buffer: Buffer): Buffe"
  },
  {
    "path": "packages/lisk-cryptography/types/sodium-native/index.d.ts",
    "chars": 966,
    "preview": "// tslint:disable only-arrow-functions variable-name\ndeclare module 'sodium-native' {\n\texport const crypto_box_MACBYTES:"
  },
  {
    "path": "packages/lisk-cryptography/types/varuint-bitcoin/index.d.ts",
    "chars": 156,
    "preview": "// tslint:disable only-arrow-functions\ndeclare module 'varuint-bitcoin' {\n\texport function encode(num: number, buffer?: "
  },
  {
    "path": "packages/lisk-elements/README.md",
    "chars": 7745,
    "preview": "# Lisk Elements\n\nLisk Elements is a JavaScript library for [Lisk][Lisk Core GitHub], the blockchain application platform"
  },
  {
    "path": "packages/lisk-elements/index.html",
    "chars": 259,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>Title</title>\n</head>\n<body>\nOpen the cons"
  },
  {
    "path": "packages/lisk-elements/package.json",
    "chars": 3758,
    "preview": "{\n\t\"name\": \"lisk-elements\",\n\t\"version\": \"2.0.0\",\n\t\"description\": \"Elements for building blockchain applications in the L"
  },
  {
    "path": "packages/lisk-elements/scripts/prestart.sh",
    "chars": 148,
    "preview": "read -r -p $'\\e[96mDo you want to build Lisk Elements first? [y/N]\\e[0m ' should_build\nif [[ $should_build =~ ^[Yy]$ ]]\n"
  },
  {
    "path": "packages/lisk-elements/scripts/start.sh",
    "chars": 135,
    "preview": "node -i -e \"global.lisk = require('./dist-node').default; console.log('\\\\x1b[34m', 'The global \\`lisk\\` was initialised'"
  },
  {
    "path": "packages/lisk-elements/src/index.ts",
    "chars": 829,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-elements/test/_setup.ts",
    "chars": 541,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-elements/test/index.ts",
    "chars": 1143,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-passphrase/LICENSE",
    "chars": 35141,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "packages/lisk-passphrase/README.md",
    "chars": 2453,
    "preview": "# @liskhq/lisk-passphrase\n\n@liskhq/lisk-passphrase is containing mnemonic passphrase helpers for use with Lisk-related s"
  },
  {
    "path": "packages/lisk-passphrase/package.json",
    "chars": 3555,
    "preview": "{\n\t\"name\": \"@liskhq/lisk-passphrase\",\n\t\"version\": \"2.0.0\",\n\t\"description\": \"Mnemonic passphrase helpers for use with Lis"
  },
  {
    "path": "packages/lisk-passphrase/src/index.ts",
    "chars": 586,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-passphrase/src/validation.ts",
    "chars": 5625,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-passphrase/test/_setup.ts",
    "chars": 1212,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-passphrase/test/index.ts",
    "chars": 986,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-passphrase/test/validation.ts",
    "chars": 19538,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/LICENSE",
    "chars": 35141,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "packages/lisk-transactions/README.md",
    "chars": 2462,
    "preview": "# @liskhq/lisk-transactions\n\n@liskhq/lisk-transactions is containing everything related to transactions according to the"
  },
  {
    "path": "packages/lisk-transactions/fixtures/invalid_transactions.json",
    "chars": 11566,
    "preview": "[\n\t{\n\t\t\"type\":4,\n\t\t\"amount\": \"0\",\n\t\t\"fee\": \"3000000000\",\n\t\t\"recipientId\":null,\n\t\t\"senderPublicKey\":\n\t\t\"c094ebee7ec0c50eb"
  },
  {
    "path": "packages/lisk-transactions/fixtures/transactions.json",
    "chars": 33236,
    "preview": "[\n\t{\n\t\t\"type\": 1,\n\t\t\"amount\": \"0\",\n\t\t\"fee\": \"500000000\",\n\t\t\"recipientId\": \"\",\n\t\t\"senderPublicKey\":\n\t\t\t\"c094ebee7ec0c50eb"
  },
  {
    "path": "packages/lisk-transactions/package.json",
    "chars": 3714,
    "preview": "{\n\t\"name\": \"@liskhq/lisk-transactions\",\n\t\"version\": \"2.0.0\",\n\t\"description\": \"Everything related to transactions accordi"
  },
  {
    "path": "packages/lisk-transactions/src/0_transfer.ts",
    "chars": 2954,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/1_register_second_passphrase.ts",
    "chars": 1621,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/2_register_delegate.ts",
    "chars": 1688,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/3_cast_votes.ts",
    "chars": 2290,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/4_register_multisignature_account.ts",
    "chars": 2771,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/5_create_dapp.ts",
    "chars": 2614,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/constants.ts",
    "chars": 2014,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/create_signature_object.ts",
    "chars": 1314,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/index.ts",
    "chars": 1127,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/transaction_types.ts",
    "chars": 3022,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/format.ts",
    "chars": 2206,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/get_address_and_public_key_from_recipient_data.ts",
    "chars": 1481,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/get_transaction_bytes.ts",
    "chars": 7872,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/get_transaction_hash.ts",
    "chars": 822,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/get_transaction_id.ts",
    "chars": 1099,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/index.ts",
    "chars": 1312,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/prepare_transaction.ts",
    "chars": 2126,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/sign_and_verify.ts",
    "chars": 2304,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/sign_raw_transaction.ts",
    "chars": 1628,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/time.ts",
    "chars": 1053,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/validation/index.ts",
    "chars": 813,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/validation/schema.ts",
    "chars": 4849,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/validation/validate_transaction.ts",
    "chars": 2789,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/validation/validation.ts",
    "chars": 4078,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/src/utils/validation/validator.ts",
    "chars": 2250,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/0_transfer.ts",
    "chars": 9520,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/1_register_second_passphrase.ts",
    "chars": 8022,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/2_register_delegate.ts",
    "chars": 7308,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/3_cast_votes.ts",
    "chars": 12092,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/4_register_multisignature_account.ts",
    "chars": 13726,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/5_create_dapp.ts",
    "chars": 11957,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/_global_hooks.ts",
    "chars": 49,
    "preview": "afterEach(() => {\n\treturn sandbox.restore();\n});\n"
  },
  {
    "path": "packages/lisk-transactions/test/_setup.ts",
    "chars": 1428,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/constants.ts",
    "chars": 2628,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/create_signature_object.ts",
    "chars": 3751,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/index.ts",
    "chars": 1944,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/mocha.opts",
    "chars": 191,
    "preview": "--recursive\n--require ts-node/register\n--require tsconfig-paths/register\n--require source-map-support/register\n--require"
  },
  {
    "path": "packages/lisk-transactions/test/tsconfig.json",
    "chars": 239,
    "preview": "{\n\t\"extends\": \"../tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"baseUrl\": \".\",\n\t\t\"declaration\": false,\n\t\t\"target\": \"es2017\",\n\t\t\"ty"
  },
  {
    "path": "packages/lisk-transactions/test/utils/format.ts",
    "chars": 4541,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/utils/get_transaction_bytes.ts",
    "chars": 28373,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/utils/get_transaction_hash.ts",
    "chars": 2158,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/utils/get_transaction_id.ts",
    "chars": 1934,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/utils/index.ts",
    "chars": 3591,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/utils/prepare_transaction.ts",
    "chars": 4673,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/utils/sign_and_verify.ts",
    "chars": 10969,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/utils/sign_raw_transaction.ts",
    "chars": 9901,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/utils/time.ts",
    "chars": 1802,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/utils/validation/validate_transaction.ts",
    "chars": 6548,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/utils/validation/validation.ts",
    "chars": 11970,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/test/utils/validation/validator.ts",
    "chars": 14316,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "packages/lisk-transactions/types/ajv-merge-patch/index.d.ts",
    "chars": 136,
    "preview": "/* tslint:disable:only-arrow-functions */\ndeclare module 'ajv-merge-patch' {\n\texport default function addKeywords(ajv: o"
  },
  {
    "path": "packages/lisk-transactions/types/browserify-bignum/index.d.ts",
    "chars": 8117,
    "preview": "/* tslint:disable:only-arrow-functions member-access readonly-keyword no-any */\n/// <reference types=\"node\" />\n\ndeclare "
  },
  {
    "path": "scripts/init.sh",
    "chars": 820,
    "preview": "#!/bin/bash\n\n# Unofficial strict mode\nset -euo pipefail\nIFS=$'\\n\\t'\n\npackageName=${1:-}\n\nROOT_PACKAGE_NAME=$(jq --raw-ou"
  },
  {
    "path": "templates/.npmignore.tmpl",
    "chars": 196,
    "preview": ".babelrc\n.eslintignore\n.eslintrc.json\n.gitignore\n.lintstagedrc.json\n.nycrc\n.prettierrc.json\ncypress.json\nindex.html\nJenk"
  },
  {
    "path": "templates/.npmrc.tmpl",
    "chars": 52,
    "preview": "message = \":arrow_up: Version %s\"\nsave-exact = true\n"
  },
  {
    "path": "templates/.nycrc-ts.tmpl",
    "chars": 64,
    "preview": "{\n\t\"exclude\": [\"test/**\", \"**/*.d.ts\"],\n\t\"extension\": [\".ts\"]\n}\n"
  },
  {
    "path": "templates/.prettierignore.tmpl",
    "chars": 177,
    "preview": "package.json\n\n.nyc_output/\ncoverage/\ndist-node/\ndist-browser/\nbrowsertest.build/\nnode_modules/\n\n# BUG: See https://githu"
  },
  {
    "path": "templates/.prettierrc.json.tmpl",
    "chars": 68,
    "preview": "{\n\t\"singleQuote\": true,\n\t\"trailingComma\": \"all\",\n\t\"useTabs\": true\n}\n"
  },
  {
    "path": "templates/browsertest.tmpl/.eslintrc.json",
    "chars": 52,
    "preview": "{\n\t\"env\": {\n\t\t\"mocha\": true,\n\t\t\"browser\": true\n\t}\n}\n"
  },
  {
    "path": "templates/browsertest.tmpl/browsertest.html",
    "chars": 628,
    "preview": "<!DOCTYPE html>\n<html>\n\n<head>\n\t<meta charset=\"utf-8\">\n\t<title>Browser tests</title>\n\t<link rel=\"stylesheet\" media=\"all\""
  },
  {
    "path": "templates/browsertest.tmpl/browsertest.min.html",
    "chars": 632,
    "preview": "<!DOCTYPE html>\n<html>\n\n<head>\n\t<meta charset=\"utf-8\">\n\t<title>Browser tests</title>\n\t<link rel=\"stylesheet\" media=\"all\""
  },
  {
    "path": "templates/browsertest.tmpl/run_tests.js",
    "chars": 638,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "templates/browsertest.tmpl/setup.js",
    "chars": 611,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "templates/cypress.json.tmpl",
    "chars": 66,
    "preview": "{\n\t\"video\": false,\n\t\"pluginsFile\": false,\n\t\"supportFile\": false\n}\n"
  },
  {
    "path": "templates/cypress.tmpl/integration/index.js",
    "chars": 1362,
    "preview": "/*\n * Copyright © 2018 Lisk Foundation\n *\n * See the LICENSE file at the top-level directory of this distribution\n * for"
  },
  {
    "path": "templates/mocha.opts.ts.tmpl",
    "chars": 160,
    "preview": "--recursive\n--require ts-node/register\n--require tsconfig-paths/register\n--require source-map-support/register\n--require"
  },
  {
    "path": "templates/scripts.tmpl/clean.sh",
    "chars": 240,
    "preview": "#!/bin/bash\n\n# Unofficial strict mode\nset -euo pipefail\nIFS=$'\\n\\t'\n\n# Usage\n# npm run clean\n\nrm -rf .nyc_output/\nrm -rf"
  },
  {
    "path": "templates/tsconfig-test.json.tmpl",
    "chars": 227,
    "preview": "{\n\t\"extends\": \"../tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"baseUrl\": \".\",\n\t\t\"declaration\": false,\n\t\t\"target\": \"es2017\",\n\t\t\"ty"
  },
  {
    "path": "templates/tsconfig.browsertest.json.tmpl",
    "chars": 289,
    "preview": "{\n\t\"extends\": \"../../tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"declaration\": false,\n\t\t\"outDir\": \"browsertest.build\",\n\t\t\"baseUr"
  },
  {
    "path": "templates/tsconfig.json.tmpl",
    "chars": 168,
    "preview": "{\n\t\"extends\": \"../../tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"declaration\": true,\n\t\t\"outDir\": \"dist-node\",\n\t\t\"rootDir\": \"./sr"
  },
  {
    "path": "templates/tslint-test.json.tmpl",
    "chars": 46,
    "preview": "{\n\t\"extends\": [\"../../../tslint.test.json\"]\n}\n"
  },
  {
    "path": "templates/tslint.json.tmpl",
    "chars": 36,
    "preview": "{\n\t\"extends\": \"../../tslint.json\"\n}\n"
  },
  {
    "path": "tsconfig.json",
    "chars": 429,
    "preview": "{\n\t\"compilerOptions\": {\n\t\t\"esModuleInterop\": true,\n\t\t\"forceConsistentCasingInFileNames\": true,\n\t\t\"target\": \"es2017\",\n\t\t\""
  },
  {
    "path": "tslint.json",
    "chars": 808,
    "preview": "{\n\t\"defaultSeverity\": \"error\",\n\t\"extends\": [\n\t\t\"tslint:all\",\n\t\t\"tslint-immutable/all\",\n\t\t\"tslint-config-prettier\"\n\t],\n\t\""
  },
  {
    "path": "tslint.test.json",
    "chars": 89,
    "preview": "{\n\t\"rules\": {\n\t\t\"arrow-return-shorthand\": \"off\",\n\t\t\"no-expression-statement\": \"off\"\n\t}\n}\n"
  }
]

// ... and 3 more files (download for full content)

About this extraction

This page contains the full source code of the LiskHQ/lisk-js GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 203 files (781.4 KB), approximately 216.7k tokens, and a symbol index with 170 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!