# @requestnetwork/currency

> Currency tools for Request Network packages.

Latest version **0.34.0** (published 2026-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @requestnetwork/currency
pnpm add @requestnetwork/currency
yarn add @requestnetwork/currency
bun add @requestnetwork/currency
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

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

## Facts

| | |
|---|---|
| Version | 0.34.0 |
| Published | 2026-09-18 |
| First published | 2021-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=22.0.0 |
| Dependencies | 10 |
| Unpacked size | 246.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 385 |
| Maintainers | request-bot, yomarion, aimensahnoun, mantisclone-requestnetwork, rodrigopavezi-request, bassgeta-rn |
| Keywords | requestnetwork, currency, utils |

## Links

- npm: https://www.npmjs.com/package/@requestnetwork/currency
- Repository: https://github.com/RequestNetwork/requestNetwork
- Homepage: https://github.com/RequestNetwork/requestNetwork/tree/master/packages/currency#readme
- Issues: https://github.com/RequestNetwork/requestNetwork/issues
- npm.io page: https://npm.io/package/@requestnetwork/currency

## Dependencies (10)

- [tslib](https://npm.io/package/tslib.md) 2.8.1
- [starknet](https://npm.io/package/starknet.md) 9.2.1
- [@ton/core](https://npm.io/package/@ton/core.md) 0.61.0
- [@mysten/sui](https://npm.io/package/@mysten/sui.md) 1.45.0
- [@ton/crypto](https://npm.io/package/@ton/crypto.md) 3.3.0
- [node-dijkstra](https://npm.io/package/node-dijkstra.md) 2.5.0
- [@requestnetwork/types](https://npm.io/package/@requestnetwork/types.md) 0.60.0
- [@requestnetwork/utils](https://npm.io/package/@requestnetwork/utils.md) 0.60.0
- [@metamask/contract-metadata](https://npm.io/package/@metamask/contract-metadata.md) 1.31.0
- [multicoin-address-validator](https://npm.io/package/multicoin-address-validator.md) 0.5.15

## Recent versions

- 0.34.0 (latest) — 2026-09-18
- 0.33.1-next.b2a1665f.0 (next) — 2026-08-31
- 0.33.1-next.18be89d7.0 — 2026-08-31
- 0.33.1-next.6df923e2.0 — 2026-08-31
- 0.33.1-next.af792b64.0 — 2026-06-09
- 0.33.1-next.f220532d.0 — 2026-06-08
- 0.33.1-next.ba2344ff.0 — 2026-06-05
- 0.33.1-next.ada584b1.0 — 2026-06-05
- 0.33.0 — 2026-06-03
- 0.32.1-next.053cae94.0 — 2026-05-28
- 0.32.0 — 2026-05-25
- 0.31.1-next.2d9d2486.0 — 2026-05-24
- 0.31.0 — 2026-02-16
- 0.30.0 — 2025-12-18
- 0.29.0 — 2025-12-12
- … 643 more at https://npm.io/package/@requestnetwork/currency/versions

## README

# @requestnetwork/currency

`@requestnetwork/currency` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).
It is a collection of tools for the currencies and chains shared between the @requestnetwork packages.

## Installation

```bash
npm install @requestnetwork/currency
```

## Usage

```javascript
import { RequestLogicTypes } from '@requestnetwork/types';
import { Currency, Token } from '@requestnetwork/currency';

const decimals = new Currency({
  type: RequestLogicTypes.CURRENCY.ETH,
  value: 'ETH',
}).getDecimals();

console.log(decimals); // 18

const ETHHash = new Currency({
  type: RequestLogicTypes.CURRENCY.ETH,
  value: 'ETH',
}).getHash();

console.log(ETHHash); // 0xF5AF88e117747e87fC5929F2ff87221B1447652E

// Get currencies from their symbol
const ETHCurrency: RequestLogicTypes.ICurrency = Currency.from('ETH');
const FAUCurrency: RequestLogicTypes.ICurrency = Currency.from('DAI');
// Get currencies from their address
const DAICurrency: RequestLogicTypes.ICurrency = Currency.from(
  '0x6B175474E89094C44Da98b954EedeAC495271d0F',
);

console.log(FAUCurrency.toString()); // FAU-rinkeby
console.log(DAICurrency.toString()); // DAI

// Get a token symbol from its address
const FAUToken = Token.from('0xFab46E002BbF0b4509813474841E0716E6730136');

console.log(FAUToken.symbol); // FAU
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
[Read the contributing guide](/CONTRIBUTING.md)

### Adding a new chain

Supported chains are listed in `src/chains`:

- `src/chains/btc/data` for BTC type chains
- `src/chains/evm/data` for EVM type chains
- `src/chains/near/data` for NEAR type chains

The chain names are subjective, but they are unique and uniform across all Request Network packages.
They are formatted with the kebab-case naming convention.

In order to add a new chain, first create a file `[nameOfTheChain].ts` in the correct directory.
Its internal structure should conform with the corresponding type, respectively:

- `BtcChain`
- `EvmChain`
- `NearChain`

These types are described in the `index.ts` file of each chain subdirectory.
Please add the `testnet: true` property for staging chains.

## License

[MIT](/LICENSE)

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