# xdb-digitalbits-sdk

> xdb-digitalbits-sdk is a library for working with the DigitalBits Frontier server.

Latest version **8.2.2** (published 2021-07-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install xdb-digitalbits-sdk
pnpm add xdb-digitalbits-sdk
yarn add xdb-digitalbits-sdk
bun add xdb-digitalbits-sdk
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 8.2.2 |
| Published | 2021-07-29 |
| First published | 2021-07-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 16 |
| Unpacked size | 2.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | XDB Foundation |
| Maintainers | xdbfoundation |
| Keywords | digitalbits |

## Links

- npm: https://www.npmjs.com/package/xdb-digitalbits-sdk
- Repository: https://github.com/xdbfoundation/xdb-digitalbits-sdk
- Issues: https://github.com/xdbfoundation/xdb-digitalbits-sdk/issues
- npm.io page: https://npm.io/package/xdb-digitalbits-sdk

## Dependencies (16)

- [toml](https://npm.io/package/toml.md) ^2.3.0
- [axios](https://npm.io/package/axios.md) 0.21.1
- [tslib](https://npm.io/package/tslib.md) ^1.10.0
- [urijs](https://npm.io/package/urijs.md) ^1.19.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [@types/node](https://npm.io/package/@types/node.md) >= 8
- [detect-node](https://npm.io/package/detect-node.md) ^2.0.4
- [es6-promise](https://npm.io/package/es6-promise.md) ^4.2.4
- [eventsource](https://npm.io/package/eventsource.md) ^1.0.7
- [randombytes](https://npm.io/package/randombytes.md) ^2.1.0
- [@types/urijs](https://npm.io/package/@types/urijs.md) ^1.19.6
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^4.0.0
- [utility-types](https://npm.io/package/utility-types.md) ^3.7.0
- [@types/eventsource](https://npm.io/package/@types/eventsource.md) ^1.1.2
- [@types/randombytes](https://npm.io/package/@types/randombytes.md) ^2.0.0
- [xdb-digitalbits-base](https://npm.io/package/xdb-digitalbits-base.md) 5.3.0

## Recent versions

- 8.2.2 (latest) — 2021-07-29
- 8.2.3 (testing) — 2022-01-31

## README

xdb-digitalbits-sdk is a Javascript library for communicating with a
[DigitalBits Frontier server](https://github.com/xdbfoundation/go/tree/master/services/frontier).
It is used for building DigitalBits apps either on Node.js or in the browser.

It provides:

- a networking layer API for Frontier endpoints.
- facilities for building and signing transactions, for communicating with a
  DigitalBits Frontier instance, and for submitting transactions or querying network
  history.

### xdb-digitalbits-sdk vs xdb-digitalbits-base

xdb-digitalbits-sdk is a high-level library that serves as client-side API for Frontier.
[xdb-digitalbits-base](https://github.com/xdbfoundation/xdb-digitalbits-base) is lower-level
library for creating DigitalBits primitive constructs via XDR helpers and wrappers.

**Most people will want xdb-digitalbits-sdk instead of digitalbits-base.** You should only
use digitalbits-base if you know what you're doing!


> **Important!** The Node.js version of the `xdb-digitalbits-base` (`xdb-digitalbits-sdk` dependency) package
> uses the [`sodium-native`](https://www.npmjs.com/package/sodium-native) package as
> an [optional dependency](https://docs.npmjs.com/files/package.json#optionaldependencies). `sodium-native` is
> a low level binding to [libsodium](https://github.com/jedisct1/libsodium),
> (an implementation of [Ed25519](https://ed25519.cr.yp.to/) signatures).
> If installation of `sodium-native` fails, or it is unavailable, `xdb-digitalbits-base` (and `xdb-digitalbits-sdk`) will
> fallback to using the [`tweetnacl`](https://www.npmjs.com/package/tweetnacl) package implementation.
>
> If you are using `xdb-digitalbits-sdk`/`xdb-digitalbits-base` in a browser you can ignore
> this. However, for production backend deployments you should be
> using `sodium-native`. If `sodium-native` is successfully installed and working the
> `DigitalBitsSdk.FastSigning` variable will return `true`.


## Install

1. Add lib to your project:

```shell
npm install xdb-digitalbits-sdk --save
```

2. require/import it in your JavaScript:

```js
var DigitalBitsSdk = require('xdb-digitalbits-sdk');
```

## Usage

For information on how to use xdb-digitalbits-sdk, take a look at the
[docs](./docs/reference/readme.md).

There is also API Documentation
[here](https://github.com/xdbfoundation/go/tree/master/services/frontier/internal/docs/reference).

## Testing
Build before testing:

```shell
yarn gulp build
```

To run all tests:

```shell
yarn gulp test
```

To run a specific set of tests:

```shell
yarn gulp test:unit
yarn gulp test:browser
```

To generate and check the documentation site:

```shell
# install the `serve` command if you don't have it already
yarn global add serve

# generate the docs files
yarn docs

# get these files working in a browser
serve jsdocs/

# you'll be able to browse the docs at http://localhost:5000
```

## Documentation

Documentation for this repo lives in
[docs](./docs/reference/readme.md).


## License

xdb-digitalbits-sdk is licensed under an Apache-2.0 license. See the
[LICENSE](https://github.com/xdbfoundation/xdb-digitalbits-sdk/blob/master/LICENSE) file
for details.

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