@subwallet/extension-base 1.3.58-0 → 1.3.59-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.
@@ -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.58-0'
16
+ version: '1.3.59-0'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
@@ -73,6 +73,8 @@ const createSubstrateExtrinsic = async _ref => {
73
73
 
74
74
  transfer = transaction.extrinsic;
75
75
  transferAmount = value;
76
+ } else if ((0, _utils3._isGigaToken)(tokenInfo) && api.tx.currencies) {
77
+ transfer = api.tx.currencies.transfer(to, (0, _utils3._getTokenOnChainAssetId)(tokenInfo), value);
76
78
  } else if (_constants._TRANSFER_CHAIN_GROUP.acala.includes(networkKey)) {
77
79
  if (!(0, _utils3._isNativeToken)(tokenInfo)) {
78
80
  if (isTxCurrenciesSupported) {
@@ -34,6 +34,7 @@ var _exportNames = {
34
34
  _isChainTonCompatible: true,
35
35
  _isChainCardanoCompatible: true,
36
36
  _isNativeToken: true,
37
+ _isGigaToken: true,
37
38
  _isNativeTokenBySlug: true,
38
39
  _isSmartContractToken: true,
39
40
  _isChainSubstrateCompatible: true,
@@ -176,6 +177,7 @@ exports._isCustomChain = _isCustomChain;
176
177
  exports._isCustomProvider = _isCustomProvider;
177
178
  exports._isEqualContractAddress = _isEqualContractAddress;
178
179
  exports._isEqualSmartContractAsset = _isEqualSmartContractAsset;
180
+ exports._isGigaToken = _isGigaToken;
179
181
  exports._isJettonToken = _isJettonToken;
180
182
  exports._isLocalToken = _isLocalToken;
181
183
  exports._isMantaZkAsset = _isMantaZkAsset;
@@ -205,7 +207,8 @@ exports._isXcmPathSupported = _isXcmPathSupported;
205
207
  exports._parseAssetRefKey = _parseAssetRefKey;
206
208
  exports._parseMetadataForAssetId = _parseMetadataForAssetId;
207
209
  exports._parseMetadataForSmartContractAsset = _parseMetadataForSmartContractAsset;
208
- exports.findChainInfoByHalfGenesisHash = exports.findChainInfoByChainId = void 0;
210
+ exports.findChainInfoByChainId = void 0;
211
+ exports.findChainInfoByHalfGenesisHash = void 0;
209
212
  exports.randomizeProvider = randomizeProvider;
210
213
  exports.updateLatestChainInfo = updateLatestChainInfo;
211
214
  var _types = require("@subwallet/chain-list/types");
@@ -382,6 +385,10 @@ function _isChainCardanoCompatible(chainInfo) {
382
385
  function _isNativeToken(tokenInfo) {
383
386
  return tokenInfo.assetType === _types._AssetType.NATIVE;
384
387
  }
388
+ function _isGigaToken(tokenInfo) {
389
+ var _tokenInfo$metadata8;
390
+ return (_tokenInfo$metadata8 = tokenInfo.metadata) === null || _tokenInfo$metadata8 === void 0 ? void 0 : _tokenInfo$metadata8.isGigaToken;
391
+ }
385
392
  function _isNativeTokenBySlug(tokenSlug) {
386
393
  return tokenSlug.includes(_types._AssetType.NATIVE);
387
394
  }
@@ -581,16 +588,16 @@ function _isXcmPathSupported(originTokenSlug, destinationTokenSlug, assetRefMap)
581
588
  return assetRef.path === _types._AssetRefPath.XCM;
582
589
  }
583
590
  function _getXcmAssetType(tokenInfo) {
584
- var _tokenInfo$metadata8;
585
- return ((_tokenInfo$metadata8 = tokenInfo.metadata) === null || _tokenInfo$metadata8 === void 0 ? void 0 : _tokenInfo$metadata8.assetType) || '';
591
+ var _tokenInfo$metadata9;
592
+ return ((_tokenInfo$metadata9 = tokenInfo.metadata) === null || _tokenInfo$metadata9 === void 0 ? void 0 : _tokenInfo$metadata9.assetType) || '';
586
593
  }
587
594
  function _getXcmAssetId(tokenInfo) {
588
- var _tokenInfo$metadata9;
589
- return ((_tokenInfo$metadata9 = tokenInfo.metadata) === null || _tokenInfo$metadata9 === void 0 ? void 0 : _tokenInfo$metadata9.assetId) || '-1';
595
+ var _tokenInfo$metadata10;
596
+ return ((_tokenInfo$metadata10 = tokenInfo.metadata) === null || _tokenInfo$metadata10 === void 0 ? void 0 : _tokenInfo$metadata10.assetId) || '-1';
590
597
  }
591
598
  function _getXcmAssetMultilocation(tokenInfo) {
592
- var _tokenInfo$metadata10;
593
- return (_tokenInfo$metadata10 = tokenInfo.metadata) === null || _tokenInfo$metadata10 === void 0 ? void 0 : _tokenInfo$metadata10.multilocation;
599
+ var _tokenInfo$metadata11;
600
+ return (_tokenInfo$metadata11 = tokenInfo.metadata) === null || _tokenInfo$metadata11 === void 0 ? void 0 : _tokenInfo$metadata11.multilocation;
594
601
  }
595
602
  function _getXcmTransferType(originChainInfo, destinationChainInfo) {
596
603
  var _originChainInfo$subs, _destinationChainInfo;
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "./cjs/detectPackage.js"
18
18
  ],
19
19
  "type": "module",
20
- "version": "1.3.58-0",
20
+ "version": "1.3.59-0",
21
21
  "main": "./cjs/index.js",
22
22
  "module": "./index.js",
23
23
  "types": "./index.d.ts",
@@ -2879,10 +2879,10 @@
2879
2879
  "@substrate/connect": "^0.8.9",
2880
2880
  "@subwallet-monorepos/subwallet-services-sdk": "^0.1.8",
2881
2881
  "@subwallet/chain-list": "0.2.115",
2882
- "@subwallet/extension-base": "^1.3.58-0",
2883
- "@subwallet/extension-chains": "^1.3.58-0",
2884
- "@subwallet/extension-dapp": "^1.3.58-0",
2885
- "@subwallet/extension-inject": "^1.3.58-0",
2882
+ "@subwallet/extension-base": "^1.3.59-0",
2883
+ "@subwallet/extension-chains": "^1.3.59-0",
2884
+ "@subwallet/extension-dapp": "^1.3.59-0",
2885
+ "@subwallet/extension-inject": "^1.3.59-0",
2886
2886
  "@subwallet/keyring": "^0.1.13",
2887
2887
  "@subwallet/ui-keyring": "^0.1.13",
2888
2888
  "@ton/core": "^0.56.3",
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.58-0'
10
+ version: '1.3.59-0'
11
11
  };
@@ -7,7 +7,7 @@ import { getPSP22ContractPromise } from '@subwallet/extension-base/koni/api/cont
7
7
  import { getWasmContractGasLimit } from '@subwallet/extension-base/koni/api/contract-handler/wasm/utils';
8
8
  import { estimateTonTxFee } from '@subwallet/extension-base/services/balance-service/helpers/subscribe/ton/utils';
9
9
  import { _TRANSFER_CHAIN_GROUP } from '@subwallet/extension-base/services/chain-service/constants';
10
- import { _getContractAddressOfToken, _getTokenOnChainAssetId, _getTokenOnChainInfo, _getXcmAssetMultilocation, _isBridgedToken, _isChainEvmCompatible, _isChainTonCompatible, _isNativeToken, _isTokenGearSmartContract, _isTokenTransferredByEvm, _isTokenTransferredByTon, _isTokenWasmSmartContract } from '@subwallet/extension-base/services/chain-service/utils';
10
+ import { _getContractAddressOfToken, _getTokenOnChainAssetId, _getTokenOnChainInfo, _getXcmAssetMultilocation, _isBridgedToken, _isChainEvmCompatible, _isChainTonCompatible, _isGigaToken, _isNativeToken, _isTokenGearSmartContract, _isTokenTransferredByEvm, _isTokenTransferredByTon, _isTokenWasmSmartContract } from '@subwallet/extension-base/services/chain-service/utils';
11
11
  import { calculateGasFeeParams } from '@subwallet/extension-base/services/fee-service/utils';
12
12
  import { combineEthFee, getGRC20ContractPromise, getVFTContractPromise } from '@subwallet/extension-base/utils';
13
13
  import { keyring } from '@subwallet/ui-keyring';
@@ -65,6 +65,8 @@ export const createSubstrateExtrinsic = async ({
65
65
 
66
66
  transfer = transaction.extrinsic;
67
67
  transferAmount = value;
68
+ } else if (_isGigaToken(tokenInfo) && api.tx.currencies) {
69
+ transfer = api.tx.currencies.transfer(to, _getTokenOnChainAssetId(tokenInfo), value);
68
70
  } else if (_TRANSFER_CHAIN_GROUP.acala.includes(networkKey)) {
69
71
  if (!_isNativeToken(tokenInfo)) {
70
72
  if (isTxCurrenciesSupported) {
@@ -46,6 +46,7 @@ export declare function _isChainBitcoinCompatible(chainInfo: _ChainInfo): boolea
46
46
  export declare function _isChainTonCompatible(chainInfo: _ChainInfo): boolean;
47
47
  export declare function _isChainCardanoCompatible(chainInfo: _ChainInfo): boolean;
48
48
  export declare function _isNativeToken(tokenInfo: _ChainAsset): boolean;
49
+ export declare function _isGigaToken(tokenInfo: _ChainAsset): boolean | undefined;
49
50
  export declare function _isNativeTokenBySlug(tokenSlug: string): boolean;
50
51
  export declare function _isSmartContractToken(tokenInfo: _ChainAsset): boolean;
51
52
  export declare function _isChainSubstrateCompatible(chainInfo: _ChainInfo): boolean;
@@ -160,6 +160,10 @@ export function _isChainCardanoCompatible(chainInfo) {
160
160
  export function _isNativeToken(tokenInfo) {
161
161
  return tokenInfo.assetType === _AssetType.NATIVE;
162
162
  }
163
+ export function _isGigaToken(tokenInfo) {
164
+ var _tokenInfo$metadata8;
165
+ return (_tokenInfo$metadata8 = tokenInfo.metadata) === null || _tokenInfo$metadata8 === void 0 ? void 0 : _tokenInfo$metadata8.isGigaToken;
166
+ }
163
167
  export function _isNativeTokenBySlug(tokenSlug) {
164
168
  return tokenSlug.includes(_AssetType.NATIVE);
165
169
  }
@@ -358,16 +362,16 @@ export function _isXcmPathSupported(originTokenSlug, destinationTokenSlug, asset
358
362
  return assetRef.path === _AssetRefPath.XCM;
359
363
  }
360
364
  export function _getXcmAssetType(tokenInfo) {
361
- var _tokenInfo$metadata8;
362
- return ((_tokenInfo$metadata8 = tokenInfo.metadata) === null || _tokenInfo$metadata8 === void 0 ? void 0 : _tokenInfo$metadata8.assetType) || '';
365
+ var _tokenInfo$metadata9;
366
+ return ((_tokenInfo$metadata9 = tokenInfo.metadata) === null || _tokenInfo$metadata9 === void 0 ? void 0 : _tokenInfo$metadata9.assetType) || '';
363
367
  }
364
368
  export function _getXcmAssetId(tokenInfo) {
365
- var _tokenInfo$metadata9;
366
- return ((_tokenInfo$metadata9 = tokenInfo.metadata) === null || _tokenInfo$metadata9 === void 0 ? void 0 : _tokenInfo$metadata9.assetId) || '-1';
369
+ var _tokenInfo$metadata10;
370
+ return ((_tokenInfo$metadata10 = tokenInfo.metadata) === null || _tokenInfo$metadata10 === void 0 ? void 0 : _tokenInfo$metadata10.assetId) || '-1';
367
371
  }
368
372
  export function _getXcmAssetMultilocation(tokenInfo) {
369
- var _tokenInfo$metadata10;
370
- return (_tokenInfo$metadata10 = tokenInfo.metadata) === null || _tokenInfo$metadata10 === void 0 ? void 0 : _tokenInfo$metadata10.multilocation;
373
+ var _tokenInfo$metadata11;
374
+ return (_tokenInfo$metadata11 = tokenInfo.metadata) === null || _tokenInfo$metadata11 === void 0 ? void 0 : _tokenInfo$metadata11.multilocation;
371
375
  }
372
376
  export function _getXcmTransferType(originChainInfo, destinationChainInfo) {
373
377
  var _originChainInfo$subs, _destinationChainInfo;