@moosty/lisk-extended-api
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

lisk-extended-api

Extends api with asset filter.

Install

npm install --save @moosty/lisk-extended-api

Usage

Add module to your Lisk SDK application

import { ExtendedHTTPApiModule } from "@moosty/lisk-extended-api";

app.registerModule(ExtendedHTTPApiModule, {
  port: 1234, // default 2020 
  limit: 1000, // default 100
  assets: [ // allowed assets
    'recipientId',
    'unit.total',
  ],
});

API

The http api is for the transactions and accounts and filters on assets.

Examples:

Asset exists in transaction or account

http://localhost:2020/extended-api/transactions?asset=foo

http://localhost:2020/extended-api/accounts?asset=foo

Asset has specific value:

http://localhost:2020/extended-api/transactions?asset=foo&contains=bar

http://localhost:2020/extended-api/accounts?asset=foo&contains=bar

http://localhost:2020/extended-api/transactions?asset=recipientId&contains=395830482304L&limit=100

http://localhost:2020/extended-api/transactions?asset=nested.field&contains=22&offset=0

Type selection: (Thanks to @tomploem)

http://localhost:2020/extended-api/transactions?asset=foo&contains=bar&type=31

/@moosty/lisk-extended-api/

    Package Sidebar

    Install

    npm i @moosty/lisk-extended-api

    Weekly Downloads

    4

    Version

    0.0.10

    License

    GPL-3.0

    Unpacked Size

    51.9 kB

    Total Files

    15

    Last publish

    Collaborators

    • corbifex
    • moostyteam