|
1 |
| -# @distributedlab/tools |
2 |
| -These packages aim to provide developers with a set of commonly used functions and features for building web applications, such as handling big numbers, date manipulation, subscribing to and receiving notifications when certain events occur with EventEmitter, and more. |
| 1 | +# @tokene/toolkit |
| 2 | +These packages aim to provide developers with a set of commonly used functions and features for building TokenE web applications, such as handling big numbers, date manipulation, subscribing to and receiving notifications when certain events occur with EventEmitter, and more. |
3 | 3 |
|
4 | 4 | 
|
5 | 5 | 
|
6 | 6 | 
|
7 |
| - |
| 7 | + |
8 | 8 |
|
9 | 9 | ## Getting Started
|
10 | 10 |
|
11 | 11 | ### Installing
|
12 | 12 |
|
13 | 13 | ```
|
14 |
| -yarn add @distributedlab/tools |
| 14 | +yarn add @tokene/toolkit |
15 | 15 | ```
|
16 | 16 |
|
17 | 17 | #### Work with big numbers
|
18 | 18 | ```ts
|
19 |
| -import { BN } from '@distributedlab/tools'; |
| 19 | +import { IpfsUtil } from '@tokene/toolkit' |
20 | 20 |
|
21 |
| -const amountA = BN.fromRaw(2, 18) |
22 |
| -const amountB = BN.fromRaw(3, 18) |
| 21 | +const ipfsEntity = new IpfsUtil({ |
| 22 | + rawData: JSON.stringify({ |
| 23 | + someData: 'lorem ipsum dolor sit amet concestetur!', |
| 24 | + }), |
| 25 | +}) |
23 | 26 |
|
24 |
| -console.log(amountA.add(amountB).format({ |
25 |
| - decimals: 18, |
26 |
| - decimalSeparator: '.', |
27 |
| - groupSeparator: ',', |
28 |
| - groupSize: 3, |
29 |
| -})) |
30 |
| -``` |
31 |
| - |
32 |
| -#### Work with dates |
33 |
| -```ts |
34 |
| -import { time } from '@distributedlab/tools'; |
35 |
| - |
36 |
| -const currentDate = time() |
37 |
| - |
38 |
| -console.log(currentDate.format('YYYY-MM-DD')) |
| 27 | +await ipfsEntity.uploadSelf() |
39 | 28 | ```
|
40 | 29 |
|
41 | 30 | ## Running the tests
|
|
0 commit comments