@subwallet/extension-base 1.1.21-3 → 1.1.23-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.
Files changed (59) hide show
  1. package/background/KoniTypes.d.ts +10 -1
  2. package/cjs/koni/api/dotsama/balance.js +51 -1
  3. package/cjs/koni/api/dotsama/crowdloan.js +29 -3
  4. package/cjs/koni/api/dotsama/transfer.js +10 -3
  5. package/cjs/koni/api/staking/bonding/astar.js +9 -5
  6. package/cjs/koni/api/staking/bonding/relayChain.js +2 -2
  7. package/cjs/koni/api/xcm/index.js +6 -1
  8. package/cjs/koni/api/xcm/polkadotXcm.js +1 -3
  9. package/cjs/koni/api/xcm/xTokens.js +1 -1
  10. package/cjs/koni/background/handlers/Extension.js +117 -99
  11. package/cjs/koni/background/handlers/State.js +12 -6
  12. package/cjs/koni/background/subscription.js +1 -1
  13. package/cjs/packageInfo.js +1 -1
  14. package/cjs/services/chain-service/constants.js +8 -4
  15. package/cjs/services/chain-service/handler/SubstrateApi.js +9 -0
  16. package/cjs/services/chain-service/handler/chain-spec/goldberg.js +123 -0
  17. package/cjs/services/chain-service/index.js +18 -0
  18. package/cjs/services/history-service/helpers/subscan-extrinsic-parser-helper.js +53 -0
  19. package/cjs/services/history-service/index.js +78 -21
  20. package/cjs/services/history-service/subscan-history.js +107 -0
  21. package/cjs/services/subscan-service/index.js +109 -4
  22. package/cjs/services/subscan-service/subscan-chain-map.js +82 -8
  23. package/cjs/utils/index.js +10 -1
  24. package/koni/api/dotsama/balance.js +51 -1
  25. package/koni/api/dotsama/crowdloan.d.ts +2 -2
  26. package/koni/api/dotsama/crowdloan.js +29 -2
  27. package/koni/api/dotsama/transfer.js +10 -3
  28. package/koni/api/staking/bonding/astar.js +9 -5
  29. package/koni/api/staking/bonding/relayChain.js +2 -2
  30. package/koni/api/xcm/index.js +6 -1
  31. package/koni/api/xcm/polkadotXcm.js +2 -4
  32. package/koni/api/xcm/xTokens.js +1 -1
  33. package/koni/background/handlers/Extension.d.ts +1 -0
  34. package/koni/background/handlers/Extension.js +20 -3
  35. package/koni/background/handlers/State.d.ts +1 -0
  36. package/koni/background/handlers/State.js +13 -7
  37. package/koni/background/subscription.js +1 -1
  38. package/package.json +21 -6
  39. package/packageInfo.js +1 -1
  40. package/services/chain-service/constants.d.ts +3 -0
  41. package/services/chain-service/constants.js +8 -5
  42. package/services/chain-service/handler/SubstrateApi.js +8 -0
  43. package/services/chain-service/handler/chain-spec/goldberg.d.ts +115 -0
  44. package/services/chain-service/handler/chain-spec/goldberg.js +116 -0
  45. package/services/chain-service/index.d.ts +1 -0
  46. package/services/chain-service/index.js +18 -0
  47. package/services/history-service/helpers/subscan-extrinsic-parser-helper.d.ts +6 -0
  48. package/services/history-service/helpers/subscan-extrinsic-parser-helper.js +44 -0
  49. package/services/history-service/index.d.ts +10 -6
  50. package/services/history-service/index.js +79 -22
  51. package/services/history-service/subscan-history.d.ts +5 -0
  52. package/services/history-service/subscan-history.js +100 -0
  53. package/services/subscan-service/index.d.ts +10 -2
  54. package/services/subscan-service/index.js +105 -4
  55. package/services/subscan-service/subscan-chain-map.d.ts +9 -3
  56. package/services/subscan-service/subscan-chain-map.js +78 -5
  57. package/services/subscan-service/types.d.ts +146 -0
  58. package/utils/index.d.ts +1 -0
  59. package/utils/index.js +7 -0
@@ -450,7 +450,7 @@ export interface NFTTransactionAdditionalInfo {
450
450
  }
451
451
  export declare type TransactionAdditionalInfo<T extends ExtrinsicType> = T extends ExtrinsicType.TRANSFER_XCM ? XCMTransactionAdditionalInfo : T extends ExtrinsicType.SEND_NFT ? NFTTransactionAdditionalInfo : undefined;
