@subwallet/extension-base 1.3.53-0 → 1.3.54-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/background/KoniTypes.d.ts +10 -3
- package/cjs/koni/background/handlers/Extension.js +4 -4
- package/cjs/koni/background/handlers/State.js +1 -0
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/balance-service/transfer/xcm/snowBridge.js +21 -10
- package/cjs/services/chain-online-service/index.js +168 -15
- package/cjs/services/chain-service/index.js +39 -10
- package/cjs/services/chain-service/utils/patch.js +2 -2
- package/cjs/services/earning-service/constants/chains.js +2 -4
- package/cjs/services/earning-service/handlers/base.js +1 -1
- package/cjs/services/earning-service/handlers/native-staking/base.js +4 -2
- package/cjs/services/earning-service/handlers/native-staking/dtao.js +9 -3
- package/cjs/services/earning-service/handlers/native-staking/relay-chain.js +1 -10
- package/cjs/services/earning-service/handlers/native-staking/tao.js +24 -14
- package/cjs/services/earning-service/service.js +2 -2
- package/cjs/services/migration-service/scripts/MigrateTransactionHistoryBySymbol.js +6 -2
- package/cjs/services/migration-service/scripts/databases/MigrateAssetSetting.js +6 -2
- package/cjs/services/migration-service/scripts/index.js +2 -2
- package/cjs/services/swap-service/index.js +24 -18
- package/cjs/services/transaction-service/utils.js +25 -16
- package/koni/background/handlers/Extension.d.ts +1 -1
- package/koni/background/handlers/Extension.js +4 -4
- package/koni/background/handlers/State.js +1 -0
- package/package.json +8 -6
- package/packageInfo.js +1 -1
- package/services/balance-service/transfer/xcm/snowBridge.js +21 -10
- package/services/chain-online-service/index.d.ts +4 -1
- package/services/chain-online-service/index.js +168 -15
- package/services/chain-service/index.js +39 -10
- package/services/chain-service/utils/patch.d.ts +1 -1
- package/services/chain-service/utils/patch.js +2 -2
- package/services/earning-service/constants/chains.d.ts +0 -1
- package/services/earning-service/constants/chains.js +1 -2
- package/services/earning-service/handlers/base.d.ts +3 -3
- package/services/earning-service/handlers/base.js +1 -1
- package/services/earning-service/handlers/native-staking/base.js +4 -2
- package/services/earning-service/handlers/native-staking/dtao.d.ts +4 -3
- package/services/earning-service/handlers/native-staking/dtao.js +9 -3
- package/services/earning-service/handlers/native-staking/relay-chain.d.ts +0 -2
- package/services/earning-service/handlers/native-staking/relay-chain.js +2 -11
- package/services/earning-service/handlers/native-staking/tao.d.ts +1 -0
- package/services/earning-service/handlers/native-staking/tao.js +24 -14
- package/services/earning-service/service.d.ts +3 -3
- package/services/earning-service/service.js +2 -2
- package/services/migration-service/scripts/MigrateTransactionHistoryBySymbol.js +6 -2
- package/services/migration-service/scripts/databases/MigrateAssetSetting.js +6 -2
- package/services/migration-service/scripts/index.js +2 -2
- package/services/swap-service/index.js +24 -18
- package/services/transaction-service/utils.js +25 -16
- package/types/yield/actions/join/submit.d.ts +5 -0
- package/types/yield/actions/others.d.ts +7 -2
- package/types/yield/info/account/info.d.ts +1 -0
|
@@ -947,14 +947,14 @@ export default class EarningService {
|
|
|
947
947
|
return Promise.reject(new TransactionError(BasicTxErrorType.INTERNAL_ERROR));
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
|
-
async
|
|
950
|
+
async yieldGetEarningImpact(params) {
|
|
951
951
|
await this.eventService.waitChainReady;
|
|
952
952
|
const {
|
|
953
953
|
slug
|
|
954
954
|
} = params;
|
|
955
955
|
const handler = this.getPoolHandler(slug);
|
|
956
956
|
if (handler) {
|
|
957
|
-
return handler.
|
|
957
|
+
return handler.getEarningImpact(params);
|
|
958
958
|
} else {
|
|
959
959
|
return Promise.reject(new TransactionError(BasicTxErrorType.INTERNAL_ERROR));
|
|
960
960
|
}
|
|
@@ -7,8 +7,12 @@ export default class MigrateTransactionHistoryBySymbol extends BaseMigrationJob
|
|
|
7
7
|
const state = this.state;
|
|
8
8
|
try {
|
|
9
9
|
const changeSlugsMap = {
|
|
10
|
-
'
|
|
11
|
-
'
|
|
10
|
+
'bifrost_testnet-NATIVE-BNC': 'bifrost_testnet-NATIVE-BFC',
|
|
11
|
+
'energy_web_x_rococo-NATIVE-VT': 'energy_web_x_rococo-NATIVE-EWT',
|
|
12
|
+
'chainflip_dot-NATIVE-DOT': 'chainflip_dot-NATIVE-Unit',
|
|
13
|
+
'autonomys_taurus-NATIVE-AI3': 'autonomys_taurus-NATIVE-tAI3',
|
|
14
|
+
'fraxtal-NATIVE-frxETH': 'fraxtal-ERC20-frxETH-0xFC00000000000000000000000000000000000006',
|
|
15
|
+
'arbitrum_one-ERC20-USDT-0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9': 'arbitrum_one-ERC20-USD₮0-0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'
|
|
12
16
|
};
|
|
13
17
|
const allTxs = [];
|
|
14
18
|
await Promise.all(Object.entries(changeSlugsMap).map(async ([oldSlug, newSlug], i) => {
|
|
@@ -6,8 +6,12 @@ export default class MigrateAssetSetting extends BaseMigrationJob {
|
|
|
6
6
|
async run() {
|
|
7
7
|
try {
|
|
8
8
|
const changeSlugsMap = {
|
|
9
|
-
'
|
|
10
|
-
'
|
|
9
|
+
'bifrost_testnet-NATIVE-BNC': 'bifrost_testnet-NATIVE-BFC',
|
|
10
|
+
'energy_web_x_rococo-NATIVE-VT': 'energy_web_x_rococo-NATIVE-EWT',
|
|
11
|
+
'chainflip_dot-NATIVE-DOT': 'chainflip_dot-NATIVE-Unit',
|
|
12
|
+
'autonomys_taurus-NATIVE-AI3': 'autonomys_taurus-NATIVE-tAI3',
|
|
13
|
+
'fraxtal-NATIVE-frxETH': 'fraxtal-ERC20-frxETH-0xFC00000000000000000000000000000000000006',
|
|
14
|
+
'arbitrum_one-ERC20-USDT-0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9': 'arbitrum_one-ERC20-USD₮0-0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'
|
|
11
15
|
};
|
|
12
16
|
const assetSetting = await this.state.chainService.getAssetSettings();
|
|
13
17
|
const migratedAssetSetting = {};
|
|
@@ -54,8 +54,8 @@ export default {
|
|
|
54
54
|
'1.1.33-01': MigrateLedgerAccountV2,
|
|
55
55
|
'1.1.41-01': DeleteChainStaking,
|
|
56
56
|
// '1.1.46-01': AutoEnableSomeTokens,
|
|
57
|
-
'1.
|
|
58
|
-
'1.
|
|
57
|
+
'1.3.53-01': MigrateAssetSetting,
|
|
58
|
+
'1.3.53-02': MigrateTransactionHistoryBySymbol,
|
|
59
59
|
'1.2.69-01': MigrateRemoveGenesisHash,
|
|
60
60
|
'1.2.13-01': ReloadMetadata,
|
|
61
61
|
'1.2.32-01': MigratePairData,
|
|
@@ -43,24 +43,30 @@ export class SwapService {
|
|
|
43
43
|
..._request,
|
|
44
44
|
isSupportKyberVersion: true
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
try {
|
|
47
|
+
const quotes = await subwalletApiSdk.swapApi.fetchSwapQuoteData(request);
|
|
48
|
+
if (Array.isArray(quotes)) {
|
|
49
|
+
quotes.forEach(quoteData => {
|
|
50
|
+
if (!_SUPPORTED_SWAP_PROVIDERS.includes(quoteData.provider)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (!quoteData.quote || Object.keys(quoteData.quote).length === 0) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (!('errorClass' in quoteData.quote)) {
|
|
57
|
+
availableQuotes.push({
|
|
58
|
+
quote: quoteData.quote
|
|
59
|
+
});
|
|
60
|
+
} else {
|
|
61
|
+
availableQuotes.push({
|
|
62
|
+
error: new SwapError(quoteData.quote.errorType, quoteData.quote.message)
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
} catch (err) {
|
|
68
|
+
availableQuotes.push({
|
|
69
|
+
error: new SwapError(SwapErrorType.ASSET_NOT_SUPPORTED)
|
|
64
70
|
});
|
|
65
71
|
}
|
|
66
72
|
return availableQuotes;
|
|
@@ -16,6 +16,21 @@ function getBlockExplorerAccountRoute(explorerLink) {
|
|
|
16
16
|
if (explorerLink.includes('explorer.subspace.network')) {
|
|
17
17
|
return 'accounts';
|
|
18
18
|
}
|
|
19
|
+
if (explorerLink.includes('edgscan.ink')) {
|
|
20
|
+
return 'accounts';
|
|
21
|
+
}
|
|
22
|
+
if (explorerLink.includes('devnet-explorer.mosaicchain.io')) {
|
|
23
|
+
return 'accounts';
|
|
24
|
+
}
|
|
25
|
+
if (explorerLink.includes('statescan.io')) {
|
|
26
|
+
return '#/accounts';
|
|
27
|
+
}
|
|
28
|
+
if (explorerLink.includes('explorer.joystream.org')) {
|
|
29
|
+
return '#/accounts';
|
|
30
|
+
}
|
|
31
|
+
if (explorerLink.includes('explorer.gen6.app')) {
|
|
32
|
+
return '#/accounts';
|
|
33
|
+
}
|
|
19
34
|
if (explorerLink.includes('deeperscan.io')) {
|
|
20
35
|
return 'account';
|
|
21
36
|
}
|
|
@@ -25,24 +40,18 @@ function getBlockExplorerAccountRoute(explorerLink) {
|
|
|
25
40
|
if (explorerLink.includes('3dpscan.io')) {
|
|
26
41
|
return 'account';
|
|
27
42
|
}
|
|
28
|
-
if (explorerLink.includes('
|
|
29
|
-
return '
|
|
30
|
-
}
|
|
31
|
-
if (explorerLink.includes('explorer.gen6.app')) {
|
|
32
|
-
return '#/accounts';
|
|
33
|
-
}
|
|
34
|
-
if (explorerLink.includes('astral.autonomys')) {
|
|
35
|
-
return 'accounts';
|
|
43
|
+
if (explorerLink.includes('main.dentnet.io')) {
|
|
44
|
+
return 'account';
|
|
36
45
|
}
|
|
37
46
|
if (explorerLink.includes('taostats.io')) {
|
|
38
47
|
return 'account';
|
|
39
48
|
}
|
|
49
|
+
if (explorerLink.includes('uniquescan.io')) {
|
|
50
|
+
return 'account';
|
|
51
|
+
}
|
|
40
52
|
if (explorerLink.includes('tonviewer.com')) {
|
|
41
53
|
return '';
|
|
42
54
|
}
|
|
43
|
-
if (explorerLink.includes('devnet-explorer.mosaicchain.io')) {
|
|
44
|
-
return 'accounts';
|
|
45
|
-
}
|
|
46
55
|
if (explorerLink.includes('pdexmon.com')) {
|
|
47
56
|
return 'holders';
|
|
48
57
|
}
|
|
@@ -52,7 +61,7 @@ function getBlockExplorerTxRoute(chainInfo) {
|
|
|
52
61
|
if (_isPureEvmChain(chainInfo) || _isPureBitcoinChain(chainInfo)) {
|
|
53
62
|
return 'tx';
|
|
54
63
|
}
|
|
55
|
-
if (['moonbeam'].includes(chainInfo.slug)) {
|
|
64
|
+
if (['moonbeam', 'crabParachain'].includes(chainInfo.slug)) {
|
|
56
65
|
return 'tx';
|
|
57
66
|
}
|
|
58
67
|
if (_isPureCardanoChain(chainInfo) || _isPureTonChain(chainInfo)) {
|
|
@@ -61,15 +70,15 @@ function getBlockExplorerTxRoute(chainInfo) {
|
|
|
61
70
|
if (['aventus', 'deeper_network'].includes(chainInfo.slug)) {
|
|
62
71
|
return 'transaction';
|
|
63
72
|
}
|
|
64
|
-
if (['gen6_public'].includes(chainInfo.slug)) {
|
|
73
|
+
if (['gen6_public', 'joystream'].includes(chainInfo.slug)) {
|
|
65
74
|
return '#/extrinsics';
|
|
66
75
|
}
|
|
76
|
+
if (['edgeware'].includes(chainInfo.slug)) {
|
|
77
|
+
return 'extrinsics';
|
|
78
|
+
}
|
|
67
79
|
if (['mosaicTest', 'polkadex'].includes(chainInfo.slug)) {
|
|
68
80
|
return 'transactions';
|
|
69
81
|
}
|
|
70
|
-
if (['autonomys'].includes(chainInfo.slug)) {
|
|
71
|
-
return 'extrinsics';
|
|
72
|
-
}
|
|
73
82
|
const explorerLink = _getBlockExplorerFromChain(chainInfo);
|
|
74
83
|
if (explorerLink && explorerLink.includes('statescan.io')) {
|
|
75
84
|
return '#/extrinsics';
|
|
@@ -23,6 +23,7 @@ export interface SubmitJoinNativeStaking extends AbstractSubmitYieldJoinData {
|
|
|
23
23
|
subnetData?: {
|
|
24
24
|
netuid: number;
|
|
25
25
|
slippage: number;
|
|
26
|
+
stakingFee?: string;
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
export interface SubmitJoinNominationPool extends AbstractSubmitYieldJoinData {
|
|
@@ -79,6 +80,10 @@ export interface BondingSubmitParams extends BaseRequestSign {
|
|
|
79
80
|
address: string;
|
|
80
81
|
selectedValidators: ValidatorInfo[];
|
|
81
82
|
lockPeriod?: number;
|
|
83
|
+
subnetData?: {
|
|
84
|
+
netuid: number;
|
|
85
|
+
slippage: number;
|
|
86
|
+
};
|
|
82
87
|
}
|
|
83
88
|
export declare type RequestBondingSubmit = InternalRequestSign<BondingSubmitParams>;
|
|
84
89
|
export declare type SubmitChangeValidatorStaking = SubmitBittensorChangeValidatorStaking | SubmitJoinNativeStaking;
|
|
@@ -11,7 +11,7 @@ import { BasePoolInfo, UnstakingInfo, YieldPoolInfo } from '../info';
|
|
|
11
11
|
* @prop {boolean} fastLeave - Fast leave pool (swap token)
|
|
12
12
|
* @prop {YieldPoolInfo} poolInfo - Pool's info - use for create history
|
|
13
13
|
* */
|
|
14
|
-
export interface
|
|
14
|
+
export interface BaseYieldLeaveParams extends BaseRequestSign {
|
|
15
15
|
/** Request account */
|
|
16
16
|
address: string;
|
|
17
17
|
/** Amount token want to leave */
|
|
@@ -24,9 +24,14 @@ export interface YieldLeaveParams extends BaseRequestSign {
|
|
|
24
24
|
fastLeave: boolean;
|
|
25
25
|
/** Pool's info - use for create history */
|
|
26
26
|
poolInfo: YieldPoolInfo;
|
|
27
|
+
}
|
|
28
|
+
export interface SubnetYieldLeaveParams {
|
|
27
29
|
/** Slippage (subnet staking) */
|
|
28
30
|
slippage?: number;
|
|
31
|
+
/** stakingFee (subnet staking) */
|
|
32
|
+
stakingFee?: string;
|
|
29
33
|
}
|
|
34
|
+
export declare type YieldLeaveParams = BaseYieldLeaveParams & Partial<SubnetYieldLeaveParams>;
|
|
30
35
|
export declare type RequestYieldLeave = InternalRequestSign<YieldLeaveParams>;
|
|
31
36
|
/**
|
|
32
37
|
* @interface RequestYieldWithdrawal
|
|
@@ -86,7 +91,7 @@ export interface StakeClaimRewardParams extends BaseRequestSign {
|
|
|
86
91
|
bondReward?: boolean;
|
|
87
92
|
}
|
|
88
93
|
export declare type RequestStakeClaimReward = InternalRequestSign<StakeClaimRewardParams>;
|
|
89
|
-
export interface
|
|
94
|
+
export interface RequestEarningImpact {
|
|
90
95
|
slug: string;
|
|
91
96
|
value: string;
|
|
92
97
|
netuid: number;
|