@blocklet/launcher-util 2.0.29 → 2.0.31

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.
Files changed (2) hide show
  1. package/lib/util.js +4 -0
  2. package/package.json +4 -4
package/lib/util.js CHANGED
@@ -1,5 +1,6 @@
1
1
  require('moment-timezone');
2
2
  const moment = require('moment');
3
+ const get = require('lodash.get');
3
4
  const { BN, fromUnitToToken, fromTokenToUnit } = require('@ocap/util');
4
5
 
5
6
  const calculatePrice = (duration, unitPrice, from) => {
@@ -102,6 +103,8 @@ const getExplorerUrl = ({ address, type = 'txs', chainHost }) => {
102
103
  return `https://explorer.abtnetwork.io/explorer/${type}/${address}?host=${chainHost}`;
103
104
  };
104
105
 
106
+ const getBlockletDisplayName = (blocklet) => get(blocklet, 'title') || get(blocklet, 'name') || '';
107
+
105
108
  module.exports = {
106
109
  formatPeriod,
107
110
  calculatePrice,
@@ -111,4 +114,5 @@ module.exports = {
111
114
  getSort,
112
115
  sortArrayByDate,
113
116
  getExplorerUrl,
117
+ getBlockletDisplayName,
114
118
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/launcher-util",
3
- "version": "2.0.29",
3
+ "version": "2.0.31",
4
4
  "description": "Common constants",
5
5
  "keywords": [
6
6
  "constant"
@@ -31,8 +31,8 @@
31
31
  "url": "https://github.com/blocklet/launcher/issues"
32
32
  },
33
33
  "dependencies": {
34
- "@blocklet/sdk": "^1.16.4",
35
- "@ocap/util": "^1.18.68",
34
+ "@blocklet/sdk": "^1.16.5",
35
+ "@ocap/util": "^1.18.72",
36
36
  "axios": "^0.26.1",
37
37
  "flat": "^5.0.2",
38
38
  "lodash.get": "^4.4.2",
@@ -42,5 +42,5 @@
42
42
  "nodemailer": "^6.9.1",
43
43
  "url-join": "^4.0.1"
44
44
  },
45
- "gitHead": "1dd45e9681ee59f58353ebf31fe79a57355ef87a"
45
+ "gitHead": "a2504029bf7037ff719841a011b49ef85fb36cf2"
46
46
  }