@subwallet/extension-base 1.2.30-0 → 1.2.31-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.
@@ -1652,8 +1652,8 @@ export interface KoniRequestSignatures {
1652
1652
  'pri(accounts.inject.add)': [RequestAddInjectedAccounts, boolean];
1653
1653
  'pri(accounts.inject.remove)': [RequestRemoveInjectedAccounts, boolean];
1654
1654
  'pri(derivation.createV2)': [RequestDeriveCreateV2, boolean];
1655
- 'pri(json.restoreV2)': [RequestJsonRestoreV2, void];
1656
- 'pri(json.batchRestoreV2)': [RequestBatchRestoreV2, void];
1655
+ 'pri(json.restoreV2)': [RequestJsonRestoreV2, string[]];
1656
+ 'pri(json.batchRestoreV2)': [RequestBatchRestoreV2, string[]];
1657
1657
  'pri(accounts.batchExportV2)': [RequestAccountBatchExportV2, ResponseAccountBatchExportV2];
1658
1658
  'pri(accounts.exportPrivateKey)': [RequestAccountExportPrivateKey, ResponseAccountExportPrivateKey];
1659
1659
  'pri(accounts.subscribeWithCurrentAddress)': [RequestAccountSubscribe, AccountsWithCurrentAddress, AccountsWithCurrentAddress];
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fetchLastestBlockedActionsAndFeatures = void 0;
7
+ var _utils = require("@subwallet/extension-base/utils");
8
+ // Copyright 2019-2022 @subwallet/extension-base authors & contributors
9
+ // SPDX-License-Identifier: Apache-2.0
10
+
11
+ const BLOCKED_ACTIONS_AND_FEATURES_PROMISE = (0, _utils.fetchStaticData)('blocked-actions-features');
12
+ const fetchLastestBlockedActionsAndFeatures = async () => {
13
+ return await BLOCKED_ACTIONS_AND_FEATURES_PROMISE;
14
+ };
15
+ exports.fetchLastestBlockedActionsAndFeatures = fetchLastestBlockedActionsAndFeatures;
@@ -62,6 +62,18 @@ Object.keys(_storage).forEach(function (key) {
62
62
  }
63
63
  });
64
64
  });
65
+ var _blockedActionsList = require("./blocked-actions-list");
66
+ Object.keys(_blockedActionsList).forEach(function (key) {
67
+ if (key === "default" || key === "__esModule") return;
68
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
69
+ if (key in exports && exports[key] === _blockedActionsList[key]) return;
70
+ Object.defineProperty(exports, key, {
71
+ enumerable: true,
72
+ get: function () {
73
+ return _blockedActionsList[key];
74
+ }
75
+ });
76
+ });
65
77
  // Copyright 2019-2022 @subwallet/extension-koni authors & contributors
66
78
  // SPDX-License-Identifier: Apache-2.0
67
79
 
@@ -8,6 +8,8 @@ exports.additionalValidateTransfer = additionalValidateTransfer;
8
8
  exports.additionalValidateXcmTransfer = additionalValidateXcmTransfer;
9
9
  exports.checkBalanceWithTransactionFee = checkBalanceWithTransactionFee;
10
10
  exports.checkSigningAccountForTransaction = checkSigningAccountForTransaction;
11
+ exports.checkSupportForAction = checkSupportForAction;
12
+ exports.checkSupportForFeature = checkSupportForFeature;
11
13
  exports.checkSupportForTransaction = checkSupportForTransaction;
12
14
  exports.estimateFeeForTransaction = estimateFeeForTransaction;
13
15
  exports.validateTransferRequest = validateTransferRequest;
@@ -152,6 +154,170 @@ function additionalValidateXcmTransfer(originTokenInfo, destinationTokenInfo, se
152
154
  }
153
155
  return [warning, error];
154
156
  }
157
+ function checkSupportForFeature(validationResponse, blockedFeaturesList, chainInfo) {
158
+ const extrinsicType = validationResponse.extrinsicType;
159
+ const chain = validationResponse.chain;
160
+ const currentFeature = `${extrinsicType}___${chain}`;
161
+ if (blockedFeaturesList.includes(currentFeature)) {
162
+ validationResponse.errors.push(new _TransactionError.TransactionError(_KoniTypes.BasicTxErrorType.UNSUPPORTED, (0, _i18next.t)(`Feature under maintenance on ${chainInfo.name} network. Try again later`)));
163
+ }
164
+ }
165
+ function checkSupportForAction(validationResponse, blockedActionsMap) {
166
+ const extrinsicType = validationResponse.extrinsicType;
167
+ let currentAction = '';
168
+ switch (extrinsicType) {
169
+ case _KoniTypes.ExtrinsicType.TRANSFER_BALANCE:
170
+
171
+ // eslint-disable-next-line no-fallthrough
172
+ case _KoniTypes.ExtrinsicType.TRANSFER_TOKEN:
173
+ {
174
+ const data = validationResponse.data;
175
+ const tokenSlug = data.tokenSlug;
176
+ currentAction = `${extrinsicType}___${tokenSlug}`;
177
+ break;
178
+ }
179
+ case _KoniTypes.ExtrinsicType.TRANSFER_XCM:
180
+ {
181
+ const data = validationResponse.data;
182
+ const tokenSlug = data.tokenSlug;
183
+ const destinationNetworkKey = data.destinationNetworkKey;
184
+ currentAction = `${extrinsicType}___${tokenSlug}___${destinationNetworkKey}`;
185
+ break;
186
+ }
187
+ case _KoniTypes.ExtrinsicType.SEND_NFT:
188
+ {
189
+ const data = validationResponse.data;
190
+ const networkKey = data.networkKey;
191
+ const collectionId = data.nftItem.collectionId;
192
+ currentAction = `${extrinsicType}___${networkKey}___${collectionId}`;
193
+ break;
194
+ }
195
+ case _KoniTypes.ExtrinsicType.SWAP:
196
+ {
197
+ const data = validationResponse.data;
198
+ const pairSlug = data.quote.pair.slug;
199
+ const providerId = data.provider.id;
200
+ currentAction = `${extrinsicType}___${pairSlug}___${providerId}`;
201
+ break;
202
+ }
203
+ case _KoniTypes.ExtrinsicType.STAKING_BOND:
204
+ {
205
+ const data = validationResponse.data;
206
+ const chain = data.chain;
207
+ currentAction = `${extrinsicType}___${chain}`;
208
+ break;
209
+ }
210
+ case _KoniTypes.ExtrinsicType.STAKING_LEAVE_POOL:
211
+ {
212
+ const data = validationResponse.data;
213
+ const slug = data.slug;
214
+ currentAction = `${extrinsicType}___${slug}`;
215
+ break;
216
+ }
217
+ case _KoniTypes.ExtrinsicType.STAKING_UNBOND:
218
+ {
219
+ const data = validationResponse.data;
220
+ const chain = data.chain;
221
+ currentAction = `${extrinsicType}___${chain}`;
222
+ break;
223
+ }
224
+ case _KoniTypes.ExtrinsicType.STAKING_CLAIM_REWARD:
225
+ {
226
+ const data = validationResponse.data;
227
+ const slug = data.slug;
228
+ currentAction = `${extrinsicType}___${slug}`;
229
+ break;
230
+ }
231
+ case _KoniTypes.ExtrinsicType.STAKING_WITHDRAW:
232
+ {
233
+ const data = validationResponse.data;
234
+ const slug = data.slug;
235
+ currentAction = `${extrinsicType}___${slug}`;
236
+ break;
237
+ }
238
+ case _KoniTypes.ExtrinsicType.STAKING_COMPOUNDING:
239
+ {
240
+ const data = validationResponse.data;
241
+ const networkKey = data.networkKey;
242
+ currentAction = `${extrinsicType}___${networkKey}`;
243
+ break;
244
+ }
245
+ case _KoniTypes.ExtrinsicType.STAKING_CANCEL_COMPOUNDING:
246
+ {
247
+ const data = validationResponse.data;
248
+ const networkKey = data.networkKey;
249
+ currentAction = `${extrinsicType}___${networkKey}`;
250
+ break;
251
+ }
252
+ case _KoniTypes.ExtrinsicType.STAKING_CANCEL_UNSTAKE:
253
+ {
254
+ const data = validationResponse.data;
255
+ const slug = data.slug;
256
+ currentAction = `${extrinsicType}___${slug}`;
257
+ break;
258
+ }
259
+ case _KoniTypes.ExtrinsicType.JOIN_YIELD_POOL:
260
+ {
261
+ const data = validationResponse.data;
262
+ const slug = data.data.slug;
263
+ currentAction = `${extrinsicType}___${slug}`;
264
+ break;
265
+ }
266
+ case _KoniTypes.ExtrinsicType.MINT_VDOT:
267
+ case _KoniTypes.ExtrinsicType.MINT_LDOT:
268
+ case _KoniTypes.ExtrinsicType.MINT_SDOT:
269
+ case _KoniTypes.ExtrinsicType.MINT_QDOT:
270
+ case _KoniTypes.ExtrinsicType.MINT_STDOT:
271
+
272
+ // eslint-disable-next-line no-fallthrough
273
+ case _KoniTypes.ExtrinsicType.MINT_VMANTA:
274
+ {
275
+ const data = validationResponse.data;
276
+ const slug = data.slug;
277
+ currentAction = `${extrinsicType}___${slug}`;
278
+ break;
279
+ }
280
+ case _KoniTypes.ExtrinsicType.REDEEM_VDOT:
281
+ case _KoniTypes.ExtrinsicType.REDEEM_LDOT:
282
+ case _KoniTypes.ExtrinsicType.REDEEM_SDOT:
283
+ case _KoniTypes.ExtrinsicType.REDEEM_QDOT:
284
+ case _KoniTypes.ExtrinsicType.REDEEM_STDOT:
285
+
286
+ // eslint-disable-next-line no-fallthrough
287
+ case _KoniTypes.ExtrinsicType.REDEEM_VMANTA:
288
+ {
289
+ const data = validationResponse.data;
290
+ const slug = data.slug;
291
+ currentAction = `${extrinsicType}___${slug}`;
292
+ break;
293
+ }
294
+ case _KoniTypes.ExtrinsicType.UNSTAKE_VDOT:
295
+ case _KoniTypes.ExtrinsicType.UNSTAKE_LDOT:
296
+ case _KoniTypes.ExtrinsicType.UNSTAKE_SDOT:
297
+ case _KoniTypes.ExtrinsicType.UNSTAKE_QDOT:
298
+ case _KoniTypes.ExtrinsicType.UNSTAKE_STDOT:
299
+
300
+ // eslint-disable-next-line no-fallthrough
301
+ case _KoniTypes.ExtrinsicType.UNSTAKE_VMANTA:
302
+ {
303
+ const data = validationResponse.data;
304
+ const slug = data.slug;
305
+ currentAction = `${extrinsicType}___${slug}`;
306
+ break;
307
+ }
308
+ case _KoniTypes.ExtrinsicType.TOKEN_SPENDING_APPROVAL:
309
+ {
310
+ const data = validationResponse.data;
311
+ const chain = data.chain;
312
+ currentAction = `${extrinsicType}___${chain}`;
313
+ break;
314
+ }
315
+ }
316
+ const blockedActionsList = Object.values(blockedActionsMap).flat();
317
+ if (blockedActionsList.includes(currentAction)) {
318
+ validationResponse.errors.push(new _TransactionError.TransactionError(_KoniTypes.BasicTxErrorType.UNSUPPORTED, (0, _i18next.t)('Feature under maintenance. Try again later')));
319
+ }
320
+ }
155
321
 
