@defisaver/tokens 1.4.7 → 1.4.11

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
@@ -51,7 +51,7 @@
51
51
 
52
52
  #### Defined in
53
53
 
54
- [types.ts:62](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/types.ts#L62)
54
+ [types.ts:62](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/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/8f13dea/src/types.ts#L6)
68
+ [types.ts:6](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/types.ts#L6)
69
69
 
70
70
  ___
71
71
 
@@ -94,7 +94,7 @@ Chain-specific asset info type
94
94
 
95
95
  #### Defined in
96
96
 
97
- [types.ts:30](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/types.ts#L30)
97
+ [types.ts:30](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/types.ts#L30)
98
98
 
99
99
  ___
100
100
 
@@ -122,7 +122,7 @@ Chain-agnostic asset info type
122
122
 
123
123
  #### Defined in
124
124
 
125
- [types.ts:13](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/types.ts#L13)
125
+ [types.ts:13](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/types.ts#L13)
126
126
 
127
127
  ___
128
128
 
@@ -132,7 +132,7 @@ ___
132
132
 
133
133
  #### Defined in
134
134
 
135
- [types.ts:69](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/types.ts#L69)
135
+ [types.ts:69](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/types.ts#L69)
136
136
 
137
137
  ___
138
138
 
@@ -160,7 +160,7 @@ Maker ilk info type
160
160
 
161
161
  #### Defined in
162
162
 
163
- [types.ts:48](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/types.ts#L48)
163
+ [types.ts:48](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/types.ts#L48)
164
164
 
165
165
  ## Variables
166
166
 
@@ -170,7 +170,7 @@ Maker ilk info type
170
170
 
171
171
  #### Defined in
172
172
 
173
- [index.ts:27](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L27)
173
+ [index.ts:27](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L27)
174
174
 
175
175
  ___
176
176
 
@@ -180,7 +180,7 @@ ___
180
180
 
181
181
  #### Defined in
182
182
 
183
- [aaveV2Markets.ts:3](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/aaveV2Markets.ts#L3)
183
+ [aaveV2Markets.ts:3](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/aaveV2Markets.ts#L3)
184
184
 
185
185
  ___
186
186
 
@@ -190,7 +190,7 @@ ___
190
190
 
191
191
  #### Defined in
192
192
 
193
- [assets.ts:229](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/assets.ts#L229)
193
+ [assets.ts:230](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/assets.ts#L230)
194
194
 
195
195
  ___
196
196
 
@@ -200,7 +200,7 @@ ___
200
200
 
201
201
  #### Defined in
202
202
 
203
- [ilks.ts:5](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/ilks.ts#L5)
203
+ [ilks.ts:5](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/ilks.ts#L5)
204
204
 
205
205
  ___
206
206
 
@@ -210,7 +210,7 @@ ___
210
210
 
211
211
  #### Defined in
212
212
 
213
- [reflexerCollTypes.ts:3](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/reflexerCollTypes.ts#L3)
213
+ [reflexerCollTypes.ts:3](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/reflexerCollTypes.ts#L3)
214
214
 
215
215
  ___
216
216
 
@@ -228,7 +228,7 @@ ___
228
228
 
229
229
  #### Defined in
230
230
 
231
- [index.ts:25](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L25)
231
+ [index.ts:25](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L25)
232
232
 
233
233
  ## Functions
234
234
 
@@ -249,7 +249,7 @@ ___
249
249
 
250
250
  #### Defined in
251
251
 
252
- [index.ts:146](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L146)
252
+ [index.ts:147](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L147)
253
253
 
254
254
  ___
255
255
 
@@ -270,7 +270,7 @@ ___
270
270
 
271
271
  #### Defined in
272
272
 
273
- [index.ts:167](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L167)
273
+ [index.ts:168](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L168)
274
274
 
275
275
  ___
276
276
 
@@ -290,7 +290,7 @@ ___
290
290
 
291
291
  #### Defined in
292
292
 
293
- [index.ts:139](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L139)
293
+ [index.ts:140](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L140)
294
294
 
295
295
  ___
296
296
 
@@ -313,7 +313,7 @@ Warning: will not throw if asset not found. Instead, will return a placeholder o
313
313
 
314
314
  #### Defined in
315
315
 
316
- [index.ts:58](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L58)
316
+ [index.ts:59](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L59)
317
317
 
318
318
  ___
319
319
 
@@ -333,7 +333,7 @@ ___
333
333
 
334
334
  #### Defined in
335
335
 
336
- [index.ts:93](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L93)
336
+ [index.ts:94](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L94)
337
337
 
338
338
  ___
339
339
 
@@ -356,7 +356,7 @@ Warning: will not throw if ilk not found. Instead, will return a placeholder obj
356
356
 
357
357
  #### Defined in
358
358
 
359
- [index.ts:71](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L71)
359
+ [index.ts:72](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L72)
360
360
 
361
361
  ___
362
362
 
@@ -376,7 +376,7 @@ ___
376
376
 
377
377
  #### Defined in
378
378
 
379
- [index.ts:98](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L98)
379
+ [index.ts:99](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L99)
380
380
 
381
381
  ___
382
382
 
@@ -397,7 +397,7 @@ ___
397
397
 
398
398
  #### Defined in
399
399
 
400
- [index.ts:21](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L21)
400
+ [index.ts:21](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L21)
401
401
 
402
402
  ___
403
403
 
@@ -420,7 +420,7 @@ Token symbol
420
420
 
421
421
  #### Defined in
422
422
 
423
- [index.ts:119](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L119)
423
+ [index.ts:120](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L120)
424
424
 
425
425
  ___
426
426
 
@@ -442,7 +442,7 @@ Token symbol
442
442
 
443
443
  #### Defined in
444
444
 
445
- [index.ts:131](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L131)
445
+ [index.ts:132](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L132)
446
446
 
447
447
  ___
448
448
 
@@ -464,4 +464,4 @@ Token symbol
464
464
 
465
465
  #### Defined in
466
466
 
467
- [index.ts:137](https://github.com/DecenterApps/defisaver-tokens/blob/8f13dea/src/index.ts#L137)
467
+ [index.ts:138](https://github.com/DecenterApps/defisaver-tokens/blob/ee06613/src/index.ts#L138)
package/esm/assets.js CHANGED
@@ -206,6 +206,7 @@ const ImusdAddress = "0x30647a72dc82d7fbb1123ea74716ab8a317eac19";
206
206
  const cUSDPAddress = "0x041171993284df560249B57358F931D9eB7b925D";
207
207
  const GuniDaiUsdc1Address = "0xAbDDAfB225e10B90D798bB8A886238Fb835e2053";
208
208
  const GuniDaiUsdc2Address = "0x50379f632ca68D36E50cfBC8F78fe16bd1499d1e";
209
+ const USTAddress = "0xa693B19d2931d498c5B318dF961919BB4aee87a5";
209
210
  export const assetProto = {
210
211
  symbol: '?',
211
212
  name: 'Unknown',
@@ -225,9 +226,13 @@ export const assetProto = {
225
226
  export const assets = [
226
227
  Object.assign(Object.assign({}, assetProto), { symbol: 'ETH', name: 'Ether', decimals: 18, exchange: true, compoundCollateral: false, addresses: {
227
228
  1: ETHAddress,
229
+ 10: '0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000',
230
+ 42161: ETHAddress,
228
231
  } }),
229
232
  Object.assign(Object.assign({}, assetProto), { symbol: 'WETH', name: 'WrappedEther', decimals: 18, addresses: {
230
233
  1: WETHAddress,
234
+ 10: '0x4200000000000000000000000000000000000006',
235
+ 42161: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
231
236
  }, yearnCollateral: true }),
232
237
  Object.assign(Object.assign({}, assetProto), { symbol: 'cETH', underlyingAsset: 'ETH', name: 'Ether', decimals: 8, exchange: false, compoundCollateral: true, addresses: {
233
238
  1: cETHAddress,
@@ -857,4 +862,7 @@ export const assets = [
857
862
  Object.assign(Object.assign({}, assetProto), { symbol: 'GUNIV3DAIUSDC2', name: 'Gelato Uniswap DAI/USDC LP 0.01%', decimals: 18, addresses: {
858
863
  1: GuniDaiUsdc2Address,
859
864
  } }),
865
+ Object.assign(Object.assign({}, assetProto), { symbol: 'UST', name: 'UST (Wormhole)', decimals: 6, addresses: {
866
+ 1: USTAddress,
867
+ } }),
860
868
  ];
package/esm/index.js CHANGED
@@ -21,6 +21,7 @@ Dec.set({
21
21
  rounding: Dec.ROUND_DOWN,
22
22
  toExpPos: 9e15,
23
23
  toExpNeg: -9e15,
24
+ precision: 50,
24
25
  });
25
26
  /**
26
27
  *
@@ -29,7 +30,7 @@ Dec.set({
29
30
  */
30
31
  const handleWBTCLegacy = (symbol = '') => (symbol === 'WBTC Legacy' ? 'WBTC' : symbol);
31
32
  const _addChainSpecificData = (assetDataBase) => {
32
- const assetData = Object.assign(Object.assign({}, assetDataBase), { address: assetDataBase.addresses[config.network] || '0x0000000000000000000000000000000000000000' });
33
+ const assetData = Object.assign(Object.assign({}, assetDataBase), { address: assetDataBase.addresses[config.network] || '' });
33
34
  if (config.iconFunc)
34
35
  assetData.icon = config.iconFunc(Object.assign({}, assetData));
35
36
  return assetData;
@@ -73,7 +74,7 @@ export const getIlkInfo = (ilk = '') => {
73
74
  return Object.assign(Object.assign({}, ilkData), { assetData });
74
75
  };
75
76
  export const getAssetInfoByAddress = (address = '') => {
76
- const assetDataBase = assets.find(t => t.addresses[config.network].toLowerCase() === address.toLowerCase());
77
+ const assetDataBase = assets.find(t => { var _a; return ((_a = t.addresses[config.network]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === address.toLowerCase(); });
77
78
  return _addChainSpecificData(assetDataBase || Object.assign({}, assetProto));
78
79
  };
79
80
  export const ilkToAsset = (ilk = '') => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/tokens",
3
- "version": "1.4.7",
3
+ "version": "1.4.11",
4
4
  "description": "Centralized asset data & utility functions",
5
5
  "main": "umd/index.js",
6
6
  "module": "esm/index.js",
package/src/assets.ts CHANGED
@@ -208,6 +208,7 @@ const ImusdAddress = "0x30647a72dc82d7fbb1123ea74716ab8a317eac19";
208
208
  const cUSDPAddress = "0x041171993284df560249B57358F931D9eB7b925D";
209
209
  const GuniDaiUsdc1Address = "0xAbDDAfB225e10B90D798bB8A886238Fb835e2053";
210
210
  const GuniDaiUsdc2Address = "0x50379f632ca68D36E50cfBC8F78fe16bd1499d1e";
211
+ const USTAddress = "0xa693B19d2931d498c5B318dF961919BB4aee87a5"
211
212
 
212
213
  export const assetProto: AssetDataBase = {
213
214
  symbol: '?',
@@ -236,6 +237,8 @@ export const assets: AssetDataBase[] = [
236
237
  compoundCollateral: false,
237
238
  addresses: {
238
239
  1: ETHAddress,
240
+ 10: '0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000',
241
+ 42161: ETHAddress,
239
242
  },
240
243
  },
241
244
  {
@@ -245,6 +248,8 @@ export const assets: AssetDataBase[] = [
245
248
  decimals: 18,
246
249
  addresses: {
247
250
  1: WETHAddress,
251
+ 10: '0x4200000000000000000000000000000000000006',
252
+ 42161: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
248
253
  },
249
254
  yearnCollateral: true,
250
255
  },
@@ -2371,4 +2376,13 @@ export const assets: AssetDataBase[] = [
2371
2376
  1: GuniDaiUsdc2Address,
2372
2377
  },
2373
2378
  },
2379
+ {
2380
+ ...assetProto,
2381
+ symbol: 'UST',
2382
+ name: 'UST (Wormhole)',
2383
+ decimals: 6,
2384
+ addresses: {
2385
+ 1: USTAddress,
2386
+ },
2387
+ },
2374
2388
  ];
package/src/index.ts CHANGED
@@ -30,6 +30,7 @@ Dec.set({
30
30
  rounding: Dec.ROUND_DOWN,
31
31
  toExpPos: 9e15,
32
32
  toExpNeg: -9e15,
33
+ precision: 50,
33
34
  });
34
35
 
35
36
  /**
@@ -42,7 +43,7 @@ const handleWBTCLegacy = (symbol:string = ''):string => (symbol === 'WBTC Legacy
42
43
  const _addChainSpecificData = (assetDataBase:AssetDataBase):AssetData => {
43
44
  const assetData = {
44
45
  ...assetDataBase,
45
- address: assetDataBase.addresses[config.network] || '0x0000000000000000000000000000000000000000'
46
+ address: assetDataBase.addresses[config.network] || ''
46
47
  };
47
48
  if (config.iconFunc) assetData.icon = config.iconFunc({ ...assetData });
48
49
  return assetData;
@@ -91,7 +92,7 @@ export const getIlkInfo = (ilk:string = ''):ExtendedIlkData => {
91
92
  };
92
93
 
93
94
  export const getAssetInfoByAddress = (address: string = ''):AssetData => {
94
- const assetDataBase = assets.find(t => t.addresses[config.network].toLowerCase() === address.toLowerCase());
95
+ const assetDataBase = assets.find(t => t.addresses[config.network]?.toLowerCase() === address.toLowerCase());
95
96
  return _addChainSpecificData(assetDataBase || {...assetProto});
96
97
  }
97
98
 
package/src/types.ts CHANGED
@@ -13,7 +13,7 @@ type AddressMapping = {
13
13
  type AssetDataBase = {
14
14
  symbol: string;
15
15
  name: string;
16
- addresses: AddressMapping,
16
+ addresses: AddressMapping;
17
17
  decimals: number;
18
18
  icon: Function;
19
19
  underlyingAsset: string;
@@ -31,7 +31,7 @@ type AssetData = {
31
31
  symbol: string;
32
32
  name: string;
33
33
  address: string;
34
- addresses: AddressMapping,
34
+ addresses: AddressMapping;
35
35
  decimals: number;
36
36
  icon: Function;
37
37
  underlyingAsset: string;
package/umd/index.js CHANGED
@@ -75,7 +75,8 @@ var MAXUINT = '11579208923731619542357098500868790785326998466564056403945758400
75
75
  decimal_js__WEBPACK_IMPORTED_MODULE_0___default().set({
76
76
  rounding: (decimal_js__WEBPACK_IMPORTED_MODULE_0___default().ROUND_DOWN),
77
77
  toExpPos: 9e15,
78
- toExpNeg: -9e15
78
+ toExpNeg: -9e15,
79
+ precision: 50
79
80
  });
80
81
  /**
81
82
  *
@@ -90,7 +91,7 @@ var handleWBTCLegacy = function handleWBTCLegacy() {
90
91
 
91
92
  var _addChainSpecificData = assetDataBase => {
92
93
  var assetData = _objectSpread(_objectSpread({}, assetDataBase), {}, {
93
- address: assetDataBase.addresses[config.network] || '0x0000000000000000000000000000000000000000'
94
+ address: assetDataBase.addresses[config.network] || ''
94
95
  });
95
96
 
96
97
  if (config.iconFunc) assetData.icon = config.iconFunc(_objectSpread({}, assetData));
@@ -146,7 +147,11 @@ var getIlkInfo = function getIlkInfo() {
146
147
  };
147
148
  var getAssetInfoByAddress = function getAssetInfoByAddress() {
148
149
  var address = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
149
- var assetDataBase = _assets__WEBPACK_IMPORTED_MODULE_1__.assets.find(t => t.addresses[config.network].toLowerCase() === address.toLowerCase());
150
+ var assetDataBase = _assets__WEBPACK_IMPORTED_MODULE_1__.assets.find(t => {
151
+ var _t$addresses$config$n;
152
+
153
+ return ((_t$addresses$config$n = t.addresses[config.network]) === null || _t$addresses$config$n === void 0 ? void 0 : _t$addresses$config$n.toLowerCase()) === address.toLowerCase();
154
+ });
150
155
  return _addChainSpecificData(assetDataBase || _objectSpread({}, _assets__WEBPACK_IMPORTED_MODULE_1__.assetProto));
151
156
  };
152
157
  var ilkToAsset = function ilkToAsset() {
@@ -459,6 +464,7 @@ var ImusdAddress = "0x30647a72dc82d7fbb1123ea74716ab8a317eac19";
459
464
  var cUSDPAddress = "0x041171993284df560249B57358F931D9eB7b925D";
460
465
  var GuniDaiUsdc1Address = "0xAbDDAfB225e10B90D798bB8A886238Fb835e2053";
461
466
  var GuniDaiUsdc2Address = "0x50379f632ca68D36E50cfBC8F78fe16bd1499d1e";
467
+ var USTAddress = "0xa693B19d2931d498c5B318dF961919BB4aee87a5";
462
468
  var assetProto = {
463
469
  symbol: '?',
464
470
  name: 'Unknown',
@@ -482,14 +488,18 @@ var assets = [_objectSpread(_objectSpread({}, assetProto), {}, {
482
488
  exchange: true,
483
489
  compoundCollateral: false,
484
490
  addresses: {
485
- 1: ETHAddress
491
+ 1: ETHAddress,
492
+ 10: '0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000',
493
+ 42161: ETHAddress
486
494
  }
487
495
  }), _objectSpread(_objectSpread({}, assetProto), {}, {
488
496
  symbol: 'WETH',
489
497
  name: 'WrappedEther',
490
498
  decimals: 18,
491
499
  addresses: {
492
- 1: WETHAddress
500
+ 1: WETHAddress,
501
+ 10: '0x4200000000000000000000000000000000000006',
502
+ 42161: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1'
493
503
  },
494
504
  yearnCollateral: true
495
505
  }), _objectSpread(_objectSpread({}, assetProto), {}, {
@@ -2204,6 +2214,13 @@ var assets = [_objectSpread(_objectSpread({}, assetProto), {}, {
2204
2214
  addresses: {
2205
2215
  1: GuniDaiUsdc2Address
2206
2216
  }
2217
+ }), _objectSpread(_objectSpread({}, assetProto), {}, {
2218
+ symbol: 'UST',
2219
+ name: 'UST (Wormhole)',
2220
+ decimals: 6,
2221
+ addresses: {
2222
+ 1: USTAddress
2223
+ }
2207
2224
  })];
2208
2225
 
2209
2226
  /***/ }),