# node-elements

> Typescript/node bindings for Elements

Latest version **0.4.2** (published 2021-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-elements
pnpm add node-elements
yarn add node-elements
bun add node-elements
```

## Health

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

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

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.2 |
| Published | 2021-11-08 |
| First published | 2019-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 27.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Karl-Johan Alm |
| Maintainers | kjalm |

## Links

- npm: https://www.npmjs.com/package/node-elements
- Repository: https://github.com/kallewoof/node-elements
- Homepage: https://github.com/kallewoof/node-elements#readme
- Issues: https://github.com/kallewoof/node-elements/issues
- npm.io page: https://npm.io/package/node-elements

## Dependencies (2)

- [bcrpc](https://npm.io/package/bcrpc.md) ^0.2.3
- [@types/node](https://npm.io/package/@types/node.md) ^13.1.1

## Recent versions

- 0.4.2 (latest) — 2021-11-08
- 0.4.1 — 2021-10-27
- 0.4.0 — 2021-05-31
- 0.3.10 — 2021-05-31
- 0.3.9 — 2021-05-31
- 0.3.8 — 2021-05-31
- 0.3.7 — 2021-04-19
- 0.3.6 — 2021-04-19
- 0.3.5 — 2021-04-19
- 0.3.4 — 2021-04-08
- 0.3.3 — 2021-04-08
- 0.3.2 — 2021-04-08
- 0.3.1 — 2020-04-10
- 0.3.0 — 2020-04-10
- 0.2.4 — 2020-03-31
- … 16 more at https://npm.io/package/node-elements/versions

## README

# node-elements

Typescript/node bindings for Elements, using bcrpc.

Installation:
```Bash
$ node install --save node-elements
```

For typescript, you also want `@types/node-elements`.

Example:
```JavaScript
// dict helper
const KV = (k, v) => {
    const kv = {};
    kv[k] = v;
    return kv;
};
// get a new confidential address from elements
const addr = await GetNewAddress();
// fetch the addressinfo, and get the scriptPubKey from it
const spk = (await GetAddressInfo(addr)).scriptPubKey;
// create a new raw transaction sending amount to the address
const crtres: string = await elements.CreateRawTransaction([], KV(addr, amount));
// fund it
const { hex, fee, changepos } = await elements.FundRawTransaction(crtres);
// ...
```

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