@ocap/config 1.13.44 → 1.13.48
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/lib/default.js +3 -3
- package/lib/index.js +11 -2
- package/lib/schema.js +7 -1
- package/package.json +5 -4
package/lib/default.js
CHANGED
@@ -4,7 +4,7 @@ module.exports = {
|
|
4
4
|
maxListSize: 8,
|
5
5
|
maxMultisig: 8,
|
6
6
|
maxTxSize: {
|
7
|
-
default: 65535,
|
7
|
+
default: 65535,
|
8
8
|
'fg:t:account_migrate': 348,
|
9
9
|
'fg:t:create_asset': 65881,
|
10
10
|
'fg:t:create_factory': 65881,
|
@@ -23,7 +23,7 @@ module.exports = {
|
|
23
23
|
'fg:t:stake': 4096,
|
24
24
|
'fg:t:revoke_stake': 664,
|
25
25
|
'fg:t:create_rollup': 1691,
|
26
|
-
'fg:t:update_rollup':
|
26
|
+
'fg:t:update_rollup': 1691,
|
27
27
|
'fg:t:join_rollup': 1691,
|
28
28
|
'fg:t:leave_rollup': 1691,
|
29
29
|
'fg:t:create_rollup_block': 4096,
|
@@ -71,6 +71,7 @@ module.exports = {
|
|
71
71
|
'fg:t:stake',
|
72
72
|
'fg:t:join_rollup',
|
73
73
|
'fg:t:leave_rollup',
|
74
|
+
'fg:t:update_rollup',
|
74
75
|
'fg:t:deposit_token_v2',
|
75
76
|
'fg:t:create_rollup_block',
|
76
77
|
],
|
@@ -86,6 +87,5 @@ module.exports = {
|
|
86
87
|
initialSupply: 1000000000, // 1 billion
|
87
88
|
totalSupply: 1000000000, // 1 billion
|
88
89
|
inflationRate: 0,
|
89
|
-
erc20ContractAddress: '',
|
90
90
|
},
|
91
91
|
};
|
package/lib/index.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
const merge = require('lodash/merge');
|
2
2
|
const pick = require('lodash/pick');
|
3
3
|
const { fromTokenToUnit } = require('@ocap/util');
|
4
|
+
const { isValid, toTypeInfo } = require('@arcblock/did');
|
4
5
|
const { toTokenAddress } = require('@arcblock/did-util');
|
5
6
|
|
6
7
|
const defaultConfig = require('./default');
|
@@ -31,12 +32,20 @@ const genTokenItx = (config) => {
|
|
31
32
|
'decimal',
|
32
33
|
'icon',
|
33
34
|
'totalSupply',
|
34
|
-
'
|
35
|
+
'initialSupply',
|
36
|
+
'foreignToken',
|
35
37
|
]);
|
36
38
|
|
37
39
|
itx.totalSupply = fromTokenToUnit(itx.totalSupply, itx.decimal).toString();
|
40
|
+
itx.initialSupply = fromTokenToUnit(itx.initialSupply || itx.totalSupply, itx.decimal).toString();
|
38
41
|
itx.issuer = config.moderator.address;
|
39
|
-
|
42
|
+
|
43
|
+
const legacyAddr = process.env.CHAIN_TOKEN_ADDRESS;
|
44
|
+
if (legacyAddr && isValid(legacyAddr) && toTypeInfo(legacyAddr, true).role === 'ROLE_TOKEN') {
|
45
|
+
itx.address = legacyAddr;
|
46
|
+
} else {
|
47
|
+
itx.address = toTokenAddress(itx);
|
48
|
+
}
|
40
49
|
|
41
50
|
return itx;
|
42
51
|
};
|
package/lib/schema.js
CHANGED
@@ -42,7 +42,13 @@ const configSchema = Joi.object({
|
|
42
42
|
initialSupply: Joi.number().positive().required(),
|
43
43
|
totalSupply: Joi.number().positive().required(),
|
44
44
|
inflationRate: Joi.number().required(),
|
45
|
-
|
45
|
+
foreignToken: Joi.object({
|
46
|
+
type: Joi.string().min(1).max(32).required(),
|
47
|
+
contractAddress: Joi.string().required(),
|
48
|
+
chainType: Joi.string().min(1).max(32).required(),
|
49
|
+
chainName: Joi.string().min(1).max(32).required(),
|
50
|
+
chainId: Joi.number().positive().required(),
|
51
|
+
}).optional(),
|
46
52
|
})
|
47
53
|
.optional()
|
48
54
|
.default(defaultConfig.token),
|
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"publishConfig": {
|
4
4
|
"access": "public"
|
5
5
|
},
|
6
|
-
"version": "1.13.
|
6
|
+
"version": "1.13.48",
|
7
7
|
"description": "OCAP config parsing/validation and default",
|
8
8
|
"main": "lib/index.js",
|
9
9
|
"files": [
|
@@ -22,10 +22,11 @@
|
|
22
22
|
"jest": "^26.6.3"
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
|
-
"@arcblock/did
|
26
|
-
"@
|
25
|
+
"@arcblock/did": "1.13.48",
|
26
|
+
"@arcblock/did-util": "1.13.48",
|
27
|
+
"@ocap/util": "1.13.48",
|
27
28
|
"joi": "^17.3.0",
|
28
29
|
"lodash": "^4.17.21"
|
29
30
|
},
|
30
|
-
"gitHead": "
|
31
|
+
"gitHead": "08167e9f2d7223fac315e45b871a81bfbdf42de7"
|
31
32
|
}
|