npm package: @solidusnetwork/solidus-js
Description: A complete and compact Solidus library, for dapps, wallets and any other tools.
Author: 0xcircuitbreaker
Latest version: 1.0.0-alpha.55

# Solidus JS SDK

[![npm (tag)](https://img.shields.io/npm/v/@solidusnetwork/solidus-js)](https://www.npmjs.com/package/@solidusnetwork/solidus-js)

---

**This library is still under development and not ready for production use.**

A complete, compact and simple library for Au and Ag, written
in [TypeScript](https://www.typescriptlang.org).

**Features**

-   Keep your private keys in your client, **safe** and sound
-   Import and export BIP 39 **mnemonic phrases** (12 word backup phrases) and **HD Wallets** (English as well as Czech, French, Italian, Japanese, Korean, Simplified Chinese, Spanish, Traditional Chinese)
-   Meta-classes create JavaScript objects from any contract ABI, including **ABIv2** and **Human-Readable ABI**
-   Connect to Solidus nodes over [JSON-RPC](https://solidus.network/docs/develop/apis/json-rpc-api/)
-   **Small** (~136kb compressed; 460kb uncompressed)
-   **Tree-shaking** focused; include only what you need during bundling
-   **Complete** functionality for all your Solidus needs
-   Extensive documentation **coming soon**
-   Large collection of **test cases** which are maintained and added to
-   Fully written in **TypeScript**, with strict types for security and safety
-   **MIT License** (including ALL dependencies); completely open source to do with as you please

## Installing

**NodeJS**

```
npm install @solidusnetwork/solidus-js
```

**Browser (ESM)**

The bundled library is available in the `./dist/` folder in this repo.

```
<script type="module">
    import { solidus } from "./dist/solidus.min.js";
</script>
```

### Using Local Version as Dependency in Other Projects

For developers looking to contribute to solidus-js or integrate it into their projects with local modifications, setting up a local development environment is essential.

**Prepare solidus-js for Symbolic Linking**

1. Clone the solidus-js repository and navigate into it.

    ```bash
    git clone https://github.com/solidus-network/solidus-js.git
    cd solidus-js
    ```

2. Install dependencies.

    ```bash
    npm install
    ```

3. Create a global symbolic link for solidus-js. This makes the package available to link in any other project. Whenever a local change is made that you want to test in another project, you must run this command again to update the symbolic link.

    ```bash
    npm run update-symlink
    ```

**Linking solidus-js to Another Project**

After setting up solidus-js for local development, you can link it to another project to test changes.

1. Navigate to your project.
    ```bash
    cd path/to/your/project
    ```
2. Link the globally linked solidus-js package to your project.
    ```bash
    npm link @solidusnetwork/solidus-js
    ```
3. Build your project as needed.

**Testing Changes**

With solidus-js linked to your project, any changes made to the library can be immediately tested. Remember to rebuild (`npm run update-symlink`) after making changes.

**Reverting to the Published Package**

If you need to revert back to the official package published on npm:

1. Unlink solidus-js by removing the symlink.

    ```bash
    npm unlink @solidusnetwork/solidus-js
    ```

2. Reinstall from npm:
    ```bash
    npm install @solidusnetwork/solidus-js
    ```

## Documentation

Documentation for the Solidus JS SDK is under development.

## Extension Packages

The `@solidusnetwork/solidus-js` package only includes the most common and most core
functionality to interact with Solidus Network. There are many other
packages designed to further enhance the functionality and experience.

-   [@solidusnetwork/solidus-polling](https://npmjs.com/package/@solidusnetwork/solidus-polling) - A package to poll Solidus Network for events and logs

## Deterministic Build
Use ./build-deterministic.sh to deterministically build the solidus-js library using Docker.

## License

MIT License (including **all** dependencies).