# @coolwallets/icx

> ICON (ICX) sdk for CoolWalletS

Latest version **0.0.2** (published 2020-01-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install @coolwallets/icx
pnpm add @coolwallets/icx
yarn add @coolwallets/icx
bun add @coolwallets/icx
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-01-05 |
| First published | 2020-01-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 53.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | anton |
| Maintainers | antoncoding, antoncoolbitx, kunming0525 |
| Keywords | icx, icon, hardwarewallet, coolwallets, javascript, transaction, signing, cryptocurrency |

## Links

- npm: https://www.npmjs.com/package/@coolwallets/icx
- npm.io page: https://npm.io/package/@coolwallets/icx

## Dependencies (5)

- [js-sha3](https://npm.io/package/js-sha3.md) ^0.8.0
- [elliptic](https://npm.io/package/elliptic.md) ^6.5.1
- [@coolwallets/coin](https://npm.io/package/@coolwallets/coin.md) ^0.1.0
- [@coolwallets/core](https://npm.io/package/@coolwallets/core.md) ^0.0.19
- [@coolwallets/transport](https://npm.io/package/@coolwallets/transport.md) ^0.0.10

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [stockfish](https://npm.io/package/stockfish.md) — 27.0K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2020-01-05
- 0.0.1 — 2020-01-03

## README

# CoolWalletS ICX App

ICON API of CoolWalletS.

![version](https://img.shields.io/npm/v/@coolwallets/icx)

## Install

```shell
npm install @coolwallets/icx
```

## Usage

```javascript
import cwsICX from '@coolwallets/icx'
const ICON = new cwsICX(transport, appPrivateKey, appId)
```

### getAddress

Get address by address index.

```javascript
const address = await ICON.getAddress(0)
console.log(address)

// hx76f46307b53686f2dd4a2c8ca2f22492e842c4bf
```

The address generated is compatible to BIP44 with **account** and **change** set to 0, which means calling `getAddress(i)` will get the address of folllowing BIP44 path:

```none
m/44'/60'/0'/0/{i}
```

In the design of current hardware, we only support path `m/44'/60'/0'/0/{i}` for speed optimization. This might change in the future and we will then open a more general interface to deal with custom path.

### signTransaction

Sign ICON Transaction. We suggest you to use [Icon Official SDK](https://github.com/icon-project/icon-sdk-js) to build an unsigned transaction.

```javascript

const txObj = new IconBuilder.IcxTransactionBuilder()
    .from('hx76f46307b53686f2dd4a2c8ca2f22492e842c4bf')
    .to('hxe86b015c06145965931aff551d4958256a86226e')
    .value(IconAmount.of('0.023', IconAmount.Unit.ICX).toLoop())
    .stepLimit(IconConverter.toBigNumber(100000))
    .nid(IconConverter.toBigNumber(1))
    .version(IconConverter.toBigNumber(3))
    .timestamp(timestamp)
    .build();

// Returns raw transaction object
const rawTx = IconConverter.toRawTransaction(txObj);

// sign with address index 0
const signedTx = await ETH.signTransaction(rawTx, 0)
```

The signed transaction will be in form of `Object`, which you can use the official sdk to broadcast.

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