@subwallet/extension-base 1.1.33-0 → 1.1.33-beta.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/background/KoniTypes.d.ts +120 -69
- package/background/KoniTypes.js +22 -13
- package/background/errors/TransactionError.js +9 -0
- package/cjs/background/KoniTypes.js +23 -16
- package/cjs/background/errors/TransactionError.js +9 -0
- package/cjs/constants/index.js +19 -4
- package/cjs/koni/api/dotsama/balance.js +464 -0
- package/cjs/koni/api/nft/config.js +33 -23
- package/cjs/koni/api/nft/index.js +14 -0
- package/cjs/koni/api/nft/nft.js +1 -22
- package/cjs/koni/api/nft/ordinal_nft/constants.js +21 -0
- package/cjs/koni/api/nft/ordinal_nft/index.js +121 -0
- package/cjs/koni/api/nft/ordinal_nft/utils.js +41 -0
- package/cjs/koni/api/staking/bonding/amplitude.js +31 -28
- package/cjs/koni/api/staking/bonding/astar.js +11 -10
- package/cjs/koni/api/staking/bonding/index.js +4 -1
- package/cjs/koni/api/staking/bonding/paraChain.js +25 -23
- package/cjs/koni/api/staking/bonding/relayChain.js +48 -45
- package/cjs/koni/api/staking/bonding/utils.js +104 -86
- package/cjs/koni/api/staking/index.js +6 -5
- package/cjs/koni/api/staking/paraChain.js +6 -5
- package/cjs/koni/api/staking/relayChain.js +3 -2
- package/cjs/koni/api/yield/helper/utils.js +49 -0
- package/cjs/koni/background/cron.js +3 -21
- package/cjs/koni/background/handlers/Extension.js +368 -69
- package/cjs/koni/background/handlers/State.js +18 -12
- package/cjs/koni/background/handlers/index.js +4 -2
- package/cjs/koni/background/subscription.js +7 -104
- package/cjs/services/campaign-service/index.js +9 -6
- package/cjs/services/chain-service/constants.js +4 -17
- package/cjs/services/chain-service/handler/SubstrateApi.js +10 -5
- package/cjs/services/chain-service/index.js +123 -39
- package/cjs/services/chain-service/utils.js +75 -1
- package/cjs/services/earning-service/constants/chains.js +30 -0
- package/cjs/services/earning-service/constants/index.js +27 -0
- package/cjs/services/earning-service/constants/step.js +18 -0
- package/cjs/services/earning-service/handlers/base.js +262 -0
- package/cjs/services/earning-service/handlers/index.js +60 -0
- package/cjs/services/earning-service/handlers/lending/base.js +81 -0
- package/cjs/services/earning-service/handlers/lending/index.js +13 -0
- package/cjs/services/earning-service/handlers/lending/interlay.js +192 -0
- package/cjs/services/earning-service/handlers/liquid-staking/acala.js +240 -0
- package/cjs/services/earning-service/handlers/liquid-staking/base.js +98 -0
- package/cjs/services/earning-service/handlers/liquid-staking/bifrost-manta.js +140 -0
- package/cjs/services/earning-service/handlers/liquid-staking/bifrost.js +299 -0
- package/cjs/services/earning-service/handlers/liquid-staking/index.js +41 -0
- package/cjs/services/earning-service/handlers/liquid-staking/parallel.js +227 -0
- package/cjs/services/earning-service/handlers/liquid-staking/stella-swap.js +404 -0
- package/cjs/services/earning-service/handlers/native-staking/amplitude.js +434 -0
- package/cjs/services/earning-service/handlers/native-staking/astar.js +466 -0
- package/cjs/services/earning-service/handlers/native-staking/base-para.js +146 -0
- package/cjs/services/earning-service/handlers/native-staking/base.js +161 -0
- package/cjs/services/earning-service/handlers/native-staking/index.js +34 -0
- package/cjs/services/earning-service/handlers/native-staking/para-chain.js +390 -0
- package/cjs/services/earning-service/handlers/native-staking/relay-chain.js +567 -0
- package/cjs/services/earning-service/handlers/nomination-pool/index.js +566 -0
- package/cjs/services/earning-service/handlers/special.js +497 -0
- package/cjs/services/earning-service/service.js +741 -0
- package/cjs/services/earning-service/utils/index.js +128 -0
- package/cjs/services/event-service/index.js +5 -0
- package/cjs/services/keyring-service/index.js +14 -2
- package/cjs/services/migration-service/scripts/DeleteEarningData.js +21 -0
- package/cjs/services/migration-service/scripts/EnableEarningChains.js +21 -0
- package/cjs/services/migration-service/scripts/MigrateEthProvider.js +17 -0
- package/cjs/services/migration-service/scripts/MigrateLedgerAccount.js +1 -1
- package/cjs/services/migration-service/scripts/MigratePioneerProvider.js +17 -0
- package/cjs/services/migration-service/scripts/MigrateProvider.js +29 -0
- package/cjs/services/migration-service/scripts/MigrateTransactionHistory.js +1 -1
- package/cjs/services/migration-service/scripts/databases/MigrateEarningHistory.js +21 -0
- package/cjs/services/migration-service/scripts/databases/MigrateEarningVersion.js +21 -0
- package/cjs/services/migration-service/scripts/index.js +6 -1
- package/cjs/services/mint-campaign-service/campaigns/UnlockDotCampaign.js +149 -0
- package/cjs/services/mint-campaign-service/campaigns/index.js +13 -0
- package/cjs/services/mint-campaign-service/constants.js +11 -0
- package/cjs/services/mint-campaign-service/index.js +18 -0
- package/cjs/services/notification-service/NotificationService.js +1 -1
- package/cjs/services/storage-service/DatabaseService.js +92 -1
- package/cjs/services/storage-service/databases/index.js +7 -0
- package/cjs/services/storage-service/db-stores/AssetRef.js +24 -0
- package/cjs/services/storage-service/db-stores/NominatorMetadata.js +3 -3
- package/cjs/services/storage-service/db-stores/YieldPoolStore.js +36 -0
- package/cjs/services/storage-service/db-stores/YieldPositionStore.js +71 -0
- package/cjs/services/storage-service/index.js +241 -0
- package/cjs/services/subscan-service/index.js +16 -0
- package/cjs/services/transaction-service/event-parser/index.js +58 -0
- package/cjs/services/transaction-service/helpers/index.js +3 -1
- package/cjs/services/transaction-service/index.js +252 -75
- package/cjs/services/transaction-service/utils.js +1 -0
- package/cjs/types/campaigns/index.js +16 -0
- package/cjs/types/campaigns/unlock-dot.js +1 -0
- package/cjs/types/index.js +44 -0
- package/cjs/types/ordinal.js +1 -0
- package/cjs/types/transaction.js +1 -0
- package/cjs/types/yield/actions/index.js +27 -0
- package/cjs/types/yield/actions/join/index.js +38 -0
- package/cjs/types/yield/actions/join/step.js +48 -0
- package/cjs/types/yield/actions/join/submit.js +1 -0
- package/cjs/types/yield/actions/join/validate.js +16 -0
- package/cjs/types/yield/actions/others.js +1 -0
- package/cjs/types/yield/index.js +27 -0
- package/cjs/types/yield/info/account/index.js +49 -0
- package/cjs/types/yield/info/account/info.js +1 -0
- package/cjs/types/yield/info/account/reward.js +1 -0
- package/cjs/types/yield/info/account/target.js +32 -0
- package/cjs/types/yield/info/account/unstake.js +27 -0
- package/cjs/types/yield/info/base.js +41 -0
- package/cjs/types/yield/info/chain/index.js +27 -0
- package/cjs/types/yield/info/chain/info.js +1 -0
- package/cjs/types/yield/info/chain/target.js +1 -0
- package/cjs/types/yield/info/index.js +49 -0
- package/cjs/types/yield/info/pallet.js +15 -0
- package/cjs/types.js +1 -0
- package/cjs/utils/address.js +34 -0
- package/cjs/utils/fetchStaticData.js +2 -1
- package/cjs/utils/index.js +89 -1
- package/cjs/utils/keyring.js +57 -0
- package/cjs/utils/number.js +6 -2
- package/cjs/utils/object.js +12 -0
- package/constants/index.d.ts +6 -1
- package/constants/index.js +6 -1
- package/koni/api/nft/config.js +33 -23
- package/koni/api/nft/index.js +15 -1
- package/koni/api/nft/nft.js +2 -23
- package/koni/api/nft/ordinal_nft/constants.d.ts +9 -0
- package/koni/api/nft/ordinal_nft/constants.js +12 -0
- package/koni/api/nft/ordinal_nft/index.d.ts +8 -0
- package/koni/api/nft/ordinal_nft/index.js +114 -0
- package/koni/api/nft/ordinal_nft/utils.d.ts +2 -0
- package/koni/api/nft/ordinal_nft/utils.js +33 -0
- package/koni/api/staking/bonding/amplitude.js +25 -22
- package/koni/api/staking/bonding/astar.js +9 -8
- package/koni/api/staking/bonding/index.d.ts +1 -1
- package/koni/api/staking/bonding/index.js +5 -1
- package/koni/api/staking/bonding/paraChain.js +12 -10
- package/koni/api/staking/bonding/relayChain.d.ts +2 -2
- package/koni/api/staking/bonding/relayChain.js +33 -30
- package/koni/api/staking/bonding/utils.d.ts +15 -38
- package/koni/api/staking/bonding/utils.js +85 -69
- package/koni/api/staking/index.js +2 -1
- package/koni/api/staking/paraChain.js +7 -6
- package/koni/api/staking/relayChain.js +4 -3
- package/koni/api/yield/helper/utils.d.ts +10 -0
- package/koni/api/yield/helper/utils.js +34 -0
- package/koni/background/cron.d.ts +0 -4
- package/koni/background/cron.js +4 -22
- package/koni/background/handlers/Extension.d.ts +17 -1
- package/koni/background/handlers/Extension.js +327 -30
- package/koni/background/handlers/State.d.ts +6 -1
- package/koni/background/handlers/State.js +17 -12
- package/koni/background/handlers/index.js +4 -2
- package/koni/background/subscription.d.ts +1 -6
- package/koni/background/subscription.js +8 -104
- package/package.json +327 -4
- package/services/campaign-service/index.js +9 -6
- package/services/chain-service/constants.d.ts +1 -12
- package/services/chain-service/constants.js +1 -14
- package/services/chain-service/handler/SubstrateApi.js +10 -5
- package/services/chain-service/index.d.ts +11 -1
- package/services/chain-service/index.js +119 -36
- package/services/chain-service/utils.d.ts +11 -1
- package/services/chain-service/utils.js +71 -2
- package/services/earning-service/constants/abis/compound_finance_v2_abi.json +1235 -0
- package/services/earning-service/constants/abis/st_liquid_token_abi.json +1355 -0
- package/services/earning-service/constants/chains.d.ts +15 -0
- package/services/earning-service/constants/chains.js +22 -0
- package/services/earning-service/constants/index.d.ts +2 -0
- package/services/earning-service/constants/index.js +5 -0
- package/services/earning-service/constants/step.d.ts +3 -0
- package/services/earning-service/constants/step.js +10 -0
- package/services/earning-service/handlers/base.d.ts +113 -0
- package/services/earning-service/handlers/base.js +256 -0
- package/services/earning-service/handlers/index.d.ts +5 -0
- package/services/earning-service/handlers/index.js +8 -0
- package/services/earning-service/handlers/lending/base.d.ts +8 -0
- package/services/earning-service/handlers/lending/base.js +73 -0
- package/services/earning-service/handlers/lending/index.d.ts +1 -0
- package/services/earning-service/handlers/lending/index.js +4 -0
- package/services/earning-service/handlers/lending/interlay.d.ts +24 -0
- package/services/earning-service/handlers/lending/interlay.js +184 -0
- package/services/earning-service/handlers/liquid-staking/acala.d.ts +27 -0
- package/services/earning-service/handlers/liquid-staking/acala.js +232 -0
- package/services/earning-service/handlers/liquid-staking/base.d.ts +11 -0
- package/services/earning-service/handlers/liquid-staking/base.js +90 -0
- package/services/earning-service/handlers/liquid-staking/bifrost-manta.d.ts +37 -0
- package/services/earning-service/handlers/liquid-staking/bifrost-manta.js +132 -0
- package/services/earning-service/handlers/liquid-staking/bifrost.d.ts +46 -0
- package/services/earning-service/handlers/liquid-staking/bifrost.js +288 -0
- package/services/earning-service/handlers/liquid-staking/index.d.ts +5 -0
- package/services/earning-service/handlers/liquid-staking/index.js +8 -0
- package/services/earning-service/handlers/liquid-staking/parallel.d.ts +26 -0
- package/services/earning-service/handlers/liquid-staking/parallel.js +219 -0
- package/services/earning-service/handlers/liquid-staking/stella-swap.d.ts +34 -0
- package/services/earning-service/handlers/liquid-staking/stella-swap.js +394 -0
- package/services/earning-service/handlers/native-staking/amplitude.d.ts +22 -0
- package/services/earning-service/handlers/native-staking/amplitude.js +425 -0
- package/services/earning-service/handlers/native-staking/astar.d.ts +19 -0
- package/services/earning-service/handlers/native-staking/astar.js +456 -0
- package/services/earning-service/handlers/native-staking/base-para.d.ts +11 -0
- package/services/earning-service/handlers/native-staking/base-para.js +138 -0
- package/services/earning-service/handlers/native-staking/base.d.ts +21 -0
- package/services/earning-service/handlers/native-staking/base.js +152 -0
- package/services/earning-service/handlers/native-staking/index.d.ts +4 -0
- package/services/earning-service/handlers/native-staking/index.js +7 -0
- package/services/earning-service/handlers/native-staking/para-chain.d.ts +15 -0
- package/services/earning-service/handlers/native-staking/para-chain.js +382 -0
- package/services/earning-service/handlers/native-staking/relay-chain.d.ts +21 -0
- package/services/earning-service/handlers/native-staking/relay-chain.js +558 -0
- package/services/earning-service/handlers/nomination-pool/index.d.ts +36 -0
- package/services/earning-service/handlers/nomination-pool/index.js +556 -0
- package/services/earning-service/handlers/special.d.ts +64 -0
- package/services/earning-service/handlers/special.js +489 -0
- package/services/earning-service/service.d.ts +94 -0
- package/services/earning-service/service.js +730 -0
- package/services/earning-service/utils/index.d.ts +18 -0
- package/services/earning-service/utils/index.js +112 -0
- package/services/event-service/index.d.ts +2 -0
- package/services/event-service/index.js +5 -0
- package/services/event-service/types.d.ts +9 -0
- package/services/keyring-service/index.d.ts +2 -1
- package/services/keyring-service/index.js +14 -2
- package/services/migration-service/scripts/DeleteEarningData.d.ts +4 -0
- package/services/migration-service/scripts/DeleteEarningData.js +13 -0
- package/services/migration-service/scripts/EnableEarningChains.d.ts +4 -0
- package/services/migration-service/scripts/EnableEarningChains.js +13 -0
- package/services/migration-service/scripts/MigrateLedgerAccount.js +1 -1
- package/services/migration-service/scripts/MigrateTransactionHistory.js +1 -1
- package/services/migration-service/scripts/databases/MigrateEarningHistory.d.ts +4 -0
- package/services/migration-service/scripts/databases/MigrateEarningHistory.js +13 -0
- package/services/migration-service/scripts/databases/MigrateEarningVersion.d.ts +4 -0
- package/services/migration-service/scripts/databases/MigrateEarningVersion.js +13 -0
- package/services/migration-service/scripts/index.js +6 -1
- package/services/mint-campaign-service/campaigns/UnlockDotCampaign.d.ts +13 -0
- package/services/mint-campaign-service/campaigns/UnlockDotCampaign.js +139 -0
- package/services/mint-campaign-service/campaigns/index.d.ts +1 -0
- package/services/mint-campaign-service/campaigns/index.js +4 -0
- package/services/mint-campaign-service/constants.d.ts +1 -0
- package/services/mint-campaign-service/constants.js +4 -0
- package/services/mint-campaign-service/index.d.ts +7 -0
- package/services/mint-campaign-service/index.js +11 -0
- package/services/notification-service/NotificationService.js +1 -1
- package/services/storage-service/DatabaseService.d.ts +30 -3
- package/services/storage-service/DatabaseService.js +91 -1
- package/services/storage-service/databases/index.d.ts +8 -2
- package/services/storage-service/databases/index.js +7 -0
- package/services/storage-service/db-stores/AssetRef.d.ts +7 -0
- package/services/storage-service/db-stores/AssetRef.js +16 -0
- package/services/storage-service/db-stores/NominatorMetadata.js +3 -3
- package/services/storage-service/db-stores/YieldPoolStore.d.ts +10 -0
- package/services/storage-service/db-stores/YieldPoolStore.js +28 -0
- package/services/storage-service/db-stores/YieldPositionStore.d.ts +11 -0
- package/services/storage-service/db-stores/YieldPositionStore.js +63 -0
- package/services/subscan-service/index.d.ts +3 -2
- package/services/subscan-service/index.js +15 -0
- package/services/subscan-service/types.d.ts +20 -0
- package/services/transaction-service/event-parser/index.d.ts +3 -1
- package/services/transaction-service/event-parser/index.js +57 -1
- package/services/transaction-service/helpers/index.js +3 -1
- package/services/transaction-service/index.d.ts +6 -13
- package/services/transaction-service/index.js +250 -73
- package/services/transaction-service/types.d.ts +2 -0
- package/services/transaction-service/utils.js +1 -0
- package/types/campaigns/index.d.ts +1 -0
- package/types/campaigns/index.js +4 -0
- package/types/campaigns/unlock-dot.d.ts +71 -0
- package/types/campaigns/unlock-dot.js +1 -0
- package/types/index.d.ts +5 -0
- package/types/index.js +5 -1
- package/types/ordinal.d.ts +69 -0
- package/types/ordinal.js +1 -0
- package/types/transaction.d.ts +3 -0
- package/types/transaction.js +1 -0
- package/types/yield/actions/index.d.ts +2 -0
- package/types/yield/actions/index.js +5 -0
- package/types/yield/actions/join/index.d.ts +3 -0
- package/types/yield/actions/join/index.js +6 -0
- package/types/yield/actions/join/step.d.ts +96 -0
- package/types/yield/actions/join/step.js +47 -0
- package/types/yield/actions/join/submit.d.ts +58 -0
- package/types/yield/actions/join/submit.js +1 -0
- package/types/yield/actions/join/validate.d.ts +18 -0
- package/types/yield/actions/join/validate.js +10 -0
- package/types/yield/actions/others.d.ts +85 -0
- package/types/yield/actions/others.js +1 -0
- package/types/yield/index.d.ts +2 -0
- package/types/yield/index.js +5 -0
- package/types/yield/info/account/index.d.ts +4 -0
- package/types/yield/info/account/index.js +7 -0
- package/types/yield/info/account/info.d.ts +92 -0
- package/types/yield/info/account/info.js +1 -0
- package/types/yield/info/account/reward.d.ts +47 -0
- package/types/yield/info/account/reward.js +1 -0
- package/types/yield/info/account/target.d.ts +43 -0
- package/types/yield/info/account/target.js +27 -0
- package/types/yield/info/account/unstake.d.ts +31 -0
- package/types/yield/info/account/unstake.js +22 -0
- package/types/yield/info/base.d.ts +45 -0
- package/types/yield/info/base.js +36 -0
- package/types/yield/info/chain/index.d.ts +2 -0
- package/types/yield/info/chain/index.js +5 -0
- package/types/yield/info/chain/info.d.ts +252 -0
- package/types/yield/info/chain/info.js +1 -0
- package/types/yield/info/chain/target.d.ts +37 -0
- package/types/yield/info/chain/target.js +1 -0
- package/types/yield/info/index.d.ts +4 -0
- package/types/yield/info/index.js +7 -0
- package/types/yield/info/pallet.d.ts +143 -0
- package/types/yield/info/pallet.js +9 -0
- package/utils/fetchStaticData.js +2 -1
- package/utils/index.d.ts +5 -0
- package/utils/index.js +52 -0
- package/utils/number.d.ts +2 -1
- package/utils/number.js +2 -1
- package/utils/object.d.ts +1 -0
- package/utils/object.js +6 -0
|
@@ -226,8 +226,9 @@ class ChainService {
|
|
|
226
226
|
getActiveChainInfos() {
|
|
227
227
|
const result = {};
|
|
228
228
|
Object.values(this.getChainStateMap()).forEach(chainState => {
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
const chainInfo = this.getChainInfoByKey(chainState.slug);
|
|
230
|
+
if (chainState.active && chainInfo && chainInfo.chainStatus === _types._ChainStatus.ACTIVE) {
|
|
231
|
+
result[chainState.slug] = chainInfo;
|
|
231
232
|
}
|
|
232
233
|
});
|
|
233
234
|
return result;
|
|
@@ -409,9 +410,9 @@ class ChainService {
|
|
|
409
410
|
await this.eventService.waitDatabaseReady;
|
|
410
411
|
|
|
411
412
|
// TODO: reconsider the flow of initiation
|
|
412
|
-
|
|
413
|
-
this.
|
|
414
|
-
this.dataMap.assetRefMap =
|
|
413
|
+
this.multiChainAssetMapSubject.next(_chainList.MultiChainAssetMap);
|
|
414
|
+
const storedAssetRefMap = await this.dbService.getAssetRefMap();
|
|
415
|
+
this.dataMap.assetRefMap = storedAssetRefMap && Object.values(storedAssetRefMap).length > 0 ? storedAssetRefMap : _chainList.AssetRefMap;
|
|
415
416
|
await this.initChains();
|
|
416
417
|
this.chainInfoMapSubject.next(this.getChainInfoMap());
|
|
417
418
|
this.updateChainStateMapSubscription();
|
|
@@ -419,16 +420,81 @@ class ChainService {
|
|
|
419
420
|
this.xcmRefMapSubject.next(this.dataMap.assetRefMap);
|
|
420
421
|
await this.initApis();
|
|
421
422
|
await this.initAssetSettings();
|
|
423
|
+
this.checkLatestData();
|
|
422
424
|
}
|
|
425
|
+
checkLatestData() {
|
|
426
|
+
clearInterval(this.refreshLatestChainDataTimeOut);
|
|
427
|
+
this.handleLatestData();
|
|
428
|
+
this.handleLatestData();
|
|
429
|
+
this.refreshLatestChainDataTimeOut = setInterval(this.handleLatestData.bind(this), _constants.LATEST_CHAIN_DATA_FETCHING_INTERVAL);
|
|
430
|
+
}
|
|
431
|
+
stopCheckLatestChainData() {
|
|
432
|
+
clearInterval(this.refreshLatestChainDataTimeOut);
|
|
433
|
+
}
|
|
434
|
+
handleLatestProviderData(latestChainInfo) {
|
|
435
|
+
try {
|
|
436
|
+
if (latestChainInfo && latestChainInfo.length > 0) {
|
|
437
|
+
const {
|
|
438
|
+
needUpdateChainApiList,
|
|
439
|
+
storedChainInfoList
|
|
440
|
+
} = (0, _utils.updateLatestChainInfo)(this.dataMap, latestChainInfo);
|
|
441
|
+
this.dbService.bulkUpdateChainStore(storedChainInfoList).catch(console.error);
|
|
442
|
+
this.updateChainSubscription();
|
|
443
|
+
needUpdateChainApiList.forEach(chainInfo => {
|
|
444
|
+
console.log('Updating chain API for', chainInfo.slug);
|
|
445
|
+
this.initApiForChain(chainInfo).catch(console.error);
|
|
446
|
+
});
|
|
447
|
+
this.logger.log('Finished updating latest RPC providers');
|
|
448
|
+
}
|
|
449
|
+
} catch (e) {
|
|
450
|
+
console.error('Error fetching latest chain data');
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
handleLatestBlockedAssetRef(latestBlockedAssetRefList) {
|
|
454
|
+
if (latestBlockedAssetRefList.length > 0) {
|
|
455
|
+
latestBlockedAssetRefList.forEach(blockedAssetRef => {
|
|
456
|
+
delete this.dataMap.assetRefMap[blockedAssetRef];
|
|
457
|
+
});
|
|
458
|
+
} else {
|
|
459
|
+
this.dataMap.assetRefMap = _chainList.AssetRefMap;
|
|
460
|
+
}
|
|
461
|
+
this.dbService.setAssetRef(this.dataMap.assetRefMap).catch(console.error);
|
|
462
|
+
this.xcmRefMapSubject.next(this.dataMap.assetRefMap);
|
|
463
|
+
this.logger.log('Finished updating latest asset ref');
|
|
464
|
+
}
|
|
465
|
+
handleLatestPriceId(latestPriceIds) {
|
|
466
|
+
Object.entries(latestPriceIds).forEach(_ref3 => {
|
|
467
|
+
let [slug, priceId] = _ref3;
|
|
468
|
+
if (this.dataMap.assetRegistry[slug]) {
|
|
469
|
+
this.dataMap.assetRegistry[slug].priceId = priceId;
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
this.assetRegistrySubject.next(this.dataMap.assetRegistry);
|
|
473
|
+
this.eventService.emit('asset.updateState', '');
|
|
474
|
+
this.logger.log('Finished updating latest price IDs');
|
|
475
|
+
}
|
|
476
|
+
handleLatestData() {
|
|
477
|
+
this.fetchLatestChainData().then(latestChainInfo => {
|
|
478
|
+
this.handleLatestProviderData(latestChainInfo);
|
|
479
|
+
}).catch(console.error);
|
|
480
|
+
this.fetchLatestBlockedAssetRef().then(latestAssetRef => {
|
|
481
|
+
this.handleLatestBlockedAssetRef(latestAssetRef);
|
|
482
|
+
}).catch(console.error);
|
|
483
|
+
|
|
484
|
+
// this.fetchLatestPriceIdsData().then((latestPriceIds) => {
|
|
485
|
+
// this.handleLatestPriceId(latestPriceIds);
|
|
486
|
+
// }).catch(console.error);
|
|
487
|
+
}
|
|
488
|
+
|
|
423
489
|
async initApis() {
|
|
424
490
|
const chainInfoMap = this.getChainInfoMap();
|
|
425
491
|
const chainStateMap = this.getChainStateMap();
|
|
426
|
-
await Promise.all(Object.entries(chainInfoMap).filter(
|
|
492
|
+
await Promise.all(Object.entries(chainInfoMap).filter(_ref4 => {
|
|
427
493
|
var _chainStateMap$slug;
|
|
428
|
-
let [slug] =
|
|
494
|
+
let [slug] = _ref4;
|
|
429
495
|
return (_chainStateMap$slug = chainStateMap[slug]) === null || _chainStateMap$slug === void 0 ? void 0 : _chainStateMap$slug.active;
|
|
430
|
-
}).map(
|
|
431
|
-
let [, chainInfo] =
|
|
496
|
+
}).map(_ref5 => {
|
|
497
|
+
let [, chainInfo] = _ref5;
|
|
432
498
|
try {
|
|
433
499
|
return this.initApiForChain(chainInfo);
|
|
434
500
|
} catch (e) {
|
|
@@ -577,8 +643,8 @@ class ChainService {
|
|
|
577
643
|
}
|
|
578
644
|
return duplicatedSlug;
|
|
579
645
|
}
|
|
580
|
-
async
|
|
581
|
-
return
|
|
646
|
+
async fetchLatestChainData() {
|
|
647
|
+
return await (0, _utils2.fetchStaticData)('chains');
|
|
582
648
|
// try {
|
|
583
649
|
// const timeout = new Promise((resolve) => {
|
|
584
650
|
// const id = setTimeout(() => {
|
|
@@ -615,9 +681,16 @@ class ChainService {
|
|
|
615
681
|
// }
|
|
616
682
|
}
|
|
617
683
|
|
|
684
|
+
// @ts-ignore
|
|
685
|
+
async fetchLatestPriceIdsData() {
|
|
686
|
+
return await (0, _utils2.fetchStaticData)('chain-assets/price-map');
|
|
687
|
+
}
|
|
688
|
+
async fetchLatestBlockedAssetRef() {
|
|
689
|
+
return await (0, _utils2.fetchStaticData)('chain-assets/disabled-xcm-channels');
|
|
690
|
+
}
|
|
618
691
|
async initChains() {
|
|
619
692
|
const storedChainSettings = await this.dbService.getAllChainStore();
|
|
620
|
-
const
|
|
693
|
+
const defaultChainInfoMap = _chainList.ChainInfoMap;
|
|
621
694
|
const storedChainSettingMap = {};
|
|
622
695
|
storedChainSettings.forEach(chainStoredSetting => {
|
|
623
696
|
storedChainSettingMap[chainStoredSetting.slug] = chainStoredSetting;
|
|
@@ -626,10 +699,13 @@ class ChainService {
|
|
|
626
699
|
const deprecatedChains = [];
|
|
627
700
|
const deprecatedChainMap = {};
|
|
628
701
|
if (storedChainSettings.length === 0) {
|
|
629
|
-
this.dataMap.chainInfoMap =
|
|
630
|
-
Object.values(
|
|
702
|
+
this.dataMap.chainInfoMap = defaultChainInfoMap;
|
|
703
|
+
Object.values(defaultChainInfoMap).forEach(chainInfo => {
|
|
704
|
+
const {
|
|
705
|
+
providerKey
|
|
706
|
+
} = (0, _utils.randomizeProvider)(chainInfo.providers);
|
|
631
707
|
this.dataMap.chainStateMap[chainInfo.slug] = {
|
|
632
|
-
currentProvider:
|
|
708
|
+
currentProvider: providerKey,
|
|
633
709
|
slug: chainInfo.slug,
|
|
634
710
|
connectionStatus: _types3._ChainConnectionStatus.DISCONNECTED,
|
|
635
711
|
active: _constants._DEFAULT_ACTIVE_CHAINS.includes(chainInfo.slug)
|
|
@@ -639,15 +715,15 @@ class ChainService {
|
|
|
639
715
|
newStorageData.push({
|
|
640
716
|
...chainInfo,
|
|
641
717
|
active: _constants._DEFAULT_ACTIVE_CHAINS.includes(chainInfo.slug),
|
|
642
|
-
currentProvider:
|
|
718
|
+
currentProvider: providerKey
|
|
643
719
|
});
|
|
644
720
|
});
|
|
645
721
|
} else {
|
|
646
|
-
const mergedChainInfoMap =
|
|
722
|
+
const mergedChainInfoMap = defaultChainInfoMap;
|
|
647
723
|
for (const [storedSlug, storedChainInfo] of Object.entries(storedChainSettingMap)) {
|
|
648
|
-
const chainInfo =
|
|
724
|
+
const chainInfo = defaultChainInfoMap[storedSlug];
|
|
649
725
|
|
|
650
|
-
// Network
|
|
726
|
+
// Network existed on change list
|
|
651
727
|
// check predefined chains first, keep setting for providers and currentProvider
|
|
652
728
|
if (chainInfo) {
|
|
653
729
|
// Keep customer provider only
|
|
@@ -662,23 +738,27 @@ class ChainService {
|
|
|
662
738
|
}
|
|
663
739
|
}
|
|
664
740
|
mergedChainInfoMap[storedSlug].providers = providers;
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
}
|
|
741
|
+
const {
|
|
742
|
+
providerKey
|
|
743
|
+
} = (0, _utils.randomizeProvider)(providers);
|
|
744
|
+
let selectedProvider = providerKey;
|
|
745
|
+
const storedProviderKey = storedChainInfo.currentProvider;
|
|
746
|
+
const storedProviderValue = storedChainInfo.providers[storedProviderKey] || '';
|
|
747
|
+
if (storedProviderValue !== null && storedProviderValue !== void 0 && storedProviderValue.startsWith('light') || storedProviderKey !== null && storedProviderKey !== void 0 && storedProviderKey.startsWith(_types3._CUSTOM_PREFIX)) {
|
|
748
|
+
const savedProviderKey = Object.keys(providers).find(key => providers[key] === storedProviderValue);
|
|
749
|
+
if (savedProviderKey) {
|
|
750
|
+
selectedProvider = savedProviderKey;
|
|
676
751
|
}
|
|
677
752
|
}
|
|
753
|
+
|
|
754
|
+
// Merge current provider
|
|
755
|
+
// let currentProvider = storedChainInfo.currentProvider;
|
|
756
|
+
// const providerValue = storedChainInfo.providers[selectedProvider] || '';
|
|
757
|
+
|
|
678
758
|
const hasProvider = Object.values(providers).length > 0;
|
|
679
759
|
const canActive = hasProvider && chainInfo.chainStatus === _types._ChainStatus.ACTIVE;
|
|
680
760
|
this.dataMap.chainStateMap[storedSlug] = {
|
|
681
|
-
currentProvider:
|
|
761
|
+
currentProvider: selectedProvider,
|
|
682
762
|
slug: storedSlug,
|
|
683
763
|
connectionStatus: _types3._ChainConnectionStatus.DISCONNECTED,
|
|
684
764
|
active: canActive && storedChainInfo.active
|
|
@@ -686,13 +766,13 @@ class ChainService {
|
|
|
686
766
|
newStorageData.push({
|
|
687
767
|
...mergedChainInfoMap[storedSlug],
|
|
688
768
|
active: canActive && storedChainInfo.active,
|
|
689
|
-
currentProvider:
|
|
769
|
+
currentProvider: selectedProvider
|
|
690
770
|
});
|
|
691
771
|
} else if ((0, _utils._isCustomChain)(storedSlug)) {
|
|
692
772
|
var _storedChainInfo$subs, _storedChainInfo$evmI;
|
|
693
773
|
// only custom chains are left
|
|
694
774
|
// check custom chain duplicated with predefined chain => merge into predefined chain
|
|
695
|
-
const duplicatedDefaultSlug = this.checkExistedPredefinedChain(
|
|
775
|
+
const duplicatedDefaultSlug = this.checkExistedPredefinedChain(defaultChainInfoMap, (_storedChainInfo$subs = storedChainInfo.substrateInfo) === null || _storedChainInfo$subs === void 0 ? void 0 : _storedChainInfo$subs.genesisHash, (_storedChainInfo$evmI = storedChainInfo.evmInfo) === null || _storedChainInfo$evmI === void 0 ? void 0 : _storedChainInfo$evmI.evmChainId);
|
|
696
776
|
if (duplicatedDefaultSlug.length > 0) {
|
|
697
777
|
// merge custom chain with existed chain
|
|
698
778
|
mergedChainInfoMap[duplicatedDefaultSlug].providers = {
|
|
@@ -717,6 +797,7 @@ class ChainService {
|
|
|
717
797
|
slug: storedSlug,
|
|
718
798
|
name: storedChainInfo.name,
|
|
719
799
|
providers: storedChainInfo.providers,
|
|
800
|
+
// TODO: review
|
|
720
801
|
evmInfo: storedChainInfo.evmInfo,
|
|
721
802
|
substrateInfo: storedChainInfo.substrateInfo,
|
|
722
803
|
isTestnet: storedChainInfo.isTestnet,
|
|
@@ -726,6 +807,7 @@ class ChainService {
|
|
|
726
807
|
};
|
|
727
808
|
this.dataMap.chainStateMap[storedSlug] = {
|
|
728
809
|
currentProvider: storedChainInfo.currentProvider,
|
|
810
|
+
// TODO: review
|
|
729
811
|
slug: storedSlug,
|
|
730
812
|
connectionStatus: _types3._ChainConnectionStatus.DISCONNECTED,
|
|
731
813
|
active: storedChainInfo.active
|
|
@@ -733,7 +815,7 @@ class ChainService {
|
|
|
733
815
|
newStorageData.push({
|
|
734
816
|
...mergedChainInfoMap[storedSlug],
|
|
735
817
|
active: storedChainInfo.active,
|
|
736
|
-
currentProvider: storedChainInfo.currentProvider
|
|
818
|
+
currentProvider: storedChainInfo.currentProvider // TODO: review
|
|
737
819
|
});
|
|
738
820
|
}
|
|
739
821
|
} else {
|
|
@@ -742,8 +824,8 @@ class ChainService {
|
|
|
742
824
|
}
|
|
743
825
|
|
|
744
826
|
// Fill in the missing chainState and storageData (new chains never before seen)
|
|
745
|
-
Object.entries(mergedChainInfoMap).forEach(
|
|
746
|
-
let [slug, chainInfo] =
|
|
827
|
+
Object.entries(mergedChainInfoMap).forEach(_ref6 => {
|
|
828
|
+
let [slug, chainInfo] = _ref6;
|
|
747
829
|
if (!(slug in this.dataMap.chainStateMap)) {
|
|
748
830
|
this.dataMap.chainStateMap[slug] = {
|
|
749
831
|
currentProvider: Object.keys(chainInfo.providers)[0],
|
|
@@ -766,7 +848,7 @@ class ChainService {
|
|
|
766
848
|
}
|
|
767
849
|
async initAssetRegistry(deprecatedCustomChainMap) {
|
|
768
850
|
const storedAssetRegistry = await this.dbService.getAllAssetStore();
|
|
769
|
-
const latestAssetRegistry =
|
|
851
|
+
const latestAssetRegistry = _chainList.ChainAssetMap;
|
|
770
852
|
const availableChains = Object.values(this.dataMap.chainInfoMap).filter(info => info.chainStatus === _types._ChainStatus.ACTIVE).map(chainInfo => chainInfo.slug);
|
|
771
853
|
|
|
772
854
|
// Fill out zk assets from latestAssetRegistry if not supported
|
|
@@ -1216,9 +1298,11 @@ class ChainService {
|
|
|
1216
1298
|
}
|
|
1217
1299
|
async stopAllChainApis() {
|
|
1218
1300
|
await Promise.all([this.substrateChainHandler.sleep(), this.evmChainHandler.sleep()]);
|
|
1301
|
+
this.stopCheckLatestChainData();
|
|
1219
1302
|
}
|
|
1220
1303
|
async resumeAllChainApis() {
|
|
1221
1304
|
await Promise.all([this.substrateChainHandler.wakeUp(), this.evmChainHandler.wakeUp()]);
|
|
1305
|
+
this.checkLatestData();
|
|
1222
1306
|
}
|
|
1223
1307
|
checkAndUpdateStatusMapForChain(chainSlug) {
|
|
1224
1308
|
const substrateApiMap = this.getSubstrateApiMap();
|
|
@@ -1354,10 +1438,10 @@ class ChainService {
|
|
|
1354
1438
|
return this.assetSettingSubject;
|
|
1355
1439
|
}
|
|
1356
1440
|
async getChainLogoMap() {
|
|
1357
|
-
return
|
|
1441
|
+
return Promise.resolve(_chainList.ChainLogoMap);
|
|
1358
1442
|
}
|
|
1359
1443
|
async getAssetLogoMap() {
|
|
1360
|
-
return
|
|
1444
|
+
return Promise.resolve(_chainList.AssetLogoMap);
|
|
1361
1445
|
}
|
|
1362
1446
|
resetWallet(resetAll) {
|
|
1363
1447
|
if (resetAll) {
|
|
@@ -60,6 +60,7 @@ exports._isSmartContractToken = _isSmartContractToken;
|
|
|
60
60
|
exports._isSubstrateChain = _isSubstrateChain;
|
|
61
61
|
exports._isSubstrateParaChain = _isSubstrateParaChain;
|
|
62
62
|
exports._isSubstrateRelayChain = _isSubstrateRelayChain;
|
|
63
|
+
exports._isSupportOrdinal = void 0;
|
|
63
64
|
exports._isTokenEvmSmartContract = _isTokenEvmSmartContract;
|
|
64
65
|
exports._isTokenTransferredByEvm = _isTokenTransferredByEvm;
|
|
65
66
|
exports._isTokenWasmSmartContract = _isTokenWasmSmartContract;
|
|
@@ -67,6 +68,8 @@ exports._isXcmPathSupported = _isXcmPathSupported;
|
|
|
67
68
|
exports._parseAssetRefKey = _parseAssetRefKey;
|
|
68
69
|
exports._parseMetadataForSmartContractAsset = _parseMetadataForSmartContractAsset;
|
|
69
70
|
exports.findChainInfoByHalfGenesisHash = exports.findChainInfoByChainId = void 0;
|
|
71
|
+
exports.randomizeProvider = randomizeProvider;
|
|
72
|
+
exports.updateLatestChainInfo = updateLatestChainInfo;
|
|
70
73
|
var _types = require("@subwallet/chain-list/types");
|
|
71
74
|
var _constants = require("@subwallet/extension-base/services/chain-service/constants");
|
|
72
75
|
var _types2 = require("@subwallet/extension-base/services/chain-service/types");
|
|
@@ -161,7 +164,7 @@ function _getTokenMinAmount(tokenInfo) {
|
|
|
161
164
|
return tokenInfo.minAmount || '0';
|
|
162
165
|
}
|
|
163
166
|
function _isChainEvmCompatible(chainInfo) {
|
|
164
|
-
return chainInfo.evmInfo
|
|
167
|
+
return !!chainInfo.evmInfo;
|
|
165
168
|
}
|
|
166
169
|
function _isNativeToken(tokenInfo) {
|
|
167
170
|
return tokenInfo.assetType === _types._AssetType.NATIVE;
|
|
@@ -216,6 +219,11 @@ function _isChainSupportWasmNft(chainInfo) {
|
|
|
216
219
|
var _chainInfo$substrateI8, _chainInfo$substrateI9;
|
|
217
220
|
return ((_chainInfo$substrateI8 = chainInfo.substrateInfo) === null || _chainInfo$substrateI8 === void 0 ? void 0 : (_chainInfo$substrateI9 = _chainInfo$substrateI8.supportSmartContract) === null || _chainInfo$substrateI9 === void 0 ? void 0 : _chainInfo$substrateI9.includes(_types._AssetType.PSP34)) || false;
|
|
218
221
|
}
|
|
222
|
+
const _isSupportOrdinal = chain => {
|
|
223
|
+
const chains = ['polkadot', 'astar', 'bifrost_dot', 'moonbeam'];
|
|
224
|
+
return chains.includes(chain);
|
|
225
|
+
};
|
|
226
|
+
exports._isSupportOrdinal = _isSupportOrdinal;
|
|
219
227
|
function _getNftTypesSupportedByChain(chainInfo) {
|
|
220
228
|
const result = [];
|
|
221
229
|
if (chainInfo.substrateInfo && chainInfo.substrateInfo.supportSmartContract) {
|
|
@@ -429,4 +437,70 @@ const findChainInfoByChainId = (chainMap, chainId) => {
|
|
|
429
437
|
exports.findChainInfoByChainId = findChainInfoByChainId;
|
|
430
438
|
function _isMantaZkAsset(chainAsset) {
|
|
431
439
|
return _constants._MANTA_ZK_CHAIN_GROUP.includes(chainAsset.originChain) && chainAsset.symbol.startsWith(_constants._ZK_ASSET_PREFIX);
|
|
440
|
+
}
|
|
441
|
+
function randomizeProvider(providers, excludedKeys) {
|
|
442
|
+
if (Object.keys(providers).length === 0) {
|
|
443
|
+
return {
|
|
444
|
+
providerKey: '',
|
|
445
|
+
providerValue: ''
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
let isValid = false;
|
|
449
|
+
let selectedProviderKey = '';
|
|
450
|
+
let selectedProviderValue = '';
|
|
451
|
+
while (!isValid) {
|
|
452
|
+
var _selectedProviderValu, _selectedProviderKey;
|
|
453
|
+
const randomProvider = Math.floor(Math.random() * Object.keys(providers).length);
|
|
454
|
+
selectedProviderKey = Object.keys(providers)[randomProvider];
|
|
455
|
+
selectedProviderValue = providers[selectedProviderKey];
|
|
456
|
+
if (!((_selectedProviderValu = selectedProviderValue) !== null && _selectedProviderValu !== void 0 && _selectedProviderValu.startsWith('light')) && !((_selectedProviderKey = selectedProviderKey) !== null && _selectedProviderKey !== void 0 && _selectedProviderKey.startsWith(_types2._CUSTOM_PREFIX)) && !(excludedKeys !== null && excludedKeys !== void 0 && excludedKeys.includes(selectedProviderKey))) {
|
|
457
|
+
// if it's light client, then re-randomize
|
|
458
|
+
isValid = true;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
return {
|
|
462
|
+
providerKey: selectedProviderKey,
|
|
463
|
+
providerValue: selectedProviderValue
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
function updateLatestChainInfo(currentDataMap, latestChainInfoList) {
|
|
467
|
+
const currentChainInfoMap = currentDataMap.chainInfoMap;
|
|
468
|
+
const currentChainStateMap = currentDataMap.chainStateMap;
|
|
469
|
+
const storedChainInfoList = [];
|
|
470
|
+
const needUpdateChainApiList = [];
|
|
471
|
+
latestChainInfoList.forEach(latestChainInfo => {
|
|
472
|
+
const currentChainInfo = currentChainInfoMap[latestChainInfo.slug];
|
|
473
|
+
const currentChainState = currentChainStateMap[latestChainInfo.slug];
|
|
474
|
+
const currentChainProviderValue = currentChainInfo === null || currentChainInfo === void 0 ? void 0 : currentChainInfo.providers[currentChainState === null || currentChainState === void 0 ? void 0 : currentChainState.currentProvider];
|
|
475
|
+
if (currentChainInfo && currentChainState) {
|
|
476
|
+
const preservedProvider = {};
|
|
477
|
+
Object.entries(currentChainInfo.providers).forEach(_ref => {
|
|
478
|
+
let [providerKey, providerValue] = _ref;
|
|
479
|
+
if (providerValue !== null && providerValue !== void 0 && providerValue.startsWith('light') || providerKey !== null && providerKey !== void 0 && providerKey.startsWith(_types2._CUSTOM_PREFIX)) {
|
|
480
|
+
preservedProvider[providerKey] = providerValue;
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
currentChainInfo.providers = {
|
|
484
|
+
...latestChainInfo.providers,
|
|
485
|
+
...preservedProvider
|
|
486
|
+
};
|
|
487
|
+
const currentProviderNotFound = !Object.keys(currentChainInfo.providers).includes(currentChainState.currentProvider);
|
|
488
|
+
const currentProviderUpdated = Object.keys(currentChainInfo.providers).includes(currentChainState.currentProvider) && !Object.values(currentChainInfo.providers).includes(currentChainProviderValue);
|
|
489
|
+
if (currentChainInfo.chainStatus === _types._ChainStatus.ACTIVE && (currentProviderNotFound || currentProviderUpdated)) {
|
|
490
|
+
const {
|
|
491
|
+
providerKey
|
|
492
|
+
} = randomizeProvider(currentChainInfo.providers);
|
|
493
|
+
currentChainState.currentProvider = providerKey;
|
|
494
|
+
needUpdateChainApiList.push(currentChainInfo);
|
|
495
|
+
}
|
|
496
|
+
storedChainInfoList.push({
|
|
497
|
+
...currentChainInfo,
|
|
498
|
+
...currentChainState
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
return {
|
|
503
|
+
storedChainInfoList,
|
|
504
|
+
needUpdateChainApiList
|
|
505
|
+
};
|
|
432
506
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports._STAKING_CHAIN_GROUP = exports.ST_LIQUID_TOKEN_ABI = void 0;
|
|
7
|
+
// Copyright 2019-2022 @subwallet/extension-base
|
|
8
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
+
|
|
10
|
+
const _STAKING_CHAIN_GROUP = {
|
|
11
|
+
relay: ['polkadot', 'kusama', 'aleph', 'polkadex', 'ternoa', 'ternoa_alphanet', 'alephTest', 'polkadexTest', 'westend', 'kate', 'edgeware', 'creditcoin', 'vara_network', 'goldberg_testnet'],
|
|
12
|
+
para: ['moonbeam', 'moonriver', 'moonbase', 'turing', 'turingStaging', 'bifrost', 'bifrost_testnet', 'calamari_test', 'calamari', 'manta_network'],
|
|
13
|
+
astar: ['astar', 'shiden', 'shibuya'],
|
|
14
|
+
amplitude: ['amplitude', 'amplitude_test', 'kilt', 'kilt_peregrine', 'pendulum', 'krest_network'],
|
|
15
|
+
// amplitude and kilt only share some common logic
|
|
16
|
+
kilt: ['kilt', 'kilt_peregrine'],
|
|
17
|
+
nominationPool: ['polkadot', 'kusama', 'westend', 'alephTest', 'aleph', 'kate', 'vara_network', 'goldberg_testnet'],
|
|
18
|
+
bifrost: ['bifrost', 'bifrost_testnet'],
|
|
19
|
+
aleph: ['aleph', 'alephTest'],
|
|
20
|
+
// A0 has distinct tokenomics
|
|
21
|
+
ternoa: ['ternoa', 'ternoa_alphanet'],
|
|
22
|
+
liquidStaking: ['bifrost_dot', 'acala', 'parallel', 'moonbeam'],
|
|
23
|
+
lending: ['interlay'],
|
|
24
|
+
krest_network: ['krest_network']
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-assignment
|
|
28
|
+
exports._STAKING_CHAIN_GROUP = _STAKING_CHAIN_GROUP;
|
|
29
|
+
const ST_LIQUID_TOKEN_ABI = require('./abis/st_liquid_token_abi.json');
|
|
30
|
+
exports.ST_LIQUID_TOKEN_ABI = ST_LIQUID_TOKEN_ABI;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _chains = require("./chains");
|
|
7
|
+
Object.keys(_chains).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _chains[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _chains[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _step = require("./step");
|
|
18
|
+
Object.keys(_step).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _step[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _step[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.fakeAddress = exports.DEFAULT_YIELD_FIRST_STEP = void 0;
|
|
7
|
+
var _types = require("@subwallet/extension-base/types");
|
|
8
|
+
// Copyright 2019-2022 @subwallet/extension-base
|
|
9
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
|
|
11
|
+
const DEFAULT_YIELD_FIRST_STEP = {
|
|
12
|
+
id: 0,
|
|
13
|
+
name: 'Fill information',
|
|
14
|
+
type: _types.YieldStepType.DEFAULT
|
|
15
|
+
};
|
|
16
|
+
exports.DEFAULT_YIELD_FIRST_STEP = DEFAULT_YIELD_FIRST_STEP;
|
|
17
|
+
const fakeAddress = '15MLn9YQaHZ4GMkhK3qXqR5iGGSdULyJ995ctjeBgFRseyi6';
|
|
18
|
+
exports.fakeAddress = fakeAddress;
|