Code Monkey home page Code Monkey logo

ima-js's Introduction

SKALE IMA-JS

Discord GitHub Workflow Status NPM npm GitHub top language

IMA-JS is a Typescript/Javascript library which implements client for SKALE Interchain Messaging Agent (IMA).

ℹ️ IMA-JS v2 is based on ethers.js, while v1 was built on top of web3js

Installation

Node

npm install --save @skalenetwork/ima-js

Yarn

yarn add @skalenetwork/ima-js

Usage

Full usage documentation with examples can be found on our docs portal: https://docs.skale.network/ima/1.3.x/

Development

Git clone with submodules

git clone --recurse-submodules --remote-submodules https://github.com/skalenetwork/ima-js

CLI usage

IMA-JS now also available as a standalone command line tool

Installation

VERSION_NUM={RELEASE_NAME_HERE} && sudo -E bash -c "curl -L https://github.com/skalenetwork/ima-js/releases/download/$VERSION_NUM/ima-$VERSION_NUM >  /usr/local/bin/ima"
sudo chmod +x /usr/local/bin/ima

Usage

ima --help

Connect chains

Example:

ima connect -n1 chain1 -n2 chain2 -pk1 456 -pk2 123 -e1 http://0.0.0.0:10001 -e2 http://0.0.0.0:10002

Testing

Check out GA test workflow in .github/workflows/test.yml to see all steps.

Deploy test tokens:

INSTALL_PACKAGES=True yarn deploy-tokens

Run tests:

yarn test

Linter

Used linter: https://palantir.github.io/tslint/

Install the global CLI and its peer dependency:

yarn global add tslint typescript

Linter git hook

Be sure to add pre-commit git hook:

echo 'yarn lint' > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

License

GitHub

All contributions are made under the GNU Lesser General Public License v3. See LICENSE.

ima-js's People

Contributors

adiled avatar cstrangedk avatar dmytrotkk avatar tarasglek avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

tarasglek adiled

ima-js's Issues

getTransacton fails on the latetest Metamask version

On the latest version of Metamask sendTx fails with the following error:

Screenshot 2024-04-23 at 20 27 07

Working version of Metamask: 11.13.1
MM version with breaking change: 11.14.1

Issue can be fixed by updating ethers.js dependency to the latest version.

Error during yarn deploy-tokens: Error HH303: Unrecognized task erc20

I'm trying to follow the readme to run ima-js tests.

However command yarn deploy-tokens fails:

yarn deploy-tokens
yarn run v1.22.18
$ bash ./scripts/deploy_test_tokens.sh
./scripts/deploy_test_tokens.sh: line 9: [: ==: unary operator expected
Error HH303: Unrecognized task erc20

For more info go to https://hardhat.org/HH303 or run Hardhat with --show-stack-traces
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Note adding INSTALL_PACKAGES variable results in same issue. I see this bash error a lot in skale bash scripts. It could be improved by adding double quotes, eg
from

if [ $INSTALL_PACKAGES == 'True' ]; then

to

if [ "$INSTALL_PACKAGES" == 'True' ]; then

Migrate to ethers.js v6

Problem

Our project currently uses ethers.js v5, but v6 has been released with new features and improvements that could benefit our project.

Upgrade steps

  • Update the package.json file to use ethers.js v6.
  • Review the ethers.js v6 changelog and update the project code accordingly.
  • Verify the existing test suite to ensure that all tests pass after the update.
  • Test the application manually to make sure that everything still works as expected.

ethers.js v6 includes several new features and improvements, migration guide: https://docs.ethers.org/v6/migrating/

This task is a part of our ongoing effort to keep our project's dependencies up-to-date and take advantage of the latest features and improvements in our tech stack.

Implement activeUser in CommunityLocker

Problem

Right now it is not possible to check if user active or is user able to send transfer to another chain.

Solution

Add support of activeUsers, timeLimitPerMessage and lastMessageTimeStampToSchain in CommunityLocker

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.