@subwallet/extension-base 1.0.1 → 1.0.2-1b
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 +25 -36
- package/background/KoniTypes.js +12 -7
- package/background/errors/TransactionError.js +21 -1
- package/cjs/background/KoniTypes.js +14 -8
- package/cjs/background/errors/TransactionError.js +20 -0
- package/cjs/constants/index.js +13 -28
- package/cjs/koni/api/dotsama/balance.js +60 -224
- package/cjs/koni/api/dotsama/transfer.js +30 -29
- package/cjs/koni/api/nft/acala_nft/index.js +4 -1
- package/cjs/koni/api/nft/bit.country/index.js +4 -1
- package/cjs/koni/api/nft/evm_nft/index.js +7 -3
- package/cjs/koni/api/nft/index.js +3 -6
- package/cjs/koni/api/nft/karura_nft/index.js +4 -1
- package/cjs/koni/api/nft/rmrk_nft/index.js +8 -1
- package/cjs/koni/api/nft/statemine_nft/index.js +4 -1
- package/cjs/koni/api/nft/unique_nft/index.js +6 -1
- package/cjs/koni/api/nft/wasm_nft/index.js +169 -111
- package/cjs/koni/api/nft/wasm_nft/utils.js +11 -7
- package/cjs/koni/api/staking/bonding/amplitude.js +18 -10
- package/cjs/koni/api/staking/bonding/astar.js +37 -238
- package/cjs/koni/api/staking/bonding/index.js +26 -14
- package/cjs/koni/api/staking/bonding/paraChain.js +100 -11
- package/cjs/koni/api/staking/bonding/relayChain.js +174 -16
- package/cjs/koni/api/staking/bonding/utils.js +55 -10
- package/cjs/koni/api/tokens/wasm/index.js +5 -4
- package/cjs/koni/api/tokens/wasm/utils.js +63 -0
- package/cjs/koni/api/xcm/index.js +0 -111
- package/cjs/koni/api/xcm/polkadotXcm.js +2 -2
- package/cjs/koni/api/xcm/utils.js +18 -13
- package/cjs/koni/api/xcm/xTokens.js +3 -5
- package/cjs/koni/api/xcm/xcmPallet.js +9 -6
- package/cjs/koni/background/cron.js +179 -77
- package/cjs/koni/background/handlers/Extension.js +231 -195
- package/cjs/koni/background/handlers/State.js +147 -111
- package/cjs/koni/background/handlers/Tabs.js +48 -39
- package/cjs/koni/background/subscription.js +64 -56
- package/cjs/packageInfo.js +1 -1
- package/cjs/page/index.js +5 -0
- package/cjs/services/chain-service/constants.js +1 -11
- package/cjs/services/chain-service/handler/SubstrateChainHandler.js +13 -8
- package/cjs/services/chain-service/handler/light-client/index.js +2 -0
- package/cjs/services/chain-service/index.js +39 -6
- package/cjs/services/chain-service/utils.js +4 -0
- package/cjs/services/event-service/index.js +75 -0
- package/cjs/services/event-service/types.js +11 -0
- package/cjs/services/history-service/index.js +46 -21
- package/cjs/services/history-service/subsquid-multi-chain-history.js +19 -11
- package/cjs/services/keyring-service/index.js +101 -0
- package/cjs/services/migration-service/index.js +13 -10
- package/cjs/{koni/migration/scripts/RemoveWrongCrowdloan.js → services/migration-service/scripts/AutoEnableChainsTokens.js} +11 -6
- package/cjs/services/migration-service/scripts/MigrateNetworkSettings.js +39 -19
- package/cjs/services/migration-service/scripts/MigrateSettings.js +31 -0
- package/cjs/services/migration-service/scripts/MigrateTransactionHistory.js +72 -0
- package/cjs/services/migration-service/scripts/index.js +13 -4
- package/cjs/services/price-service/coingecko.js +15 -3
- package/cjs/services/price-service/index.js +15 -18
- package/cjs/services/request-service/constants.js +8 -2
- package/cjs/services/request-service/handler/AuthRequestHandler.js +43 -12
- package/cjs/services/request-service/index.js +3 -0
- package/cjs/services/storage-service/DatabaseService.js +53 -34
- package/cjs/services/storage-service/databases/index.js +1 -1
- package/cjs/services/storage-service/db-stores/BaseStoreWithAddressAndChain.js +2 -8
- package/cjs/services/storage-service/db-stores/Nft.js +8 -18
- package/cjs/services/storage-service/db-stores/Transaction.js +10 -7
- package/cjs/services/subscan-service/index.js +107 -0
- package/cjs/services/subscan-service/subscan-chain-map.js +74 -0
- package/cjs/services/subscan-service/types.js +1 -0
- package/cjs/services/transaction-service/event-parser/index.js +20 -48
- package/cjs/services/transaction-service/index.js +66 -22
- package/cjs/services/transaction-service/utils.js +4 -6
- package/cjs/utils/address.js +9 -1
- package/cjs/utils/index.js +30 -26
- package/constants/index.d.ts +8 -13
- package/constants/index.js +8 -13
- package/koni/api/dotsama/balance.d.ts +0 -1
- package/koni/api/dotsama/balance.js +33 -197
- package/koni/api/dotsama/transfer.js +5 -4
- package/koni/api/nft/acala_nft/index.js +3 -1
- package/koni/api/nft/bit.country/index.js +3 -1
- package/koni/api/nft/evm_nft/index.js +6 -3
- package/koni/api/nft/index.d.ts +1 -2
- package/koni/api/nft/index.js +3 -6
- package/koni/api/nft/karura_nft/index.js +3 -1
- package/koni/api/nft/nft.d.ts +1 -0
- package/koni/api/nft/rmrk_nft/index.js +8 -1
- package/koni/api/nft/statemine_nft/index.js +3 -1
- package/koni/api/nft/unique_nft/index.js +5 -1
- package/koni/api/nft/wasm_nft/index.d.ts +0 -2
- package/koni/api/nft/wasm_nft/index.js +167 -109
- package/koni/api/nft/wasm_nft/utils.d.ts +7 -5
- package/koni/api/nft/wasm_nft/utils.js +7 -5
- package/koni/api/staking/bonding/amplitude.d.ts +1 -2
- package/koni/api/staking/bonding/amplitude.js +22 -13
- package/koni/api/staking/bonding/astar.d.ts +2 -11
- package/koni/api/staking/bonding/astar.js +39 -231
- package/koni/api/staking/bonding/index.d.ts +5 -2
- package/koni/api/staking/bonding/index.js +27 -17
- package/koni/api/staking/bonding/paraChain.d.ts +4 -1
- package/koni/api/staking/bonding/paraChain.js +101 -14
- package/koni/api/staking/bonding/relayChain.d.ts +6 -2
- package/koni/api/staking/bonding/relayChain.js +172 -17
- package/koni/api/staking/bonding/utils.d.ts +15 -2
- package/koni/api/staking/bonding/utils.js +53 -11
- package/koni/api/tokens/wasm/index.js +5 -4
- package/koni/api/tokens/wasm/utils.d.ts +6 -0
- package/koni/api/tokens/wasm/utils.js +54 -0
- package/koni/api/xcm/index.js +1 -112
- package/koni/api/xcm/polkadotXcm.js +3 -3
- package/koni/api/xcm/utils.d.ts +5 -6
- package/koni/api/xcm/utils.js +15 -10
- package/koni/api/xcm/xTokens.js +5 -7
- package/koni/api/xcm/xcmPallet.js +10 -9
- package/koni/background/cron.d.ts +6 -1
- package/koni/background/cron.js +179 -76
- package/koni/background/handlers/Extension.d.ts +2 -2
- package/koni/background/handlers/Extension.js +161 -125
- package/koni/background/handlers/State.d.ts +21 -20
- package/koni/background/handlers/State.js +144 -111
- package/koni/background/handlers/Tabs.js +30 -20
- package/koni/background/subscription.d.ts +1 -1
- package/koni/background/subscription.js +64 -58
- package/package.json +63 -18
- package/packageInfo.js +1 -1
- package/page/index.d.ts +2 -0
- package/page/index.js +4 -0
- package/services/chain-service/constants.d.ts +0 -1
- package/services/chain-service/constants.js +0 -9
- package/services/chain-service/handler/SubstrateChainHandler.js +14 -9
- package/services/chain-service/handler/light-client/index.d.ts +17 -1
- package/services/chain-service/handler/light-client/index.js +1 -1
- package/services/chain-service/helper/psp22_abi.json +1041 -881
- package/services/chain-service/helper/psp34_abi.json +2963 -1807
- package/services/chain-service/index.d.ts +6 -4
- package/services/chain-service/index.js +40 -9
- package/services/chain-service/utils.d.ts +1 -0
- package/services/chain-service/utils.js +3 -0
- package/services/event-service/index.d.ts +22 -0
- package/services/event-service/index.js +63 -0
- package/services/event-service/types.d.ts +28 -0
- package/services/event-service/types.js +4 -0
- package/services/history-service/index.d.ts +5 -3
- package/services/history-service/index.js +46 -21
- package/services/history-service/subsquid-multi-chain-history.js +22 -13
- package/services/keyring-service/index.d.ts +19 -0
- package/services/keyring-service/index.js +93 -0
- package/services/migration-service/index.js +11 -9
- package/services/migration-service/scripts/AutoEnableChainsTokens.d.ts +4 -0
- package/services/migration-service/scripts/AutoEnableChainsTokens.js +13 -0
- package/services/migration-service/scripts/MigrateNetworkSettings.js +37 -18
- package/services/migration-service/scripts/MigrateSettings.d.ts +4 -0
- package/services/migration-service/scripts/MigrateSettings.js +23 -0
- package/services/migration-service/scripts/MigrateTransactionHistory.d.ts +4 -0
- package/services/migration-service/scripts/MigrateTransactionHistory.js +64 -0
- package/services/migration-service/scripts/index.d.ts +1 -0
- package/services/migration-service/scripts/index.js +10 -3
- package/services/price-service/coingecko.js +15 -3
- package/services/price-service/index.d.ts +5 -3
- package/services/price-service/index.js +15 -18
- package/services/request-service/constants.d.ts +1 -0
- package/services/request-service/constants.js +6 -1
- package/services/request-service/handler/AuthRequestHandler.d.ts +8 -1
- package/services/request-service/handler/AuthRequestHandler.js +44 -13
- package/services/request-service/index.d.ts +7 -1
- package/services/request-service/index.js +3 -0
- package/services/storage-service/DatabaseService.d.ts +1 -0
- package/services/storage-service/DatabaseService.js +53 -34
- package/services/storage-service/databases/index.js +1 -1
- package/services/storage-service/db-stores/BaseStoreWithAddressAndChain.d.ts +1 -1
- package/services/storage-service/db-stores/BaseStoreWithAddressAndChain.js +2 -8
- package/services/storage-service/db-stores/Nft.d.ts +3 -3
- package/services/storage-service/db-stores/Nft.js +8 -17
- package/services/storage-service/db-stores/Transaction.js +10 -7
- package/services/subscan-service/index.d.ts +20 -0
- package/services/subscan-service/index.js +99 -0
- package/services/subscan-service/subscan-chain-map.d.ts +5 -0
- package/services/subscan-service/subscan-chain-map.js +63 -0
- package/services/subscan-service/types.d.ts +27 -0
- package/services/subscan-service/types.js +1 -0
- package/services/transaction-service/event-parser/index.d.ts +2 -2
- package/services/transaction-service/event-parser/index.js +21 -49
- package/services/transaction-service/index.d.ts +4 -2
- package/services/transaction-service/index.js +66 -22
- package/services/transaction-service/utils.js +5 -6
- package/utils/address.d.ts +1 -0
- package/utils/address.js +9 -2
- package/utils/index.d.ts +2 -1
- package/utils/index.js +26 -23
- package/cjs/background/errors/EvmRpcError.js +0 -21
- package/cjs/background/errors/SubWalletProviderError.js +0 -17
- package/cjs/constants/ethereum.js +0 -19
- package/cjs/errors/SubWalletProviderError.js +0 -17
- package/cjs/koni/api/xcm/astar.js +0 -160
- package/cjs/koni/api/xcm/moonbeamXcm.js +0 -80
- package/cjs/koni/api/xcm/statemintXcm.js +0 -197
- package/cjs/koni/api/xcm/substrateXcm.js +0 -213
- package/cjs/koni/migration/Base.js +0 -20
- package/cjs/koni/migration/index.js +0 -45
- package/cjs/koni/migration/scripts/ChangeRouteToHome.js +0 -22
- package/cjs/koni/migration/scripts/ClearOldStorage.js +0 -24
- package/cjs/koni/migration/scripts/RemoveWrongTransactionHistoriesFromStore.js +0 -36
- package/cjs/koni/migration/scripts/ResetTransactionHistoryEventIdx.js +0 -21
- package/cjs/koni/migration/scripts/index.js +0 -22
- package/cjs/koni/page/index.js +0 -16
- package/cjs/services/asset-service/index.js +0 -91
- package/cjs/services/storage-service/db-stores/ExtraDelegationInfo.js +0 -17
- package/cjs/stores/Balance.js +0 -18
- package/cjs/stores/Crowdloan.js +0 -18
- package/cjs/stores/CustomEvmToken.js +0 -18
- package/cjs/stores/NetworkMap.js +0 -18
- package/cjs/stores/Nft.js +0 -18
- package/cjs/stores/NftCollection.js +0 -18
- package/cjs/stores/Price.js +0 -18
- package/cjs/stores/Staking.js +0 -18
- package/cjs/stores/StakingReward.js +0 -18
- package/cjs/utils/eth/parseTransactionData.js +0 -284
- package/koni/page/index.d.ts +0 -2
- package/koni/page/index.js +0 -9
- /package/cjs/{koni/page → page}/SubWalleEvmProvider.js +0 -0
- /package/{koni/page → page}/SubWalleEvmProvider.d.ts +0 -0
- /package/{koni/page → page}/SubWalleEvmProvider.js +0 -0
|
@@ -103,7 +103,6 @@ export interface StakingItem {
|
|
|
103
103
|
nativeToken: string;
|
|
104
104
|
unit?: string;
|
|
105
105
|
state: APIItemState;
|
|
106
|
-
rewardInfo?: StakingRewardItem;
|
|
107
106
|
}
|
|
108
107
|
export interface StakingJson {
|
|
109
108
|
reset?: boolean;
|
|
@@ -379,14 +378,14 @@ export interface AmountData extends BasicTokenInfo {
|
|
|
379
378
|
}
|
|
380
379
|
export interface XCMTransactionAdditionalInfo {
|
|
381
380
|
destinationChain: string;
|
|
382
|
-
fee
|
|
381
|
+
fee?: AmountData;
|
|
383
382
|
}
|
|
384
383
|
export interface NFTTransactionAdditionalInfo {
|
|
385
384
|
collectionName: string;
|
|
386
385
|
}
|
|
387
386
|
export declare type TransactionAdditionalInfo<T extends ExtrinsicType> = T extends ExtrinsicType.TRANSFER_XCM ? XCMTransactionAdditionalInfo : T extends ExtrinsicType.SEND_NFT ? NFTTransactionAdditionalInfo : undefined;
|
|
388
387
|
export interface TransactionHistoryItem<ET extends ExtrinsicType = ExtrinsicType.TRANSFER_BALANCE> {
|
|
389
|
-
origin?:
|
|
388
|
+
origin?: 'app' | 'migration' | 'subsquid';
|
|
390
389
|
callhash?: string;
|
|
391
390
|
signature?: string;
|
|
392
391
|
chain: string;
|
|
@@ -423,7 +422,6 @@ export interface SWWarning {
|
|
|
423
422
|
data?: unknown;
|
|
424
423
|
}
|
|
425
424
|
export declare enum BasicTxErrorType {
|
|
426
|
-
NOT_ENOUGH_FEE = "NOT_ENOUGH_FEE",
|
|
427
425
|
NOT_ENOUGH_BALANCE = "NOT_ENOUGH_BALANCE",
|
|
428
426
|
CHAIN_DISCONNECTED = "CHAIN_DISCONNECTED",
|
|
429
427
|
INVALID_PARAMS = "INVALID_PARAMS",
|
|
@@ -437,12 +435,11 @@ export declare enum BasicTxErrorType {
|
|
|
437
435
|
NOT_ENOUGH_EXISTENTIAL_DEPOSIT = "NOT_ENOUGH_EXISTENTIAL_DEPOSIT"
|
|
438
436
|
}
|
|
439
437
|
export declare enum StakingTxErrorType {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
CANCEL_COMPOUND_ERROR = "cancelCompoundError"
|
|
438
|
+
NOT_ENOUGH_MIN_STAKE = "NOT_ENOUGH_MIN_STAKE",
|
|
439
|
+
EXCEED_MAX_NOMINATIONS = "EXCEED_MAX_NOMINATIONS",
|
|
440
|
+
EXIST_UNSTAKING_REQUEST = "EXIST_UNSTAKING_REQUEST",
|
|
441
|
+
INVALID_ACTIVE_STAKE = "INVALID_ACTIVE_STAKE",
|
|
442
|
+
EXCEED_MAX_UNSTAKING = "EXCEED_MAX_UNSTAKING"
|
|
446
443
|
}
|
|
447
444
|
export declare enum TransferTxErrorType {
|
|
448
445
|
NOT_ENOUGH_VALUE = "NOT_ENOUGH_VALUE",
|
|
@@ -1045,6 +1042,8 @@ export interface ChainStakingMetadata {
|
|
|
1045
1042
|
inflation?: number;
|
|
1046
1043
|
minJoinNominationPool?: string;
|
|
1047
1044
|
minStake: string;
|
|
1045
|
+
nominatorCount?: number;
|
|
1046
|
+
minPoolBonding?: string;
|
|
1048
1047
|
maxValidatorPerNominator: number;
|
|
1049
1048
|
maxWithdrawalRequestPerValidator: number;
|
|
1050
1049
|
allowCancelUnstaking: boolean;
|
|
@@ -1057,10 +1056,11 @@ export interface NominationInfo {
|
|
|
1057
1056
|
activeStake: string;
|
|
1058
1057
|
hasUnstaking?: boolean;
|
|
1059
1058
|
validatorMinStake?: string;
|
|
1059
|
+
status: StakingStatus;
|
|
1060
1060
|
}
|
|
1061
1061
|
export interface PalletNominationPoolsBondedPoolInner {
|
|
1062
1062
|
points: number;
|
|
1063
|
-
state: 'Open' | 'Destroying';
|
|
1063
|
+
state: 'Open' | 'Destroying' | 'Locked';
|
|
1064
1064
|
memberCounter: number;
|
|
1065
1065
|
roles: {
|
|
1066
1066
|
depositor: string;
|
|
@@ -1086,9 +1086,16 @@ export interface UnstakingInfo {
|
|
|
1086
1086
|
waitingTime: number;
|
|
1087
1087
|
validatorAddress?: string;
|
|
1088
1088
|
}
|
|
1089
|
+
export declare enum StakingStatus {
|
|
1090
|
+
EARNING_REWARD = "EARNING_REWARD",
|
|
1091
|
+
PARTIALLY_EARNING = "PARTIALLY_EARNING",
|
|
1092
|
+
NOT_EARNING = "NOT_EARNING",
|
|
1093
|
+
WAITING = "WAITING"
|
|
1094
|
+
}
|
|
1089
1095
|
export interface NominatorMetadata {
|
|
1090
1096
|
chain: string;
|
|
1091
1097
|
type: StakingType;
|
|
1098
|
+
status: StakingStatus;
|
|
1092
1099
|
address: string;
|
|
1093
1100
|
activeStake: string;
|
|
1094
1101
|
nominations: NominationInfo[];
|
|
@@ -1111,33 +1118,12 @@ export interface ValidatorInfo {
|
|
|
1111
1118
|
icon?: string;
|
|
1112
1119
|
isCrowded: boolean;
|
|
1113
1120
|
}
|
|
1114
|
-
export interface NominationPoolMetadata {
|
|
1115
|
-
id: string;
|
|
1116
|
-
identity?: string;
|
|
1117
|
-
address: string;
|
|
1118
|
-
memberCount: number;
|
|
1119
|
-
bondedAmount: string;
|
|
1120
|
-
}
|
|
1121
|
-
export interface NominatorInfo {
|
|
1122
|
-
chain: string;
|
|
1123
|
-
address: string;
|
|
1124
|
-
isBondedBefore: boolean;
|
|
1125
|
-
bondedValidators: string[];
|
|
1126
|
-
bondedPool: string[];
|
|
1127
|
-
}
|
|
1128
|
-
export interface ChainBondingInfo {
|
|
1129
|
-
chain: string;
|
|
1130
|
-
estimatedReturn: number;
|
|
1131
|
-
activeNominatorCount: number;
|
|
1132
|
-
totalNominatorCount: number;
|
|
1133
|
-
unbondingPeriod: number;
|
|
1134
|
-
totalStake: string;
|
|
1135
|
-
}
|
|
1136
1121
|
export interface BondingSubmitParams extends BaseRequestSign {
|
|
1137
1122
|
chain: string;
|
|
1138
1123
|
type: StakingType;
|
|
1139
1124
|
nominatorMetadata?: NominatorMetadata;
|
|
1140
1125
|
amount: string;
|
|
1126
|
+
address: string;
|
|
1141
1127
|
selectedValidators: ValidatorInfo[];
|
|
1142
1128
|
lockPeriod?: number;
|
|
1143
1129
|
}
|
|
@@ -1346,6 +1332,9 @@ export interface Notification {
|
|
|
1346
1332
|
};
|
|
1347
1333
|
}
|
|
1348
1334
|
export declare type NotificationParams = Omit<Notification, 'id'>;
|
|
1335
|
+
export interface CronReloadRequest {
|
|
1336
|
+
data: 'nft' | 'staking';
|
|
1337
|
+
}
|
|
1349
1338
|
export interface KoniRequestSignatures {
|
|
1350
1339
|
'pri(staking.submitTuringCancelCompound)': [RequestTuringCancelStakeCompound, SWTransactionResponse];
|
|
1351
1340
|
'pri(staking.submitTuringCompound)': [RequestTuringStakeCompound, SWTransactionResponse];
|
|
@@ -1383,7 +1372,7 @@ export interface KoniRequestSignatures {
|
|
|
1383
1372
|
'pri(assetSetting.update)': [AssetSettingUpdateReq, boolean];
|
|
1384
1373
|
'pri(evmNft.submitTransaction)': [NftTransactionRequest, SWTransactionResponse];
|
|
1385
1374
|
'pri(evmNft.getTransaction)': [NftTransactionRequest, EvmNftTransaction];
|
|
1386
|
-
'pri(substrateNft.submitTransaction)': [
|
|
1375
|
+
'pri(substrateNft.submitTransaction)': [NftTransactionRequest, SWTransactionResponse];
|
|
1387
1376
|
'pri(substrateNft.getTransaction)': [NftTransactionRequest, SubstrateNftTransaction];
|
|
1388
1377
|
'pri(nft.getNft)': [null, NftJson];
|
|
1389
1378
|
'pri(nft.getSubscription)': [RequestSubscribeNft, NftJson, NftJson];
|
|
@@ -1427,10 +1416,9 @@ export interface KoniRequestSignatures {
|
|
|
1427
1416
|
'pri(accounts.subscribeWithCurrentAddress)': [RequestAccountSubscribe, AccountsWithCurrentAddress, AccountsWithCurrentAddress];
|
|
1428
1417
|
'pri(accounts.subscribeAccountsInputAddress)': [RequestAccountSubscribe, string, OptionInputAddress];
|
|
1429
1418
|
'pri(accounts.saveRecent)': [RequestSaveRecentAccount, SingleAddress];
|
|
1430
|
-
'pri(accounts.triggerSubscription)': [null, boolean];
|
|
1431
1419
|
'pri(accounts.get.meta)': [RequestAccountMeta, ResponseAccountMeta];
|
|
1432
1420
|
'pri(accounts.updateCurrentAddress)': [string, boolean];
|
|
1433
|
-
'pri(currentAccount.saveAddress)': [RequestCurrentAccountAddress,
|
|
1421
|
+
'pri(currentAccount.saveAddress)': [RequestCurrentAccountAddress, CurrentAccountInfo];
|
|
1434
1422
|
'pri(settings.changeBalancesVisibility)': [null, boolean, UiSettings];
|
|
1435
1423
|
'pri(settings.subscribe)': [null, UiSettings, UiSettings];
|
|
1436
1424
|
'pri(settings.saveAccountAllLogo)': [string, boolean, UiSettings];
|
|
@@ -1479,6 +1467,7 @@ export interface KoniRequestSignatures {
|
|
|
1479
1467
|
'pri(transactions.getOne)': [RequestGetTransaction, SWTransactionResult];
|
|
1480
1468
|
'pri(transactions.subscribe)': [null, Record<string, SWTransactionResult>, Record<string, SWTransactionResult>];
|
|
1481
1469
|
'pri(notifications.subscribe)': [null, Notification[], Notification[]];
|
|
1470
|
+
'pri(cron.reload)': [CronReloadRequest, boolean];
|
|
1482
1471
|
'mobile(ping)': [null, string];
|
|
1483
1472
|
'mobile(cronAndSubscription.init)': [RequestInitCronAndSubscription, ActiveCronAndSubscriptionMap];
|
|
1484
1473
|
'mobile(cronAndSubscription.activeService.subscribe)': [null, ActiveCronAndSubscriptionMap, ActiveCronAndSubscriptionMap];
|
package/background/KoniTypes.js
CHANGED
|
@@ -90,7 +90,6 @@ export let ExtrinsicStatus;
|
|
|
90
90
|
})(ExtrinsicStatus || (ExtrinsicStatus = {}));
|
|
91
91
|
export let BasicTxErrorType;
|
|
92
92
|
(function (BasicTxErrorType) {
|
|
93
|
-
BasicTxErrorType["NOT_ENOUGH_FEE"] = "NOT_ENOUGH_FEE";
|
|
94
93
|
BasicTxErrorType["NOT_ENOUGH_BALANCE"] = "NOT_ENOUGH_BALANCE";
|
|
95
94
|
BasicTxErrorType["CHAIN_DISCONNECTED"] = "CHAIN_DISCONNECTED";
|
|
96
95
|
BasicTxErrorType["INVALID_PARAMS"] = "INVALID_PARAMS";
|
|
@@ -105,12 +104,11 @@ export let BasicTxErrorType;
|
|
|
105
104
|
})(BasicTxErrorType || (BasicTxErrorType = {}));
|
|
106
105
|
export let StakingTxErrorType;
|
|
107
106
|
(function (StakingTxErrorType) {
|
|
108
|
-
StakingTxErrorType["
|
|
109
|
-
StakingTxErrorType["
|
|
110
|
-
StakingTxErrorType["
|
|
111
|
-
StakingTxErrorType["
|
|
112
|
-
StakingTxErrorType["
|
|
113
|
-
StakingTxErrorType["CANCEL_COMPOUND_ERROR"] = "cancelCompoundError";
|
|
107
|
+
StakingTxErrorType["NOT_ENOUGH_MIN_STAKE"] = "NOT_ENOUGH_MIN_STAKE";
|
|
108
|
+
StakingTxErrorType["EXCEED_MAX_NOMINATIONS"] = "EXCEED_MAX_NOMINATIONS";
|
|
109
|
+
StakingTxErrorType["EXIST_UNSTAKING_REQUEST"] = "EXIST_UNSTAKING_REQUEST";
|
|
110
|
+
StakingTxErrorType["INVALID_ACTIVE_STAKE"] = "INVALID_ACTIVE_STAKE";
|
|
111
|
+
StakingTxErrorType["EXCEED_MAX_UNSTAKING"] = "EXCEED_MAX_UNSTAKING";
|
|
114
112
|
})(StakingTxErrorType || (StakingTxErrorType = {}));
|
|
115
113
|
export let TransferTxErrorType;
|
|
116
114
|
(function (TransferTxErrorType) {
|
|
@@ -204,6 +202,13 @@ export let UnstakingStatus;
|
|
|
204
202
|
UnstakingStatus["CLAIMABLE"] = "CLAIMABLE";
|
|
205
203
|
UnstakingStatus["UNLOCKING"] = "UNLOCKING";
|
|
206
204
|
})(UnstakingStatus || (UnstakingStatus = {}));
|
|
205
|
+
export let StakingStatus;
|
|
206
|
+
(function (StakingStatus) {
|
|
207
|
+
StakingStatus["EARNING_REWARD"] = "EARNING_REWARD";
|
|
208
|
+
StakingStatus["PARTIALLY_EARNING"] = "PARTIALLY_EARNING";
|
|
209
|
+
StakingStatus["NOT_EARNING"] = "NOT_EARNING";
|
|
210
|
+
StakingStatus["WAITING"] = "WAITING";
|
|
211
|
+
})(StakingStatus || (StakingStatus = {}));
|
|
207
212
|
export let ChainEditStandard;
|
|
208
213
|
|
|
209
214
|
// ChainService
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { SWError } from '@subwallet/extension-base/background/errors/SWError';
|
|
5
|
-
import { BasicTxErrorType } from '@subwallet/extension-base/background/KoniTypes';
|
|
5
|
+
import { BasicTxErrorType, StakingTxErrorType } from '@subwallet/extension-base/background/KoniTypes';
|
|
6
6
|
|
|
7
7
|
// Todo: finish this map in the future
|
|
8
8
|
const defaultErrorMap = {
|
|
@@ -49,6 +49,26 @@ const defaultErrorMap = {
|
|
|
49
49
|
[BasicTxErrorType.UNSUPPORTED]: {
|
|
50
50
|
message: 'This transaction is not supported',
|
|
51
51
|
code: undefined
|
|
52
|
+
},
|
|
53
|
+
[StakingTxErrorType.NOT_ENOUGH_MIN_STAKE]: {
|
|
54
|
+
message: 'Not enough min stake',
|
|
55
|
+
code: undefined
|
|
56
|
+
},
|
|
57
|
+
[StakingTxErrorType.EXCEED_MAX_NOMINATIONS]: {
|
|
58
|
+
message: 'Exceed max nominations',
|
|
59
|
+
code: undefined
|
|
60
|
+
},
|
|
61
|
+
[StakingTxErrorType.EXIST_UNSTAKING_REQUEST]: {
|
|
62
|
+
message: 'Exist unstaking request',
|
|
63
|
+
code: undefined
|
|
64
|
+
},
|
|
65
|
+
[StakingTxErrorType.INVALID_ACTIVE_STAKE]: {
|
|
66
|
+
message: 'Invalid active stake',
|
|
67
|
+
code: undefined
|
|
68
|
+
},
|
|
69
|
+
[StakingTxErrorType.EXCEED_MAX_UNSTAKING]: {
|
|
70
|
+
message: 'Exceed max unstaking',
|
|
71
|
+
code: undefined
|
|
52
72
|
}
|
|
53
73
|
};
|
|
54
74
|
export class TransactionError extends SWError {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.UnstakingStatus = exports.TransferTxErrorType = exports.TransactionDirection = exports.ThemeNames = exports.StakingType = exports.StakingTxErrorType = exports.RMRK_VER = exports.ProviderErrorType = exports.NotificationType = exports.NETWORK_STATUS = exports.NETWORK_ERROR = exports.ExtrinsicType = exports.ExtrinsicStatus = exports.ExternalRequestPromiseStatus = exports.EvmProviderErrorType = exports.CrowdloanParaState = exports.ContractType = exports.ChainType = exports.ChainEditStandard = exports.BasicTxWarningCode = exports.BasicTxErrorType = exports.BalanceErrorType = exports.AccountExternalErrorCode = exports.APIItemState = void 0;
|
|
6
|
+
exports.UnstakingStatus = exports.TransferTxErrorType = exports.TransactionDirection = exports.ThemeNames = exports.StakingType = exports.StakingTxErrorType = exports.StakingStatus = exports.RMRK_VER = exports.ProviderErrorType = exports.NotificationType = exports.NETWORK_STATUS = exports.NETWORK_ERROR = exports.ExtrinsicType = exports.ExtrinsicStatus = exports.ExternalRequestPromiseStatus = exports.EvmProviderErrorType = exports.CrowdloanParaState = exports.ContractType = exports.ChainType = exports.ChainEditStandard = exports.BasicTxWarningCode = exports.BasicTxErrorType = exports.BalanceErrorType = exports.AccountExternalErrorCode = exports.APIItemState = void 0;
|
|
7
7
|
// Copyright 2019-2022 @polkadot/extension-koni authors & contributors
|
|
8
8
|
// SPDX-License-Identifier: Apache-2.0
|
|
9
9
|
/// Request Auth
|
|
@@ -95,7 +95,6 @@ exports.ExtrinsicStatus = ExtrinsicStatus;
|
|
|
95
95
|
let BasicTxErrorType;
|
|
96
96
|
exports.BasicTxErrorType = BasicTxErrorType;
|
|
97
97
|
(function (BasicTxErrorType) {
|
|
98
|
-
BasicTxErrorType["NOT_ENOUGH_FEE"] = "NOT_ENOUGH_FEE";
|
|
99
98
|
BasicTxErrorType["NOT_ENOUGH_BALANCE"] = "NOT_ENOUGH_BALANCE";
|
|
100
99
|
BasicTxErrorType["CHAIN_DISCONNECTED"] = "CHAIN_DISCONNECTED";
|
|
101
100
|
BasicTxErrorType["INVALID_PARAMS"] = "INVALID_PARAMS";
|
|
@@ -111,12 +110,11 @@ exports.BasicTxErrorType = BasicTxErrorType;
|
|
|
111
110
|
let StakingTxErrorType;
|
|
112
111
|
exports.StakingTxErrorType = StakingTxErrorType;
|
|
113
112
|
(function (StakingTxErrorType) {
|
|
114
|
-
StakingTxErrorType["
|
|
115
|
-
StakingTxErrorType["
|
|
116
|
-
StakingTxErrorType["
|
|
117
|
-
StakingTxErrorType["
|
|
118
|
-
StakingTxErrorType["
|
|
119
|
-
StakingTxErrorType["CANCEL_COMPOUND_ERROR"] = "cancelCompoundError";
|
|
113
|
+
StakingTxErrorType["NOT_ENOUGH_MIN_STAKE"] = "NOT_ENOUGH_MIN_STAKE";
|
|
114
|
+
StakingTxErrorType["EXCEED_MAX_NOMINATIONS"] = "EXCEED_MAX_NOMINATIONS";
|
|
115
|
+
StakingTxErrorType["EXIST_UNSTAKING_REQUEST"] = "EXIST_UNSTAKING_REQUEST";
|
|
116
|
+
StakingTxErrorType["INVALID_ACTIVE_STAKE"] = "INVALID_ACTIVE_STAKE";
|
|
117
|
+
StakingTxErrorType["EXCEED_MAX_UNSTAKING"] = "EXCEED_MAX_UNSTAKING";
|
|
120
118
|
})(StakingTxErrorType || (exports.StakingTxErrorType = StakingTxErrorType = {}));
|
|
121
119
|
let TransferTxErrorType;
|
|
122
120
|
exports.TransferTxErrorType = TransferTxErrorType;
|
|
@@ -211,6 +209,14 @@ exports.UnstakingStatus = UnstakingStatus;
|
|
|
211
209
|
UnstakingStatus["CLAIMABLE"] = "CLAIMABLE";
|
|
212
210
|
UnstakingStatus["UNLOCKING"] = "UNLOCKING";
|
|
213
211
|
})(UnstakingStatus || (exports.UnstakingStatus = UnstakingStatus = {}));
|
|
212
|
+
let StakingStatus;
|
|
213
|
+
exports.StakingStatus = StakingStatus;
|
|
214
|
+
(function (StakingStatus) {
|
|
215
|
+
StakingStatus["EARNING_REWARD"] = "EARNING_REWARD";
|
|
216
|
+
StakingStatus["PARTIALLY_EARNING"] = "PARTIALLY_EARNING";
|
|
217
|
+
StakingStatus["NOT_EARNING"] = "NOT_EARNING";
|
|
218
|
+
StakingStatus["WAITING"] = "WAITING";
|
|
219
|
+
})(StakingStatus || (exports.StakingStatus = StakingStatus = {}));
|
|
214
220
|
let ChainEditStandard; // ChainService
|
|
215
221
|
// for custom network
|
|
216
222
|
exports.ChainEditStandard = ChainEditStandard;
|
|
@@ -54,6 +54,26 @@ const defaultErrorMap = {
|
|
|
54
54
|
[_KoniTypes.BasicTxErrorType.UNSUPPORTED]: {
|
|
55
55
|
message: 'This transaction is not supported',
|
|
56
56
|
code: undefined
|
|
57
|
+
},
|
|
58
|
+
[_KoniTypes.StakingTxErrorType.NOT_ENOUGH_MIN_STAKE]: {
|
|
59
|
+
message: 'Not enough min stake',
|
|
60
|
+
code: undefined
|
|
61
|
+
},
|
|
62
|
+
[_KoniTypes.StakingTxErrorType.EXCEED_MAX_NOMINATIONS]: {
|
|
63
|
+
message: 'Exceed max nominations',
|
|
64
|
+
code: undefined
|
|
65
|
+
},
|
|
66
|
+
[_KoniTypes.StakingTxErrorType.EXIST_UNSTAKING_REQUEST]: {
|
|
67
|
+
message: 'Exist unstaking request',
|
|
68
|
+
code: undefined
|
|
69
|
+
},
|
|
70
|
+
[_KoniTypes.StakingTxErrorType.INVALID_ACTIVE_STAKE]: {
|
|
71
|
+
message: 'Invalid active stake',
|
|
72
|
+
code: undefined
|
|
73
|
+
},
|
|
74
|
+
[_KoniTypes.StakingTxErrorType.EXCEED_MAX_UNSTAKING]: {
|
|
75
|
+
message: 'Exceed max unstaking',
|
|
76
|
+
code: undefined
|
|
57
77
|
}
|
|
58
78
|
};
|
|
59
79
|
class TransactionError extends _SWError.SWError {
|
package/cjs/constants/index.js
CHANGED
|
@@ -5,31 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
CRON_REFRESH_PRICE_INTERVAL: true,
|
|
8
|
-
DOTSAMA_API_TIMEOUT: true,
|
|
9
|
-
DOTSAMA_AUTO_CONNECT_MS: true,
|
|
10
|
-
DOTSAMA_MAX_CONTINUE_RETRY: true,
|
|
11
8
|
CRON_AUTO_RECOVER_DOTSAMA_INTERVAL: true,
|
|
12
9
|
CRON_AUTO_RECOVER_WEB3_INTERVAL: true,
|
|
13
10
|
ACALA_REFRESH_CROWDLOAN_INTERVAL: true,
|
|
14
|
-
ACALA_REFRESH_BALANCE_INTERVAL: true,
|
|
15
11
|
ASTAR_REFRESH_BALANCE_INTERVAL: true,
|
|
16
12
|
SUB_TOKEN_REFRESH_BALANCE_INTERVAL: true,
|
|
17
|
-
SUBSCRIBE_BALANCE_FAST_INTERVAL: true,
|
|
18
13
|
CRON_REFRESH_NFT_INTERVAL: true,
|
|
19
14
|
CRON_REFRESH_STAKING_REWARD_INTERVAL: true,
|
|
20
15
|
CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL: true,
|
|
21
16
|
CRON_REFRESH_HISTORY_INTERVAL: true,
|
|
22
17
|
CRON_GET_API_MAP_STATUS: true,
|
|
23
|
-
CRON_REFRESH_STAKING_DATA: true,
|
|
24
18
|
CRON_REFRESH_CHAIN_STAKING_METADATA: true,
|
|
25
19
|
CRON_REFRESH_CHAIN_NOMINATOR_METADATA: true,
|
|
26
20
|
ALL_ACCOUNT_KEY: true,
|
|
27
21
|
ALL_NETWORK_KEY: true,
|
|
28
22
|
ALL_GENESIS_HASH: true,
|
|
29
23
|
IGNORE_GET_SUBSTRATE_FEATURES_LIST: true,
|
|
30
|
-
IGNORE_QR_SIGNER: true
|
|
24
|
+
IGNORE_QR_SIGNER: true,
|
|
25
|
+
DEFAULT_TIME_AUTO_LOCK: true
|
|
31
26
|
};
|
|
32
|
-
exports.SUB_TOKEN_REFRESH_BALANCE_INTERVAL = exports.
|
|
27
|
+
exports.SUB_TOKEN_REFRESH_BALANCE_INTERVAL = exports.IGNORE_QR_SIGNER = exports.IGNORE_GET_SUBSTRATE_FEATURES_LIST = exports.DEFAULT_TIME_AUTO_LOCK = exports.CRON_REFRESH_STAKING_REWARD_INTERVAL = exports.CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL = exports.CRON_REFRESH_PRICE_INTERVAL = exports.CRON_REFRESH_NFT_INTERVAL = exports.CRON_REFRESH_HISTORY_INTERVAL = exports.CRON_REFRESH_CHAIN_STAKING_METADATA = exports.CRON_REFRESH_CHAIN_NOMINATOR_METADATA = exports.CRON_GET_API_MAP_STATUS = exports.CRON_AUTO_RECOVER_WEB3_INTERVAL = exports.CRON_AUTO_RECOVER_DOTSAMA_INTERVAL = exports.ASTAR_REFRESH_BALANCE_INTERVAL = exports.ALL_NETWORK_KEY = exports.ALL_GENESIS_HASH = exports.ALL_ACCOUNT_KEY = exports.ACALA_REFRESH_CROWDLOAN_INTERVAL = void 0;
|
|
33
28
|
var _staking = require("./staking");
|
|
34
29
|
Object.keys(_staking).forEach(function (key) {
|
|
35
30
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -47,41 +42,29 @@ Object.keys(_staking).forEach(function (key) {
|
|
|
47
42
|
|
|
48
43
|
const CRON_REFRESH_PRICE_INTERVAL = 30000;
|
|
49
44
|
exports.CRON_REFRESH_PRICE_INTERVAL = CRON_REFRESH_PRICE_INTERVAL;
|
|
50
|
-
const DOTSAMA_API_TIMEOUT = 30000;
|
|
51
|
-
exports.DOTSAMA_API_TIMEOUT = DOTSAMA_API_TIMEOUT;
|
|
52
|
-
const DOTSAMA_AUTO_CONNECT_MS = 3000;
|
|
53
|
-
exports.DOTSAMA_AUTO_CONNECT_MS = DOTSAMA_AUTO_CONNECT_MS;
|
|
54
|
-
const DOTSAMA_MAX_CONTINUE_RETRY = 2;
|
|
55
|
-
exports.DOTSAMA_MAX_CONTINUE_RETRY = DOTSAMA_MAX_CONTINUE_RETRY;
|
|
56
45
|
const CRON_AUTO_RECOVER_DOTSAMA_INTERVAL = 60000;
|
|
57
46
|
exports.CRON_AUTO_RECOVER_DOTSAMA_INTERVAL = CRON_AUTO_RECOVER_DOTSAMA_INTERVAL;
|
|
58
47
|
const CRON_AUTO_RECOVER_WEB3_INTERVAL = 90000;
|
|
59
48
|
exports.CRON_AUTO_RECOVER_WEB3_INTERVAL = CRON_AUTO_RECOVER_WEB3_INTERVAL;
|
|
60
49
|
const ACALA_REFRESH_CROWDLOAN_INTERVAL = 300000;
|
|
61
50
|
exports.ACALA_REFRESH_CROWDLOAN_INTERVAL = ACALA_REFRESH_CROWDLOAN_INTERVAL;
|
|
62
|
-
const
|
|
63
|
-
exports.ACALA_REFRESH_BALANCE_INTERVAL = ACALA_REFRESH_BALANCE_INTERVAL;
|
|
64
|
-
const ASTAR_REFRESH_BALANCE_INTERVAL = 30000;
|
|
51
|
+
const ASTAR_REFRESH_BALANCE_INTERVAL = 60000;
|
|
65
52
|
exports.ASTAR_REFRESH_BALANCE_INTERVAL = ASTAR_REFRESH_BALANCE_INTERVAL;
|
|
66
|
-
const SUB_TOKEN_REFRESH_BALANCE_INTERVAL =
|
|
53
|
+
const SUB_TOKEN_REFRESH_BALANCE_INTERVAL = 60000;
|
|
67
54
|
exports.SUB_TOKEN_REFRESH_BALANCE_INTERVAL = SUB_TOKEN_REFRESH_BALANCE_INTERVAL;
|
|
68
|
-
const
|
|
69
|
-
exports.SUBSCRIBE_BALANCE_FAST_INTERVAL = SUBSCRIBE_BALANCE_FAST_INTERVAL;
|
|
70
|
-
const CRON_REFRESH_NFT_INTERVAL = 900000;
|
|
55
|
+
const CRON_REFRESH_NFT_INTERVAL = 7200000;
|
|
71
56
|
exports.CRON_REFRESH_NFT_INTERVAL = CRON_REFRESH_NFT_INTERVAL;
|
|
72
57
|
const CRON_REFRESH_STAKING_REWARD_INTERVAL = 900000;
|
|
73
58
|
exports.CRON_REFRESH_STAKING_REWARD_INTERVAL = CRON_REFRESH_STAKING_REWARD_INTERVAL;
|
|
74
|
-
const CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL =
|
|
59
|
+
const CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL = 300000;
|
|
75
60
|
exports.CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL = CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL;
|
|
76
|
-
const CRON_REFRESH_HISTORY_INTERVAL =
|
|
61
|
+
const CRON_REFRESH_HISTORY_INTERVAL = 900000;
|
|
77
62
|
exports.CRON_REFRESH_HISTORY_INTERVAL = CRON_REFRESH_HISTORY_INTERVAL;
|
|
78
|
-
const CRON_GET_API_MAP_STATUS =
|
|
63
|
+
const CRON_GET_API_MAP_STATUS = 10000;
|
|
79
64
|
exports.CRON_GET_API_MAP_STATUS = CRON_GET_API_MAP_STATUS;
|
|
80
|
-
const CRON_REFRESH_STAKING_DATA = 30000;
|
|
81
|
-
exports.CRON_REFRESH_STAKING_DATA = CRON_REFRESH_STAKING_DATA;
|
|
82
65
|
const CRON_REFRESH_CHAIN_STAKING_METADATA = 900000;
|
|
83
66
|
exports.CRON_REFRESH_CHAIN_STAKING_METADATA = CRON_REFRESH_CHAIN_STAKING_METADATA;
|
|
84
|
-
const CRON_REFRESH_CHAIN_NOMINATOR_METADATA =
|
|
67
|
+
const CRON_REFRESH_CHAIN_NOMINATOR_METADATA = 1800000;
|
|
85
68
|
exports.CRON_REFRESH_CHAIN_NOMINATOR_METADATA = CRON_REFRESH_CHAIN_NOMINATOR_METADATA;
|
|
86
69
|
const ALL_ACCOUNT_KEY = 'ALL';
|
|
87
70
|
exports.ALL_ACCOUNT_KEY = ALL_ACCOUNT_KEY;
|
|
@@ -92,4 +75,6 @@ exports.ALL_GENESIS_HASH = ALL_GENESIS_HASH;
|
|
|
92
75
|
const IGNORE_GET_SUBSTRATE_FEATURES_LIST = ['astarEvm', 'ethereum', 'ethereum_goerli', 'binance', 'binance_test', 'boba_rinkeby', 'boba', 'bobabase', 'bobabeam'];
|
|
93
76
|
exports.IGNORE_GET_SUBSTRATE_FEATURES_LIST = IGNORE_GET_SUBSTRATE_FEATURES_LIST;
|
|
94
77
|
const IGNORE_QR_SIGNER = [];
|
|
95
|
-
exports.IGNORE_QR_SIGNER = IGNORE_QR_SIGNER;
|
|
78
|
+
exports.IGNORE_QR_SIGNER = IGNORE_QR_SIGNER;
|
|
79
|
+
const DEFAULT_TIME_AUTO_LOCK = 15 * 60 * 1000;
|
|
80
|
+
exports.DEFAULT_TIME_AUTO_LOCK = DEFAULT_TIME_AUTO_LOCK;
|