@subwallet/extension-base 1.3.29-0 → 1.3.29-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/core/utils.js CHANGED
@@ -151,6 +151,7 @@ function _isSupportLedgerAccount(validateRecipientParams) {
151
151
  return '';
152
152
  }
153
153
  const _isSufficientToken = async (tokenInfo, substrateApi) => {
154
+ // todo: remove const and detect by pallets instead
154
155
  if (_constants.SUFFICIENT_CHAIN.includes(tokenInfo.originChain) && tokenInfo.assetType !== _types._AssetType.NATIVE) {
155
156
  const assetId = (0, _utils2._isBridgedToken)(tokenInfo) ? (0, _utils2._getXcmAssetMultilocation)(tokenInfo) : (0, _utils2._getTokenOnChainAssetId)(tokenInfo);
156
157
  const queryParams = {
@@ -164,8 +165,13 @@ const _isSufficientToken = async (tokenInfo, substrateApi) => {
164
165
  }
165
166
  const metadata = await substrateApi.makeRpcQuery(queryParams);
166
167
  return metadata.isSufficient;
167
- } else {
168
- return false;
169
168
  }
169
+
170
+ // todo
171
+ // if (tokenInfo.metadata?.isSufficient) {
172
+ // return tokenInfo.metadata?.isSufficient;
173
+ // }
174
+
175
+ return false;
170
176
  };
171
177
  exports._isSufficientToken = _isSufficientToken;
@@ -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.3.29-0'
16
+ version: '1.3.29-1'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
@@ -300,7 +300,7 @@ const _XCM_CHAIN_GROUP = {
300
300
  // default is xTokens pallet
301
301
  };
302
302
  exports._XCM_CHAIN_GROUP = _XCM_CHAIN_GROUP;
303
- const SUFFICIENT_CHAIN = ['astar', 'calamari', 'parallel', 'darwinia2', 'crabParachain', 'pangolin', 'statemint', 'moonriver', 'shiden', 'moonbeam', 'statemine', 'liberland', 'dentnet', 'phala', 'crust', 'dbcchain', 'rococo_assethub', 'hydradx_main'];
303
+ const SUFFICIENT_CHAIN = ['astar', 'calamari', 'parallel', 'darwinia2', 'crabParachain', 'pangolin', 'statemint', 'moonriver', 'shiden', 'moonbeam', 'statemine', 'liberland', 'dentnet', 'phala', 'crust', 'dbcchain', 'rococo_assethub'];
304
304
  exports.SUFFICIENT_CHAIN = SUFFICIENT_CHAIN;
305
305
  const _XCM_TYPE = {
306
306
  RP: `${_types._SubstrateChainType.RELAYCHAIN}-${_types._SubstrateChainType.PARACHAIN}`,
package/core/utils.js CHANGED
@@ -133,6 +133,7 @@ export function _isSupportLedgerAccount(validateRecipientParams) {
133
133
  return '';
134
134
  }
135
135
  export const _isSufficientToken = async (tokenInfo, substrateApi) => {
136
+ // todo: remove const and detect by pallets instead
136
137
  if (SUFFICIENT_CHAIN.includes(tokenInfo.originChain) && tokenInfo.assetType !== _AssetType.NATIVE) {
137
138
  const assetId = _isBridgedToken(tokenInfo) ? _getXcmAssetMultilocation(tokenInfo) : _getTokenOnChainAssetId(tokenInfo);
138
139
  const queryParams = {
@@ -146,7 +147,12 @@ export const _isSufficientToken = async (tokenInfo, substrateApi) => {
146
147
  }
147
148
  const metadata = await substrateApi.makeRpcQuery(queryParams);
148
149
  return metadata.isSufficient;
149
- } else {
150
- return false;
151
150
  }
151
+
152
+ // todo
153
+ // if (tokenInfo.metadata?.isSufficient) {
154
+ // return tokenInfo.metadata?.isSufficient;
155
+ // }
156
+
157
+ return false;
152
158
  };
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "./cjs/detectPackage.js"
18
18
  ],
19
19
  "type": "module",
20
- "version": "1.3.29-0",
20
+ "version": "1.3.29-1",
21
21
  "main": "./cjs/index.js",
22
22
  "module": "./index.js",
23
23
  "types": "./index.d.ts",
@@ -2670,12 +2670,12 @@
2670
2670
  "@sora-substrate/type-definitions": "^1.17.7",
2671
2671
  "@substrate/connect": "^0.8.9",
2672
2672
  "@subwallet/chain-list": "0.2.102",
2673
- "@subwallet/extension-base": "^1.3.29-0",
2674
- "@subwallet/extension-chains": "^1.3.29-0",
2675
- "@subwallet/extension-dapp": "^1.3.29-0",
2676
- "@subwallet/extension-inject": "^1.3.29-0",
2673
+ "@subwallet/extension-base": "^1.3.29-1",
2674
+ "@subwallet/extension-chains": "^1.3.29-1",
2675
+ "@subwallet/extension-dapp": "^1.3.29-1",
2676
+ "@subwallet/extension-inject": "^1.3.29-1",
2677
2677
  "@subwallet/keyring": "^0.1.9",
2678
- "@subwallet/subwallet-api-sdk": "^1.3.29-0",
2678
+ "@subwallet/subwallet-api-sdk": "^1.3.29-1",
2679
2679
  "@subwallet/ui-keyring": "^0.1.9",
2680
2680
  "@ton/core": "^0.56.3",
2681
2681
  "@ton/crypto": "^3.2.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.3.29-0'
10
+ version: '1.3.29-1'
11
11
  };
@@ -278,7 +278,7 @@ export const _XCM_CHAIN_GROUP = {
278
278
  // default is xTokens pallet
279
279
  };
280
280
 
281
- export const SUFFICIENT_CHAIN = ['astar', 'calamari', 'parallel', 'darwinia2', 'crabParachain', 'pangolin', 'statemint', 'moonriver', 'shiden', 'moonbeam', 'statemine', 'liberland', 'dentnet', 'phala', 'crust', 'dbcchain', 'rococo_assethub', 'hydradx_main'];
281
+ export const SUFFICIENT_CHAIN = ['astar', 'calamari', 'parallel', 'darwinia2', 'crabParachain', 'pangolin', 'statemint', 'moonriver', 'shiden', 'moonbeam', 'statemine', 'liberland', 'dentnet', 'phala', 'crust', 'dbcchain', 'rococo_assethub'];
282
282
  export const _XCM_TYPE = {
283
283
  RP: `${_SubstrateChainType.RELAYCHAIN}-${_SubstrateChainType.PARACHAIN}`,
284
284
  // DMP