@subwallet/extension-base 1.1.33-beta.3 → 1.1.35-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 +69 -111
- package/background/KoniTypes.js +13 -19
- package/background/errors/TransactionError.js +0 -9
- package/cjs/background/KoniTypes.js +16 -20
- package/cjs/background/errors/TransactionError.js +0 -9
- package/cjs/constants/index.js +4 -19
- package/cjs/koni/api/nft/config.js +23 -33
- package/cjs/koni/api/nft/index.js +0 -14
- package/cjs/koni/api/nft/nft.js +22 -1
- package/cjs/koni/api/staking/bonding/amplitude.js +16 -19
- package/cjs/koni/api/staking/bonding/astar.js +10 -11
- package/cjs/koni/api/staking/bonding/index.js +1 -4
- package/cjs/koni/api/staking/bonding/paraChain.js +23 -25
- package/cjs/koni/api/staking/bonding/relayChain.js +45 -48
- package/cjs/koni/api/staking/bonding/utils.js +86 -104
- package/cjs/koni/api/staking/index.js +5 -6
- package/cjs/koni/api/staking/paraChain.js +17 -10
- package/cjs/koni/api/staking/relayChain.js +2 -3
- package/cjs/koni/background/cron.js +21 -3
- package/cjs/koni/background/handlers/Extension.js +69 -368
- package/cjs/koni/background/handlers/State.js +12 -18
- package/cjs/koni/background/handlers/index.js +2 -4
- package/cjs/koni/background/subscription.js +104 -7
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/balance-service/helpers/subscribe/substrate/index.js +1 -3
- package/cjs/services/campaign-service/index.js +6 -9
- package/cjs/services/chain-service/constants.js +16 -1
- package/cjs/services/chain-service/index.js +2 -5
- package/cjs/services/chain-service/utils.js +1 -7
- package/cjs/services/event-service/index.js +0 -5
- package/cjs/services/keyring-service/index.js +2 -14
- package/cjs/services/migration-service/scripts/MigrateLedgerAccount.js +1 -1
- package/cjs/services/migration-service/scripts/MigrateTransactionHistory.js +1 -1
- package/cjs/services/migration-service/scripts/index.js +1 -6
- package/cjs/services/notification-service/NotificationService.js +1 -1
- package/cjs/services/storage-service/DatabaseService.js +0 -63
- package/cjs/services/storage-service/databases/index.js +0 -4
- package/cjs/services/storage-service/db-stores/NominatorMetadata.js +3 -3
- package/cjs/services/subscan-service/index.js +0 -16
- package/cjs/services/transaction-service/event-parser/index.js +0 -58
- package/cjs/services/transaction-service/helpers/index.js +1 -3
- package/cjs/services/transaction-service/index.js +75 -249
- package/cjs/services/transaction-service/utils.js +0 -1
- package/cjs/types/index.js +0 -44
- package/cjs/utils/fetchStaticData.js +1 -2
- package/cjs/utils/index.js +1 -89
- package/cjs/utils/number.js +2 -6
- package/constants/index.d.ts +1 -6
- package/constants/index.js +1 -6
- package/koni/api/nft/config.js +23 -33
- package/koni/api/nft/index.js +1 -15
- package/koni/api/nft/nft.js +23 -2
- package/koni/api/staking/bonding/amplitude.js +10 -13
- package/koni/api/staking/bonding/astar.js +8 -9
- package/koni/api/staking/bonding/index.d.ts +1 -1
- package/koni/api/staking/bonding/index.js +1 -5
- package/koni/api/staking/bonding/paraChain.js +10 -12
- package/koni/api/staking/bonding/relayChain.d.ts +2 -2
- package/koni/api/staking/bonding/relayChain.js +30 -33
- package/koni/api/staking/bonding/utils.d.ts +38 -15
- package/koni/api/staking/bonding/utils.js +69 -85
- package/koni/api/staking/index.js +1 -2
- package/koni/api/staking/paraChain.js +18 -11
- package/koni/api/staking/relayChain.js +3 -4
- package/koni/background/cron.d.ts +4 -0
- package/koni/background/cron.js +22 -4
- package/koni/background/handlers/Extension.d.ts +1 -17
- package/koni/background/handlers/Extension.js +30 -327
- package/koni/background/handlers/State.d.ts +1 -6
- package/koni/background/handlers/State.js +12 -17
- package/koni/background/handlers/index.js +2 -4
- package/koni/background/subscription.d.ts +6 -1
- package/koni/background/subscription.js +104 -8
- package/package.json +7 -320
- package/packageInfo.js +1 -1
- package/services/balance-service/helpers/subscribe/substrate/index.js +2 -4
- package/services/campaign-service/index.js +6 -9
- package/services/chain-service/constants.d.ts +12 -0
- package/services/chain-service/constants.js +14 -0
- package/services/chain-service/index.js +2 -5
- package/services/chain-service/utils.d.ts +0 -1
- package/services/chain-service/utils.js +1 -5
- package/services/event-service/index.d.ts +0 -2
- package/services/event-service/index.js +0 -5
- package/services/event-service/types.d.ts +0 -9
- package/services/keyring-service/index.d.ts +1 -2
- package/services/keyring-service/index.js +2 -14
- package/services/migration-service/scripts/MigrateLedgerAccount.js +1 -1
- package/services/migration-service/scripts/MigrateTransactionHistory.js +1 -1
- package/services/migration-service/scripts/index.js +1 -6
- package/services/notification-service/NotificationService.js +1 -1
- package/services/storage-service/DatabaseService.d.ts +1 -22
- package/services/storage-service/DatabaseService.js +0 -63
- package/services/storage-service/databases/index.d.ts +1 -3
- package/services/storage-service/databases/index.js +0 -4
- package/services/storage-service/db-stores/NominatorMetadata.js +3 -3
- package/services/subscan-service/index.d.ts +2 -3
- package/services/subscan-service/index.js +0 -15
- package/services/subscan-service/types.d.ts +0 -20
- package/services/transaction-service/event-parser/index.d.ts +1 -3
- package/services/transaction-service/event-parser/index.js +1 -57
- package/services/transaction-service/helpers/index.js +1 -3
- package/services/transaction-service/index.d.ts +13 -6
- package/services/transaction-service/index.js +73 -247
- package/services/transaction-service/types.d.ts +0 -2
- package/services/transaction-service/utils.js +0 -1
- package/types/index.d.ts +0 -5
- package/types/index.js +1 -5
- package/utils/fetchStaticData.js +1 -2
- package/utils/index.d.ts +0 -5
- package/utils/index.js +0 -52
- package/utils/number.d.ts +1 -2
- package/utils/number.js +1 -2
- package/cjs/koni/api/dotsama/balance.js +0 -464
- package/cjs/koni/api/nft/ordinal_nft/constants.js +0 -21
- package/cjs/koni/api/nft/ordinal_nft/index.js +0 -121
- package/cjs/koni/api/nft/ordinal_nft/utils.js +0 -41
- package/cjs/koni/api/yield/helper/utils.js +0 -46
- package/cjs/services/earning-service/constants/chains.js +0 -30
- package/cjs/services/earning-service/constants/index.js +0 -27
- package/cjs/services/earning-service/constants/step.js +0 -18
- package/cjs/services/earning-service/handlers/base.js +0 -262
- package/cjs/services/earning-service/handlers/index.js +0 -60
- package/cjs/services/earning-service/handlers/lending/base.js +0 -81
- package/cjs/services/earning-service/handlers/lending/index.js +0 -13
- package/cjs/services/earning-service/handlers/lending/interlay.js +0 -192
- package/cjs/services/earning-service/handlers/liquid-staking/acala.js +0 -240
- package/cjs/services/earning-service/handlers/liquid-staking/base.js +0 -97
- package/cjs/services/earning-service/handlers/liquid-staking/bifrost-manta.js +0 -140
- package/cjs/services/earning-service/handlers/liquid-staking/bifrost.js +0 -298
- package/cjs/services/earning-service/handlers/liquid-staking/index.js +0 -34
- package/cjs/services/earning-service/handlers/liquid-staking/parallel.js +0 -227
- package/cjs/services/earning-service/handlers/liquid-staking/stella-swap.js +0 -404
- package/cjs/services/earning-service/handlers/native-staking/amplitude.js +0 -434
- package/cjs/services/earning-service/handlers/native-staking/astar.js +0 -466
- package/cjs/services/earning-service/handlers/native-staking/base-para.js +0 -146
- package/cjs/services/earning-service/handlers/native-staking/base.js +0 -161
- package/cjs/services/earning-service/handlers/native-staking/index.js +0 -34
- package/cjs/services/earning-service/handlers/native-staking/para-chain.js +0 -390
- package/cjs/services/earning-service/handlers/native-staking/relay-chain.js +0 -567
- package/cjs/services/earning-service/handlers/nomination-pool/index.js +0 -566
- package/cjs/services/earning-service/handlers/special.js +0 -493
- package/cjs/services/earning-service/service.js +0 -740
- package/cjs/services/earning-service/utils/index.js +0 -128
- package/cjs/services/migration-service/scripts/DeleteEarningData.js +0 -21
- package/cjs/services/migration-service/scripts/EnableEarningChains.js +0 -21
- package/cjs/services/migration-service/scripts/MigrateEthProvider.js +0 -17
- package/cjs/services/migration-service/scripts/MigratePioneerProvider.js +0 -17
- package/cjs/services/migration-service/scripts/MigrateProvider.js +0 -29
- package/cjs/services/migration-service/scripts/databases/MigrateEarningHistory.js +0 -21
- package/cjs/services/migration-service/scripts/databases/MigrateEarningVersion.js +0 -21
- package/cjs/services/mint-campaign-service/campaigns/UnlockDotCampaign.js +0 -149
- package/cjs/services/mint-campaign-service/campaigns/index.js +0 -13
- package/cjs/services/mint-campaign-service/constants.js +0 -11
- package/cjs/services/mint-campaign-service/index.js +0 -18
- package/cjs/services/storage-service/db-stores/YieldPoolStore.js +0 -36
- package/cjs/services/storage-service/db-stores/YieldPositionStore.js +0 -71
- package/cjs/services/storage-service/index.js +0 -241
- package/cjs/types/campaigns/index.js +0 -16
- package/cjs/types/campaigns/unlock-dot.js +0 -1
- package/cjs/types/ordinal.js +0 -1
- package/cjs/types/transaction.js +0 -1
- package/cjs/types/yield/actions/index.js +0 -27
- package/cjs/types/yield/actions/join/index.js +0 -38
- package/cjs/types/yield/actions/join/step.js +0 -47
- package/cjs/types/yield/actions/join/submit.js +0 -1
- package/cjs/types/yield/actions/join/validate.js +0 -16
- package/cjs/types/yield/actions/others.js +0 -1
- package/cjs/types/yield/index.js +0 -27
- package/cjs/types/yield/info/account/index.js +0 -49
- package/cjs/types/yield/info/account/info.js +0 -1
- package/cjs/types/yield/info/account/reward.js +0 -1
- package/cjs/types/yield/info/account/target.js +0 -32
- package/cjs/types/yield/info/account/unstake.js +0 -27
- package/cjs/types/yield/info/base.js +0 -41
- package/cjs/types/yield/info/chain/index.js +0 -27
- package/cjs/types/yield/info/chain/info.js +0 -1
- package/cjs/types/yield/info/chain/target.js +0 -1
- package/cjs/types/yield/info/index.js +0 -49
- package/cjs/types/yield/info/pallet.js +0 -15
- package/cjs/types.js +0 -1
- package/cjs/utils/address.js +0 -34
- package/cjs/utils/keyring.js +0 -57
- package/cjs/utils/object.js +0 -12
- package/koni/api/nft/ordinal_nft/constants.d.ts +0 -9
- package/koni/api/nft/ordinal_nft/constants.js +0 -12
- package/koni/api/nft/ordinal_nft/index.d.ts +0 -8
- package/koni/api/nft/ordinal_nft/index.js +0 -114
- package/koni/api/nft/ordinal_nft/utils.d.ts +0 -2
- package/koni/api/nft/ordinal_nft/utils.js +0 -33
- package/koni/api/yield/helper/utils.d.ts +0 -10
- package/koni/api/yield/helper/utils.js +0 -32
- package/services/earning-service/constants/abis/compound_finance_v2_abi.json +0 -1235
- package/services/earning-service/constants/abis/st_liquid_token_abi.json +0 -1355
- package/services/earning-service/constants/chains.d.ts +0 -15
- package/services/earning-service/constants/chains.js +0 -22
- package/services/earning-service/constants/index.d.ts +0 -2
- package/services/earning-service/constants/index.js +0 -5
- package/services/earning-service/constants/step.d.ts +0 -3
- package/services/earning-service/constants/step.js +0 -10
- package/services/earning-service/handlers/base.d.ts +0 -113
- package/services/earning-service/handlers/base.js +0 -256
- package/services/earning-service/handlers/index.d.ts +0 -5
- package/services/earning-service/handlers/index.js +0 -8
- package/services/earning-service/handlers/lending/base.d.ts +0 -8
- package/services/earning-service/handlers/lending/base.js +0 -73
- package/services/earning-service/handlers/lending/index.d.ts +0 -1
- package/services/earning-service/handlers/lending/index.js +0 -4
- package/services/earning-service/handlers/lending/interlay.d.ts +0 -24
- package/services/earning-service/handlers/lending/interlay.js +0 -184
- package/services/earning-service/handlers/liquid-staking/acala.d.ts +0 -27
- package/services/earning-service/handlers/liquid-staking/acala.js +0 -232
- package/services/earning-service/handlers/liquid-staking/base.d.ts +0 -11
- package/services/earning-service/handlers/liquid-staking/base.js +0 -89
- package/services/earning-service/handlers/liquid-staking/bifrost.d.ts +0 -46
- package/services/earning-service/handlers/liquid-staking/bifrost.js +0 -287
- package/services/earning-service/handlers/liquid-staking/index.d.ts +0 -4
- package/services/earning-service/handlers/liquid-staking/index.js +0 -7
- package/services/earning-service/handlers/liquid-staking/parallel.d.ts +0 -26
- package/services/earning-service/handlers/liquid-staking/parallel.js +0 -219
- package/services/earning-service/handlers/liquid-staking/stella-swap.d.ts +0 -34
- package/services/earning-service/handlers/liquid-staking/stella-swap.js +0 -394
- package/services/earning-service/handlers/native-staking/amplitude.d.ts +0 -22
- package/services/earning-service/handlers/native-staking/amplitude.js +0 -425
- package/services/earning-service/handlers/native-staking/astar.d.ts +0 -19
- package/services/earning-service/handlers/native-staking/astar.js +0 -456
- package/services/earning-service/handlers/native-staking/base-para.d.ts +0 -11
- package/services/earning-service/handlers/native-staking/base-para.js +0 -138
- package/services/earning-service/handlers/native-staking/base.d.ts +0 -21
- package/services/earning-service/handlers/native-staking/base.js +0 -152
- package/services/earning-service/handlers/native-staking/index.d.ts +0 -4
- package/services/earning-service/handlers/native-staking/index.js +0 -7
- package/services/earning-service/handlers/native-staking/para-chain.d.ts +0 -15
- package/services/earning-service/handlers/native-staking/para-chain.js +0 -382
- package/services/earning-service/handlers/native-staking/relay-chain.d.ts +0 -21
- package/services/earning-service/handlers/native-staking/relay-chain.js +0 -558
- package/services/earning-service/handlers/nomination-pool/index.d.ts +0 -36
- package/services/earning-service/handlers/nomination-pool/index.js +0 -556
- package/services/earning-service/handlers/special.d.ts +0 -64
- package/services/earning-service/handlers/special.js +0 -485
- package/services/earning-service/service.d.ts +0 -94
- package/services/earning-service/service.js +0 -729
- package/services/earning-service/utils/index.d.ts +0 -18
- package/services/earning-service/utils/index.js +0 -112
- package/services/migration-service/scripts/DeleteEarningData.d.ts +0 -4
- package/services/migration-service/scripts/DeleteEarningData.js +0 -13
- package/services/migration-service/scripts/EnableEarningChains.d.ts +0 -4
- package/services/migration-service/scripts/EnableEarningChains.js +0 -13
- package/services/migration-service/scripts/databases/MigrateEarningHistory.d.ts +0 -4
- package/services/migration-service/scripts/databases/MigrateEarningHistory.js +0 -13
- package/services/migration-service/scripts/databases/MigrateEarningVersion.d.ts +0 -4
- package/services/migration-service/scripts/databases/MigrateEarningVersion.js +0 -13
- package/services/mint-campaign-service/campaigns/UnlockDotCampaign.d.ts +0 -13
- package/services/mint-campaign-service/campaigns/UnlockDotCampaign.js +0 -139
- package/services/mint-campaign-service/campaigns/index.d.ts +0 -1
- package/services/mint-campaign-service/campaigns/index.js +0 -4
- package/services/mint-campaign-service/constants.d.ts +0 -1
- package/services/mint-campaign-service/constants.js +0 -4
- package/services/mint-campaign-service/index.d.ts +0 -7
- package/services/mint-campaign-service/index.js +0 -11
- package/services/storage-service/db-stores/YieldPoolStore.d.ts +0 -10
- package/services/storage-service/db-stores/YieldPoolStore.js +0 -28
- package/services/storage-service/db-stores/YieldPositionStore.d.ts +0 -11
- package/services/storage-service/db-stores/YieldPositionStore.js +0 -63
- package/types/campaigns/index.d.ts +0 -1
- package/types/campaigns/index.js +0 -4
- package/types/campaigns/unlock-dot.d.ts +0 -71
- package/types/campaigns/unlock-dot.js +0 -1
- package/types/ordinal.d.ts +0 -69
- package/types/ordinal.js +0 -1
- package/types/transaction.d.ts +0 -3
- package/types/transaction.js +0 -1
- package/types/yield/actions/index.d.ts +0 -2
- package/types/yield/actions/index.js +0 -5
- package/types/yield/actions/join/index.d.ts +0 -3
- package/types/yield/actions/join/index.js +0 -6
- package/types/yield/actions/join/step.d.ts +0 -95
- package/types/yield/actions/join/step.js +0 -46
- package/types/yield/actions/join/submit.d.ts +0 -58
- package/types/yield/actions/join/submit.js +0 -1
- package/types/yield/actions/join/validate.d.ts +0 -18
- package/types/yield/actions/join/validate.js +0 -10
- package/types/yield/actions/others.d.ts +0 -85
- package/types/yield/actions/others.js +0 -1
- package/types/yield/index.d.ts +0 -2
- package/types/yield/index.js +0 -5
- package/types/yield/info/account/index.d.ts +0 -4
- package/types/yield/info/account/index.js +0 -7
- package/types/yield/info/account/info.d.ts +0 -92
- package/types/yield/info/account/info.js +0 -1
- package/types/yield/info/account/reward.d.ts +0 -47
- package/types/yield/info/account/reward.js +0 -1
- package/types/yield/info/account/target.d.ts +0 -43
- package/types/yield/info/account/target.js +0 -27
- package/types/yield/info/account/unstake.d.ts +0 -31
- package/types/yield/info/account/unstake.js +0 -22
- package/types/yield/info/base.d.ts +0 -45
- package/types/yield/info/base.js +0 -36
- package/types/yield/info/chain/index.d.ts +0 -2
- package/types/yield/info/chain/index.js +0 -5
- package/types/yield/info/chain/info.d.ts +0 -252
- package/types/yield/info/chain/info.js +0 -1
- package/types/yield/info/chain/target.d.ts +0 -37
- package/types/yield/info/chain/target.js +0 -1
- package/types/yield/info/index.d.ts +0 -4
- package/types/yield/info/index.js +0 -7
- package/types/yield/info/pallet.d.ts +0 -143
- package/types/yield/info/pallet.js +0 -9
- package/utils/object.d.ts +0 -1
- package/utils/object.js +0 -6
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.DatabaseService = void 0;
|
|
8
|
-
var _KoniTypes = require("@subwallet/extension-base/background/KoniTypes");
|
|
9
|
-
var _databases = _interopRequireDefault(require("@subwallet/extension-base/services/storage-service/databases"));
|
|
10
|
-
var _dbStores = require("@subwallet/extension-base/services/storage-service/db-stores");
|
|
11
|
-
var _ChainStakingMetadata = _interopRequireDefault(require("@subwallet/extension-base/services/storage-service/db-stores/ChainStakingMetadata"));
|
|
12
|
-
var _NominatorMetadata = _interopRequireDefault(require("@subwallet/extension-base/services/storage-service/db-stores/NominatorMetadata"));
|
|
13
|
-
var _utils = require("@subwallet/extension-base/utils");
|
|
14
|
-
var _util = require("@polkadot/util");
|
|
15
|
-
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
16
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
-
|
|
18
|
-
class DatabaseService {
|
|
19
|
-
// TODO: might remove this
|
|
20
|
-
|
|
21
|
-
constructor(eventService) {
|
|
22
|
-
this.eventService = eventService;
|
|
23
|
-
this.logger = (0, _util.logger)('DB-Service');
|
|
24
|
-
this._db = new _databases.default();
|
|
25
|
-
this._db.on('ready', () => {
|
|
26
|
-
this.eventService.emit('database.ready', true);
|
|
27
|
-
});
|
|
28
|
-
this.stores = {
|
|
29
|
-
price: new _dbStores.PriceStore(this._db.price),
|
|
30
|
-
balance: new _dbStores.BalanceStore(this._db.balances),
|
|
31
|
-
nft: new _dbStores.NftStore(this._db.nfts),
|
|
32
|
-
nftCollection: new _dbStores.NftCollectionStore(this._db.nftCollections),
|
|
33
|
-
crowdloan: new _dbStores.CrowdloanStore(this._db.crowdloans),
|
|
34
|
-
staking: new _dbStores.StakingStore(this._db.stakings),
|
|
35
|
-
transaction: new _dbStores.TransactionStore(this._db.transactions),
|
|
36
|
-
migration: new _dbStores.MigrationStore(this._db.migrations),
|
|
37
|
-
metadata: new _dbStores.MetadataStore(this._db.metadata),
|
|
38
|
-
chain: new _dbStores.ChainStore(this._db.chain),
|
|
39
|
-
asset: new _dbStores.AssetStore(this._db.asset),
|
|
40
|
-
// staking
|
|
41
|
-
chainStakingMetadata: new _ChainStakingMetadata.default(this._db.chainStakingMetadata),
|
|
42
|
-
nominatorMetadata: new _NominatorMetadata.default(this._db.nominatorMetadata)
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
async updatePriceStore(priceData) {
|
|
46
|
-
await this.stores.price.table.put(priceData);
|
|
47
|
-
}
|
|
48
|
-
async getPriceStore() {
|
|
49
|
-
try {
|
|
50
|
-
const rs = await this.stores.price.table.get('usd');
|
|
51
|
-
return rs;
|
|
52
|
-
} catch (e) {
|
|
53
|
-
this.logger.error(e);
|
|
54
|
-
return undefined;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Balance
|
|
59
|
-
async getStoredBalance() {
|
|
60
|
-
return this.stores.balance.table.toArray();
|
|
61
|
-
}
|
|
62
|
-
async updateBalanceStore(address, item) {
|
|
63
|
-
if (item.state === _KoniTypes.APIItemState.READY) {
|
|
64
|
-
return this.stores.balance.upsert({
|
|
65
|
-
address,
|
|
66
|
-
...item
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
async removeFromBalanceStore(assets) {
|
|
71
|
-
return this.stores.balance.removeBySlugs(assets);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Crowdloan
|
|
75
|
-
async updateCrowdloanStore(chain, address, item) {
|
|
76
|
-
if (item.state === _KoniTypes.APIItemState.READY && item.contribute !== '0') {
|
|
77
|
-
return this.stores.crowdloan.upsert({
|
|
78
|
-
chain,
|
|
79
|
-
address,
|
|
80
|
-
...item
|
|
81
|
-
});
|
|
82
|
-
} else {
|
|
83
|
-
return this.stores.crowdloan.deleteByChainAndAddress(chain, address);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Staking
|
|
88
|
-
async updateStaking(chain, address, item) {
|
|
89
|
-
if (item.state === _KoniTypes.APIItemState.READY) {
|
|
90
|
-
return this.stores.staking.upsert(item);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
async getStakings(addresses, chains) {
|
|
94
|
-
return this.stores.staking.getStakings(addresses, chains);
|
|
95
|
-
}
|
|
96
|
-
async getStakingsByChains(chains) {
|
|
97
|
-
return this.stores.staking.getStakingsByChains(chains);
|
|
98
|
-
}
|
|
99
|
-
async getPooledStakings(addresses, chainHashes) {
|
|
100
|
-
return this.stores.staking.getPooledStakings(addresses, chainHashes);
|
|
101
|
-
}
|
|
102
|
-
subscribeStaking(addresses, chainList, callback) {
|
|
103
|
-
this.stakingSubscription && this.stakingSubscription.unsubscribe();
|
|
104
|
-
this.stakingSubscription = this.stores.staking.subscribeStaking(addresses, chainList).subscribe({
|
|
105
|
-
next: stakings => callback && callback(stakings)
|
|
106
|
-
});
|
|
107
|
-
return this.stakingSubscription;
|
|
108
|
-
}
|
|
109
|
-
subscribeChainStakingMetadata(chains, callback) {
|
|
110
|
-
this.stores.chainStakingMetadata.subscribeByChain(chains).subscribe({
|
|
111
|
-
next: data => callback && callback(data)
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
subscribeNominatorMetadata(addresses, callback) {
|
|
115
|
-
return this.stores.nominatorMetadata.subscribeByAddresses(addresses).subscribe({
|
|
116
|
-
next: data => callback && callback(data)
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// Transaction histories
|
|
121
|
-
async getHistories(query) {
|
|
122
|
-
return this.stores.transaction.queryHistory(query);
|
|
123
|
-
}
|
|
124
|
-
async upsertHistory(histories) {
|
|
125
|
-
const cleanedHistory = histories.filter(x => x && x.address && x.chain && x.extrinsicHash);
|
|
126
|
-
return this.stores.transaction.bulkUpsert(cleanedHistory);
|
|
127
|
-
}
|
|
128
|
-
async updateHistoryByExtrinsicHash(extrinsicHash, updateData) {
|
|
129
|
-
const canUpdate = updateData && extrinsicHash;
|
|
130
|
-
if (!canUpdate) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
return this.stores.transaction.updateWithQuery({
|
|
134
|
-
extrinsicHash
|
|
135
|
-
}, updateData);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// NFT Collection
|
|
139
|
-
async addNftCollection(collection) {
|
|
140
|
-
return this.stores.nftCollection.upsert(collection);
|
|
141
|
-
}
|
|
142
|
-
async deleteNftCollection(chain, collectionId) {
|
|
143
|
-
await this.stores.nftCollection.removeCollection(chain, collectionId);
|
|
144
|
-
await this.stores.nft.deleteNftsByCollection(chain, collectionId);
|
|
145
|
-
}
|
|
146
|
-
getAllNftCollection(chainHashes) {
|
|
147
|
-
return this.stores.nftCollection.getNftCollection(chainHashes);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// NFT
|
|
151
|
-
subscribeNft(addresses, chainHashes, callback) {
|
|
152
|
-
this.nftSubscription && this.nftSubscription.unsubscribe();
|
|
153
|
-
this.nftSubscription = this.stores.nft.subscribeNft(addresses, chainHashes).subscribe({
|
|
154
|
-
next: nfts => callback && callback(nfts)
|
|
155
|
-
});
|
|
156
|
-
return this.nftSubscription;
|
|
157
|
-
}
|
|
158
|
-
async cleanUpNft(chain, owner, collectionIds, nftIds, ownNothing) {
|
|
159
|
-
if (ownNothing) {
|
|
160
|
-
return this.stores.nft.deleteNftsByChainAndOwner(chain, (0, _utils.reformatAddress)(owner, 42), collectionIds);
|
|
161
|
-
}
|
|
162
|
-
return this.stores.nft.cleanUpNfts(chain, (0, _utils.reformatAddress)(owner, 42), collectionIds, nftIds);
|
|
163
|
-
}
|
|
164
|
-
async getNft(addresses, chainHashes) {
|
|
165
|
-
return this.stores.nft.getNft(addresses, chainHashes);
|
|
166
|
-
}
|
|
167
|
-
async addNft(address, nft) {
|
|
168
|
-
return this.stores.nft.upsert({
|
|
169
|
-
...nft,
|
|
170
|
-
address
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
handleNftTransfer(chain, addresses, nftItem) {
|
|
174
|
-
return this.stores.nft.deleteNftItem(chain, addresses, nftItem);
|
|
175
|
-
}
|
|
176
|
-
removeNfts(chain, address, collectionId, nftIds) {
|
|
177
|
-
return this.stores.nft.removeNfts(chain, address, collectionId, nftIds);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// Chain
|
|
181
|
-
async updateChainStore(item) {
|
|
182
|
-
return this.stores.chain.upsert(item);
|
|
183
|
-
}
|
|
184
|
-
async bulkUpdateChainStore(data) {
|
|
185
|
-
return this.stores.chain.bulkUpsert(data);
|
|
186
|
-
}
|
|
187
|
-
async removeFromChainStore(chains) {
|
|
188
|
-
return this.stores.chain.removeChains(chains);
|
|
189
|
-
}
|
|
190
|
-
async getAllChainStore() {
|
|
191
|
-
return this.stores.chain.getAll();
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// Asset
|
|
195
|
-
async updateAssetStore(item) {
|
|
196
|
-
return this.stores.asset.upsert(item);
|
|
197
|
-
}
|
|
198
|
-
async getAllAssetStore() {
|
|
199
|
-
return this.stores.asset.getAll();
|
|
200
|
-
}
|
|
201
|
-
async removeFromAssetStore(items) {
|
|
202
|
-
return this.stores.asset.removeAssets(items);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// Staking
|
|
206
|
-
async updateChainStakingMetadata(item, changes) {
|
|
207
|
-
const existingRecord = await this.stores.chainStakingMetadata.getByChainAndType(item.chain, item.type);
|
|
208
|
-
if (existingRecord && changes) {
|
|
209
|
-
return this.stores.chainStakingMetadata.updateByChainAndType(item.chain, item.type, changes);
|
|
210
|
-
}
|
|
211
|
-
return this.stores.chainStakingMetadata.upsert(item);
|
|
212
|
-
}
|
|
213
|
-
async getChainStakingMetadata() {
|
|
214
|
-
return this.stores.chainStakingMetadata.getAll();
|
|
215
|
-
}
|
|
216
|
-
async getStakingMetadataByChain(chain) {
|
|
217
|
-
let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _KoniTypes.StakingType.NOMINATED;
|
|
218
|
-
return this.stores.chainStakingMetadata.getByChainAndType(chain, type);
|
|
219
|
-
}
|
|
220
|
-
async updateNominatorMetadata(item) {
|
|
221
|
-
return this.stores.nominatorMetadata.upsert(item);
|
|
222
|
-
}
|
|
223
|
-
async getNominatorMetadata() {
|
|
224
|
-
return this.stores.nominatorMetadata.getAll();
|
|
225
|
-
}
|
|
226
|
-
async resetWallet(resetAll) {
|
|
227
|
-
return new Promise((resolve, reject) => {
|
|
228
|
-
const stores = [this.stores.balance, this.stores.nft, this.stores.nftCollection, this.stores.crowdloan, this.stores.staking, this.stores.transaction, this.stores.nominatorMetadata];
|
|
229
|
-
if (resetAll) {
|
|
230
|
-
stores.push(this.stores.chain, this.stores.asset);
|
|
231
|
-
}
|
|
232
|
-
const promises = stores.map(store => store.clear());
|
|
233
|
-
Promise.all(promises).then(() => {
|
|
234
|
-
resolve();
|
|
235
|
-
}).catch(e => {
|
|
236
|
-
reject(e);
|
|
237
|
-
});
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
exports.DatabaseService = DatabaseService;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _unlockDot = require("./unlock-dot");
|
|
7
|
-
Object.keys(_unlockDot).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _unlockDot[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _unlockDot[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/cjs/types/ordinal.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/cjs/types/transaction.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _join = require("./join");
|
|
7
|
-
Object.keys(_join).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _join[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _join[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _others = require("./others");
|
|
18
|
-
Object.keys(_others).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _others[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _others[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _step = require("./step");
|
|
7
|
-
Object.keys(_step).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _step[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _step[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _submit = require("./submit");
|
|
18
|
-
Object.keys(_submit).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _submit[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _submit[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _validate = require("./validate");
|
|
29
|
-
Object.keys(_validate).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _validate[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _validate[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.YieldStepType = void 0;
|
|
7
|
-
// Copyright 2019-2022 @subwallet/extension-base
|
|
8
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
-
/**
|
|
10
|
-
* @interface RequestEarlyValidateYield
|
|
11
|
-
* @description Params to early validate join pool
|
|
12
|
-
* @prop {string} slug - Pool's slug
|
|
13
|
-
* @prop {string} address - Account's address
|
|
14
|
-
* */
|
|
15
|
-
/**
|
|
16
|
-
* @interface ResponseEarlyValidateYield
|
|
17
|
-
* @prop {boolean} passed - Passed validate
|
|
18
|
-
* */
|
|
19
|
-
/**
|
|
20
|
-
* @interface OptimalYieldPathParams
|
|
21
|
-
* @description Params to generate steps
|
|
22
|
-
* */
|
|
23
|
-
/**
|
|
24
|
-
* @enum {string}
|
|
25
|
-
* @description Type of join yield step
|
|
26
|
-
* */
|
|
27
|
-
let YieldStepType;
|
|
28
|
-
/**
|
|
29
|
-
* @interface BaseYieldStepDetail
|
|
30
|
-
* @description Base info of a step
|
|
31
|
-
* @prop {string} name - Step's name
|
|
32
|
-
* @prop {YieldStepType} type - Step's type
|
|
33
|
-
* @prop {Record<string,unknown>} [metadata] - Metadata for generating extrinsic
|
|
34
|
-
* */
|
|
35
|
-
exports.YieldStepType = YieldStepType;
|
|
36
|
-
(function (YieldStepType) {
|
|
37
|
-
YieldStepType["DEFAULT"] = "DEFAULT";
|
|
38
|
-
YieldStepType["XCM"] = "XCM";
|
|
39
|
-
YieldStepType["NOMINATE"] = "NOMINATE";
|
|
40
|
-
YieldStepType["JOIN_NOMINATION_POOL"] = "JOIN_NOMINATION_POOL";
|
|
41
|
-
YieldStepType["MINT_VDOT"] = "MINT_VDOT";
|
|
42
|
-
YieldStepType["MINT_LDOT"] = "MINT_LDOT";
|
|
43
|
-
YieldStepType["MINT_QDOT"] = "MINT_QDOT";
|
|
44
|
-
YieldStepType["MINT_SDOT"] = "MINT_SDOT";
|
|
45
|
-
YieldStepType["MINT_STDOT"] = "MINT_STDOT";
|
|
46
|
-
YieldStepType["TOKEN_APPROVAL"] = "TOKEN_APPROVAL";
|
|
47
|
-
})(YieldStepType || (exports.YieldStepType = YieldStepType = {}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.YieldValidationStatus = void 0;
|
|
7
|
-
// Copyright 2019-2022 @subwallet/extension-base
|
|
8
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
-
let YieldValidationStatus;
|
|
10
|
-
exports.YieldValidationStatus = YieldValidationStatus;
|
|
11
|
-
(function (YieldValidationStatus) {
|
|
12
|
-
YieldValidationStatus["NOT_ENOUGH_FEE"] = "NOT_ENOUGH_FEE";
|
|
13
|
-
YieldValidationStatus["NOT_ENOUGH_BALANCE"] = "NOT_ENOUGH_BALANCE";
|
|
14
|
-
YieldValidationStatus["NOT_ENOUGH_MIN_JOIN_POOL"] = "NOT_ENOUGH_MIN_JOIN_POOL";
|
|
15
|
-
YieldValidationStatus["OK"] = "OK";
|
|
16
|
-
})(YieldValidationStatus || (exports.YieldValidationStatus = YieldValidationStatus = {}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/cjs/types/yield/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _info = require("./info");
|
|
7
|
-
Object.keys(_info).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _info[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _info[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _actions = require("./actions");
|
|
18
|
-
Object.keys(_actions).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _actions[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _actions[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _info = require("./info");
|
|
7
|
-
Object.keys(_info).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _info[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _info[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _reward = require("./reward");
|
|
18
|
-
Object.keys(_reward).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _reward[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _reward[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _target = require("./target");
|
|
29
|
-
Object.keys(_target).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _target[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _target[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _unstake = require("./unstake");
|
|
40
|
-
Object.keys(_unstake).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _unstake[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _unstake[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.EarningStatus = void 0;
|
|
7
|
-
// Copyright 2019-2022 @subwallet/extension-base
|
|
8
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
-
/**
|
|
10
|
-
* @enum {string}
|
|
11
|
-
* @description The earning status of an account in a pool.
|
|
12
|
-
* */
|
|
13
|
-
let EarningStatus;
|
|
14
|
-
/**
|
|
15
|
-
* @interface NominationInfo
|
|
16
|
-
* @description Info of the validator account joined
|
|
17
|
-
* @prop {string} chain - Slug of chain
|
|
18
|
-
* @prop {string} validatorAddress - Validator's address or nomination pool's id
|
|
19
|
-
* @prop {string} [validatorIdentity] - Validator's identity
|
|
20
|
-
* @prop {string} activeStake - Active staked value
|
|
21
|
-
* @prop {boolean} [hasUnstaking] - Does the account have unstake request with validator?
|
|
22
|
-
* @prop {string} [validatorMinStake] - Min amount to join with validator
|
|
23
|
-
* @prop {EarningStatus} status - The staking status of the account
|
|
24
|
-
* */
|
|
25
|
-
exports.EarningStatus = EarningStatus;
|
|
26
|
-
(function (EarningStatus) {
|
|
27
|
-
EarningStatus["EARNING_REWARD"] = "EARNING_REWARD";
|
|
28
|
-
EarningStatus["PARTIALLY_EARNING"] = "PARTIALLY_EARNING";
|
|
29
|
-
EarningStatus["NOT_EARNING"] = "NOT_EARNING";
|
|
30
|
-
EarningStatus["WAITING"] = "WAITING";
|
|
31
|
-
EarningStatus["NOT_STAKING"] = "NOT_STAKING";
|
|
32
|
-
})(EarningStatus || (exports.EarningStatus = EarningStatus = {}));
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.UnstakingStatus = void 0;
|
|
7
|
-
// Copyright 2019-2022 @subwallet/extension-base
|
|
8
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
-
/**
|
|
10
|
-
* @enum {string}
|
|
11
|
-
* @description The status of un-staked request.
|
|
12
|
-
* */
|
|
13
|
-
let UnstakingStatus;
|
|
14
|
-
/**
|
|
15
|
-
* @interface UnstakingInfo
|
|
16
|
-
* @description Info of un-stake request
|
|
17
|
-
* @prop {string} chain - Slug of chain
|
|
18
|
-
* @prop {UnstakingStatus} status - Status of request
|
|
19
|
-
* @prop {string} claimable - Amount to be withdrawn
|
|
20
|
-
* @prop {number} [waitingTime] - Time remains to wait (in hours)
|
|
21
|
-
* @prop {string} [validatorAddress] - Address of validator
|
|
22
|
-
* */
|
|
23
|
-
exports.UnstakingStatus = UnstakingStatus;
|
|
24
|
-
(function (UnstakingStatus) {
|
|
25
|
-
UnstakingStatus["CLAIMABLE"] = "CLAIMABLE";
|
|
26
|
-
UnstakingStatus["UNLOCKING"] = "UNLOCKING";
|
|
27
|
-
})(UnstakingStatus || (exports.UnstakingStatus = UnstakingStatus = {}));
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.YieldPoolType = exports.YieldCompoundingPeriod = void 0;
|
|
7
|
-
// Copyright 2019-2022 @subwallet/extension-base
|
|
8
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
-
/**
|
|
10
|
-
* @enum {string}
|
|
11
|
-
* @description The types of yield pool.
|
|
12
|
-
* */
|
|
13
|
-
let YieldPoolType;
|
|
14
|
-
/**
|
|
15
|
-
* @enum {number}
|
|
16
|
-
* @description Time to calculate profit
|
|
17
|
-
* */
|
|
18
|
-
exports.YieldPoolType = YieldPoolType;
|
|
19
|
-
(function (YieldPoolType) {
|
|
20
|
-
YieldPoolType["LIQUID_STAKING"] = "LIQUID_STAKING";
|
|
21
|
-
YieldPoolType["LENDING"] = "LENDING";
|
|
22
|
-
YieldPoolType["SINGLE_FARMING"] = "SINGLE_FARMING";
|
|
23
|
-
YieldPoolType["NOMINATION_POOL"] = "NOMINATION_POOL";
|
|
24
|
-
YieldPoolType["NATIVE_STAKING"] = "NATIVE_STAKING";
|
|
25
|
-
YieldPoolType["PARACHAIN_STAKING"] = "PARACHAIN_STAKING";
|
|
26
|
-
})(YieldPoolType || (exports.YieldPoolType = YieldPoolType = {}));
|
|
27
|
-
let YieldCompoundingPeriod;
|
|
28
|
-
/**
|
|
29
|
-
* @interface BasePoolInfo
|
|
30
|
-
* @prop {string} slug - Pool's slug
|
|
31
|
-
* @prop {string} chain - Pool's chain
|
|
32
|
-
* @prop {string} type - Pool's type
|
|
33
|
-
* @prop {string} group - Pool's group (by token)
|
|
34
|
-
* */
|
|
35
|
-
exports.YieldCompoundingPeriod = YieldCompoundingPeriod;
|
|
36
|
-
(function (YieldCompoundingPeriod) {
|
|
37
|
-
YieldCompoundingPeriod[YieldCompoundingPeriod["DAILY"] = 1] = "DAILY";
|
|
38
|
-
YieldCompoundingPeriod[YieldCompoundingPeriod["WEEKLY"] = 7] = "WEEKLY";
|
|
39
|
-
YieldCompoundingPeriod[YieldCompoundingPeriod["MONTHLY"] = 30] = "MONTHLY";
|
|
40
|
-
YieldCompoundingPeriod[YieldCompoundingPeriod["YEARLY"] = 365] = "YEARLY";
|
|
41
|
-
})(YieldCompoundingPeriod || (exports.YieldCompoundingPeriod = YieldCompoundingPeriod = {}));
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _info = require("./info");
|
|
7
|
-
Object.keys(_info).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _info[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _info[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _target = require("./target");
|
|
18
|
-
Object.keys(_target).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _target[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _target[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _account = require("./account");
|
|
7
|
-
Object.keys(_account).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _account[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _account[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _base = require("./base");
|
|
18
|
-
Object.keys(_base).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _base[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _base[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _chain = require("./chain");
|
|
29
|
-
Object.keys(_chain).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _chain[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _chain[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _pallet = require("./pallet");
|
|
40
|
-
Object.keys(_pallet).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _pallet[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _pallet[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|