Skip to content

Commit ebe05f6

Browse files
committed
docs: add some for utils
1 parent f695210 commit ebe05f6

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

www/docs/API/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 6
2+
sidebar_position: 7
33
---
44

55
# CHANGELOG

www/docs/API/utils.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# Utils
6+
7+
Util functions are provided so you can use low level functions in your application.
8+
9+
## `address`
10+
11+
the address helpers can be imported using:
12+
13+
```js
14+
import { address } from 'starknet.js';
15+
```
16+
17+
### `getChecksumAddress(address: BigNumberish): string`
18+
19+
This function accepts an address as a `BigNumberish` and returns the checksummed address as a string.
20+
An example:
21+
22+
```js
23+
import { address } from 'starknet.js';
24+
25+
const addressToCheck = '0x2fd23d9182193775423497fc0c472e156c57c69e4089a1967fb288a2d84e914';
26+
27+
const checksummedAddress = address.getChecksumAddress(addressToCheck);
28+
29+
console.log(checksummedAddress); // 0x02FD23D9182193775423497Fc0c472E156C57C69E4089a1967fb288a2D84e914
30+
```
31+
32+
### `validateChecksumAddress(address: string): boolean`
33+
34+
This function validates the checksum address. It returns true if the address is valid, false otherwise.

0 commit comments

Comments
 (0)