@subwallet/extension-base 1.1.33-beta.1 → 1.1.34-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 -120
- package/background/KoniTypes.js +13 -22
- package/background/errors/TransactionError.js +0 -9
- package/cjs/background/KoniTypes.js +16 -23
- 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 +17 -2
- package/cjs/services/chain-service/index.js +3 -25
- 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 +1 -92
- package/cjs/services/storage-service/databases/index.js +0 -7
- 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 -252
- 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 +8 -331
- 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 +13 -1
- package/services/chain-service/constants.js +15 -1
- package/services/chain-service/index.d.ts +0 -2
- package/services/chain-service/index.js +3 -25
- 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 +3 -30
- package/services/storage-service/DatabaseService.js +1 -91
- package/services/storage-service/databases/index.d.ts +2 -8
- package/services/storage-service/databases/index.js +0 -7
- 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 -250
- 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 -49
- 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 -98
- package/cjs/services/earning-service/handlers/liquid-staking/bifrost-manta.js +0 -140
- package/cjs/services/earning-service/handlers/liquid-staking/bifrost.js +0 -299
- package/cjs/services/earning-service/handlers/liquid-staking/index.js +0 -41
- 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 -497
- package/cjs/services/earning-service/service.js +0 -741
- 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/AssetRef.js +0 -24
- 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 -48
- 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 -34
- 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 -90
- package/services/earning-service/handlers/liquid-staking/bifrost-manta.d.ts +0 -37
- package/services/earning-service/handlers/liquid-staking/bifrost-manta.js +0 -132
- package/services/earning-service/handlers/liquid-staking/bifrost.d.ts +0 -46
- package/services/earning-service/handlers/liquid-staking/bifrost.js +0 -288
- package/services/earning-service/handlers/liquid-staking/index.d.ts +0 -5
- package/services/earning-service/handlers/liquid-staking/index.js +0 -8
- 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 -489
- package/services/earning-service/service.d.ts +0 -94
- package/services/earning-service/service.js +0 -730
- 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/AssetRef.d.ts +0 -7
- package/services/storage-service/db-stores/AssetRef.js +0 -16
- 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 -96
- package/types/yield/actions/join/step.js +0 -47
- 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,18 +0,0 @@
|
|
|
1
|
-
import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types';
|
|
2
|
-
import { LendingYieldPoolInfo, LiquidYieldPoolInfo, NativeYieldPoolInfo, NominationYieldPoolInfo, YieldAssetExpectedEarning, YieldCompoundingPeriod, YieldPoolInfo, YieldPoolType } from '@subwallet/extension-base/types';
|
|
3
|
-
export declare function calculateReward(apr: number, amount?: number, compoundingPeriod?: YieldCompoundingPeriod, isApy?: boolean): YieldAssetExpectedEarning;
|
|
4
|
-
/**
|
|
5
|
-
* @returns
|
|
6
|
-
* <p>
|
|
7
|
-
* [0] - identity
|
|
8
|
-
* </p>
|
|
9
|
-
* <p>
|
|
10
|
-
* [1] - isReasonable (isVerified)
|
|
11
|
-
* </p>
|
|
12
|
-
* */
|
|
13
|
-
export declare function parseIdentity(substrateApi: _SubstrateApi, address: string, children?: string): Promise<[string | undefined, boolean]>;
|
|
14
|
-
export declare function isActionFromValidator(stakingType: YieldPoolType, chain: string): boolean;
|
|
15
|
-
export declare const isNominationPool: (pool: YieldPoolInfo) => pool is NominationYieldPoolInfo;
|
|
16
|
-
export declare const isNativeStakingPool: (pool: YieldPoolInfo) => pool is NativeYieldPoolInfo;
|
|
17
|
-
export declare const isLiquidPool: (pool: YieldPoolInfo) => pool is LiquidYieldPoolInfo;
|
|
18
|
-
export declare const isLendingPool: (pool: YieldPoolInfo) => pool is LendingYieldPoolInfo;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
// Copyright 2019-2022 @subwallet/extension-base
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import { _STAKING_CHAIN_GROUP } from '@subwallet/extension-base/services/earning-service/constants';
|
|
5
|
-
import { YieldCompoundingPeriod, YieldPoolType } from '@subwallet/extension-base/types';
|
|
6
|
-
import { hexToString, isHex } from '@polkadot/util';
|
|
7
|
-
export function calculateReward(apr, amount = 0, compoundingPeriod = YieldCompoundingPeriod.YEARLY, isApy = false) {
|
|
8
|
-
if (!apr) {
|
|
9
|
-
return {};
|
|
10
|
-
}
|
|
11
|
-
if (!isApy) {
|
|
12
|
-
const periodApr = apr / 365 * compoundingPeriod; // APR is always annually
|
|
13
|
-
const earningRatio = periodApr / 100 / compoundingPeriod;
|
|
14
|
-
const periodApy = (1 + earningRatio) ** compoundingPeriod - 1;
|
|
15
|
-
const reward = periodApy * amount;
|
|
16
|
-
return {
|
|
17
|
-
apy: periodApy * 100,
|
|
18
|
-
rewardInToken: reward
|
|
19
|
-
};
|
|
20
|
-
} else {
|
|
21
|
-
const reward = apr / 100 * amount;
|
|
22
|
-
return {
|
|
23
|
-
apy: apr,
|
|
24
|
-
rewardInToken: reward * (compoundingPeriod / YieldCompoundingPeriod.YEARLY)
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @returns
|
|
31
|
-
* <p>
|
|
32
|
-
* [0] - identity
|
|
33
|
-
* </p>
|
|
34
|
-
* <p>
|
|
35
|
-
* [1] - isReasonable (isVerified)
|
|
36
|
-
* </p>
|
|
37
|
-
* */
|
|
38
|
-
export async function parseIdentity(substrateApi, address, children) {
|
|
39
|
-
const compactResult = rs => {
|
|
40
|
-
const result = [];
|
|
41
|
-
if (rs) {
|
|
42
|
-
result.push(rs);
|
|
43
|
-
}
|
|
44
|
-
if (children) {
|
|
45
|
-
result.push(children);
|
|
46
|
-
}
|
|
47
|
-
if (result.length > 0) {
|
|
48
|
-
return result.join('/');
|
|
49
|
-
} else {
|
|
50
|
-
return undefined;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
if (substrateApi.api.query.identity) {
|
|
54
|
-
let identity;
|
|
55
|
-
const _parent = await substrateApi.api.query.identity.superOf(address);
|
|
56
|
-
const parentInfo = _parent.toHuman();
|
|
57
|
-
if (parentInfo) {
|
|
58
|
-
const [parentAddress, {
|
|
59
|
-
Raw: data
|
|
60
|
-
}] = parentInfo;
|
|
61
|
-
const child = isHex(data) ? hexToString(data) : data;
|
|
62
|
-
|
|
63
|
-
// TODO: Re-check
|
|
64
|
-
if (address !== parentAddress) {
|
|
65
|
-
const [rs, isReasonable] = await parseIdentity(substrateApi, parentAddress, child);
|
|
66
|
-
return [compactResult(rs), isReasonable];
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const _identity = await substrateApi.api.query.identity.identityOf(address);
|
|
70
|
-
const identityInfo = _identity.toHuman();
|
|
71
|
-
if (identityInfo) {
|
|
72
|
-
var _identityInfo$info, _identityInfo$info$di, _identityInfo$info2, _identityInfo$info2$w, _identityInfo$info3, _identityInfo$info3$r, _identityInfo$info4, _identityInfo$info4$t;
|
|
73
|
-
const displayName = (_identityInfo$info = identityInfo.info) === null || _identityInfo$info === void 0 ? void 0 : (_identityInfo$info$di = _identityInfo$info.display) === null || _identityInfo$info$di === void 0 ? void 0 : _identityInfo$info$di.Raw;
|
|
74
|
-
const web = (_identityInfo$info2 = identityInfo.info) === null || _identityInfo$info2 === void 0 ? void 0 : (_identityInfo$info2$w = _identityInfo$info2.web) === null || _identityInfo$info2$w === void 0 ? void 0 : _identityInfo$info2$w.Raw;
|
|
75
|
-
const riot = (_identityInfo$info3 = identityInfo.info) === null || _identityInfo$info3 === void 0 ? void 0 : (_identityInfo$info3$r = _identityInfo$info3.riot) === null || _identityInfo$info3$r === void 0 ? void 0 : _identityInfo$info3$r.Raw;
|
|
76
|
-
const twitter = (_identityInfo$info4 = identityInfo.info) === null || _identityInfo$info4 === void 0 ? void 0 : (_identityInfo$info4$t = _identityInfo$info4.twitter) === null || _identityInfo$info4$t === void 0 ? void 0 : _identityInfo$info4$t.Raw;
|
|
77
|
-
const isReasonable = identityInfo.judgements.length > 0;
|
|
78
|
-
if (displayName) {
|
|
79
|
-
identity = isHex(displayName) ? hexToString(displayName) : displayName;
|
|
80
|
-
} else {
|
|
81
|
-
identity = twitter || web || riot;
|
|
82
|
-
}
|
|
83
|
-
return [compactResult(identity), isReasonable];
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return [undefined, false];
|
|
87
|
-
}
|
|
88
|
-
export function isActionFromValidator(stakingType, chain) {
|
|
89
|
-
if (stakingType === YieldPoolType.NOMINATION_POOL || stakingType === YieldPoolType.LIQUID_STAKING || stakingType === YieldPoolType.LENDING) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
if (_STAKING_CHAIN_GROUP.astar.includes(chain)) {
|
|
93
|
-
return true;
|
|
94
|
-
} else if (_STAKING_CHAIN_GROUP.amplitude.includes(chain)) {
|
|
95
|
-
return true;
|
|
96
|
-
} else if (_STAKING_CHAIN_GROUP.para.includes(chain)) {
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
export const isNominationPool = pool => {
|
|
102
|
-
return pool.type === YieldPoolType.NOMINATION_POOL;
|
|
103
|
-
};
|
|
104
|
-
export const isNativeStakingPool = pool => {
|
|
105
|
-
return pool.type === YieldPoolType.NATIVE_STAKING;
|
|
106
|
-
};
|
|
107
|
-
export const isLiquidPool = pool => {
|
|
108
|
-
return pool.type === YieldPoolType.LIQUID_STAKING;
|
|
109
|
-
};
|
|
110
|
-
export const isLendingPool = pool => {
|
|
111
|
-
return pool.type === YieldPoolType.LENDING;
|
|
112
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import BaseMigrationJob from '@subwallet/extension-base/services/migration-service/Base';
|
|
5
|
-
export default class DeleteEarningData extends BaseMigrationJob {
|
|
6
|
-
async run() {
|
|
7
|
-
try {
|
|
8
|
-
await this.state.dbService.deleteYieldPoolInfo(['LcDOT___acala_euphrates_liquid_staking', 'xcDOT___moonwell_lending']);
|
|
9
|
-
} catch (e) {
|
|
10
|
-
console.error(e);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import BaseMigrationJob from '@subwallet/extension-base/services/migration-service/Base';
|
|
5
|
-
export default class EnableEarningChains extends BaseMigrationJob {
|
|
6
|
-
async run() {
|
|
7
|
-
try {
|
|
8
|
-
await this.state.chainService.enableChains(['moonbeam', 'acala', 'bifrost_dot', 'interlay', 'parallel']);
|
|
9
|
-
} catch (e) {
|
|
10
|
-
console.error(e);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import BaseMigrationJob from '@subwallet/extension-base/services/migration-service/Base';
|
|
5
|
-
export default class MigrateEarningHistory extends BaseMigrationJob {
|
|
6
|
-
async run() {
|
|
7
|
-
try {
|
|
8
|
-
await this.state.dbService.removeOldEarningData();
|
|
9
|
-
} catch (e) {
|
|
10
|
-
console.error(e);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import BaseMigrationJob from '@subwallet/extension-base/services/migration-service/Base';
|
|
5
|
-
export default class MigrateEarningVersion extends BaseMigrationJob {
|
|
6
|
-
async run() {
|
|
7
|
-
try {
|
|
8
|
-
await this.state.dbService.removeOldEarningData();
|
|
9
|
-
} catch (e) {
|
|
10
|
-
console.error(e);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import KoniState from '@subwallet/extension-base/koni/background/handlers/State';
|
|
2
|
-
import { UnlockDotSubmitMintData, UnlockDotTransactionNft } from '@subwallet/extension-base/types';
|
|
3
|
-
export default class UnlockDotCampaign {
|
|
4
|
-
#private;
|
|
5
|
-
constructor(state: KoniState);
|
|
6
|
-
mintNft({ address, extrinsicHash, network, slug, transactionId }: UnlockDotSubmitMintData): Promise<void>;
|
|
7
|
-
private checkMint;
|
|
8
|
-
private submitNft;
|
|
9
|
-
private getMinted;
|
|
10
|
-
canMint(address: string, slug: string, network: string): Promise<boolean>;
|
|
11
|
-
subscribeMintedNft(transactionId: string, cb: (data: UnlockDotTransactionNft) => void): import("rxjs").Subscription;
|
|
12
|
-
getMintedNft(transactionId: string): UnlockDotTransactionNft;
|
|
13
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import { isSameAddress } from '@subwallet/extension-base/utils';
|
|
5
|
-
import axios from 'axios';
|
|
6
|
-
import { BehaviorSubject } from 'rxjs';
|
|
7
|
-
import { MINT_HOST } from "../constants.js";
|
|
8
|
-
export default class UnlockDotCampaign {
|
|
9
|
-
#host = MINT_HOST;
|
|
10
|
-
#campaignId = 4;
|
|
11
|
-
#state;
|
|
12
|
-
#transactionNftSubject = new BehaviorSubject({});
|
|
13
|
-
#transactionNftState = {};
|
|
14
|
-
constructor(state) {
|
|
15
|
-
this.#state = state;
|
|
16
|
-
}
|
|
17
|
-
async mintNft({
|
|
18
|
-
address,
|
|
19
|
-
extrinsicHash,
|
|
20
|
-
network,
|
|
21
|
-
slug,
|
|
22
|
-
transactionId
|
|
23
|
-
}) {
|
|
24
|
-
var _result;
|
|
25
|
-
this.#transactionNftState[transactionId] = undefined;
|
|
26
|
-
this.#transactionNftSubject.next(this.#transactionNftState);
|
|
27
|
-
const requestId = await this.checkMint({
|
|
28
|
-
address,
|
|
29
|
-
extrinsicHash,
|
|
30
|
-
network,
|
|
31
|
-
slug
|
|
32
|
-
});
|
|
33
|
-
let result;
|
|
34
|
-
if (requestId) {
|
|
35
|
-
result = await this.submitNft(address, requestId);
|
|
36
|
-
await this.#state.reloadNft();
|
|
37
|
-
// } else {
|
|
38
|
-
// result = await this.getMinted(address, slug);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
this.#transactionNftState[transactionId] = (_result = result) !== null && _result !== void 0 ? _result : {
|
|
42
|
-
nftImage: ''
|
|
43
|
-
};
|
|
44
|
-
this.#transactionNftSubject.next(this.#transactionNftState);
|
|
45
|
-
}
|
|
46
|
-
async checkMint({
|
|
47
|
-
address,
|
|
48
|
-
extrinsicHash,
|
|
49
|
-
network,
|
|
50
|
-
slug
|
|
51
|
-
}) {
|
|
52
|
-
const data = {
|
|
53
|
-
address,
|
|
54
|
-
campaignId: this.#campaignId,
|
|
55
|
-
category: slug,
|
|
56
|
-
additionalData: {
|
|
57
|
-
slug,
|
|
58
|
-
extrinsicHash,
|
|
59
|
-
network
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const response = await axios.request({
|
|
63
|
-
baseURL: this.#host,
|
|
64
|
-
url: '/api/mint/check',
|
|
65
|
-
method: 'POST',
|
|
66
|
-
data
|
|
67
|
-
});
|
|
68
|
-
const respData = response.data;
|
|
69
|
-
if (respData.inMintingTime && respData.hasBalance && respData.validCampaign && respData.validCategory && respData.validUser && respData.notDuplicated && respData.requestId && respData.requestId > 1) {
|
|
70
|
-
return respData.requestId;
|
|
71
|
-
}
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
async submitNft(address, id) {
|
|
75
|
-
const data = {
|
|
76
|
-
requestId: id,
|
|
77
|
-
recipient: address
|
|
78
|
-
};
|
|
79
|
-
const response = await axios.request({
|
|
80
|
-
baseURL: this.#host,
|
|
81
|
-
url: '/api/mint/submit',
|
|
82
|
-
method: 'POST',
|
|
83
|
-
data
|
|
84
|
-
});
|
|
85
|
-
return response.data;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// @ts-ignore
|
|
89
|
-
async getMinted(address, slug) {
|
|
90
|
-
const params = {
|
|
91
|
-
address
|
|
92
|
-
};
|
|
93
|
-
const response = await axios.request({
|
|
94
|
-
baseURL: this.#host,
|
|
95
|
-
url: '/api/mint/fetch',
|
|
96
|
-
method: 'GET',
|
|
97
|
-
params: params
|
|
98
|
-
});
|
|
99
|
-
const data = response.data;
|
|
100
|
-
for (const item of data) {
|
|
101
|
-
if (isSameAddress(item.address, address) && slug === item.mintCategory && item.status === 'success' && item.campaignId === this.#campaignId) {
|
|
102
|
-
return item;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return undefined;
|
|
106
|
-
}
|
|
107
|
-
async canMint(address, slug, network) {
|
|
108
|
-
const data = {
|
|
109
|
-
address,
|
|
110
|
-
campaignId: this.#campaignId,
|
|
111
|
-
category: slug,
|
|
112
|
-
additionalData: {
|
|
113
|
-
slug,
|
|
114
|
-
network
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
const response = await axios.request({
|
|
118
|
-
baseURL: this.#host,
|
|
119
|
-
url: '/api/mint/check',
|
|
120
|
-
method: 'POST',
|
|
121
|
-
data
|
|
122
|
-
});
|
|
123
|
-
const respData = response.data;
|
|
124
|
-
if (respData.inMintingTime && respData.validCampaign && respData.validCategory && respData.validUser && respData.notDuplicated) {
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
subscribeMintedNft(transactionId, cb) {
|
|
130
|
-
return this.#transactionNftSubject.subscribe({
|
|
131
|
-
next: map => {
|
|
132
|
-
cb(map[transactionId]);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
getMintedNft(transactionId) {
|
|
137
|
-
return this.#transactionNftSubject.value[transactionId];
|
|
138
|
-
}
|
|
139
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as UnlockDotCampaign } from './UnlockDotCampaign';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MINT_HOST: string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import KoniState from '@subwallet/extension-base/koni/background/handlers/State';
|
|
2
|
-
import { UnlockDotCampaign } from './campaigns';
|
|
3
|
-
export default class MintCampaignService {
|
|
4
|
-
#private;
|
|
5
|
-
readonly unlockDotCampaign: UnlockDotCampaign;
|
|
6
|
-
constructor(state: KoniState);
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Copyright 2019-2022 @polkadot/extension-base authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import { UnlockDotCampaign } from "./campaigns/index.js";
|
|
5
|
-
export default class MintCampaignService {
|
|
6
|
-
#state;
|
|
7
|
-
constructor(state) {
|
|
8
|
-
this.#state = state;
|
|
9
|
-
this.unlockDotCampaign = new UnlockDotCampaign(this.#state);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IAssetRef } from '@subwallet/extension-base/services/storage-service/databases';
|
|
2
|
-
import BaseStore from '@subwallet/extension-base/services/storage-service/db-stores/BaseStore';
|
|
3
|
-
export default class AssetRefStore extends BaseStore<IAssetRef> {
|
|
4
|
-
getAll(): Promise<IAssetRef[]>;
|
|
5
|
-
getAssetRef(slug: string): Promise<IAssetRef | undefined>;
|
|
6
|
-
subscribeAssetRef(): import("dexie").Observable<IAssetRef[]>;
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import BaseStore from '@subwallet/extension-base/services/storage-service/db-stores/BaseStore';
|
|
5
|
-
import { liveQuery } from 'dexie';
|
|
6
|
-
export default class AssetRefStore extends BaseStore {
|
|
7
|
-
async getAll() {
|
|
8
|
-
return this.table.toArray();
|
|
9
|
-
}
|
|
10
|
-
async getAssetRef(slug) {
|
|
11
|
-
return this.table.get(slug);
|
|
12
|
-
}
|
|
13
|
-
subscribeAssetRef() {
|
|
14
|
-
return liveQuery(async () => await this.table.toArray());
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import BaseStore from '@subwallet/extension-base/services/storage-service/db-stores/BaseStore';
|
|
2
|
-
import { YieldPoolInfo, YieldPoolType } from '@subwallet/extension-base/types';
|
|
3
|
-
export default class YieldPoolStore extends BaseStore<YieldPoolInfo> {
|
|
4
|
-
getAll(): Promise<YieldPoolInfo[]>;
|
|
5
|
-
getByChains(chains: string[]): Promise<YieldPoolInfo[]>;
|
|
6
|
-
getByChainAndType(chain: string, poolType: YieldPoolType): Promise<YieldPoolInfo | undefined>;
|
|
7
|
-
bulkDelete(slugs: string[]): Promise<void>;
|
|
8
|
-
getBySlug(slug: string): Promise<YieldPoolInfo | undefined>;
|
|
9
|
-
subscribeYieldPoolInfo(chains: string[]): import("dexie").Observable<YieldPoolInfo[]>;
|
|
10
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import BaseStore from '@subwallet/extension-base/services/storage-service/db-stores/BaseStore';
|
|
5
|
-
import { liveQuery } from 'dexie';
|
|
6
|
-
export default class YieldPoolStore extends BaseStore {
|
|
7
|
-
async getAll() {
|
|
8
|
-
return this.table.toArray();
|
|
9
|
-
}
|
|
10
|
-
async getByChains(chains) {
|
|
11
|
-
if (chains.length === 0) {
|
|
12
|
-
return this.getAll();
|
|
13
|
-
}
|
|
14
|
-
return this.table.where('chain').anyOfIgnoreCase(chains).toArray();
|
|
15
|
-
}
|
|
16
|
-
async getByChainAndType(chain, poolType) {
|
|
17
|
-
return this.table.where('chain').equals(chain).and(item => item.type === poolType).first();
|
|
18
|
-
}
|
|
19
|
-
async bulkDelete(slugs) {
|
|
20
|
-
return this.table.bulkDelete(slugs);
|
|
21
|
-
}
|
|
22
|
-
async getBySlug(slug) {
|
|
23
|
-
return this.table.get(slug);
|
|
24
|
-
}
|
|
25
|
-
subscribeYieldPoolInfo(chains) {
|
|
26
|
-
return liveQuery(() => this.getByChains(chains));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import BaseStore from '@subwallet/extension-base/services/storage-service/db-stores/BaseStore';
|
|
2
|
-
import { YieldPositionInfo } from '@subwallet/extension-base/types';
|
|
3
|
-
export default class YieldPositionStore extends BaseStore<YieldPositionInfo> {
|
|
4
|
-
getAll(): Promise<YieldPositionInfo[]>;
|
|
5
|
-
getByAddress(addresses: string[]): Promise<YieldPositionInfo[]>;
|
|
6
|
-
removeByAddresses(addresses: string[]): import("dexie").PromiseExtended<number>;
|
|
7
|
-
removeByChains(chains: string[]): import("dexie").PromiseExtended<number>;
|
|
8
|
-
getByAddressAndChains(addresses: string[], chains: string[]): Promise<YieldPositionInfo[]>;
|
|
9
|
-
getByAddressAndSlug(address: string, slug: string): import("dexie").PromiseExtended<YieldPositionInfo | undefined>;
|
|
10
|
-
subscribeYieldPositions(addresses: string[]): import("dexie").Observable<YieldPositionInfo[]>;
|
|
11
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import BaseStore from '@subwallet/extension-base/services/storage-service/db-stores/BaseStore';
|
|
5
|
-
import { liveQuery } from 'dexie';
|
|
6
|
-
export default class YieldPositionStore extends BaseStore {
|
|
7
|
-
async getAll() {
|
|
8
|
-
return this.table
|
|
9
|
-
// .filter((item) => {
|
|
10
|
-
// let isValidLiquidStaking = false;
|
|
11
|
-
//
|
|
12
|
-
// if (item.type === YieldPoolType.LIQUID_STAKING) {
|
|
13
|
-
// const nominatorMetadata = item.metadata as NominatorMetadata;
|
|
14
|
-
//
|
|
15
|
-
// if (nominatorMetadata.unstakings.length > 0) {
|
|
16
|
-
// console.log('true', item);
|
|
17
|
-
// isValidLiquidStaking = true;
|
|
18
|
-
// }
|
|
19
|
-
// }
|
|
20
|
-
//
|
|
21
|
-
// return parseInt(item.balance[0].activeBalance) > 0 || isValidLiquidStaking;
|
|
22
|
-
// })
|
|
23
|
-
.toArray();
|
|
24
|
-
}
|
|
25
|
-
async getByAddress(addresses) {
|
|
26
|
-
if (addresses.length === 0) {
|
|
27
|
-
return this.getAll();
|
|
28
|
-
}
|
|
29
|
-
return this.table.where('address').anyOfIgnoreCase(addresses)
|
|
30
|
-
// .filter((item) => {
|
|
31
|
-
// let isValidLiquidStaking = false;
|
|
32
|
-
//
|
|
33
|
-
// if (item.type === YieldPoolType.LIQUID_STAKING) {
|
|
34
|
-
// const nominatorMetadata = item.metadata as NominatorMetadata;
|
|
35
|
-
//
|
|
36
|
-
// if (nominatorMetadata && nominatorMetadata?.unstakings?.length > 0) {
|
|
37
|
-
// isValidLiquidStaking = true;
|
|
38
|
-
// }
|
|
39
|
-
// }
|
|
40
|
-
//
|
|
41
|
-
// return parseInt(item.balance[0].activeBalance) > 0 || isValidLiquidStaking;
|
|
42
|
-
// })
|
|
43
|
-
.toArray();
|
|
44
|
-
}
|
|
45
|
-
removeByAddresses(addresses) {
|
|
46
|
-
return this.table.where('address').anyOf(addresses).delete();
|
|
47
|
-
}
|
|
48
|
-
removeByChains(chains) {
|
|
49
|
-
return this.table.where('chain').anyOf(chains).delete();
|
|
50
|
-
}
|
|
51
|
-
async getByAddressAndChains(addresses, chains) {
|
|
52
|
-
return this.table.where('address').anyOfIgnoreCase(addresses).filter(item => chains.includes(item.chain)).toArray();
|
|
53
|
-
}
|
|
54
|
-
getByAddressAndSlug(address, slug) {
|
|
55
|
-
return this.table.get({
|
|
56
|
-
address,
|
|
57
|
-
slug
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
subscribeYieldPositions(addresses) {
|
|
61
|
-
return liveQuery(() => this.getByAddress(addresses));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './unlock-dot';
|
package/types/campaigns/index.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
export interface UnlockDotAdditionalData {
|
|
2
|
-
slug: string;
|
|
3
|
-
network: string;
|
|
4
|
-
extrinsicHash?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface UnlockDotCheckMintRequest {
|
|
7
|
-
address: string;
|
|
8
|
-
additionalData: UnlockDotAdditionalData;
|
|
9
|
-
category: string;
|
|
10
|
-
campaignId: number;
|
|
11
|
-
}
|
|
12
|
-
export interface UnlockDotCheckMintResponse {
|
|
13
|
-
requestId: number | null;
|
|
14
|
-
userId: number;
|
|
15
|
-
validUser: boolean;
|
|
16
|
-
validCampaign: boolean;
|
|
17
|
-
validCategory: boolean;
|
|
18
|
-
isWhiteList: boolean;
|
|
19
|
-
isOwner: boolean;
|
|
20
|
-
hasBalance: boolean;
|
|
21
|
-
notDuplicated: boolean;
|
|
22
|
-
inMintingTime: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface UnlockDotMintedData {
|
|
25
|
-
id: number;
|
|
26
|
-
campaignId: number;
|
|
27
|
-
collectionId: number;
|
|
28
|
-
userId: number;
|
|
29
|
-
address: string;
|
|
30
|
-
status: string;
|
|
31
|
-
extrinsicHash: string;
|
|
32
|
-
mintCategory: string;
|
|
33
|
-
mintDate: null;
|
|
34
|
-
rmrkNftId: string;
|
|
35
|
-
nftName: string;
|
|
36
|
-
nftImage: string;
|
|
37
|
-
recipient: string;
|
|
38
|
-
blockNumber: number;
|
|
39
|
-
additionalData: string;
|
|
40
|
-
}
|
|
41
|
-
export declare type UnlockDotTransactionNft = UnlockDotMintedData | undefined | Pick<UnlockDotMintedData, 'nftImage'>;
|
|
42
|
-
export interface UnlockDotFetchMintedRequest {
|
|
43
|
-
address: string;
|
|
44
|
-
}
|
|
45
|
-
export declare type UnlockDotFetchMintedResponse = UnlockDotMintedData[];
|
|
46
|
-
export interface UnlockDotMintSubmitRequest {
|
|
47
|
-
recipient: string;
|
|
48
|
-
requestId: number;
|
|
49
|
-
}
|
|
50
|
-
export declare type UnlockDotMintSubmitResponse = UnlockDotMintedData;
|
|
51
|
-
export interface UnlockDotCheckMintData {
|
|
52
|
-
address: string;
|
|
53
|
-
slug: string;
|
|
54
|
-
network: string;
|
|
55
|
-
extrinsicHash?: string;
|
|
56
|
-
}
|
|
57
|
-
export interface UnlockDotSubmitMintData {
|
|
58
|
-
transactionId: string;
|
|
59
|
-
address: string;
|
|
60
|
-
slug: string;
|
|
61
|
-
network: string;
|
|
62
|
-
extrinsicHash: string;
|
|
63
|
-
}
|
|
64
|
-
export interface RequestUnlockDotCheckCanMint {
|
|
65
|
-
address: string;
|
|
66
|
-
slug: string;
|
|
67
|
-
network: string;
|
|
68
|
-
}
|
|
69
|
-
export interface RequestUnlockDotSubscribeMintedData {
|
|
70
|
-
transactionId: string;
|
|
71
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|