# chainium-sdk

> Chainium SDK for JavaScript

Latest version **0.4.6** (published 2019-05-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install chainium-sdk
pnpm add chainium-sdk
yarn add chainium-sdk
bun add chainium-sdk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.6 |
| Published | 2019-05-07 |
| First published | 2018-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 36.3 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | anilmujagic |
| Keywords | chainium, own, blockchain, crypto, sdk |

## Links

- npm: https://www.npmjs.com/package/chainium-sdk
- Repository: https://github.com/OwnMarket/OwnBlockchainSdkJS
- Homepage: https://github.com/OwnMarket/OwnBlockchainSdkJS#readme
- Issues: https://github.com/OwnMarket/OwnBlockchainSdkJS/issues
- npm.io page: https://npm.io/package/chainium-sdk

## Dependencies (5)

- [bs58](https://npm.io/package/bs58.md) ^4.0.1
- [bip32](https://npm.io/package/bip32.md) ^1.0.4
- [bip39](https://npm.io/package/bip39.md) ^3.0.1
- [elliptic](https://npm.io/package/elliptic.md) ^6.4.1
- [crypto-js](https://npm.io/package/crypto-js.md) ^3.1.9-1

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.4.6 (latest) — 2019-05-07
- 0.4.5 — 2019-05-07
- 0.4.4 — 2019-05-07
- 0.4.3 — 2019-05-07
- 0.4.2 — 2019-05-07
- 0.4.1 — 2019-05-07
- 0.4.0 — 2019-05-07
- 0.3.3 — 2019-03-28
- 0.3.2 — 2019-02-20
- 0.3.1 — 2019-02-15
- 0.3.0 — 2019-02-15
- 0.2.0 — 2019-02-14
- 0.1.0 — 2018-12-10

## README

# OwnBlockchainSdkJS

Own Blockchain SDK for JavaScript


## Quick Start

```bash
$ git clone https://github.com/OwnMarket/OwnBlockchainSdkJS.git
$ cd OwnBlockchainSdkJS/Source
$ npm ci
```


Run tests:

```bash
$ npm test
```


## Usage

Own Blockchain SDK for JS can be used in two scenarios:

- `own-blockchain-sdk` npm package
- `own-blockchain-sdk.js` standalone library


### NPM Package

Add [package](https://www.npmjs.com/package/own-blockchain-sdk) to the project:

```bash
$ npm install own-blockchain-sdk
```

Use the package in JS code:

```js
var ownSdk = require('own-blockchain-sdk');
var networkCode = 'OWN_PUBLIC_BLOCKCHAIN_TESTNET';

// Create a new wallet
var wallet = ownSdk.crypto.generateWallet();
console.log(wallet);

// Compose a transaction with nonce = 1 and actionFee = 0.1
var tx = ownSdk.transactions.createTx(wallet.address, 1, 0.1);
tx.addTransferChxAction('CHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 100); // Transfer 100 CHX to CHxxx... address.

// Look at the raw transaction in JSON format
console.log(tx.toJson(4));

// Sign the transaction for submission to node API on TestNet
console.log(tx.sign(networkCode, wallet.privateKey));
```


### Standalone Library

When `own-blockchain-sdk.js` library is referenced from the browser app,
it will create a global `ownBlockchainSdk` object, which contains all the SDK functionality in nested modules.

Examples of how to use the SDK can be found in the `demo` directory. Especially useful is the `browser-demo.html` file,
which shows how to generate private key and address pairs and sign transactions.


## Build Standalone Library

To build a standalone library for the browser, [Browserify](http://browserify.org) package is required:

```bash
$ sudo npm install -g browserify
```

Build is started using the `build.sh` script (`build.bat` for Windows):

```bash
$ ./build.sh
```

This results in `own-blockchain-sdk.js` file being created in `dist` directory.

---
_Source: https://npm.io/package/chainium-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
