@defisaver/tokens 1.4.22 → 1.4.23

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Table of contents
4
4
 
5
- ### Type Aliases
5
+ ### Type aliases
6
6
 
7
7
  - [AaveMarketData](README.md#aavemarketdata)
8
8
  - [AddressMapping](README.md#addressmapping)
@@ -34,7 +34,7 @@
34
34
  - [tokenFromMakerJoin](README.md#tokenfrommakerjoin)
35
35
  - [tokenFromReflexerJoin](README.md#tokenfromreflexerjoin)
36
36
 
37
- ## Type Aliases
37
+ ## Type aliases
38
38
 
39
39
  ### AaveMarketData
40
40
 
@@ -51,7 +51,7 @@
51
51
 
52
52
  #### Defined in
53
53
 
54
- [types.ts:62](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/types.ts#L62)
54
+ [types.ts:62](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/types.ts#L62)
55
55
 
56
56
  ___
57
57
 
@@ -65,7 +65,7 @@ ___
65
65
 
66
66
  #### Defined in
67
67
 
68
- [types.ts:6](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/types.ts#L6)
68
+ [types.ts:6](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/types.ts#L6)
69
69
 
70
70
  ___
71
71
 
@@ -73,6 +73,8 @@ ___
73
73
 
74
74
  Ƭ **AssetData**: `Object`
75
75
 
76
+ Chain-specific asset info type
77
+
76
78
  #### Type declaration
77
79
 
78
80
  | Name | Type |
@@ -92,7 +94,7 @@ ___
92
94
 
93
95
  #### Defined in
94
96
 
95
- [types.ts:30](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/types.ts#L30)
97
+ [types.ts:30](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/types.ts#L30)
96
98
 
97
99
  ___
98
100
 
@@ -100,6 +102,8 @@ ___
100
102
 
101
103
  Ƭ **AssetDataBase**: `Object`
102
104
 
105
+ Chain-agnostic asset info type
106
+
103
107
  #### Type declaration
104
108
 
105
109
  | Name | Type |
@@ -118,7 +122,7 @@ ___
118
122
 
119
123
  #### Defined in
120
124
 
121
- [types.ts:13](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/types.ts#L13)
125
+ [types.ts:13](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/types.ts#L13)
122
126
 
123
127
  ___
124
128
 
@@ -128,7 +132,7 @@ ___
128
132
 
129
133
  #### Defined in
130
134
 
131
- [types.ts:69](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/types.ts#L69)
135
+ [types.ts:69](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/types.ts#L69)
132
136
 
133
137
  ___
134
138
 
@@ -136,6 +140,8 @@ ___
136
140
 
137
141
  Ƭ **IlkData**: `Object`
138
142
 
143
+ Maker ilk info type
144
+
139
145
  #### Type declaration
140
146
 
141
147
  | Name | Type |
@@ -154,63 +160,63 @@ ___
154
160
 
155
161
  #### Defined in
156
162
 
157
- [types.ts:48](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/types.ts#L48)
163
+ [types.ts:48](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/types.ts#L48)
158
164
 
159
165
  ## Variables
160
166
 
161
167
  ### MAXUINT
162
168
 
163
- `Const` **MAXUINT**: `string` = `'115792089237316195423570985008687907853269984665640564039457584007913129639935'`
169
+ • **MAXUINT**: `string` = `'115792089237316195423570985008687907853269984665640564039457584007913129639935'`
164
170
 
165
171
  #### Defined in
166
172
 
167
- [index.ts:27](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L27)
173
+ [index.ts:27](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L27)
168
174
 
169
175
  ___
170
176
 
171
177
  ### aaveV2Markets
172
178
 
173
- `Const` **aaveV2Markets**: [`AaveMarketData`](README.md#aavemarketdata)[]
179
+ • **aaveV2Markets**: [`AaveMarketData`](README.md#aavemarketdata)[]
174
180
 
175
181
  #### Defined in
176
182
 
177
- [aaveV2Markets.ts:3](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/aaveV2Markets.ts#L3)
183
+ [aaveV2Markets.ts:3](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/aaveV2Markets.ts#L3)
178
184
 
179
185
  ___
180
186
 
181
187
  ### assets
182
188
 
183
- `Const` **assets**: [`AssetDataBase`](README.md#assetdatabase)[]
189
+ • **assets**: [`AssetDataBase`](README.md#assetdatabase)[]
184
190
 
185
191
  #### Defined in
186
192
 
187
- [assets.ts:232](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/assets.ts#L232)
193
+ [assets.ts:232](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/assets.ts#L232)
188
194
 
189
195
  ___
190
196
 
191
197
  ### ilks
192
198
 
193
- `Const` **ilks**: [`IlkData`](README.md#ilkdata)[]
199
+ • **ilks**: [`IlkData`](README.md#ilkdata)[]
194
200
 
195
201
  #### Defined in
196
202
 
197
- [ilks.ts:5](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/ilks.ts#L5)
203
+ [ilks.ts:5](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/ilks.ts#L5)
198
204
 
199
205
  ___
200
206
 
201
207
  ### reflexerCollTypes
202
208
 
203
- `Const` **reflexerCollTypes**: [`IlkData`](README.md#ilkdata)[]
209
+ • **reflexerCollTypes**: [`IlkData`](README.md#ilkdata)[]
204
210
 
205
211
  #### Defined in
206
212
 
207
- [reflexerCollTypes.ts:3](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/reflexerCollTypes.ts#L3)
213
+ [reflexerCollTypes.ts:3](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/reflexerCollTypes.ts#L3)
208
214
 
209
215
  ___
210
216
 
211
217
  ### utils
212
218
 
213
- `Const` **utils**: `Object`
219
+ • **utils**: `Object`
214
220
 
215
221
  #### Type declaration
216
222
 
@@ -222,20 +228,20 @@ ___
222
228
 
223
229
  #### Defined in
224
230
 
225
- [index.ts:25](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L25)
231
+ [index.ts:25](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L25)
226
232
 
227
233
  ## Functions
228
234
 
229
235
  ### assetAmountInEth
230
236
 
231
- ▸ **assetAmountInEth**(`amount`, `asset?`): `string`
237
+ `Const` **assetAmountInEth**(`amount`, `asset?`): `string`
232
238
 
233
239
  #### Parameters
234
240
 
235
241
  | Name | Type | Default value | Description |
236
242
  | :------ | :------ | :------ | :------ |
237
- | `amount` | `string` \| `number` \| `object` | `undefined` | |
238
- | `asset` | `string` | `'ETH'` | |
243
+ | `amount` | `string` \| `number` \| `object` | `undefined` | Amount in wei |
244
+ | `asset` | `string` | `'ETH'` | Asset symbol (or `MCD-${symbol}` for maker asset - always 18dec) |
239
245
 
240
246
  #### Returns
241
247
 
@@ -243,20 +249,20 @@ ___
243
249
 
244
250
  #### Defined in
245
251
 
246
- [index.ts:148](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L148)
252
+ [index.ts:149](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L149)
247
253
 
248
254
  ___
249
255
 
250
256
  ### assetAmountInWei
251
257
 
252
- ▸ **assetAmountInWei**(`amount`, `asset`): `string`
258
+ `Const` **assetAmountInWei**(`amount`, `asset`): `string`
253
259
 
254
260
  #### Parameters
255
261
 
256
262
  | Name | Type | Description |
257
263
  | :------ | :------ | :------ |
258
- | `amount` | `string` \| `number` \| `object` | |
259
- | `asset` | `string` | |
264
+ | `amount` | `string` \| `number` \| `object` | Amount in eth |
265
+ | `asset` | `string` | Asset symbol |
260
266
 
261
267
  #### Returns
262
268
 
@@ -264,13 +270,13 @@ ___
264
270
 
265
271
  #### Defined in
266
272
 
267
- [index.ts:169](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L169)
273
+ [index.ts:170](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L170)
268
274
 
269
275
  ___
270
276
 
271
277
  ### getAaveV2MarketInfo
272
278
 
273
- ▸ **getAaveV2MarketInfo**(`name?`): `void` \| [`AaveMarketData`](README.md#aavemarketdata)
279
+ `Const` **getAaveV2MarketInfo**(`name?`): `void` \| [`AaveMarketData`](README.md#aavemarketdata)
274
280
 
275
281
  #### Parameters
276
282
 
@@ -284,13 +290,16 @@ ___
284
290
 
285
291
  #### Defined in
286
292
 
287
- [index.ts:141](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L141)
293
+ [index.ts:142](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L142)
288
294
 
289
295
  ___
290
296
 
291
297
  ### getAssetInfo
292
298
 
293
- ▸ **getAssetInfo**(`symbol?`, `chainId?`): [`AssetData`](README.md#assetdata)
299
+ `Const` **getAssetInfo**(`symbol?`, `chainId?`): [`AssetData`](README.md#assetdata)
300
+
301
+ Returns asset info.
302
+ Warning: will not throw if asset not found. Instead, will return a placeholder object.
294
303
 
295
304
  #### Parameters
296
305
 
@@ -305,13 +314,13 @@ ___
305
314
 
306
315
  #### Defined in
307
316
 
308
- [index.ts:60](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L60)
317
+ [index.ts:60](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L60)
309
318
 
310
319
  ___
311
320
 
312
321
  ### getAssetInfoByAddress
313
322
 
314
- ▸ **getAssetInfoByAddress**(`address?`, `chainId?`): [`AssetData`](README.md#assetdata)
323
+ `Const` **getAssetInfoByAddress**(`address?`, `chainId?`): [`AssetData`](README.md#assetdata)
315
324
 
316
325
  #### Parameters
317
326
 
@@ -326,19 +335,22 @@ ___
326
335
 
327
336
  #### Defined in
328
337
 
329
- [index.ts:95](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L95)
338
+ [index.ts:95](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L95)
330
339
 
331
340
  ___
332
341
 
333
342
  ### getIlkInfo
334
343
 
335
- ▸ **getIlkInfo**(`ilk?`): [`ExtendedIlkData`](README.md#extendedilkdata)
344
+ `Const` **getIlkInfo**(`ilk?`): [`ExtendedIlkData`](README.md#extendedilkdata)
345
+
346
+ Returns Maker or Reflexer ilk info, and asset info as `assetData` attribute.
347
+ Warning: will not throw if ilk not found. Instead, will return a placeholder object.
336
348
 
337
349
  #### Parameters
338
350
 
339
351
  | Name | Type | Default value | Description |
340
352
  | :------ | :------ | :------ | :------ |
341
- | `ilk` | `string` | `''` | |
353
+ | `ilk` | `string` | `''` | Ilk encoded as string or as hex |
342
354
 
343
355
  #### Returns
344
356
 
@@ -346,13 +358,13 @@ ___
346
358
 
347
359
  #### Defined in
348
360
 
349
- [index.ts:73](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L73)
361
+ [index.ts:73](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L73)
350
362
 
351
363
  ___
352
364
 
353
365
  ### ilkToAsset
354
366
 
355
- ▸ **ilkToAsset**(`ilk?`): `string`
367
+ `Const` **ilkToAsset**(`ilk?`): `string`
356
368
 
357
369
  #### Parameters
358
370
 
@@ -366,13 +378,13 @@ ___
366
378
 
367
379
  #### Defined in
368
380
 
369
- [index.ts:100](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L100)
381
+ [index.ts:100](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L100)
370
382
 
371
383
  ___
372
384
 
373
385
  ### set
374
386
 
375
- ▸ **set**(`key`, `value`): `void`
387
+ `Const` **set**(`key`, `value`): `void`
376
388
 
377
389
  #### Parameters
378
390
 
@@ -387,65 +399,71 @@ ___
387
399
 
388
400
  #### Defined in
389
401
 
390
- [index.ts:21](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L21)
402
+ [index.ts:21](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L21)
391
403
 
392
404
  ___
393
405
 
394
406
  ### tokenFromJoin
395
407
 
396
- ▸ **tokenFromJoin**(`join`, `fromIlks?`): `string`
408
+ `Const` **tokenFromJoin**(`join`, `fromIlks?`): `string`
397
409
 
398
410
  #### Parameters
399
411
 
400
412
  | Name | Type | Default value | Description |
401
413
  | :------ | :------ | :------ | :------ |
402
- | `join` | `string` | `undefined` | |
414
+ | `join` | `string` | `undefined` | Maker or Reflexer ilk join |
403
415
  | `fromIlks` | [`IlkData`](README.md#ilkdata)[] | `ilks` | |
404
416
 
405
417
  #### Returns
406
418
 
407
419
  `string`
408
420
 
421
+ Token symbol
422
+
409
423
  #### Defined in
410
424
 
411
- [index.ts:121](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L121)
425
+ [index.ts:122](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L122)
412
426
 
413
427
  ___
414
428
 
415
429
  ### tokenFromMakerJoin
416
430
 
417
- ▸ **tokenFromMakerJoin**(`join`): `string`
431
+ `Const` **tokenFromMakerJoin**(`join`): `string`
418
432
 
419
433
  #### Parameters
420
434
 
421
435
  | Name | Type | Description |
422
436
  | :------ | :------ | :------ |
423
- | `join` | `string` | |
437
+ | `join` | `string` | Maker ilk join |
424
438
 
425
439
  #### Returns
426
440
 
427
441
  `string`
428
442
 
443
+ Token symbol
444
+
429
445
  #### Defined in
430
446
 
431
- [index.ts:133](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L133)
447
+ [index.ts:134](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L134)
432
448
 
433
449
  ___
434
450
 
435
451
  ### tokenFromReflexerJoin
436
452
 
437
- ▸ **tokenFromReflexerJoin**(`join`): `string`
453
+ `Const` **tokenFromReflexerJoin**(`join`): `string`
438
454
 
439
455
  #### Parameters
440
456
 
441
457
  | Name | Type | Description |
442
458
  | :------ | :------ | :------ |
443
- | `join` | `string` | |
459
+ | `join` | `string` | Reflexer ilk join |
444
460
 
445
461
  #### Returns
446
462
 
447
463
  `string`
448
464
 
465
+ Token symbol
466
+
449
467
  #### Defined in
450
468
 
451
- [index.ts:139](https://github.com/DecenterApps/defisaver-tokens/blob/117ec02/src/index.ts#L139)
469
+ [index.ts:140](https://github.com/DecenterApps/defisaver-tokens/blob/a54dc0d/src/index.ts#L140)
package/esm/ilks.js CHANGED
@@ -425,7 +425,7 @@ export const ilks = [
425
425
  "ilkBytes": "0x435256563145544853544554482d410000000000000000000000000000000000",
426
426
  "join": "0x82D8bfDB61404C796385f251654F6d7e92092b5D",
427
427
  "clip": "0x1926862F899410BfC19FeFb8A3C69C7Aed22463a",
428
- "pip": "0x0A7DA4e31582a2fB4FD4067943e88f127F70ab39",
428
+ "pip": "0xEa508F82728927454bd3ce853171b0e2705880D4",
429
429
  "isLP": true,
430
430
  "isCrop": true
431
431
  },
@@ -439,5 +439,16 @@ export const ilks = [
439
439
  "pip": "0xFe7a2aC0B945f12089aEEB6eCebf4F384D9f043F",
440
440
  "isLP": false,
441
441
  "isCrop": false
442
+ },
443
+ {
444
+ "asset": "rETH",
445
+ "assetAddress": "0xae78736Cd615f374D3085123A210448E74Fc6393",
446
+ "ilkLabel": "RETH-A",
447
+ "ilkBytes": "0x524554482d410000000000000000000000000000000000000000000000000000",
448
+ "join": "0xC6424e862f1462281B0a5FAc078e4b63006bDEBF",
449
+ "clip": "0x27CA5E525ea473eD52Ea9423CD08cCc081d96a98",
450
+ "pip": "0xeE7F0b350aA119b3d05DC733a4621a81972f7D47",
451
+ "isLP": false,
452
+ "isCrop": false
442
453
  }
443
454
  ];
package/esm/index.d.ts CHANGED
@@ -24,7 +24,7 @@ export declare const MAXUINT: string;
24
24
  * @param chainId {number}
25
25
  * @return {AssetData}
26
26
  */
27
- export declare const getAssetInfo: (symbol?: string, chainId?: number) => AssetData;
27
+ export declare const getAssetInfo: (symbol?: string, chainId?: number | undefined) => AssetData;
28
28
  /**
29
29
  * Returns Maker or Reflexer ilk info, and asset info as `assetData` attribute.
30
30
  * Warning: will not throw if ilk not found. Instead, will return a placeholder object.
@@ -33,7 +33,7 @@ export declare const getAssetInfo: (symbol?: string, chainId?: number) => AssetD
33
33
  * @returns {ExtendedIlkData}
34
34
  */
35
35
  export declare const getIlkInfo: (ilk?: string) => ExtendedIlkData;
36
- export declare const getAssetInfoByAddress: (address?: string, chainId?: number) => AssetData;
36
+ export declare const getAssetInfoByAddress: (address?: string, chainId?: number | undefined) => AssetData;
37
37
  export declare const ilkToAsset: (ilk?: string) => string;
38
38
  /** @private **/
39
39
  export declare const compoundAsset: (underlyingAsset: string) => string;
package/esm/index.js CHANGED
@@ -92,6 +92,8 @@ export const ilkToAsset = (ilk = '') => {
92
92
  return 'wstETH';
93
93
  if (asset === 'CRVV1ETHSTETH')
94
94
  return 'steCRV';
95
+ if (asset === 'RETH')
96
+ return 'rETH';
95
97
  return asset;
96
98
  };
97
99
  /** @private **/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/tokens",
3
- "version": "1.4.22",
3
+ "version": "1.4.23",
4
4
  "description": "Centralized asset data & utility functions",
5
5
  "main": "umd/index.js",
6
6
  "module": "esm/index.js",
package/src/ilks.ts CHANGED
@@ -428,7 +428,7 @@ export const ilks:IlkData[] = [
428
428
  "ilkBytes": "0x435256563145544853544554482d410000000000000000000000000000000000",
429
429
  "join": "0x82D8bfDB61404C796385f251654F6d7e92092b5D",
430
430
  "clip": "0x1926862F899410BfC19FeFb8A3C69C7Aed22463a",
431
- "pip": "0x0A7DA4e31582a2fB4FD4067943e88f127F70ab39",
431
+ "pip": "0xEa508F82728927454bd3ce853171b0e2705880D4",
432
432
  "isLP": true,
433
433
  "isCrop": true
434
434
  },
@@ -442,5 +442,16 @@ export const ilks:IlkData[] = [
442
442
  "pip": "0xFe7a2aC0B945f12089aEEB6eCebf4F384D9f043F",
443
443
  "isLP": false,
444
444
  "isCrop": false
445
+ },
446
+ {
447
+ "asset": "rETH",
448
+ "assetAddress": "0xae78736Cd615f374D3085123A210448E74Fc6393",
449
+ "ilkLabel": "RETH-A",
450
+ "ilkBytes": "0x524554482d410000000000000000000000000000000000000000000000000000",
451
+ "join": "0xC6424e862f1462281B0a5FAc078e4b63006bDEBF",
452
+ "clip": "0x27CA5E525ea473eD52Ea9423CD08cCc081d96a98",
453
+ "pip": "0xeE7F0b350aA119b3d05DC733a4621a81972f7D47",
454
+ "isLP": false,
455
+ "isCrop": false
445
456
  }
446
457
  ];
package/src/index.ts CHANGED
@@ -105,6 +105,7 @@ export const ilkToAsset = (ilk: string = ''):string => {
105
105
  if (asset === 'PAXUSD' || asset === 'PAX') return 'USDP';
106
106
  if (asset === 'WSTETH') return 'wstETH';
107
107
  if (asset === 'CRVV1ETHSTETH') return 'steCRV';
108
+ if (asset === 'RETH') return 'rETH';
108
109
  return asset;
109
110
  }
110
111