156
322
  // general validations
157
323
  function checkSupportForTransaction(validationResponse, transaction) {
@@ -1431,6 +1431,10 @@ class KoniExtension {
1431
1431
  withMasterPassword
1432
1432
  } = _ref43;
1433
1433
  const isPasswordValidated = this.validatePassword(file, password);
1434
+ const {
1435
+ promise,
1436
+ resolve
1437
+ } = (0, _utils4.createPromiseHandler)();
1434
1438
  if (isPasswordValidated) {
1435
1439
  try {
1436
1440
  this._saveCurrentAccountAddress(address, () => {
@@ -1445,10 +1449,12 @@ class KoniExtension {
1445
1449
  });
1446
1450
  }
1447
1451
  this._addAddressToAuthList(address, isAllowed);
1452
+ resolve([address]);
1448
1453
  });
1449
1454
  if (this.#alwaysLock) {
1450
1455
  this.keyringLock();
1451
1456
  }
1457
+ return promise;
1452
1458
  } catch (error) {
1453
1459
  throw new Error(error.message);
1454
1460
  }
@@ -1465,17 +1471,35 @@ class KoniExtension {
1465
1471
  } = _ref44;
1466
1472
  const addressList = accountsInfo.map(acc => acc.address);
1467
1473
  const isPasswordValidated = this.validatedAccountsPassword(file, password);
1474
+ const {
1475
+ promise,
1476
+ resolve
1477
+ } = (0, _utils4.createPromiseHandler)();
1468
1478
  if (isPasswordValidated) {
1469
1479
  try {
1470
1480
  this._saveCurrentAccountAddress(_constants.ALL_ACCOUNT_KEY, () => {
1471
1481
  _uiKeyring.keyring.restoreAccounts(file, password);
1472
1482
  this.#koniState.keyringService.removeNoneHardwareGenesisHash();
1473
- this._addAddressesToAuthList(addressList, isAllowed);
1483
+ const successAddressList = addressList.reduce((addressList, address) => {
1484
+ try {
1485
+ const account = _uiKeyring.keyring.getPair(address);
1486
+ if (account) {
1487
+ addressList.push(address);
1488
+ }
1489
+ } catch (error) {
1490
+ console.log(error);
1491
+ }
1492
+ return addressList;
1493
+ }, []);
1494
+ this._addAddressesToAuthList(successAddressList, isAllowed);
1495
+ resolve(successAddressList);
1474
1496
  });
1475
1497
 
1476
1498
  // if (this.#alwaysLock) {
1477
1499
  // this.keyringLock();
1478
1500
  // }
1501
+
1502
+ return promise;
1479
1503
  } catch (error) {
1480
1504
  throw new Error(error.message);
1481
1505
  }
@@ -3051,14 +3075,14 @@ class KoniExtension {
3051
3075
  } else {
3052
3076
  metadata = await this.#koniState.chainService.getMetadataByHash(payload.genesisHash);
3053
3077
  if (metadata) {
3054
- var _chainInfo$substrateI, _chainInfo$substrateI2, _chainInfo$substrateI3;
3078
+ var _chainInfo$substrateI, _chainInfo$substrateI2, _chainInfo$substrateI3, _chainInfo$substrateI4;
3055
3079
  registry = new _types3.TypeRegistry();
3056
3080
  const _metadata = new _types3.Metadata(registry, metadata.hexValue);
3057
3081
  registry.register(metadata.types);
3058
3082
  registry.setChainProperties(registry.createType('ChainProperties', {
3059
- ss58Format: (chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI = chainInfo.substrateInfo) === null || _chainInfo$substrateI === void 0 ? void 0 : _chainInfo$substrateI.addressPrefix) || 42,
3060
- tokenDecimals: chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI2 = chainInfo.substrateInfo) === null || _chainInfo$substrateI2 === void 0 ? void 0 : _chainInfo$substrateI2.decimals,
3061
- tokenSymbol: chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI3 = chainInfo.substrateInfo) === null || _chainInfo$substrateI3 === void 0 ? void 0 : _chainInfo$substrateI3.symbol
3083
+ ss58Format: (_chainInfo$substrateI = chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI2 = chainInfo.substrateInfo) === null || _chainInfo$substrateI2 === void 0 ? void 0 : _chainInfo$substrateI2.addressPrefix) !== null && _chainInfo$substrateI !== void 0 ? _chainInfo$substrateI : 42,
3084
+ tokenDecimals: chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI3 = chainInfo.substrateInfo) === null || _chainInfo$substrateI3 === void 0 ? void 0 : _chainInfo$substrateI3.decimals,
3085
+ tokenSymbol: chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI4 = chainInfo.substrateInfo) === null || _chainInfo$substrateI4 === void 0 ? void 0 : _chainInfo$substrateI4.symbol
3062
3086
  }));
3063
3087
  registry.setMetadata(_metadata, payload.signedExtensions, metadata.userExtensions);
