@subwallet/extension-base 1.3.69-0 → 1.3.70-2
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 +11 -0
- package/background/KoniTypes.js +3 -0
- package/cjs/background/KoniTypes.js +3 -0
- package/cjs/koni/background/handlers/Extension.js +62 -0
- package/cjs/koni/background/handlers/State.js +5 -2
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/chain-service/constants.js +15 -4
- package/cjs/services/chain-service/utils/index.js +13 -5
- package/cjs/services/event-service/index.js +1 -0
- package/cjs/services/open-gov/handler.js +563 -0
- package/cjs/services/open-gov/index.js +273 -0
- package/cjs/services/open-gov/interface.js +28 -0
- package/cjs/services/open-gov/utils.js +66 -0
- package/cjs/services/storage-service/DatabaseService.js +19 -1
- package/cjs/services/storage-service/databases/index.js +3 -0
- package/cjs/services/storage-service/db-stores/GovLockedInfoStore.js +35 -0
- package/cjs/services/transaction-service/helpers/index.js +6 -0
- package/cjs/services/transaction-service/index.js +43 -0
- package/cjs/utils/account/transform.js +5 -4
- package/koni/background/handlers/Extension.d.ts +4 -0
- package/koni/background/handlers/Extension.js +62 -0
- package/koni/background/handlers/State.d.ts +2 -0
- package/koni/background/handlers/State.js +5 -2
- package/package.json +30 -5
- package/packageInfo.js +1 -1
- package/services/chain-service/constants.d.ts +8 -0
- package/services/chain-service/constants.js +12 -2
- package/services/chain-service/utils/index.js +13 -5
- package/services/event-service/index.d.ts +1 -0
- package/services/event-service/index.js +1 -0
- package/services/event-service/types.d.ts +1 -0
- package/services/open-gov/handler.d.ts +27 -0
- package/services/open-gov/handler.js +547 -0
- package/services/open-gov/index.d.ts +45 -0
- package/services/open-gov/index.js +265 -0
- package/services/open-gov/interface.d.ts +141 -0
- package/services/open-gov/interface.js +21 -0
- package/services/open-gov/utils.d.ts +14 -0
- package/services/open-gov/utils.js +52 -0
- package/services/storage-service/DatabaseService.d.ts +7 -0
- package/services/storage-service/DatabaseService.js +19 -1
- package/services/storage-service/databases/index.d.ts +2 -0
- package/services/storage-service/databases/index.js +3 -0
- package/services/storage-service/db-stores/GovLockedInfoStore.d.ts +10 -0
- package/services/storage-service/db-stores/GovLockedInfoStore.js +27 -0
- package/services/transaction-service/helpers/index.js +6 -0
- package/services/transaction-service/index.js +43 -0
- package/utils/account/transform.js +5 -4
|
@@ -34,6 +34,7 @@ import { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
|
|
|
34
34
|
import { SignerResult } from '@polkadot/types/types/extrinsic';
|
|
35
35
|
import { HexString } from '@polkadot/util/types';
|
|
36
36
|
import { EarningImpactResult } from '../services/earning-service/handlers/native-staking/dtao';
|
|
37
|
+
import { GovVoteRequest, GovVotingInfo, RemoveVoteRequest, UnlockVoteRequest } from '../services/open-gov/interface';
|
|
37
38
|
import { TransactionWarning } from './warnings/TransactionWarning';
|
|
38
39
|
export declare enum RuntimeEnvironment {
|
|
39
40
|
Web = "Web",
|
|
@@ -447,6 +448,9 @@ export declare enum ExtrinsicType {
|
|
|
447
448
|
TOKEN_SPENDING_APPROVAL = "token.spending_approval",
|
|
448
449
|
SWAP = "swap",
|
|
449
450
|
CLAIM_BRIDGE = "claim.claim_bridge",
|
|
451
|
+
GOV_VOTE = "gov.vote",
|
|
452
|
+
GOV_UNVOTE = "gov.unvote",
|
|
453
|
+
GOV_UNLOCK_VOTE = "gov.unlock-vote",
|
|
450
454
|
EVM_EXECUTE = "evm.execute",
|
|
451
455
|
UNKNOWN = "unknown"
|
|
452
456
|
}
|
|
@@ -490,6 +494,9 @@ export interface ExtrinsicDataTypeMap {
|
|
|
490
494
|
[ExtrinsicType.CLAIM_BRIDGE]: RequestClaimBridge;
|
|
491
495
|
[ExtrinsicType.EVM_EXECUTE]: TransactionConfig;
|
|
492
496
|
[ExtrinsicType.CROWDLOAN]: any;
|
|
497
|
+
[ExtrinsicType.GOV_VOTE]: GovVoteRequest;
|
|
498
|
+
[ExtrinsicType.GOV_UNVOTE]: RemoveVoteRequest;
|
|
499
|
+
[ExtrinsicType.GOV_UNLOCK_VOTE]: UnlockVoteRequest;
|
|
493
500
|
[ExtrinsicType.SWAP]: SwapTxData;
|
|
494
501
|
[ExtrinsicType.UNKNOWN]: any;
|
|
495
502
|
}
|
|
@@ -2084,6 +2091,10 @@ export interface KoniRequestSignatures {
|
|
|
2084
2091
|
'pri(migrate.migrateUnifiedAndFetchEligibleSoloAccounts)': [RequestMigrateUnifiedAndFetchEligibleSoloAccounts, ResponseMigrateUnifiedAndFetchEligibleSoloAccounts];
|
|
2085
2092
|
'pri(migrate.migrateSoloAccount)': [RequestMigrateSoloAccount, ResponseMigrateSoloAccount];
|
|
2086
2093
|
'pri(migrate.pingSession)': [RequestPingSession, boolean];
|
|
2094
|
+
'pri(openGov.vote)': [GovVoteRequest, SWTransactionResponse];
|
|
2095
|
+
'pri(openGov.unvote)': [RemoveVoteRequest, SWTransactionResponse];
|
|
2096
|
+
'pri(openGov.subscribeGovLockedInfo)': [null, GovVotingInfo[], GovVotingInfo[]];
|
|
2097
|
+
'pri(openGov.unlockVote)': [UnlockVoteRequest, SWTransactionResponse];
|
|
2087
2098
|
}
|
|
2088
2099
|
export interface ApplicationMetadataType {
|
|
2089
2100
|
version: string;
|
package/background/KoniTypes.js
CHANGED
|
@@ -106,6 +106,9 @@ export let ExtrinsicType;
|
|
|
106
106
|
ExtrinsicType["TOKEN_SPENDING_APPROVAL"] = "token.spending_approval";
|
|
107
107
|
ExtrinsicType["SWAP"] = "swap";
|
|
108
108
|
ExtrinsicType["CLAIM_BRIDGE"] = "claim.claim_bridge";
|
|
109
|
+
ExtrinsicType["GOV_VOTE"] = "gov.vote";
|
|
110
|
+
ExtrinsicType["GOV_UNVOTE"] = "gov.unvote";
|
|
111
|
+
ExtrinsicType["GOV_UNLOCK_VOTE"] = "gov.unlock-vote";
|
|
109
112
|
ExtrinsicType["EVM_EXECUTE"] = "evm.execute";
|
|
110
113
|
ExtrinsicType["UNKNOWN"] = "unknown";
|
|
111
114
|
})(ExtrinsicType || (ExtrinsicType = {}));
|
|
@@ -121,6 +121,9 @@ exports.ExtrinsicType = ExtrinsicType;
|
|
|
121
121
|
ExtrinsicType["TOKEN_SPENDING_APPROVAL"] = "token.spending_approval";
|
|
122
122
|
ExtrinsicType["SWAP"] = "swap";
|
|
123
123
|
ExtrinsicType["CLAIM_BRIDGE"] = "claim.claim_bridge";
|
|
124
|
+
ExtrinsicType["GOV_VOTE"] = "gov.vote";
|
|
125
|
+
ExtrinsicType["GOV_UNVOTE"] = "gov.unvote";
|
|
126
|
+
ExtrinsicType["GOV_UNLOCK_VOTE"] = "gov.unlock-vote";
|
|
124
127
|
ExtrinsicType["EVM_EXECUTE"] = "evm.execute";
|
|
125
128
|
ExtrinsicType["UNKNOWN"] = "unknown";
|
|
126
129
|
})(ExtrinsicType || (exports.ExtrinsicType = ExtrinsicType = {}));
|
|
@@ -4842,6 +4842,58 @@ class KoniExtension {
|
|
|
4842
4842
|
}
|
|
4843
4843
|
/* Migrate Unified Account */
|
|
4844
4844
|
|
|
4845
|
+
/* Open Gov */
|
|
4846
|
+
|
|
4847
|
+
async handleVote(request) {
|
|
4848
|
+
const extrinsic = await this.#koniState.openGovService.handleVote(request);
|
|
4849
|
+
return await this.#koniState.transactionService.handleTransaction({
|
|
4850
|
+
address: request.address,
|
|
4851
|
+
chain: request.chain,
|
|
4852
|
+
transaction: extrinsic,
|
|
4853
|
+
data: request,
|
|
4854
|
+
extrinsicType: _KoniTypes.ExtrinsicType.GOV_VOTE,
|
|
4855
|
+
chainType: _KoniTypes.ChainType.SUBSTRATE
|
|
4856
|
+
});
|
|
4857
|
+
}
|
|
4858
|
+
async handleRemoveVote(request) {
|
|
4859
|
+
const extrinsic = await this.#koniState.openGovService.handleRemoveVote(request);
|
|
4860
|
+
return await this.#koniState.transactionService.handleTransaction({
|
|
4861
|
+
address: request.address,
|
|
4862
|
+
chain: request.chain,
|
|
4863
|
+
transaction: extrinsic,
|
|
4864
|
+
data: request,
|
|
4865
|
+
extrinsicType: _KoniTypes.ExtrinsicType.GOV_UNVOTE,
|
|
4866
|
+
chainType: _KoniTypes.ChainType.SUBSTRATE
|
|
4867
|
+
});
|
|
4868
|
+
}
|
|
4869
|
+
async handleUnlockVote(request) {
|
|
4870
|
+
const extrinsic = await this.#koniState.openGovService.handleUnlockVote(request);
|
|
4871
|
+
return await this.#koniState.transactionService.handleTransaction({
|
|
4872
|
+
address: request.address,
|
|
4873
|
+
chain: request.chain,
|
|
4874
|
+
transaction: extrinsic,
|
|
4875
|
+
data: request,
|
|
4876
|
+
extrinsicType: _KoniTypes.ExtrinsicType.GOV_UNLOCK_VOTE,
|
|
4877
|
+
chainType: _KoniTypes.ChainType.SUBSTRATE
|
|
4878
|
+
});
|
|
4879
|
+
}
|
|
4880
|
+
async subscribeGovLockedInfo(id, port) {
|
|
4881
|
+
const cb = (0, _subscriptions.createSubscription)(id, port);
|
|
4882
|
+
await this.#koniState.openGovService.waitForStarted();
|
|
4883
|
+
const govLockedInfoSubscription = this.#koniState.openGovService.subscribeGovLockedInfoSubject().subscribe({
|
|
4884
|
+
next: rs => {
|
|
4885
|
+
cb(rs);
|
|
4886
|
+
}
|
|
4887
|
+
});
|
|
4888
|
+
this.createUnsubscriptionHandle(id, govLockedInfoSubscription.unsubscribe);
|
|
4889
|
+
port.onDisconnect.addListener(() => {
|
|
4890
|
+
this.cancelSubscription(id);
|
|
4891
|
+
});
|
|
4892
|
+
return await this.#koniState.openGovService.getGovLockedInfoInfo();
|
|
4893
|
+
}
|
|
4894
|
+
|
|
4895
|
+
/* Open Gov */
|
|
4896
|
+
|
|
4845
4897
|
// --------------------------------------------------------------
|
|
4846
4898
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
4847
4899
|
async handle(id, type, request, port) {
|
|
@@ -5500,6 +5552,16 @@ class KoniExtension {
|
|
|
5500
5552
|
return this.migrateSoloAccount(request);
|
|
5501
5553
|
case 'pri(migrate.pingSession)':
|
|
5502
5554
|
return this.pingSession(request);
|
|
5555
|
+
|
|
5556
|
+
/* Gov */
|
|
5557
|
+
case 'pri(openGov.vote)':
|
|
5558
|
+
return this.handleVote(request);
|
|
5559
|
+
case 'pri(openGov.unvote)':
|
|
5560
|
+
return this.handleRemoveVote(request);
|
|
5561
|
+
case 'pri(openGov.unlockVote)':
|
|
5562
|
+
return this.handleUnlockVote(request);
|
|
5563
|
+
case 'pri(openGov.subscribeGovLockedInfo)':
|
|
5564
|
+
return this.subscribeGovLockedInfo(id, port);
|
|
5503
5565
|
// Default
|
|
5504
5566
|
default:
|
|
5505
5567
|
throw new Error(`Unable to handle message of type ${type}`);
|
|
@@ -34,6 +34,7 @@ var _mintCampaignService = _interopRequireDefault(require("@subwallet/extension-
|
|
|
34
34
|
var _mktCampaignService = _interopRequireDefault(require("@subwallet/extension-base/services/mkt-campaign-service"));
|
|
35
35
|
var _nftService = _interopRequireDefault(require("@subwallet/extension-base/services/nft-service"));
|
|
36
36
|
var _NotificationService = _interopRequireDefault(require("@subwallet/extension-base/services/notification-service/NotificationService"));
|
|
37
|
+
var _openGov = _interopRequireDefault(require("@subwallet/extension-base/services/open-gov"));
|
|
37
38
|
var _priceService = require("@subwallet/extension-base/services/price-service");
|
|
38
39
|
var _requestService = _interopRequireDefault(require("@subwallet/extension-base/services/request-service"));
|
|
39
40
|
var _PopupHandler = require("@subwallet/extension-base/services/request-service/handler/PopupHandler");
|
|
@@ -128,6 +129,7 @@ class KoniState {
|
|
|
128
129
|
this.swapService = new _swapService.SwapService(this);
|
|
129
130
|
this.inappNotificationService = new _inappNotificationService.InappNotificationService(this.dbService, this.keyringService, this.eventService, this.chainService);
|
|
130
131
|
this.chainOnlineService = new _chainOnlineService.ChainOnlineService(this.chainService, this.settingService, this.eventService, this.dbService);
|
|
132
|
+
this.openGovService = new _openGov.default(this);
|
|
131
133
|
this.subscription = new _subscription.KoniSubscription(this, this.dbService);
|
|
132
134
|
this.cron = new _cron.KoniCron(this, this.subscription, this.dbService);
|
|
133
135
|
this.logger = (0, _util.logger)('State');
|
|
@@ -232,6 +234,7 @@ class KoniState {
|
|
|
232
234
|
await this.earningService.init();
|
|
233
235
|
await this.swapService.init();
|
|
234
236
|
await this.inappNotificationService.init();
|
|
237
|
+
await this.openGovService.init();
|
|
235
238
|
|
|
236
239
|
// this.onReady();
|
|
237
240
|
this.onAccountAdd();
|
|
@@ -1687,7 +1690,7 @@ class KoniState {
|
|
|
1687
1690
|
this.campaignService.stop();
|
|
1688
1691
|
await Promise.all([this.cron.stop(), this.subscription.stop()]);
|
|
1689
1692
|
await this.pauseAllNetworks(undefined, 'IDLE mode');
|
|
1690
|
-
await Promise.all([this.historyService.stop(), this.priceService.stop(), this.balanceService.stop(), this.earningService.stop(), this.swapService.stop(), this.inappNotificationService.stop()]);
|
|
1693
|
+
await Promise.all([this.historyService.stop(), this.priceService.stop(), this.balanceService.stop(), this.earningService.stop(), this.swapService.stop(), this.inappNotificationService.stop(), this.openGovService.stop()]);
|
|
1691
1694
|
|
|
1692
1695
|
// Complete sleeping
|
|
1693
1696
|
sleeping.resolve();
|
|
@@ -1743,7 +1746,7 @@ class KoniState {
|
|
|
1743
1746
|
this.generalStatus = _types.ServiceStatus.STARTING_FULL;
|
|
1744
1747
|
const startingFull = (0, _promise.createPromiseHandler)();
|
|
1745
1748
|
this.waitStartingFull = startingFull.promise;
|
|
1746
|
-
await Promise.all([this.cron.start(), this.subscription.start(), this.historyService.start(), this.priceService.start(), this.balanceService.start(), this.earningService.start(), this.swapService.start(), this.inappNotificationService.start()]);
|
|
1749
|
+
await Promise.all([this.cron.start(), this.subscription.start(), this.historyService.start(), this.priceService.start(), this.balanceService.start(), this.earningService.start(), this.swapService.start(), this.inappNotificationService.start(), this.openGovService.start()]);
|
|
1747
1750
|
this.eventService.emit('general.start_full', true);
|
|
1748
1751
|
this.waitStartingFull = null;
|
|
1749
1752
|
this.generalStatus = _types.ServiceStatus.STARTED_FULL;
|
package/cjs/packageInfo.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports._ZK_ASSET_PREFIX = exports._TRANSFER_CHAIN_GROUP = exports._SUBSTRATE_DEFAULT_INFLATION_PARAMS = exports._STAKING_ERA_LENGTH_MAP = exports._PURE_EVM_CHAINS = exports._PREDEFINED_SINGLE_MODES = exports._PARACHAIN_INFLATION_DISTRIBUTION = exports._NFT_CHAIN_GROUP = exports._MANTA_ZK_CHAIN_GROUP = exports._KNOWN_CHAIN_INFLATION_PARAMS = exports._EXPECTED_BLOCK_TIME = exports._DEFAULT_MANTA_ZK_CHAIN = exports._DEFAULT_ACTIVE_CHAINS = exports._BTC_SERVICE_TOKEN = exports._BITCOIN_TESTNET_NAME = exports._BITCOIN_TESTNET_CHAIN_SLUG = exports._BITCOIN_NAME = exports._BITCOIN_CHAIN_SLUG = exports._BALANCE_LOCKED_ID_GROUP = exports._BALANCE_CHAIN_GROUP = exports._API_OPTIONS_CHAIN_GROUP = exports.LATEST_CHAIN_DATA_FETCHING_INTERVAL = exports.EVM_REFORMAT_DECIMALS = exports.EVM_PASS_CONNECT_STATUS = exports.API_CONNECT_TIMEOUT = exports.API_AUTO_CONNECT_MS = void 0;
|
|
6
|
+
exports._ZK_ASSET_PREFIX = exports._TRANSFER_CHAIN_GROUP = exports._SUBSTRATE_DEFAULT_INFLATION_PARAMS = exports._STAKING_ERA_LENGTH_MAP = exports._PURE_EVM_CHAINS = exports._PREDEFINED_SINGLE_MODES = exports._PARACHAIN_INFLATION_DISTRIBUTION = exports._NFT_CHAIN_GROUP = exports._MANTA_ZK_CHAIN_GROUP = exports._KNOWN_CHAIN_INFLATION_PARAMS = exports._GOVERNANCE_CHAIN_GROUP = exports._EXPECTED_BLOCK_TIME = exports._DEFAULT_MANTA_ZK_CHAIN = exports._DEFAULT_ACTIVE_CHAINS = exports._BTC_SERVICE_TOKEN = exports._BITCOIN_TESTNET_NAME = exports._BITCOIN_TESTNET_CHAIN_SLUG = exports._BITCOIN_NAME = exports._BITCOIN_CHAIN_SLUG = exports._BALANCE_LOCKED_ID_GROUP = exports._BALANCE_CHAIN_GROUP = exports._API_OPTIONS_CHAIN_GROUP = exports.LATEST_CHAIN_DATA_FETCHING_INTERVAL = exports.EVM_REFORMAT_DECIMALS = exports.EVM_PASS_CONNECT_STATUS = exports.API_CONNECT_TIMEOUT = exports.API_AUTO_CONNECT_MS = void 0;
|
|
7
7
|
var _chainList = require("@subwallet/chain-list");
|
|
8
8
|
var _KoniTypes = require("@subwallet/extension-base/background/KoniTypes");
|
|
9
9
|
// Copyright 2019-2022 @subwallet/extension-base
|
|
@@ -30,9 +30,18 @@ const _PREDEFINED_SINGLE_MODES = {
|
|
|
30
30
|
};
|
|
31
31
|
exports._PREDEFINED_SINGLE_MODES = _PREDEFINED_SINGLE_MODES;
|
|
32
32
|
const _PURE_EVM_CHAINS = ['binance', 'binance_test', 'ethereum', 'ethereum_goerli', 'astarEvm', 'shidenEvm', 'shibuyaEvm', 'crabEvm', 'pangolinEvm', 'cloverEvm', 'boba_rinkeby', 'boba', 'bobabase', 'bobabeam', 'watr_network_evm'];
|
|
33
|
+
exports._PURE_EVM_CHAINS = _PURE_EVM_CHAINS;
|
|
34
|
+
const _GOVERNANCE_CHAIN_GROUP = {
|
|
35
|
+
polkadot: ['statemint', 'bifrost_dot', 'hydradx_main', 'ajunaPolkadot', 'astar', 'phala', 'litentry', 'acala', 'centrifuge', 'interlay', 'laos_network'],
|
|
36
|
+
kusama: ['statemine', 'bifrost', 'basilisk', 'karura', 'kintsugi'],
|
|
37
|
+
westend_assethub: ['westend_assethub'],
|
|
38
|
+
paseo: ['paseo_assethub'],
|
|
39
|
+
solo: ['vara_network', 'zkverify'],
|
|
40
|
+
testnet: ['zkverify_testnet']
|
|
41
|
+
};
|
|
33
42
|
|
|
34
43
|
// Get balance----------------------------------------------------------------------------------------------------------
|
|
35
|
-
exports.
|
|
44
|
+
exports._GOVERNANCE_CHAIN_GROUP = _GOVERNANCE_CHAIN_GROUP;
|
|
36
45
|
const _BALANCE_CHAIN_GROUP = {
|
|
37
46
|
kintsugi: ['kintsugi', 'interlay', 'kintsugi_test', 'mangatax_para'],
|
|
38
47
|
genshiro: ['genshiro_testnet', 'genshiro'],
|
|
@@ -139,6 +148,8 @@ const _EXPECTED_BLOCK_TIME = {
|
|
|
139
148
|
statemint: 6,
|
|
140
149
|
statemine: 6,
|
|
141
150
|
polkadex: 12,
|
|
151
|
+
westend_assethub: 6,
|
|
152
|
+
paseo_assethub: 6,
|
|
142
153
|
ternoa: 6,
|
|
143
154
|
ternoa_alphanet: 6,
|
|
144
155
|
westend: 6,
|
|
@@ -149,8 +160,8 @@ const _EXPECTED_BLOCK_TIME = {
|
|
|
149
160
|
vara_testnet: 3,
|
|
150
161
|
goldberg_testnet: 20,
|
|
151
162
|
polimec: 12,
|
|
152
|
-
bifrost:
|
|
153
|
-
//
|
|
163
|
+
bifrost: 6,
|
|
164
|
+
// bifrost kusama
|
|
154
165
|
moonbeam: 12,
|
|
155
166
|
moonriver: 12,
|
|
156
167
|
moonbase: 6,
|
|
@@ -515,28 +515,36 @@ function _getChainNativeTokenBasicInfo(chainInfo) {
|
|
|
515
515
|
return defaultTokenInfo;
|
|
516
516
|
}
|
|
517
517
|
if (chainInfo.substrateInfo) {
|
|
518
|
-
// substrate by default
|
|
519
518
|
return {
|
|
519
|
+
...defaultTokenInfo,
|
|
520
520
|
symbol: chainInfo.substrateInfo.symbol,
|
|
521
521
|
decimals: chainInfo.substrateInfo.decimals
|
|
522
522
|
};
|
|
523
|
-
}
|
|
523
|
+
}
|
|
524
|
+
if (chainInfo.evmInfo) {
|
|
524
525
|
return {
|
|
526
|
+
...defaultTokenInfo,
|
|
525
527
|
symbol: chainInfo.evmInfo.symbol,
|
|
526
528
|
decimals: chainInfo.evmInfo.decimals
|
|
527
529
|
};
|
|
528
|
-
}
|
|
530
|
+
}
|
|
531
|
+
if (chainInfo.tonInfo) {
|
|
529
532
|
return {
|
|
533
|
+
...defaultTokenInfo,
|
|
530
534
|
symbol: chainInfo.tonInfo.symbol,
|
|
531
535
|
decimals: chainInfo.tonInfo.decimals
|
|
532
536
|
};
|
|
533
|
-
}
|
|
537
|
+
}
|
|
538
|
+
if (chainInfo.cardanoInfo) {
|
|
534
539
|
return {
|
|
540
|
+
...defaultTokenInfo,
|
|
535
541
|
symbol: chainInfo.cardanoInfo.symbol,
|
|
536
542
|
decimals: chainInfo.cardanoInfo.decimals
|
|
537
543
|
};
|
|
538
|
-
}
|
|
544
|
+
}
|
|
545
|
+
if (chainInfo.bitcoinInfo) {
|
|
539
546
|
return {
|
|
547
|
+
...defaultTokenInfo,
|
|
540
548
|
symbol: chainInfo.bitcoinInfo.symbol,
|
|
541
549
|
decimals: chainInfo.bitcoinInfo.decimals
|
|
542
550
|
};
|
|
@@ -40,6 +40,7 @@ class EventService extends _eventemitter.default {
|
|
|
40
40
|
this.waitBuyServiceReady = this.generateWaitPromise('buy.services.ready');
|
|
41
41
|
this.waitEarningReady = this.generateWaitPromise('earning.ready');
|
|
42
42
|
this.waitLedgerReady = this.generateWaitPromise('ledger.ready');
|
|
43
|
+
this.waitOpenGovReady = this.generateWaitPromise('open-gov.ready');
|
|
43
44
|
}
|
|
44
45
|
generateWaitPromise(eventType) {
|
|
45
46
|
return new Promise(resolve => {
|