# centavo-lib

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

Latest version **1.0.1** (published 2021-02-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install centavo-lib
pnpm add centavo-lib
yarn add centavo-lib
bun add centavo-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.1 |
| Published | 2021-02-20 |
| First published | 2021-02-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.13.0 |
| Dependencies | 12 |
| Unpacked size | 4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | arsm |

## Links

- npm: https://www.npmjs.com/package/centavo-lib
- Repository: https://gitlab.com/cnt-blockchain/cnt-lib
- npm.io page: https://npm.io/package/centavo-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
- [lodash.isequal](https://npm.io/package/lodash.isequal.md) ^4.5.0
- [ripple-keypairs](https://npm.io/package/ripple-keypairs.md) ^1.0.0
- [https-proxy-agent](https://npm.io/package/https-proxy-agent.md) ^5.0.0
- [ripple-binary-codec](https://npm.io/package/ripple-binary-codec.md) ^1.1.0
- [ripple-address-codec](https://npm.io/package/ripple-address-codec.md) ^4.1.1
- [ripple-lib-transactionparser](https://npm.io/package/ripple-lib-transactionparser.md) 0.8.2

## Recent versions

- 1.0.1 (latest) — 2021-02-20
- 1.9.2 — 2021-02-19

## README

# centavo-lib (CentavoAPI)

A JavaScript/TypeScript API for interacting with the CXTLedger

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

This is the recommended library for integrating a JavaScript/TypeScript app with the CXTLedger, 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://cxtl.org/CentavoAPI-reference.html)

See the full reference documentation on the CXTLedger Dev Portal.

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

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

### Features

+ Connect to a `rippled` server from Node.js or a web browser
+ Listen to events on the CXTLedger (transactions, ledger, validations, etc.)
+ Sign and submit transactions to the CXTLedger
+ 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: [CentavoAPI Beginners Guide](https://cxtl.org/get-started-with-CentavoAPI-for-javascript.html)

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

Then see the documentation:

## Documentation

+ [CentavoAPI Beginners Guide](https://cxtl.org/get-started-with-CentavoAPI-for-javascript.html)
+ [CentavoAPI Full Reference Documentation](https://cxtl.org/CentavoAPI-reference.html)
+ [Code Samples](https://gitlab.com/cnt-blockchain/cnt-lib/tree/develop/docs/samples)


## 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

+ [CXTLedger Dev Portal](https://cxtl.org/)

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