Skip to content

lukso-network/lsp-utils

Repository files navigation

LSP Smart Contracts Utils · npm version

This package was created with the intent to help developers to use @lukso/lsp-smart-contracts. Its purpose is to provide a series of helper functions for each LSP.

⚠️ This package is currently in early stages of development,
use for testing or experimentation purposes only.

Installation

npm

@lukso/lsp-utils is available as a npm package.

npm install @lukso/lsp-utils

cloning the repository

Alternatively you can also clone the repository and install its dependencies to start using the smart contracts.

$ git clone https://github.com/lukso-network/lsp-utils.git
$ cd ./lsp-utils
$ npm install

Usage

in Javascript

You can use the utils by importing them as follow:

ES6 Modules:

import { encodeAllowedCalls } from '@lukso/lsp-utils/dist/lib/es6';

const allowedCalls = encodeAllowedCalls(
    allowedInteractions,
    allowedAddresses,
    allowedStandards,
    allowedFunctions,
);

CommonJS

cosnt { encodeAllowedCalls } = require('@lukso/lsp-utils/dist/lib/es5');

const allowedCalls = encodeAllowedCalls(
    allowedInteractions,
    allowedAddresses,
    allowedStandards,
    allowedFunctions
);

Documentation

For more informations check the docs folder