# @swisstronik/utils

> Library with different utils for transaction encryption / decryption

Latest version **1.3.0** (published 2024-05-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @swisstronik/utils
pnpm add @swisstronik/utils
yarn add @swisstronik/utils
bun add @swisstronik/utils
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2024-05-28 |
| First published | 2023-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 145.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | splend1d_man |
| Keywords | swisstronik, encryption, deoxysii, x25519 |

## Links

- npm: https://www.npmjs.com/package/@swisstronik/utils
- npm.io page: https://npm.io/package/@swisstronik/utils

## Dependencies (7)

- [rlp](https://npm.io/package/rlp.md) ^3.0.0
- [axios](https://npm.io/package/axios.md) ^1.3.6
- [bech32](https://npm.io/package/bech32.md) ^2.0.0
- [ethers](https://npm.io/package/ethers.md) 5.7.2
- [tweetnacl](https://npm.io/package/tweetnacl.md) ^1.0.3
- [@noble/hashes](https://npm.io/package/@noble/hashes.md) ^1.3.0
- [@oasisprotocol/deoxysii](https://npm.io/package/@oasisprotocol/deoxysii.md) 0.0.5

## Recent versions

- 1.3.0 (latest) — 2024-05-28
- 1.2.2 — 2024-05-21
- 1.2.1 — 2024-02-16
- 1.2.0 — 2024-02-14
- 1.1.1 — 2023-11-14
- 1.1.0 — 2023-11-14
- 1.0.7 — 2023-10-20
- 1.0.6 — 2023-10-17
- 1.0.5 — 2023-10-13
- 1.0.4 — 2023-10-13
- 1.0.3 — 2023-10-13
- 1.0.2 — 2023-10-13
- 1.0.1 — 2023-10-13
- 1.0.0 — 2023-10-10

## README

### Utils for encryption / decryption

Main purpose of this package is to provide set of helper functions for transaction data / query encryption 
and decryption of node response

## Installation

```shell
npm install @swisstronik/utils
```

## Examples

### Convert bech32 address to ethereum and vice versa

```typescript
import { bech32toEthAddress, ethAddressToBech32} from '@swisstronik/utils'

const originalBech32Address = "swtr13sllcdsqhjektac5r6h50dvjrthm0yt6zw3q4s"

const ethAddress = bech32toEthAddress(originalBech32Address) // 0x8C3FFC3600BCB365F7141EAF47B5921AEFB7917A
const bech32Address = ethAddressToBech32(ethAddress) // swtr13sllcdsqhjektac5r6h50dvjrthm0yt6zw3q4s
```

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