# iw-trx

> >> This project provides a simple package to realize the core logic of the wallet. If you have any questions, please ask at the following website [icanwallet](https://github.com/icanwallet/icanwallet)

Latest version **1.0.5** (published 2022-05-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install iw-trx
pnpm add iw-trx
yarn add iw-trx
bun add iw-trx
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-05-31 |
| First published | 2021-06-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 327.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | icanwallet |
| Maintainers | icanwallet |
| Keywords | crypto wallet, tron wallet, trx wallet |

## Links

- npm: https://www.npmjs.com/package/iw-trx
- Repository: https://github.com/icanwallet/iw-trx
- Issues: https://github.com/icanwallet/iw-trx/issues
- npm.io page: https://npm.io/package/iw-trx

## Dependencies (1)

- [iwcrypto](https://npm.io/package/iwcrypto.md) ^1.1.1

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2022-05-31
- 1.0.4 — 2021-06-19
- 1.0.2 — 2021-06-14
- 1.0.0 — 2021-06-14

## README

## iw-trx
>> This project provides a simple package to realize the core logic of the wallet. If you have any questions, please ask at the following website
[icanwallet](https://github.com/icanwallet/icanwallet)

## use case

``` javascript
//install
npm i iw-trx -s


//from mnemonic
const ecc = require('iw-trx')
const wallet = ecc.fromMnemonic(mnemonic)
console.log(wallet)
//from privateKey
const wallet2 = ecc.fromPrivateKey(wallet.privateKey)
console.log(wallet2)
//check address
console.log(ecc.isAddress(wallet.address))

```

## account

```javascripot
const testPrivatekey = '....'
const usdtToken = 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t'

const tokeninfo = await libs.tokenInfo(usdtToken)
console.log(tokeninfo);
const abiInfo = await libs.getAbi(usdtToken)
console.log(abiInfo);
			
const contracts = await libs.getContract(testPrivatekey, usdtToken, libs.defalutAbi);
console.log(contracts)

libs.config.nodeUrl = 'https://api.shasta.trongrid.io';
let  balance = await libs.balanceOf('TTfaBaMkqhWa36z9GzwncNmxY68XuZCxty')
console.log(balance)

let source = await libs.getAccountResources('TTfaBaMkqhWa36z9GzwncNmxY68XuZCxty')
console.log(source);

let deploy = await libs.deployContract(testPrivatekey)
console.log(deploy)

let freeze = await libs.freezeBalance(testPrivatekey,2);
console.log(freeze);

let rt = await libs.transfer(testPrivatekey, 'trx', 'TRVX2Kw7SdAkscke6Guv5RF933Chs1jHEp', 0.01)
console.log(rt)

let  logs = await libs.logs('TAUN6FwrnwwmaEqYcckffC7wYmbaS6cBiX', 'trx',1, 5)
console.log(logs)

let  logstrc = await libs.logs('TAUN6FwrnwwmaEqYcckffC7wYmbaS6cBiX', usdtToken,1, 5)
console.log(logstrc)
```

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