@subwallet/extension-base 1.1.62-0 → 1.1.64-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/koni/background/handlers/Extension.js +21 -7
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/chain-service/index.js +19 -15
- package/cjs/services/chain-service/utils/index.js +3 -1
- package/cjs/services/migration-service/scripts/MigrateTransactionHistoryBySymbol.js +1 -4
- package/cjs/services/migration-service/scripts/databases/MigrateAssetSetting.js +1 -4
- package/cjs/services/migration-service/scripts/index.js +2 -2
- package/cjs/services/transaction-service/index.js +3 -3
- package/cjs/services/transaction-service/utils.js +6 -0
- package/cjs/utils/eth/parseTransaction/index.js +1 -1
- package/koni/background/handlers/Extension.js +21 -7
- package/package.json +6 -6
- package/packageInfo.js +1 -1
- package/services/chain-service/index.js +19 -15
- package/services/chain-service/utils/index.js +3 -1
- package/services/migration-service/scripts/MigrateTransactionHistoryBySymbol.js +1 -4
- package/services/migration-service/scripts/databases/MigrateAssetSetting.js +1 -4
- package/services/migration-service/scripts/index.js +2 -2
- package/services/transaction-service/index.js +3 -3
- package/services/transaction-service/utils.js +6 -0
- package/signers/types.d.ts +1 -1
- package/utils/eth/parseTransaction/index.js +1 -1
|
@@ -3052,7 +3052,10 @@ class KoniExtension {
|
|
|
3052
3052
|
let registry = new _types4.TypeRegistry();
|
|
3053
3053
|
let isEvm = false;
|
|
3054
3054
|
if ((0, _Extension.isJsonPayload)(payload)) {
|
|
3055
|
-
|
|
3055
|
+
/**
|
|
3056
|
+
* Get the metadata for the genesisHash
|
|
3057
|
+
* @todo: need to handle case metadata store in db
|
|
3058
|
+
*/
|
|
3056
3059
|
const currentMetadata = this.#koniState.knownMetadata.find(meta => meta.genesisHash === payload.genesisHash);
|
|
3057
3060
|
|
|
3058
3061
|
// set the registry before calling the sign function
|
|
@@ -3061,12 +3064,23 @@ class KoniExtension {
|
|
|
3061
3064
|
registry.register(currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata.types);
|
|
3062
3065
|
}
|
|
3063
3066
|
const [, chainInfo] = this.#koniState.findNetworkKeyByGenesisHash(payload.genesisHash);
|
|
3064
|
-
if (
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3067
|
+
if (!currentMetadata) {
|
|
3068
|
+
/*
|
|
3069
|
+
* Some networks must have metadata to signing,
|
|
3070
|
+
* so if the chain not active (cannot use metadata from api), it must be rejected
|
|
3071
|
+
* */
|
|
3072
|
+
if (chainInfo && (_constants2._API_OPTIONS_CHAIN_GROUP.avail.includes(chainInfo.slug) || _constants2._API_OPTIONS_CHAIN_GROUP.goldberg.includes(chainInfo.slug)) // The special case for chains that need metadata to signing
|
|
3073
|
+
) {
|
|
3074
|
+
// For case the chain does not have any provider
|
|
3075
|
+
if (!Object.keys(chainInfo.providers).length) {
|
|
3076
|
+
reject(new Error('{{chain}} network does not have any provider to connect, please update metadata from dApp'.replaceAll('{{chain}}', chainInfo.name)));
|
|
3077
|
+
return false;
|
|
3078
|
+
}
|
|
3079
|
+
const isChainActive = this.#koniState.getChainStateByKey(chainInfo.slug).active;
|
|
3080
|
+
if (!isChainActive) {
|
|
3081
|
+
reject(new Error('Please activate {{chain}} network before signing'.replaceAll('{{chain}}', chainInfo.name)));
|
|
3082
|
+
return false;
|
|
3083
|
+
}
|
|
3070
3084
|
registry = this.#koniState.getSubstrateApi(chainInfo.slug).api.registry;
|
|
3071
3085
|
}
|
|
3072
3086
|
}
|
package/cjs/packageInfo.js
CHANGED
|
@@ -725,21 +725,25 @@ class ChainService {
|
|
|
725
725
|
}
|
|
726
726
|
this.lockChainInfoMap = true;
|
|
727
727
|
const initPromises = chainSlugs.map(async chainSlug => {
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
728
|
+
// Add try catch to prevent one chain error stop the whole process
|
|
729
|
+
try {
|
|
730
|
+
var _chainStateMap$chainS;
|
|
731
|
+
const chainInfo = chainInfoMap[chainSlug];
|
|
732
|
+
const currentState = (_chainStateMap$chainS = chainStateMap[chainSlug]) === null || _chainStateMap$chainS === void 0 ? void 0 : _chainStateMap$chainS.active;
|
|
733
|
+
if (!currentState) {
|
|
734
|
+
// Enable chain success then update chain state
|
|
735
|
+
await this.initApiForChain(chainInfo);
|
|
736
|
+
this.dbService.updateChainStore({
|
|
737
|
+
...chainInfo,
|
|
738
|
+
active: true,
|
|
739
|
+
currentProvider: chainStateMap[chainSlug].currentProvider,
|
|
740
|
+
manualTurnOff: !!chainStateMap[chainSlug].manualTurnOff
|
|
741
|
+
}).catch(console.error);
|
|
742
|
+
chainStateMap[chainSlug].active = true;
|
|
743
|
+
this.eventService.emit('chain.updateState', chainSlug);
|
|
744
|
+
needUpdate = true;
|
|
745
|
+
}
|
|
746
|
+
} catch (e) {}
|
|
743
747
|
});
|
|
744
748
|
await Promise.all(initPromises);
|
|
745
749
|
this.lockChainInfoMap = false;
|
|
@@ -617,7 +617,9 @@ function updateLatestChainInfo(currentDataMap, latestChainInfoList) {
|
|
|
617
617
|
providerKey
|
|
618
618
|
} = randomizeProvider(currentChainInfo.providers);
|
|
619
619
|
currentChainState.currentProvider = providerKey;
|
|
620
|
-
|
|
620
|
+
if (currentChainState.active) {
|
|
621
|
+
needUpdateChainApiList.push(currentChainInfo);
|
|
622
|
+
}
|
|
621
623
|
}
|
|
622
624
|
needUpdate = true;
|
|
623
625
|
}
|
|
@@ -14,10 +14,7 @@ class MigrateTransactionHistoryBySymbol extends _Base.default {
|
|
|
14
14
|
const state = this.state;
|
|
15
15
|
try {
|
|
16
16
|
const changeSlugsMap = {
|
|
17
|
-
'
|
|
18
|
-
'calamari-LOCAL-AUSD': 'calamari-LOCAL-aSEED',
|
|
19
|
-
'moonriver-LOCAL-xcaSeed': 'moonriver-LOCAL-xcaSEED',
|
|
20
|
-
'bifrost-LOCAL-KUSD': 'bifrost-LOCAL-aSEED'
|
|
17
|
+
'commune-NATIVE-C': 'commune-NATIVE-COMAI'
|
|
21
18
|
};
|
|
22
19
|
const allTxs = [];
|
|
23
20
|
await Promise.all(Object.entries(changeSlugsMap).map(async (_ref, i) => {
|
|
@@ -13,10 +13,7 @@ class MigrateAssetSetting extends _Base.default {
|
|
|
13
13
|
async run() {
|
|
14
14
|
try {
|
|
15
15
|
const changeSlugsMap = {
|
|
16
|
-
'
|
|
17
|
-
'calamari-LOCAL-AUSD': 'calamari-LOCAL-aSEED',
|
|
18
|
-
'moonriver-LOCAL-xcaSeed': 'moonriver-LOCAL-xcaSEED',
|
|
19
|
-
'bifrost-LOCAL-KUSD': 'bifrost-LOCAL-aSEED'
|
|
16
|
+
'commune-NATIVE-C': 'commune-NATIVE-COMAI'
|
|
20
17
|
};
|
|
21
18
|
const assetSetting = await this.state.chainService.getAssetSettings();
|
|
22
19
|
const migratedAssetSetting = {};
|
|
@@ -56,8 +56,8 @@ var _default = {
|
|
|
56
56
|
'1.1.28-01': _MigrateEarningVersion.default,
|
|
57
57
|
'1.1.41-01': _DeleteChainStaking.default,
|
|
58
58
|
'1.1.46-01': _AutoEnableSomeTokens.default,
|
|
59
|
-
'1.1.
|
|
60
|
-
'1.1.
|
|
59
|
+
'1.1.62-01': _MigrateAssetSetting.default,
|
|
60
|
+
'1.1.62-02': _MigrateTransactionHistoryBySymbol.default
|
|
61
61
|
// [`${EVERYTIME}-1.1.42-02`]: MigrateTransactionHistoryBySymbol
|
|
62
62
|
// [`${EVERYTIME}-1`]: AutoEnableChainsTokens
|
|
63
63
|
};
|
|
@@ -891,7 +891,7 @@ class TransactionService {
|
|
|
891
891
|
maxFeePerGas: (0, _ethereumjsUtil.addHexPrefix)((0, _utils4.anyNumberToBN)(transaction.maxFeePerGas).toString(16)),
|
|
892
892
|
maxPriorityFeePerGas: (0, _ethereumjsUtil.addHexPrefix)((0, _utils4.anyNumberToBN)(transaction.maxPriorityFeePerGas).toString(16)),
|
|
893
893
|
gasLimit: (0, _ethereumjsUtil.addHexPrefix)((0, _utils4.anyNumberToBN)(transaction.gas).toString(16)),
|
|
894
|
-
to: transaction.to
|
|
894
|
+
to: transaction.to,
|
|
895
895
|
value: (0, _ethereumjsUtil.addHexPrefix)((0, _utils4.anyNumberToBN)(transaction.value).toString(16)),
|
|
896
896
|
data: transaction.data,
|
|
897
897
|
chainId: (0, _utils._getEvmChainId)(chainInfo),
|
|
@@ -903,7 +903,7 @@ class TransactionService {
|
|
|
903
903
|
nonce: (_transaction$nonce2 = transaction.nonce) !== null && _transaction$nonce2 !== void 0 ? _transaction$nonce2 : 0,
|
|
904
904
|
gasPrice: (0, _ethereumjsUtil.addHexPrefix)((0, _utils4.anyNumberToBN)(transaction.gasPrice).toString(16)),
|
|
905
905
|
gasLimit: (0, _ethereumjsUtil.addHexPrefix)((0, _utils4.anyNumberToBN)(transaction.gas).toString(16)),
|
|
906
|
-
to: transaction.to
|
|
906
|
+
to: transaction.to,
|
|
907
907
|
value: (0, _ethereumjsUtil.addHexPrefix)((0, _utils4.anyNumberToBN)(transaction.value).toString(16)),
|
|
908
908
|
data: transaction.data,
|
|
909
909
|
chainId: (0, _utils._getEvmChainId)(chainInfo),
|
|
@@ -978,7 +978,7 @@ class TransactionService {
|
|
|
978
978
|
maxFeePerGas: (0, _utils4.anyNumberToBN)(payload.maxFeePerGas).toNumber(),
|
|
979
979
|
maxPriorityFeePerGas: (0, _utils4.anyNumberToBN)(payload.maxPriorityFeePerGas).toNumber(),
|
|
980
980
|
gasLimit: (0, _utils4.anyNumberToBN)(payload.gas).toNumber(),
|
|
981
|
-
to: payload.to
|
|
981
|
+
to: payload.to,
|
|
982
982
|
value: (0, _utils4.anyNumberToBN)(payload.value).toNumber(),
|
|
983
983
|
data: payload.data,
|
|
984
984
|
chainId: payload.chainId
|
|
@@ -33,6 +33,9 @@ function getBlockExplorerAccountRoute(explorerLink) {
|
|
|
33
33
|
if (explorerLink.includes('explorer.polimec.org')) {
|
|
34
34
|
return 'account';
|
|
35
35
|
}
|
|
36
|
+
if (explorerLink.includes('invarch.statescan.io')) {
|
|
37
|
+
return '#/accounts';
|
|
38
|
+
}
|
|
36
39
|
return 'address';
|
|
37
40
|
}
|
|
38
41
|
function getBlockExplorerTxRoute(chainInfo) {
|
|
@@ -42,6 +45,9 @@ function getBlockExplorerTxRoute(chainInfo) {
|
|
|
42
45
|
if (['aventus', 'deeper_network'].includes(chainInfo.slug)) {
|
|
43
46
|
return 'transaction';
|
|
44
47
|
}
|
|
48
|
+
if (['invarch'].includes(chainInfo.slug)) {
|
|
49
|
+
return '#/extrinsics';
|
|
50
|
+
}
|
|
45
51
|
return 'extrinsic';
|
|
46
52
|
}
|
|
47
53
|
function getExplorerLink(chainInfo, value, type) {
|
|
@@ -100,7 +100,7 @@ const parseResult = (type, input, name) => {
|
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
const isContractAddress = async (address, evmApi) => {
|
|
103
|
-
if (!evmApi) {
|
|
103
|
+
if (!evmApi || !address) {
|
|
104
104
|
return false;
|
|
105
105
|
} else {
|
|
106
106
|
const code = await evmApi.api.eth.getCode(address);
|
|
@@ -2969,7 +2969,10 @@ export default class KoniExtension {
|
|
|
2969
2969
|
let registry = new TypeRegistry();
|
|
2970
2970
|
let isEvm = false;
|
|
2971
2971
|
if (isJsonPayload(payload)) {
|
|
2972
|
-
|
|
2972
|
+
/**
|
|
2973
|
+
* Get the metadata for the genesisHash
|
|
2974
|
+
* @todo: need to handle case metadata store in db
|
|
2975
|
+
*/
|
|
2973
2976
|
const currentMetadata = this.#koniState.knownMetadata.find(meta => meta.genesisHash === payload.genesisHash);
|
|
2974
2977
|
|
|
2975
2978
|
// set the registry before calling the sign function
|
|
@@ -2978,12 +2981,23 @@ export default class KoniExtension {
|
|
|
2978
2981
|
registry.register(currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata.types);
|
|
2979
2982
|
}
|
|
2980
2983
|
const [, chainInfo] = this.#koniState.findNetworkKeyByGenesisHash(payload.genesisHash);
|
|
2981
|
-
if (
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2984
|
+
if (!currentMetadata) {
|
|
2985
|
+
/*
|
|
2986
|
+
* Some networks must have metadata to signing,
|
|
2987
|
+
* so if the chain not active (cannot use metadata from api), it must be rejected
|
|
2988
|
+
* */
|
|
2989
|
+
if (chainInfo && (_API_OPTIONS_CHAIN_GROUP.avail.includes(chainInfo.slug) || _API_OPTIONS_CHAIN_GROUP.goldberg.includes(chainInfo.slug)) // The special case for chains that need metadata to signing
|
|
2990
|
+
) {
|
|
2991
|
+
// For case the chain does not have any provider
|
|
2992
|
+
if (!Object.keys(chainInfo.providers).length) {
|
|
2993
|
+
reject(new Error('{{chain}} network does not have any provider to connect, please update metadata from dApp'.replaceAll('{{chain}}', chainInfo.name)));
|
|
2994
|
+
return false;
|
|
2995
|
+
}
|
|
2996
|
+
const isChainActive = this.#koniState.getChainStateByKey(chainInfo.slug).active;
|
|
2997
|
+
if (!isChainActive) {
|
|
2998
|
+
reject(new Error('Please activate {{chain}} network before signing'.replaceAll('{{chain}}', chainInfo.name)));
|
|
2999
|
+
return false;
|
|
3000
|
+
}
|
|
2987
3001
|
registry = this.#koniState.getSubstrateApi(chainInfo.slug).api.registry;
|
|
2988
3002
|
}
|
|
2989
3003
|
}
|
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.64-0",
|
|
21
21
|
"main": "./cjs/index.js",
|
|
22
22
|
"module": "./index.js",
|
|
23
23
|
"types": "./index.d.ts",
|
|
@@ -1869,11 +1869,11 @@
|
|
|
1869
1869
|
"@reduxjs/toolkit": "^1.9.1",
|
|
1870
1870
|
"@sora-substrate/type-definitions": "^1.17.7",
|
|
1871
1871
|
"@substrate/connect": "^0.8.9",
|
|
1872
|
-
"@subwallet/chain-list": "0.2.
|
|
1873
|
-
"@subwallet/extension-base": "^1.1.
|
|
1874
|
-
"@subwallet/extension-chains": "^1.1.
|
|
1875
|
-
"@subwallet/extension-dapp": "^1.1.
|
|
1876
|
-
"@subwallet/extension-inject": "^1.1.
|
|
1872
|
+
"@subwallet/chain-list": "0.2.60",
|
|
1873
|
+
"@subwallet/extension-base": "^1.1.64-0",
|
|
1874
|
+
"@subwallet/extension-chains": "^1.1.64-0",
|
|
1875
|
+
"@subwallet/extension-dapp": "^1.1.64-0",
|
|
1876
|
+
"@subwallet/extension-inject": "^1.1.64-0",
|
|
1877
1877
|
"@subwallet/keyring": "^0.1.5",
|
|
1878
1878
|
"@subwallet/ui-keyring": "^0.1.5",
|
|
1879
1879
|
"@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.64-0'
|
|
11
11
|
};
|
|
@@ -703,21 +703,25 @@ export class ChainService {
|
|
|
703
703
|
}
|
|
704
704
|
this.lockChainInfoMap = true;
|
|
705
705
|
const initPromises = chainSlugs.map(async chainSlug => {
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
706
|
+
// Add try catch to prevent one chain error stop the whole process
|
|
707
|
+
try {
|
|
708
|
+
var _chainStateMap$chainS;
|
|
709
|
+
const chainInfo = chainInfoMap[chainSlug];
|
|
710
|
+
const currentState = (_chainStateMap$chainS = chainStateMap[chainSlug]) === null || _chainStateMap$chainS === void 0 ? void 0 : _chainStateMap$chainS.active;
|
|
711
|
+
if (!currentState) {
|
|
712
|
+
// Enable chain success then update chain state
|
|
713
|
+
await this.initApiForChain(chainInfo);
|
|
714
|
+
this.dbService.updateChainStore({
|
|
715
|
+
...chainInfo,
|
|
716
|
+
active: true,
|
|
717
|
+
currentProvider: chainStateMap[chainSlug].currentProvider,
|
|
718
|
+
manualTurnOff: !!chainStateMap[chainSlug].manualTurnOff
|
|
719
|
+
}).catch(console.error);
|
|
720
|
+
chainStateMap[chainSlug].active = true;
|
|
721
|
+
this.eventService.emit('chain.updateState', chainSlug);
|
|
722
|
+
needUpdate = true;
|
|
723
|
+
}
|
|
724
|
+
} catch (e) {}
|
|
721
725
|
});
|
|
722
726
|
await Promise.all(initPromises);
|
|
723
727
|
this.lockChainInfoMap = false;
|
|
@@ -448,7 +448,9 @@ export function updateLatestChainInfo(currentDataMap, latestChainInfoList) {
|
|
|
448
448
|
providerKey
|
|
449
449
|
} = randomizeProvider(currentChainInfo.providers);
|
|
450
450
|
currentChainState.currentProvider = providerKey;
|
|
451
|
-
|
|
451
|
+
if (currentChainState.active) {
|
|
452
|
+
needUpdateChainApiList.push(currentChainInfo);
|
|
453
|
+
}
|
|
452
454
|
}
|
|
453
455
|
needUpdate = true;
|
|
454
456
|
}
|
|
@@ -7,10 +7,7 @@ export default class MigrateTransactionHistoryBySymbol extends BaseMigrationJob
|
|
|
7
7
|
const state = this.state;
|
|
8
8
|
try {
|
|
9
9
|
const changeSlugsMap = {
|
|
10
|
-
'
|
|
11
|
-
'calamari-LOCAL-AUSD': 'calamari-LOCAL-aSEED',
|
|
12
|
-
'moonriver-LOCAL-xcaSeed': 'moonriver-LOCAL-xcaSEED',
|
|
13
|
-
'bifrost-LOCAL-KUSD': 'bifrost-LOCAL-aSEED'
|
|
10
|
+
'commune-NATIVE-C': 'commune-NATIVE-COMAI'
|
|
14
11
|
};
|
|
15
12
|
const allTxs = [];
|
|
16
13
|
await Promise.all(Object.entries(changeSlugsMap).map(async ([oldSlug, newSlug], i) => {
|
|
@@ -6,10 +6,7 @@ export default class MigrateAssetSetting extends BaseMigrationJob {
|
|
|
6
6
|
async run() {
|
|
7
7
|
try {
|
|
8
8
|
const changeSlugsMap = {
|
|
9
|
-
'
|
|
10
|
-
'calamari-LOCAL-AUSD': 'calamari-LOCAL-aSEED',
|
|
11
|
-
'moonriver-LOCAL-xcaSeed': 'moonriver-LOCAL-xcaSEED',
|
|
12
|
-
'bifrost-LOCAL-KUSD': 'bifrost-LOCAL-aSEED'
|
|
9
|
+
'commune-NATIVE-C': 'commune-NATIVE-COMAI'
|
|
13
10
|
};
|
|
14
11
|
const assetSetting = await this.state.chainService.getAssetSettings();
|
|
15
12
|
const migratedAssetSetting = {};
|
|
@@ -48,8 +48,8 @@ export default {
|
|
|
48
48
|
'1.1.28-01': MigrateEarningVersion,
|
|
49
49
|
'1.1.41-01': DeleteChainStaking,
|
|
50
50
|
'1.1.46-01': AutoEnableSomeTokens,
|
|
51
|
-
'1.1.
|
|
52
|
-
'1.1.
|
|
51
|
+
'1.1.62-01': MigrateAssetSetting,
|
|
52
|
+
'1.1.62-02': MigrateTransactionHistoryBySymbol
|
|
53
53
|
// [`${EVERYTIME}-1.1.42-02`]: MigrateTransactionHistoryBySymbol
|
|
54
54
|
// [`${EVERYTIME}-1`]: AutoEnableChainsTokens
|
|
55
55
|
};
|
|
@@ -878,7 +878,7 @@ export default class TransactionService {
|
|
|
878
878
|
maxFeePerGas: addHexPrefix(anyNumberToBN(transaction.maxFeePerGas).toString(16)),
|
|
879
879
|
maxPriorityFeePerGas: addHexPrefix(anyNumberToBN(transaction.maxPriorityFeePerGas).toString(16)),
|
|
880
880
|
gasLimit: addHexPrefix(anyNumberToBN(transaction.gas).toString(16)),
|
|
881
|
-
to: transaction.to
|
|
881
|
+
to: transaction.to,
|
|
882
882
|
value: addHexPrefix(anyNumberToBN(transaction.value).toString(16)),
|
|
883
883
|
data: transaction.data,
|
|
884
884
|
chainId: _getEvmChainId(chainInfo),
|
|
@@ -890,7 +890,7 @@ export default class TransactionService {
|
|
|
890
890
|
nonce: (_transaction$nonce2 = transaction.nonce) !== null && _transaction$nonce2 !== void 0 ? _transaction$nonce2 : 0,
|
|
891
891
|
gasPrice: addHexPrefix(anyNumberToBN(transaction.gasPrice).toString(16)),
|
|
892
892
|
gasLimit: addHexPrefix(anyNumberToBN(transaction.gas).toString(16)),
|
|
893
|
-
to: transaction.to
|
|
893
|
+
to: transaction.to,
|
|
894
894
|
value: addHexPrefix(anyNumberToBN(transaction.value).toString(16)),
|
|
895
895
|
data: transaction.data,
|
|
896
896
|
chainId: _getEvmChainId(chainInfo),
|
|
@@ -964,7 +964,7 @@ export default class TransactionService {
|
|
|
964
964
|
maxFeePerGas: anyNumberToBN(payload.maxFeePerGas).toNumber(),
|
|
965
965
|
maxPriorityFeePerGas: anyNumberToBN(payload.maxPriorityFeePerGas).toNumber(),
|
|
966
966
|
gasLimit: anyNumberToBN(payload.gas).toNumber(),
|
|
967
|
-
to: payload.to
|
|
967
|
+
to: payload.to,
|
|
968
968
|
value: anyNumberToBN(payload.value).toNumber(),
|
|
969
969
|
data: payload.data,
|
|
970
970
|
chainId: payload.chainId
|
|
@@ -25,6 +25,9 @@ function getBlockExplorerAccountRoute(explorerLink) {
|
|
|
25
25
|
if (explorerLink.includes('explorer.polimec.org')) {
|
|
26
26
|
return 'account';
|
|
27
27
|
}
|
|
28
|
+
if (explorerLink.includes('invarch.statescan.io')) {
|
|
29
|
+
return '#/accounts';
|
|
30
|
+
}
|
|
28
31
|
return 'address';
|
|
29
32
|
}
|
|
30
33
|
function getBlockExplorerTxRoute(chainInfo) {
|
|
@@ -34,6 +37,9 @@ function getBlockExplorerTxRoute(chainInfo) {
|
|
|
34
37
|
if (['aventus', 'deeper_network'].includes(chainInfo.slug)) {
|
|
35
38
|
return 'transaction';
|
|
36
39
|
}
|
|
40
|
+
if (['invarch'].includes(chainInfo.slug)) {
|
|
41
|
+
return '#/extrinsics';
|
|
42
|
+
}
|
|
37
43
|
return 'extrinsic';
|
|
38
44
|
}
|
|
39
45
|
export function getExplorerLink(chainInfo, value, type) {
|
package/signers/types.d.ts
CHANGED