@subwallet/extension-base 1.3.20-0 → 1.3.21-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/background/KoniTypes.d.ts +8 -1
- package/cjs/defaults.js +1 -1
- package/cjs/koni/background/handlers/Extension.js +519 -90
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/chain-service/handler/EvmApi.js +1 -3
- package/cjs/services/chain-service/utils/patch.js +1 -1
- package/cjs/services/earning-service/handlers/liquid-staking/stella-swap.js +19 -8
- package/cjs/services/earning-service/handlers/special.js +16 -10
- package/cjs/services/history-service/helpers/recoverHistoryStatus.js +14 -5
- package/cjs/services/history-service/index.js +15 -3
- package/cjs/services/inapp-notification-service/index.js +78 -0
- package/cjs/services/inapp-notification-service/interfaces.js +2 -0
- package/cjs/services/keyring-service/context/state.js +2 -1
- package/cjs/services/request-service/handler/EvmRequestHandler.js +10 -0
- package/cjs/services/request-service/handler/SubstrateRequestHandler.js +4 -3
- package/cjs/services/request-service/index.js +2 -2
- package/cjs/services/setting-service/constants.js +5 -2
- package/cjs/services/storage-service/DatabaseService.js +98 -2
- package/cjs/services/storage-service/databases/index.js +3 -0
- package/cjs/services/storage-service/db-stores/ProcessTransaction.js +47 -0
- package/cjs/services/storage-service/db-stores/Transaction.js +2 -0
- package/cjs/services/storage-service/db-stores/index.js +8 -1
- package/cjs/services/swap-service/handler/asset-hub/handler.js +30 -11
- package/cjs/services/swap-service/handler/hydradx-handler.js +18 -10
- package/cjs/services/swap-service/index.js +3 -0
- package/cjs/services/swap-service/utils.js +1 -0
- package/cjs/services/transaction-service/index.js +218 -9
- package/cjs/types/index.js +11 -0
- package/cjs/types/setting.js +1 -0
- package/cjs/types/swap/index.js +4 -1
- package/cjs/types/transaction/index.js +11 -0
- package/cjs/types/transaction/process.js +28 -0
- package/cjs/types/yield/actions/join/submit.js +16 -1
- package/defaults.d.ts +1 -1
- package/defaults.js +1 -1
- package/koni/background/handlers/Extension.d.ts +5 -0
- package/koni/background/handlers/Extension.js +437 -12
- package/package.json +21 -6
- package/packageInfo.js +1 -1
- package/services/chain-service/handler/EvmApi.js +1 -3
- package/services/chain-service/utils/patch.js +1 -1
- package/services/earning-service/handlers/liquid-staking/stella-swap.js +19 -8
- package/services/earning-service/handlers/special.js +18 -12
- package/services/history-service/helpers/recoverHistoryStatus.js +14 -5
- package/services/history-service/index.d.ts +6 -5
- package/services/history-service/index.js +16 -5
- package/services/inapp-notification-service/index.d.ts +2 -0
- package/services/inapp-notification-service/index.js +79 -1
- package/services/inapp-notification-service/interfaces.d.ts +8 -1
- package/services/inapp-notification-service/interfaces.js +2 -0
- package/services/keyring-service/context/state.d.ts +1 -1
- package/services/keyring-service/context/state.js +3 -2
- package/services/request-service/handler/EvmRequestHandler.js +10 -0
- package/services/request-service/handler/SubstrateRequestHandler.d.ts +1 -1
- package/services/request-service/handler/SubstrateRequestHandler.js +4 -3
- package/services/request-service/index.d.ts +1 -1
- package/services/request-service/index.js +2 -2
- package/services/setting-service/constants.d.ts +1 -0
- package/services/setting-service/constants.js +3 -1
- package/services/storage-service/DatabaseService.d.ts +12 -3
- package/services/storage-service/DatabaseService.js +100 -4
- package/services/storage-service/databases/index.d.ts +2 -1
- package/services/storage-service/databases/index.js +3 -0
- package/services/storage-service/db-stores/ProcessTransaction.d.ts +14 -0
- package/services/storage-service/db-stores/ProcessTransaction.js +39 -0
- package/services/storage-service/db-stores/Transaction.js +2 -0
- package/services/storage-service/db-stores/index.d.ts +1 -0
- package/services/storage-service/db-stores/index.js +2 -1
- package/services/swap-service/handler/asset-hub/handler.js +30 -11
- package/services/swap-service/handler/hydradx-handler.js +18 -10
- package/services/swap-service/index.js +3 -0
- package/services/swap-service/utils.js +1 -0
- package/services/transaction-service/index.d.ts +19 -1
- package/services/transaction-service/index.js +220 -11
- package/services/transaction-service/types.d.ts +13 -4
- package/types/index.d.ts +1 -0
- package/types/index.js +1 -0
- package/types/setting.d.ts +3 -0
- package/types/setting.js +1 -0
- package/types/swap/index.d.ts +3 -2
- package/types/swap/index.js +4 -1
- package/types/transaction/index.d.ts +1 -0
- package/types/transaction/index.js +1 -0
- package/types/transaction/process.d.ts +84 -0
- package/types/transaction/process.js +20 -0
- package/types/transaction/request.d.ts +3 -1
- package/types/yield/actions/join/submit.d.ts +18 -3
- package/types/yield/actions/join/submit.js +11 -1
|
@@ -64,6 +64,12 @@ Object.defineProperty(exports, "PriceStore", {
|
|
|
64
64
|
return _Price.default;
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
+
Object.defineProperty(exports, "ProcessTransactionStore", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function () {
|
|
70
|
+
return _ProcessTransaction.default;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
67
73
|
Object.defineProperty(exports, "StakingStore", {
|
|
68
74
|
enumerable: true,
|
|
69
75
|
get: function () {
|
|
@@ -87,4 +93,5 @@ var _Migration = _interopRequireDefault(require("./Migration"));
|
|
|
87
93
|
var _Metadata = _interopRequireDefault(require("./Metadata"));
|
|
88
94
|
var _MetadataV = _interopRequireDefault(require("./MetadataV15"));
|
|
89
95
|
var _Chain = _interopRequireDefault(require("./Chain"));
|
|
90
|
-
var _Asset = _interopRequireDefault(require("./Asset"));
|
|
96
|
+
var _Asset = _interopRequireDefault(require("./Asset"));
|
|
97
|
+
var _ProcessTransaction = _interopRequireDefault(require("./ProcessTransaction"));
|
|
@@ -8,6 +8,7 @@ exports.AssetHubSwapHandler = void 0;
|
|
|
8
8
|
var _SwapError = require("@subwallet/extension-base/background/errors/SwapError");
|
|
9
9
|
var _TransactionError = require("@subwallet/extension-base/background/errors/TransactionError");
|
|
10
10
|
var _KoniTypes = require("@subwallet/extension-base/background/KoniTypes");
|
|
11
|
+
var _constants = require("@subwallet/extension-base/constants");
|
|
11
12
|
var _swap = require("@subwallet/extension-base/core/logic-validation/swap");
|
|
12
13
|
var _xcm = require("@subwallet/extension-base/services/balance-service/transfer/xcm");
|
|
13
14
|
var _utils = require("@subwallet/extension-base/services/chain-service/utils");
|
|
@@ -27,7 +28,18 @@ class AssetHubSwapHandler {
|
|
|
27
28
|
isReady = false;
|
|
28
29
|
constructor(chainService, balanceService, feeService, chain) {
|
|
29
30
|
const chainInfo = chainService.getChainInfoByKey(chain);
|
|
30
|
-
const providerSlug =
|
|
31
|
+
const providerSlug = function () {
|
|
32
|
+
switch (chain) {
|
|
33
|
+
case 'statemint':
|
|
34
|
+
return _swap2.SwapProviderId.POLKADOT_ASSET_HUB;
|
|
35
|
+
case 'statemine':
|
|
36
|
+
return _swap2.SwapProviderId.KUSAMA_ASSET_HUB;
|
|
37
|
+
case 'westend_assethub':
|
|
38
|
+
return _swap2.SwapProviderId.WESTEND_ASSET_HUB;
|
|
39
|
+
default:
|
|
40
|
+
return _swap2.SwapProviderId.ROCOCO_ASSET_HUB;
|
|
41
|
+
}
|
|
42
|
+
}();
|
|
31
43
|
this.swapBaseHandler = new _baseHandler.SwapBaseHandler({
|
|
32
44
|
balanceService,
|
|
33
45
|
chainService,
|
|
@@ -85,21 +97,13 @@ class AssetHubSwapHandler {
|
|
|
85
97
|
try {
|
|
86
98
|
const alternativeChainInfo = this.chainService.getChainInfoByKey(alternativeAsset.originChain);
|
|
87
99
|
const originalChainInfo = this.chainService.getChainInfoByKey(this.chain);
|
|
88
|
-
const step = {
|
|
89
|
-
metadata: {
|
|
90
|
-
sendingValue: bnAmount.toString(),
|
|
91
|
-
originTokenInfo: alternativeAsset,
|
|
92
|
-
destinationTokenInfo: fromAsset
|
|
93
|
-
},
|
|
94
|
-
name: `Transfer ${alternativeAsset.symbol} from ${alternativeChainInfo.name}`,
|
|
95
|
-
type: _serviceBase.CommonStepType.XCM
|
|
96
|
-
};
|
|
97
100
|
const xcmOriginSubstrateApi = await this.chainService.getSubstrateApi(alternativeAsset.originChain).isReady;
|
|
98
101
|
const id = (0, _getId.getId)();
|
|
99
102
|
const feeInfo = await this.swapBaseHandler.feeService.subscribeChainFee(id, alternativeChainInfo.slug, 'substrate');
|
|
100
103
|
const xcmTransfer = await (0, _xcm.createXcmExtrinsic)({
|
|
101
104
|
originTokenInfo: alternativeAsset,
|
|
102
105
|
destinationTokenInfo: fromAsset,
|
|
106
|
+
// Mock sending value to get payment info
|
|
103
107
|
sendingValue: bnAmount.toString(),
|
|
104
108
|
recipient: params.request.address,
|
|
105
109
|
sender: params.request.address,
|
|
@@ -113,12 +117,27 @@ class AssetHubSwapHandler {
|
|
|
113
117
|
const fee = {
|
|
114
118
|
feeComponent: [{
|
|
115
119
|
feeType: _swap2.SwapFeeType.NETWORK_FEE,
|
|
116
|
-
amount: Math.round(xcmFeeInfo.partialFee *
|
|
120
|
+
amount: Math.round(xcmFeeInfo.partialFee * _constants.XCM_MIN_AMOUNT_RATIO).toString(),
|
|
117
121
|
tokenSlug: (0, _utils._getChainNativeTokenSlug)(alternativeChainInfo)
|
|
118
122
|
}],
|
|
119
123
|
defaultFeeToken: (0, _utils._getChainNativeTokenSlug)(alternativeChainInfo),
|
|
120
124
|
feeOptions: [(0, _utils._getChainNativeTokenSlug)(alternativeChainInfo)]
|
|
121
125
|
};
|
|
126
|
+
let bnTransferAmount = bnAmount.minus(bnFromAssetBalance);
|
|
127
|
+
if ((0, _utils._isNativeToken)(alternativeAsset)) {
|
|
128
|
+
const bnXcmFee = new _bignumber.default(fee.feeComponent[0].amount); // xcm fee is paid in native token but swap token is not always native token
|
|
129
|
+
|
|
130
|
+
bnTransferAmount = bnTransferAmount.plus(bnXcmFee);
|
|
131
|
+
}
|
|
132
|
+
const step = {
|
|
133
|
+
metadata: {
|
|
134
|
+
sendingValue: bnTransferAmount.toString(),
|
|
135
|
+
originTokenInfo: alternativeAsset,
|
|
136
|
+
destinationTokenInfo: fromAsset
|
|
137
|
+
},
|
|
138
|
+
name: `Transfer ${alternativeAsset.symbol} from ${alternativeChainInfo.name}`,
|
|
139
|
+
type: _serviceBase.CommonStepType.XCM
|
|
140
|
+
};
|
|
122
141
|
return [step, fee];
|
|
123
142
|
} catch (e) {
|
|
124
143
|
console.error('Error creating xcm step', e);
|
|
@@ -11,6 +11,7 @@ var _types = require("@subwallet/chain-list/types");
|
|
|
11
11
|
var _SwapError = require("@subwallet/extension-base/background/errors/SwapError");
|
|
12
12
|
var _TransactionError = require("@subwallet/extension-base/background/errors/TransactionError");
|
|
13
13
|
var _KoniTypes = require("@subwallet/extension-base/background/KoniTypes");
|
|
14
|
+
var _constants = require("@subwallet/extension-base/constants");
|
|
14
15
|
var _swap = require("@subwallet/extension-base/core/logic-validation/swap");
|
|
15
16
|
var _xcm = require("@subwallet/extension-base/services/balance-service/transfer/xcm");
|
|
16
17
|
var _utils = require("@subwallet/extension-base/services/chain-service/utils");
|
|
@@ -100,21 +101,13 @@ class HydradxHandler {
|
|
|
100
101
|
try {
|
|
101
102
|
const alternativeChainInfo = this.chainService.getChainInfoByKey(alternativeAsset.originChain);
|
|
102
103
|
const destChainInfo = this.chainService.getChainInfoByKey(this.chain());
|
|
103
|
-
const step = {
|
|
104
|
-
metadata: {
|
|
105
|
-
sendingValue: bnAmount.toString(),
|
|
106
|
-
originTokenInfo: alternativeAsset,
|
|
107
|
-
destinationTokenInfo: fromAsset
|
|
108
|
-
},
|
|
109
|
-
name: `Transfer ${alternativeAsset.symbol} from ${alternativeChainInfo.name}`,
|
|
110
|
-
type: _serviceBase.CommonStepType.XCM
|
|
111
|
-
};
|
|
112
104
|
const xcmOriginSubstrateApi = await this.chainService.getSubstrateApi(alternativeAsset.originChain).isReady;
|
|
113
105
|
const id = (0, _getId.getId)();
|
|
114
106
|
const feeInfo = await this.swapBaseHandler.feeService.subscribeChainFee(id, alternativeAsset.originChain, 'substrate');
|
|
115
107
|
const xcmTransfer = await (0, _xcm.createXcmExtrinsic)({
|
|
116
108
|
originTokenInfo: alternativeAsset,
|
|
117
109
|
destinationTokenInfo: fromAsset,
|
|
110
|
+
// Mock sending value to get payment info
|
|
118
111
|
sendingValue: bnAmount.toString(),
|
|
119
112
|
recipient: params.request.address,
|
|
120
113
|
substrateApi: xcmOriginSubstrateApi,
|
|
@@ -128,12 +121,27 @@ class HydradxHandler {
|
|
|
128
121
|
const fee = {
|
|
129
122
|
feeComponent: [{
|
|
130
123
|
feeType: _swap2.SwapFeeType.NETWORK_FEE,
|
|
131
|
-
amount: Math.round(xcmFeeInfo.partialFee *
|
|
124
|
+
amount: Math.round(xcmFeeInfo.partialFee * _constants.XCM_MIN_AMOUNT_RATIO).toString(),
|
|
132
125
|
tokenSlug: (0, _utils._getChainNativeTokenSlug)(alternativeChainInfo)
|
|
133
126
|
}],
|
|
134
127
|
defaultFeeToken: (0, _utils._getChainNativeTokenSlug)(alternativeChainInfo),
|
|
135
128
|
feeOptions: [(0, _utils._getChainNativeTokenSlug)(alternativeChainInfo)]
|
|
136
129
|
};
|
|
130
|
+
let bnTransferAmount = bnAmount.minus(bnFromAssetBalance);
|
|
131
|
+
if ((0, _utils._isNativeToken)(alternativeAsset)) {
|
|
132
|
+
const bnXcmFee = new _bignumber.default(fee.feeComponent[0].amount); // xcm fee is paid in native token but swap token is not always native token
|
|
133
|
+
|
|
134
|
+
bnTransferAmount = bnTransferAmount.plus(bnXcmFee);
|
|
135
|
+
}
|
|
136
|
+
const step = {
|
|
137
|
+
metadata: {
|
|
138
|
+
sendingValue: bnTransferAmount.toString(),
|
|
139
|
+
originTokenInfo: alternativeAsset,
|
|
140
|
+
destinationTokenInfo: fromAsset
|
|
141
|
+
},
|
|
142
|
+
name: `Transfer ${alternativeAsset.symbol} from ${alternativeChainInfo.name}`,
|
|
143
|
+
type: _serviceBase.CommonStepType.XCM
|
|
144
|
+
};
|
|
137
145
|
return [step, fee];
|
|
138
146
|
} catch (e) {
|
|
139
147
|
console.error('Error creating xcm step', e);
|
|
@@ -165,6 +165,9 @@ class SwapService {
|
|
|
165
165
|
case _swap.SwapProviderId.ROCOCO_ASSET_HUB:
|
|
166
166
|
this.handlers[providerId] = new _assetHub.AssetHubSwapHandler(this.chainService, this.state.balanceService, this.state.feeService, 'rococo_assethub');
|
|
167
167
|
break;
|
|
168
|
+
case _swap.SwapProviderId.WESTEND_ASSET_HUB:
|
|
169
|
+
this.handlers[providerId] = new _assetHub.AssetHubSwapHandler(this.chainService, this.state.balanceService, this.state.feeService, 'westend_assethub');
|
|
170
|
+
break;
|
|
168
171
|
case _swap.SwapProviderId.SIMPLE_SWAP:
|
|
169
172
|
this.handlers[providerId] = new _simpleswapHandler.SimpleSwapHandler(this.chainService, this.state.balanceService, this.state.feeService);
|
|
170
173
|
break;
|
|
@@ -73,6 +73,7 @@ const _PROVIDER_TO_SUPPORTED_PAIR_MAP = {
|
|
|
73
73
|
[_swap2.SwapProviderId.POLKADOT_ASSET_HUB]: [_chainList.COMMON_CHAIN_SLUGS.POLKADOT_ASSET_HUB],
|
|
74
74
|
[_swap2.SwapProviderId.KUSAMA_ASSET_HUB]: [_chainList.COMMON_CHAIN_SLUGS.KUSAMA_ASSET_HUB],
|
|
75
75
|
[_swap2.SwapProviderId.ROCOCO_ASSET_HUB]: [_chainList.COMMON_CHAIN_SLUGS.ROCOCO_ASSET_HUB],
|
|
76
|
+
[_swap2.SwapProviderId.WESTEND_ASSET_HUB]: ['westend_assethub'],
|
|
76
77
|
[_swap2.SwapProviderId.SIMPLE_SWAP]: ['bittensor', _chainList.COMMON_CHAIN_SLUGS.ETHEREUM, _chainList.COMMON_CHAIN_SLUGS.POLKADOT]
|
|
77
78
|
};
|
|
78
79
|
exports._PROVIDER_TO_SUPPORTED_PAIR_MAP = _PROVIDER_TO_SUPPORTED_PAIR_MAP;
|
|
@@ -36,8 +36,10 @@ var _util = require("@polkadot/util");
|
|
|
36
36
|
// SPDX-License-Identifier: Apache-2.0
|
|
37
37
|
|
|
38
38
|
class TransactionService {
|
|
39
|
-
transactionSubject = new _rxjs.BehaviorSubject({});
|
|
40
39
|
watchTransactionSubscribes = {};
|
|
40
|
+
aliveProcessMap = new Map();
|
|
41
|
+
transactionSubject = new _rxjs.BehaviorSubject({});
|
|
42
|
+
aliveProcessSubject = new _rxjs.BehaviorSubject(this.aliveProcessMap);
|
|
41
43
|
get transactions() {
|
|
42
44
|
return this.transactionSubject.getValue();
|
|
43
45
|
}
|
|
@@ -66,11 +68,13 @@ class TransactionService {
|
|
|
66
68
|
return [];
|
|
67
69
|
}
|
|
68
70
|
async validateTransaction(transactionInput) {
|
|
71
|
+
var _transactionInput$ste;
|
|
69
72
|
const validationResponse = {
|
|
70
73
|
...transactionInput,
|
|
71
74
|
status: undefined,
|
|
72
75
|
errors: transactionInput.errors || [],
|
|
73
|
-
warnings: transactionInput.warnings || []
|
|
76
|
+
warnings: transactionInput.warnings || [],
|
|
77
|
+
processId: (_transactionInput$ste = transactionInput.step) === null || _transactionInput$ste === void 0 ? void 0 : _transactionInput$ste.processId
|
|
74
78
|
};
|
|
75
79
|
const {
|
|
76
80
|
additionalValidator,
|
|
@@ -137,6 +141,44 @@ class TransactionService {
|
|
|
137
141
|
getTransactionSubject() {
|
|
138
142
|
return this.transactionSubject;
|
|
139
143
|
}
|
|
144
|
+
get observables() {
|
|
145
|
+
const transactionSubject = this.transactionSubject;
|
|
146
|
+
const aliveProcessSubject = this.aliveProcessSubject;
|
|
147
|
+
return {
|
|
148
|
+
get transaction() {
|
|
149
|
+
return transactionSubject.asObservable();
|
|
150
|
+
},
|
|
151
|
+
get aliveProcess() {
|
|
152
|
+
return aliveProcessSubject.asObservable().pipe((0, _rxjs.map)(aliveProcessMap => {
|
|
153
|
+
const aliveProcessRecord = {};
|
|
154
|
+
aliveProcessMap.forEach((value, key) => {
|
|
155
|
+
aliveProcessRecord[key] = value;
|
|
156
|
+
});
|
|
157
|
+
return aliveProcessRecord;
|
|
158
|
+
}));
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
get values() {
|
|
163
|
+
const transactionSubject = this.transactionSubject;
|
|
164
|
+
const aliveProcessSubject = this.aliveProcessSubject;
|
|
165
|
+
return {
|
|
166
|
+
get transaction() {
|
|
167
|
+
return transactionSubject.value;
|
|
168
|
+
},
|
|
169
|
+
get aliveProcess() {
|
|
170
|
+
const aliveProcessMap = aliveProcessSubject.value;
|
|
171
|
+
const aliveProcessRecord = {};
|
|
172
|
+
aliveProcessMap.forEach((value, key) => {
|
|
173
|
+
aliveProcessRecord[key] = value;
|
|
174
|
+
});
|
|
175
|
+
return aliveProcessRecord;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
updateAliveProcess() {
|
|
180
|
+
this.aliveProcessSubject.next(this.aliveProcessMap);
|
|
181
|
+
}
|
|
140
182
|
fillTransactionDefaultInfo(transaction) {
|
|
141
183
|
const isInternal = !transaction.url;
|
|
142
184
|
const transactionId = (0, _helpers.getTransactionId)(transaction.chainType, transaction.chain, isInternal, (0, _helpers2.isWalletConnectRequest)(transaction.id));
|
|
@@ -214,6 +256,12 @@ class TransactionService {
|
|
|
214
256
|
resolve();
|
|
215
257
|
}
|
|
216
258
|
});
|
|
259
|
+
emitter.on('timeout', data => {
|
|
260
|
+
if (transaction.errorOnTimeOut && data.errors.length > 0) {
|
|
261
|
+
validatedTransaction.errors.push(...data.errors);
|
|
262
|
+
resolve();
|
|
263
|
+
}
|
|
264
|
+
});
|
|
217
265
|
});
|
|
218
266
|
|
|
219
267
|
// @ts-ignore
|
|
@@ -226,20 +274,39 @@ class TransactionService {
|
|
|
226
274
|
// Send Transaction
|
|
227
275
|
const emitter = await (transaction.chainType === 'substrate' ? this.signAndSendSubstrateTransaction(transaction) : transaction.chainType === 'evm' ? this.signAndSendEvmTransaction(transaction) : this.signAndSendTonTransaction(transaction));
|
|
228
276
|
const {
|
|
229
|
-
eventsHandler
|
|
277
|
+
eventsHandler,
|
|
278
|
+
step
|
|
230
279
|
} = transaction;
|
|
231
280
|
emitter.on('signed', data => {
|
|
232
281
|
this.onSigned(data);
|
|
233
282
|
});
|
|
234
283
|
emitter.on('send', data => {
|
|
235
284
|
this.onSend(data);
|
|
285
|
+
if (step) {
|
|
286
|
+
this.updateProcessStepStatus(step, {
|
|
287
|
+
transactionId: transaction.id,
|
|
288
|
+
status: _types.StepStatus.SUBMITTING,
|
|
289
|
+
chain: transaction.chain
|
|
290
|
+
});
|
|
291
|
+
}
|
|
236
292
|
});
|
|
237
293
|
emitter.on('extrinsicHash', data => {
|
|
238
294
|
this.onHasTransactionHash(data);
|
|
295
|
+
if (step) {
|
|
296
|
+
this.updateProcessStepStatus(step, {
|
|
297
|
+
extrinsicHash: data.extrinsicHash,
|
|
298
|
+
status: _types.StepStatus.PROCESSING
|
|
299
|
+
});
|
|
300
|
+
}
|
|
239
301
|
});
|
|
240
302
|
emitter.on('success', data => {
|
|
241
303
|
this.handlePostProcessing(data.id);
|
|
242
304
|
this.onSuccess(data);
|
|
305
|
+
if (step) {
|
|
306
|
+
this.updateProcessStepStatus(step, {
|
|
307
|
+
status: _types.StepStatus.COMPLETE
|
|
308
|
+
});
|
|
309
|
+
}
|
|
243
310
|
});
|
|
244
311
|
emitter.on('error', data => {
|
|
245
312
|
// this.handlePostProcessing(data.id); // might enable this later
|
|
@@ -247,12 +314,33 @@ class TransactionService {
|
|
|
247
314
|
...data,
|
|
248
315
|
errors: [...data.errors, new _TransactionError.TransactionError(_types.BasicTxErrorType.INTERNAL_ERROR)]
|
|
249
316
|
});
|
|
317
|
+
if (step) {
|
|
318
|
+
const rejectError = data.errors.find(error => {
|
|
319
|
+
// TODO: REFACTOR ERROR CODE
|
|
320
|
+
if ([_types.BasicTxErrorType.UNABLE_TO_SIGN, _types.BasicTxErrorType.USER_REJECT_REQUEST].includes(error.errorType)) {
|
|
321
|
+
return true;
|
|
322
|
+
}
|
|
323
|
+
return false;
|
|
324
|
+
});
|
|
325
|
+
if (rejectError) {
|
|
326
|
+
this.deleteProcess(step);
|
|
327
|
+
} else {
|
|
328
|
+
this.updateProcessStepStatus(step, {
|
|
329
|
+
status: _types.StepStatus.FAILED
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
}
|
|
250
333
|
});
|
|
251
334
|
emitter.on('timeout', data => {
|
|
252
335
|
this.onTimeOut({
|
|
253
336
|
...data,
|
|
254
337
|
errors: [...data.errors, new _TransactionError.TransactionError(_types.BasicTxErrorType.TIMEOUT)]
|
|
255
338
|
});
|
|
339
|
+
if (step) {
|
|
340
|
+
this.updateProcessStepStatus(step, {
|
|
341
|
+
status: _types.StepStatus.TIMEOUT
|
|
342
|
+
});
|
|
343
|
+
}
|
|
256
344
|
});
|
|
257
345
|
|
|
258
346
|
// Todo: handle any event with transaction.eventsHandler
|
|
@@ -283,6 +371,7 @@ class TransactionService {
|
|
|
283
371
|
return (0, _utils3.getExplorerLink)(chainInfo, transaction.extrinsicHash, 'tx');
|
|
284
372
|
}
|
|
285
373
|
transactionToHistories(id, startBlock, nonce, eventLogs) {
|
|
374
|
+
var _transaction$step;
|
|
286
375
|
const transaction = this.getTransaction(id);
|
|
287
376
|
const extrinsicType = transaction.extrinsicType;
|
|
288
377
|
const chainInfo = this.state.chainService.getChainInfoByKey(transaction.chain);
|
|
@@ -306,7 +395,8 @@ class TransactionService {
|
|
|
306
395
|
blockHash: '',
|
|
307
396
|
// Will be added in next step
|
|
308
397
|
nonce: nonce !== null && nonce !== void 0 ? nonce : 0,
|
|
309
|
-
startBlock: startBlock || 0
|
|
398
|
+
startBlock: startBlock || 0,
|
|
399
|
+
processId: (_transaction$step = transaction.step) === null || _transaction$step === void 0 ? void 0 : _transaction$step.processId
|
|
310
400
|
};
|
|
311
401
|
const nativeAsset = (0, _utils2._getChainNativeTokenBasicInfo)(chainInfo);
|
|
312
402
|
const baseNativeAmount = {
|
|
@@ -659,6 +749,7 @@ class TransactionService {
|
|
|
659
749
|
|
|
660
750
|
// Create Input History Transaction History
|
|
661
751
|
this.state.historyService.insertHistories(this.transactionToHistories(id, startBlock, nonce)).catch(console.error);
|
|
752
|
+
this.createProcessNotification(id).catch(console.error);
|
|
662
753
|
console.debug(`Transaction "${id}" is sent`);
|
|
663
754
|
}
|
|
664
755
|
onHasTransactionHash(_ref3) {
|
|
@@ -871,6 +962,8 @@ class TransactionService {
|
|
|
871
962
|
address,
|
|
872
963
|
chain,
|
|
873
964
|
id,
|
|
965
|
+
isPassConfirmation,
|
|
966
|
+
step,
|
|
874
967
|
transaction,
|
|
875
968
|
url
|
|
876
969
|
} = _ref7;
|
|
@@ -948,7 +1041,8 @@ class TransactionService {
|
|
|
948
1041
|
id,
|
|
949
1042
|
errors: [],
|
|
950
1043
|
warnings: [],
|
|
951
|
-
extrinsicHash: id
|
|
1044
|
+
extrinsicHash: id,
|
|
1045
|
+
processId: step === null || step === void 0 ? void 0 : step.processId
|
|
952
1046
|
};
|
|
953
1047
|
if (isInjected) {
|
|
954
1048
|
this.state.requestService.addConfirmation(id, url || _constants2.EXTENSION_REQUEST_URL, 'evmWatchTransactionRequest', payload, {}).then(async _ref8 => {
|
|
@@ -1016,7 +1110,9 @@ class TransactionService {
|
|
|
1016
1110
|
emitter.emit('error', eventData);
|
|
1017
1111
|
});
|
|
1018
1112
|
} else {
|
|
1019
|
-
this.state.requestService.addConfirmation(id, url || _constants2.EXTENSION_REQUEST_URL, 'evmSendTransactionRequest', payload, {
|
|
1113
|
+
this.state.requestService.addConfirmation(id, url || _constants2.EXTENSION_REQUEST_URL, 'evmSendTransactionRequest', payload, {
|
|
1114
|
+
isPassConfirmation
|
|
1115
|
+
}).then(async _ref9 => {
|
|
1020
1116
|
let {
|
|
1021
1117
|
isApproved,
|
|
1022
1118
|
payload
|
|
@@ -1084,6 +1180,8 @@ class TransactionService {
|
|
|
1084
1180
|
feeCustom,
|
|
1085
1181
|
id,
|
|
1086
1182
|
nonNativeTokenPayFeeSlug,
|
|
1183
|
+
signAfterCreate,
|
|
1184
|
+
step,
|
|
1087
1185
|
transaction,
|
|
1088
1186
|
url
|
|
1089
1187
|
} = _ref10;
|
|
@@ -1094,7 +1192,8 @@ class TransactionService {
|
|
|
1094
1192
|
id,
|
|
1095
1193
|
errors: [],
|
|
1096
1194
|
warnings: [],
|
|
1097
|
-
extrinsicHash: id
|
|
1195
|
+
extrinsicHash: id,
|
|
1196
|
+
processId: step === null || step === void 0 ? void 0 : step.processId
|
|
1098
1197
|
};
|
|
1099
1198
|
const extrinsic = transaction;
|
|
1100
1199
|
// const registry = extrinsic.registry;
|
|
@@ -1106,7 +1205,7 @@ class TransactionService {
|
|
|
1106
1205
|
const {
|
|
1107
1206
|
signature,
|
|
1108
1207
|
signedTransaction
|
|
1109
|
-
} = await this.state.requestService.signInternalTransaction(id, address, url || _constants2.EXTENSION_REQUEST_URL, payload);
|
|
1208
|
+
} = await this.state.requestService.signInternalTransaction(id, address, url || _constants2.EXTENSION_REQUEST_URL, payload, signAfterCreate);
|
|
1110
1209
|
return {
|
|
1111
1210
|
id: new Date().getTime(),
|
|
1112
1211
|
signature,
|
|
@@ -1195,6 +1294,7 @@ class TransactionService {
|
|
|
1195
1294
|
chain,
|
|
1196
1295
|
extrinsicType,
|
|
1197
1296
|
id,
|
|
1297
|
+
step,
|
|
1198
1298
|
transaction,
|
|
1199
1299
|
url
|
|
1200
1300
|
} = _ref13;
|
|
@@ -1204,7 +1304,8 @@ class TransactionService {
|
|
|
1204
1304
|
id,
|
|
1205
1305
|
errors: [],
|
|
1206
1306
|
warnings: [],
|
|
1207
|
-
extrinsicHash: id
|
|
1307
|
+
extrinsicHash: id,
|
|
1308
|
+
processId: step === null || step === void 0 ? void 0 : step.processId
|
|
1208
1309
|
};
|
|
1209
1310
|
const payload = transaction;
|
|
1210
1311
|
const signer = message => {
|
|
@@ -1325,6 +1426,114 @@ class TransactionService {
|
|
|
1325
1426
|
extrinsicHash: transaction.extrinsicHash
|
|
1326
1427
|
}).catch(console.error);
|
|
1327
1428
|
}
|
|
1429
|
+
async createProcessIfNeed(process) {
|
|
1430
|
+
if (!this.aliveProcessMap.has(process.id)) {
|
|
1431
|
+
this.aliveProcessMap.set(process.id, process);
|
|
1432
|
+
this.updateAliveProcess();
|
|
1433
|
+
await this.state.dbService.upsertProcessTransaction(process);
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
checkProcessExist(processId) {
|
|
1437
|
+
return this.aliveProcessMap.has(processId);
|
|
1438
|
+
}
|
|
1439
|
+
deleteProcess(step) {
|
|
1440
|
+
const {
|
|
1441
|
+
processId
|
|
1442
|
+
} = step;
|
|
1443
|
+
this.aliveProcessMap.delete(processId);
|
|
1444
|
+
this.state.dbService.deleteProcessTransactionById(processId).catch(console.error);
|
|
1445
|
+
this.updateAliveProcess();
|
|
1446
|
+
}
|
|
1447
|
+
updateProcessStepStatus(step, data) {
|
|
1448
|
+
const {
|
|
1449
|
+
processId,
|
|
1450
|
+
stepId
|
|
1451
|
+
} = step;
|
|
1452
|
+
const process = this.aliveProcessMap.get(processId);
|
|
1453
|
+
if (process) {
|
|
1454
|
+
const step = process.steps.find(item => item.id === stepId);
|
|
1455
|
+
if (step) {
|
|
1456
|
+
Object.assign(step, data);
|
|
1457
|
+
if ([_types.StepStatus.PREPARE || _types.StepStatus.PROCESSING].includes(step.status)) {
|
|
1458
|
+
process.currentStepId = step.id;
|
|
1459
|
+
}
|
|
1460
|
+
if (step.status === _types.StepStatus.COMPLETE) {
|
|
1461
|
+
const nextStep = process.steps.find(item => item.id === stepId + 1);
|
|
1462
|
+
if (nextStep) {
|
|
1463
|
+
nextStep.status = _types.StepStatus.PREPARE;
|
|
1464
|
+
process.currentStepId = nextStep.id;
|
|
1465
|
+
}
|
|
1466
|
+
} else if ([_types.StepStatus.FAILED, _types.StepStatus.TIMEOUT].includes(step.status)) {
|
|
1467
|
+
const nextSteps = process.steps.filter(item => item.id > stepId);
|
|
1468
|
+
nextSteps.forEach(item => {
|
|
1469
|
+
item.status = _types.StepStatus.CANCELLED;
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
if (process.steps.some(item => [_types.StepStatus.PROCESSING, _types.StepStatus.SUBMITTING].includes(item.status))) {
|
|
1474
|
+
process.status = _types.StepStatus.PROCESSING;
|
|
1475
|
+
}
|
|
1476
|
+
if (process.steps.some(item => item.status === _types.StepStatus.TIMEOUT)) {
|
|
1477
|
+
process.status = _types.StepStatus.TIMEOUT;
|
|
1478
|
+
}
|
|
1479
|
+
if (process.steps.every(item => item.status === _types.StepStatus.COMPLETE)) {
|
|
1480
|
+
const lastStep = process.steps[process.steps.length - 1];
|
|
1481
|
+
process.lastTransactionChain = lastStep.chain;
|
|
1482
|
+
process.lastTransactionId = lastStep.transactionId;
|
|
1483
|
+
process.status = _types.StepStatus.COMPLETE;
|
|
1484
|
+
}
|
|
1485
|
+
if (process.steps.some(item => item.status === _types.StepStatus.FAILED)) {
|
|
1486
|
+
process.status = _types.StepStatus.FAILED;
|
|
1487
|
+
}
|
|
1488
|
+
this.aliveProcessMap.set(processId, process);
|
|
1489
|
+
this.state.dbService.upsertProcessTransaction(process).catch(console.error);
|
|
1490
|
+
if ([_types.StepStatus.COMPLETE, _types.StepStatus.FAILED, _types.StepStatus.TIMEOUT].includes(process.status)) {
|
|
1491
|
+
this.aliveProcessMap.delete(processId);
|
|
1492
|
+
}
|
|
1493
|
+
this.updateAliveProcess();
|
|
1494
|
+
} else {
|
|
1495
|
+
this.state.dbService.getProcessTransactionById(processId).then(process => {
|
|
1496
|
+
if (process) {
|
|
1497
|
+
const step = process.steps.find(item => item.id === stepId);
|
|
1498
|
+
if (step && step.status === _types.StepStatus.TIMEOUT && [_types.StepStatus.COMPLETE, _types.StepStatus.FAILED].includes(data.status)) {
|
|
1499
|
+
Object.assign(step, data);
|
|
1500
|
+
const isLastStep = process.steps[process.steps.length - 1].id = stepId;
|
|
1501
|
+
if (isLastStep) {
|
|
1502
|
+
process.status = data.status;
|
|
1503
|
+
}
|
|
1504
|
+
this.state.dbService.upsertProcessTransaction(process).catch(console.error);
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
}).catch(console.error);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
async updateProcessInfo(id, combineInfo, step) {
|
|
1511
|
+
const process = this.aliveProcessMap.get(id);
|
|
1512
|
+
if (process) {
|
|
1513
|
+
if (step) {
|
|
1514
|
+
const index = process.steps.findIndex(item => item.id === (step === null || step === void 0 ? void 0 : step.id));
|
|
1515
|
+
if (index !== -1) {
|
|
1516
|
+
process.steps[index] = step;
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
if (combineInfo) {
|
|
1520
|
+
process.combineInfo = combineInfo;
|
|
1521
|
+
}
|
|
1522
|
+
this.aliveProcessMap.set(process.id, process);
|
|
1523
|
+
this.updateAliveProcess();
|
|
1524
|
+
await this.state.dbService.upsertProcessTransaction(process);
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
async createProcessNotification(transactionId) {
|
|
1528
|
+
var _transaction$step2;
|
|
1529
|
+
const transaction = this.getTransaction(transactionId);
|
|
1530
|
+
if (transaction && (_transaction$step2 = transaction.step) !== null && _transaction$step2 !== void 0 && _transaction$step2.processId) {
|
|
1531
|
+
const process = this.aliveProcessMap.get(transaction.step.processId);
|
|
1532
|
+
if (process) {
|
|
1533
|
+
await this.state.inappNotificationService.createProcessNotification(process);
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1328
1537
|
resetWallet() {
|
|
1329
1538
|
this.transactionSubject.next({});
|
|
1330
1539
|
}
|
package/cjs/types/index.js
CHANGED
|
@@ -156,4 +156,15 @@ Object.keys(_yield).forEach(function (key) {
|
|
|
156
156
|
return _yield[key];
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
|
+
});
|
|
160
|
+
var _setting = require("./setting");
|
|
161
|
+
Object.keys(_setting).forEach(function (key) {
|
|
162
|
+
if (key === "default" || key === "__esModule") return;
|
|
163
|
+
if (key in exports && exports[key] === _setting[key]) return;
|
|
164
|
+
Object.defineProperty(exports, key, {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: function () {
|
|
167
|
+
return _setting[key];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
159
170
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/cjs/types/swap/index.js
CHANGED
|
@@ -38,9 +38,12 @@ exports.SwapProviderId = SwapProviderId;
|
|
|
38
38
|
SwapProviderId["POLKADOT_ASSET_HUB"] = "POLKADOT_ASSET_HUB";
|
|
39
39
|
SwapProviderId["KUSAMA_ASSET_HUB"] = "KUSAMA_ASSET_HUB";
|
|
40
40
|
SwapProviderId["ROCOCO_ASSET_HUB"] = "ROCOCO_ASSET_HUB";
|
|
41
|
+
SwapProviderId["WESTEND_ASSET_HUB"] = "WESTEND_ASSET_HUB";
|
|
41
42
|
SwapProviderId["SIMPLE_SWAP"] = "SIMPLE_SWAP";
|
|
42
43
|
})(SwapProviderId || (exports.SwapProviderId = SwapProviderId = {}));
|
|
43
|
-
const _SUPPORTED_SWAP_PROVIDERS = [SwapProviderId.CHAIN_FLIP_TESTNET, SwapProviderId.CHAIN_FLIP_MAINNET, SwapProviderId.HYDRADX_MAINNET, SwapProviderId.HYDRADX_TESTNET, SwapProviderId.POLKADOT_ASSET_HUB, SwapProviderId.KUSAMA_ASSET_HUB, SwapProviderId.ROCOCO_ASSET_HUB,
|
|
44
|
+
const _SUPPORTED_SWAP_PROVIDERS = [SwapProviderId.CHAIN_FLIP_TESTNET, SwapProviderId.CHAIN_FLIP_MAINNET, SwapProviderId.HYDRADX_MAINNET, SwapProviderId.HYDRADX_TESTNET, SwapProviderId.POLKADOT_ASSET_HUB, SwapProviderId.KUSAMA_ASSET_HUB, SwapProviderId.ROCOCO_ASSET_HUB,
|
|
45
|
+
// SwapProviderId.WESTEND_ASSET_HUB,
|
|
46
|
+
SwapProviderId.SIMPLE_SWAP];
|
|
44
47
|
exports._SUPPORTED_SWAP_PROVIDERS = _SUPPORTED_SWAP_PROVIDERS;
|
|
45
48
|
// process handling
|
|
46
49
|
let SwapFeeType;
|
|
@@ -25,6 +25,17 @@ Object.keys(_error).forEach(function (key) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
+
var _process = require("./process");
|
|
29
|
+
Object.keys(_process).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _process[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _process[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
28
39
|
var _request = require("./request");
|
|
29
40
|
Object.keys(_request).forEach(function (key) {
|
|
30
41
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StepStatus = exports.ProcessType = exports.PROCESSING_STEP_STATUS = void 0;
|
|
7
|
+
// Copyright 2019-2022 @subwallet/extension-base
|
|
8
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
+
let ProcessType;
|
|
10
|
+
exports.ProcessType = ProcessType;
|
|
11
|
+
(function (ProcessType) {
|
|
12
|
+
ProcessType["SWAP"] = "swap";
|
|
13
|
+
ProcessType["EARNING"] = "earning";
|
|
14
|
+
})(ProcessType || (exports.ProcessType = ProcessType = {}));
|
|
15
|
+
let StepStatus;
|
|
16
|
+
exports.StepStatus = StepStatus;
|
|
17
|
+
(function (StepStatus) {
|
|
18
|
+
StepStatus["QUEUED"] = "QUEUED";
|
|
19
|
+
StepStatus["PREPARE"] = "PREPARE";
|
|
20
|
+
StepStatus["SUBMITTING"] = "SUBMITTING";
|
|
21
|
+
StepStatus["PROCESSING"] = "PROCESSING";
|
|
22
|
+
StepStatus["COMPLETE"] = "COMPLETE";
|
|
23
|
+
StepStatus["FAILED"] = "FAILED";
|
|
24
|
+
StepStatus["CANCELLED"] = "CANCELLED";
|
|
25
|
+
StepStatus["TIMEOUT"] = "TIMEOUT";
|
|
26
|
+
})(StepStatus || (exports.StepStatus = StepStatus = {}));
|
|
27
|
+
const PROCESSING_STEP_STATUS = [StepStatus.PREPARE, StepStatus.SUBMITTING, StepStatus.PROCESSING];
|
|
28
|
+
exports.PROCESSING_STEP_STATUS = PROCESSING_STEP_STATUS;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EarningProcessType = void 0;
|
|
7
|
+
// Copyright 2019-2022 @subwallet/extension-base
|
|
8
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
+
// Result after create extrinsic
|
|
10
|
+
let EarningProcessType;
|
|
11
|
+
exports.EarningProcessType = EarningProcessType;
|
|
12
|
+
(function (EarningProcessType) {
|
|
13
|
+
EarningProcessType["NOMINATION_POOL"] = "NOMINATION_POOL";
|
|
14
|
+
EarningProcessType["NATIVE_STAKING"] = "NATIVE_STAKING";
|
|
15
|
+
EarningProcessType["YIELD"] = "YIELD";
|
|
16
|
+
})(EarningProcessType || (exports.EarningProcessType = EarningProcessType = {}));
|
package/defaults.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const ALLOWED_PATH: readonly ["/", "/settings/security", "/accounts/connect-ledger", "/accounts/restore-json", "/accounts/detail", "/accounts/new-seed-phrase"];
|
|
1
|
+
declare const ALLOWED_PATH: readonly ["/", "/settings/security", "/transaction-submission", "/accounts/connect-ledger", "/accounts/restore-json", "/accounts/detail", "/accounts/new-seed-phrase"];
|
|
2
2
|
declare const PHISHING_PAGE_REDIRECT = "/phishing-page-detected";
|
|
3
3
|
declare const EXTENSION_PREFIX: string;
|
|
4
4
|
declare const ID_PREFIX: string;
|
package/defaults.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2019-2022 @polkadot/extension-base authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
const ALLOWED_PATH = ['/', '/settings/security', '/accounts/connect-ledger', '/accounts/restore-json', '/accounts/detail', '/accounts/new-seed-phrase'];
|
|
4
|
+
const ALLOWED_PATH = ['/', '/settings/security', '/transaction-submission', '/accounts/connect-ledger', '/accounts/restore-json', '/accounts/detail', '/accounts/new-seed-phrase'];
|
|
5
5
|
const PHISHING_PAGE_REDIRECT = '/phishing-page-detected';
|
|
6
6
|
const EXTENSION_PREFIX = process.env.EXTENSION_PREFIX || '';
|
|
7
7
|
const ID_PREFIX = process.env.ID_PREFIX || EXTENSION_PREFIX || '';
|