3064
3088
  } else {
@@ -4409,9 +4433,9 @@ class KoniExtension {
4409
4433
  case 'pri(accounts.batchExportV2)':
4410
4434
  return this.batchExportV2(request);
4411
4435
  case 'pri(json.restoreV2)':
4412
- return this.jsonRestoreV2(request);
4436
+ return await this.jsonRestoreV2(request);
4413
4437
  case 'pri(json.batchRestoreV2)':
4414
- return this.batchRestoreV2(request);
4438
+ return await this.batchRestoreV2(request);
4415
4439
  case 'pri(nft.getNft)':
4416
4440
  return await this.getNft();
4417
4441
  case 'pri(nft.getSubscription)':
@@ -13,6 +13,6 @@ const packageInfo = {
13
13
  name: '@subwallet/extension-base',
14
14
  path: typeof __dirname === 'string' ? __dirname : 'auto',
15
15
  type: 'cjs',
16
- version: '1.2.30-0'
16
+ version: '1.2.31-0'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
@@ -73,16 +73,16 @@ class StellaSwapLiquidStakingPoolHandler extends _base.default {
73
73
  const tvlCall = stakingContract.methods.fundRaisedBalance();
74
74
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
75
75
  const exchangeRateCall = stakingContract.methods.getPooledTokenByShares(sampleTokenShare);
76
-
77
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
78
- const [aprObject, tvl, equivalentTokenShare] = await Promise.all([aprPromise,
79
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
80
- tvlCall.call(),
81
76
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
82
- exchangeRateCall.call()]);
77
+ const equivalentTokenShare = await exchangeRateCall.call();
83
78
  const rate = equivalentTokenShare;
84
79
  const exchangeRate = rate / 10 ** (0, _utils._getAssetDecimals)(derivativeTokenInfo);
85
80
  this.updateExchangeRate(rate);
81
+
82
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
83
+ const [aprObject, tvl] = await Promise.all([aprPromise,
84
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
85
+ tvlCall.call()]);
86
86
  return {
87
87
  ...this.baseInfo,
88
88
  type: this.type,
@@ -98,11 +98,12 @@ class ChainflipSwapHandler {
98
98
  const toAsset = this.chainService.getAssetBySlug(request.pair.to);
99
99
  const srcChain = fromAsset.originChain;
100
100
  const destChain = toAsset.originChain;
101
+ const isSwapCrossChain = srcChain !== destChain;
101
102
  const srcChainInfo = this.chainService.getChainInfoByKey(srcChain);
102
103
  const srcChainId = this.chainMapping[srcChain];
103
104
  const destChainId = this.chainMapping[destChain];
104
- const fromAssetId = this.assetMapping[fromAsset.slug];
105
- const toAssetId = this.assetMapping[toAsset.slug];
105
+ const fromAssetId = (0, _utils._getAssetSymbol)(fromAsset);
106
+ const toAssetId = (0, _utils._getAssetSymbol)(toAsset);
106
107
  if (!srcChainId || !destChainId || !fromAssetId || !toAssetId) {
107
108
  return {
108
109
  error: _swap3.SwapErrorType.ASSET_NOT_SUPPORTED
@@ -110,9 +111,21 @@ class ChainflipSwapHandler {
110
111
  }
111
112
  const [supportedDestChains, srcAssets, destAssets] = await Promise.all([this.swapSdk.getChains(srcChainId), this.swapSdk.getAssets(srcChainId), this.swapSdk.getAssets(destChainId)]);
112
113
  const supportedDestChainId = supportedDestChains.find(c => c.chain === destChainId);
113
- const srcAssetData = srcAssets.find(a => a.asset === fromAssetId);
114
- const destAssetData = destAssets.find(a => a.asset === toAssetId);
115
- if (!destAssetData || !srcAssetData || !supportedDestChainId) {
114
+ const srcAssetData = srcAssets.find(a => {
115
+ if ((0, _utils._isSmartContractToken)(fromAsset)) {
116
+ var _a$contractAddress;
117
+ return (a === null || a === void 0 ? void 0 : (_a$contractAddress = a.contractAddress) === null || _a$contractAddress === void 0 ? void 0 : _a$contractAddress.toLowerCase()) === (0, _utils._getContractAddressOfToken)(fromAsset).toLowerCase() && a.asset === fromAssetId;
118
+ }
119
+ return a.asset === fromAssetId;
120
+ });
121
+ const destAssetData = destAssets.find(a => {
122
+ if ((0, _utils._isSmartContractToken)(toAsset)) {
123
+ var _a$contractAddress2;
124
+ return (a === null || a === void 0 ? void 0 : (_a$contractAddress2 = a.contractAddress) === null || _a$contractAddress2 === void 0 ? void 0 : _a$contractAddress2.toLowerCase()) === (0, _utils._getContractAddressOfToken)(toAsset).toLowerCase() && a.asset === toAssetId;
125
+ }
126
+ return a.asset === toAssetId;
127
+ });
128
+ if (!destAssetData || !srcAssetData || isSwapCrossChain && !supportedDestChainId) {
116
129
  return {
117
130
  error: _swap3.SwapErrorType.UNKNOWN
118
131
  };
@@ -208,8 +221,8 @@ class ChainflipSwapHandler {
208
221
  }
209
222
  const srcChainId = this.chainMapping[fromAsset.originChain];
210
223
  const destChainId = this.chainMapping[toAsset.originChain];
211
- const fromAssetId = this.assetMapping[fromAsset.slug];
212
- const toAssetId = this.assetMapping[toAsset.slug];
224
+ const fromAssetId = (0, _utils._getAssetSymbol)(fromAsset);
225
+ const toAssetId = (0, _utils._getAssetSymbol)(toAsset);
213
226
  try {
214
227
  var _metadata$maxSwap;
215
228
  const quoteResponse = await this.swapSdk.getQuote({
@@ -223,13 +236,22 @@ class ChainflipSwapHandler {
223
236
  quoteResponse.quote.includedFees.forEach(fee => {
224
237
  switch (fee.type) {
225
238
  case ChainflipFeeType.INGRESS:
239
+ {
240
+ console.log('ingress', fee);
241
+ feeComponent.push({
242
+ tokenSlug: fromAsset.slug,
243
+ amount: fee.amount,
244
+ feeType: _swap3.SwapFeeType.NETWORK_FEE
245
+ });
246
+ break;
247
+ }
226
248
 
227
249
  // eslint-disable-next-line no-fallthrough
228
250
  case ChainflipFeeType.EGRESS:
229
251
  {
230
- const tokenSlug = Object.keys(this.assetMapping).find(assetSlug => this.assetMapping[assetSlug] === fee.asset);
252
+ console.log('egress', fee);
231
253
  feeComponent.push({
232
- tokenSlug,
254
+ tokenSlug: toAsset.slug,
233
255
  amount: fee.amount,
234
256
  feeType: _swap3.SwapFeeType.NETWORK_FEE
235
257
  });
@@ -243,9 +265,9 @@ class ChainflipSwapHandler {
243
265
  // eslint-disable-next-line no-fallthrough
244
266
  case ChainflipFeeType.BROKER:
245
267
  {
246
- const tokenSlug = Object.keys(this.assetMapping).find(assetSlug => this.assetMapping[assetSlug] === fee.asset);
268
+ console.log('broker fee', fee);
247
269
  feeComponent.push({
248
- tokenSlug,
270
+ tokenSlug: this.intermediaryAssetSlug,
249
271
  amount: fee.amount,
250
272
  feeType: _swap3.SwapFeeType.PLATFORM_FEE
251
273
  });
@@ -330,8 +352,8 @@ class ChainflipSwapHandler {
330
352
  const receiver = recipient !== null && recipient !== void 0 ? recipient : address;
331
353
  const srcChainId = this.chainMapping[fromAsset.originChain];
332
354
  const destChainId = this.chainMapping[toAsset.originChain];
333
- const fromAssetId = this.assetMapping[fromAsset.slug];
334
- const toAssetId = this.assetMapping[toAsset.slug];
355
+ const fromAssetId = (0, _utils._getAssetSymbol)(fromAsset);
356
+ const toAssetId = (0, _utils._getAssetSymbol)(toAsset);
335
357
  const depositAddressResponse = await this.swapSdk.requestDepositAddress({
336
358
  srcChain: srcChainId,
337
359
  destChain: destChainId,
@@ -26,7 +26,8 @@ const CHAIN_FLIP_MAINNET_EXPLORER = 'https://scan.chainflip.io';
26
26
  exports.CHAIN_FLIP_MAINNET_EXPLORER = CHAIN_FLIP_MAINNET_EXPLORER;
27
27
  const CHAIN_FLIP_SUPPORTED_MAINNET_MAPPING = {
28
28
  [_chainList.COMMON_CHAIN_SLUGS.POLKADOT]: _swap.Chains.Polkadot,
29
- [_chainList.COMMON_CHAIN_SLUGS.ETHEREUM]: _swap.Chains.Ethereum
29
+ [_chainList.COMMON_CHAIN_SLUGS.ETHEREUM]: _swap.Chains.Ethereum,
30
+ [_chainList.COMMON_CHAIN_SLUGS.ARBITRUM]: _swap.Chains.Arbitrum
30
31
  };
31
32
  exports.CHAIN_FLIP_SUPPORTED_MAINNET_MAPPING = CHAIN_FLIP_SUPPORTED_MAINNET_MAPPING;
32
33
  const CHAIN_FLIP_SUPPORTED_TESTNET_MAPPING = {
@@ -37,7 +38,8 @@ exports.CHAIN_FLIP_SUPPORTED_TESTNET_MAPPING = CHAIN_FLIP_SUPPORTED_TESTNET_MAPP
37
38
  const CHAIN_FLIP_SUPPORTED_MAINNET_ASSET_MAPPING = {
38
39
  [_chainList.COMMON_ASSETS.DOT]: _swap.Assets.DOT,
39
40
  [_chainList.COMMON_ASSETS.ETH]: _swap.Assets.ETH,
40
- [_chainList.COMMON_ASSETS.USDC_ETHEREUM]: _swap.Assets.USDC
41
+ [_chainList.COMMON_ASSETS.USDC_ETHEREUM]: _swap.Assets.USDC,
42
+ [_chainList.COMMON_ASSETS.USDT_ETHEREUM]: _swap.Assets.USDT
41
43
  };
42
44
  exports.CHAIN_FLIP_SUPPORTED_MAINNET_ASSET_MAPPING = CHAIN_FLIP_SUPPORTED_MAINNET_ASSET_MAPPING;
43
45
  const CHAIN_FLIP_SUPPORTED_TESTNET_ASSET_MAPPING = {
@@ -56,7 +58,7 @@ exports.SWAP_QUOTE_TIMEOUT_MAP = SWAP_QUOTE_TIMEOUT_MAP;
56
58
  const _PROVIDER_TO_SUPPORTED_PAIR_MAP = {
57
59
  [_swap2.SwapProviderId.HYDRADX_MAINNET]: [_chainList.COMMON_CHAIN_SLUGS.HYDRADX],
58
60
  [_swap2.SwapProviderId.HYDRADX_TESTNET]: [_chainList.COMMON_CHAIN_SLUGS.HYDRADX_TESTNET],
59
- [_swap2.SwapProviderId.CHAIN_FLIP_MAINNET]: [_chainList.COMMON_CHAIN_SLUGS.POLKADOT, _chainList.COMMON_CHAIN_SLUGS.ETHEREUM],
61
+ [_swap2.SwapProviderId.CHAIN_FLIP_MAINNET]: [_chainList.COMMON_CHAIN_SLUGS.POLKADOT, _chainList.COMMON_CHAIN_SLUGS.ETHEREUM, _chainList.COMMON_CHAIN_SLUGS.ARBITRUM],
60
62
  [_swap2.SwapProviderId.CHAIN_FLIP_TESTNET]: [_chainList.COMMON_CHAIN_SLUGS.CHAINFLIP_POLKADOT, _chainList.COMMON_CHAIN_SLUGS.ETHEREUM_SEPOLIA],
61
63
  [_swap2.SwapProviderId.POLKADOT_ASSET_HUB]: [_chainList.COMMON_CHAIN_SLUGS.POLKADOT_ASSET_HUB],
62
64
  [_swap2.SwapProviderId.KUSAMA_ASSET_HUB]: [_chainList.COMMON_CHAIN_SLUGS.KUSAMA_ASSET_HUB],
@@ -75,6 +75,13 @@ class TransactionService {
75
75
  chain,
76
76
  extrinsicType
77
77
  } = validationResponse;
78
+ const chainInfo = this.state.chainService.getChainInfoByKey(chain);
79
+ const {
80
+ blockedActionsMap,
81
+ blockedFeaturesList
82
+ } = await (0, _constants.fetchLastestBlockedActionsAndFeatures)();
83
+ (0, _transfer.checkSupportForFeature)(validationResponse, blockedFeaturesList, chainInfo);
84
+ (0, _transfer.checkSupportForAction)(validationResponse, blockedActionsMap);
78
85
  const transaction = transactionInput.transaction;
79
86
 
80
87
  // Check duplicated transaction
@@ -82,7 +89,6 @@ class TransactionService {
82
89
 
83
90
  // Check support for transaction
84
91
  (0, _transfer.checkSupportForTransaction)(validationResponse, transaction);
85
- const chainInfo = this.state.chainService.getChainInfoByKey(chain);
86
92
  if (!chainInfo) {
87
93
  validationResponse.errors.push(new _TransactionError.TransactionError(_KoniTypes.BasicTxErrorType.INTERNAL_ERROR, (0, _i18next.t)('Cannot find network')));
88
94
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.termAndCondition = exports.staticData = exports.marketingCampaigns = exports.currencySymbol = exports.crowdloanFunds = exports.buyTokenConfigs = exports.buyServiceInfos = exports.StaticKey = void 0;
6
+ exports.termAndCondition = exports.staticData = exports.marketingCampaigns = exports.currencySymbol = exports.crowdloanFunds = exports.buyTokenConfigs = exports.buyServiceInfos = exports.blockedActionsFeatures = exports.StaticKey = void 0;
7
7
  var _chainList = require("@subwallet/chain-list");
8
8
  // Copyright 2019-2022 @subwallet/extension-base authors & contributors
9
9
  // SPDX-License-Identifier: Apache-2.0
@@ -27,7 +27,10 @@ const termAndCondition = require('./termAndCondition.json');
27
27
  // eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-assignment
28
28
  exports.termAndCondition = termAndCondition;
29
29
  const currencySymbol = require('./currencySymbol.json');
30
+ // eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-assignment
30
31
  exports.currencySymbol = currencySymbol;
32
+ const blockedActionsFeatures = require('./blockedActionsFeatures.json');
33
+ exports.blockedActionsFeatures = blockedActionsFeatures;
31
34
  let StaticKey;
32
35
  exports.StaticKey = StaticKey;
33
36
  (function (StaticKey) {
@@ -38,6 +41,7 @@ exports.StaticKey = StaticKey;
38
41
  StaticKey["CROWDLOAN_FUNDS"] = "crowdloan-funds";
39
42
  StaticKey["TERM_AND_CONDITION"] = "term-and-condition";
40
43
  StaticKey["BUY_TOKEN_CONFIGS"] = "buy-token-configs";
44
+ StaticKey["BLOCKED_ACTIONS_FEATURES"] = "blocked-actions-features";
41
45
  })(StaticKey || (exports.StaticKey = StaticKey = {}));
42
46
  const staticData = {
43
47
  [StaticKey.CHAINS]: Object.values(_chainList.ChainInfoMap),
@@ -46,6 +50,7 @@ const staticData = {
46
50
  [StaticKey.CROWDLOAN_FUNDS]: crowdloanFunds,
47
51
  [StaticKey.MARKETING_CAMPAINGS]: marketingCampaigns,
48
52
  [StaticKey.TERM_AND_CONDITION]: termAndCondition.default,
49
- [StaticKey.BUY_TOKEN_CONFIGS]: buyTokenConfigs
53
+ [StaticKey.BUY_TOKEN_CONFIGS]: buyTokenConfigs,
54
+ [StaticKey.BLOCKED_ACTIONS_FEATURES]: blockedActionsFeatures
50
55
  };
51
56
  exports.staticData = staticData;
@@ -0,0 +1,7 @@
1
+ import { ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
2
+ interface BlockedActionsFeaturesMap {
3
+ blockedActionsMap: Record<ExtrinsicType, string[]>;
4
+ blockedFeaturesList: string[];
5
+ }
6
+ export declare const fetchLastestBlockedActionsAndFeatures: () => Promise<BlockedActionsFeaturesMap>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ // Copyright 2019-2022 @subwallet/extension-base authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { fetchStaticData } from '@subwallet/extension-base/utils';
5
+ const BLOCKED_ACTIONS_AND_FEATURES_PROMISE = fetchStaticData('blocked-actions-features');
6
+ export const fetchLastestBlockedActionsAndFeatures = async () => {
7
+ return await BLOCKED_ACTIONS_AND_FEATURES_PROMISE;
8
+ };
@@ -32,3 +32,4 @@ export declare const ORDINAL_METHODS: string[];
32
32
  export declare const PERMISSIONS_TO_REVOKE: string[];
33
33
  export * from './staking';
34
34
  export * from './storage';
35
+ export * from './blocked-actions-list';
@@ -34,4 +34,5 @@ export const ORDINAL_COLLECTION = '__Ordinal__';
34
34
  export const ORDINAL_METHODS = ['drc-20', 'pol-20'];
35
35
  export const PERMISSIONS_TO_REVOKE = ['eth_accounts'];
36
36
  export * from "./staking.js";
37
- export * from "./storage.js";
37
+ export * from "./storage.js";
38
+ export * from "./blocked-actions-list.js";
@@ -10,6 +10,8 @@ export declare function validateTransferRequest(tokenInfo: _ChainAsset, from: _A
10
10
  export declare function additionalValidateTransfer(tokenInfo: _ChainAsset, nativeTokenInfo: _ChainAsset, extrinsicType: ExtrinsicType, receiverTransferTokenFreeBalance: string, transferAmount: string, senderTransferTokenTransferable?: string, receiverNativeTransferable?: string): [TransactionWarning[], TransactionError[]];
11
11
  export declare function validateXcmTransferRequest(destTokenInfo: _ChainAsset | undefined, sender: _Address, sendingValue: string): [TransactionError[], KeyringPair | undefined, BigN | undefined];
12
12
  export declare function additionalValidateXcmTransfer(originTokenInfo: _ChainAsset, destinationTokenInfo: _ChainAsset, sendingAmount: string, senderTransferable: string, receiverNativeBalance: string, destChainInfo: _ChainInfo, isSnowBridge?: boolean): [TransactionWarning | undefined, TransactionError | undefined];
13
+ export declare function checkSupportForFeature(validationResponse: SWTransactionResponse, blockedFeaturesList: string[], chainInfo: _ChainInfo): void;
14
+ export declare function checkSupportForAction(validationResponse: SWTransactionResponse, blockedActionsMap: Record<ExtrinsicType, string[]>): void;
13
15
  export declare function checkSupportForTransaction(validationResponse: SWTransactionResponse, transaction: OptionalSWTransaction): void;
14
16
  export declare function estimateFeeForTransaction(validationResponse: SWTransactionResponse, transaction: OptionalSWTransaction, chainInfo: _ChainInfo, evmApi: _EvmApi): Promise<FeeData>;
15
17
  export declare function checkSigningAccountForTransaction(validationResponse: SWTransactionResponse): void;
@@ -138,6 +138,170 @@ export function additionalValidateXcmTransfer(originTokenInfo, destinationTokenI
138
138
  }
139
139
  return [warning, error];
140
140
  }
141
+ export function checkSupportForFeature(validationResponse, blockedFeaturesList, chainInfo) {
142
+ const extrinsicType = validationResponse.extrinsicType;
143
+ const chain = validationResponse.chain;
144
+ const currentFeature = `${extrinsicType}___${chain}`;
145
+ if (blockedFeaturesList.includes(currentFeature)) {
146
+ validationResponse.errors.push(new TransactionError(BasicTxErrorType.UNSUPPORTED, t(`Feature under maintenance on ${chainInfo.name} network. Try again later`)));
147
+ }
148
+ }
149
+ export function checkSupportForAction(validationResponse, blockedActionsMap) {
150
+ const extrinsicType = validationResponse.extrinsicType;
151
+ let currentAction = '';
152
+ switch (extrinsicType) {
153
+ case ExtrinsicType.TRANSFER_BALANCE:
154
+
155
+ // eslint-disable-next-line no-fallthrough
156
+ case ExtrinsicType.TRANSFER_TOKEN:
157
+ {
158
+ const data = validationResponse.data;
159
+ const tokenSlug = data.tokenSlug;
160
+ currentAction = `${extrinsicType}___${tokenSlug}`;
161
+ break;
162
+ }
163
+ case ExtrinsicType.TRANSFER_XCM:
164
+ {
165
+ const data = validationResponse.data;
166
+ const tokenSlug = data.tokenSlug;
167
+ const destinationNetworkKey = data.destinationNetworkKey;
168
+ currentAction = `${extrinsicType}___${tokenSlug}___${destinationNetworkKey}`;
169
+ break;
170
+ }
171
+ case ExtrinsicType.SEND_NFT:
172
+ {
173
+ const data = validationResponse.data;
174
+ const networkKey = data.networkKey;
175
+ const collectionId = data.nftItem.collectionId;
176
+ currentAction = `${extrinsicType}___${networkKey}___${collectionId}`;
177
+ break;
178
+ }
179
+ case ExtrinsicType.SWAP:
180
+ {
181
+ const data = validationResponse.data;
182
+ const pairSlug = data.quote.pair.slug;
183
+ const providerId = data.provider.id;
184
+ currentAction = `${extrinsicType}___${pairSlug}___${providerId}`;
185
+ break;
186
+ }
187
+ case ExtrinsicType.STAKING_BOND:
188
+ {
189
+ const data = validationResponse.data;
190
+ const chain = data.chain;
191
+ currentAction = `${extrinsicType}___${chain}`;
192
+ break;
193
+ }
194
+ case ExtrinsicType.STAKING_LEAVE_POOL:
195
+ {
196
+ const data = validationResponse.data;
197
+ const slug = data.slug;
198
+ currentAction = `${extrinsicType}___${slug}`;
199
+ break;
200
+ }
201
+ case ExtrinsicType.STAKING_UNBOND:
202
+ {
203
+ const data = validationResponse.data;
204
+ const chain = data.chain;
205
+ currentAction = `${extrinsicType}___${chain}`;
206
+ break;
207
+ }
208
+ case ExtrinsicType.STAKING_CLAIM_REWARD:
209
+ {
210
+ const data = validationResponse.data;
211
+ const slug = data.slug;
212
+ currentAction = `${extrinsicType}___${slug}`;
213
+ break;
214
+ }
215
+ case ExtrinsicType.STAKING_WITHDRAW:
216
+ {
217
+ const data = validationResponse.data;
218
+ const slug = data.slug;
219
+ currentAction = `${extrinsicType}___${slug}`;
220
+ break;
221
+ }
222
+ case ExtrinsicType.STAKING_COMPOUNDING:
223
+ {
224
+ const data = validationResponse.data;
225
+ const networkKey = data.networkKey;
226
+ currentAction = `${extrinsicType}___${networkKey}`;
227
+ break;
228
+ }
229
+ case ExtrinsicType.STAKING_CANCEL_COMPOUNDING:
230
+ {
231
+ const data = validationResponse.data;
232
+ const networkKey = data.networkKey;
233
+ currentAction = `${extrinsicType}___${networkKey}`;
234
+ break;
235
+ }
236
+ case ExtrinsicType.STAKING_CANCEL_UNSTAKE:
237
+ {
238
+ const data = validationResponse.data;
239
+ const slug = data.slug;
240
+ currentAction = `${extrinsicType}___${slug}`;
241
+ break;
242
+ }
243
+ case ExtrinsicType.JOIN_YIELD_POOL:
244
+ {
245
+ const data = validationResponse.data;
246
+ const slug = data.data.slug;
247
+ currentAction = `${extrinsicType}___${slug}`;
248
+ break;
249
+ }
250
+ case ExtrinsicType.MINT_VDOT:
251
+ case ExtrinsicType.MINT_LDOT:
252
+ case ExtrinsicType.MINT_SDOT:
253
+ case ExtrinsicType.MINT_QDOT:
254
+ case ExtrinsicType.MINT_STDOT:
255
+
256
+ // eslint-disable-next-line no-fallthrough
257
+ case ExtrinsicType.MINT_VMANTA:
258
+ {
259
+ const data = validationResponse.data;
260
+ const slug = data.slug;
261
+ currentAction = `${extrinsicType}___${slug}`;
262
+ break;
263
+ }
264
+ case ExtrinsicType.REDEEM_VDOT:
265
+ case ExtrinsicType.REDEEM_LDOT:
266
+ case ExtrinsicType.REDEEM_SDOT:
267
+ case ExtrinsicType.REDEEM_QDOT:
268
+ case ExtrinsicType.REDEEM_STDOT:
269
+
270
+ // eslint-disable-next-line no-fallthrough
271
+ case ExtrinsicType.REDEEM_VMANTA:
272
+ {
273
+ const data = validationResponse.data;
274
+ const slug = data.slug;
275
+ currentAction = `${extrinsicType}___${slug}`;
276
+ break;
277
+ }
278
+ case ExtrinsicType.UNSTAKE_VDOT:
279
+ case ExtrinsicType.UNSTAKE_LDOT:
280
+ case ExtrinsicType.UNSTAKE_SDOT:
281
+ case ExtrinsicType.UNSTAKE_QDOT:
282
+ case ExtrinsicType.UNSTAKE_STDOT:
283
+
284
+ // eslint-disable-next-line no-fallthrough
285
+ case ExtrinsicType.UNSTAKE_VMANTA:
286
+ {
287
+ const data = validationResponse.data;
288
+ const slug = data.slug;
289
+ currentAction = `${extrinsicType}___${slug}`;
290
+ break;
291
+ }
292
+ case ExtrinsicType.TOKEN_SPENDING_APPROVAL:
293
+ {
294
+ const data = validationResponse.data;
295
+ const chain = data.chain;
296
+ currentAction = `${extrinsicType}___${chain}`;
297
+ break;
298
+ }
299
+ }
300
+ const blockedActionsList = Object.values(blockedActionsMap).flat();
301
+ if (blockedActionsList.includes(currentAction)) {
302
+ validationResponse.errors.push(new TransactionError(BasicTxErrorType.UNSUPPORTED, t('Feature under maintenance. Try again later')));
303
+ }
304
+ }
141
305
 
142
306
  // general validations
143
307
  export function checkSupportForTransaction(validationResponse, transaction) {
@@ -34,7 +34,7 @@ import { isProposalExpired, isSupportWalletConnectChain, isSupportWalletConnectN
34
34
  import { SWStorage } from '@subwallet/extension-base/storage';
35
35
  import { AccountsStore } from '@subwallet/extension-base/stores';
36
36
  import { YieldPoolType } from '@subwallet/extension-base/types';
37
- import { BN_ZERO, convertSubjectInfoToAddresses, createTransactionFromRLP, isSameAddress, MODULE_SUPPORT, reformatAddress, signatureToHex, uniqueStringArray } from '@subwallet/extension-base/utils';
37
+ import { BN_ZERO, convertSubjectInfoToAddresses, createPromiseHandler, createTransactionFromRLP, isSameAddress, MODULE_SUPPORT, reformatAddress, signatureToHex, uniqueStringArray } from '@subwallet/extension-base/utils';
38
38
  import { parseContractInput, parseEvmRlp } from '@subwallet/extension-base/utils/eth/parseTransaction';
39
39
  import { metadataExpand } from '@subwallet/extension-chains';
40
40
  import { createPair } from '@subwallet/keyring';
@@ -1375,6 +1375,10 @@ export default class KoniExtension {
1375
1375
  withMasterPassword
1376
1376
  }) {
1377
1377
  const isPasswordValidated = this.validatePassword(file, password);
1378
+ const {
1379
+ promise,
1380
+ resolve
1381
+ } = createPromiseHandler();
1378
1382
  if (isPasswordValidated) {
1379
1383
  try {
1380
1384
  this._saveCurrentAccountAddress(address, () => {
@@ -1389,10 +1393,12 @@ export default class KoniExtension {
1389
1393
  });
1390
1394
  }
1391
1395
  this._addAddressToAuthList(address, isAllowed);
1396
+ resolve([address]);
1392
1397
  });
1393
1398
  if (this.#alwaysLock) {
1394
1399
  this.keyringLock();
1395
1400
  }
1401
+ return promise;
1396
1402
  } catch (error) {
1397
1403
  throw new Error(error.message);
1398
1404
  }
@@ -1408,17 +1414,35 @@ export default class KoniExtension {
1408
1414
  }) {
1409
1415
  const addressList = accountsInfo.map(acc => acc.address);
1410
1416
  const isPasswordValidated = this.validatedAccountsPassword(file, password);
1417
+ const {
1418
+ promise,
1419
+ resolve
1420
+ } = createPromiseHandler();
1411
1421
  if (isPasswordValidated) {
1412
1422
  try {
1413
1423
  this._saveCurrentAccountAddress(ALL_ACCOUNT_KEY, () => {
1414
1424
  keyring.restoreAccounts(file, password);
1415
1425
  this.#koniState.keyringService.removeNoneHardwareGenesisHash();
1416
- this._addAddressesToAuthList(addressList, isAllowed);
1426
+ const successAddressList = addressList.reduce((addressList, address) => {
1427
+ try {
1428
+ const account = keyring.getPair(address);
1429
+ if (account) {
1430
+ addressList.push(address);
1431
+ }
1432
+ } catch (error) {
1433
+ console.log(error);
1434
+ }
1435
+ return addressList;
1436
+ }, []);
1437
+ this._addAddressesToAuthList(successAddressList, isAllowed);
1438
+ resolve(successAddressList);
1417
1439
  });
1418
1440
 
1419
1441
  // if (this.#alwaysLock) {
1420
1442
  // this.keyringLock();
1421
1443
  // }
1444
+
1445
+ return promise;
1422
1446
  } catch (error) {
1423
1447
  throw new Error(error.message);
1424
1448
  }
@@ -2968,14 +2992,14 @@ export default class KoniExtension {
2968
2992
  } else {
2969
2993
  metadata = await this.#koniState.chainService.getMetadataByHash(payload.genesisHash);
2970
2994
  if (metadata) {
2971
- var _chainInfo$substrateI, _chainInfo$substrateI2, _chainInfo$substrateI3;
2995
+ var _chainInfo$substrateI, _chainInfo$substrateI2, _chainInfo$substrateI3, _chainInfo$substrateI4;
2972
2996
  registry = new TypeRegistry();
2973
2997
  const _metadata = new Metadata(registry, metadata.hexValue);
2974
2998
  registry.register(metadata.types);
2975
2999
  registry.setChainProperties(registry.createType('ChainProperties', {
2976
- ss58Format: (chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI = chainInfo.substrateInfo) === null || _chainInfo$substrateI === void 0 ? void 0 : _chainInfo$substrateI.addressPrefix) || 42,
2977
- tokenDecimals: chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI2 = chainInfo.substrateInfo) === null || _chainInfo$substrateI2 === void 0 ? void 0 : _chainInfo$substrateI2.decimals,
2978
- tokenSymbol: chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI3 = chainInfo.substrateInfo) === null || _chainInfo$substrateI3 === void 0 ? void 0 : _chainInfo$substrateI3.symbol
3000
+ ss58Format: (_chainInfo$substrateI = chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI2 = chainInfo.substrateInfo) === null || _chainInfo$substrateI2 === void 0 ? void 0 : _chainInfo$substrateI2.addressPrefix) !== null && _chainInfo$substrateI !== void 0 ? _chainInfo$substrateI : 42,
3001
+ tokenDecimals: chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI3 = chainInfo.substrateInfo) === null || _chainInfo$substrateI3 === void 0 ? void 0 : _chainInfo$substrateI3.decimals,
3002
+ tokenSymbol: chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI4 = chainInfo.substrateInfo) === null || _chainInfo$substrateI4 === void 0 ? void 0 : _chainInfo$substrateI4.symbol
2979
3003
  }));
2980
3004
  registry.setMetadata(_metadata, payload.signedExtensions, metadata.userExtensions);
2981
3005
  } else {
@@ -4301,9 +4325,9 @@ export default class KoniExtension {
4301
4325
  case 'pri(accounts.batchExportV2)':
4302
4326
  return this.batchExportV2(request);
4303
4327
  case 'pri(json.restoreV2)':
4304
- return this.jsonRestoreV2(request);
4328
+ return await this.jsonRestoreV2(request);
4305
4329
  case 'pri(json.batchRestoreV2)':
4306
- return this.batchRestoreV2(request);
4330
+ return await this.batchRestoreV2(request);
4307
4331
  case 'pri(nft.getNft)':
4308
4332
  return await this.getNft();
4309
4333
  case 'pri(nft.getSubscription)':
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "./cjs/detectPackage.js"
18
18
  ],
19
19
  "type": "module",
20
- "version": "1.2.30-0",
20
+ "version": "1.2.31-0",
21
21
  "main": "./cjs/index.js",
22
22
  "module": "./index.js",
23
23
  "types": "./index.d.ts",
@@ -114,6 +114,11 @@
114
114
  "require": "./cjs/constants/index.js",
115
115
  "default": "./constants/index.js"
116
116
  },
117
+ "./constants/blocked-actions-list": {
118
+ "types": "./constants/blocked-actions-list.d.ts",
119
+ "require": "./cjs/constants/blocked-actions-list.js",
120
+ "default": "./constants/blocked-actions-list.js"
121
+ },
117
122
  "./constants/i18n": {
118
123
  "types": "./constants/i18n.d.ts",
119
124
  "require": "./cjs/constants/i18n.js",
@@ -2016,6 +2021,7 @@
2016
2021
  "require": "./cjs/utils/staticData/index.js",
2017
2022
  "default": "./utils/staticData/index.js"
2018
2023
  },
2024
+ "./utils/staticData/blockedActionsFeatures.json": "./utils/staticData/blockedActionsFeatures.json",
2019
2025
  "./utils/staticData/buyServiceInfos.json": "./utils/staticData/buyServiceInfos.json",
2020
2026
  "./utils/staticData/buyTokenConfigs.json": "./utils/staticData/buyTokenConfigs.json",
2021
2027
  "./utils/staticData/chains.json": "./utils/staticData/chains.json",
@@ -2038,12 +2044,12 @@
2038
2044
  "@acala-network/api": "^5.0.2",
2039
2045
  "@apollo/client": "^3.7.14",
2040
2046
  "@azns/resolver-core": "^1.4.0",
2041
- "@chainflip/sdk": "^1.5.2",
2047
+ "@chainflip/sdk": "^1.6.0",
2042
2048
  "@equilab/api": "~1.14.25",
2043
2049
  "@ethereumjs/common": "^4.1.0",
2044
2050
  "@ethereumjs/tx": "^5.1.0",
2045
2051
  "@ethersproject/abi": "^5.7.0",
2046
- "@galacticcouncil/sdk": "^4.2.0",
2052
+ "@galacticcouncil/sdk": "^4.2.1",
2047
2053
  "@gear-js/api": "^0.38.1",
2048
2054
  "@json-rpc-tools/utils": "^1.7.6",
2049
2055
  "@metamask/eth-sig-util": "^7.0.3",
@@ -2070,13 +2076,13 @@
2070
2076
  "@reduxjs/toolkit": "^1.9.1",
2071
2077
  "@sora-substrate/type-definitions": "^1.17.7",
2072
2078
  "@substrate/connect": "^0.8.9",
2073
- "@subwallet/chain-list": "0.2.87",
2074
- "@subwallet/extension-base": "^1.2.30-0",
2075
- "@subwallet/extension-chains": "^1.2.30-0",
2076
- "@subwallet/extension-dapp": "^1.2.30-0",
2077
- "@subwallet/extension-inject": "^1.2.30-0",
2078
- "@subwallet/keyring": "^0.1.6",
2079
- "@subwallet/ui-keyring": "^0.1.6",
2079
+ "@subwallet/chain-list": "0.2.88",
2080
+ "@subwallet/extension-base": "^1.2.31-0",
2081
+ "@subwallet/extension-chains": "^1.2.31-0",
2082
+ "@subwallet/extension-dapp": "^1.2.31-0",
2083
+ "@subwallet/extension-inject": "^1.2.31-0",
2084
+ "@subwallet/keyring": "^0.1.7",
2085
+ "@subwallet/ui-keyring": "^0.1.7",
2080
2086
  "@walletconnect/keyvaluestorage": "^1.1.1",
2081
2087
  "@walletconnect/sign-client": "^2.14.0",
2082
2088
  "@walletconnect/types": "^2.14.0",
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.2.30-0'
10
+ version: '1.2.31-0'
11
11
  };
@@ -64,16 +64,16 @@ export default class StellaSwapLiquidStakingPoolHandler extends BaseLiquidStakin
64
64
  const tvlCall = stakingContract.methods.fundRaisedBalance();
65
65
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
66
66
  const exchangeRateCall = stakingContract.methods.getPooledTokenByShares(sampleTokenShare);
67
-
68
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
69
- const [aprObject, tvl, equivalentTokenShare] = await Promise.all([aprPromise,
70
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
71
- tvlCall.call(),
72
67
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
73
- exchangeRateCall.call()]);
68
+ const equivalentTokenShare = await exchangeRateCall.call();
74
69
  const rate = equivalentTokenShare;
75
70
  const exchangeRate = rate / 10 ** _getAssetDecimals(derivativeTokenInfo);
76
71
  this.updateExchangeRate(rate);
72
+
73
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
74
+ const [aprObject, tvl] = await Promise.all([aprPromise,
75
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
76
+ tvlCall.call()]);
77
77
  return {
78
78
  ...this.baseInfo,
79
79
  type: this.type,
@@ -1,3 +1,4 @@
1
+ import { Asset } from '@chainflip/sdk/swap';
1
2
  import { COMMON_ASSETS } from '@subwallet/chain-list';
2
3
  import { SwapError } from '@subwallet/extension-base/background/errors/SwapError';
3
4
  import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError';
@@ -18,8 +19,8 @@ export declare class ChainflipSwapHandler implements SwapBaseInterface {
18
19
  get providerInfo(): import("@subwallet/extension-base/types/swap").SwapProvider;
19
20
  get name(): string;
20
21
  get slug(): string;
21
- get assetMapping(): Record<string, import("@chainflip/sdk/dist/contracts-Cb-5VdIi").a>;
22
- get chainMapping(): Record<string, import("@chainflip/sdk/dist/contracts-Cb-5VdIi").C>;
22
+ get assetMapping(): Record<string, Asset>;
23
+ get chainMapping(): Record<string, import("@chainflip/sdk/dist/contracts-DmShvHR7").C>;
23
24
  get intermediaryAssetSlug(): COMMON_ASSETS.USDC_ETHEREUM | COMMON_ASSETS.USDC_SEPOLIA;
24
25
  validateSwapRequest(request: SwapRequest): Promise<SwapEarlyValidation>;
25
26
  private parseSwapPath;
@@ -9,7 +9,7 @@ import { BasicTxErrorType, ChainType, ExtrinsicType } from '@subwallet/extension
9
9
  import { _getChainflipEarlyValidationError } from '@subwallet/extension-base/core/logic-validation/swap';
10
10
  import { getERC20TransactionObject, getEVMTransactionObject } from '@subwallet/extension-base/services/balance-service/transfer/smart-contract';
11
11
  import { createTransferExtrinsic } from '@subwallet/extension-base/services/balance-service/transfer/token';
12
- import { _getAssetDecimals, _getChainNativeTokenSlug, _getContractAddressOfToken, _isNativeToken, _isSubstrateChain } from '@subwallet/extension-base/services/chain-service/utils';
12
+ import { _getAssetDecimals, _getAssetSymbol, _getChainNativeTokenSlug, _getContractAddressOfToken, _isNativeToken, _isSmartContractToken, _isSubstrateChain } from '@subwallet/extension-base/services/chain-service/utils';
13
13
  import { SwapBaseHandler } from '@subwallet/extension-base/services/swap-service/handler/base-handler';
14
14
  import { calculateSwapRate, CHAIN_FLIP_SUPPORTED_MAINNET_ASSET_MAPPING, CHAIN_FLIP_SUPPORTED_MAINNET_MAPPING, CHAIN_FLIP_SUPPORTED_TESTNET_ASSET_MAPPING, CHAIN_FLIP_SUPPORTED_TESTNET_MAPPING, getChainflipOptions, SWAP_QUOTE_TIMEOUT_MAP } from '@subwallet/extension-base/services/swap-service/utils';
15
15
  import { CommonStepType } from '@subwallet/extension-base/types/service-base';
@@ -90,11 +90,12 @@ export class ChainflipSwapHandler {
90
90
  const toAsset = this.chainService.getAssetBySlug(request.pair.to);
91
91
  const srcChain = fromAsset.originChain;
92
92
  const destChain = toAsset.originChain;
93
+ const isSwapCrossChain = srcChain !== destChain;
93
94
  const srcChainInfo = this.chainService.getChainInfoByKey(srcChain);
94
95
  const srcChainId = this.chainMapping[srcChain];
95
96
  const destChainId = this.chainMapping[destChain];
96
- const fromAssetId = this.assetMapping[fromAsset.slug];
97
- const toAssetId = this.assetMapping[toAsset.slug];
97
+ const fromAssetId = _getAssetSymbol(fromAsset);
98
+ const toAssetId = _getAssetSymbol(toAsset);
98
99
  if (!srcChainId || !destChainId || !fromAssetId || !toAssetId) {
99
100
  return {
100
101
  error: SwapErrorType.ASSET_NOT_SUPPORTED
@@ -102,9 +103,21 @@ export class ChainflipSwapHandler {
102
103
  }
103
104
  const [supportedDestChains, srcAssets, destAssets] = await Promise.all([this.swapSdk.getChains(srcChainId), this.swapSdk.getAssets(srcChainId), this.swapSdk.getAssets(destChainId)]);
104
105
  const supportedDestChainId = supportedDestChains.find(c => c.chain === destChainId);
105
- const srcAssetData = srcAssets.find(a => a.asset === fromAssetId);
106
- const destAssetData = destAssets.find(a => a.asset === toAssetId);
107
- if (!destAssetData || !srcAssetData || !supportedDestChainId) {
106
+ const srcAssetData = srcAssets.find(a => {
107
+ if (_isSmartContractToken(fromAsset)) {
108
+ var _a$contractAddress;
109
+ return (a === null || a === void 0 ? void 0 : (_a$contractAddress = a.contractAddress) === null || _a$contractAddress === void 0 ? void 0 : _a$contractAddress.toLowerCase()) === _getContractAddressOfToken(fromAsset).toLowerCase() && a.asset === fromAssetId;
110
+ }
111
+ return a.asset === fromAssetId;
112
+ });
113
+ const destAssetData = destAssets.find(a => {
114
+ if (_isSmartContractToken(toAsset)) {
115
+ var _a$contractAddress2;
116
+ return (a === null || a === void 0 ? void 0 : (_a$contractAddress2 = a.contractAddress) === null || _a$contractAddress2 === void 0 ? void 0 : _a$contractAddress2.toLowerCase()) === _getContractAddressOfToken(toAsset).toLowerCase() && a.asset === toAssetId;
117
+ }
118
+ return a.asset === toAssetId;
119
+ });
120
+ if (!destAssetData || !srcAssetData || isSwapCrossChain && !supportedDestChainId) {
108
121
  return {
109
122
  error: SwapErrorType.UNKNOWN
110
123
  };
@@ -200,8 +213,8 @@ export class ChainflipSwapHandler {
200
213
  }
201
214
  const srcChainId = this.chainMapping[fromAsset.originChain];
202
215
  const destChainId = this.chainMapping[toAsset.originChain];
203
- const fromAssetId = this.assetMapping[fromAsset.slug];
204
- const toAssetId = this.assetMapping[toAsset.slug];
216
+ const fromAssetId = _getAssetSymbol(fromAsset);
217
+ const toAssetId = _getAssetSymbol(toAsset);
205
218
  try {
206
219
  var _metadata$maxSwap;
207
220
  const quoteResponse = await this.swapSdk.getQuote({
@@ -215,13 +228,22 @@ export class ChainflipSwapHandler {
215
228
  quoteResponse.quote.includedFees.forEach(fee => {
216
229
  switch (fee.type) {
217
230
  case ChainflipFeeType.INGRESS:
231
+ {
232
+ console.log('ingress', fee);
233
+ feeComponent.push({
234
+ tokenSlug: fromAsset.slug,
235
+ amount: fee.amount,
236
+ feeType: SwapFeeType.NETWORK_FEE
237
+ });
238
+ break;
239
+ }
218
240
 
219
241
  // eslint-disable-next-line no-fallthrough
220
242
  case ChainflipFeeType.EGRESS:
221
243
  {
222
- const tokenSlug = Object.keys(this.assetMapping).find(assetSlug => this.assetMapping[assetSlug] === fee.asset);
244
+ console.log('egress', fee);
223
245
  feeComponent.push({
224
- tokenSlug,
246
+ tokenSlug: toAsset.slug,
225
247
  amount: fee.amount,
226
248
  feeType: SwapFeeType.NETWORK_FEE
227
249
  });
@@ -235,9 +257,9 @@ export class ChainflipSwapHandler {
235
257
  // eslint-disable-next-line no-fallthrough
236
258
  case ChainflipFeeType.BROKER:
237
259
  {
238
- const tokenSlug = Object.keys(this.assetMapping).find(assetSlug => this.assetMapping[assetSlug] === fee.asset);
260
+ console.log('broker fee', fee);
239
261
  feeComponent.push({
240
- tokenSlug,
262
+ tokenSlug: this.intermediaryAssetSlug,
241
263
  amount: fee.amount,
242
264
  feeType: SwapFeeType.PLATFORM_FEE
243
265
  });
@@ -322,8 +344,8 @@ export class ChainflipSwapHandler {
322
344
  const receiver = recipient !== null && recipient !== void 0 ? recipient : address;
323
345
  const srcChainId = this.chainMapping[fromAsset.originChain];
324
346
  const destChainId = this.chainMapping[toAsset.originChain];
325
- const fromAssetId = this.assetMapping[fromAsset.slug];
326
- const toAssetId = this.assetMapping[toAsset.slug];
347
+ const fromAssetId = _getAssetSymbol(fromAsset);
348
+ const toAssetId = _getAssetSymbol(toAsset);
327
349
  const depositAddressResponse = await this.swapSdk.requestDepositAddress({
328
350
  srcChain: srcChainId,
329
351
  destChain: destChainId,
@@ -11,7 +11,8 @@ export const CHAIN_FLIP_TESTNET_EXPLORER = 'https://blocks-perseverance.chainfli
11
11
  export const CHAIN_FLIP_MAINNET_EXPLORER = 'https://scan.chainflip.io';
12
12
  export const CHAIN_FLIP_SUPPORTED_MAINNET_MAPPING = {
13
13
  [COMMON_CHAIN_SLUGS.POLKADOT]: Chains.Polkadot,
14
- [COMMON_CHAIN_SLUGS.ETHEREUM]: Chains.Ethereum
14
+ [COMMON_CHAIN_SLUGS.ETHEREUM]: Chains.Ethereum,
15
+ [COMMON_CHAIN_SLUGS.ARBITRUM]: Chains.Arbitrum
15
16
  };
16
17
  export const CHAIN_FLIP_SUPPORTED_TESTNET_MAPPING = {
17
18
  [COMMON_CHAIN_SLUGS.ETHEREUM_SEPOLIA]: Chains.Ethereum,
@@ -20,7 +21,8 @@ export const CHAIN_FLIP_SUPPORTED_TESTNET_MAPPING = {
20
21
  export const CHAIN_FLIP_SUPPORTED_MAINNET_ASSET_MAPPING = {
21
22
  [COMMON_ASSETS.DOT]: Assets.DOT,
22
23
  [COMMON_ASSETS.ETH]: Assets.ETH,
23
- [COMMON_ASSETS.USDC_ETHEREUM]: Assets.USDC
24
+ [COMMON_ASSETS.USDC_ETHEREUM]: Assets.USDC,
25
+ [COMMON_ASSETS.USDT_ETHEREUM]: Assets.USDT
24
26
  };
25
27
  export const CHAIN_FLIP_SUPPORTED_TESTNET_ASSET_MAPPING = {
26
28
  [COMMON_ASSETS.PDOT]: Assets.DOT,
@@ -36,7 +38,7 @@ export const SWAP_QUOTE_TIMEOUT_MAP = {
36
38
  export const _PROVIDER_TO_SUPPORTED_PAIR_MAP = {
37
39
  [SwapProviderId.HYDRADX_MAINNET]: [COMMON_CHAIN_SLUGS.HYDRADX],
38
40
  [SwapProviderId.HYDRADX_TESTNET]: [COMMON_CHAIN_SLUGS.HYDRADX_TESTNET],
39
- [SwapProviderId.CHAIN_FLIP_MAINNET]: [COMMON_CHAIN_SLUGS.POLKADOT, COMMON_CHAIN_SLUGS.ETHEREUM],
41
+ [SwapProviderId.CHAIN_FLIP_MAINNET]: [COMMON_CHAIN_SLUGS.POLKADOT, COMMON_CHAIN_SLUGS.ETHEREUM, COMMON_CHAIN_SLUGS.ARBITRUM],
40
42
  [SwapProviderId.CHAIN_FLIP_TESTNET]: [COMMON_CHAIN_SLUGS.CHAINFLIP_POLKADOT, COMMON_CHAIN_SLUGS.ETHEREUM_SEPOLIA],
41
43
  [SwapProviderId.POLKADOT_ASSET_HUB]: [COMMON_CHAIN_SLUGS.POLKADOT_ASSET_HUB],
42
44
  [SwapProviderId.KUSAMA_ASSET_HUB]: [COMMON_CHAIN_SLUGS.KUSAMA_ASSET_HUB],
@@ -4,8 +4,8 @@
4
4
  import { EvmProviderError } from '@subwallet/extension-base/background/errors/EvmProviderError';
5
5
  import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError';
6
6
  import { BasicTxErrorType, ChainType, EvmProviderErrorType, ExtrinsicStatus, ExtrinsicType, NotificationType, TransactionDirection } from '@subwallet/extension-base/background/KoniTypes';
7
- import { ALL_ACCOUNT_KEY } from '@subwallet/extension-base/constants';
8
- import { checkBalanceWithTransactionFee, checkSigningAccountForTransaction, checkSupportForTransaction, estimateFeeForTransaction } from '@subwallet/extension-base/core/logic-validation/transfer';
7
+ import { ALL_ACCOUNT_KEY, fetchLastestBlockedActionsAndFeatures } from '@subwallet/extension-base/constants';
8
+ import { checkBalanceWithTransactionFee, checkSigningAccountForTransaction, checkSupportForAction, checkSupportForFeature, checkSupportForTransaction, estimateFeeForTransaction } from '@subwallet/extension-base/core/logic-validation/transfer';
9
9
  import { _getAssetDecimals, _getAssetSymbol, _getChainNativeTokenBasicInfo, _getEvmChainId, _isChainEvmCompatible } from '@subwallet/extension-base/services/chain-service/utils';
10
10
  import { EXTENSION_REQUEST_URL } from '@subwallet/extension-base/services/request-service/constants';
11
11
  import { TRANSACTION_TIMEOUT } from '@subwallet/extension-base/services/transaction-service/constants';
@@ -68,6 +68,13 @@ export default class TransactionService {
68
68
  chain,
69
69
  extrinsicType
70
70
  } = validationResponse;
71
+ const chainInfo = this.state.chainService.getChainInfoByKey(chain);
72
+ const {
73
+ blockedActionsMap,
74
+ blockedFeaturesList
75
+ } = await fetchLastestBlockedActionsAndFeatures();
76
+ checkSupportForFeature(validationResponse, blockedFeaturesList, chainInfo);
77
+ checkSupportForAction(validationResponse, blockedActionsMap);
71
78
  const transaction = transactionInput.transaction;
72
79
 
73
80
  // Check duplicated transaction
@@ -75,7 +82,6 @@ export default class TransactionService {
75
82
 
76
83
  // Check support for transaction
77
84
  checkSupportForTransaction(validationResponse, transaction);
78
- const chainInfo = this.state.chainService.getChainInfoByKey(chain);
79
85
  if (!chainInfo) {
80
86
  validationResponse.errors.push(new TransactionError(BasicTxErrorType.INTERNAL_ERROR, t('Cannot find network')));
81
87
  }
@@ -0,0 +1,39 @@
1
+ {
2
+ "blockedFeaturesList": [],
3
+ "blockedActionsMap": {
4
+ "transfer.balance": [],
5
+ "transfer.token": [],
6
+ "transfer.xcm": [],
7
+ "send_nft": [],
8
+ "swap": [],
9
+ "staking.join_pool": [],
10
+ "staking.leave_pool": [],
11
+ "staking.bond": [],
12
+ "staking.unbond": [],
13
+ "staking.claim_reward": [],
14
+ "staking.withdraw": [],
15
+ "staking.compounding": [],
16
+ "staking.cancel_compounding": [],
17
+ "staking.cancel_unstake": [],
18
+ "earn.join_pool": [],
19
+ "earn.mint_vdot": [],
20
+ "earn.mint_ldot": [],
21
+ "earn.mint_sdot": [],
22
+ "earn.mint_qdot": [],
23
+ "earn.mint_stdot": [],
24
+ "earn.mint_vmanta": [],
25
+ "earn.redeem_qdot": [],
26
+ "earn.redeem_vdot": [],
27
+ "earn.redeem_ldot": [],
28
+ "earn.redeem_sdot": [],
29
+ "earn.redeem_stdot": [],
30
+ "earn.redeem_vmanta": [],
31
+ "earn.unstake_qdot": [],
32
+ "earn.unstake_vdot": [],
33
+ "earn.unstake_ldot": [],
34
+ "earn.unstake_sdot": [],
35
+ "earn.unstake_stdot": [],
36
+ "earn.unstake_vmanta": [],
37
+ "token.spending_approval": []
38
+ }
39
+ }
@@ -4,6 +4,7 @@ export declare const crowdloanFunds: Record<string, unknown>[];
4
4
  export declare const marketingCampaigns: Record<string, unknown>;
5
5
  export declare const termAndCondition: Record<string, unknown>;
6
6
  export declare const currencySymbol: Record<string, unknown>;
7
+ export declare const blockedActionsFeatures: Record<string, unknown>;
7
8
  export declare enum StaticKey {
8
9
  BUY_SERVICE_INFOS = "buy-service-infos",
9
10
  CHAINS = "chains",
@@ -11,7 +12,8 @@ export declare enum StaticKey {
11
12
  MARKETING_CAMPAINGS = "marketing-campaigns",
12
13
  CROWDLOAN_FUNDS = "crowdloan-funds",
13
14
  TERM_AND_CONDITION = "term-and-condition",
14
- BUY_TOKEN_CONFIGS = "buy-token-configs"
15
+ BUY_TOKEN_CONFIGS = "buy-token-configs",
16
+ BLOCKED_ACTIONS_FEATURES = "blocked-actions-features"
15
17
  }
16
18
  export declare const staticData: {
17
19
  chains: import("@subwallet/chain-list/types")._ChainInfo[];
@@ -21,4 +23,5 @@ export declare const staticData: {
21
23
  "marketing-campaigns": Record<string, unknown>;
22
24
  "term-and-condition": unknown;
23
25
  "buy-token-configs": Record<string, unknown>[];
26
+ "blocked-actions-features": Record<string, unknown>;
24
27
  };
@@ -16,6 +16,8 @@ export const marketingCampaigns = require("./marketingCampaigns.json");
16
16
  export const termAndCondition = require("./termAndCondition.json");
17
17
  // eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-assignment
18
18
  export const currencySymbol = require("./currencySymbol.json");
19
+ // eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-assignment
20
+ export const blockedActionsFeatures = require("./blockedActionsFeatures.json");
19
21
  export let StaticKey;
20
22
  (function (StaticKey) {
21
23
  StaticKey["BUY_SERVICE_INFOS"] = "buy-service-infos";
@@ -25,6 +27,7 @@ export let StaticKey;
25
27
  StaticKey["CROWDLOAN_FUNDS"] = "crowdloan-funds";
26
28
  StaticKey["TERM_AND_CONDITION"] = "term-and-condition";
27
29
  StaticKey["BUY_TOKEN_CONFIGS"] = "buy-token-configs";
30
+ StaticKey["BLOCKED_ACTIONS_FEATURES"] = "blocked-actions-features";
28
31
  })(StaticKey || (StaticKey = {}));
29
32
  export const staticData = {
30
33
  [StaticKey.CHAINS]: Object.values(ChainInfoMap),
@@ -33,5 +36,6 @@ export const staticData = {
33
36
  [StaticKey.CROWDLOAN_FUNDS]: crowdloanFunds,
34
37
  [StaticKey.MARKETING_CAMPAINGS]: marketingCampaigns,
35
38
  [StaticKey.TERM_AND_CONDITION]: termAndCondition.default,
36
- [StaticKey.BUY_TOKEN_CONFIGS]: buyTokenConfigs
39
+ [StaticKey.BUY_TOKEN_CONFIGS]: buyTokenConfigs,
40
+ [StaticKey.BLOCKED_ACTIONS_FEATURES]: blockedActionsFeatures
37
41
  };