@subwallet/extension-base 1.1.61-0 → 1.1.62-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/cjs/constants/staking.js +9 -1
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/chain-service/constants.js +6 -3
- package/cjs/services/chain-service/handler/SubstrateApi.js +3 -5
- package/cjs/services/chain-service/index.js +8 -0
- package/cjs/services/chain-service/utils/index.js +4 -0
- package/cjs/services/chain-service/utils/patch.js +1 -1
- package/cjs/services/earning-service/constants/chains.js +5 -3
- package/cjs/services/earning-service/handlers/native-staking/amplitude.js +91 -51
- package/cjs/services/earning-service/handlers/native-staking/para-chain.js +119 -106
- package/cjs/services/earning-service/handlers/native-staking/relay-chain.js +22 -15
- package/cjs/services/earning-service/handlers/nomination-pool/index.js +11 -6
- package/cjs/services/earning-service/service.js +1 -1
- package/cjs/services/earning-service/utils/index.js +10 -2
- package/cjs/services/price-service/index.js +14 -6
- package/constants/staking.d.ts +1 -0
- package/constants/staking.js +7 -0
- package/package.json +7 -12
- package/packageInfo.js +1 -1
- package/services/chain-service/constants.js +6 -3
- package/services/chain-service/handler/SubstrateApi.js +4 -5
- package/services/chain-service/index.js +8 -0
- package/services/chain-service/utils/index.js +4 -0
- package/services/chain-service/utils/patch.js +1 -1
- package/services/earning-service/constants/chains.d.ts +1 -0
- package/services/earning-service/constants/chains.js +3 -2
- package/services/earning-service/handlers/native-staking/amplitude.d.ts +2 -0
- package/services/earning-service/handlers/native-staking/amplitude.js +91 -51
- package/services/earning-service/handlers/native-staking/para-chain.d.ts +2 -0
- package/services/earning-service/handlers/native-staking/para-chain.js +119 -106
- package/services/earning-service/handlers/native-staking/relay-chain.js +23 -16
- package/services/earning-service/handlers/nomination-pool/index.js +11 -6
- package/services/earning-service/service.js +1 -1
- package/services/earning-service/utils/index.js +10 -2
- package/services/price-service/index.js +14 -6
- package/types/yield/info/chain/info.d.ts +2 -0
- package/types/yield/info/chain/target.d.ts +1 -0
- package/types/yield/info/pallet.d.ts +6 -0
- package/utils/staticData/currencySymbol.json +9 -9
- package/cjs/services/chain-service/handler/chain-spec/goldberg.js +0 -190
- package/services/chain-service/handler/chain-spec/goldberg.d.ts +0 -184
- package/services/chain-service/handler/chain-spec/goldberg.js +0 -183
|
@@ -7,6 +7,8 @@ export default class ParaNativeStakingPoolHandler extends BaseParaNativeStakingP
|
|
|
7
7
|
subscribePoolInfo(callback: (data: YieldPoolInfo) => void): Promise<VoidFunction>;
|
|
8
8
|
parseNominatorMetadata(chainInfo: _ChainInfo, address: string, substrateApi: _SubstrateApi, delegatorState: PalletParachainStakingDelegator): Promise<Omit<YieldPositionInfo, keyof BaseYieldPositionInfo>>;
|
|
9
9
|
subscribePoolPosition(useAddresses: string[], resultCallback: (rs: YieldPositionInfo) => void): Promise<VoidFunction>;
|
|
10
|
+
getMantaPoolTargets(): Promise<ValidatorInfo[]>;
|
|
11
|
+
getParachainPoolTargets(): Promise<ValidatorInfo[]>;
|
|
10
12
|
getPoolTargets(): Promise<ValidatorInfo[]>;
|
|
11
13
|
createJoinExtrinsic(data: SubmitJoinNativeStaking, positionInfo?: YieldPositionInfo): Promise<[TransactionData, YieldTokenBaseInfo]>;
|
|
12
14
|
handleYieldUnstake(amount: string, address: string, selectedTarget?: string): Promise<[ExtrinsicType, TransactionData]>;
|
|
@@ -54,7 +54,7 @@ export default class ParaNativeStakingPoolHandler extends BaseParaNativeStakingP
|
|
|
54
54
|
await defaultCallback();
|
|
55
55
|
await chainApi.isReady;
|
|
56
56
|
const unsub = await chainApi.api.query.parachainStaking.round(async _round => {
|
|
57
|
-
var _chainApi$api$consts, _chainApi$api$consts$, _chainApi$api$consts$2;
|
|
57
|
+
var _chainApi$api$consts, _chainApi$api$consts$, _chainApi$api$consts$2, _chainApi$api$consts$3, _chainApi$api$consts$4, _chainApi$api$query$p, _chainApi$api$query$p2;
|
|
58
58
|
if (cancel) {
|
|
59
59
|
unsub();
|
|
60
60
|
return;
|
|
@@ -63,11 +63,14 @@ export default class ParaNativeStakingPoolHandler extends BaseParaNativeStakingP
|
|
|
63
63
|
const round = parseRawNumber(roundObj.current);
|
|
64
64
|
const maxDelegations = (_chainApi$api$consts = chainApi.api.consts) === null || _chainApi$api$consts === void 0 ? void 0 : (_chainApi$api$consts$ = _chainApi$api$consts.parachainStaking) === null || _chainApi$api$consts$ === void 0 ? void 0 : (_chainApi$api$consts$2 = _chainApi$api$consts$.maxDelegationsPerDelegator) === null || _chainApi$api$consts$2 === void 0 ? void 0 : _chainApi$api$consts$2.toString();
|
|
65
65
|
const unstakingDelay = chainApi.api.consts.parachainStaking.delegationBondLessDelay.toString();
|
|
66
|
+
const maxTopDelegatorsPerCollator = (_chainApi$api$consts$3 = chainApi.api.consts.parachainStaking.maxTopDelegationsPerCandidate) === null || _chainApi$api$consts$3 === void 0 ? void 0 : _chainApi$api$consts$3.toPrimitive();
|
|
67
|
+
const maxDelegatorsPerCollator = (_chainApi$api$consts$4 = chainApi.api.consts.parachainStaking.maxDelegatorsPerCollator) === null || _chainApi$api$consts$4 === void 0 ? void 0 : _chainApi$api$consts$4.toPrimitive();
|
|
68
|
+
const maxPoolMembers = maxTopDelegatorsPerCollator || maxDelegatorsPerCollator || undefined;
|
|
66
69
|
let _unvestedAllocation;
|
|
67
70
|
if (chainApi.api.query.vesting && chainApi.api.query.vesting.totalUnvestedAllocation) {
|
|
68
71
|
_unvestedAllocation = await chainApi.api.query.vesting.totalUnvestedAllocation();
|
|
69
72
|
}
|
|
70
|
-
const [_totalStake, _totalIssuance, _inflation] = await Promise.all([chainApi.api.query.parachainStaking.staked(round), chainApi.api.query.balances.totalIssuance(), chainApi.api.query.parachainStaking.inflationConfig()]);
|
|
73
|
+
const [_totalStake, _totalIssuance, _inflation] = await Promise.all([(_chainApi$api$query$p = chainApi.api.query.parachainStaking) !== null && _chainApi$api$query$p !== void 0 && _chainApi$api$query$p.staked ? (_chainApi$api$query$p2 = chainApi.api.query.parachainStaking) === null || _chainApi$api$query$p2 === void 0 ? void 0 : _chainApi$api$query$p2.staked(round) : chainApi.api.query.parachainStaking.total(), chainApi.api.query.balances.totalIssuance(), chainApi.api.query.parachainStaking.inflationConfig()]);
|
|
71
74
|
let unvestedAllocation;
|
|
72
75
|
if (_unvestedAllocation) {
|
|
73
76
|
const rawUnvestedAllocation = _unvestedAllocation.toString();
|
|
@@ -113,7 +116,8 @@ export default class ParaNativeStakingPoolHandler extends BaseParaNativeStakingP
|
|
|
113
116
|
tvl: totalStake.toString(),
|
|
114
117
|
unstakingPeriod: unstakingPeriod,
|
|
115
118
|
inflation
|
|
116
|
-
}
|
|
119
|
+
},
|
|
120
|
+
maxPoolMembers
|
|
117
121
|
};
|
|
118
122
|
callback(data);
|
|
119
123
|
});
|
|
@@ -266,102 +270,44 @@ export default class ParaNativeStakingPoolHandler extends BaseParaNativeStakingP
|
|
|
266
270
|
/* Subscribe pool position */
|
|
267
271
|
|
|
268
272
|
/* Get pool targets */
|
|
269
|
-
|
|
270
|
-
|
|
273
|
+
async getMantaPoolTargets() {
|
|
274
|
+
var _this$chainInfo$subst;
|
|
271
275
|
const apiProps = await this.substrateApi.isReady;
|
|
272
276
|
const allCollators = [];
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
const DECIMAL = (_this$chainInfo$subst = this.chainInfo.substrateInfo) === null || _this$chainInfo$subst === void 0 ? void 0 : _this$chainInfo$subst.decimals;
|
|
276
|
-
const POINTS_PER_BLOCK = MANTA_VALIDATOR_POINTS_PER_BLOCK; // producing 1 block will get 20 points for validator
|
|
277
|
+
const DECIMAL = (_this$chainInfo$subst = this.chainInfo.substrateInfo) === null || _this$chainInfo$subst === void 0 ? void 0 : _this$chainInfo$subst.decimals;
|
|
278
|
+
const POINTS_PER_BLOCK = MANTA_VALIDATOR_POINTS_PER_BLOCK; // producing 1 block will get 20 points for validator
|
|
277
279
|
|
|
278
|
-
|
|
280
|
+
const [_allCollators, _collatorCommission, _allCollatorsPool, _selectedCollators, _round, _totalIssuance, _inflationConfig] = await Promise.all([apiProps.api.query.parachainStaking.candidateInfo.entries(), apiProps.api.query.parachainStaking.collatorCommission(), apiProps.api.query.parachainStaking.candidatePool(), apiProps.api.query.parachainStaking.selectedCandidates(), apiProps.api.query.parachainStaking.round(), apiProps.api.query.balances.totalIssuance(), apiProps.api.query.parachainStaking.inflationConfig()]);
|
|
279
281
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
282
|
+
// noted: Annual Inflation = Total Issuance * Annual Inflation Percent
|
|
283
|
+
const round = _round.toPrimitive();
|
|
284
|
+
const totalIssuance = _totalIssuance.toString();
|
|
285
|
+
const inflationConfig = _inflationConfig.toHuman();
|
|
286
|
+
const annualInflationPercent = parseFloat(inflationConfig.annual.ideal.slice(0, -1)) / 100;
|
|
287
|
+
const bnAnnualInflation = new BigN(totalIssuance).multipliedBy(annualInflationPercent);
|
|
286
288
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const collatorInfo = collator[1].toPrimitive();
|
|
302
|
-
const bnTotalStake = new BN(collatorInfo.totalCounted);
|
|
303
|
-
const bnOwnStake = new BN(collatorInfo.bond);
|
|
304
|
-
const bnOtherStake = bnTotalStake.sub(bnOwnStake);
|
|
305
|
-
const bnMinBond = new BN(collatorInfo.lowestTopDelegationAmount);
|
|
306
|
-
allCollators.push({
|
|
307
|
-
commission: 0,
|
|
308
|
-
address: collatorAddress,
|
|
309
|
-
totalStake: bnTotalStake.toString(),
|
|
310
|
-
ownStake: bnOwnStake.toString(),
|
|
311
|
-
otherStake: bnOtherStake.toString(),
|
|
312
|
-
nominatorCount: collatorInfo.delegationCount,
|
|
313
|
-
blocked: false,
|
|
314
|
-
isVerified: false,
|
|
315
|
-
minBond: bnMinBond.toString(),
|
|
316
|
-
chain: this.chain,
|
|
317
|
-
isCrowded: parseInt(maxDelegationPerCollator) > 0
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
await Promise.all(allCollators.map(async collator => {
|
|
322
|
-
if (allCollatorsPool.includes(collator.address)) {
|
|
323
|
-
// noted: number of blocks = total points / points per block
|
|
324
|
-
const _collatorPoints = await apiProps.api.query.parachainStaking.awardedPts(parseInt(round.current) - 1, collator.address);
|
|
325
|
-
const collatorPoints = _collatorPoints.toPrimitive();
|
|
326
|
-
const blocksPreviousRound = collatorPoints / POINTS_PER_BLOCK;
|
|
327
|
-
collator.expectedReturn = calculateMantaNominatorReturn(DECIMAL, collatorCommissionPercent, totalActiveCollators, bnAnnualInflation, blocksPreviousRound, bnCollatorExpectedBlocksPerRound, new BigN(collator.totalStake), false);
|
|
328
|
-
}
|
|
329
|
-
}));
|
|
330
|
-
const extraInfoMap = {};
|
|
331
|
-
await Promise.all(allCollators.map(async collator => {
|
|
332
|
-
const [_info, [identity, isReasonable]] = await Promise.all([apiProps.api.query.parachainStaking.candidateInfo(collator.address), parseIdentity(apiProps, collator.address)]);
|
|
333
|
-
const rawInfo = _info.toHuman();
|
|
334
|
-
const active = (rawInfo === null || rawInfo === void 0 ? void 0 : rawInfo.status) === 'Active';
|
|
335
|
-
extraInfoMap[collator.address] = {
|
|
336
|
-
identity,
|
|
337
|
-
isVerified: isReasonable,
|
|
338
|
-
active
|
|
339
|
-
};
|
|
340
|
-
}));
|
|
341
|
-
for (const validator of allCollators) {
|
|
342
|
-
validator.blocked = !extraInfoMap[validator.address].active;
|
|
343
|
-
validator.identity = extraInfoMap[validator.address].identity;
|
|
344
|
-
validator.isVerified = extraInfoMap[validator.address].isVerified;
|
|
345
|
-
// @ts-ignore
|
|
346
|
-
validator.commission = collatorCommission;
|
|
347
|
-
}
|
|
348
|
-
return allCollators;
|
|
349
|
-
} else {
|
|
350
|
-
const [_allCollators, _collatorCommission] = await Promise.all([apiProps.api.query.parachainStaking.candidateInfo.entries(), apiProps.api.query.parachainStaking.collatorCommission()]);
|
|
351
|
-
const maxDelegationPerCollator = apiProps.api.consts.parachainStaking.maxTopDelegationsPerCandidate.toString();
|
|
352
|
-
const rawCollatorCommission = _collatorCommission.toHuman();
|
|
353
|
-
const collatorCommission = parseFloat(rawCollatorCommission.split('%')[0]);
|
|
354
|
-
for (const collator of _allCollators) {
|
|
355
|
-
const _collatorAddress = collator[0].toHuman();
|
|
356
|
-
const collatorAddress = _collatorAddress[0];
|
|
289
|
+
// noted: allCollatorsPool -> all candidate collators; selectedCollators -> candidate collators selected in current round
|
|
290
|
+
const allCollatorsPoolInfo = _allCollatorsPool.toPrimitive();
|
|
291
|
+
const allCollatorsPool = allCollatorsPoolInfo.map(collator => collator.owner.toString());
|
|
292
|
+
const selectedCollators = _selectedCollators.toPrimitive();
|
|
293
|
+
const totalActiveCollators = selectedCollators.length;
|
|
294
|
+
const bnCollatorExpectedBlocksPerRound = new BigN(round.length).dividedBy(allCollatorsPool.length);
|
|
295
|
+
const maxDelegationPerCollator = apiProps.api.consts.parachainStaking.maxTopDelegationsPerCandidate.toString();
|
|
296
|
+
const rawCollatorCommission = _collatorCommission.toHuman();
|
|
297
|
+
const collatorCommission = parseFloat(rawCollatorCommission.split('%')[0]);
|
|
298
|
+
const collatorCommissionPercent = collatorCommission / 100;
|
|
299
|
+
for (const collator of _allCollators) {
|
|
300
|
+
const _collatorAddress = collator[0].toHuman();
|
|
301
|
+
const collatorAddress = _collatorAddress[0];
|
|
302
|
+
if (allCollatorsPool.includes(collatorAddress)) {
|
|
357
303
|
const collatorInfo = collator[1].toPrimitive();
|
|
358
304
|
const bnTotalStake = new BN(collatorInfo.totalCounted);
|
|
359
305
|
const bnOwnStake = new BN(collatorInfo.bond);
|
|
360
306
|
const bnOtherStake = bnTotalStake.sub(bnOwnStake);
|
|
361
307
|
const bnMinBond = new BN(collatorInfo.lowestTopDelegationAmount);
|
|
308
|
+
const maxNominatorRewarded = parseInt(maxDelegationPerCollator);
|
|
362
309
|
allCollators.push({
|
|
363
310
|
commission: 0,
|
|
364
|
-
expectedReturn: 0,
|
|
365
311
|
address: collatorAddress,
|
|
366
312
|
totalStake: bnTotalStake.toString(),
|
|
367
313
|
ownStake: bnOwnStake.toString(),
|
|
@@ -371,28 +317,95 @@ export default class ParaNativeStakingPoolHandler extends BaseParaNativeStakingP
|
|
|
371
317
|
isVerified: false,
|
|
372
318
|
minBond: bnMinBond.toString(),
|
|
373
319
|
chain: this.chain,
|
|
374
|
-
isCrowded:
|
|
320
|
+
isCrowded: collatorInfo.delegationCount ? collatorInfo.delegationCount >= maxNominatorRewarded : false
|
|
375
321
|
});
|
|
376
322
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
active
|
|
386
|
-
};
|
|
387
|
-
}));
|
|
388
|
-
for (const validator of allCollators) {
|
|
389
|
-
validator.blocked = !extraInfoMap[validator.address].active;
|
|
390
|
-
validator.identity = extraInfoMap[validator.address].identity;
|
|
391
|
-
validator.isVerified = extraInfoMap[validator.address].isVerified;
|
|
392
|
-
// @ts-ignore
|
|
393
|
-
validator.commission = collatorCommission;
|
|
323
|
+
}
|
|
324
|
+
await Promise.all(allCollators.map(async collator => {
|
|
325
|
+
if (allCollatorsPool.includes(collator.address)) {
|
|
326
|
+
// noted: number of blocks = total points / points per block
|
|
327
|
+
const _collatorPoints = await apiProps.api.query.parachainStaking.awardedPts(parseInt(round.current) - 1, collator.address);
|
|
328
|
+
const collatorPoints = _collatorPoints.toPrimitive();
|
|
329
|
+
const blocksPreviousRound = collatorPoints / POINTS_PER_BLOCK;
|
|
330
|
+
collator.expectedReturn = calculateMantaNominatorReturn(DECIMAL, collatorCommissionPercent, totalActiveCollators, bnAnnualInflation, blocksPreviousRound, bnCollatorExpectedBlocksPerRound, new BigN(collator.totalStake), false);
|
|
394
331
|
}
|
|
395
|
-
|
|
332
|
+
}));
|
|
333
|
+
const extraInfoMap = {};
|
|
334
|
+
await Promise.all(allCollators.map(async collator => {
|
|
335
|
+
const [_info, [identity, isReasonable]] = await Promise.all([apiProps.api.query.parachainStaking.candidateInfo(collator.address), parseIdentity(apiProps, collator.address)]);
|
|
336
|
+
const rawInfo = _info.toHuman();
|
|
337
|
+
const active = (rawInfo === null || rawInfo === void 0 ? void 0 : rawInfo.status) === 'Active';
|
|
338
|
+
extraInfoMap[collator.address] = {
|
|
339
|
+
identity,
|
|
340
|
+
isVerified: isReasonable,
|
|
341
|
+
active
|
|
342
|
+
};
|
|
343
|
+
}));
|
|
344
|
+
for (const validator of allCollators) {
|
|
345
|
+
validator.blocked = !extraInfoMap[validator.address].active;
|
|
346
|
+
validator.identity = extraInfoMap[validator.address].identity;
|
|
347
|
+
validator.isVerified = extraInfoMap[validator.address].isVerified;
|
|
348
|
+
// @ts-ignore
|
|
349
|
+
validator.commission = collatorCommission;
|
|
350
|
+
}
|
|
351
|
+
return allCollators;
|
|
352
|
+
}
|
|
353
|
+
async getParachainPoolTargets() {
|
|
354
|
+
const apiProps = await this.substrateApi.isReady;
|
|
355
|
+
const allCollators = [];
|
|
356
|
+
const [_allCollators, _collatorCommission] = await Promise.all([apiProps.api.query.parachainStaking.candidateInfo.entries(), apiProps.api.query.parachainStaking.collatorCommission()]);
|
|
357
|
+
const maxDelegationPerCollator = apiProps.api.consts.parachainStaking.maxTopDelegationsPerCandidate.toString();
|
|
358
|
+
const rawCollatorCommission = _collatorCommission.toHuman();
|
|
359
|
+
const collatorCommission = parseFloat(rawCollatorCommission.split('%')[0]);
|
|
360
|
+
for (const collator of _allCollators) {
|
|
361
|
+
const _collatorAddress = collator[0].toHuman();
|
|
362
|
+
const collatorAddress = _collatorAddress[0];
|
|
363
|
+
const collatorInfo = collator[1].toPrimitive();
|
|
364
|
+
const bnTotalStake = new BN(collatorInfo.totalCounted);
|
|
365
|
+
const bnOwnStake = new BN(collatorInfo.bond);
|
|
366
|
+
const bnOtherStake = bnTotalStake.sub(bnOwnStake);
|
|
367
|
+
const bnMinBond = new BN(collatorInfo.lowestTopDelegationAmount);
|
|
368
|
+
const maxNominatorRewarded = parseInt(maxDelegationPerCollator);
|
|
369
|
+
allCollators.push({
|
|
370
|
+
commission: 0,
|
|
371
|
+
expectedReturn: 0,
|
|
372
|
+
address: collatorAddress,
|
|
373
|
+
totalStake: bnTotalStake.toString(),
|
|
374
|
+
ownStake: bnOwnStake.toString(),
|
|
375
|
+
otherStake: bnOtherStake.toString(),
|
|
376
|
+
nominatorCount: collatorInfo.delegationCount,
|
|
377
|
+
blocked: false,
|
|
378
|
+
isVerified: false,
|
|
379
|
+
minBond: bnMinBond.toString(),
|
|
380
|
+
chain: this.chain,
|
|
381
|
+
isCrowded: collatorInfo.delegationCount ? collatorInfo.delegationCount >= maxNominatorRewarded : false
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
const extraInfoMap = {};
|
|
385
|
+
await Promise.all(allCollators.map(async collator => {
|
|
386
|
+
const [_info, [identity, isReasonable]] = await Promise.all([apiProps.api.query.parachainStaking.candidateInfo(collator.address), parseIdentity(apiProps, collator.address)]);
|
|
387
|
+
const rawInfo = _info.toHuman();
|
|
388
|
+
const active = (rawInfo === null || rawInfo === void 0 ? void 0 : rawInfo.status) === 'Active';
|
|
389
|
+
extraInfoMap[collator.address] = {
|
|
390
|
+
identity,
|
|
391
|
+
isVerified: isReasonable,
|
|
392
|
+
active
|
|
393
|
+
};
|
|
394
|
+
}));
|
|
395
|
+
for (const validator of allCollators) {
|
|
396
|
+
validator.blocked = !extraInfoMap[validator.address].active;
|
|
397
|
+
validator.identity = extraInfoMap[validator.address].identity;
|
|
398
|
+
validator.isVerified = extraInfoMap[validator.address].isVerified;
|
|
399
|
+
// @ts-ignore
|
|
400
|
+
validator.commission = collatorCommission;
|
|
401
|
+
}
|
|
402
|
+
return allCollators;
|
|
403
|
+
}
|
|
404
|
+
async getPoolTargets() {
|
|
405
|
+
if (_STAKING_CHAIN_GROUP.manta.includes(this.chain)) {
|
|
406
|
+
return this.getMantaPoolTargets();
|
|
407
|
+
} else {
|
|
408
|
+
return this.getParachainPoolTargets();
|
|
396
409
|
}
|
|
397
410
|
}
|
|
398
411
|
|
|
@@ -6,7 +6,7 @@ import { BasicTxErrorType, ExtrinsicType, StakingTxErrorType } from '@subwallet/
|
|
|
6
6
|
import { calculateAlephZeroValidatorReturn, calculateChainStakedReturnV2, calculateInflation, calculateTernoaValidatorReturn, calculateValidatorStakedReturn, getAvgValidatorEraReward, getCommission, getMaxValidatorErrorMessage, getMinStakeErrorMessage, getSupportedDaysByHistoryDepth, getTopValidatorByPoints, getValidatorPointsMap } from '@subwallet/extension-base/koni/api/staking/bonding/utils';
|
|
7
7
|
import { _STAKING_ERA_LENGTH_MAP } from '@subwallet/extension-base/services/chain-service/constants';
|
|
8
8
|
import { _getChainSubstrateAddressPrefix } from '@subwallet/extension-base/services/chain-service/utils';
|
|
9
|
-
import { _STAKING_CHAIN_GROUP, MaxEraRewardPointsEras } from '@subwallet/extension-base/services/earning-service/constants';
|
|
9
|
+
import { _STAKING_CHAIN_GROUP, _UPDATED_RUNTIME_STAKING_GROUP, MaxEraRewardPointsEras } from '@subwallet/extension-base/services/earning-service/constants';
|
|
10
10
|
import { parseIdentity } from '@subwallet/extension-base/services/earning-service/utils';
|
|
11
11
|
import { EarningStatus, UnstakingStatus } from '@subwallet/extension-base/types';
|
|
12
12
|
import { balanceFormatter, formatNumber, reformatAddress } from '@subwallet/extension-base/utils';
|
|
@@ -44,20 +44,22 @@ export default class RelayNativeStakingPoolHandler extends BaseNativeStakingPool
|
|
|
44
44
|
await defaultCallback();
|
|
45
45
|
await substrateApi.isReady;
|
|
46
46
|
const unsub = await ((_substrateApi$api$que = substrateApi.api.query.staking) === null || _substrateApi$api$que === void 0 ? void 0 : _substrateApi$api$que.currentEra(async _currentEra => {
|
|
47
|
-
var _substrateApi$api$con, _substrateApi$api$con2, _substrateApi$api$cal, _substrateApi$api$que2, _substrateApi$api$que3, _substrateApi$api$que4, _substrateApi$api$que5, _substrateApi$api$que6;
|
|
47
|
+
var _substrateApi$api$con, _substrateApi$api$con2, _substrateApi$api$con3, _substrateApi$api$cal, _substrateApi$api$que2, _substrateApi$api$que3, _substrateApi$api$que4, _substrateApi$api$que5, _substrateApi$api$que6;
|
|
48
48
|
if (cancel) {
|
|
49
49
|
unsub();
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
let maxNominations = ((_substrateApi$api$con = substrateApi.api.consts.staking) === null || _substrateApi$api$con === void 0 ? void 0 : (_substrateApi$api$con2 = _substrateApi$api$con.maxNominations) === null || _substrateApi$api$con2 === void 0 ? void 0 : _substrateApi$api$con2.toString()) || '16';
|
|
53
|
+
const unlimitedNominatorRewarded = substrateApi.api.consts.staking.maxExposurePageSize !== undefined;
|
|
54
|
+
const maxNominatorRewarded = (_substrateApi$api$con3 = substrateApi.api.consts.staking.maxNominatorRewardedPerValidator) === null || _substrateApi$api$con3 === void 0 ? void 0 : _substrateApi$api$con3.toString();
|
|
53
55
|
const _maxNominationsByNominationQuota = await ((_substrateApi$api$cal = substrateApi.api.call.stakingApi) === null || _substrateApi$api$cal === void 0 ? void 0 : _substrateApi$api$cal.nominationsQuota(0)); // todo: review param. Currently return constant for all param.
|
|
54
56
|
const maxNominationsByNominationQuota = _maxNominationsByNominationQuota === null || _maxNominationsByNominationQuota === void 0 ? void 0 : _maxNominationsByNominationQuota.toString();
|
|
55
57
|
maxNominations = maxNominationsByNominationQuota !== null && maxNominationsByNominationQuota !== void 0 ? maxNominationsByNominationQuota : maxNominations;
|
|
56
58
|
const currentEra = _currentEra.toString();
|
|
57
59
|
const maxUnlockingChunks = substrateApi.api.consts.staking.maxUnlockingChunks.toString();
|
|
58
60
|
const unlockingEras = substrateApi.api.consts.staking.bondingDuration.toString();
|
|
59
|
-
const maxSupportedEras = substrateApi.api.consts.staking.historyDepth.toString();
|
|
60
|
-
const erasPerDay = 24 / _STAKING_ERA_LENGTH_MAP[chainInfo.slug]; // Can be exactly calculate from babe.epochDuration * blockTime * staking.sessionsPerEra
|
|
61
|
+
const maxSupportedEras = substrateApi.api.consts.staking.historyDepth.toString(); // todo: handle case historyDepth undefined
|
|
62
|
+
const erasPerDay = 24 / _STAKING_ERA_LENGTH_MAP[chainInfo.slug] || _STAKING_ERA_LENGTH_MAP.default; // Can be exactly calculate from babe.epochDuration * blockTime * staking.sessionsPerEra
|
|
61
63
|
|
|
62
64
|
const supportedDays = getSupportedDaysByHistoryDepth(erasPerDay, parseInt(maxSupportedEras), parseInt(currentEra) / erasPerDay);
|
|
63
65
|
const startEra = parseInt(currentEra) - supportedDays * erasPerDay;
|
|
@@ -110,7 +112,8 @@ export default class RelayNativeStakingPoolHandler extends BaseNativeStakingPool
|
|
|
110
112
|
// TODO recheck
|
|
111
113
|
unstakingPeriod: unlockingPeriod,
|
|
112
114
|
inflation: inflation
|
|
113
|
-
}
|
|
115
|
+
},
|
|
116
|
+
maxPoolMembers: unlimitedNominatorRewarded ? undefined : maxNominatorRewarded ? parseInt(maxNominatorRewarded) : undefined
|
|
114
117
|
};
|
|
115
118
|
callback(data);
|
|
116
119
|
}));
|
|
@@ -144,7 +147,7 @@ export default class RelayNativeStakingPoolHandler extends BaseNativeStakingPool
|
|
|
144
147
|
let nominationStatus = EarningStatus.NOT_EARNING;
|
|
145
148
|
let eraStakerOtherList = [];
|
|
146
149
|
let identity;
|
|
147
|
-
if (
|
|
150
|
+
if (_UPDATED_RUNTIME_STAKING_GROUP.includes(this.chain)) {
|
|
148
151
|
// todo: review all relaychains later
|
|
149
152
|
const [[_identity], _eraStaker] = await Promise.all([parseIdentity(substrateApi, validatorAddress), substrateApi.api.query.staking.erasStakersPaged.entries(currentEra, validatorAddress)]);
|
|
150
153
|
identity = _identity;
|
|
@@ -296,9 +299,9 @@ export default class RelayNativeStakingPoolHandler extends BaseNativeStakingPool
|
|
|
296
299
|
const validatorInfoList = [];
|
|
297
300
|
const maxEraRewardPointsEras = MaxEraRewardPointsEras;
|
|
298
301
|
const endEraForPoints = parseInt(activeEra) - 1;
|
|
299
|
-
let startEraForPoints = endEraForPoints - maxEraRewardPointsEras + 1;
|
|
302
|
+
let startEraForPoints = Math.max(endEraForPoints - maxEraRewardPointsEras + 1, 0);
|
|
300
303
|
let _eraStakersPromise;
|
|
301
|
-
if (
|
|
304
|
+
if (_UPDATED_RUNTIME_STAKING_GROUP.includes(this.chain)) {
|
|
302
305
|
// todo: review all relaychains later
|
|
303
306
|
_eraStakersPromise = chainApi.api.query.staking.erasStakersOverview.entries(parseInt(currentEra));
|
|
304
307
|
} else {
|
|
@@ -339,7 +342,7 @@ export default class RelayNativeStakingPoolHandler extends BaseNativeStakingPool
|
|
|
339
342
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
|
340
343
|
const rawValidatorInfo = item[0].toHuman();
|
|
341
344
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
|
342
|
-
const rawValidatorStat = item[1].
|
|
345
|
+
const rawValidatorStat = item[1].toPrimitive();
|
|
343
346
|
const validatorAddress = rawValidatorInfo[1];
|
|
344
347
|
if (!blockValidatorList.includes(validatorAddress)) {
|
|
345
348
|
var _validatorPointsMap$v;
|
|
@@ -347,16 +350,20 @@ export default class RelayNativeStakingPoolHandler extends BaseNativeStakingPool
|
|
|
347
350
|
if (topValidatorList.includes(validatorAddress)) {
|
|
348
351
|
isTopQuartile = true;
|
|
349
352
|
}
|
|
350
|
-
const
|
|
351
|
-
const
|
|
352
|
-
const bnTotalStake = new BN(rawTotalStake.replaceAll(',', ''));
|
|
353
|
-
const bnOwnStake = new BN(rawOwnStake.replaceAll(',', ''));
|
|
353
|
+
const bnTotalStake = new BN(rawValidatorStat.total);
|
|
354
|
+
const bnOwnStake = new BN(rawValidatorStat.own);
|
|
354
355
|
const otherStake = bnTotalStake.sub(bnOwnStake);
|
|
355
356
|
totalStakeMap[validatorAddress] = bnTotalStake;
|
|
356
357
|
let nominatorCount = 0;
|
|
357
|
-
if (
|
|
358
|
-
|
|
359
|
-
|
|
358
|
+
if (_UPDATED_RUNTIME_STAKING_GROUP.includes(this.chain)) {
|
|
359
|
+
nominatorCount = rawValidatorStat.nominatorCount;
|
|
360
|
+
} else {
|
|
361
|
+
if ('others' in rawValidatorStat) {
|
|
362
|
+
// todo: handle interfaces and types better
|
|
363
|
+
// @ts-ignore
|
|
364
|
+
const others = rawValidatorStat.others;
|
|
365
|
+
nominatorCount = others.length;
|
|
366
|
+
}
|
|
360
367
|
}
|
|
361
368
|
allValidators.push(validatorAddress);
|
|
362
369
|
validatorInfoList.push({
|
|
@@ -6,6 +6,7 @@ import { APIItemState, BasicTxErrorType, ChainType, ExtrinsicType, StakingTxErro
|
|
|
6
6
|
import { calculateChainStakedReturnV2, calculateInflation, getAvgValidatorEraReward, getExistUnstakeErrorMessage, getMinStakeErrorMessage, getSupportedDaysByHistoryDepth, parsePoolStashAddress } from '@subwallet/extension-base/koni/api/staking/bonding/utils';
|
|
7
7
|
import { _STAKING_ERA_LENGTH_MAP } from '@subwallet/extension-base/services/chain-service/constants';
|
|
8
8
|
import { _getChainSubstrateAddressPrefix } from '@subwallet/extension-base/services/chain-service/utils';
|
|
9
|
+
import { _UPDATED_RUNTIME_STAKING_GROUP } from '@subwallet/extension-base/services/earning-service/constants';
|
|
9
10
|
import { EarningStatus, UnstakingStatus, YieldPoolType, YieldStepType } from '@subwallet/extension-base/types';
|
|
10
11
|
import { balanceFormatter, formatNumber, reformatAddress } from '@subwallet/extension-base/utils';
|
|
11
12
|
import BigN from 'bignumber.js';
|
|
@@ -83,7 +84,8 @@ export default class NominationPoolHandler extends BasePoolHandler {
|
|
|
83
84
|
|
|
84
85
|
const supportedDays = getSupportedDaysByHistoryDepth(erasPerDay, parseInt(maxSupportedEras), parseInt(currentEra) / erasPerDay);
|
|
85
86
|
const startEra = parseInt(currentEra) - supportedDays * erasPerDay;
|
|
86
|
-
const [_EraStakeInfo, _totalIssuance, _auctionCounter, _minPoolJoin, ..._eraReward] = await Promise.all([substrateApi.api.query.staking.erasTotalStake.multi([parseInt(currentEra), parseInt(currentEra) - 1]), substrateApi.api.query.balances.totalIssuance(), (_substrateApi$api$
|
|
87
|
+
const [_maxPoolMember, _EraStakeInfo, _totalIssuance, _auctionCounter, _minPoolJoin, ..._eraReward] = await Promise.all([(_substrateApi$api$que2 = substrateApi.api.query.nominationPools) === null || _substrateApi$api$que2 === void 0 ? void 0 : _substrateApi$api$que2.maxPoolMembersPerPool(), substrateApi.api.query.staking.erasTotalStake.multi([parseInt(currentEra), parseInt(currentEra) - 1]), substrateApi.api.query.balances.totalIssuance(), (_substrateApi$api$que3 = substrateApi.api.query.auctions) === null || _substrateApi$api$que3 === void 0 ? void 0 : _substrateApi$api$que3.auctionCounter(), (_substrateApi$api$que4 = substrateApi.api.query.nominationPools) === null || _substrateApi$api$que4 === void 0 ? void 0 : _substrateApi$api$que4.minJoinBond(), substrateApi.api.query.staking.erasValidatorReward.multi([...Array(supportedDays).keys()].map(i => i + startEra))]);
|
|
88
|
+
const maxPoolMembers = _maxPoolMember ? parseInt(_maxPoolMember.toString()) : undefined;
|
|
87
89
|
const [_totalEraStake, _lastTotalStaked] = _EraStakeInfo;
|
|
88
90
|
const validatorEraReward = getAvgValidatorEraReward(supportedDays, _eraReward[0]);
|
|
89
91
|
const lastTotalStaked = _lastTotalStaked.toString();
|
|
@@ -129,7 +131,8 @@ export default class NominationPoolHandler extends BasePoolHandler {
|
|
|
129
131
|
// TODO recheck
|
|
130
132
|
unstakingPeriod: unlockingPeriod,
|
|
131
133
|
inflation: inflation
|
|
132
|
-
}
|
|
134
|
+
},
|
|
135
|
+
maxPoolMembers: maxPoolMembers || undefined
|
|
133
136
|
};
|
|
134
137
|
callback(data);
|
|
135
138
|
}));
|
|
@@ -159,7 +162,7 @@ export default class NominationPoolHandler extends BasePoolHandler {
|
|
|
159
162
|
const validatorList = nominations.targets;
|
|
160
163
|
await Promise.all(validatorList.map(async validatorAddress => {
|
|
161
164
|
let eraStakerOtherList = [];
|
|
162
|
-
if (
|
|
165
|
+
if (_UPDATED_RUNTIME_STAKING_GROUP.includes(this.chain)) {
|
|
163
166
|
// todo: review all relaychains later
|
|
164
167
|
const _eraStaker = await substrateApi.api.query.staking.erasStakersPaged.entries(currentEra, validatorAddress);
|
|
165
168
|
eraStakerOtherList = _eraStaker.flatMap(paged => paged[1].toPrimitive().others);
|
|
@@ -318,13 +321,13 @@ export default class NominationPoolHandler extends BasePoolHandler {
|
|
|
318
321
|
const nominationPools = [];
|
|
319
322
|
const _allPoolsInfo = await substrateApi.api.query.nominationPools.reversePoolIdLookup.entries();
|
|
320
323
|
await Promise.all(_allPoolsInfo.map(async _poolInfo => {
|
|
321
|
-
var _bondedPool$points;
|
|
324
|
+
var _substrateApi$api$que7, _bondedPool$points;
|
|
322
325
|
const poolAddressList = _poolInfo[0].toHuman();
|
|
323
326
|
const poolAddress = poolAddressList[0];
|
|
324
327
|
const poolId = _poolInfo[1].toPrimitive();
|
|
325
328
|
const poolsPalletId = substrateApi.api.consts.nominationPools.palletId.toString();
|
|
326
329
|
const poolStashAccount = parsePoolStashAddress(substrateApi.api, 0, poolId, poolsPalletId);
|
|
327
|
-
const [_nominations, _bondedPool, _metadata, _minimumActiveStake] = await Promise.all([substrateApi.api.query.staking.nominators(poolStashAccount), substrateApi.api.query.nominationPools.bondedPools(poolId), substrateApi.api.query.nominationPools.metadata(poolId), substrateApi.api.query.staking.minimumActiveStake()]);
|
|
330
|
+
const [_nominations, _bondedPool, _metadata, _minimumActiveStake, _maxPoolMembers] = await Promise.all([substrateApi.api.query.staking.nominators(poolStashAccount), substrateApi.api.query.nominationPools.bondedPools(poolId), substrateApi.api.query.nominationPools.metadata(poolId), substrateApi.api.query.staking.minimumActiveStake(), (_substrateApi$api$que7 = substrateApi.api.query.nominationPools) === null || _substrateApi$api$que7 === void 0 ? void 0 : _substrateApi$api$que7.maxPoolMembersPerPool()]);
|
|
328
331
|
const minimumActiveStake = _minimumActiveStake.toPrimitive();
|
|
329
332
|
const nominations = _nominations.toJSON();
|
|
330
333
|
const poolMetadata = _metadata.toPrimitive();
|
|
@@ -333,6 +336,7 @@ export default class NominationPoolHandler extends BasePoolHandler {
|
|
|
333
336
|
const isPoolOpen = bondedPool.state === 'Open';
|
|
334
337
|
const isPoolNominating = !!nominations && nominations.targets.length > 0;
|
|
335
338
|
const isPoolEarningReward = bondedPool.points > minimumActiveStake;
|
|
339
|
+
const maxPoolMembers = _maxPoolMembers ? parseInt(_maxPoolMembers.toString()) : undefined;
|
|
336
340
|
nominationPools.push({
|
|
337
341
|
id: poolId,
|
|
338
342
|
address: poolAddress,
|
|
@@ -341,7 +345,8 @@ export default class NominationPoolHandler extends BasePoolHandler {
|
|
|
341
345
|
roles: bondedPool.roles,
|
|
342
346
|
memberCounter: bondedPool.memberCounter,
|
|
343
347
|
state: bondedPool.state,
|
|
344
|
-
isProfitable: isPoolOpen && isPoolNominating && isPoolEarningReward
|
|
348
|
+
isProfitable: isPoolOpen && isPoolNominating && isPoolEarningReward,
|
|
349
|
+
isCrowded: maxPoolMembers ? bondedPool.memberCounter >= maxPoolMembers : false
|
|
345
350
|
});
|
|
346
351
|
}));
|
|
347
352
|
return nominationPools;
|
|
@@ -33,7 +33,7 @@ export default class EarningService {
|
|
|
33
33
|
yieldPositionSubject = new BehaviorSubject({});
|
|
34
34
|
yieldPositionListSubject = new BehaviorSubject([]); // virtual list of yieldPositionSubject with filter values
|
|
35
35
|
|
|
36
|
-
useOnlineCacheOnly =
|
|
36
|
+
useOnlineCacheOnly = false;
|
|
37
37
|
constructor(state) {
|
|
38
38
|
this.state = state;
|
|
39
39
|
this.dbService = state.dbService;
|
|
@@ -53,7 +53,7 @@ export async function parseIdentity(substrateApi, address, children) {
|
|
|
53
53
|
if (substrateApi.api.query.identity) {
|
|
54
54
|
let identity;
|
|
55
55
|
const _parent = await substrateApi.api.query.identity.superOf(address);
|
|
56
|
-
const parentInfo = _parent.toHuman();
|
|
56
|
+
const parentInfo = _parent === null || _parent === void 0 ? void 0 : _parent.toHuman();
|
|
57
57
|
if (parentInfo) {
|
|
58
58
|
const [parentAddress, {
|
|
59
59
|
Raw: data
|
|
@@ -66,8 +66,16 @@ export async function parseIdentity(substrateApi, address, children) {
|
|
|
66
66
|
return [compactResult(rs), isReasonable];
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
+
let identityInfo;
|
|
69
70
|
const _identity = await substrateApi.api.query.identity.identityOf(address);
|
|
70
|
-
const
|
|
71
|
+
const identityOfMetadata = substrateApi.api.query.identity.identityOf.creator.meta;
|
|
72
|
+
const identityOfReturnType = substrateApi.api.registry.lookup.getName(identityOfMetadata.type.asMap.value);
|
|
73
|
+
if (identityOfReturnType === 'PalletIdentityRegistration') {
|
|
74
|
+
identityInfo = _identity.toHuman();
|
|
75
|
+
} else {
|
|
76
|
+
const _identityInfo = _identity === null || _identity === void 0 ? void 0 : _identity.toHuman();
|
|
77
|
+
identityInfo = _identityInfo ? _identityInfo[0] : undefined;
|
|
78
|
+
}
|
|
71
79
|
if (identityInfo) {
|
|
72
80
|
var _identityInfo$info, _identityInfo$info$di, _identityInfo$info2, _identityInfo$info2$w, _identityInfo$info3, _identityInfo$info3$r, _identityInfo$info4, _identityInfo$info4$t, _identityInfo$judgeme;
|
|
73
81
|
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;
|
|
@@ -61,17 +61,25 @@ export class PriceService {
|
|
|
61
61
|
})();
|
|
62
62
|
}
|
|
63
63
|
async calculatePriceMap() {
|
|
64
|
-
const
|
|
64
|
+
const {
|
|
65
|
+
price24hMap,
|
|
66
|
+
priceMap
|
|
67
|
+
} = this.rawPriceSubject.value;
|
|
65
68
|
const exchangeRateData = this.rawExchangeRateMap.value;
|
|
66
69
|
const currencyKey = this.currency.value;
|
|
67
|
-
if (Object.keys(
|
|
70
|
+
if (Object.keys(this.rawPriceSubject.value).length === 0) {
|
|
68
71
|
return;
|
|
69
72
|
}
|
|
70
73
|
if (Object.keys(exchangeRateData).length === 0) {
|
|
71
74
|
return;
|
|
72
75
|
}
|
|
73
76
|
const finalPriceMap = {
|
|
74
|
-
|
|
77
|
+
priceMap: {
|
|
78
|
+
...priceMap
|
|
79
|
+
},
|
|
80
|
+
price24hMap: {
|
|
81
|
+
...price24hMap
|
|
82
|
+
},
|
|
75
83
|
currency: currencyKey,
|
|
76
84
|
exchangeRateMap: exchangeRateData,
|
|
77
85
|
currencyData: staticData[StaticKey.CURRENCY_SYMBOL][currencyKey || DEFAULT_CURRENCY]
|
|
@@ -80,8 +88,8 @@ export class PriceService {
|
|
|
80
88
|
return finalPriceMap;
|
|
81
89
|
}
|
|
82
90
|
Object.keys(finalPriceMap.price24hMap).forEach(key => {
|
|
83
|
-
finalPriceMap.price24hMap[key]
|
|
84
|
-
finalPriceMap.priceMap[key]
|
|
91
|
+
finalPriceMap.price24hMap[key] *= exchangeRateData[currencyKey].exchange;
|
|
92
|
+
finalPriceMap.priceMap[key] *= exchangeRateData[currencyKey].exchange;
|
|
85
93
|
});
|
|
86
94
|
await this.dbService.updatePriceStore(finalPriceMap);
|
|
87
95
|
return finalPriceMap;
|
|
@@ -112,7 +120,7 @@ export class PriceService {
|
|
|
112
120
|
this.priceIds = priceIds || this.getPriceIds();
|
|
113
121
|
|
|
114
122
|
// Update for tokens price
|
|
115
|
-
this.getTokenPrice(this.priceIds,
|
|
123
|
+
this.getTokenPrice(this.priceIds, DEFAULT_CURRENCY).then(() => {
|
|
116
124
|
this.refreshPriceMapByAction();
|
|
117
125
|
}).catch(e => {
|
|
118
126
|
console.error(e);
|
|
@@ -226,6 +226,7 @@ export interface NominationYieldPoolInfo extends AbstractYieldPoolInfo {
|
|
|
226
226
|
type: YieldPoolType.NOMINATION_POOL;
|
|
227
227
|
metadata: NormalYieldPoolMetadata;
|
|
228
228
|
statistic?: NormalYieldPoolStatistic;
|
|
229
|
+
maxPoolMembers?: number;
|
|
229
230
|
}
|
|
230
231
|
/**
|
|
231
232
|
* @interface NativeYieldPoolInfo
|
|
@@ -237,6 +238,7 @@ export interface NativeYieldPoolInfo extends AbstractYieldPoolInfo {
|
|
|
237
238
|
type: YieldPoolType.NATIVE_STAKING;
|
|
238
239
|
metadata: NormalYieldPoolMetadata;
|
|
239
240
|
statistic?: NormalYieldPoolStatistic;
|
|
241
|
+
maxPoolMembers?: number;
|
|
240
242
|
}
|
|
241
243
|
/**
|
|
242
244
|
* Info of yield pool
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"USD": {"label": "United States Dollar", "symbol": "
|
|
3
|
-
"BRL": {"label": "Brazilian Real", "symbol": "
|
|
4
|
-
"CNY": {"label": "Chinese Yuan", "symbol": "
|
|
5
|
-
"EUR": {"label": "Euro", "symbol": "
|
|
6
|
-
"GBP": {"label": "British Pound Sterling", "symbol": "
|
|
7
|
-
"HKD": {"label": "Hong Kong Dollar", "symbol": "
|
|
8
|
-
"JPY": {"label": "Japanese Yen", "symbol": "
|
|
9
|
-
"RUB": {"label": "Russian Ruble", "symbol": "
|
|
10
|
-
"VND": {"label": "Vietnamese Dong", "symbol": "
|
|
2
|
+
"USD": {"label": "United States Dollar", "symbol": "$", "isPrefix": true},
|
|
3
|
+
"BRL": {"label": "Brazilian Real", "symbol": "R$", "isPrefix": true},
|
|
4
|
+
"CNY": {"label": "Chinese Yuan", "symbol": "C¥", "isPrefix": true},
|
|
5
|
+
"EUR": {"label": "Euro", "symbol": "€", "isPrefix": true},
|
|
6
|
+
"GBP": {"label": "British Pound Sterling", "symbol": "£", "isPrefix": true},
|
|
7
|
+
"HKD": {"label": "Hong Kong Dollar", "symbol": "H$", "isPrefix": true},
|
|
8
|
+
"JPY": {"label": "Japanese Yen", "symbol": "¥", "isPrefix": true},
|
|
9
|
+
"RUB": {"label": "Russian Ruble", "symbol": "₽", "isPrefix": true},
|
|
10
|
+
"VND": {"label": "Vietnamese Dong", "symbol": "₫", "isPrefix": true}
|
|
11
11
|
}
|