Packages

This section details how to use Lisk Elements after a successful installation has been completed.

Usage

Node.js

Simply import, (or require) the package and access its functionality according to the relevant namespace.

Example for client package:

import lisk from '@liskhq/lisk-client';
//or
const lisk = require('@liskhq/lisk-client');
const transaction = lisk.transaction.transfer({
    amount: '100000000',
    recipientId: '15434119221255134066L',
    passphrase: 'robust swift grocery peasant forget share enable convince deputy road keep cheap',
});

Example for sub packages:

import * as transactions from '@liskhq/lisk-transactions';

transactions.transfer({
    amount: '123000000',
    recipientId: '12668885769632475474L',
});

Browser

Load the Lisk Elements script via the CDN. For example, to load the minified version 2.3.1 of Lisk Elements, include the following script which will then expose the lisk variable:

<script src="https://js.lisk.io/lisk-client-2.3.1.min.js"></script>
<script>
    const transaction = lisk.transaction.transfer({
        amount: '100000000',
        recipientId: '15434119221255134066L',
        passphrase: 'robust swift grocery peasant forget share enable convince deputy road keep cheap',
    });
</script>