452
452
  export interface TransactionHistoryItem<ET extends ExtrinsicType = ExtrinsicType.TRANSFER_BALANCE> {
453
- origin?: 'app' | 'migration' | 'subsquid';
453
+ origin?: 'app' | 'migration' | 'subsquid' | 'subscan';
454
454
  callhash?: string;
455
455
  signature?: string;
456
456
  chain: string;
@@ -1603,6 +1603,14 @@ export declare type CampaignData = CampaignBanner | CampaignNotification;
1603
1603
  export interface RequestCampaignBannerComplete {
1604
1604
  slug: string;
1605
1605
  }
1606
+ export interface RequestSubscribeHistory {
1607
+ address: string;
1608
+ chain: string;
1609
+ }
1610
+ export interface ResponseSubscribeHistory {
1611
+ id: string;
1612
+ items: TransactionHistoryItem[];
1613
+ }
1606
1614
  export interface KoniRequestSignatures {
1607
1615
  'pri(staking.submitTuringCancelCompound)': [RequestTuringCancelStakeCompound, SWTransactionResponse];
1608
1616
  'pri(staking.submitTuringCompound)': [RequestTuringStakeCompound, SWTransactionResponse];
@@ -1716,6 +1724,7 @@ export interface KoniRequestSignatures {
1716
1724
  'pri(settings.saveShowZeroBalance)': [RequestChangeShowZeroBalance, boolean];
1717
1725
  'pri(settings.saveShowBalance)': [RequestChangeShowBalance, boolean];
1718
1726
  'pri(transaction.history.getSubscription)': [null, TransactionHistoryItem[], TransactionHistoryItem[]];
1727
+ 'pri(transaction.history.subscribe)': [RequestSubscribeHistory, ResponseSubscribeHistory, TransactionHistoryItem[]];
1719
1728
  'pri(transfer.checkReferenceCount)': [RequestTransferCheckReferenceCount, boolean];
1720
1729
  'pri(transfer.checkSupporting)': [RequestTransferCheckSupporting, SupportTransferResponse];
1721
1730
  'pri(transfer.getExistentialDeposit)': [RequestTransferExistentialDeposit, string];
@@ -79,6 +79,8 @@ async function subscribeSubstrateBalance(addresses, chainInfo, chain, networkAPI
79
79
  unsubLocalToken = await subscribeEqBalanceAccountPallet(addresses, chain, networkAPI.api, callBack, true);
80
80
  } else if (_constants2._BALANCE_CHAIN_GROUP.equilibrium_parachain.includes(chain)) {
81
81
  unsubLocalToken = await subscribeEquilibriumTokenBalance(addresses, chain, networkAPI.api, callBack, true);
82
+ } else if (_constants2._BALANCE_CHAIN_GROUP.centrifuge.includes(chain)) {
83
+ unsubLocalToken = await subscribeOrmlTokensPallet(addresses, chain, networkAPI.api, callBack);
82
84
  }
83
85
  if ((0, _utils2._isChainEvmCompatible)(chainInfo)) {
84
86
  unsubEvmContractToken = subscribeERC20Interval(addresses, chain, evmApiMap, callBack);
@@ -105,7 +107,8 @@ async function subscribeWithSystemAccountPallet(addresses, chainInfo, networkAPI
105
107
  let [total, reserved, miscFrozen, feeFrozen] = [new _util.BN(0), new _util.BN(0), new _util.BN(0), new _util.BN(0)];
106
108
  let pooledStakingBalance = _util.BN_ZERO;
107
109
  if ((0, _utils2._isSubstrateRelayChain)(chainInfo) && networkAPI.query.nominationPools) {
108
- const poolMemberDatas = await networkAPI.query.nominationPools.poolMembers.multi(addresses);
110
+ var _networkAPI$query$nom;
111
+ const poolMemberDatas = await ((_networkAPI$query$nom = networkAPI.query.nominationPools.poolMembers) === null || _networkAPI$query$nom === void 0 ? void 0 : _networkAPI$query$nom.multi(addresses));
109
112
  if (poolMemberDatas) {
110
113
  for (const _poolMemberData of poolMemberDatas) {
111
114
  const poolMemberData = _poolMemberData.toPrimitive();
@@ -292,6 +295,53 @@ async function subscribeEqBalanceAccountPallet(addresses, chain, api, callBack,
292
295
  });
293
296
  };
294
297
  }
298
+
299
+ // eslint-disable-next-line @typescript-eslint/require-await
300
+ async function subscribeOrmlTokensPallet(addresses, chain, api, callBack) {
301
+ const tokenTypes = [_types._AssetType.LOCAL];
302
+ const tokenMap = _handlers.state.getAssetByChainAndAsset(chain, tokenTypes);
303
+ const unsubList = Object.values(tokenMap).map(async tokenInfo => {
304
+ try {
305
+ const onChainInfo = (0, _utils2._getTokenOnChainInfo)(tokenInfo);
306
+
307
+ // Get Token Balance
308
+ // @ts-ignore
309
+ const unsub = await api.query.ormlTokens.accounts.multi(addresses.map(address => [address, onChainInfo]), balances => {
310
+ const tokenBalance = {
311
+ reserved: (0, _utils3.sumBN)(balances.map(b => b.reserved || new _util.BN(0))),
312
+ frozen: (0, _utils3.sumBN)(balances.map(b => b.frozen || new _util.BN(0))),
313
+ free: (0, _utils3.sumBN)(balances.map(b => b.free || new _util.BN(0))) // free is actually total balance
314
+ };
315
+
316
+ // free balance = total balance - frozen misc
317
+ // locked balance = reserved + frozen misc
318
+ const freeBalance = tokenBalance.free.sub(tokenBalance.frozen);
319
+ const lockedBalance = tokenBalance.frozen.add(tokenBalance.reserved);
320
+ callBack({
321
+ tokenSlug: tokenInfo.slug,
322
+ state: _KoniTypes.APIItemState.READY,
323
+ free: freeBalance.toString(),
324
+ locked: lockedBalance.toString(),
325
+ substrateInfo: {
326
+ reserved: tokenBalance.reserved.toString(),
327
+ miscFrozen: tokenBalance.frozen.toString()
328
+ }
329
+ });
330
+ });
331
+ return unsub;
332
+ } catch (err) {
333
+ console.warn(err);
334
+ return undefined;
335
+ }
336
+ });
337
+ return () => {
338
+ unsubList.forEach(subProm => {
339
+ subProm.then(unsub => {
340
+ unsub && unsub();
341
+ }).catch(console.error);
342
+ });
343
+ };
344
+ }
295
345
  async function subscribeTokensAccountsPallet(addresses, chain, api, callBack, includeNativeToken) {
296
346
  const tokenTypes = includeNativeToken ? [_types._AssetType.NATIVE, _types._AssetType.LOCAL] : [_types._AssetType.LOCAL];
297
347
  const tokenMap = _handlers.state.getAssetByChainAndAsset(chain, tokenTypes);
@@ -24,7 +24,20 @@ const STATUS_MAP = {
24
24
  [_types._FundStatus.FAILED]: _KoniTypes.CrowdloanParaState.FAILED,
25
25
  [_types._FundStatus.WON]: _KoniTypes.CrowdloanParaState.COMPLETED
26
26
  };
27
+ function getChainInfoMap(chainInfoList) {
28
+ const result = {};
29
+ chainInfoList.forEach(ci => {
30
+ if (ci.slug) {
31
+ result[ci.slug] = ci;
32
+ }
33
+ });
34
+ return result;
35
+ }
27
36
  const getOnlineFundList = (0, _fetchStaticData.fetchStaticData)('crowdloan-funds');
37
+ const getOnlineChainInfoMap = (async () => {
38
+ const chainInfoList = await (0, _fetchStaticData.fetchStaticData)('chains');
39
+ return getChainInfoMap(chainInfoList);
40
+ })();
28
41
  function getRPCCrowdloan(parentAPI, fundInfo, hexAddresses, callback) {
29
42
  const {
30
43
  auctionIndex,
@@ -130,16 +143,29 @@ const subscribeAcalaContributeInterval = (polkadotAddresses, fundInfo, callback)
130
143
  // return stateMap;
131
144
  // }, {} as Record<string, CrowdloanParaState>);
132
145
  // }
146
+ exports.subscribeAcalaContributeInterval = subscribeAcalaContributeInterval;
147
+ function isNeedToUpdateLatestFundInfoMap(latestMap, chainSlug, fundInfo) {
148
+ if (!latestMap[chainSlug]) {
149
+ return true;
150
+ }
151
+ if (!fundInfo.auctionIndex && fundInfo.status === _types._FundStatus.IN_AUCTION) {
152
+ return true;
153
+ }
154
+ if (fundInfo.auctionIndex > latestMap[chainSlug].auctionIndex) {
155
+ return true;
156
+ }
157
+ return false;
158
+ }
133
159
 
134
160
  // Get All crowdloan
135
- exports.subscribeAcalaContributeInterval = subscribeAcalaContributeInterval;
136
- async function subscribeCrowdloan(addresses, substrateApiMap, callback, chainInfoMap) {
161
+ async function subscribeCrowdloan(addresses, substrateApiMap, callback) {
137
162
  const unsubMap = {};
138
163
  const latestMap = {};
139
164
  const rawFundList = await getOnlineFundList;
165
+ const chainInfoMap = await getOnlineChainInfoMap;
140
166
  rawFundList.forEach(fundInfo => {
141
167
  const chainSlug = fundInfo.chain;
142
- if (!latestMap[chainSlug] || fundInfo.auctionIndex > latestMap[chainSlug].auctionIndex) {
168
+ if (isNeedToUpdateLatestFundInfoMap(latestMap, chainSlug, fundInfo)) {
143
169
  latestMap[chainSlug] = fundInfo;
144
170
  }
145
171
  });
@@ -105,8 +105,11 @@ async function checkSupportTransfer(networkKey, tokenInfo, substrateApiMap, chai
105
105
  // result.supportTransfer = true;
106
106
  // result.supportTransferAll = true;
107
107
  } else if (_constants._TRANSFER_CHAIN_GROUP.avail.includes(networkKey)) {
108
- result.supportTransfer = false;
109
- result.supportTransferAll = false;
108
+ result.supportTransfer = true;
109
+ result.supportTransferAll = true;
110
+ } else if (_constants._TRANSFER_CHAIN_GROUP.centrifuge.includes(networkKey)) {
111
+ result.supportTransfer = true;
112
+ result.supportTransferAll = true;
110
113
  }
111
114
  return result;
112
115
  }
@@ -190,7 +193,11 @@ const createTransferExtrinsic = async _ref => {
190
193
  if (transferAll) {
191
194
  transfer = api.tx.balances.transferAll(to, false);
192
195
  } else if (value) {
193
- transfer = api.tx.balances.transferKeepAlive(to, new _util.BN(value));
196
+ if (api.tx.balances.transferKeepAlive) {
197
+ transfer = api.tx.balances.transferKeepAlive(to, new _util.BN(value));
198
+ } else {
199
+ transfer = api.tx.balances.transfer(to, new _util.BN(value));
200
+ }
194
201
  }
195
202
  }
196
203
  return [transfer, transferAmount || value];
@@ -79,6 +79,9 @@ async function getAstarStakingMetadata(chain, substrateApi) {
79
79
  unstakingPeriod
80
80
  };
81
81
  }
82
+ const convertAddress = address => {
83
+ return (0, _utilCrypto.isEthereumAddress)(address) ? address.toLowerCase() : address;
84
+ };
82
85
  async function subscribeAstarNominatorMetadata(chainInfo, address, substrateApi, ledger) {
83
86
  const nominationList = [];
84
87
  const unstakingList = [];
@@ -97,14 +100,15 @@ async function subscribeAstarNominatorMetadata(chainInfo, address, substrateApi,
97
100
  if (_stakerInfo.length > 0) {
98
101
  const dAppInfoMap = {};
99
102
  allDapps.forEach(dappInfo => {
100
- dAppInfoMap[dappInfo.address.toLowerCase()] = dappInfo;
103
+ dAppInfoMap[convertAddress(dappInfo.address)] = dappInfo;
101
104
  });
102
105
  for (const item of _stakerInfo) {
103
106
  const data = item[0].toHuman();
104
107
  const stakedDapp = data[1];
105
108
  const stakeData = item[1].toPrimitive();
106
109
  const stakeList = stakeData.stakes;
107
- const dappAddress = stakedDapp.Evm ? stakedDapp.Evm.toLowerCase() : stakedDapp.Wasm;
110
+ const _dappAddress = stakedDapp.Evm ? stakedDapp.Evm.toLowerCase() : stakedDapp.Wasm;
111
+ const dappAddress = convertAddress(_dappAddress);
108
112
  const currentStake = stakeList.slice(-1)[0].staked.toString() || '0';
109
113
  const bnCurrentStake = new _util.BN(currentStake);
110
114
  if (bnCurrentStake.gt(_util.BN_ZERO)) {
@@ -114,7 +118,7 @@ async function subscribeAstarNominatorMetadata(chainInfo, address, substrateApi,
114
118
  nominationList.push({
115
119
  status: dappStakingStatus,
116
120
  chain: chainInfo.slug,
117
- validatorAddress: (0, _utilCrypto.isEthereumAddress)(dappAddress) ? dappAddress.toLowerCase() : dappAddress,
121
+ validatorAddress: dappAddress,
118
122
  activeStake: currentStake,
119
123
  validatorMinStake: '0',
120
124
  validatorIdentity: dappInfo === null || dappInfo === void 0 ? void 0 : dappInfo.name,
@@ -192,7 +196,7 @@ async function getAstarNominatorMetadata(chainInfo, address, substrateApi) {
192
196
  const stakedDapp = data[1];
193
197
  const stakeData = item[1].toPrimitive();
194
198
  const stakeList = stakeData.stakes;
195
- const dappAddress = (0, _utilCrypto.isEthereumAddress)(stakedDapp.Evm) ? stakedDapp.Evm.toLowerCase() : stakedDapp.Evm;
199
+ const dappAddress = convertAddress(stakedDapp.Evm);
196
200
  const currentStake = stakeList.slice(-1)[0].staked.toString() || '0';
197
201
  const bnCurrentStake = new _util.BN(currentStake);
198
202
  if (bnCurrentStake.gt(_util.BN_ZERO)) {
@@ -285,7 +289,7 @@ async function getAstarDappsInfo(networkKey, substrateApi) {
285
289
  allDappsInfo.push({
286
290
  commission: 0,
287
291
  expectedReturn: 0,
288
- address: (0, _utilCrypto.isEthereumAddress)(dappAddress) ? dappAddress.toLowerCase() : dappAddress,
292
+ address: convertAddress(dappAddress),
289
293
  totalStake: totalStake,
290
294
  ownStake: '0',
291
295
  otherStake: totalStake.toString(),
@@ -101,9 +101,9 @@ function validateRelayBondingCondition(chainInfo, amount, selectedValidators, ad
101
101
  }
102
102
  function subscribeRelayChainStakingMetadata(chainInfo, substrateApi, callback) {
103
103
  return substrateApi.api.query.staking.currentEra(async _currentEra => {
104
- var _substrateApi$api$que, _substrateApi$api$que2, _substrateApi$api$que3, _substrateApi$api$que4, _substrateApi$api$que5, _substrateApi$api$que6, _substrateApi$api$que7;
104
+ var _substrateApi$api$con, _substrateApi$api$con2, _substrateApi$api$que, _substrateApi$api$que2, _substrateApi$api$que3, _substrateApi$api$que4, _substrateApi$api$que5, _substrateApi$api$que6, _substrateApi$api$que7;
105
105
  const currentEra = _currentEra.toString();
106
- const maxNominations = substrateApi.api.consts.staking.maxNominations.toString();
106
+ const maxNominations = ((_substrateApi$api$con = substrateApi.api.consts.staking) === null || _substrateApi$api$con === void 0 ? void 0 : (_substrateApi$api$con2 = _substrateApi$api$con.maxNominations) === null || _substrateApi$api$con2 === void 0 ? void 0 : _substrateApi$api$con2.toString()) || '16'; // TODO
107
107
  const maxUnlockingChunks = substrateApi.api.consts.staking.maxUnlockingChunks.toString();
108
108
  const unlockingEras = substrateApi.api.consts.staking.bondingDuration.toString();
109
109
  const [_totalEraStake, _totalIssuance, _auctionCounter, _minNominatorBond, _minPoolJoin, _minimumActiveStake] = await Promise.all([substrateApi.api.query.staking.erasTotalStake(parseInt(currentEra)), substrateApi.api.query.balances.totalIssuance(), (_substrateApi$api$que = substrateApi.api.query.auctions) === null || _substrateApi$api$que === void 0 ? void 0 : _substrateApi$api$que.auctionCounter(), substrateApi.api.query.staking.minNominatorBond(), (_substrateApi$api$que2 = substrateApi.api.query) === null || _substrateApi$api$que2 === void 0 ? void 0 : (_substrateApi$api$que3 = _substrateApi$api$que2.nominationPools) === null || _substrateApi$api$que3 === void 0 ? void 0 : _substrateApi$api$que3.minJoinBond(), ((_substrateApi$api$que4 = substrateApi.api.query) === null || _substrateApi$api$que4 === void 0 ? void 0 : (_substrateApi$api$que5 = _substrateApi$api$que4.staking) === null || _substrateApi$api$que5 === void 0 ? void 0 : _substrateApi$api$que5.minimumActiveStake) && ((_substrateApi$api$que6 = substrateApi.api.query) === null || _substrateApi$api$que6 === void 0 ? void 0 : (_substrateApi$api$que7 = _substrateApi$api$que6.staking) === null || _substrateApi$api$que7 === void 0 ? void 0 : _substrateApi$api$que7.minimumActiveStake())]);
@@ -8,6 +8,7 @@ var _polkadotXcm = require("@subwallet/extension-base/koni/api/xcm/polkadotXcm")
8
8
  var _xcmPallet = require("@subwallet/extension-base/koni/api/xcm/xcmPallet");
9
9
  var _xTokens = require("@subwallet/extension-base/koni/api/xcm/xTokens");
10
10
  var _constants = require("@subwallet/extension-base/services/chain-service/constants");
11
+ var _utils = require("@subwallet/extension-base/services/chain-service/utils");
11
12
  // Copyright 2019-2022 @subwallet/extension-base
12
13
  // SPDX-License-Identifier: Apache-2.0
13
14
 
@@ -26,7 +27,11 @@ const createXcmExtrinsic = async _ref => {
26
27
  const api = chainApi.api;
27
28
  let extrinsic;
28
29
  if (_constants._XCM_CHAIN_GROUP.polkadotXcm.includes(originTokenInfo.originChain)) {
29
- extrinsic = (0, _polkadotXcm.getExtrinsicByPolkadotXcmPallet)(originTokenInfo, originChainInfo, destinationChainInfo, recipient, sendingValue, api);
30
+ if (['astar', 'shiden'].includes(originChainInfo.slug) && !(0, _utils._isNativeToken)(originTokenInfo)) {
31
+ extrinsic = (0, _xTokens.getExtrinsicByXtokensPallet)(originTokenInfo, originChainInfo, destinationChainInfo, recipient, sendingValue, api);
32
+ } else {
33
+ extrinsic = (0, _polkadotXcm.getExtrinsicByPolkadotXcmPallet)(originTokenInfo, originChainInfo, destinationChainInfo, recipient, sendingValue, api);
34
+ }
30
35
  } else if (_constants._XCM_CHAIN_GROUP.xcmPallet.includes(originTokenInfo.originChain)) {
31
36
  extrinsic = (0, _xcmPallet.getExtrinsicByXcmPalletPallet)(originTokenInfo, originChainInfo, destinationChainInfo, recipient, sendingValue, api);
32
37
  } else {
@@ -16,9 +16,7 @@ function getExtrinsicByPolkadotXcmPallet(tokenInfo, originChainInfo, destination
16
16
  const destination = (0, _utils.getDestinationChainLocation)(originChainInfo, destinationChainInfo, version);
17
17
  let assetLocation = (0, _utils.getTokenLocation)(tokenInfo, value, version);
18
18
  let method = 'limitedReserveTransferAssets';
19
- if (['astar', 'shiden'].includes(originChainInfo.slug) && !(0, _utils2._isNativeToken)(tokenInfo)) {
20
- method = 'limitedReserveWithdrawAssets';
21
- } else if (['statemint', 'statemine'].includes(originChainInfo.slug) && (0, _utils2._isSubstrateRelayChain)(destinationChainInfo)) {
19
+ if (['statemint', 'statemine'].includes(originChainInfo.slug) && (0, _utils2._isSubstrateRelayChain)(destinationChainInfo)) {
22
20
  assetLocation = {
23
21
  [version]: [{
24
22
  id: {
@@ -25,6 +25,6 @@ function getCurrencyId(tokenInfo) {
25
25
  }
26
26
  function getExtrinsicByXtokensPallet(tokenInfo, originChainInfo, destinationChainInfo, recipientAddress, value, api) {
27
27
  const weightParam = ['pioneer'].includes(originChainInfo.slug) ? _utils.FOUR_INSTRUCTIONS_WEIGHT : (0, _utils.getDestWeight)();
28
- const destVersion = ['moonbeam', 'moonriver', 'bifrost_dot', 'interlay', 'hydradx_main', 'acala', 'parallel'].includes(originChainInfo.slug) ? 'V3' : undefined;
28
+ const destVersion = ['moonbeam', 'moonriver', 'bifrost_dot', 'interlay', 'hydradx_main', 'acala', 'parallel', 'astar', 'shiden'].includes(originChainInfo.slug) ? 'V3' : undefined;
29
29
  return api.tx.xTokens.transfer(getCurrencyId(tokenInfo), value, (0, _utils.getDestMultilocation)(destinationChainInfo, recipientAddress, destVersion), weightParam);
30
30
  }