@xylabs/eth-address 4.13.20 → 4.13.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +291 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,13 +12,301 @@
|
|
|
12
12
|
[![snyk-badge][]][snyk-link]
|
|
13
13
|
[![socket-badge][]][socket-link]
|
|
14
14
|
|
|
15
|
-
Version: 4.13.19
|
|
16
15
|
|
|
17
16
|
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
|
|
18
17
|
|
|
19
|
-
## Documentation
|
|
18
|
+
## API Documentation
|
|
19
|
+
|
|
20
|
+
**@xylabs/eth-address**
|
|
21
|
+
|
|
22
|
+
***
|
|
23
|
+
|
|
24
|
+
## Classes
|
|
25
|
+
|
|
26
|
+
- [EthAddress](#classes/EthAddress)
|
|
27
|
+
|
|
28
|
+
## Functions
|
|
29
|
+
|
|
30
|
+
- [isEthAddress](#functions/isEthAddress)
|
|
31
|
+
- [ellipsize](#functions/ellipsize)
|
|
32
|
+
- [padHex](#functions/padHex)
|
|
33
|
+
|
|
34
|
+
### classes
|
|
35
|
+
|
|
36
|
+
### <a id="EthAddress"></a>EthAddress
|
|
37
|
+
|
|
38
|
+
[**@xylabs/eth-address**](#../README)
|
|
39
|
+
|
|
40
|
+
***
|
|
41
|
+
|
|
42
|
+
## Properties
|
|
43
|
+
|
|
44
|
+
### type
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
readonly static type: "EthAddress" = 'EthAddress';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
***
|
|
51
|
+
|
|
52
|
+
### type
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
type: string = EthAddress.type;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Methods
|
|
59
|
+
|
|
60
|
+
### fromString()
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
static fromString(value?, base?): undefined | EthAddress;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Parameters
|
|
67
|
+
|
|
68
|
+
#### value?
|
|
69
|
+
|
|
70
|
+
`string`
|
|
71
|
+
|
|
72
|
+
#### base?
|
|
73
|
+
|
|
74
|
+
`number` = `16`
|
|
75
|
+
|
|
76
|
+
### Returns
|
|
77
|
+
|
|
78
|
+
`undefined` \| `EthAddress`
|
|
79
|
+
|
|
80
|
+
***
|
|
81
|
+
|
|
82
|
+
### parse()
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
static parse(value, base?): undefined | EthAddress;
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Parameters
|
|
89
|
+
|
|
90
|
+
#### value
|
|
91
|
+
|
|
92
|
+
`unknown`
|
|
93
|
+
|
|
94
|
+
#### base?
|
|
95
|
+
|
|
96
|
+
`number`
|
|
97
|
+
|
|
98
|
+
### Returns
|
|
99
|
+
|
|
100
|
+
`undefined` \| `EthAddress`
|
|
101
|
+
|
|
102
|
+
***
|
|
103
|
+
|
|
104
|
+
### validate()
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
static validate(address): boolean;
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Parameters
|
|
111
|
+
|
|
112
|
+
#### address
|
|
113
|
+
|
|
114
|
+
`string`
|
|
115
|
+
|
|
116
|
+
### Returns
|
|
117
|
+
|
|
118
|
+
`boolean`
|
|
119
|
+
|
|
120
|
+
***
|
|
121
|
+
|
|
122
|
+
### equals()
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
equals(address?): boolean;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Parameters
|
|
129
|
+
|
|
130
|
+
#### address?
|
|
131
|
+
|
|
132
|
+
`null` | `string` | `EthAddress`
|
|
133
|
+
|
|
134
|
+
### Returns
|
|
135
|
+
|
|
136
|
+
`boolean`
|
|
137
|
+
|
|
138
|
+
***
|
|
139
|
+
|
|
140
|
+
### toBigNumber()
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
toBigNumber(): bigint;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Returns
|
|
147
|
+
|
|
148
|
+
`bigint`
|
|
149
|
+
|
|
150
|
+
***
|
|
151
|
+
|
|
152
|
+
### toHex()
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
toHex(): string;
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Returns
|
|
159
|
+
|
|
160
|
+
`string`
|
|
161
|
+
|
|
162
|
+
***
|
|
163
|
+
|
|
164
|
+
### toJSON()
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
toJSON(): string;
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Returns
|
|
171
|
+
|
|
172
|
+
`string`
|
|
173
|
+
|
|
174
|
+
***
|
|
175
|
+
|
|
176
|
+
### toLowerCaseString()
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
toLowerCaseString(): string;
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Returns
|
|
183
|
+
|
|
184
|
+
`string`
|
|
185
|
+
|
|
186
|
+
***
|
|
187
|
+
|
|
188
|
+
### toShortString()
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
toShortString(length): string;
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Parameters
|
|
195
|
+
|
|
196
|
+
#### length
|
|
197
|
+
|
|
198
|
+
`number` = `2`
|
|
199
|
+
|
|
200
|
+
### Returns
|
|
201
|
+
|
|
202
|
+
`string`
|
|
203
|
+
|
|
204
|
+
***
|
|
205
|
+
|
|
206
|
+
### toString()
|
|
207
|
+
|
|
208
|
+
```ts
|
|
209
|
+
toString(checksum?, chainId?): string;
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Parameters
|
|
213
|
+
|
|
214
|
+
#### checksum?
|
|
215
|
+
|
|
216
|
+
`boolean`
|
|
217
|
+
|
|
218
|
+
#### chainId?
|
|
219
|
+
|
|
220
|
+
`string`
|
|
221
|
+
|
|
222
|
+
### Returns
|
|
223
|
+
|
|
224
|
+
`string`
|
|
225
|
+
|
|
226
|
+
***
|
|
227
|
+
|
|
228
|
+
### validate()
|
|
229
|
+
|
|
230
|
+
```ts
|
|
231
|
+
validate(): boolean;
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Returns
|
|
235
|
+
|
|
236
|
+
`boolean`
|
|
237
|
+
|
|
238
|
+
### functions
|
|
239
|
+
|
|
240
|
+
### <a id="ellipsize"></a>ellipsize
|
|
241
|
+
|
|
242
|
+
[**@xylabs/eth-address**](#../README)
|
|
243
|
+
|
|
244
|
+
***
|
|
245
|
+
|
|
246
|
+
```ts
|
|
247
|
+
function ellipsize(value, length): string;
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Parameters
|
|
251
|
+
|
|
252
|
+
### value
|
|
253
|
+
|
|
254
|
+
`string`
|
|
255
|
+
|
|
256
|
+
### length
|
|
257
|
+
|
|
258
|
+
`number` = `2`
|
|
259
|
+
|
|
260
|
+
## Returns
|
|
261
|
+
|
|
262
|
+
`string`
|
|
263
|
+
|
|
264
|
+
### <a id="isEthAddress"></a>isEthAddress
|
|
265
|
+
|
|
266
|
+
[**@xylabs/eth-address**](#../README)
|
|
267
|
+
|
|
268
|
+
***
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
function isEthAddress(obj): boolean;
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Parameters
|
|
275
|
+
|
|
276
|
+
### obj
|
|
277
|
+
|
|
278
|
+
### type
|
|
279
|
+
|
|
280
|
+
`string`
|
|
281
|
+
|
|
282
|
+
## Returns
|
|
283
|
+
|
|
284
|
+
`boolean`
|
|
285
|
+
|
|
286
|
+
### <a id="padHex"></a>padHex
|
|
287
|
+
|
|
288
|
+
[**@xylabs/eth-address**](#../README)
|
|
289
|
+
|
|
290
|
+
***
|
|
291
|
+
|
|
292
|
+
```ts
|
|
293
|
+
function padHex(hex, byteCount): string;
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
## Parameters
|
|
297
|
+
|
|
298
|
+
### hex
|
|
299
|
+
|
|
300
|
+
`string`
|
|
301
|
+
|
|
302
|
+
### byteCount
|
|
303
|
+
|
|
304
|
+
`number` = `0`
|
|
305
|
+
|
|
306
|
+
## Returns
|
|
307
|
+
|
|
308
|
+
`string`
|
|
20
309
|
|
|
21
|
-
Coming Soon!
|
|
22
310
|
|
|
23
311
|
Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
|
|
24
312
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/eth-address",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.21",
|
|
4
4
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eth",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"src"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@xylabs/assert": "^4.13.
|
|
47
|
+
"@xylabs/assert": "^4.13.21",
|
|
48
48
|
"ethers": "^6.15.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|