# @yqrashawn/js-conflux-sdk

> JavaScript Conflux Software Development Kit

Latest version **0.7.4-c** (published 2020-02-12) · LGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @yqrashawn/js-conflux-sdk
pnpm add @yqrashawn/js-conflux-sdk
yarn add @yqrashawn/js-conflux-sdk
bun add @yqrashawn/js-conflux-sdk
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.4-c |
| Published | 2020-02-12 |
| First published | 2019-12-30 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 2.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Haizhou@conflux-chain.org |
| Maintainers | yqrashawn |
| Keywords | conflux, sdk |

## Links

- npm: https://www.npmjs.com/package/@yqrashawn/js-conflux-sdk
- Repository: https://github.com/Conflux-Chain/js-conflux-sdk
- Homepage: https://github.com/Conflux-Chain/js-conflux-sdk#readme
- Issues: https://github.com/Conflux-Chain/js-conflux-sdk/issues
- npm.io page: https://npm.io/package/@yqrashawn/js-conflux-sdk

## Dependencies (7)

- [esm](https://npm.io/package/esm.md) ^3.2.25
- [jsbi](https://npm.io/package/jsbi.md) ^3.1.1
- [keccak](https://npm.io/package/keccak.md) ^2.0.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [secp256k1](https://npm.io/package/secp256k1.md) ^3.7.1
- [superagent](https://npm.io/package/superagent.md) ^5.1.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.8.4

## Recent versions

- 0.7.4-c (latest) — 2020-02-12
- 0.7.4-b — 2020-02-12
- 0.7.4-a — 2020-02-12
- 0.3.2-alpha — 2019-12-30

## README

# js-conflux-sdk

JavaScript Conflux Software Development Kit

## Installation

`npm install js-conflux-sdk`

## Usage

[api document](https://github.com/Conflux-Chain/js-conflux-sdk/blob/master/api.md)

### Nodejs
```javascript
const { Conflux } = require('js-conflux-sdk');

async function main() {
  const cfx = new Conflux({
    url: 'http://testnet-jsonrpc.conflux-chain.org:12537',
    defaultGasPrice: 100,
    defaultGas: 1000000,
    logger: console,
  });

  const balance = await cfx.getBalance('0xbbd9e9be525ab967e633bcdaeac8bd5723ed4d6b');
  console.log(balance); // 937499420597305000n
}

main();
```
require neseted file/dir  

``` javascript
const util = require('js-conflux-sdk/lib/util');
```

### Frontend

#### esm
``` javascript
import { Conflux } from 'js-conflux-sdk';
import { util } from 'js-conflux-sdk/esm/util';
```

Note: This assumes bundler will read the [package.json browser
field](https://docs.npmjs.com/files/package.json#browser) as module entry. For
bundlers don't support that, additional configurations needs to be add to
support that. Please checkout the bundlers documentation.

#### umd
``` javascript
import { Conflux } from 'js-conflux-sdk/dist/js-conflux-sdk.umd.min.js';
```

or  

``` html
<script type="text/javascript" src="node_modules/js-conflux-sdk/dist/js-conflux-sdk.umd.min.js"></script>
<script type="text/javascript">
  const cfx = new window.Conflux.Conflux({
    url: 'http://testnet-jsonrpc.conflux-chain.org:12537',
    defaultGasPrice: 100,
    defaultGas: 1000000,
    logger: console,
  });
</script>
```

## Example

[example](https://github.com/Conflux-Chain/js-conflux-sdk/tree/master/example)

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