# aitd-lib

> A TypeScript/JavaScript API for interacting with the AITD Ledger in Node.js and the browser

Latest version **1.0.4** (published 2021-02-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install aitd-lib
pnpm add aitd-lib
yarn add aitd-lib
bun add aitd-lib
```

## 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 | 1.0.4 |
| Published | 2021-02-23 |
| First published | 2021-02-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.13.0 |
| Dependencies | 12 |
| Unpacked size | 4.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | aitd |

## Links

- npm: https://www.npmjs.com/package/aitd-lib
- Repository: https://github.com/moumc/aitd-lib
- Homepage: https://github.com/moumc/aitd-lib#readme
- Issues: https://github.com/moumc/aitd-lib/issues
- npm.io page: https://npm.io/package/aitd-lib

## Dependencies (12)

- [ws](https://npm.io/package/ws.md) ^7.2.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [@types/ws](https://npm.io/package/@types/ws.md) ^7.2.0
- [jsonschema](https://npm.io/package/jsonschema.md) 1.2.2
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.0.0
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.136
- [aitd-keypairs](https://npm.io/package/aitd-keypairs.md) ^1.0.1
- [lodash.isequal](https://npm.io/package/lodash.isequal.md) ^4.5.0
- [aitd-binary-codec](https://npm.io/package/aitd-binary-codec.md) ^1.0.5
- [https-proxy-agent](https://npm.io/package/https-proxy-agent.md) ^5.0.0
- [aitd-address-codec](https://npm.io/package/aitd-address-codec.md) ^1.0.3
- [aitd-lib-transactionparser](https://npm.io/package/aitd-lib-transactionparser.md) 0.0.2

## Recent versions

- 1.0.4 (latest) — 2021-02-23
- 1.0.3 — 2021-02-22
- 1.0.2 — 2021-02-22
- 1.0.1 — 2021-02-22
- 1.0.0 — 2021-02-22

## README

# aitd-lib (AitdAPI)

A JavaScript/TypeScript API for interacting with the AITD Ledger

[![NPM](https://nodei.co/npm/aitd-lib.png)](https://www.npmjs.org/package/aitd-lib)

This is the recommended library for integrating a JavaScript/TypeScript app with the AITD Ledger, especially if you intend to use advanced functionality such as IOUs, payment paths, the decentralized exchange, account settings, payment channels, escrows, multi-signing, and more.

## [➡️ Reference Documentation](https://aitdl.org/aitdapi-reference.html)

See the full reference documentation on the AITD Ledger Dev Portal.

## [➡️ Applications and Projects](APPLICATIONS.md)

What is aitd-lib used for? The applications on the list linked above use `aitd-lib`. Open a PR to add your app or project to the list!

### Features

+ Connect to a `aitdd` server from Node.js or a web browser
+ Helpers for creating requests and parsing responses for the [aitdd API](https://developers.aitd.com/aitdd-api.html)
+ Listen to events on the AITD Ledger (transactions, ledger, validations, etc.)
+ Sign and submit transactions to the AITD Ledger
+ Type definitions for TypeScript

### Requirements

+ **[Node.js v14](https://nodejs.org/)** is recommended. Other versions may work but are not frequently tested.
+ **[Yarn](https://yarnpkg.com/)** is recommended. `npm` may work but we use `yarn.lock`.

## Getting Started

See also: [AitdAPI Beginners Guide](https://aitdl.org/get-started-with-aitdapi-for-javascript.html)

In an existing project (with `package.json`), install `aitd-lib`:
```
$ yarn add aitd-lib
```

Then see the documentation:

## Documentation

+ [AitdAPI Beginners Guide](https://aitdl.org/get-started-with-aitdapi-for-javascript.html)
+ [AitdAPI Full Reference Documentation](https://aitdl.org/aitdapi-reference.html) ([in this repo](https://github.com/aitd/aitd-lib/blob/develop/docs/index.md))
+ [Code Samples](https://github.com/aitd/aitd-lib/tree/develop/docs/samples)

### Mailing Lists

We have a low-traffic mailing list for announcements of new aitd-lib releases. (About 1 email per week)

+ [Subscribe to aitd-lib-announce](https://groups.google.com/forum/#!forum/aitd-lib-announce)

If you're using the AITD Ledger in production, you should run a [aitdd server](https://github.com/aitd/aitdd) and subscribe to the aitd-server mailing list as well.

+ [Subscribe to aitd-server](https://groups.google.com/forum/#!forum/aitd-server)

## Development

To build the library for Node.js and the browser:
```
$ yarn build
```

The TypeScript compiler will [output](./tsconfig.json#L7) the resulting JS files in `./dist/npm/`.

webpack will output the resulting JS files in `./build/`.

For details, see the `scripts` in `package.json`.

## Running Tests

### Unit Tests

1. Clone the repository
2. `cd` into the repository and install dependencies with `yarn install`
3. `yarn test`

### Linting

Run `yarn lint` to lint the code with `eslint`.

## Generating Documentation

Do not edit `./docs/index.md` directly because it is a generated file.

Instead, edit the appropriate `.md.ejs` files in `./docs/src/`.

If you make changes to the JSON schemas, fixtures, or documentation sources, update the documentation by running `yarn run docgen`.

## More Information

+ [aitd-lib-announce mailing list](https://groups.google.com/forum/#!forum/aitd-lib-announce) - subscribe for release announcements
+ [AitdAPI Reference](https://aitdl.org/aitdapi-reference.html) - AITD Ledger Dev Portal
+ [AITD Ledger Dev Portal](https://aitdl.org/)

 [![Build Status](https://travis-ci.org/aitd/aitd-lib.svg?branch=master)](https://travis-ci.org/aitd/aitd-lib)

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