@subwallet/extension-base 1.1.44-0 → 1.1.45-0
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/cjs/packageInfo.js +1 -1
- package/cjs/services/chain-service/constants.js +4 -2
- package/cjs/services/chain-service/index.js +5 -5
- package/cjs/services/earning-service/constants/chains.js +1 -1
- package/cjs/services/earning-service/service.js +1 -1
- package/cjs/services/migration-service/scripts/MigrateTransactionHistoryBySymbol.js +5 -1
- package/cjs/services/migration-service/scripts/databases/MigrateAssetSetting.js +2 -1
- package/cjs/services/migration-service/scripts/index.js +1 -1
- package/cjs/services/transaction-service/utils.js +3 -0
- package/package.json +6 -6
- package/packageInfo.js +1 -1
- package/services/chain-service/constants.js +4 -2
- package/services/chain-service/index.js +5 -5
- package/services/earning-service/constants/chains.js +1 -1
- package/services/earning-service/service.js +1 -1
- package/services/migration-service/scripts/MigrateTransactionHistoryBySymbol.js +5 -1
- package/services/migration-service/scripts/databases/MigrateAssetSetting.js +2 -1
- package/services/migration-service/scripts/index.js +1 -1
- package/services/transaction-service/utils.js +3 -0
package/cjs/packageInfo.js
CHANGED
|
@@ -100,7 +100,8 @@ const _STAKING_ERA_LENGTH_MAP = {
|
|
|
100
100
|
vara_network: 12,
|
|
101
101
|
goldberg_testnet: 24,
|
|
102
102
|
manta_network: 6,
|
|
103
|
-
krest_network: 4
|
|
103
|
+
krest_network: 4,
|
|
104
|
+
polimec: 6
|
|
104
105
|
};
|
|
105
106
|
exports._STAKING_ERA_LENGTH_MAP = _STAKING_ERA_LENGTH_MAP;
|
|
106
107
|
const _EXPECTED_BLOCK_TIME = {
|
|
@@ -117,7 +118,8 @@ const _EXPECTED_BLOCK_TIME = {
|
|
|
117
118
|
edgeware: 6,
|
|
118
119
|
creditcoin: 12,
|
|
119
120
|
vara_network: 3,
|
|
120
|
-
goldberg_testnet: 20
|
|
121
|
+
goldberg_testnet: 20,
|
|
122
|
+
polimec: 12
|
|
121
123
|
};
|
|
122
124
|
exports._EXPECTED_BLOCK_TIME = _EXPECTED_BLOCK_TIME;
|
|
123
125
|
const _PARACHAIN_INFLATION_DISTRIBUTION = {
|
|
@@ -1518,15 +1518,15 @@ class ChainService {
|
|
|
1518
1518
|
const chainInfoMap = this.getChainInfoMap();
|
|
1519
1519
|
Object.values(chainInfoMap).forEach(i => {
|
|
1520
1520
|
var _i$extraInfo;
|
|
1521
|
-
|
|
1521
|
+
const subscanSlug = i.slug === 'goldberg_testnet' ? 'avail-testnet' : (_i$extraInfo = i.extraInfo) === null || _i$extraInfo === void 0 ? void 0 : _i$extraInfo.subscanSlug; // Hotfix for Goldberg testnet
|
|
1522
|
+
|
|
1523
|
+
if (!subscanSlug) {
|
|
1522
1524
|
return;
|
|
1523
1525
|
}
|
|
1524
1526
|
if (!reverse) {
|
|
1525
|
-
|
|
1526
|
-
result[i.slug] = (_i$extraInfo2 = i.extraInfo) === null || _i$extraInfo2 === void 0 ? void 0 : _i$extraInfo2.subscanSlug;
|
|
1527
|
+
result[i.slug] = subscanSlug;
|
|
1527
1528
|
} else {
|
|
1528
|
-
|
|
1529
|
-
result[(_i$extraInfo3 = i.extraInfo) === null || _i$extraInfo3 === void 0 ? void 0 : _i$extraInfo3.subscanSlug] = i.slug;
|
|
1529
|
+
result[subscanSlug] = i.slug;
|
|
1530
1530
|
}
|
|
1531
1531
|
});
|
|
1532
1532
|
return result;
|
|
@@ -9,7 +9,7 @@ exports._STAKING_CHAIN_GROUP = exports.ST_LIQUID_TOKEN_ABI = exports.MANTA_VALID
|
|
|
9
9
|
|
|
10
10
|
const _STAKING_CHAIN_GROUP = {
|
|
11
11
|
relay: ['polkadot', 'kusama', 'aleph', 'polkadex', 'ternoa', 'alephTest', 'polkadexTest', 'westend', 'kate', 'edgeware', 'creditcoin', 'vara_network', 'goldberg_testnet'],
|
|
12
|
-
para: ['moonbeam', 'moonriver', 'moonbase', 'turing', 'turingStaging', 'bifrost', 'bifrost_testnet', 'calamari_test', 'calamari', 'manta_network'],
|
|
12
|
+
para: ['moonbeam', 'moonriver', 'moonbase', 'turing', 'turingStaging', 'bifrost', 'bifrost_testnet', 'calamari_test', 'calamari', 'manta_network', 'polimec'],
|
|
13
13
|
astar: ['astar', 'shiden', 'shibuya'],
|
|
14
14
|
amplitude: ['amplitude', 'amplitude_test', 'kilt', 'kilt_peregrine', 'pendulum', 'krest_network'],
|
|
15
15
|
// amplitude and kilt only share some common logic
|
|
@@ -277,7 +277,7 @@ class EarningService {
|
|
|
277
277
|
const unsubList = [];
|
|
278
278
|
for (const handler of Object.values(this.handlers)) {
|
|
279
279
|
// Force subscribe onchain data
|
|
280
|
-
const forceSubscribe = handler.type === _types2.YieldPoolType.LIQUID_STAKING || handler.type === _types2.YieldPoolType.LENDING;
|
|
280
|
+
const forceSubscribe = handler.type === _types2.YieldPoolType.LIQUID_STAKING || handler.type === _types2.YieldPoolType.LENDING || !onlineData[handler.slug];
|
|
281
281
|
if (!this.useOnlineCacheOnly || forceSubscribe) {
|
|
282
282
|
handler.subscribePoolInfo(callback).then(unsub => {
|
|
283
283
|
if (!cancel) {
|
|
@@ -29,7 +29,8 @@ class MigrateTransactionHistoryBySymbol extends _Base.default {
|
|
|
29
29
|
'pangolin-LOCAL-CKTON': 'pangolin-LOCAL-PKTON',
|
|
30
30
|
'zeta_test-NATIVE-aZETA': 'zeta_test-NATIVE-ZETA',
|
|
31
31
|
'origintrail-NATIVE-OTP': 'origintrail-NATIVE-NEURO',
|
|
32
|
-
'moonbeam-LOCAL-xciBTC': 'moonbeam-LOCAL-xcIBTC'
|
|
32
|
+
'moonbeam-LOCAL-xciBTC': 'moonbeam-LOCAL-xcIBTC',
|
|
33
|
+
'tomochain-NATIVE-TOMO': 'tomochain-NATIVE-VIC'
|
|
33
34
|
};
|
|
34
35
|
const allTxs = [];
|
|
35
36
|
await Promise.all(Object.entries(changeSlugsMap).map(async (_ref, i) => {
|
|
@@ -50,6 +51,9 @@ class MigrateTransactionHistoryBySymbol extends _Base.default {
|
|
|
50
51
|
if (transaction.amount && transaction.amount.symbol === oldSymbolSlug) {
|
|
51
52
|
transaction.amount.symbol = newSymbolSlug;
|
|
52
53
|
}
|
|
54
|
+
if (transaction.fee && transaction.fee.symbol === oldSymbolSlug) {
|
|
55
|
+
transaction.fee.symbol = newSymbolSlug;
|
|
56
|
+
}
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
allTxs.push(...filterTransactions);
|
|
@@ -28,7 +28,8 @@ class MigrateAssetSetting extends _Base.default {
|
|
|
28
28
|
'pangolin-LOCAL-CKTON': 'pangolin-LOCAL-PKTON',
|
|
29
29
|
'zeta_test-NATIVE-aZETA': 'zeta_test-NATIVE-ZETA',
|
|
30
30
|
'origintrail-NATIVE-OTP': 'origintrail-NATIVE-NEURO',
|
|
31
|
-
'moonbeam-LOCAL-xciBTC': 'moonbeam-LOCAL-xcIBTC'
|
|
31
|
+
'moonbeam-LOCAL-xciBTC': 'moonbeam-LOCAL-xcIBTC',
|
|
32
|
+
'tomochain-NATIVE-TOMO': 'tomochain-NATIVE-VIC'
|
|
32
33
|
};
|
|
33
34
|
const assetSetting = await this.state.chainService.getAssetSettings();
|
|
34
35
|
const migratedAssetSetting = {};
|
|
@@ -55,7 +55,7 @@ var _default = {
|
|
|
55
55
|
'1.1.28-01': _MigrateEarningVersion.default,
|
|
56
56
|
'1.1.41-01': _DeleteChainStaking.default,
|
|
57
57
|
'1.1.44-01': _MigrateAssetSetting.default,
|
|
58
|
-
'1.1.
|
|
58
|
+
'1.1.45-01': _MigrateTransactionHistoryBySymbol.default
|
|
59
59
|
// [`${EVERYTIME}-1.1.42-02`]: MigrateTransactionHistoryBySymbol
|
|
60
60
|
// [`${EVERYTIME}-1`]: AutoEnableChainsTokens
|
|
61
61
|
};
|
|
@@ -28,6 +28,9 @@ function getBlockExplorerAccountRoute(explorerLink) {
|
|
|
28
28
|
if (explorerLink.includes('3dpscan.io')) {
|
|
29
29
|
return 'account';
|
|
30
30
|
}
|
|
31
|
+
if (explorerLink.includes('explorer.polimec.org')) {
|
|
32
|
+
return 'account';
|
|
33
|
+
}
|
|
31
34
|
return 'address';
|
|
32
35
|
}
|
|
33
36
|
function getBlockExplorerTxRoute(chainInfo) {
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"./cjs/detectPackage.js"
|
|
18
18
|
],
|
|
19
19
|
"type": "module",
|
|
20
|
-
"version": "1.1.
|
|
20
|
+
"version": "1.1.45-0",
|
|
21
21
|
"main": "./cjs/index.js",
|
|
22
22
|
"module": "./index.js",
|
|
23
23
|
"types": "./index.d.ts",
|
|
@@ -1791,11 +1791,11 @@
|
|
|
1791
1791
|
"@reduxjs/toolkit": "^1.9.1",
|
|
1792
1792
|
"@sora-substrate/type-definitions": "^1.17.7",
|
|
1793
1793
|
"@substrate/connect": "^0.7.26",
|
|
1794
|
-
"@subwallet/chain-list": "0.2.
|
|
1795
|
-
"@subwallet/extension-base": "^1.1.
|
|
1796
|
-
"@subwallet/extension-chains": "^1.1.
|
|
1797
|
-
"@subwallet/extension-dapp": "^1.1.
|
|
1798
|
-
"@subwallet/extension-inject": "^1.1.
|
|
1794
|
+
"@subwallet/chain-list": "0.2.47",
|
|
1795
|
+
"@subwallet/extension-base": "^1.1.45-0",
|
|
1796
|
+
"@subwallet/extension-chains": "^1.1.45-0",
|
|
1797
|
+
"@subwallet/extension-dapp": "^1.1.45-0",
|
|
1798
|
+
"@subwallet/extension-inject": "^1.1.45-0",
|
|
1799
1799
|
"@subwallet/keyring": "^0.1.3",
|
|
1800
1800
|
"@subwallet/ui-keyring": "^0.1.3",
|
|
1801
1801
|
"@walletconnect/sign-client": "^2.8.4",
|
package/packageInfo.js
CHANGED
|
@@ -7,5 +7,5 @@ export const packageInfo = {
|
|
|
7
7
|
name: '@subwallet/extension-base',
|
|
8
8
|
path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
|
|
9
9
|
type: 'esm',
|
|
10
|
-
version: '1.1.
|
|
10
|
+
version: '1.1.45-0'
|
|
11
11
|
};
|
|
@@ -87,7 +87,8 @@ export const _STAKING_ERA_LENGTH_MAP = {
|
|
|
87
87
|
vara_network: 12,
|
|
88
88
|
goldberg_testnet: 24,
|
|
89
89
|
manta_network: 6,
|
|
90
|
-
krest_network: 4
|
|
90
|
+
krest_network: 4,
|
|
91
|
+
polimec: 6
|
|
91
92
|
};
|
|
92
93
|
export const _EXPECTED_BLOCK_TIME = {
|
|
93
94
|
// in seconds
|
|
@@ -103,7 +104,8 @@ export const _EXPECTED_BLOCK_TIME = {
|
|
|
103
104
|
edgeware: 6,
|
|
104
105
|
creditcoin: 12,
|
|
105
106
|
vara_network: 3,
|
|
106
|
-
goldberg_testnet: 20
|
|
107
|
+
goldberg_testnet: 20,
|
|
108
|
+
polimec: 12
|
|
107
109
|
};
|
|
108
110
|
export const _PARACHAIN_INFLATION_DISTRIBUTION = {
|
|
109
111
|
moonbeam: {
|
|
@@ -1497,15 +1497,15 @@ export class ChainService {
|
|
|
1497
1497
|
const chainInfoMap = this.getChainInfoMap();
|
|
1498
1498
|
Object.values(chainInfoMap).forEach(i => {
|
|
1499
1499
|
var _i$extraInfo;
|
|
1500
|
-
|
|
1500
|
+
const subscanSlug = i.slug === 'goldberg_testnet' ? 'avail-testnet' : (_i$extraInfo = i.extraInfo) === null || _i$extraInfo === void 0 ? void 0 : _i$extraInfo.subscanSlug; // Hotfix for Goldberg testnet
|
|
1501
|
+
|
|
1502
|
+
if (!subscanSlug) {
|
|
1501
1503
|
return;
|
|
1502
1504
|
}
|
|
1503
1505
|
if (!reverse) {
|
|
1504
|
-
|
|
1505
|
-
result[i.slug] = (_i$extraInfo2 = i.extraInfo) === null || _i$extraInfo2 === void 0 ? void 0 : _i$extraInfo2.subscanSlug;
|
|
1506
|
+
result[i.slug] = subscanSlug;
|
|
1506
1507
|
} else {
|
|
1507
|
-
|
|
1508
|
-
result[(_i$extraInfo3 = i.extraInfo) === null || _i$extraInfo3 === void 0 ? void 0 : _i$extraInfo3.subscanSlug] = i.slug;
|
|
1508
|
+
result[subscanSlug] = i.slug;
|
|
1509
1509
|
}
|
|
1510
1510
|
});
|
|
1511
1511
|
return result;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
export const _STAKING_CHAIN_GROUP = {
|
|
5
5
|
relay: ['polkadot', 'kusama', 'aleph', 'polkadex', 'ternoa', 'alephTest', 'polkadexTest', 'westend', 'kate', 'edgeware', 'creditcoin', 'vara_network', 'goldberg_testnet'],
|
|
6
|
-
para: ['moonbeam', 'moonriver', 'moonbase', 'turing', 'turingStaging', 'bifrost', 'bifrost_testnet', 'calamari_test', 'calamari', 'manta_network'],
|
|
6
|
+
para: ['moonbeam', 'moonriver', 'moonbase', 'turing', 'turingStaging', 'bifrost', 'bifrost_testnet', 'calamari_test', 'calamari', 'manta_network', 'polimec'],
|
|
7
7
|
astar: ['astar', 'shiden', 'shibuya'],
|
|
8
8
|
amplitude: ['amplitude', 'amplitude_test', 'kilt', 'kilt_peregrine', 'pendulum', 'krest_network'],
|
|
9
9
|
// amplitude and kilt only share some common logic
|
|
@@ -270,7 +270,7 @@ export default class EarningService {
|
|
|
270
270
|
const unsubList = [];
|
|
271
271
|
for (const handler of Object.values(this.handlers)) {
|
|
272
272
|
// Force subscribe onchain data
|
|
273
|
-
const forceSubscribe = handler.type === YieldPoolType.LIQUID_STAKING || handler.type === YieldPoolType.LENDING;
|
|
273
|
+
const forceSubscribe = handler.type === YieldPoolType.LIQUID_STAKING || handler.type === YieldPoolType.LENDING || !onlineData[handler.slug];
|
|
274
274
|
if (!this.useOnlineCacheOnly || forceSubscribe) {
|
|
275
275
|
handler.subscribePoolInfo(callback).then(unsub => {
|
|
276
276
|
if (!cancel) {
|
|
@@ -22,7 +22,8 @@ export default class MigrateTransactionHistoryBySymbol extends BaseMigrationJob
|
|
|
22
22
|
'pangolin-LOCAL-CKTON': 'pangolin-LOCAL-PKTON',
|
|
23
23
|
'zeta_test-NATIVE-aZETA': 'zeta_test-NATIVE-ZETA',
|
|
24
24
|
'origintrail-NATIVE-OTP': 'origintrail-NATIVE-NEURO',
|
|
25
|
-
'moonbeam-LOCAL-xciBTC': 'moonbeam-LOCAL-xcIBTC'
|
|
25
|
+
'moonbeam-LOCAL-xciBTC': 'moonbeam-LOCAL-xcIBTC',
|
|
26
|
+
'tomochain-NATIVE-TOMO': 'tomochain-NATIVE-VIC'
|
|
26
27
|
};
|
|
27
28
|
const allTxs = [];
|
|
28
29
|
await Promise.all(Object.entries(changeSlugsMap).map(async ([oldSlug, newSlug], i) => {
|
|
@@ -42,6 +43,9 @@ export default class MigrateTransactionHistoryBySymbol extends BaseMigrationJob
|
|
|
42
43
|
if (transaction.amount && transaction.amount.symbol === oldSymbolSlug) {
|
|
43
44
|
transaction.amount.symbol = newSymbolSlug;
|
|
44
45
|
}
|
|
46
|
+
if (transaction.fee && transaction.fee.symbol === oldSymbolSlug) {
|
|
47
|
+
transaction.fee.symbol = newSymbolSlug;
|
|
48
|
+
}
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
allTxs.push(...filterTransactions);
|
|
@@ -21,7 +21,8 @@ export default class MigrateAssetSetting extends BaseMigrationJob {
|
|
|
21
21
|
'pangolin-LOCAL-CKTON': 'pangolin-LOCAL-PKTON',
|
|
22
22
|
'zeta_test-NATIVE-aZETA': 'zeta_test-NATIVE-ZETA',
|
|
23
23
|
'origintrail-NATIVE-OTP': 'origintrail-NATIVE-NEURO',
|
|
24
|
-
'moonbeam-LOCAL-xciBTC': 'moonbeam-LOCAL-xcIBTC'
|
|
24
|
+
'moonbeam-LOCAL-xciBTC': 'moonbeam-LOCAL-xcIBTC',
|
|
25
|
+
'tomochain-NATIVE-TOMO': 'tomochain-NATIVE-VIC'
|
|
25
26
|
};
|
|
26
27
|
const assetSetting = await this.state.chainService.getAssetSettings();
|
|
27
28
|
const migratedAssetSetting = {};
|
|
@@ -47,7 +47,7 @@ export default {
|
|
|
47
47
|
'1.1.28-01': MigrateEarningVersion,
|
|
48
48
|
'1.1.41-01': DeleteChainStaking,
|
|
49
49
|
'1.1.44-01': MigrateAssetSetting,
|
|
50
|
-
'1.1.
|
|
50
|
+
'1.1.45-01': MigrateTransactionHistoryBySymbol
|
|
51
51
|
// [`${EVERYTIME}-1.1.42-02`]: MigrateTransactionHistoryBySymbol
|
|
52
52
|
// [`${EVERYTIME}-1`]: AutoEnableChainsTokens
|
|
53
53
|
};
|
|
@@ -22,6 +22,9 @@ function getBlockExplorerAccountRoute(explorerLink) {
|
|
|
22
22
|
if (explorerLink.includes('3dpscan.io')) {
|
|
23
23
|
return 'account';
|
|
24
24
|
}
|
|
25
|
+
if (explorerLink.includes('explorer.polimec.org')) {
|
|
26
|
+
return 'account';
|
|
27
|
+
}
|
|
25
28
|
return 'address';
|
|
26
29
|
}
|
|
27
30
|
function getBlockExplorerTxRoute(chainInfo) {
|