From 42fe7ce04c37f61ae5821b857f4deed5500edc13 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 23 Nov 2020 23:10:46 +0800 Subject: [PATCH 001/127] replace json view to react-json-view --- package-lock.json | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/package-lock.json b/package-lock.json index 17c9b0a43..280f9c854 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2127,6 +2127,24 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" }, + "encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "requires": { + "iconv-lite": "^0.6.2" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } + } + }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -3319,6 +3337,11 @@ "has": "^1.0.1" } }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, "is-string": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", @@ -3354,6 +3377,15 @@ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "requires": { + "node-fetch": "^1.0.1", + "whatwg-fetch": ">=0.10.0" + } + }, "jquery": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", @@ -6462,6 +6494,11 @@ } } }, + "whatwg-fetch": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.5.0.tgz", + "integrity": "sha512-jXkLtsR42xhXg7akoDKvKWE40eJeI+2KZqcp2h3NsOrRnDvtWX36KcKl30dy+hxECivdk2BVUHVNrPtoMBUx6A==" + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", From 0c87d53ea518d8f04c99b47cf7f823649ca5dfcc Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 24 Nov 2020 04:39:59 +0800 Subject: [PATCH 002/127] simplify storing validators --- imports/api/blocks/server/methods.js | 10 ++++++++++ imports/api/chain/server/methods.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 7bea3a75a..ec8b1c7c3 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -25,6 +25,16 @@ getRemovedValidators = (prevValidators, validators) => { return prevValidators; } +getValidatorFromConsensusKey = (validators, consensusKey) => { + for (v in validators){ + let pubkeyType = Meteor.settings.public.secp256k1?'tendermint/PubKeySecp256k1':'tendermint/PubKeyEd25519'; + if (validators[v].pub_key.value == Meteor.call('bech32ToPubkey', consensusKey, pubkeyType)){ + return validators[v] + } + } + return null; +} + getValidatorProfileUrl = (identity) => { if (identity.length == 16){ let response = HTTP.get(`https://keybase.io/_/api/1.0/user/lookup.json?key_suffix=${identity}&fields=pictures`) diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index f52c9388c..3a0425937 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -88,7 +88,7 @@ Meteor.methods({ } catch(e){ console.log(url); - console.log(e); + console.log(e.response.content); } if ( Coin.StakingCoin.denom ) { From 8021dd8fed2f7cfca33ebc891a4a1147e05de1c8 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 28 Nov 2020 22:44:01 +0800 Subject: [PATCH 003/127] put vp distribution calculation in async function --- imports/api/blocks/server/methods.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index ec8b1c7c3..f774d8c78 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -122,9 +122,6 @@ calculateVPDist = async (analyticsData, blockData) => { } } - // console.log(topTwentyPower) - // console.log(bottomEightyPower) - bottomSixtySixPercent = 1 - topThirtyFourPercent; numBottomSixtySix = activeValidators.length - numTopThirtyFour; From 787c25ef0318df76721e48056317fcfed22f9a77 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 29 Nov 2020 00:34:57 +0800 Subject: [PATCH 004/127] enable modules --- imports/api/chain/server/methods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index 3a0425937..f52c9388c 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -88,7 +88,7 @@ Meteor.methods({ } catch(e){ console.log(url); - console.log(e.response.content); + console.log(e); } if ( Coin.StakingCoin.denom ) { From 536b4b8de46fd4389e0306e9a45faef8f02864be Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 29 Nov 2020 00:44:53 +0800 Subject: [PATCH 005/127] remove tx indexing from block --- imports/api/blocks/server/methods.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index f774d8c78..c67cd8a92 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -403,7 +403,8 @@ Meteor.methods({ analyticsData.voting_power += valData.voting_power if (!valExist && valData.consensus_pubkey){ - + + // let val = getValidatorFromConsensusKey(validators, v); // get the validator hex address and other bech32 addresses. valData.delegator_address = Meteor.call('getDelegator', valData.operator_address); From a8258e4ff625547deae286db507742f49b1a1c37 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 29 Nov 2020 02:23:05 +0800 Subject: [PATCH 006/127] get self delegation every 50 blocks --- imports/api/blocks/server/methods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index c67cd8a92..da252979a 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -82,7 +82,7 @@ getValidatorUptime = async (validatorSet) => { } } catch(e){ - console.log("Getting signing info of %o: %o", validatorSet[key].consensus_pubkey, e.response.statusCode); + console.log("Getting signing info of %o: %o", validatorSet[key].consensus_pubkey, e); } } catch(e){ From 215e2f06ea65ca1a89bcaab9e996aceb9ed60fdf Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 29 Nov 2020 03:45:19 +0800 Subject: [PATCH 007/127] add try catch for bech32 conversion --- imports/api/blocks/server/methods.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index da252979a..d71e265ab 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -27,9 +27,15 @@ getRemovedValidators = (prevValidators, validators) => { getValidatorFromConsensusKey = (validators, consensusKey) => { for (v in validators){ - let pubkeyType = Meteor.settings.public.secp256k1?'tendermint/PubKeySecp256k1':'tendermint/PubKeyEd25519'; - if (validators[v].pub_key.value == Meteor.call('bech32ToPubkey', consensusKey, pubkeyType)){ - return validators[v] + try { + let pubkeyType = Meteor.settings.public.secp256k1?'tendermint/PubKeySecp256k1':'tendermint/PubKeyEd25519'; + let pubkey = Meteor.call('bech32ToPubkey', consensusKey, pubkeyType); + if (validators[v].pub_key.value == pubkey){ + return validators[v] + } + } + catch (e){ + console.log("Error converting pubkey: %o\n%o", consensusKey, e) } } return null; From 6dbcbb1a2431aa915acbec636856ae9f788c75eb Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 29 Nov 2020 03:52:12 +0800 Subject: [PATCH 008/127] update display error code --- imports/api/blocks/server/methods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index d71e265ab..cc9e0243f 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -88,7 +88,7 @@ getValidatorUptime = async (validatorSet) => { } } catch(e){ - console.log("Getting signing info of %o: %o", validatorSet[key].consensus_pubkey, e); + console.log("Getting signing info of %o: %o", validatorSet[key].consensus_pubkey, e.response.statusCode); } } catch(e){ From c6c532289cca14b2f31862cecff7e16ed4d85f94 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Fri, 11 Sep 2020 00:02:17 +0800 Subject: [PATCH 009/127] display staking ratio --- imports/ui/home/ChainStatus.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/imports/ui/home/ChainStatus.jsx b/imports/ui/home/ChainStatus.jsx index 0f475522c..6f5f458b6 100644 --- a/imports/ui/home/ChainStatus.jsx +++ b/imports/ui/home/ChainStatus.jsx @@ -34,7 +34,8 @@ export default class ChainStatus extends React.Component { numValidators: this.props.status.validators, totalNumValidators: this.props.status.totalValidators, bondedTokens: this.props.states.bondedTokens, - totalSupply: this.props.states.totalSupply + notBondedTokens: this.props.states.notBondedTokens, + // totalSupply: this.props.states.totalSupply }) switch (this.state.avgBlockTimeType){ @@ -200,7 +201,7 @@ export default class ChainStatus extends React.Component { chainStatus.onlineVotingPower ({this.state.votingPowerText}) - {this.state.votingPower}chainStatus.fromTotalStakes + {this.state.votingPower}chainStatus.fromTotalStakes From efb0796ee310bcd4b5501627646075cdf437d65a Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Fri, 11 Sep 2020 00:14:03 +0800 Subject: [PATCH 010/127] update validator search condition --- imports/ui/validators/ListContainer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imports/ui/validators/ListContainer.js b/imports/ui/validators/ListContainer.js index 10423894c..77a677c95 100644 --- a/imports/ui/validators/ListContainer.js +++ b/imports/ui/validators/ListContainer.js @@ -19,15 +19,15 @@ export default ValidatorListContainer = withTracker((props) => { if (props.inactive){ validatorsCond = { $or: [ - { status: { $lt : 2 } }, - { jailed: true } + { status: { $lt : 3 } }, + // { jailed: true } ] } } else{ validatorsCond = { - jailed: false, - status: 2 + // jailed: false, + status: 3 } } From 1970c7572919307a6774891eb31dfca9c4aec14b Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Fri, 11 Sep 2020 00:47:18 +0800 Subject: [PATCH 011/127] fix home validator list and genesis params --- imports/ui/home/ChainStatus.jsx | 2 +- imports/ui/home/TopValidatorsContainer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/ui/home/ChainStatus.jsx b/imports/ui/home/ChainStatus.jsx index 6f5f458b6..c2577cab0 100644 --- a/imports/ui/home/ChainStatus.jsx +++ b/imports/ui/home/ChainStatus.jsx @@ -201,7 +201,7 @@ export default class ChainStatus extends React.Component { chainStatus.onlineVotingPower ({this.state.votingPowerText}) - {this.state.votingPower}chainStatus.fromTotalStakes + {this.state.votingPower}chainStatus.fromTotalStakes diff --git a/imports/ui/home/TopValidatorsContainer.js b/imports/ui/home/TopValidatorsContainer.js index 6808254f6..920b590d1 100644 --- a/imports/ui/home/TopValidatorsContainer.js +++ b/imports/ui/home/TopValidatorsContainer.js @@ -21,7 +21,7 @@ export default TopValidatorsContainer = withTracker(() => { if (Meteor.isServer || !loading){ status = Chain.findOne({chainId:Meteor.settings.public.chainId}); - validators = Validators.find({status: 2, jailed:false}).fetch(); + validators = Validators.find({status: 3}).fetch(); if (Meteor.isServer){ // loading = false; From 74d64e32eca6093d7a5e8d45e7cd7f63e55a9078 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Fri, 11 Sep 2020 00:53:32 +0800 Subject: [PATCH 012/127] fix account delegation validator name --- imports/ui/accounts/Delegations.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/ui/accounts/Delegations.jsx b/imports/ui/accounts/Delegations.jsx index d67c4c833..502c0b31f 100644 --- a/imports/ui/accounts/Delegations.jsx +++ b/imports/ui/accounts/Delegations.jsx @@ -34,7 +34,7 @@ export default class AccountDelegations extends Component{ let reward = this.props.rewardsForEachDel[d.validator_address]; rewardDenom =(reward)?reward.find(({denom}) => denom === denomType): null; return - + {new Coin(d.balance.amount, denomType).stakeString()} {rewardDenom?new Coin(rewardDenom.amount, rewardDenom.denom).toString(4):'No rewards '} From 86f0151d39a805a07378a5c696d7c3545e946866 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Thu, 12 Mar 2020 21:05:53 +0800 Subject: [PATCH 013/127] change the BondStatus from 2 to 3 --- imports/api/chain/server/methods.js | 2 +- imports/ui/validators/ListContainer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index f52c9388c..2d9ca39f4 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -58,7 +58,7 @@ Meteor.methods({ // Since Tendermint v0.33, validator page default set to return 30 validators. // Query latest height with page 1 and 100 validators per page. - url = RPC+`/validators?height=${chain.latestBlockHeight}&page=1&per_page=100`; + url = RPC+`/validators?page=1&per_page=100`; response = HTTP.get(url); let validators = JSON.parse(response.content); validators = validators.result.validators; diff --git a/imports/ui/validators/ListContainer.js b/imports/ui/validators/ListContainer.js index 77a677c95..85be3f6a4 100644 --- a/imports/ui/validators/ListContainer.js +++ b/imports/ui/validators/ListContainer.js @@ -26,7 +26,7 @@ export default ValidatorListContainer = withTracker((props) => { } else{ validatorsCond = { - // jailed: false, + jailed: false, status: 3 } } From 7aa5a73471dfe505cf6c02652ae9621633db2d5a Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 5 May 2020 12:14:03 +0000 Subject: [PATCH 014/127] show minting --- imports/api/chain/server/methods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index 2d9ca39f4..6eaa25781 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -93,7 +93,7 @@ Meteor.methods({ if ( Coin.StakingCoin.denom ) { if (Meteor.settings.public.modules.supply){ - url = LCD + '/supply/total/'+ Coin.StakingCoin.denom; + url = LCD + '/bank/total/'+ Coin.StakingCoin.denom; try{ response = HTTP.get(url); let supply = JSON.parse(response.content).result; From 356b1d6bae18b787b0ddbcdf1bf02ff684fff1f2 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 5 May 2020 12:26:07 +0000 Subject: [PATCH 015/127] update validator status value --- CHANGELOG.md | 1 + imports/api/validators/server/publications.js | 2 +- imports/ui/validators/ListContainer.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fd68d69a..0a014b340 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ * Simplify validator storing * Get data and show proposal based on enabled modules * Calculate validator uptime in async +* Update validator status ## v0.39.x-3 diff --git a/imports/api/validators/server/publications.js b/imports/api/validators/server/publications.js index e3e1870fb..a2adcc00d 100644 --- a/imports/api/validators/server/publications.js +++ b/imports/api/validators/server/publications.js @@ -25,7 +25,7 @@ publishComposite('validators.firstSeen',{ Meteor.publish('validators.voting_power', function(){ return Validators.find({ - status: 2, + status: 3, jailed:false },{ sort:{ diff --git a/imports/ui/validators/ListContainer.js b/imports/ui/validators/ListContainer.js index 85be3f6a4..77a677c95 100644 --- a/imports/ui/validators/ListContainer.js +++ b/imports/ui/validators/ListContainer.js @@ -26,7 +26,7 @@ export default ValidatorListContainer = withTracker((props) => { } else{ validatorsCond = { - jailed: false, + // jailed: false, status: 3 } } From 4a5863ba36808ef926fbf8007a12966cb7309f6a Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Sun, 31 May 2020 22:14:58 -0600 Subject: [PATCH 016/127] fix: update more status code changes (#357) --- imports/ui/components/AccountTooltip.jsx | 28 ++++++++++++------------ imports/ui/ledger/LedgerActions.jsx | 4 ++-- imports/ui/validators/List.jsx | 2 +- imports/ui/validators/ListContainer.js | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/imports/ui/components/AccountTooltip.jsx b/imports/ui/components/AccountTooltip.jsx index 02dfec24c..8a095bd17 100644 --- a/imports/ui/components/AccountTooltip.jsx +++ b/imports/ui/components/AccountTooltip.jsx @@ -49,16 +49,16 @@ export default class AccountTooltip extends Account{ return let validator = this.state.validator; let moniker = (validator.description && validator.description.moniker) || validator.address; - let isActive = validator.status == 2 && !validator.jailed; + let isActive = validator.status == 3 && !validator.jailed; return -

{moniker}

+

{moniker}

-
- + + power {validator.voting_power?numbro(validator.voting_power).format('0,0'):0} @@ -70,22 +70,22 @@ export default class AccountTooltip extends Account{ {(isActive)? call_split { (validator.commission.commission_rates)? numbro(validator.commission.commission_rates.rate).format('0.00%') : numbro(validator.commission.rate).format('0.00%') } - :null} + :null} {(!isActive)? - access_time - {validator.lastSeen?: - (validator.unbonding_time?:null)} + access_time + {validator.lastSeen?: + (validator.unbonding_time?:null)} :null} {(!isActive)? - {(validator.status == 0)?Unbonded:Unbonding} - {validator.jailed?Jailed:''} + {(validator.status == 1)?Unbonded:Unbonding} + {validator.jailed?Jailed:''} :null} {(isActive)? - flash_on{validator.uptime?numbro(validator.uptime/100).format('0%'):0} - + flash_on{validator.uptime?numbro(validator.uptime/100).format('0%'):0} + :null} - -
+ +
} diff --git a/imports/ui/ledger/LedgerActions.jsx b/imports/ui/ledger/LedgerActions.jsx index 1c476c392..f84a7fcbe 100644 --- a/imports/ui/ledger/LedgerActions.jsx +++ b/imports/ui/ledger/LedgerActions.jsx @@ -132,7 +132,7 @@ const Fee = (props) => { } const isActiveValidator = (validator) => { - return !validator.jailed && validator.status == 2; + return !validator.jailed && validator.status == 3; } const isBetween = (value, min, max) => { @@ -524,7 +524,7 @@ class LedgerButton extends Component { getValidatorOptions = () => { let activeValidators = Validators.find( - {"jailed": false, "status": 2}, + {"jailed": false, "status": 3}, {"sort":{"description.moniker":1}} ); let redelegations = this.state.redelegations || {}; diff --git a/imports/ui/validators/List.jsx b/imports/ui/validators/List.jsx index 2a98d7f86..6241a9bcc 100644 --- a/imports/ui/validators/List.jsx +++ b/imports/ui/validators/List.jsx @@ -19,7 +19,7 @@ const ValidatorRow = (props) => { {(!props.inactive)?call_split {(props.validator.commission&&props.validator.commission.commission_rates)?numbro(props.validator.commission.commission_rates.rate).format('0.00%'):''}:''} {(!props.inactive)?{props.validator.uptime?props.validator.uptime.toFixed(2):0}% :''} {(props.inactive)?{props.validator.lastSeen?:''}:''} - {(props.inactive)?{(props.validator.status == 0)?Unbonded:Unbonding}:''} + {(props.inactive)?{(props.validator.status == 1)?Unbonded:Unbonding}:''} {(props.inactive)?{props.validator.jailed?Jailed:''}:''} diff --git a/imports/ui/validators/ListContainer.js b/imports/ui/validators/ListContainer.js index 77a677c95..85be3f6a4 100644 --- a/imports/ui/validators/ListContainer.js +++ b/imports/ui/validators/ListContainer.js @@ -26,7 +26,7 @@ export default ValidatorListContainer = withTracker((props) => { } else{ validatorsCond = { - // jailed: false, + jailed: false, status: 3 } } From ba74580b60ff1546ad3151c2d911e9aa73c2d84c Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Fri, 11 Sep 2020 01:54:41 +0800 Subject: [PATCH 017/127] fix total supply amount --- imports/api/chain/server/methods.js | 4 ++-- imports/ui/home/ChainStatus.jsx | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index 6eaa25781..fb991f513 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -92,12 +92,12 @@ Meteor.methods({ } if ( Coin.StakingCoin.denom ) { - if (Meteor.settings.public.modules.supply){ + if (Meteor.settings.public.modules.bank){ url = LCD + '/bank/total/'+ Coin.StakingCoin.denom; try{ response = HTTP.get(url); let supply = JSON.parse(response.content).result; - chainStates.totalSupply = parseInt(supply); + chainStates.totalSupply = parseInt(supply.amount); } catch(e){ console.log(url); diff --git a/imports/ui/home/ChainStatus.jsx b/imports/ui/home/ChainStatus.jsx index c2577cab0..15ebc321b 100644 --- a/imports/ui/home/ChainStatus.jsx +++ b/imports/ui/home/ChainStatus.jsx @@ -34,8 +34,7 @@ export default class ChainStatus extends React.Component { numValidators: this.props.status.validators, totalNumValidators: this.props.status.totalValidators, bondedTokens: this.props.states.bondedTokens, - notBondedTokens: this.props.states.notBondedTokens, - // totalSupply: this.props.states.totalSupply + totalSupply: this.props.states.totalSupply }) switch (this.state.avgBlockTimeType){ @@ -201,7 +200,7 @@ export default class ChainStatus extends React.Component { chainStatus.onlineVotingPower ({this.state.votingPowerText}) - {this.state.votingPower}chainStatus.fromTotalStakes + {this.state.votingPower}chainStatus.fromTotalStakes From f26a371667b502429d673cbac5b1c48c48e715d1 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Thu, 24 Sep 2020 16:20:43 +0800 Subject: [PATCH 018/127] update tx elements structures --- imports/api/validators/server/methods.js | 4 +-- imports/ui/blocks/BlockContainer.js | 32 +++++++++---------- imports/ui/components/Activities.jsx | 2 +- imports/ui/components/PowerHistory.jsx | 4 +-- .../ui/components/TransactionsContainer.js | 32 +++++++++---------- imports/ui/ledger/ledger.js | 4 +-- imports/ui/transactions/Transaction.jsx | 4 +-- imports/ui/transactions/TransactionRow.jsx | 8 ++--- 8 files changed, 45 insertions(+), 45 deletions(-) diff --git a/imports/api/validators/server/methods.js b/imports/api/validators/server/methods.js index c1715b5d7..ad6df8d9f 100644 --- a/imports/api/validators/server/methods.js +++ b/imports/api/validators/server/methods.js @@ -7,8 +7,8 @@ Meteor.methods({ this.unblock(); // look up the create validator time to consider if the validator has never updated the commission let tx = Transactions.findOne({$and:[ - {"tx.value.msg.value.delegator_address":address}, - {"tx.value.msg.type":"cosmos-sdk/MsgCreateValidator"}, + {"tx.body.messages.value.delegator_address":address}, + {"tx.body.messages.type":"cosmos-sdk/MsgCreateValidator"}, {code:{$exists:false}} ]}); diff --git a/imports/ui/blocks/BlockContainer.js b/imports/ui/blocks/BlockContainer.js index 9e895e802..975bc694a 100644 --- a/imports/ui/blocks/BlockContainer.js +++ b/imports/ui/blocks/BlockContainer.js @@ -39,42 +39,42 @@ export default BlockContainer = withTracker((props) => { block: blockExist ? block : {}, transferTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.value.msg.type":"cosmos-sdk/MsgSend"}, - {"tx.value.msg.type":"cosmos-sdk/MsgMultiSend"} + {"tx.body.messages.type":"cosmos-sdk/MsgSend"}, + {"tx.body.messages.type":"cosmos-sdk/MsgMultiSend"} ] }).fetch() : {}, stakingTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.value.msg.type":"cosmos-sdk/MsgCreateValidator"}, - {"tx.value.msg.type":"cosmos-sdk/MsgEditValidator"}, - {"tx.value.msg.type":"cosmos-sdk/MsgDelegate"}, - {"tx.value.msg.type":"cosmos-sdk/MsgUndelegate"}, - {"tx.value.msg.type":"cosmos-sdk/MsgBeginRedelegate"} + {"tx.body.messages.type":"cosmos-sdk/MsgCreateValidator"}, + {"tx.body.messages.type":"cosmos-sdk/MsgEditValidator"}, + {"tx.body.messages.type":"cosmos-sdk/MsgDelegate"}, + {"tx.body.messages.type":"cosmos-sdk/MsgUndelegate"}, + {"tx.body.messages.type":"cosmos-sdk/MsgBeginRedelegate"} ] }).fetch() : {}, distributionTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.value.msg.type":"cosmos-sdk/MsgWithdrawValidatorCommission"}, - {"tx.value.msg.type":"cosmos-sdk/MsgWithdrawDelegationReward"}, - {"tx.value.msg.type":"cosmos-sdk/MsgModifyWithdrawAddress"} + {"tx.body.messages.type":"cosmos-sdk/MsgWithdrawValidatorCommission"}, + {"tx.body.messages.type":"cosmos-sdk/MsgWithdrawDelegationReward"}, + {"tx.body.messages.type":"cosmos-sdk/MsgModifyWithdrawAddress"} ] }).fetch() : {}, governanceTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.value.msg.type":"cosmos-sdk/MsgSubmitProposal"}, - {"tx.value.msg.type":"cosmos-sdk/MsgDeposit"}, - {"tx.value.msg.type":"cosmos-sdk/MsgVote"} + {"tx.body.messages.type":"cosmos-sdk/MsgSubmitProposal"}, + {"tx.body.messages.type":"cosmos-sdk/MsgDeposit"}, + {"tx.body.messages.type":"cosmos-sdk/MsgVote"} ] }).fetch() : {}, slashingTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.value.msg.type":"cosmos-sdk/MsgUnjail"} + {"tx.body.messages.type":"cosmos-sdk/MsgUnjail"} ] }).fetch() : {}, IBCTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.value.msg.type":"cosmos-sdk/IBCTransferMsg"}, - {"tx.value.msg.type":"cosmos-sdk/IBCReceiveMsg"} + {"tx.body.messages.type":"cosmos-sdk/IBCTransferMsg"}, + {"tx.body.messages.type":"cosmos-sdk/IBCReceiveMsg"} ] }).fetch() : {}, }; diff --git a/imports/ui/components/Activities.jsx b/imports/ui/components/Activities.jsx index 53908d521..add15196b 100644 --- a/imports/ui/components/Activities.jsx +++ b/imports/ui/components/Activities.jsx @@ -39,7 +39,7 @@ export default class Activites extends Component { } render(){ - // console.log(this.props); + console.log(this.props); const msg = this.props.msg; const events = []; for (let i in this.props.events){ diff --git a/imports/ui/components/PowerHistory.jsx b/imports/ui/components/PowerHistory.jsx index 5589596fe..21cd281d9 100644 --- a/imports/ui/components/PowerHistory.jsx +++ b/imports/ui/components/PowerHistory.jsx @@ -26,7 +26,7 @@ export default class PowerHistory extends React.Component { this.setState({ tx: result.map((msg, i) => - {(msg.tx.value.msg && msg.tx.value.msg.length > 0)?msg.tx.value.msg.map((m, j) => { + {(msg.tx.body.messages && msg.tx.body.messages.length > 0)?msg.tx.body.messages.map((m, j) => { switch (m.type){ case "cosmos-sdk/MsgBeginRedelegate": return @@ -107,7 +107,7 @@ export default class PowerHistory extends React.Component { - {(msg.tx.value.msg && msg.tx.value.msg.length > 0)?msg.tx.value.msg.map((m,j) => { + {(msg.tx.body.messages && msg.tx.body.messages.length > 0)?msg.tx.body.messages.map((m,j) => { switch (m.type){ case "cosmos-sdk/MsgBeginRedelegate": return messageTypes.redelegate; diff --git a/imports/ui/components/TransactionsContainer.js b/imports/ui/components/TransactionsContainer.js index 0122e6445..4d3ea22b5 100644 --- a/imports/ui/components/TransactionsContainer.js +++ b/imports/ui/components/TransactionsContainer.js @@ -29,42 +29,42 @@ export default TransactionsContainer = withTracker((props) => { transactionsExist, transferTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.value.msg.type":"cosmos-sdk/MsgSend"}, - {"tx.value.msg.type":"cosmos-sdk/MsgMultiSend"} + {"tx.body.messages.type":"cosmos-sdk/MsgSend"}, + {"tx.body.messages.type":"cosmos-sdk/MsgMultiSend"} ] }).fetch() : {}, stakingTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.value.msg.type":"cosmos-sdk/MsgCreateValidator"}, - {"tx.value.msg.type":"cosmos-sdk/MsgEditValidator"}, - {"tx.value.msg.type":"cosmos-sdk/MsgDelegate"}, - {"tx.value.msg.type":"cosmos-sdk/MsgUndelegate"}, - {"tx.value.msg.type":"cosmos-sdk/MsgBeginRedelegate"} + {"tx.body.messages.type":"cosmos-sdk/MsgCreateValidator"}, + {"tx.body.messages.type":"cosmos-sdk/MsgEditValidator"}, + {"tx.body.messages.type":"cosmos-sdk/MsgDelegate"}, + {"tx.body.messages.type":"cosmos-sdk/MsgUndelegate"}, + {"tx.body.messages.type":"cosmos-sdk/MsgBeginRedelegate"} ] }).fetch() : {}, distributionTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.value.msg.type":"cosmos-sdk/MsgWithdrawValidatorCommission"}, - {"tx.value.msg.type":"cosmos-sdk/MsgWithdrawDelegationReward"}, - {"tx.value.msg.type":"cosmos-sdk/MsgModifyWithdrawAddress"} + {"tx.body.messages.type":"cosmos-sdk/MsgWithdrawValidatorCommission"}, + {"tx.body.messages.type":"cosmos-sdk/MsgWithdrawDelegationReward"}, + {"tx.body.messages.type":"cosmos-sdk/MsgModifyWithdrawAddress"} ] }).fetch() : {}, governanceTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.value.msg.type":"cosmos-sdk/MsgSubmitProposal"}, - {"tx.value.msg.type":"cosmos-sdk/MsgDeposit"}, - {"tx.value.msg.type":"cosmos-sdk/MsgVote"} + {"tx.body.messages.type":"cosmos-sdk/MsgSubmitProposal"}, + {"tx.body.messages.type":"cosmos-sdk/MsgDeposit"}, + {"tx.body.messages.type":"cosmos-sdk/MsgVote"} ] }).fetch() : {}, slashingTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.value.msg.type":"cosmos-sdk/MsgUnjail"} + {"tx.body.messages.type":"cosmos-sdk/MsgUnjail"} ] }).fetch() : {}, IBCTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.value.msg.type":"cosmos-sdk/IBCTransferMsg"}, - {"tx.value.msg.type":"cosmos-sdk/IBCReceiveMsg"} + {"tx.body.messages.type":"cosmos-sdk/IBCTransferMsg"}, + {"tx.body.messages.type":"cosmos-sdk/IBCReceiveMsg"} ] }).fetch() : {} }; diff --git a/imports/ui/ledger/ledger.js b/imports/ui/ledger/ledger.js index 5aee6cb2c..567eee222 100644 --- a/imports/ui/ledger/ledger.js +++ b/imports/ui/ledger/ledger.js @@ -210,8 +210,8 @@ export class Ledger { account_number: txContext.accountNumber.toString(), chain_id: txContext.chainId, fee: tx.value.fee, - memo: tx.value.memo, - msgs: tx.value.msg, + memo: tx.body.memo, + msgs: tx.body.messages, sequence: txContext.sequence.toString(), }; diff --git a/imports/ui/transactions/Transaction.jsx b/imports/ui/transactions/Transaction.jsx index 30b3dbcbd..a228b2d63 100644 --- a/imports/ui/transactions/Transaction.jsx +++ b/imports/ui/transactions/Transaction.jsx @@ -64,7 +64,7 @@ export default class Transaction extends Component{ transactions.gasUsedWanted {numbro(tx.gas_used).format("0,0")} / {numbro(tx.gas_wanted).format("0,0")} transactions.memo - + @@ -72,7 +72,7 @@ export default class Transaction extends Component{
transactions.activities
- {(tx.tx.value.msg && tx.tx.value.msg.length >0)?tx.tx.value.msg.map((msg,i) => { + {(tx.tx.body.messages && tx.tx.body.messages.length >0)?tx.tx.body.messages.map((msg,i) => { return }):''} diff --git a/imports/ui/transactions/TransactionRow.jsx b/imports/ui/transactions/TransactionRow.jsx index 8e92dd4d0..f0572b4ea 100644 --- a/imports/ui/transactions/TransactionRow.jsx +++ b/imports/ui/transactions/TransactionRow.jsx @@ -18,19 +18,19 @@ export const TransactionRow = (props) => { let tx = props.tx; return - {(tx.tx.value.msg && tx.tx.value.msg.length >0)?tx.tx.value.msg.map((msg,i) => { + {(tx.tx.body.messages && tx.tx.body.messages.length >0)?tx.tx.body.messages.map((msg,i) => { return }):''} {tx.txhash} - schedule {tx.block()?:''}{(tx.tx.value.memo && tx.tx.value.memo != "")? + schedule {tx.block()?:''}{(tx.tx.body.memo && tx.tx.body.memo != "")? message - + :""} {(!props.blockList)? {numbro(tx.height).format("0,0")}:''} {(!tx.code)?:} - monetization_on {(tx.tx.value.fee.amount.length > 0)?tx.tx.value.fee.amount.map((fee,i) => { + monetization_on {(tx.tx.auth_info.fee.amount.length > 0)?tx.tx.auth_info.fee.amount.map((fee,i) => { return {(new Coin(parseFloat(fee.amount), (fee)?fee.denom:null)).stakeString()} }):No fee} {(tx.code)? From feb34134d8d59adbdb9d33f17ae8df73d479a1ec Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 9 Nov 2020 22:04:20 +0800 Subject: [PATCH 019/127] update version --- private/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/version b/private/version index 41fce27a0..51bb99b9d 100644 --- a/private/version +++ b/private/version @@ -1 +1 @@ -v0.39.x-7 \ No newline at end of file +v0.40.x-rc1 From b253e51a9713ba441f9ff59186c66470b00e13cc Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 1 Dec 2020 17:55:57 +0000 Subject: [PATCH 020/127] refactor getting validator for v0.40 --- imports/api/blocks/server/methods.js | 152 +++++++++++++++------------ 1 file changed, 85 insertions(+), 67 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index cc9e0243f..4b85e500b 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -42,6 +42,7 @@ getValidatorFromConsensusKey = (validators, consensusKey) => { } getValidatorProfileUrl = (identity) => { + console.log("Get validator avatar.") if (identity.length == 16){ let response = HTTP.get(`https://keybase.io/_/api/1.0/user/lookup.json?key_suffix=${identity}&fields=pictures`) if (response.statusCode == 200) { @@ -74,7 +75,7 @@ getValidatorUptime = async (validatorSet) => { for(let key in validatorSet){ try{ try { - let url = LCD+'/slashing/validators/'+validatorSet[key].consensus_pubkey+'/signing_info'; + let url = LCD+'/slashing/validators/'+validatorSet[key].bech32ConsensusPubKey+'/signing_info'; let response = HTTP.get(url); let signingInfo = JSON.parse(response.content).result; if (signingInfo){ @@ -84,11 +85,11 @@ getValidatorUptime = async (validatorSet) => { valData.index_offset = signingInfo.index_offset valData.start_height = signingInfo.start_height valData.uptime = (slashingParams.signed_blocks_window - parseInt(signingInfo.missed_blocks_counter))/slashingParams.signed_blocks_window * 100; - Validators.upsert({consensus_pubkey:validatorSet[key].consensus_pubkey}, {$set:valData}) + Validators.upsert({bech32ConsensusPubKey:validatorSet[key].bech32ConsensusPubKey}, {$set:valData}) } } catch(e){ - console.log("Getting signing info of %o: %o", validatorSet[key].consensus_pubkey, e.response.statusCode); + console.log("Getting signing info of %o: %o", validatorSet[key].bech32ConsensusPubKey, e.response.statusCode); } } catch(e){ @@ -217,7 +218,7 @@ Meteor.methods({ try{ response = HTTP.get(url); - JSON.parse(response.content).result.forEach((validator) => validatorSet[validator.consensus_pubkey] = validator); + JSON.parse(response.content).result.forEach((validator) => validatorSet[validator.consensus_pubkey.value] = validator); } catch(e){ console.log(url); @@ -228,7 +229,7 @@ Meteor.methods({ try{ response = HTTP.get(url); - JSON.parse(response.content).result.forEach((validator) => validatorSet[validator.consensus_pubkey] = validator) + JSON.parse(response.content).result.forEach((validator) => validatorSet[validator.consensus_pubkey.value] = validator) } catch(e){ console.log(url); @@ -239,7 +240,7 @@ Meteor.methods({ try{ response = HTTP.get(url); - JSON.parse(response.content).result.forEach((validator) => validatorSet[validator.consensus_pubkey] = validator) + JSON.parse(response.content).result.forEach((validator) => validatorSet[validator.consensus_pubkey.value] = validator) } catch(e){ console.log(url); @@ -280,20 +281,6 @@ Meteor.methods({ blockData.proposerAddress = block.block.header.proposer_address; blockData.validators = []; - // Tendermint v0.33 start using "signatures" in last block instead of "precommits" - let precommits = block.block.last_commit.signatures; - if (precommits != null){ - // console.log(precommits.length); - for (let i=0; i 0){ @@ -353,20 +340,64 @@ Meteor.methods({ catch(e){ console.log("Getting validator set at height %o: %o", height, e) } - + + ValidatorSets.insert({ + block_height: height, + validators: validators + }) + // temporarily add bech32 concensus keys to the validator set list let tempValidators = []; for (let v in validators){ - validators[v].consensus_pubkey = Meteor.call('pubkeyToBech32', validators[v].pub_key, Meteor.settings.public.bech32PrefixConsPub); - tempValidators[validators[v].consensus_pubkey] = validators[v]; + // validators[v].consensus_pubkey = Meteor.call('pubkeyToBech32', validators[v].pub_key, Meteor.settings.public.bech32PrefixConsPub); + tempValidators[validators[v].pub_key.value] = validators[v]; } validators = tempValidators; - ValidatorSets.insert({ - block_height: height, - validators: validators - }) + // Tendermint v0.33 start using "signatures" in last block instead of "precommits" + let precommits = block.block.last_commit.signatures; + if (precommits != null){ + // console.log(precommits.length); + for (let i=0; i 1){ + // record precommits and calculate uptime + // only record from block 2 + console.log("Inserting precommits") + for (i in validators){ + let address = validators[i].address; + let record = { + height: height, + address: address, + exists: false, + voting_power: parseInt(validators[i].voting_power)//getValidatorVotingPower(existingValidators, address) + } + + for (j in precommits){ + if (precommits[j] != null){ + if (address == precommits[j].validator_address){ + record.exists = true; + bulkUpdateLastSeen.find({address:precommits[j].validator_address}).upsert().updateOne({$set:{lastSeen:blockData.time}}); + precommits.splice(j,1); + break; + } + } + } + bulkValidatorRecords.insert(record); + // ValidatorRecords.update({height:height,address:record.address},record); + } + } + blockData.validatorsCount = validators.length; let startBlockInsertTime = new Date(); Blockscon.insert(blockData); @@ -404,7 +435,7 @@ Meteor.methods({ let startFindValidatorsNameTime = new Date(); for (v in validatorSet){ let valData = validatorSet[v]; - let valExist = Validators.findOne({consensus_pubkey:v}); + let valExist = Validators.findOne({"consensus_pubkey.value":v}); analyticsData.voting_power += valData.voting_power @@ -415,12 +446,14 @@ Meteor.methods({ valData.delegator_address = Meteor.call('getDelegator', valData.operator_address); - let pubkeyType = Meteor.settings.public.secp256k1?'tendermint/PubKeySecp256k1':'tendermint/PubKeyEd25519'; + console.log("get hex address") + valData.address = getAddress(valData.consensus_pubkey); - valData.pub_key = { - type: pubkeyType, - value: Meteor.call('bech32ToPubkey', valData.consensus_pubkey, pubkeyType) - } + console.log("get bech32 consensus pubkey"); + valData.bech32ConsensusPubKey = Meteor.call('pubkeyToBech32', valData.consensus_pubkey, Meteor.settings.public.bech32PrefixConsPub); + + // assign back to the validator set so that we can use it to find the uptime + validatorSet[v].bech32ConsensusPubKey = valData.bech32ConsensusPubKey; valData.address = getAddress(valData.pub_key); @@ -437,13 +470,15 @@ Meteor.methods({ } - valData.accpub = Meteor.call('pubkeyToBech32', valData.pub_key, Meteor.settings.public.bech32PrefixAccPub); - valData.operator_pubkey = Meteor.call('pubkeyToBech32', valData.pub_key, Meteor.settings.public.bech32PrefixValPub); + valData.accpub = Meteor.call('pubkeyToBech32', valData.consensus_pubkey, Meteor.settings.public.bech32PrefixAccPub); + valData.operator_pubkey = Meteor.call('pubkeyToBech32', valData.consensus_pubkey, Meteor.settings.public.bech32PrefixValPub); // insert first power change history - valData.voting_power = validators[valData.consensus_pubkey]?parseInt(validators[valData.consensus_pubkey].voting_power):0; - valData.proposer_priority = validators[valData.consensus_pubkey]?parseInt(validators[valData.consensus_pubkey].proposer_priority):0; + valData.voting_power = validators[valData.consensus_pubkey.value]?parseInt(validators[valData.consensus_pubkey.value].voting_power):0; + valData.proposer_priority = validators[valData.consensus_pubkey.value]?parseInt(validators[valData.consensus_pubkey.value].proposer_priority):0; + + console.log("Validator not found. Insert first VP change record.") bulkVPHistory.insert({ address: valData.address, prev_voting_power: 0, @@ -455,15 +490,18 @@ Meteor.methods({ // } } else{ + + // assign to valData for getting self delegation valData.delegator_address = valExist.delegator_address; - if (validators[valData.consensus_pubkey]){ + if (validators[valData.consensus_pubkey.value]){ // Validator exists and is in validator set, update voitng power. // If voting power is different from before, add voting power history - valData.voting_power = parseInt(validators[valData.consensus_pubkey].voting_power); - valData.proposer_priority = parseInt(validators[valData.consensus_pubkey].proposer_priority); + valData.voting_power = parseInt(validators[valData.consensus_pubkey.value].voting_power); + valData.proposer_priority = parseInt(validators[valData.consensus_pubkey.value].proposer_priority); let prevVotingPower = VotingPowerHistory.findOne({address:valExist.address}, {height:-1, limit:1}); + console.log("Validator already in DB. Check if VP changed."); if (prevVotingPower){ if (prevVotingPower.voting_power != valData.voting_power){ let changeType = (prevVotingPower.voting_power > valData.voting_power)?'down':'up'; @@ -485,12 +523,14 @@ Meteor.methods({ // Validator is not in the set and it has been removed. // Set voting power to zero and add voting power history. + valData.voting_power = 0; valData.proposer_priority = 0; let prevVotingPower = VotingPowerHistory.findOne({address:valExist.address}, {height:-1, limit:1}); if (prevVotingPower && (prevVotingPower.voting_power > 0)){ + console.log("Validator is in DB but not in validator set now. Add remove VP change."); bulkVPHistory.insert({ address: valExist.address, prev_voting_power: prevVotingPower, @@ -507,6 +547,7 @@ Meteor.methods({ if (height == curr+1){ //if (height % 50 == 2){ let url = LCD+`/staking/delegators/${valData.delegator_address}/delegations/${valData.operator_address}` try{ + console.log("Getting self delegation"); let response = HTTP.get(url); let selfDelegation = JSON.parse(response.content).result; valData.self_delegation = (selfDelegation && selfDelegation.shares)?parseFloat(selfDelegation.shares)/parseFloat(valData.delegator_shares):0; @@ -516,44 +557,21 @@ Meteor.methods({ } } + // only update validator infor during start of crawling, end of crawling or every validator update window if ((height == curr+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ - bulkValidators.find({consensus_pubkey: valData.consensus_pubkey}).upsert().updateOne({$set:valData}); + console.log("Add validator upsert to bulk operations.") + bulkValidators.find({"consensus_pubkey.value": valData.consensus_pubkey.value}).upsert().updateOne({$set:valData}); } } // store valdiators exist records // let existingValidators = Validators.find({address:{$exists:true}}).fetch(); - if (height > 1){ - // record precommits and calculate uptime - // only record from block 2 - for (i in validators){ - let address = validators[i].address; - let record = { - height: height, - address: address, - exists: false, - voting_power: parseInt(validators[i].voting_power)//getValidatorVotingPower(existingValidators, address) - } - - for (j in precommits){ - if (precommits[j] != null){ - if (address == precommits[j].validator_address){ - record.exists = true; - bulkUpdateLastSeen.find({address:precommits[j].validator_address}).upsert().updateOne({$set:{lastSeen:blockData.time}}); - precommits.splice(j,1); - break; - } - } - } - bulkValidatorRecords.insert(record); - // ValidatorRecords.update({height:height,address:record.address},record); - } - } // update uptime by the end of the crawl or update window if ((height % Meteor.settings.params.validatorUpdateWindow == 0) || (height == until)){ + console.log("Update validator uptime.") getValidatorUptime(validatorSet) } From bf8c61832d044482e46db813a5ff32430a1f4c6a Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 1 Dec 2020 18:05:35 +0000 Subject: [PATCH 021/127] get validator self delegation --- imports/api/blocks/server/methods.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 4b85e500b..8df6d96f7 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -549,8 +549,9 @@ Meteor.methods({ try{ console.log("Getting self delegation"); let response = HTTP.get(url); + // console.log(url) let selfDelegation = JSON.parse(response.content).result; - valData.self_delegation = (selfDelegation && selfDelegation.shares)?parseFloat(selfDelegation.shares)/parseFloat(valData.delegator_shares):0; + valData.self_delegation = (selfDelegation.delegation && selfDelegation.delegation.shares)?parseFloat(selfDelegation.delegation.shares)/parseFloat(valData.delegator_shares):0; } catch(e){ console.log("Getting self delegation: %o, \nurl: %o", e.response, url) From e7c852d71888cd7fc924d904a4ea6e5f1a3d05c6 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 1 Dec 2020 18:08:16 +0000 Subject: [PATCH 022/127] display validator list --- imports/ui/validators/ListContainer.js | 1 - 1 file changed, 1 deletion(-) diff --git a/imports/ui/validators/ListContainer.js b/imports/ui/validators/ListContainer.js index 85be3f6a4..3b9b6f510 100644 --- a/imports/ui/validators/ListContainer.js +++ b/imports/ui/validators/ListContainer.js @@ -26,7 +26,6 @@ export default ValidatorListContainer = withTracker((props) => { } else{ validatorsCond = { - jailed: false, status: 3 } } From 7835810964d48430506ed720bf4dda75770a76c2 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 1 Dec 2020 18:16:08 +0000 Subject: [PATCH 023/127] set uptime label to slashing window --- imports/ui/validators/Validator.jsx | 2 +- imports/ui/validators/ValidatorsList.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/ui/validators/Validator.jsx b/imports/ui/validators/Validator.jsx index a0ecf77bd..bd70cda76 100644 --- a/imports/ui/validators/Validator.jsx +++ b/imports/ui/validators/Validator.jsx @@ -210,7 +210,7 @@ export default class Validator extends Component{ - validators.lastNumBlocks + validators.lastNumBlocks {this.props.validator.uptime}% {this.state.records} diff --git a/imports/ui/validators/ValidatorsList.jsx b/imports/ui/validators/ValidatorsList.jsx index f0ebc45b2..2e565886f 100644 --- a/imports/ui/validators/ValidatorsList.jsx +++ b/imports/ui/validators/ValidatorsList.jsx @@ -105,7 +105,7 @@ export default class Validators extends Component{ this.toggleDir('votingPower',e)}>power common.votingPower {renderToggleIcon(this.state.votingPowerDir)} this.toggleDir('selfDel',e)}>equalizer validators.selfPercentage {renderToggleIcon(this.state.selfDelDir==1)} {(!this.props.inactive)? this.toggleDir('commission',e)}>call_split validators.commission {renderToggleIcon(this.state.commissionDir==1)}:''} - {(!this.props.inactive)? this.toggleDir('uptime',e)}>flash_on validators.uptime ({Meteor.settings.public.slashingWindow} ) {renderToggleIcon(this.state.uptimeDir==1)}:''} + {(!this.props.inactive)? this.toggleDir('uptime',e)}>flash_on validators.uptime ({Meteor.settings.public.slashingWindow} ) {renderToggleIcon(this.state.uptimeDir==1)}:''} {(this.props.inactive)? validators.lastSeen (UTC):''} {(this.props.inactive)? this.toggleDir('status',e)}>toggle_on validators.status {renderToggleIcon(this.state.statusDir)} :''} {(this.props.inactive)? this.toggleDir('jailed',e)}>lock validators.jailed {renderToggleIcon(this.state.jailedDir)} :''} From 7d3d2bf26515525e09df8857374e1ebbd70ca63b Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 20 Jan 2021 18:51:14 +0000 Subject: [PATCH 024/127] replace legecy api --- imports/api/accounts/server/methods.js | 26 +++++++++++----------- imports/api/blocks/server/methods.js | 12 +++++----- imports/api/chain/server/methods.js | 10 ++++----- imports/api/delegations/server/methods.js | 2 +- imports/api/proposals/server/methods.js | 12 +++++----- imports/api/transactions/server/methods.js | 2 +- imports/api/validators/server/methods.js | 2 +- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/imports/api/accounts/server/methods.js b/imports/api/accounts/server/methods.js index fcca23a3d..faa5ec7b1 100644 --- a/imports/api/accounts/server/methods.js +++ b/imports/api/accounts/server/methods.js @@ -16,7 +16,7 @@ const fetchFromUrl = (url) => { Meteor.methods({ 'accounts.getAccountDetail': function(address){ this.unblock(); - let url = LCD + '/auth/accounts/'+ address; + let url = LCD + '/cosmos/auth/v1beta1/accounts/'+ address; try{ let available = HTTP.get(url); if (available.statusCode == 200){ @@ -41,7 +41,7 @@ Meteor.methods({ let balance = {} // get available atoms - let url = LCD + '/bank/balances/'+ address; + let url = LCD + '/cosmos/bank/v1beta1/balances/'+ address; try{ let available = HTTP.get(url); if (available.statusCode == 200){ @@ -55,7 +55,7 @@ Meteor.methods({ } // get delegated amnounts - url = LCD + '/staking/delegators/'+address+'/delegations'; + url = LCD + '/cosmos/staking/v1beta1/delegators/'+address+'/delegations'; try{ let delegations = HTTP.get(url); if (delegations.statusCode == 200){ @@ -67,7 +67,7 @@ Meteor.methods({ console.log(e); } // get unbonding - url = LCD + '/staking/delegators/'+address+'/unbonding_delegations'; + url = LCD + '/cosmos/staking/v1beta1/delegators/'+address+'/unbonding_delegations'; try{ let unbonding = HTTP.get(url); if (unbonding.statusCode == 200){ @@ -80,7 +80,7 @@ Meteor.methods({ } // get rewards - url = LCD + '/distribution/delegators/'+address+'/rewards'; + url = LCD + '/cosmos/distribution/v1beta1/v1beta1/delegators/'+address+'/rewards'; try{ let rewards = HTTP.get(url); if (rewards.statusCode == 200){ @@ -100,7 +100,7 @@ Meteor.methods({ let validator = Validators.findOne( {$or: [{operator_address:address}, {delegator_address:address}, {address:address}]}) if (validator) { - let url = LCD + '/distribution/validators/' + validator.operator_address; + let url = LCD + '/cosmos/distribution/v1beta1/validators/' + validator.operator_address; balance.operator_address = validator.operator_address; try { let rewards = HTTP.get(url); @@ -122,13 +122,13 @@ Meteor.methods({ }, 'accounts.getDelegation'(address, validator){ this.unblock(); - let url = `/staking/delegators/${address}/delegations/${validator}`; + let url = `/cosmos/staking/v1beta1/delegators/${address}/delegations/${validator}`; let delegations = fetchFromUrl(url); delegations = delegations && delegations.data.result; if (delegations && delegations.shares) delegations.shares = parseFloat(delegations.shares); - url = `/staking/redelegations?delegator=${address}&validator_to=${validator}`; + url = `/cosmos/staking/v1beta1/delegators/${address}/redelegations?dst_validator_addr=${validator}`; let relegations = fetchFromUrl(url); relegations = relegations && relegations.data.result; let completionTime; @@ -142,7 +142,7 @@ Meteor.methods({ delegations.redelegationCompletionTime = completionTime; } - url = `/staking/delegators/${address}/unbonding_delegations/${validator}`; + url = `/cosmos/staking/v1beta1/delegators/${address}/unbonding_delegations/${validator}`; let undelegations = fetchFromUrl(url); undelegations = undelegations && undelegations.data.result; if (undelegations) { @@ -153,7 +153,7 @@ Meteor.methods({ }, 'accounts.getAllDelegations'(address){ this.unblock(); - let url = LCD + '/staking/delegators/'+address+'/delegations'; + let url = LCD + '/cosmos/staking/v1beta1/delegators/'+address+'/delegations'; try{ let delegations = HTTP.get(url); @@ -176,7 +176,7 @@ Meteor.methods({ }, 'accounts.getAllUnbondings'(address){ this.unblock(); - let url = LCD + '/staking/delegators/'+address+'/unbonding_delegations'; + let url = LCD + '/cosmos/staking/v1beta1/delegators/'+address+'/unbonding_delegations'; try{ let unbondings = HTTP.get(url); @@ -192,7 +192,7 @@ Meteor.methods({ }, 'accounts.getAllRedelegations'(address, validator){ this.unblock(); - let url = `/staking/redelegations?delegator=${address}&validator_from=${validator}`; + let url = `/cosmos/staking/v1beta1/v1beta1/delegators/${address}/redelegations&src_validator_addr=${validator}`; let result = fetchFromUrl(url); if (result && result.data) { let redelegations = {} @@ -208,7 +208,7 @@ Meteor.methods({ }, 'accounts.getRedelegations'(address) { this.unblock(); - let url = LCD + '/staking/redelegations?delegator=' + address; + let url = LCD + '/cosmos/staking/v1beta1/v1beta1/delegators/' + address +'/redelegations'; try { let userRedelegations = HTTP.get(url); diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 8df6d96f7..611de3cbc 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -65,7 +65,7 @@ getValidatorProfileUrl = (identity) => { getValidatorUptime = async (validatorSet) => { // get validator uptime - let url = LCD+'/slashing/parameters'; + let url = LCD+'/cosmos/slashing/v1beta1/params'; let response = HTTP.get(url); const slashingParams = JSON.parse(response.content).result; @@ -75,7 +75,7 @@ getValidatorUptime = async (validatorSet) => { for(let key in validatorSet){ try{ try { - let url = LCD+'/slashing/validators/'+validatorSet[key].bech32ConsensusPubKey+'/signing_info'; + let url = LCD+'/cosmos/slashing/v1beta1/signing_infos/'+validatorSet[key].bech32ConsensusPubKey; let response = HTTP.get(url); let signingInfo = JSON.parse(response.content).result; if (signingInfo){ @@ -214,7 +214,7 @@ Meteor.methods({ let validatorSet = {} // get latest validator candidate information - url = LCD+'/staking/validators'; + url = LCD+'/cosmos/staking/v1beta1/validators'; try{ response = HTTP.get(url); @@ -225,7 +225,7 @@ Meteor.methods({ console.log(e); } - url = LCD+'/staking/validators?status=unbonding'; + url = LCD+'/cosmos/staking/v1beta1/validators?status=unbonding'; try{ response = HTTP.get(url); @@ -236,7 +236,7 @@ Meteor.methods({ console.log(e); } - url = LCD+'/staking/validators?status=unbonded'; + url = LCD+'/cosmos/staking/v1beta1/validators?status=unbonded'; try{ response = HTTP.get(url); @@ -545,7 +545,7 @@ Meteor.methods({ // get self delegation every 30 blocks if (height == curr+1){ //if (height % 50 == 2){ - let url = LCD+`/staking/delegators/${valData.delegator_address}/delegations/${valData.operator_address}` + let url = LCD+`/cosmos/staking/v1beta1/delegators/${valData.delegator_address}/delegations/${valData.operator_address}` try{ console.log("Getting self delegation"); let response = HTTP.get(url); diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index fb991f513..a3cf63666 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -77,7 +77,7 @@ Meteor.methods({ chainStates.height = parseInt(status.sync_info.latest_block_height); chainStates.time = new Date(status.sync_info.latest_block_time); - url = LCD + '/staking/pool'; + url = LCD + '/cosmos/staking/v1beta1/pool'; try{ response = HTTP.get(url); let bonding = JSON.parse(response.content).result; @@ -93,7 +93,7 @@ Meteor.methods({ if ( Coin.StakingCoin.denom ) { if (Meteor.settings.public.modules.bank){ - url = LCD + '/bank/total/'+ Coin.StakingCoin.denom; + url = LCD + '/cosmos/bank/v1beta1/supply/'+ Coin.StakingCoin.denom; try{ response = HTTP.get(url); let supply = JSON.parse(response.content).result; @@ -106,7 +106,7 @@ Meteor.methods({ } if (Meteor.settings.public.modules.distribution){ - url = LCD + '/distribution/community_pool'; + url = LCD + '/cosmos/distribution/v1beta1/community_pool'; try { response = HTTP.get(url); let pool = JSON.parse(response.content).result; @@ -127,7 +127,7 @@ Meteor.methods({ } if (Meteor.settings.public.modules.minting){ - url = LCD + '/minting/inflation'; + url = LCD + '/cosmos/minting/v1beta1/inflation'; try{ response = HTTP.get(url); let inflation = JSON.parse(response.content).result; @@ -140,7 +140,7 @@ Meteor.methods({ console.log(e.response.content); } - url = LCD + '/minting/annual-provisions'; + url = LCD + '/cosmos/minting/v1beta1/annual_provisions'; try{ response = HTTP.get(url); let provisions = JSON.parse(response.content); diff --git a/imports/api/delegations/server/methods.js b/imports/api/delegations/server/methods.js index ee9141538..a6c4be3c6 100644 --- a/imports/api/delegations/server/methods.js +++ b/imports/api/delegations/server/methods.js @@ -10,7 +10,7 @@ Meteor.methods({ console.log("=== Getting delegations ==="); for (v in validators){ if (validators[v].operator_address){ - let url = LCD + '/staking/validators/'+validators[v].operator_address+"/delegations"; + let url = LCD + '/cosmos/staking/v1beta1/validators/'+validators[v].operator_address+"/delegations"; try{ let response = HTTP.get(url); if (response.statusCode == 200){ diff --git a/imports/api/proposals/server/methods.js b/imports/api/proposals/server/methods.js index 59132e88d..c3c5f8d46 100644 --- a/imports/api/proposals/server/methods.js +++ b/imports/api/proposals/server/methods.js @@ -8,7 +8,7 @@ Meteor.methods({ 'proposals.getProposals': function(){ this.unblock(); try{ - let url = LCD + '/gov/proposals'; + let url = LCD + '/cosmos/gov/v1beta1/proposals'; let response = HTTP.get(url); let proposals = JSON.parse(response.content).result; // console.log(proposals); @@ -26,7 +26,7 @@ Meteor.methods({ proposal.proposalId = parseInt(proposal.id); if (proposal.proposalId > 0 && !finishedProposalIds.has(proposal.proposalId)) { try{ - let url = LCD + '/gov/proposals/'+proposal.proposalId+'/proposer'; + let url = LCD + '/cosmos/gov/v1beta1/proposals/'+proposal.proposalId+'/proposer'; let response = HTTP.get(url); if (response.statusCode == 200){ let proposer = JSON.parse(response.content).result; @@ -63,7 +63,7 @@ Meteor.methods({ if (parseInt(proposals[i].proposalId) > 0){ try{ // get proposal deposits - let url = LCD + '/gov/proposals/'+proposals[i].proposalId+'/deposits'; + let url = LCD + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/deposits'; let response = HTTP.get(url); let proposal = {proposalId: proposals[i].proposalId}; if (response.statusCode == 200){ @@ -71,14 +71,14 @@ Meteor.methods({ proposal.deposits = deposits; } - url = LCD + '/gov/proposals/'+proposals[i].proposalId+'/votes'; + url = LCD + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/votes'; response = HTTP.get(url); if (response.statusCode == 200){ let votes = JSON.parse(response.content).result; proposal.votes = getVoteDetail(votes); } - url = LCD + '/gov/proposals/'+proposals[i].proposalId+'/tally'; + url = LCD + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/tally'; response = HTTP.get(url); if (response.statusCode == 200){ let tally = JSON.parse(response.content).result; @@ -119,7 +119,7 @@ const getVoteDetail = (votes) => { voters.forEach((voter) => { if (!votingPowerMap[voter]) { // voter is not a validator - let url = `${LCD}/staking/delegators/${voter}/delegations`; + let url = `${LCD}/cosmos/staking/v1beta1/delegators/${voter}/delegations`; let delegations; let votingPower = 0; try{ diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index aefb12583..78241a952 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -17,7 +17,7 @@ Meteor.methods({ const bulkTransactions = Transactions.rawCollection().initializeUnorderedBulkOp(); for (let i in transactions){ try { - let url = LCD+ '/txs/'+transactions[i].txhash; + let url = LCD+ '/cosmos/tx/v1beta1/txs/'+transactions[i].txhash; let response = HTTP.get(url); let tx = JSON.parse(response.content); diff --git a/imports/api/validators/server/methods.js b/imports/api/validators/server/methods.js index ad6df8d9f..8b6edafc9 100644 --- a/imports/api/validators/server/methods.js +++ b/imports/api/validators/server/methods.js @@ -26,7 +26,7 @@ Meteor.methods({ // async 'Validators.getAllDelegations'(address){ 'Validators.getAllDelegations'(address){ this.unblock(); - let url = LCD + '/staking/validators/'+address+'/delegations'; + let url = LCD + '/cosmos/staking/v1beta1/validators/'+address+'/delegations'; try{ let delegations = HTTP.get(url); From bc62ee0ac237221338f0a6733c4ce4ef8908344b Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Fri, 22 Jan 2021 10:03:04 +0000 Subject: [PATCH 025/127] add grpc and cosmos protobuf --- package-lock.json | 382 +++++++++++++++++++++++++++++++++++++++++----- package.json | 5 +- 2 files changed, 348 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 280f9c854..738907fe0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -191,6 +191,42 @@ "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" }, + "@forbole/cosmos-protobuf-js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@forbole/cosmos-protobuf-js/-/cosmos-protobuf-js-1.0.1.tgz", + "integrity": "sha512-LKSziG8JXklmBht1+gIkuENx6JTOtH7Qque1DlbzDFixyWPOEsWEaJdckp7WwTtDYIR3F4G2BSWjAoYflveVEQ==" + }, + "@grpc/grpc-js": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.2.4.tgz", + "integrity": "sha512-z+EI20HYHLd3/uERtwOqP8Q4EPhGbz5RKUpiyo6xPWfR3pcjpf8sfNvY9XytDQ4xo1wNz7NqH1kh2UBonwzbfg==", + "requires": { + "@types/node": "^12.12.47", + "google-auth-library": "^6.1.1", + "semver": "^6.2.0" + }, + "dependencies": { + "@types/node": { + "version": "12.19.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.15.tgz", + "integrity": "sha512-lowukE3GUI+VSYSu6VcBXl14d61Rp5hA1D+61r16qnwC0lYNSqdxcvRh0pswejorHfS+HgwBasM8jLXz0/aOsw==" + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, + "@grpc/proto-loader": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.6.tgz", + "integrity": "sha512-DT14xgw3PSzPxwS13auTEwxhMMOoz33DPUKNtmYK/QYbBSpLXJy78FGGs5yVoxVobEqPm4iW9MOIoz0A3bLTRQ==", + "requires": { + "lodash.camelcase": "^4.3.0", + "protobufjs": "^6.8.6" + } + }, "@ledgerhq/devices": { "version": "4.78.0", "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-4.78.0.tgz", @@ -285,6 +321,60 @@ } } }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, "@types/d3": { "version": "4.13.12", "resolved": "https://registry.npmjs.org/@types/d3/-/d3-4.13.12.tgz", @@ -529,6 +619,11 @@ "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.163.tgz", "integrity": "sha512-BeZM/FZaV53emqyHxn9L39Oz6XbHMBRLA1b1quROku48J/1kYYxPmVOJ/qSQheb81on4BI7H6QDo6bkUuRaDNQ==" }, + "@types/long": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", + "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" + }, "@types/meteor-universe-i18n": { "version": "1.14.5", "resolved": "https://registry.npmjs.org/@types/meteor-universe-i18n/-/meteor-universe-i18n-1.14.5.tgz", @@ -557,6 +652,14 @@ "csstype": "^3.0.2" } }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, "acorn": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", @@ -569,6 +672,29 @@ "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", "dev": true }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "ajv": { "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", @@ -865,6 +991,11 @@ } } }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" + }, "asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", @@ -1133,6 +1264,11 @@ "resolved": "https://registry.npmjs.org/base16/-/base16-1.0.0.tgz", "integrity": "sha1-4pf2DX7BAUp6lxo568ipjAtoHnA=" }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, "bech32": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", @@ -1175,9 +1311,9 @@ "integrity": "sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw==" }, "bootswatch": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/bootswatch/-/bootswatch-4.5.3.tgz", - "integrity": "sha512-gaB3gBSAegmYbk97aVELKcSKVdPjWsSY4yCITkUt/SqbqjtMU/HtIUszb4O9vzdbrfuVXThc/qCXzjoJaAPgiQ==" + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/bootswatch/-/bootswatch-4.6.0.tgz", + "integrity": "sha512-Yr6YqFBC8jwTzoJoLViYlvO97IhPWGqZEm+6FXHfD/G6gbUok6sZkdXxdh4Zb6iCGEwr9p7zGCn38yKQD/bh2Q==" }, "brace-expansion": { "version": "1.1.11", @@ -1207,6 +1343,11 @@ "safe-buffer": "^5.0.1" } }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", @@ -2108,6 +2249,14 @@ } } }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "elliptic": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", @@ -2127,24 +2276,6 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" }, - "encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "requires": { - "iconv-lite": "^0.6.2" - }, - "dependencies": { - "iconv-lite": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", - "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - } - } - }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -2658,6 +2789,11 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, "events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", @@ -2672,6 +2808,11 @@ "safe-buffer": "^5.1.1" } }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, "external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -2701,6 +2842,11 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fast-text-encoding": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", + "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig==" + }, "fbemitter": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/fbemitter/-/fbemitter-3.0.0.tgz", @@ -2914,6 +3060,27 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "gaxios": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.1.0.tgz", + "integrity": "sha512-vb0to8xzGnA2qcgywAjtshOKKVDf2eQhJoiL6fHhgW5tVN7wNk7egnYIO9zotfn3lQ3De1VPdf7V5/BWfCtCmg==", + "requires": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.3.0" + } + }, + "gcp-metadata": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.2.1.tgz", + "integrity": "sha512-tSk+REe5iq/N+K+SK1XjZJUrFPuDqGZVzCy2vocIHIGmPlTGsa8owXMJwGkrXr73NO0AzhPW4MF2DEHz7P2AVw==", + "requires": { + "gaxios": "^4.0.0", + "json-bigint": "^1.0.0" + } + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -2961,11 +3128,46 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, + "google-auth-library": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-6.1.4.tgz", + "integrity": "sha512-q0kYtGWnDd9XquwiQGAZeI2Jnglk7NDi0cChE4tWp6Kpo/kbqnt9scJb0HP+/xqt03Beqw/xQah1OPrci+pOxw==", + "requires": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^4.0.0", + "gcp-metadata": "^4.2.0", + "gtoken": "^5.0.4", + "jws": "^4.0.0", + "lru-cache": "^6.0.0" + } + }, + "google-p12-pem": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.0.3.tgz", + "integrity": "sha512-wS0ek4ZtFx/ACKYF3JhyGe5kzH7pgiQ7J5otlumqR9psmWMYc+U9cErKlCYVYHoUaidXHdZ2xbo34kB+S+24hA==", + "requires": { + "node-forge": "^0.10.0" + } + }, "graceful-fs": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" }, + "gtoken": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.2.0.tgz", + "integrity": "sha512-qbf6JWEYFMj3WMAluvYXl8GAiji6w8d9OmAGCbBg0xF4xD/yu6ZaO6BhoXNddRjKcOUpZD81iea1H5B45gAo1g==", + "requires": { + "gaxios": "^4.0.0", + "google-p12-pem": "^3.0.3", + "jws": "^4.0.0", + "mime": "^2.2.0" + } + }, "gud": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/gud/-/gud-1.0.0.tgz", @@ -3059,6 +3261,30 @@ "readable-stream": "^3.1.1" } }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "requires": { + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -3338,9 +3564,9 @@ } }, "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" }, "is-string": { "version": "1.0.5", @@ -3377,15 +3603,6 @@ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" }, - "isomorphic-fetch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", - "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", - "requires": { - "node-fetch": "^1.0.1", - "whatwg-fetch": ">=0.10.0" - } - }, "jquery": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", @@ -3416,6 +3633,21 @@ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" }, + "json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "requires": { + "bignumber.js": "^9.0.0" + }, + "dependencies": { + "bignumber.js": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==" + } + } + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -3493,6 +3725,25 @@ } } }, + "jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "requires": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, "language-subtag-registry": { "version": "0.3.21", "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.21.tgz", @@ -3606,6 +3857,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" + }, "lodash.curry": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.curry/-/lodash.curry-4.1.1.tgz", @@ -3616,6 +3872,11 @@ "resolved": "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz", "integrity": "sha1-h79AKSuM+D5OjOGjrkIJ4gBxZ1o=" }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -3624,6 +3885,14 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, "make-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", @@ -4252,6 +4521,11 @@ } } }, + "mime": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.0.tgz", + "integrity": "sha512-ft3WayFSFUVBuJj7BMLKAQcSlItKtfjsKDDsii3rqFDAZ7t11zRe8ASw/GlmivGwVUYtwkQrxiGGpL6gFvB0ag==" + }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", @@ -4348,6 +4622,11 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, + "node-forge": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -5125,6 +5404,33 @@ "react-is": "^16.8.1" } }, + "protobufjs": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", + "integrity": "sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": "^13.7.0", + "long": "^4.0.0" + }, + "dependencies": { + "@types/node": { + "version": "13.13.40", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.40.tgz", + "integrity": "sha512-eKaRo87lu1yAXrzEJl0zcJxfUMDT5/mZalFyOkT44rnQps41eS2pfWzbaulSPpQLFNy29bFqn+Y5lOTL8ATlEQ==" + } + } + }, "pump": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", @@ -6494,11 +6800,6 @@ } } }, - "whatwg-fetch": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.5.0.tgz", - "integrity": "sha512-jXkLtsR42xhXg7akoDKvKWE40eJeI+2KZqcp2h3NsOrRnDvtWX36KcKl30dy+hxECivdk2BVUHVNrPtoMBUx6A==" - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -6566,6 +6867,11 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "yargs": { "version": "14.2.3", "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", diff --git a/package.json b/package.json index 50a7a54b0..cd49a3e71 100644 --- a/package.json +++ b/package.json @@ -11,13 +11,16 @@ }, "dependencies": { "@babel/runtime": "^7.12.5", + "@forbole/cosmos-protobuf-js": "^1.0.1", + "@grpc/grpc-js": "^1.2.4", + "@grpc/proto-loader": "^0.5.6", "@ledgerhq/hw-transport-webusb": "^4.78.0", "@lunie/cosmos-js": "0.0.22", "@types/meteor-universe-i18n": "^1.14.5", "babel-polyfill": "^6.26.0", "bech32": "^1.1.4", "bootstrap": "^4.6.0", - "bootswatch": "^4.5.3", + "bootswatch": "^4.6.0", "chart.js": "^2.9.4", "cheerio": "^1.0.0-rc.5", "crypto-js": "^3.3.0", From a9e509d7422dd7dfdc6ab461a0433c44fe475286 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 23 Jan 2021 08:50:03 +0000 Subject: [PATCH 026/127] replace with imporable-eng grpc-web --- default_settings.json | 3 +-- imports/api/blocks/server/methods.js | 2 ++ package-lock.json | 13 +++++++++++++ package.json | 1 + server/main.js | 7 ++++++- 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/default_settings.json b/default_settings.json index a66e45b0b..8fa797a62 100644 --- a/default_settings.json +++ b/default_settings.json @@ -37,8 +37,7 @@ "coingeckoId": "cosmos" }, "remote":{ - "rpc":"https://gaia-seeds.interblock.io", - "lcd":"https://gaia-seeds.interblock.io:1317" + "grpc":"http://grpc.cosmoshub.forbole.com:80" }, "debug": { "startTimer": true diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 611de3cbc..122d2eecc 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -11,6 +11,8 @@ import { Evidences } from '../../evidences/evidences.js'; import { sha256 } from 'js-sha256'; import { getAddress } from 'tendermint/lib/pubkey'; import * as cheerio from 'cheerio'; +import * as cosmospb from '@forbole/cosmos-protobuf-js' +import unary from '../../../both/utils/unary' getRemovedValidators = (prevValidators, validators) => { // let removeValidators = []; diff --git a/package-lock.json b/package-lock.json index 738907fe0..a6510aec2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -227,6 +227,14 @@ "protobufjs": "^6.8.6" } }, + "@improbable-eng/grpc-web": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.13.0.tgz", + "integrity": "sha512-vaxxT+Qwb7GPqDQrBV4vAAfH0HywgOLw6xGIKXd9Q8hcV63CQhmS3p4+pZ9/wVvt4Ph3ZDK9fdC983b9aGMUFg==", + "requires": { + "browser-headers": "^0.4.0" + } + }, "@ledgerhq/devices": { "version": "4.78.0", "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-4.78.0.tgz", @@ -1330,6 +1338,11 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, + "browser-headers": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/browser-headers/-/browser-headers-0.4.1.tgz", + "integrity": "sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==" + }, "browserify-aes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", diff --git a/package.json b/package.json index cd49a3e71..eea50db71 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@forbole/cosmos-protobuf-js": "^1.0.1", "@grpc/grpc-js": "^1.2.4", "@grpc/proto-loader": "^0.5.6", + "@improbable-eng/grpc-web": "^0.13.0", "@ledgerhq/hw-transport-webusb": "^4.78.0", "@lunie/cosmos-js": "0.0.22", "@types/meteor-universe-i18n": "^1.14.5", diff --git a/server/main.js b/server/main.js index 23255b6ff..e09753185 100644 --- a/server/main.js +++ b/server/main.js @@ -232,4 +232,9 @@ Meteor.startup(function(){ } }, 1000) } -}); + + // const req = new proto.cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest() + // req.setHeight(10000) + // console.log("Get block height: %o", height) + // const res = await unary(AccessAPI.GetBlockByHeight, req) +}); \ No newline at end of file From 955554c7fa2c9b1a930b318dd85094fc6e8d3263 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 23 Jan 2021 08:58:08 +0000 Subject: [PATCH 027/127] update packages --- package-lock.json | 347 ++-------------------------------------------- package.json | 5 +- 2 files changed, 10 insertions(+), 342 deletions(-) diff --git a/package-lock.json b/package-lock.json index a6510aec2..17ba451d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -192,39 +192,12 @@ "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" }, "@forbole/cosmos-protobuf-js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@forbole/cosmos-protobuf-js/-/cosmos-protobuf-js-1.0.1.tgz", - "integrity": "sha512-LKSziG8JXklmBht1+gIkuENx6JTOtH7Qque1DlbzDFixyWPOEsWEaJdckp7WwTtDYIR3F4G2BSWjAoYflveVEQ==" - }, - "@grpc/grpc-js": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.2.4.tgz", - "integrity": "sha512-z+EI20HYHLd3/uERtwOqP8Q4EPhGbz5RKUpiyo6xPWfR3pcjpf8sfNvY9XytDQ4xo1wNz7NqH1kh2UBonwzbfg==", - "requires": { - "@types/node": "^12.12.47", - "google-auth-library": "^6.1.1", - "semver": "^6.2.0" - }, - "dependencies": { - "@types/node": { - "version": "12.19.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.15.tgz", - "integrity": "sha512-lowukE3GUI+VSYSu6VcBXl14d61Rp5hA1D+61r16qnwC0lYNSqdxcvRh0pswejorHfS+HgwBasM8jLXz0/aOsw==" - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - } - } - }, - "@grpc/proto-loader": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.6.tgz", - "integrity": "sha512-DT14xgw3PSzPxwS13auTEwxhMMOoz33DPUKNtmYK/QYbBSpLXJy78FGGs5yVoxVobEqPm4iW9MOIoz0A3bLTRQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@forbole/cosmos-protobuf-js/-/cosmos-protobuf-js-1.0.2.tgz", + "integrity": "sha512-jQmfeqnbbx7T8zksJynjMbv6mypaYwlKAG7BpURZ128iuiwN9KBCIzBycr4fz2b3/20Xjyz22BbrXbi8a63meg==", "requires": { - "lodash.camelcase": "^4.3.0", - "protobufjs": "^6.8.6" + "@improbable-eng/grpc-web": "^0.13.0", + "google-protobuf": "^3.14.0" } }, "@improbable-eng/grpc-web": { @@ -329,60 +302,6 @@ } } }, - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "requires": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, "@types/d3": { "version": "4.13.12", "resolved": "https://registry.npmjs.org/@types/d3/-/d3-4.13.12.tgz", @@ -627,11 +546,6 @@ "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.163.tgz", "integrity": "sha512-BeZM/FZaV53emqyHxn9L39Oz6XbHMBRLA1b1quROku48J/1kYYxPmVOJ/qSQheb81on4BI7H6QDo6bkUuRaDNQ==" }, - "@types/long": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", - "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" - }, "@types/meteor-universe-i18n": { "version": "1.14.5", "resolved": "https://registry.npmjs.org/@types/meteor-universe-i18n/-/meteor-universe-i18n-1.14.5.tgz", @@ -660,14 +574,6 @@ "csstype": "^3.0.2" } }, - "abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "requires": { - "event-target-shim": "^5.0.0" - } - }, "acorn": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", @@ -680,29 +586,6 @@ "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", "dev": true }, - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "requires": { - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, "ajv": { "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", @@ -999,11 +882,6 @@ } } }, - "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" - }, "asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", @@ -1272,11 +1150,6 @@ "resolved": "https://registry.npmjs.org/base16/-/base16-1.0.0.tgz", "integrity": "sha1-4pf2DX7BAUp6lxo568ipjAtoHnA=" }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, "bech32": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", @@ -1356,11 +1229,6 @@ "safe-buffer": "^5.0.1" } }, - "buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" - }, "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", @@ -2262,14 +2130,6 @@ } } }, - "ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, "elliptic": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", @@ -2802,11 +2662,6 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, - "event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" - }, "events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", @@ -2821,11 +2676,6 @@ "safe-buffer": "^5.1.1" } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, "external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -2855,11 +2705,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "fast-text-encoding": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", - "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig==" - }, "fbemitter": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/fbemitter/-/fbemitter-3.0.0.tgz", @@ -3073,27 +2918,6 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "gaxios": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.1.0.tgz", - "integrity": "sha512-vb0to8xzGnA2qcgywAjtshOKKVDf2eQhJoiL6fHhgW5tVN7wNk7egnYIO9zotfn3lQ3De1VPdf7V5/BWfCtCmg==", - "requires": { - "abort-controller": "^3.0.0", - "extend": "^3.0.2", - "https-proxy-agent": "^5.0.0", - "is-stream": "^2.0.0", - "node-fetch": "^2.3.0" - } - }, - "gcp-metadata": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.2.1.tgz", - "integrity": "sha512-tSk+REe5iq/N+K+SK1XjZJUrFPuDqGZVzCy2vocIHIGmPlTGsa8owXMJwGkrXr73NO0AzhPW4MF2DEHz7P2AVw==", - "requires": { - "gaxios": "^4.0.0", - "json-bigint": "^1.0.0" - } - }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -3141,46 +2965,16 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, - "google-auth-library": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-6.1.4.tgz", - "integrity": "sha512-q0kYtGWnDd9XquwiQGAZeI2Jnglk7NDi0cChE4tWp6Kpo/kbqnt9scJb0HP+/xqt03Beqw/xQah1OPrci+pOxw==", - "requires": { - "arrify": "^2.0.0", - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - "fast-text-encoding": "^1.0.0", - "gaxios": "^4.0.0", - "gcp-metadata": "^4.2.0", - "gtoken": "^5.0.4", - "jws": "^4.0.0", - "lru-cache": "^6.0.0" - } - }, - "google-p12-pem": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.0.3.tgz", - "integrity": "sha512-wS0ek4ZtFx/ACKYF3JhyGe5kzH7pgiQ7J5otlumqR9psmWMYc+U9cErKlCYVYHoUaidXHdZ2xbo34kB+S+24hA==", - "requires": { - "node-forge": "^0.10.0" - } + "google-protobuf": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.14.0.tgz", + "integrity": "sha512-bwa8dBuMpOxg7COyqkW6muQuvNnWgVN8TX/epDRGW5m0jcrmq2QJyCyiV8ZE2/6LaIIqJtiv9bYokFhfpy/o6w==" }, "graceful-fs": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" }, - "gtoken": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.2.0.tgz", - "integrity": "sha512-qbf6JWEYFMj3WMAluvYXl8GAiji6w8d9OmAGCbBg0xF4xD/yu6ZaO6BhoXNddRjKcOUpZD81iea1H5B45gAo1g==", - "requires": { - "gaxios": "^4.0.0", - "google-p12-pem": "^3.0.3", - "jws": "^4.0.0", - "mime": "^2.2.0" - } - }, "gud": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/gud/-/gud-1.0.0.tgz", @@ -3274,30 +3068,6 @@ "readable-stream": "^3.1.1" } }, - "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "requires": { - "agent-base": "6", - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -3576,11 +3346,6 @@ "has": "^1.0.1" } }, - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" - }, "is-string": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", @@ -3646,21 +3411,6 @@ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" }, - "json-bigint": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", - "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", - "requires": { - "bignumber.js": "^9.0.0" - }, - "dependencies": { - "bignumber.js": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", - "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==" - } - } - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -3738,25 +3488,6 @@ } } }, - "jwa": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", - "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", - "requires": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "jws": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", - "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", - "requires": { - "jwa": "^2.0.0", - "safe-buffer": "^5.0.1" - } - }, "language-subtag-registry": { "version": "0.3.21", "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.21.tgz", @@ -3870,11 +3601,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" - }, "lodash.curry": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.curry/-/lodash.curry-4.1.1.tgz", @@ -3885,11 +3611,6 @@ "resolved": "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz", "integrity": "sha1-h79AKSuM+D5OjOGjrkIJ4gBxZ1o=" }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -3898,14 +3619,6 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, "make-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", @@ -4534,11 +4247,6 @@ } } }, - "mime": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.0.tgz", - "integrity": "sha512-ft3WayFSFUVBuJj7BMLKAQcSlItKtfjsKDDsii3rqFDAZ7t11zRe8ASw/GlmivGwVUYtwkQrxiGGpL6gFvB0ag==" - }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", @@ -4635,11 +4343,6 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, - "node-forge": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", - "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" - }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -5417,33 +5120,6 @@ "react-is": "^16.8.1" } }, - "protobufjs": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", - "integrity": "sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": "^13.7.0", - "long": "^4.0.0" - }, - "dependencies": { - "@types/node": { - "version": "13.13.40", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.40.tgz", - "integrity": "sha512-eKaRo87lu1yAXrzEJl0zcJxfUMDT5/mZalFyOkT44rnQps41eS2pfWzbaulSPpQLFNy29bFqn+Y5lOTL8ATlEQ==" - } - } - }, "pump": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", @@ -6880,11 +6556,6 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "yargs": { "version": "14.2.3", "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", diff --git a/package.json b/package.json index eea50db71..8725f9144 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,7 @@ }, "dependencies": { "@babel/runtime": "^7.12.5", - "@forbole/cosmos-protobuf-js": "^1.0.1", - "@grpc/grpc-js": "^1.2.4", - "@grpc/proto-loader": "^0.5.6", - "@improbable-eng/grpc-web": "^0.13.0", + "@forbole/cosmos-protobuf-js": "^1.0.2", "@ledgerhq/hw-transport-webusb": "^4.78.0", "@lunie/cosmos-js": "0.0.22", "@types/meteor-universe-i18n": "^1.14.5", From a885880731c4ded4fafd9650aeb5ef009bfa38f1 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 24 Jan 2021 09:44:32 +0000 Subject: [PATCH 028/127] add grpc unary function --- both/utils/unary.js | 23 + imports/api/blocks/server/methods.js | 14 +- imports/api/chain/server/methods.js | 24 +- package-lock.json | 1735 +++++++++++++++++++++++++- package.json | 5 +- server/main.js | 5 - 6 files changed, 1794 insertions(+), 12 deletions(-) create mode 100644 both/utils/unary.js diff --git a/both/utils/unary.js b/both/utils/unary.js new file mode 100644 index 000000000..900b666b1 --- /dev/null +++ b/both/utils/unary.js @@ -0,0 +1,23 @@ +import {grpc} from "@improbable-eng/grpc-web" +import {NodeHttpTransport} from "@improbable-eng/grpc-web-node-http-transport" + +grpc.setDefaultTransport(NodeHttpTransport()) + +export async function unary(method, request) { + console.log("gRPC endpint: %o", Meteor.settings.remote.grpc) + console.log(method) + console.log(request) +return new Promise((resolve, reject) => { + grpc.unary(method, { + request: request, + host: Meteor.settings.remote.grpc, + onEnd: ({status, statusMessage, message}) => { + if (status === grpc.Code.OK) { + resolve(message.toObject()) + } else { + reject(new Error(statusMessage)) + } + }, + }) + }) +} \ No newline at end of file diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 122d2eecc..c3653bf2a 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -12,7 +12,7 @@ import { sha256 } from 'js-sha256'; import { getAddress } from 'tendermint/lib/pubkey'; import * as cheerio from 'cheerio'; import * as cosmospb from '@forbole/cosmos-protobuf-js' -import unary from '../../../both/utils/unary' +import unary from '../../../../both/utils/unary' getRemovedValidators = (prevValidators, validators) => { // let removeValidators = []; @@ -198,7 +198,7 @@ Meteor.methods({ } return startHeight }, - 'blocks.blocksUpdate': function() { + 'blocks.blocksUpdate': async function() { this.unblock(); if (SYNCING) return "Syncing..."; @@ -218,6 +218,15 @@ Meteor.methods({ // get latest validator candidate information url = LCD+'/cosmos/staking/v1beta1/validators'; + const req = new cosmospb.staking.query.QueryValidatorsRequest() + // req.setStatus("BONDED") + // console.log("Get validators: %o", height) + const res = await unary(cosmospb.staking.query.Validators, req) + + console.log("Get validators: %o", res); + + console.log("=========") + try{ response = HTTP.get(url); JSON.parse(response.content).result.forEach((validator) => validatorSet[validator.consensus_pubkey.value] = validator); @@ -229,6 +238,7 @@ Meteor.methods({ url = LCD+'/cosmos/staking/v1beta1/validators?status=unbonding'; + try{ response = HTTP.get(url); JSON.parse(response.content).result.forEach((validator) => validatorSet[validator.consensus_pubkey.value] = validator) diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index a3cf63666..3f4fb5996 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -2,6 +2,8 @@ import { Meteor } from 'meteor/meteor'; import { HTTP } from 'meteor/http'; import { Chain, ChainStates } from '../chain.js'; import Coin from '../../../../both/utils/coins.js'; +import cosmospb from '@forbole/cosmos-protobuf-js' +import { unary }from '../../../../both/utils/unary'; findVotingPower = (validator, genValidators) => { for (let v in genValidators){ @@ -39,7 +41,7 @@ Meteor.methods({ console.log(e); } }, - 'chain.updateStatus': function(){ + 'chain.updateStatus': async function(){ this.unblock(); let url = RPC+'/status'; try{ @@ -58,6 +60,14 @@ Meteor.methods({ // Since Tendermint v0.33, validator page default set to return 30 validators. // Query latest height with page 1 and 100 validators per page. + // const req = new cosmospb.base.tendermint.GetLatestValidatorSetRequest() + // // req.setStatus("BONDED") + // // console.log("Get validators: %o", height) + // console.log(req) + + // const res = await unary(cosmospb.base.tendermint.GetLatestValidatorSet, req) + // console.log("gRPC validator set: %o", res) + url = RPC+`/validators?page=1&per_page=100`; response = HTTP.get(url); let validators = JSON.parse(response.content); @@ -78,6 +88,18 @@ Meteor.methods({ chainStates.time = new Date(status.sync_info.latest_block_time); url = LCD + '/cosmos/staking/v1beta1/pool'; + + const req = new cosmospb.staking.query.QueryPoolRequest() + const res = await unary(cosmospb.staking.query.Query.Pool, req) + console.log(res) + // // req.setStatus("BONDED") + // // console.log("Get validators: %o", height) + // console.log(req) + + // const res = await unary(cosmospb.base.tendermint.GetLatestValidatorSet, req) + // console.log("gRPC validator set: %o", res) + + try{ response = HTTP.get(url); let bonding = JSON.parse(response.content).result; diff --git a/package-lock.json b/package-lock.json index 17ba451d3..cd1979295 100644 --- a/package-lock.json +++ b/package-lock.json @@ -192,12 +192,1736 @@ "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" }, "@forbole/cosmos-protobuf-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@forbole/cosmos-protobuf-js/-/cosmos-protobuf-js-1.0.2.tgz", - "integrity": "sha512-jQmfeqnbbx7T8zksJynjMbv6mypaYwlKAG7BpURZ128iuiwN9KBCIzBycr4fz2b3/20Xjyz22BbrXbi8a63meg==", + "version": "file:../../node_modules/cosmos-protobuf-js", "requires": { "@improbable-eng/grpc-web": "^0.13.0", + "eslint-plugin-unused-imports": "^1.0.1", "google-protobuf": "^3.14.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==" + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@eslint/eslintrc": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", + "integrity": "sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==", + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" + } + } + }, + "@improbable-eng/grpc-web": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.13.0.tgz", + "integrity": "sha512-vaxxT+Qwb7GPqDQrBV4vAAfH0HywgOLw6xGIKXd9Q8hcV63CQhmS3p4+pZ9/wVvt4Ph3ZDK9fdC983b9aGMUFg==", + "requires": { + "browser-headers": "^0.4.0" + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "requires": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==" + }, + "@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "requires": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + } + }, + "@types/json-schema": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==" + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=" + }, + "@typescript-eslint/eslint-plugin": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.14.0.tgz", + "integrity": "sha512-IJ5e2W7uFNfg4qh9eHkHRUCbgZ8VKtGwD07kannJvM5t/GU8P8+24NX8gi3Hf5jST5oWPY8kyV1s/WtfiZ4+Ww==", + "requires": { + "@typescript-eslint/experimental-utils": "4.14.0", + "@typescript-eslint/scope-manager": "4.14.0", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "lodash": "^4.17.15", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.14.0.tgz", + "integrity": "sha512-6i6eAoiPlXMKRbXzvoQD5Yn9L7k9ezzGRvzC/x1V3650rUk3c3AOjQyGYyF9BDxQQDK2ElmKOZRD0CbtdkMzQQ==", + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.14.0", + "@typescript-eslint/types": "4.14.0", + "@typescript-eslint/typescript-estree": "4.14.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.14.0.tgz", + "integrity": "sha512-sUDeuCjBU+ZF3Lzw0hphTyScmDDJ5QVkyE21pRoBo8iDl7WBtVFS+WDN3blY1CH3SBt7EmYCw6wfmJjF0l/uYg==", + "requires": { + "@typescript-eslint/scope-manager": "4.14.0", + "@typescript-eslint/types": "4.14.0", + "@typescript-eslint/typescript-estree": "4.14.0", + "debug": "^4.1.1" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.14.0.tgz", + "integrity": "sha512-/J+LlRMdbPh4RdL4hfP1eCwHN5bAhFAGOTsvE6SxsrM/47XQiPSgF5MDgLyp/i9kbZV9Lx80DW0OpPkzL+uf8Q==", + "requires": { + "@typescript-eslint/types": "4.14.0", + "@typescript-eslint/visitor-keys": "4.14.0" + } + }, + "@typescript-eslint/types": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.14.0.tgz", + "integrity": "sha512-VsQE4VvpldHrTFuVPY1ZnHn/Txw6cZGjL48e+iBxTi2ksa9DmebKjAeFmTVAYoSkTk7gjA7UqJ7pIsyifTsI4A==" + }, + "@typescript-eslint/typescript-estree": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.0.tgz", + "integrity": "sha512-wRjZ5qLao+bvS2F7pX4qi2oLcOONIB+ru8RGBieDptq/SudYwshveORwCVU4/yMAd4GK7Fsf8Uq1tjV838erag==", + "requires": { + "@typescript-eslint/types": "4.14.0", + "@typescript-eslint/visitor-keys": "4.14.0", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.0.tgz", + "integrity": "sha512-MeHHzUyRI50DuiPgV9+LxcM52FCJFYjJiWHtXlbyC27b80mfOwKeiKI+MHOTEpcpfmoPFm/vvQS88bYIx6PZTA==", + "requires": { + "@typescript-eslint/types": "4.14.0", + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==" + } + } + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==" + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-includes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.2.tgz", + "integrity": "sha512-w2GspexNQpx+PutG3QpT437/BenZBj0M/MZGn5mzv/MofYqo0xmRHzn4lFsoDlWJ+THYsGJmFlW68WlDFx7VRw==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "get-intrinsic": "^1.0.1", + "is-string": "^1.0.5" + } + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + }, + "array.prototype.flat": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", + "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "browser-headers": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/browser-headers/-/browser-headers-0.4.1.tgz", + "integrity": "sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "confusing-browser-globals": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz", + "integrity": "sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==" + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=" + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "requires": { + "path-type": "^4.0.0" + }, + "dependencies": { + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + } + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.18.0-next.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", + "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.1", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.3", + "string.prototype.trimstart": "^1.0.3" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "eslint": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.18.0.tgz", + "integrity": "sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.3.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^6.0.0", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.4", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "requires": { + "esutils": "^2.0.2" + } + }, + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==" + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" + } + } + }, + "eslint-config-airbnb-base": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz", + "integrity": "sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==", + "requires": { + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.2" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "eslint-plugin-import": { + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", + "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.4", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "eslint-plugin-unused-imports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-1.0.1.tgz", + "integrity": "sha512-AVDcgeoZZoBH/g5743nvWQK7/V7w2RMILHvogfBnYa1s47los7G2ysEweRx0yJ8pSVnITJvxTBkefQbJowTi3w==", + "requires": { + "@typescript-eslint/eslint-plugin": "^4.5.0", + "eslint": "^7.11.0", + "eslint-rule-composer": "^0.3.0", + "requireindex": "~1.2.0", + "typescript": "^4.0.3" + } + }, + "eslint-rule-composer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", + "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==" + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "dependencies": { + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + } + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" + } + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" + } + } + }, + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + }, + "fastq": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.0.tgz", + "integrity": "sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA==", + "requires": { + "reusify": "^1.0.4" + } + }, + "file-entry-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz", + "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==", + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "requires": { + "locate-path": "^2.0.0" + } + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "get-intrinsic": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz", + "integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "requires": { + "type-fest": "^0.8.1" + } + }, + "globby": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", + "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "dependencies": { + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" + } + } + }, + "google-protobuf": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.14.0.tgz", + "integrity": "sha512-bwa8dBuMpOxg7COyqkW6muQuvNnWgVN8TX/epDRGW5m0jcrmq2QJyCyiV8ZE2/6LaIIqJtiv9bYokFhfpy/o6w==" + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==" + }, + "is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "requires": { + "has": "^1.0.3" + } + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==" + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==" + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "requires": { + "minimist": "^1.2.0" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "object-inspect": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.entries": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.3.tgz", + "integrity": "sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "has": "^1.0.3" + } + }, + "object.values": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.2.tgz", + "integrity": "sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "has": "^1.0.3" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "requires": { + "pify": "^2.0.0" + } + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "requires": { + "find-up": "^2.1.0" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==" + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, + "requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==" + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "requires": { + "glob": "^7.1.3" + } + }, + "run-parallel": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==" + }, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + } + } + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", + "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", + "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "string.prototype.trimstart": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz", + "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "table": { + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", + "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", + "requires": { + "ajv": "^7.0.2", + "lodash": "^4.17.20", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0" + }, + "dependencies": { + "ajv": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.3.tgz", + "integrity": "sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "tsutils": { + "version": "3.19.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.19.1.tgz", + "integrity": "sha512-GEdoBf5XI324lu7ycad7s6laADfnAqCw6wLGI+knxvw9vsIYBaJfYdmeCEG3FMMUiSm3OGgNb+m6utsWf5h9Vw==", + "requires": { + "tslib": "^1.8.1" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" + }, + "typescript": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", + "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==" + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==" + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } } }, "@improbable-eng/grpc-web": { @@ -208,6 +1932,11 @@ "browser-headers": "^0.4.0" } }, + "@improbable-eng/grpc-web-node-http-transport": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web-node-http-transport/-/grpc-web-node-http-transport-0.13.0.tgz", + "integrity": "sha512-Ev8pfMs7FbsBWc4FAY8N4dd8xQRowHFyu2AzEHl++8orrB4KSx6NonMqlsLDPBHLKwlYs7EEI6uxGwpjnYiS2Q==" + }, "@ledgerhq/devices": { "version": "4.78.0", "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-4.78.0.tgz", diff --git a/package.json b/package.json index 8725f9144..df2c1e8ec 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,9 @@ }, "dependencies": { "@babel/runtime": "^7.12.5", - "@forbole/cosmos-protobuf-js": "^1.0.2", + "@forbole/cosmos-protobuf-js": "file:../../node_modules/cosmos-protobuf-js", + "@improbable-eng/grpc-web": "^0.13.0", + "@improbable-eng/grpc-web-node-http-transport": "^0.13.0", "@ledgerhq/hw-transport-webusb": "^4.78.0", "@lunie/cosmos-js": "0.0.22", "@types/meteor-universe-i18n": "^1.14.5", @@ -24,6 +26,7 @@ "crypto-js": "^3.3.0", "d3": "^5.16.0", "fibers": "^4.0.3", + "google-protobuf": "^3.14.0", "jquery": "^3.5.1", "js-sha256": "^0.9.0", "ledger-cosmos-js": "^2.1.8", diff --git a/server/main.js b/server/main.js index e09753185..987fd260a 100644 --- a/server/main.js +++ b/server/main.js @@ -232,9 +232,4 @@ Meteor.startup(function(){ } }, 1000) } - - // const req = new proto.cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest() - // req.setHeight(10000) - // console.log("Get block height: %o", height) - // const res = await unary(AccessAPI.GetBlockByHeight, req) }); \ No newline at end of file From 52d3f27c0d182c94cd45b6f4613c9338d767b7f5 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 25 Jan 2021 17:22:21 +0000 Subject: [PATCH 029/127] update chain status request with grpc --- both/utils/time.js | 4 + both/utils/unary.js | 23 - imports/api/chain/server/methods.js | 105 +- package-lock.json | 3164 ++++++++++----------------- package.json | 2 +- server/main.js | 6 +- 6 files changed, 1195 insertions(+), 2109 deletions(-) create mode 100644 both/utils/time.js delete mode 100644 both/utils/unary.js diff --git a/both/utils/time.js b/both/utils/time.js new file mode 100644 index 000000000..9c92ad558 --- /dev/null +++ b/both/utils/time.js @@ -0,0 +1,4 @@ +export const goTimeToISOString = (time) => { + const millisecond = parseInt(time.seconds+time.nanos.toString().substring(0,3)); + return (new Date(millisecond)).toISOString() +} \ No newline at end of file diff --git a/both/utils/unary.js b/both/utils/unary.js deleted file mode 100644 index 900b666b1..000000000 --- a/both/utils/unary.js +++ /dev/null @@ -1,23 +0,0 @@ -import {grpc} from "@improbable-eng/grpc-web" -import {NodeHttpTransport} from "@improbable-eng/grpc-web-node-http-transport" - -grpc.setDefaultTransport(NodeHttpTransport()) - -export async function unary(method, request) { - console.log("gRPC endpint: %o", Meteor.settings.remote.grpc) - console.log(method) - console.log(request) -return new Promise((resolve, reject) => { - grpc.unary(method, { - request: request, - host: Meteor.settings.remote.grpc, - onEnd: ({status, statusMessage, message}) => { - if (status === grpc.Code.OK) { - resolve(message.toObject()) - } else { - reject(new Error(statusMessage)) - } - }, - }) - }) -} \ No newline at end of file diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index 3f4fb5996..782fb6e38 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -2,8 +2,8 @@ import { Meteor } from 'meteor/meteor'; import { HTTP } from 'meteor/http'; import { Chain, ChainStates } from '../chain.js'; import Coin from '../../../../both/utils/coins.js'; -import cosmospb from '@forbole/cosmos-protobuf-js' -import { unary }from '../../../../both/utils/unary'; +import { goTimeToISOString } from '../../../../both/utils/time'; +import { Cosmos } from '@forbole/cosmos-protobuf-js' findVotingPower = (validator, genValidators) => { for (let v in genValidators){ @@ -43,16 +43,14 @@ Meteor.methods({ }, 'chain.updateStatus': async function(){ this.unblock(); - let url = RPC+'/status'; try{ - let response = HTTP.get(url); - let status = JSON.parse(response.content); - status = status.result; + let req = new Cosmos.Base.Tendermint.GetLatestBlockRequest(); + let latestBlock = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetLatestBlock, req, GRPC); + // console.log(JSON.stringify(latestBlock)); let chain = {}; - chain.chainId = status.node_info.network; - chain.latestBlockHeight = status.sync_info.latest_block_height; - chain.latestBlockTime = status.sync_info.latest_block_time; - + chain.chainId = latestBlock.block.header.chainId; + chain.latestBlockHeight = latestBlock.block.header.height; + chain.latestBlockTime = goTimeToISOString(latestBlock.block.header.time) let latestState = ChainStates.findOne({}, {sort: {height: -1}}) if (latestState && latestState.height >= chain.latestBlockHeight) { return `no updates (getting block ${chain.latestBlockHeight} at block ${latestState.height})` @@ -60,22 +58,15 @@ Meteor.methods({ // Since Tendermint v0.33, validator page default set to return 30 validators. // Query latest height with page 1 and 100 validators per page. - // const req = new cosmospb.base.tendermint.GetLatestValidatorSetRequest() - // // req.setStatus("BONDED") - // // console.log("Get validators: %o", height) - // console.log(req) + req = new Cosmos.Base.Tendermint.GetLatestValidatorSetRequest() + let validators = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetLatestValidatorSet, req, GRPC) + // console.log(validators) - // const res = await unary(cosmospb.base.tendermint.GetLatestValidatorSet, req) - // console.log("gRPC validator set: %o", res) - - url = RPC+`/validators?page=1&per_page=100`; - response = HTTP.get(url); - let validators = JSON.parse(response.content); - validators = validators.result.validators; + validators = validators.validatorsList; chain.validators = validators.length; let activeVP = 0; for (v in validators){ - activeVP += parseInt(validators[v].voting_power); + activeVP += parseInt(validators[v].votingPower); } chain.activeVotingPower = activeVP; @@ -84,54 +75,37 @@ Meteor.methods({ // Get chain states if (parseInt(chain.latestBlockHeight) > 0){ let chainStates = {}; - chainStates.height = parseInt(status.sync_info.latest_block_height); - chainStates.time = new Date(status.sync_info.latest_block_time); - - url = LCD + '/cosmos/staking/v1beta1/pool'; - - const req = new cosmospb.staking.query.QueryPoolRequest() - const res = await unary(cosmospb.staking.query.Query.Pool, req) - console.log(res) - // // req.setStatus("BONDED") - // // console.log("Get validators: %o", height) - // console.log(req) - - // const res = await unary(cosmospb.base.tendermint.GetLatestValidatorSet, req) - // console.log("gRPC validator set: %o", res) - + chainStates.height = parseInt(chain.latestBlockHeight); + chainStates.time = new Date(chain.latestBlockTime); try{ - response = HTTP.get(url); - let bonding = JSON.parse(response.content).result; - // chain.bondedTokens = bonding.bonded_tokens; - // chain.notBondedTokens = bonding.not_bonded_tokens; - chainStates.bondedTokens = parseInt(bonding.bonded_tokens); - chainStates.notBondedTokens = parseInt(bonding.not_bonded_tokens); + req = new Cosmos.Staking.QueryPoolRequest(); + let bonding = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Pool, req, GRPC); + chainStates.bondedTokens = parseInt(bonding.pool.bondedTokens); + chainStates.notBondedTokens = parseInt(bonding.pool.notBondedTokens); } catch(e){ - console.log(url); console.log(e); } if ( Coin.StakingCoin.denom ) { if (Meteor.settings.public.modules.bank){ - url = LCD + '/cosmos/bank/v1beta1/supply/'+ Coin.StakingCoin.denom; try{ - response = HTTP.get(url); - let supply = JSON.parse(response.content).result; - chainStates.totalSupply = parseInt(supply.amount); + req = new Cosmos.Bank.QuerySupplyOfRequest(); + req.setDenom(Coin.StakingCoin.denom); + let supply = await Cosmos.gRPC.unary(Cosmos.Bank.Query.SupplyOf, req, GRPC); + chainStates.totalSupply = parseInt(supply.amount.amount); } catch(e){ - console.log(url); console.log(e); } } if (Meteor.settings.public.modules.distribution){ - url = LCD + '/cosmos/distribution/v1beta1/community_pool'; try { - response = HTTP.get(url); - let pool = JSON.parse(response.content).result; + req = new Cosmos.Distribution.QueryCommunityPoolRequest(); + let pool = await Cosmos.gRPC.unary(Cosmos.Distribution.Query.CommunityPool, req, GRPC); + pool = pool.poolList; if (pool && pool.length > 0){ chainStates.communityPool = []; pool.forEach((amount) => { @@ -143,36 +117,37 @@ Meteor.methods({ } } catch (e){ - console.log(url); - console.log(e.response.content) + console.log(e) } } if (Meteor.settings.public.modules.minting){ - url = LCD + '/cosmos/minting/v1beta1/inflation'; + // url = LCD + '/cosmos/minting/v1beta1/inflation'; try{ - response = HTTP.get(url); - let inflation = JSON.parse(response.content).result; + req = new Cosmos.Mint.QueryInflationRequest() + let inflation = await Cosmos.gRPC.unary(Cosmos.Mint.Query.Inflation, req, GRPC); + console.log(inflation); + // response = HTTP.get(url); + // let inflation = JSON.parse(response.content).result; if (inflation){ chainStates.inflation = parseFloat(inflation) } } catch(e){ - console.log(url); - console.log(e.response.content); + console.log(e); } - url = LCD + '/cosmos/minting/v1beta1/annual_provisions'; + // url = LCD + '/cosmos/minting/v1beta1/annual_provisions'; try{ - response = HTTP.get(url); - let provisions = JSON.parse(response.content); + req = new Cosmos.Mint.QueryAnnualProvisionsRequest(); + let provisions = await Cosmos.gRPC.unary(Cosmos.Mint.Query.AnnualProvisions, req, GRPC) + console.log(provisions) if (provisions){ - chainStates.annualProvisions = parseFloat(provisions.result) + chainStates.annualProvisions = parseFloat(provisions) } } catch(e){ - console.log(url); - console.log(e.response.content); + console.log(e); } } } diff --git a/package-lock.json b/package-lock.json index cd1979295..920554448 100644 --- a/package-lock.json +++ b/package-lock.json @@ -191,232 +191,23 @@ "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" }, - "@forbole/cosmos-protobuf-js": { - "version": "file:../../node_modules/cosmos-protobuf-js", + "@eslint/eslintrc": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", + "integrity": "sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==", "requires": { - "@improbable-eng/grpc-web": "^0.13.0", - "eslint-plugin-unused-imports": "^1.0.1", - "google-protobuf": "^3.14.0" + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" }, "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==" - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@eslint/eslintrc": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", - "integrity": "sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==", - "requires": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "lodash": "^4.17.20", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "dependencies": { - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" - } - } - }, - "@improbable-eng/grpc-web": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.13.0.tgz", - "integrity": "sha512-vaxxT+Qwb7GPqDQrBV4vAAfH0HywgOLw6xGIKXd9Q8hcV63CQhmS3p4+pZ9/wVvt4Ph3ZDK9fdC983b9aGMUFg==", - "requires": { - "browser-headers": "^0.4.0" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", - "requires": { - "@nodelib/fs.stat": "2.0.4", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==" - }, - "@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", - "requires": { - "@nodelib/fs.scandir": "2.1.4", - "fastq": "^1.6.0" - } - }, - "@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==" - }, - "@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=" - }, - "@typescript-eslint/eslint-plugin": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.14.0.tgz", - "integrity": "sha512-IJ5e2W7uFNfg4qh9eHkHRUCbgZ8VKtGwD07kannJvM5t/GU8P8+24NX8gi3Hf5jST5oWPY8kyV1s/WtfiZ4+Ww==", - "requires": { - "@typescript-eslint/experimental-utils": "4.14.0", - "@typescript-eslint/scope-manager": "4.14.0", - "debug": "^4.1.1", - "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.15", - "regexpp": "^3.0.0", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "@typescript-eslint/experimental-utils": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.14.0.tgz", - "integrity": "sha512-6i6eAoiPlXMKRbXzvoQD5Yn9L7k9ezzGRvzC/x1V3650rUk3c3AOjQyGYyF9BDxQQDK2ElmKOZRD0CbtdkMzQQ==", - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.14.0", - "@typescript-eslint/types": "4.14.0", - "@typescript-eslint/typescript-estree": "4.14.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, - "@typescript-eslint/parser": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.14.0.tgz", - "integrity": "sha512-sUDeuCjBU+ZF3Lzw0hphTyScmDDJ5QVkyE21pRoBo8iDl7WBtVFS+WDN3blY1CH3SBt7EmYCw6wfmJjF0l/uYg==", - "requires": { - "@typescript-eslint/scope-manager": "4.14.0", - "@typescript-eslint/types": "4.14.0", - "@typescript-eslint/typescript-estree": "4.14.0", - "debug": "^4.1.1" - } - }, - "@typescript-eslint/scope-manager": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.14.0.tgz", - "integrity": "sha512-/J+LlRMdbPh4RdL4hfP1eCwHN5bAhFAGOTsvE6SxsrM/47XQiPSgF5MDgLyp/i9kbZV9Lx80DW0OpPkzL+uf8Q==", - "requires": { - "@typescript-eslint/types": "4.14.0", - "@typescript-eslint/visitor-keys": "4.14.0" - } - }, - "@typescript-eslint/types": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.14.0.tgz", - "integrity": "sha512-VsQE4VvpldHrTFuVPY1ZnHn/Txw6cZGjL48e+iBxTi2ksa9DmebKjAeFmTVAYoSkTk7gjA7UqJ7pIsyifTsI4A==" - }, - "@typescript-eslint/typescript-estree": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.0.tgz", - "integrity": "sha512-wRjZ5qLao+bvS2F7pX4qi2oLcOONIB+ru8RGBieDptq/SudYwshveORwCVU4/yMAd4GK7Fsf8Uq1tjV838erag==", - "requires": { - "@typescript-eslint/types": "4.14.0", - "@typescript-eslint/visitor-keys": "4.14.0", - "debug": "^4.1.1", - "globby": "^11.0.1", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.0.tgz", - "integrity": "sha512-MeHHzUyRI50DuiPgV9+LxcM52FCJFYjJiWHtXlbyC27b80mfOwKeiKI+MHOTEpcpfmoPFm/vvQS88bYIx6PZTA==", - "requires": { - "@typescript-eslint/types": "4.14.0", - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==" - } - } - }, "acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -438,188 +229,6 @@ "uri-js": "^4.2.2" } }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" - }, - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "array-includes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.2.tgz", - "integrity": "sha512-w2GspexNQpx+PutG3QpT437/BenZBj0M/MZGn5mzv/MofYqo0xmRHzn4lFsoDlWJ+THYsGJmFlW68WlDFx7VRw==", - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1", - "get-intrinsic": "^1.0.1", - "is-string": "^1.0.5" - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" - }, - "array.prototype.flat": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", - "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" - } - }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, - "browser-headers": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/browser-headers/-/browser-headers-0.4.1.tgz", - "integrity": "sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==" - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "confusing-browser-globals": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz", - "integrity": "sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==" - }, - "contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=" - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, "debug": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", @@ -628,1302 +237,66 @@ "ms": "2.1.2" } }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "^1.0.12" - } - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "requires": { - "path-type": "^4.0.0" - }, - "dependencies": { - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" - } - } - }, - "doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", - "requires": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "requires": { - "ansi-colors": "^4.1.1" + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" } }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { - "is-arrayish": "^0.2.1" - } + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, - "es-abstract": { - "version": "1.18.0-next.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", - "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "requires": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.1", - "object-inspect": "^1.9.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.3", - "string.prototype.trimstart": "^1.0.3" + "type-fest": "^0.8.1" } }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" } }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, - "eslint": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.18.0.tgz", - "integrity": "sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ==", - "requires": { - "@babel/code-frame": "^7.0.0", - "@eslint/eslintrc": "^0.3.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.2.0", - "esutils": "^2.0.2", - "file-entry-cache": "^6.0.0", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash": "^4.17.20", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.4", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "requires": { - "esutils": "^2.0.2" - } - }, - "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==" - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" - } - } - }, - "eslint-config-airbnb-base": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz", - "integrity": "sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==", - "requires": { - "confusing-browser-globals": "^1.0.10", - "object.assign": "^4.1.2", - "object.entries": "^1.1.2" - } - }, - "eslint-import-resolver-node": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", - "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", - "requires": { - "debug": "^2.6.9", - "resolve": "^1.13.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, - "eslint-module-utils": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", - "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", - "requires": { - "debug": "^2.6.9", - "pkg-dir": "^2.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, - "eslint-plugin-import": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", - "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", - "requires": { - "array-includes": "^3.1.1", - "array.prototype.flat": "^1.2.3", - "contains-path": "^0.1.0", - "debug": "^2.6.9", - "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.4", - "eslint-module-utils": "^2.6.0", - "has": "^1.0.3", - "minimatch": "^3.0.4", - "object.values": "^1.1.1", - "read-pkg-up": "^2.0.0", - "resolve": "^1.17.0", - "tsconfig-paths": "^3.9.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, - "eslint-plugin-unused-imports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-1.0.1.tgz", - "integrity": "sha512-AVDcgeoZZoBH/g5743nvWQK7/V7w2RMILHvogfBnYa1s47los7G2ysEweRx0yJ8pSVnITJvxTBkefQbJowTi3w==", - "requires": { - "@typescript-eslint/eslint-plugin": "^4.5.0", - "eslint": "^7.11.0", - "eslint-rule-composer": "^0.3.0", - "requireindex": "~1.2.0", - "typescript": "^4.0.3" - } - }, - "eslint-rule-composer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", - "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==" - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "dependencies": { - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" - } - } - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" - } - } - }, - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" - }, - "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" - }, - "esquery": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", - "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" - } - } - }, - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "fast-glob": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", - "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" - }, - "fastq": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.0.tgz", - "integrity": "sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA==", - "requires": { - "reusify": "^1.0.4" - } - }, - "file-entry-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz", - "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==", - "requires": { - "flat-cache": "^3.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "requires": { - "locate-path": "^2.0.0" - } - }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" - }, - "get-intrinsic": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz", - "integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==", - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - } - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "requires": { - "is-glob": "^4.0.1" - } - }, - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "requires": { - "type-fest": "^0.8.1" - } - }, - "globby": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", - "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - }, - "dependencies": { - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" - } - } - }, - "google-protobuf": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.14.0.tgz", - "integrity": "sha512-bwa8dBuMpOxg7COyqkW6muQuvNnWgVN8TX/epDRGW5m0jcrmq2QJyCyiV8ZE2/6LaIIqJtiv9bYokFhfpy/o6w==" - }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" - }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" - }, - "is-callable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", - "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==" - }, - "is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", - "requires": { - "has": "^1.0.3" - } - }, - "is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-negative-zero": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==" - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, - "is-regex": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", - "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", - "requires": { - "has-symbols": "^1.0.1" - } - }, - "is-string": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", - "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==" - }, - "is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", - "requires": { - "has-symbols": "^1.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" - }, - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "requires": { - "minimist": "^1.2.0" - } - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" - } - } - }, - "object-inspect": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", - "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==" - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - }, - "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - } - }, - "object.entries": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.3.tgz", - "integrity": "sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg==", - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1", - "has": "^1.0.3" - } - }, - "object.values": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.2.tgz", - "integrity": "sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag==", - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1", - "has": "^1.0.3" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "requires": { - "callsites": "^3.0.0" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "requires": { - "error-ex": "^1.2.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" - }, - "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "requires": { - "pify": "^2.0.0" - } - }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "requires": { - "find-up": "^2.1.0" - } - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "requires": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - } - }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" - } - }, - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==" - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" - }, - "requireindex": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", - "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==" - }, - "resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", - "requires": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" - } - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "run-parallel": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", - "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==" - }, - "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - } - } - }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", - "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==" - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "string.prototype.trimend": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", - "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - } - }, - "string.prototype.trimstart": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz", - "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==", - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - }, - "table": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", - "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", - "requires": { - "ajv": "^7.0.2", - "lodash": "^4.17.20", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" - }, - "dependencies": { - "ajv": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.3.tgz", - "integrity": "sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - } - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - }, - "tsconfig-paths": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", - "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", - "requires": { - "@types/json5": "^0.0.29", - "json5": "^1.0.1", - "minimist": "^1.2.0", - "strip-bom": "^3.0.0" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "tsutils": { - "version": "3.19.1", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.19.1.tgz", - "integrity": "sha512-GEdoBf5XI324lu7ycad7s6laADfnAqCw6wLGI+knxvw9vsIYBaJfYdmeCEG3FMMUiSm3OGgNb+m6utsWf5h9Vw==", - "requires": { - "tslib": "^1.8.1" - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" - }, - "typescript": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", - "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==" - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "requires": { - "punycode": "^2.1.0" - } - }, - "v8-compile-cache": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", - "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==" - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "requires": { - "isexe": "^2.0.0" - } - }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } } }, + "@forbole/cosmos-protobuf-js": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@forbole/cosmos-protobuf-js/-/cosmos-protobuf-js-1.0.4.tgz", + "integrity": "sha512-L2TAakbFAzfV2A+qHfsqGmlaOtHW/9e1z2C1naoV6M1TrZsGEncbgbQgE9tDgY/9sJhbRqJHXerBPgB3bzoa8w==", + "requires": { + "@improbable-eng/grpc-web": "^0.13.0", + "@improbable-eng/grpc-web-node-http-transport": "^0.13.0", + "eslint-plugin-unused-imports": "^1.0.1", + "google-protobuf": "^3.14.0" + } + }, "@improbable-eng/grpc-web": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.13.0.tgz", @@ -2007,6 +380,29 @@ "integrity": "sha1-iMFN+7Si+iJY//SInM2N3Q7MsEs=", "dev": true }, + "@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "requires": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==" + }, + "@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "requires": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + } + }, "@popmotion/easing": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@popmotion/easing/-/easing-1.0.2.tgz", @@ -2264,6 +660,11 @@ "resolved": "https://registry.npmjs.org/@types/is-plain-object/-/is-plain-object-0.0.2.tgz", "integrity": "sha1-Jbyntla6I/sDeZoGDbogGnlSED0=" }, + "@types/json-schema": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==" + }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -2303,6 +704,145 @@ "csstype": "^3.0.2" } }, + "@typescript-eslint/eslint-plugin": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.14.0.tgz", + "integrity": "sha512-IJ5e2W7uFNfg4qh9eHkHRUCbgZ8VKtGwD07kannJvM5t/GU8P8+24NX8gi3Hf5jST5oWPY8kyV1s/WtfiZ4+Ww==", + "requires": { + "@typescript-eslint/experimental-utils": "4.14.0", + "@typescript-eslint/scope-manager": "4.14.0", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "lodash": "^4.17.15", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==" + }, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.14.0.tgz", + "integrity": "sha512-6i6eAoiPlXMKRbXzvoQD5Yn9L7k9ezzGRvzC/x1V3650rUk3c3AOjQyGYyF9BDxQQDK2ElmKOZRD0CbtdkMzQQ==", + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.14.0", + "@typescript-eslint/types": "4.14.0", + "@typescript-eslint/typescript-estree": "4.14.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" + } + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.14.0.tgz", + "integrity": "sha512-/J+LlRMdbPh4RdL4hfP1eCwHN5bAhFAGOTsvE6SxsrM/47XQiPSgF5MDgLyp/i9kbZV9Lx80DW0OpPkzL+uf8Q==", + "requires": { + "@typescript-eslint/types": "4.14.0", + "@typescript-eslint/visitor-keys": "4.14.0" + } + }, + "@typescript-eslint/types": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.14.0.tgz", + "integrity": "sha512-VsQE4VvpldHrTFuVPY1ZnHn/Txw6cZGjL48e+iBxTi2ksa9DmebKjAeFmTVAYoSkTk7gjA7UqJ7pIsyifTsI4A==" + }, + "@typescript-eslint/typescript-estree": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.0.tgz", + "integrity": "sha512-wRjZ5qLao+bvS2F7pX4qi2oLcOONIB+ru8RGBieDptq/SudYwshveORwCVU4/yMAd4GK7Fsf8Uq1tjV838erag==", + "requires": { + "@typescript-eslint/types": "4.14.0", + "@typescript-eslint/visitor-keys": "4.14.0", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.0.tgz", + "integrity": "sha512-MeHHzUyRI50DuiPgV9+LxcM52FCJFYjJiWHtXlbyC27b80mfOwKeiKI+MHOTEpcpfmoPFm/vvQS88bYIx6PZTA==", + "requires": { + "@typescript-eslint/types": "4.14.0", + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==" + } + } + }, "acorn": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", @@ -2319,7 +859,6 @@ "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, "requires": { "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", @@ -2327,6 +866,11 @@ "uri-js": "^4.2.2" } }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" + }, "ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", @@ -2365,7 +909,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "requires": { "sprintf-js": "~1.0.2" } @@ -2456,6 +999,11 @@ } } }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + }, "array.prototype.flat": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", @@ -2871,8 +1419,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base16": { "version": "1.0.0", @@ -2929,12 +1476,19 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", @@ -2975,8 +1529,7 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, "camelcase": { "version": "4.1.0", @@ -3262,8 +1815,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "confusing-browser-globals": { "version": "1.0.7", @@ -3344,6 +1896,44 @@ "node-fetch": "2.6.1" } }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "crypto-js": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", @@ -3750,8 +2340,7 @@ "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, "define-properties": { "version": "1.1.3", @@ -3766,11 +2355,25 @@ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "requires": { + "path-type": "^4.0.0" + }, + "dependencies": { + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + } + } + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, "requires": { "esutils": "^2.0.2" } @@ -3886,6 +2489,14 @@ "once": "^1.4.0" } }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "requires": { + "ansi-colors": "^4.1.1" + } + }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", @@ -3974,345 +2585,723 @@ "text-table": "^0.2.0" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "eslint-config-airbnb": { + "version": "17.1.1", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-17.1.1.tgz", + "integrity": "sha512-xCu//8a/aWqagKljt+1/qAM62BYZeNq04HmdevG5yUGWpja0I/xhqd6GdLRch5oetEGFiJAnvtGuTEAese53Qg==", + "dev": true, + "requires": { + "eslint-config-airbnb-base": "^13.2.0", + "object.assign": "^4.1.0", + "object.entries": "^1.1.0" + } + }, + "eslint-config-airbnb-base": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.2.0.tgz", + "integrity": "sha512-1mg/7eoB4AUeB0X1c/ho4vb2gYkNH8Trr/EgCT/aGmKhhG+F6vF5s8+iRBlWAzFIAphxIdp3YfEKgEl0f9Xg+w==", + "dev": true, + "requires": { + "confusing-browser-globals": "^1.0.5", + "object.assign": "^4.1.0", + "object.entries": "^1.1.0" + } + }, + "eslint-import-resolver-meteor": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-meteor/-/eslint-import-resolver-meteor-0.4.0.tgz", + "integrity": "sha1-yGhjhAghIIz4EzxczlGQnCamFWk=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "resolve": "^1.1.6" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", + "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.4", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + } + } + }, + "eslint-plugin-jsx-a11y": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.4.1.tgz", + "integrity": "sha512-0rGPJBbwHoGNPU73/QCLP/vveMlM1b1Z9PponxO87jfr6tuH5ligXbDT6nHSSzBC8ovX2Z+BQu7Bk5D/Xgq9zg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.11.2", + "aria-query": "^4.2.2", + "array-includes": "^3.1.1", + "ast-types-flow": "^0.0.7", + "axe-core": "^4.0.2", + "axobject-query": "^2.2.0", + "damerau-levenshtein": "^1.0.6", + "emoji-regex": "^9.0.0", + "has": "^1.0.3", + "jsx-ast-utils": "^3.1.0", + "language-tags": "^1.0.5" + }, + "dependencies": { + "emoji-regex": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.0.tgz", + "integrity": "sha512-DNc3KFPK18bPdElMJnf/Pkv5TXhxFU3YFDEuGLDRtPmV4rkmCjBkCSEp22u6rBHdSN9Vlp/GK7k98prmE1Jgug==", + "dev": true + } + } + }, + "eslint-plugin-meteor": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-meteor/-/eslint-plugin-meteor-5.2.0.tgz", + "integrity": "sha512-bHzs/0BwHdKcBbX7tYrSnBaMG+1i2f1wy8k6H/sBBsERD/yifmBUrNLiPyZkIvyVUeI8OaZw8U9fsMvLP5GhIg==", + "dev": true, + "requires": { + "invariant": "2.2.4" + } + }, + "eslint-plugin-react": { + "version": "7.22.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.22.0.tgz", + "integrity": "sha512-p30tuX3VS+NWv9nQot9xIGAHBXR0+xJVaZriEsHoJrASGCJZDJ8JLNM0YqKqI0AKm6Uxaa1VUHoNEibxRCMQHA==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flatmap": "^1.2.3", + "doctrine": "^2.1.0", + "has": "^1.0.3", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "object.entries": "^1.1.2", + "object.fromentries": "^2.0.2", + "object.values": "^1.1.1", + "prop-types": "^15.7.2", + "resolve": "^1.18.1", + "string.prototype.matchall": "^4.0.2" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "esutils": "^2.0.2" } }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", "dev": true, "requires": { - "ms": "^2.1.1" + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" } }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "dev": true + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "has-symbols": "^1.0.1" + } + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.entries": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.3.tgz", + "integrity": "sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "has": "^1.0.3" + } + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" } } } }, - "eslint-config-airbnb": { - "version": "17.1.1", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-17.1.1.tgz", - "integrity": "sha512-xCu//8a/aWqagKljt+1/qAM62BYZeNq04HmdevG5yUGWpja0I/xhqd6GdLRch5oetEGFiJAnvtGuTEAese53Qg==", - "dev": true, - "requires": { - "eslint-config-airbnb-base": "^13.2.0", - "object.assign": "^4.1.0", - "object.entries": "^1.1.0" - } - }, - "eslint-config-airbnb-base": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.2.0.tgz", - "integrity": "sha512-1mg/7eoB4AUeB0X1c/ho4vb2gYkNH8Trr/EgCT/aGmKhhG+F6vF5s8+iRBlWAzFIAphxIdp3YfEKgEl0f9Xg+w==", - "dev": true, - "requires": { - "confusing-browser-globals": "^1.0.5", - "object.assign": "^4.1.0", - "object.entries": "^1.1.0" - } - }, - "eslint-import-resolver-meteor": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-meteor/-/eslint-import-resolver-meteor-0.4.0.tgz", - "integrity": "sha1-yGhjhAghIIz4EzxczlGQnCamFWk=", - "dev": true, - "requires": { - "object-assign": "^4.0.1", - "resolve": "^1.1.6" - } - }, - "eslint-import-resolver-node": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", - "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", - "dev": true, - "requires": { - "debug": "^2.6.9", - "resolve": "^1.13.1" + "eslint-plugin-unused-imports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-1.0.1.tgz", + "integrity": "sha512-AVDcgeoZZoBH/g5743nvWQK7/V7w2RMILHvogfBnYa1s47los7G2ysEweRx0yJ8pSVnITJvxTBkefQbJowTi3w==", + "requires": { + "@typescript-eslint/eslint-plugin": "^4.5.0", + "eslint": "^7.11.0", + "eslint-rule-composer": "^0.3.0", + "requireindex": "~1.2.0", + "typescript": "^4.0.3" }, "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==" + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==" + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "eslint": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.18.0.tgz", + "integrity": "sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.3.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^6.0.0", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.4", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "requires": { - "ms": "2.0.0" + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" + } } }, - "resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", - "dev": true, + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==" + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "requires": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" + } } - } - } - }, - "eslint-module-utils": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", - "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", - "dev": true, - "requires": { - "debug": "^2.6.9", - "pkg-dir": "^2.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", "requires": { - "ms": "2.0.0" + "estraverse": "^5.1.0" } - } - } - }, - "eslint-plugin-import": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", - "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", - "dev": true, - "requires": { - "array-includes": "^3.1.1", - "array.prototype.flat": "^1.2.3", - "contains-path": "^0.1.0", - "debug": "^2.6.9", - "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.4", - "eslint-module-utils": "^2.6.0", - "has": "^1.0.3", - "minimatch": "^3.0.4", - "object.values": "^1.1.1", - "read-pkg-up": "^2.0.0", - "resolve": "^1.17.0", - "tsconfig-paths": "^3.9.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, + }, + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "file-entry-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz", + "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==", "requires": { - "ms": "2.0.0" + "flat-cache": "^3.0.4" } }, - "doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", - "dev": true, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "requires": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" + "flatted": "^3.1.0", + "rimraf": "^3.0.2" } }, - "resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", - "dev": true, + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==" + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "requires": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" + "type-fest": "^0.8.1" } - } - } - }, - "eslint-plugin-jsx-a11y": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.4.1.tgz", - "integrity": "sha512-0rGPJBbwHoGNPU73/QCLP/vveMlM1b1Z9PponxO87jfr6tuH5ligXbDT6nHSSzBC8ovX2Z+BQu7Bk5D/Xgq9zg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.11.2", - "aria-query": "^4.2.2", - "array-includes": "^3.1.1", - "ast-types-flow": "^0.0.7", - "axe-core": "^4.0.2", - "axobject-query": "^2.2.0", - "damerau-levenshtein": "^1.0.6", - "emoji-regex": "^9.0.0", - "has": "^1.0.3", - "jsx-ast-utils": "^3.1.0", - "language-tags": "^1.0.5" - }, - "dependencies": { - "emoji-regex": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.0.tgz", - "integrity": "sha512-DNc3KFPK18bPdElMJnf/Pkv5TXhxFU3YFDEuGLDRtPmV4rkmCjBkCSEp22u6rBHdSN9Vlp/GK7k98prmE1Jgug==", - "dev": true - } - } - }, - "eslint-plugin-meteor": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-meteor/-/eslint-plugin-meteor-5.2.0.tgz", - "integrity": "sha512-bHzs/0BwHdKcBbX7tYrSnBaMG+1i2f1wy8k6H/sBBsERD/yifmBUrNLiPyZkIvyVUeI8OaZw8U9fsMvLP5GhIg==", - "dev": true, - "requires": { - "invariant": "2.2.4" - } - }, - "eslint-plugin-react": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.22.0.tgz", - "integrity": "sha512-p30tuX3VS+NWv9nQot9xIGAHBXR0+xJVaZriEsHoJrASGCJZDJ8JLNM0YqKqI0AKm6Uxaa1VUHoNEibxRCMQHA==", - "dev": true, - "requires": { - "array-includes": "^3.1.1", - "array.prototype.flatmap": "^1.2.3", - "doctrine": "^2.1.0", - "has": "^1.0.3", - "jsx-ast-utils": "^2.4.1 || ^3.0.0", - "object.entries": "^1.1.2", - "object.fromentries": "^2.0.2", - "object.values": "^1.1.1", - "prop-types": "^15.7.2", - "resolve": "^1.18.1", - "string.prototype.matchall": "^4.0.2" - }, - "dependencies": { - "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==" + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "requires": { - "esutils": "^2.0.2" + "glob": "^7.1.3" } }, - "es-abstract": { - "version": "1.18.0-next.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", - "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", - "dev": true, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.0", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" + "lru-cache": "^6.0.0" } }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" } }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", - "dev": true + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } }, - "is-callable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", - "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", - "dev": true + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } }, - "is-regex": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", - "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", - "dev": true, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "requires": { - "has-symbols": "^1.0.1" + "has-flag": "^4.0.0" } }, - "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, + "table": { + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", + "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" + "ajv": "^7.0.2", + "lodash": "^4.17.20", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0" + }, + "dependencies": { + "ajv": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.3.tgz", + "integrity": "sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + } } }, - "object.entries": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.3.tgz", - "integrity": "sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg==", - "dev": true, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1", - "has": "^1.0.3" + "prelude-ls": "^1.2.1" } }, - "resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", - "dev": true, + "typescript": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", + "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==" + } + } + }, + "eslint-rule-composer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", + "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==" + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "dependencies": { + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "requires": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" + } } } } @@ -4354,8 +3343,7 @@ "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "esquery": { "version": "1.0.1", @@ -4378,8 +3366,7 @@ "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" }, "estree-walker": { "version": "0.6.1", @@ -4419,20 +3406,38 @@ "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + }, + "fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + }, + "fastq": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.0.tgz", + "integrity": "sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA==", + "requires": { + "reusify": "^1.0.4" + } }, "fbemitter": { "version": "3.0.0", @@ -4492,6 +3497,14 @@ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, "find-cache-dir": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.2.0.tgz", @@ -4627,8 +3640,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "2.1.3", @@ -4644,8 +3656,7 @@ "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, "get-caller-file": { "version": "2.0.5", @@ -4679,7 +3690,6 @@ "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4689,11 +3699,39 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "requires": { + "is-glob": "^4.0.1" + } + }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, + "globby": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", + "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "dependencies": { + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" + } + } + }, "google-protobuf": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.14.0.tgz", @@ -4808,14 +3846,12 @@ "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" }, "import-fresh": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", - "dev": true, "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -4824,14 +3860,12 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -5043,16 +4077,34 @@ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, "is-negative-zero": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=" }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -5102,8 +4154,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { "version": "3.0.1", @@ -5129,7 +4180,6 @@ "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -5143,8 +4193,7 @@ "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "json-stable-stringify": { "version": "1.0.1", @@ -5157,8 +4206,7 @@ "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, "json-stringify-safe": { "version": "5.0.1", @@ -5348,6 +4396,14 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, "make-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", @@ -5386,6 +4442,11 @@ "is-what": "^3.3.1" } }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" + }, "mersenne-twister": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mersenne-twister/-/mersenne-twister-1.1.0.tgz", @@ -5976,6 +5037,15 @@ } } }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", @@ -5996,7 +5066,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -6047,8 +5116,7 @@ "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" }, "ndjson": { "version": "1.5.0", @@ -6376,7 +5444,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, "requires": { "callsites": "^3.0.0" } @@ -6411,8 +5478,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { "version": "1.0.2", @@ -6461,6 +5527,11 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" + }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -6828,8 +5899,7 @@ "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" }, "promise": { "version": "7.3.1", @@ -6871,8 +5941,7 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "pure-color": { "version": "1.3.0", @@ -7215,11 +6284,21 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, + "requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==" + }, "resolve": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", @@ -7232,8 +6311,7 @@ "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" }, "resolve-pathname": { "version": "2.2.0", @@ -7250,6 +6328,11 @@ "signal-exit": "^3.0.2" } }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" + }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -7320,6 +6403,11 @@ "is-promise": "^2.1.0" } }, + "run-parallel": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==" + }, "rw": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", @@ -7471,6 +6559,11 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + }, "slice-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", @@ -7538,8 +6631,7 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "stream-shift": { "version": "1.0.1", @@ -7963,8 +7055,7 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" }, "through": { "version": "2.3.8", @@ -8029,6 +7120,14 @@ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, "tooltip.js": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/tooltip.js/-/tooltip.js-1.3.3.tgz", @@ -8064,6 +7163,14 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.8.1.tgz", "integrity": "sha1-aUavLR1lGnsYY7Ux1uWvpBqkTqw=" }, + "tsutils": { + "version": "3.19.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.19.1.tgz", + "integrity": "sha512-GEdoBf5XI324lu7ycad7s6laADfnAqCw6wLGI+knxvw9vsIYBaJfYdmeCEG3FMMUiSm3OGgNb+m6utsWf5h9Vw==", + "requires": { + "tslib": "^1.8.1" + } + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -8079,6 +7186,11 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" + }, "typed-styles": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/typed-styles/-/typed-styles-0.0.7.tgz", @@ -8113,7 +7225,6 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, "requires": { "punycode": "^2.1.0" } @@ -8123,6 +7234,11 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==" + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -8232,6 +7348,11 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -8285,6 +7406,11 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "yargs": { "version": "14.2.3", "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", diff --git a/package.json b/package.json index df2c1e8ec..15fa4facf 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@babel/runtime": "^7.12.5", - "@forbole/cosmos-protobuf-js": "file:../../node_modules/cosmos-protobuf-js", + "@forbole/cosmos-protobuf-js": "^1.0.4", "@improbable-eng/grpc-web": "^0.13.0", "@improbable-eng/grpc-web-node-http-transport": "^0.13.0", "@ledgerhq/hw-transport-webusb": "^4.78.0", diff --git a/server/main.js b/server/main.js index 987fd260a..b6e16acbe 100644 --- a/server/main.js +++ b/server/main.js @@ -5,12 +5,16 @@ import '/imports/startup/both'; // import moment from 'moment'; // import '/imports/api/blocks/blocks.js'; +import { Cosmos } from '@forbole/cosmos-protobuf-js' + SYNCING = false; TXSYNCING = false; COUNTMISSEDBLOCKS = false; COUNTMISSEDBLOCKSSTATS = false; RPC = Meteor.settings.remote.rpc; LCD = Meteor.settings.remote.lcd; +GRPC = Meteor.settings.remote.grpc; + timerBlocks = 0; timerTransactions = 0; timerChain = 0; @@ -164,7 +168,7 @@ aggregateDaily = () =>{ -Meteor.startup(function(){ +Meteor.startup(async function(){ if (Meteor.isDevelopment){ process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0; import DEFAULTSETTINGSJSON from '../default_settings.json' From 0fef348889b5aa8a7142885e8173de9b576c523e Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 25 Jan 2021 20:01:48 +0000 Subject: [PATCH 030/127] update block update --- imports/api/blocks/server/methods.js | 195 +++++++++++++---------- imports/startup/server/create-indexes.js | 4 +- imports/startup/server/util.js | 4 +- 3 files changed, 114 insertions(+), 89 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index c3653bf2a..bce169323 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -11,8 +11,9 @@ import { Evidences } from '../../evidences/evidences.js'; import { sha256 } from 'js-sha256'; import { getAddress } from 'tendermint/lib/pubkey'; import * as cheerio from 'cheerio'; -import * as cosmospb from '@forbole/cosmos-protobuf-js' -import unary from '../../../../both/utils/unary' +import { Cosmos } from '@forbole/cosmos-protobuf-js' +import { goTimeToISOString } from '../../../../both/utils/time'; + getRemovedValidators = (prevValidators, validators) => { // let removeValidators = []; @@ -70,7 +71,10 @@ getValidatorUptime = async (validatorSet) => { let url = LCD+'/cosmos/slashing/v1beta1/params'; let response = HTTP.get(url); - const slashingParams = JSON.parse(response.content).result; + let req = new Cosmos.Slashing.QueryParamsRequest(); + const slashingParams = await Cosmos.gRPC.unary(Cosmos.Slashing.Query.Params, req, GRPC); + + // const slashingParams = JSON.parse(response.content).result; Chain.upsert({chainId:Meteor.settings.public.chainId}, {$set:{"slashing.params":slashingParams}}); @@ -216,49 +220,43 @@ Meteor.methods({ let validatorSet = {} // get latest validator candidate information - url = LCD+'/cosmos/staking/v1beta1/validators'; - - const req = new cosmospb.staking.query.QueryValidatorsRequest() - // req.setStatus("BONDED") - // console.log("Get validators: %o", height) - const res = await unary(cosmospb.staking.query.Validators, req) + // url = LCD+'/cosmos/staking/v1beta1/validators'; - console.log("Get validators: %o", res); - - console.log("=========") + let req = new Cosmos.Staking.QueryValidatorsRequest() + let res; try{ - response = HTTP.get(url); - JSON.parse(response.content).result.forEach((validator) => validatorSet[validator.consensus_pubkey.value] = validator); + // bonded validators + req.setStatus("BOND_STATUS_BONDED") + res = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Validators, req, GRPC); + res.validatorsList.forEach((validator) => validatorSet[validator.consensusPubkey.value] = validator); } catch(e){ - console.log(url); console.log(e); } - url = LCD+'/cosmos/staking/v1beta1/validators?status=unbonding'; - - + // url = LCD+'/cosmos/staking/v1beta1/validators?status=unbonding'; try{ - response = HTTP.get(url); - JSON.parse(response.content).result.forEach((validator) => validatorSet[validator.consensus_pubkey.value] = validator) + // response = HTTP.get(url); + req.setStatus("BOND_STATUS_UNBONDING") + res = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Validators, req, GRPC); + res.validatorsList.forEach((validator) => validatorSet[validator.consensusPubkey.value] = validator) } catch(e){ - console.log(url); console.log(e); } - url = LCD+'/cosmos/staking/v1beta1/validators?status=unbonded'; - + // url = LCD+'/cosmos/staking/v1beta1/validators?status=unbonded'; try{ - response = HTTP.get(url); - JSON.parse(response.content).result.forEach((validator) => validatorSet[validator.consensus_pubkey.value] = validator) + req.setStatus("BOND_STATUS_UNBONDED") + res = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Validators, req, GRPC); + res.validatorsList.forEach((validator) => validatorSet[validator.consensusPubkey.value] = validator) } catch(e){ - console.log(url); console.log(e); } + // console.log("validaotor set: %o", validatorSet); let totalValidators = Object.keys(validatorSet).length; console.log("all validators: "+ totalValidators); Chain.update({chainId:Meteor.settings.public.chainId}, {$set:{totalValidators:totalValidators}}); @@ -267,7 +265,11 @@ Meteor.methods({ let startBlockTime = new Date(); // add timeout here? and outside this loop (for catched up and keep fetching)? this.unblock(); - let url = RPC+'/block?height=' + height; + // let url = RPC+'/block?height=' + height; + + req = new Cosmos.Base.Tendermint.GetBlockByHeightRequest(); + req.setHeight(height); + let analyticsData = {}; const bulkValidators = Validators.rawCollection().initializeUnorderedBulkOp(); @@ -276,30 +278,32 @@ Meteor.methods({ const bulkVPHistory = VotingPowerHistory.rawCollection().initializeUnorderedBulkOp(); const bulkTransactions = Transactions.rawCollection().initializeUnorderedBulkOp(); - console.log(url); + console.log("Getting block at height: %o", height); try{ let startGetHeightTime = new Date(); - let response = HTTP.get(url); - if (response.statusCode == 200){ - let block = JSON.parse(response.content); - block = block.result; + // let response = HTTP.get(url); + let block = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetBlockByHeight, req, GRPC); + // console.log(block.block.header); + // if (response.statusCode == 200){ + // let block = JSON.parse(response.content); + // block = block.result; // store height, hash, numtransaction and time in db let blockData = {}; blockData.height = height; - blockData.hash = block.block_id.hash; - blockData.transNum = block.block.data.txs?block.block.data.txs.length:0; - blockData.time = new Date(block.block.header.time); - blockData.lastBlockHash = block.block.header.last_block_id.hash; - blockData.proposerAddress = block.block.header.proposer_address; + blockData.hash = block.blockId.hash; + blockData.transNum = block.block.data.txsList?block.block.data.txsList.length:0; + blockData.time = new Date(goTimeToISOString(block.block.header.time)); + blockData.lastBlockHash = block.block.header.lastBlockId.hash; + blockData.proposerAddress = block.block.header.proposerAddress; blockData.validators = []; // save txs in database - if (block.block.data.txs && block.block.data.txs.length > 0){ - for (t in block.block.data.txs){ + if (block.block.data.txsList && block.block.data.txsList.length > 0){ + for (t in block.block.data.txsList){ bulkTransactions.insert({ // hash has to be in uppercase - txhash: sha256(Buffer.from(block.block.data.txs[t], 'base64')).toUpperCase(), + txhash: sha256(Buffer.from(block.block.data.txsList[t], 'base64')).toUpperCase(), height: height, processed: false }) @@ -318,14 +322,16 @@ Meteor.methods({ } // save double sign evidences - if (block.block.evidence.evidence){ + if (block.block.evidence.evidenceList){ Evidences.insert({ height: height, - evidence: block.block.evidence.evidence + evidence: block.block.evidence.evidenceList }); } - blockData.precommitsCount = blockData.validators.length; + // console.log("signatures: %o", block.block.lastCommit.signaturesList) + + blockData.precommitsCount = block.block.lastCommit.signaturesList.length; analyticsData.height = height; @@ -338,21 +344,29 @@ Meteor.methods({ let validators = [] let page = 0; + // let nextKey = 0; try { - let result = {} + let validatorSetResult = {} do { - url = RPC+`/validators?height=${height}&page=${++page}&per_page=100`; - response = HTTP.get(url); - console.log(url); - result = JSON.parse(response.content); - validators = [...validators, ...result.result.validators]; + // url = RPC+`/validators?height=${height}&page=${++page}&per_page=100`; + page++; + req = new Cosmos.Base.Tendermint.GetValidatorSetByHeightRequest() + req.setHeight(height); + validatorSetResult = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetValidatorSetByHeight, req, GRPC); + // response = HTTP.get(url); + // console.log(url); + // result = JSON.parse(response.content); + // console.log(validatorSetResult); + validators = [...validators, ...validatorSetResult.validatorsList]; } - while (result.result.count == 100 && (result.result.count*page < result.result.total) ) + while (validatorSetResult.validatorsList.length == 100 && (validatorSetResult.validatorsList.length*page < validatorSetResult.pagination?.total) ) } catch(e){ console.log("Getting validator set at height %o: %o", height, e) } + // console.log(validators) + ValidatorSets.insert({ block_height: height, validators: validators @@ -362,17 +376,17 @@ Meteor.methods({ let tempValidators = []; for (let v in validators){ // validators[v].consensus_pubkey = Meteor.call('pubkeyToBech32', validators[v].pub_key, Meteor.settings.public.bech32PrefixConsPub); - tempValidators[validators[v].pub_key.value] = validators[v]; + tempValidators[validators[v].pubKey.value] = validators[v]; } validators = tempValidators; // Tendermint v0.33 start using "signatures" in last block instead of "precommits" - let precommits = block.block.last_commit.signatures; + let precommits = block.block.lastCommit.signaturesList; if (precommits != null){ - // console.log(precommits.length); + // console.log(precommits); for (let i=0; i 0){ + if (pubkey.typeUrl.indexOf("ed25519") > 0){ // '1624DE6420' is ed25519 pubkey prefix let pubkeyAminoPrefix = Buffer.from('1624DE6420', 'hex'); buffer = Buffer.alloc(37); @@ -26,7 +26,7 @@ Meteor.methods({ pubkeyAminoPrefix.copy(buffer, 0) Buffer.from(pubkey.value, 'base64').copy(buffer, pubkeyAminoPrefix.length) } - else if (pubkey.type.indexOf("PubKeySecp256k1") > 0){ + else if (pubkey.typeUrl.indexOf("secp256k1") > 0){ // 'EB5AE98721' is secp256k1 pubkey prefix let pubkeyAminoPrefix = Buffer.from('EB5AE98721', 'hex'); buffer = Buffer.alloc(38); From bd930a87a35445702819abdb66d18966a89c9e85 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 25 Jan 2021 20:11:04 +0000 Subject: [PATCH 031/127] update meteor to 2.0 --- .meteor/packages | 4 ++-- .meteor/release | 2 +- .meteor/versions | 25 +++++++++++++------------ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.meteor/packages b/.meteor/packages index 9e00fbb70..3856b402e 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -10,10 +10,10 @@ mongo@1.10.1 # The database Meteor supports right now reactive-var@1.0.11 # Reactive variable for tracker tracker@1.2.0 # Meteor's client-side reactive programming library -standard-minifier-css@1.7.1 # CSS minifier run for production mode +standard-minifier-css@1.7.2 # CSS minifier run for production mode standard-minifier-js@2.6.0 # JS minifier run for production mode es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers -ecmascript@0.14.4 # Enable ECMAScript2015+ syntax in app code +ecmascript@0.15.0 # Enable ECMAScript2015+ syntax in app code shell-server@0.5.0 # Server-side component of the `meteor shell` command less@2.8.0 # Leaner CSS language diff --git a/.meteor/release b/.meteor/release index 24493339e..bc0e7170f 100644 --- a/.meteor/release +++ b/.meteor/release @@ -1 +1 @@ -METEOR@1.12 +METEOR@2.0 diff --git a/.meteor/versions b/.meteor/versions index 25ca98250..ec360e1b3 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -1,6 +1,6 @@ allow-deny@1.1.0 -autoupdate@1.6.0 -babel-compiler@7.5.4 +autoupdate@1.7.0 +babel-compiler@7.6.0 babel-runtime@1.5.0 base64@1.0.12 binary-heap@1.0.11 @@ -13,13 +13,13 @@ callback-hook@1.3.0 check@1.3.1 dburles:collection-helpers@1.1.0 ddp@1.4.0 -ddp-client@2.3.3 +ddp-client@2.4.0 ddp-common@1.4.0 ddp-server@2.3.2 deps@1.0.12 diff-sequence@1.1.1 -dynamic-import@0.5.4 -ecmascript@0.14.4 +dynamic-import@0.6.0 +ecmascript@0.15.0 ecmascript-runtime@0.7.0 ecmascript-runtime-client@0.11.0 ecmascript-runtime-server@0.10.0 @@ -31,7 +31,7 @@ geojson-utils@1.0.10 hot-code-push@1.0.4 html-tools@1.0.11 htmljs@1.0.11 -http@1.4.2 +http@1.4.3 id-map@1.1.0 inter-process-messaging@0.1.1 johanbrook:publication-collector@1.1.0 @@ -40,7 +40,7 @@ launch-screen@1.2.0 less@2.8.0 livedata@1.0.18 lmieulet:meteor-coverage@3.2.0 -logging@1.1.20 +logging@1.2.0 meteor@1.9.3 meteor-base@1.4.0 meteortesting:browser-tests@1.3.4 @@ -52,7 +52,7 @@ minimongo@1.6.1 mobile-experience@1.1.0 mobile-status-bar@1.1.0 modern-browsers@0.1.5 -modules@0.15.0 +modules@0.16.0 modules-runtime@0.12.0 mongo@1.10.1 mongo-decimal@0.1.2 @@ -62,7 +62,8 @@ npm-mongo@3.8.1 ordered-dict@1.1.0 promise@0.11.2 random@1.2.0 -react-meteor-data@2.1.4 +react-fast-refresh@0.1.0 +react-meteor-data@2.2.1 reactive-var@1.0.11 reload@1.3.1 retry@1.1.0 @@ -72,7 +73,7 @@ server-render@0.3.1 shell-server@0.5.0 socket-stream-client@0.3.1 spacebars-compiler@1.1.3 -standard-minifier-css@1.7.1 +standard-minifier-css@1.7.2 standard-minifier-js@2.6.0 static-html@1.2.2 templating-tools@1.1.2 @@ -81,5 +82,5 @@ typescript@4.1.2 underscore@1.0.10 universe:i18n@1.31.0 url@1.3.1 -webapp@1.9.1 -webapp-hashing@1.0.9 +webapp@1.10.0 +webapp-hashing@1.1.0 From 37c759b3cd60966b6b527a6d3bd0bb59b365d5d0 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 25 Jan 2021 20:20:16 +0000 Subject: [PATCH 032/127] update validator address index --- imports/startup/server/create-indexes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/startup/server/create-indexes.js b/imports/startup/server/create-indexes.js index b9d200e13..f72aeeccc 100644 --- a/imports/startup/server/create-indexes.js +++ b/imports/startup/server/create-indexes.js @@ -52,8 +52,8 @@ Transactions.rawCollection().createIndex({ ValidatorSets.rawCollection().createIndex({block_height:-1}); Validators.rawCollection().createIndex({address:1},{unique:true, partialFilterExpression: { address: { $exists: true } } }); -Validators.rawCollection().createIndex({consensusPubkey:1},{unique:true}); -// Validators.rawCollection().createIndex({"pub_key.value":1},{unique:true, partialFilterExpression: { "pub_key.value": { $exists: true } }}); +// Validators.rawCollection().createIndex({consensusPubkey:1},{unique:true}); +Validators.rawCollection().createIndex({"consensusPubkey.value":1},{unique:true, partialFilterExpression: { "consensusPubkey.value": { $exists: true } }}); VotingPowerHistory.rawCollection().createIndex({address:1,height:-1}); VotingPowerHistory.rawCollection().createIndex({type:1}); From 1df5ec05b66575890f597dabcb9a2a2749d4db92 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 25 Jan 2021 20:46:16 +0000 Subject: [PATCH 033/127] block not show proposer --- imports/ui/blocks/BlocksTable.jsx | 4 ++-- imports/ui/blocks/block.js | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/imports/ui/blocks/BlocksTable.jsx b/imports/ui/blocks/BlocksTable.jsx index 975167fb4..269bf1507 100644 --- a/imports/ui/blocks/BlocksTable.jsx +++ b/imports/ui/blocks/BlocksTable.jsx @@ -77,8 +77,8 @@ export default class BlocksTable extends Component { render(){ return
- Latest Blocks on Cosmos Hub | The Big Dipper - + Latest Blocks | Big Dipper +

blocks.latestBlocks

diff --git a/imports/ui/blocks/block.js b/imports/ui/blocks/block.js index 6fe08cb15..c86778a07 100644 --- a/imports/ui/blocks/block.js +++ b/imports/ui/blocks/block.js @@ -12,18 +12,19 @@ export default class Block extends Component { render() { let proposer = this.props.block.proposer(); - if (proposer){ - let moniker = (proposer.description&&proposer.description.moniker)?proposer.description.moniker:proposer.address; + // if (proposer){ + let moniker = (proposer&&proposer.description&&proposer.description.moniker)?proposer.description.moniker:this.props.block.proposerAddress; return { this.props.block.hash} - {moniker} + {/* {moniker} */} + {numbro(this.props.block.transNum).format('0,0')} {numbro(this.props.block.height).format('0,0')} - } - else{ - return
- } + // } + // else{ + // return
+ // } } } \ No newline at end of file From 01e6655b4279da9bd683a73fc24e82caeb246403 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 25 Jan 2021 21:23:06 +0000 Subject: [PATCH 034/127] save tx data correctly --- imports/api/blocks/server/methods.js | 2 +- imports/api/transactions/server/methods.js | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index bce169323..3d4992064 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -304,7 +304,7 @@ Meteor.methods({ bulkTransactions.insert({ // hash has to be in uppercase txhash: sha256(Buffer.from(block.block.data.txsList[t], 'base64')).toUpperCase(), - height: height, + height: parseInt(height), processed: false }) } diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index 78241a952..666840a80 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { HTTP } from 'meteor/http'; import { Transactions } from '../../transactions/transactions.js'; import { Validators } from '../../validators/validators.js'; +import { Cosmos } from '@forbole/cosmos-protobuf-js' const AddressLength = 40; @@ -17,11 +18,16 @@ Meteor.methods({ const bulkTransactions = Transactions.rawCollection().initializeUnorderedBulkOp(); for (let i in transactions){ try { - let url = LCD+ '/cosmos/tx/v1beta1/txs/'+transactions[i].txhash; - let response = HTTP.get(url); - let tx = JSON.parse(response.content); + // let url = LCD+ '/cosmos/tx/v1beta1/txs/'+transactions[i].txhash; + // let response = HTTP.get(url); + // let tx = JSON.parse(response.content); + + let req = new Cosmos.Tx.GetTxRequest(); + req.setHash(transactions[i].txhash); + let tx = await Cosmos.gRPC.unary(Cosmos.Tx.Service.GetTx, req, GRPC); + console.log(tx); - tx.height = parseInt(tx.height); + // tx.height = parseInt(tx.height); tx.processed = true; bulkTransactions.find({txhash:transactions[i].txhash}).updateOne({$set:tx}); From b72c8573ed19eb3fe476ceb79acbcabc85ecbe8b Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 26 Jan 2021 11:56:38 +0000 Subject: [PATCH 035/127] get the tendermint hex address --- imports/api/blocks/server/methods.js | 23 +++++++++++++---------- imports/startup/server/util.js | 27 ++++++++++++++------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 3d4992064..1e4f762a2 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -9,7 +9,7 @@ import { VotingPowerHistory } from '/imports/api/voting-power/history.js'; import { Transactions } from '../../transactions/transactions.js'; import { Evidences } from '../../evidences/evidences.js'; import { sha256 } from 'js-sha256'; -import { getAddress } from 'tendermint/lib/pubkey'; +// import { getAddress } from 'tendermint/lib/pubkey'; import * as cheerio from 'cheerio'; import { Cosmos } from '@forbole/cosmos-protobuf-js' import { goTimeToISOString } from '../../../../both/utils/time'; @@ -376,17 +376,21 @@ Meteor.methods({ let tempValidators = []; for (let v in validators){ // validators[v].consensus_pubkey = Meteor.call('pubkeyToBech32', validators[v].pub_key, Meteor.settings.public.bech32PrefixConsPub); + validators[v].valconsAddress = validators[v].address; + validators[v].address = Meteor.call('getAddressFromPubkey', validators[v].pubKey); tempValidators[validators[v].pubKey.value] = validators[v]; } validators = tempValidators; + console.log("before comparing precommits: %o", validators); + // Tendermint v0.33 start using "signatures" in last block instead of "precommits" let precommits = block.block.lastCommit.signaturesList; if (precommits != null){ // console.log(precommits); for (let i=0; i 0){ + if (type.indexOf("ed25519") > 0){ // '1624DE6420' is ed25519 pubkey prefix pubkeyAminoPrefix = Buffer.from('1624DE6420', 'hex') buffer = Buffer.from(bech32.fromWords(bech32.decode(pubkey).words)); } - else if (type.indexOf("PubKeySecp256k1") > 0){ + else if (type.indexOf("secp256k1") > 0){ // 'EB5AE98721' is secp256k1 pubkey prefix pubkeyAminoPrefix = Buffer.from('EB5AE98721', 'hex') buffer = Buffer.from(bech32.fromWords(bech32.decode(pubkey).words)); @@ -73,6 +69,11 @@ Meteor.methods({ return false } }, + getAddressFromPubkey: function(pubkey){ + var bytes = Buffer.from(pubkey.value, 'base64'); + // there are two extra byte in the protobuf result + return tmhash(bytes.slice(2)).slice(0, 20).toString('hex').toUpperCase(); + }, getDelegator: function(operatorAddr){ let address = bech32.decode(operatorAddr); return bech32.encode(Meteor.settings.public.bech32PrefixAccAddr, address.words); From d9011b88e081476dc172310c4a0b580844fa4ad9 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 26 Jan 2021 17:55:38 +0000 Subject: [PATCH 036/127] fix propser name --- imports/api/blocks/server/methods.js | 28 ++++++++-------------------- imports/ui/blocks/block.js | 14 +++++++------- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 1e4f762a2..0286579aa 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -81,7 +81,7 @@ getValidatorUptime = async (validatorSet) => { for(let key in validatorSet){ try{ try { - let url = LCD+'/cosmos/slashing/v1beta1/signing_infos/'+validatorSet[key].bech32ConsensusPubKey; + let url = LCD+'/cosmos/slashing/v1beta1/signing_infos/'+validatorSet[key].bech32ValConsAddress; let response = HTTP.get(url); let signingInfo = JSON.parse(response.content).result; if (signingInfo){ @@ -290,11 +290,11 @@ Meteor.methods({ // store height, hash, numtransaction and time in db let blockData = {}; blockData.height = height; - blockData.hash = block.blockId.hash; + blockData.hash = Buffer.from(block.blockId.hash, 'base64').toString('hex').toUpperCase(); blockData.transNum = block.block.data.txsList?block.block.data.txsList.length:0; blockData.time = new Date(goTimeToISOString(block.block.header.time)); - blockData.lastBlockHash = block.block.header.lastBlockId.hash; - blockData.proposerAddress = block.block.header.proposerAddress; + blockData.lastBlockHash = Buffer.from(block.block.header.lastBlockId.hash, 'base64').toString('hex').toUpperCase(); + blockData.proposerAddress = Buffer.from(block.block.header.proposerAddress, 'base64').toString('hex').toUpperCase(); blockData.validators = []; @@ -353,10 +353,6 @@ Meteor.methods({ req = new Cosmos.Base.Tendermint.GetValidatorSetByHeightRequest() req.setHeight(height); validatorSetResult = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetValidatorSetByHeight, req, GRPC); - // response = HTTP.get(url); - // console.log(url); - // result = JSON.parse(response.content); - // console.log(validatorSetResult); validators = [...validators, ...validatorSetResult.validatorsList]; } while (validatorSetResult.validatorsList.length == 100 && (validatorSetResult.validatorsList.length*page < validatorSetResult.pagination?.total) ) @@ -372,6 +368,8 @@ Meteor.methods({ validators: validators }) + blockData.validatorsCount = validators.length; + // temporarily add bech32 concensus keys to the validator set list let tempValidators = []; for (let v in validators){ @@ -382,7 +380,7 @@ Meteor.methods({ } validators = tempValidators; - console.log("before comparing precommits: %o", validators); + // console.log("before comparing precommits: %o", validators); // Tendermint v0.33 start using "signatures" in last block instead of "precommits" let precommits = block.block.lastCommit.signaturesList; @@ -428,7 +426,6 @@ Meteor.methods({ } } - blockData.validatorsCount = validators.length; let startBlockInsertTime = new Date(); Blockscon.insert(blockData); let endBlockInsertTime = new Date(); @@ -464,8 +461,6 @@ Meteor.methods({ let startFindValidatorsNameTime = new Date(); for (v in validatorSet){ - // console.log(validators) - // console.log(validatorSet[v]); let valData = validatorSet[v]; let valExist = Validators.findOne({"consensusPubkey.value":v}); @@ -488,6 +483,7 @@ Meteor.methods({ validatorSet[v].bech32ConsensusPubKey = valData.bech32ConsensusPubKey; valData.address = Meteor.call('getAddressFromPubkey', valData.consensusPubkey); + valData.bech32ValConsAddress = Meteor.call('hexToBech32', valData.address, Meteor.settings.public.bech32PrefixConsAddr); // First time adding validator to the database. @@ -546,8 +542,6 @@ Meteor.methods({ height: blockData.height, block_time: blockData.time }; - // console.log('voting power changed.'); - // console.log(changeData); bulkVPHistory.insert(changeData); } } @@ -585,13 +579,9 @@ Meteor.methods({ try{ console.log("Getting self delegation"); - // let response = HTTP.get(url); - // console.log(url) let selfDelegation = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Delegation, req, GRPC); - console.log(selfDelegation) - valData.self_delegation = (selfDelegation.delegationResponse.delegation && selfDelegation.delegationResponse.delegation.shares)?parseFloat(selfDelegation.delegationResponse.delegation.shares)/parseFloat(valData.delegatorShares):0; } catch(e){ @@ -661,13 +651,11 @@ Meteor.methods({ let startVUpTime = new Date(); if (bulkValidators.length > 0){ - // console.log(bulkValidators.length); bulkValidators.execute((err, result) => { if (err){ console.log("Error while bulk insert validators: %o",err); } if (result){ - // console.log(result); bulkUpdateLastSeen.execute((err, result) => { if (err){ console.log("Error while bulk update validator last seen: %o",err); diff --git a/imports/ui/blocks/block.js b/imports/ui/blocks/block.js index c86778a07..83396ea6f 100644 --- a/imports/ui/blocks/block.js +++ b/imports/ui/blocks/block.js @@ -12,19 +12,19 @@ export default class Block extends Component { render() { let proposer = this.props.block.proposer(); - // if (proposer){ + if (proposer){ let moniker = (proposer&&proposer.description&&proposer.description.moniker)?proposer.description.moniker:this.props.block.proposerAddress; return { this.props.block.hash} - {/* {moniker} */} - + {moniker} + {/* */} {numbro(this.props.block.transNum).format('0,0')} {numbro(this.props.block.height).format('0,0')} - // } - // else{ - // return
- // } + } + else{ + return
+ } } } \ No newline at end of file From cfc8be6d96cd31e1a23c32e78f668650d6334426 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 26 Jan 2021 17:59:11 +0000 Subject: [PATCH 037/127] fix precommits storage --- imports/api/blocks/server/methods.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 0286579aa..820491531 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -283,10 +283,6 @@ Meteor.methods({ let startGetHeightTime = new Date(); // let response = HTTP.get(url); let block = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetBlockByHeight, req, GRPC); - // console.log(block.block.header); - // if (response.statusCode == 200){ - // let block = JSON.parse(response.content); - // block = block.result; // store height, hash, numtransaction and time in db let blockData = {}; blockData.height = height; @@ -412,9 +408,10 @@ Meteor.methods({ for (j in precommits){ if (precommits[j] != null){ - if (address == precommits[j].validatorAddress){ + let precommitAddress = Buffer.from(precommits[j].validatorAddress, 'base64').toString('hex').toUpperCase(); + if (address == precommitAddress){ record.exists = true; - bulkUpdateLastSeen.find({address:precommits[j].validatorAddress}).upsert().updateOne({$set:{lastSeen:blockData.time}}); + bulkUpdateLastSeen.find({address:precommitAddress}).upsert().updateOne({$set:{lastSeen:blockData.time}}); precommits.splice(j,1); break; } From add327f2140bedaa3e3e98f70ecfb4482044ca90 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 26 Jan 2021 18:42:19 +0000 Subject: [PATCH 038/127] update validator field names --- imports/api/accounts/server/methods.js | 6 +-- imports/api/blocks/server/methods.js | 2 +- imports/api/chain/server/publications.js | 2 +- imports/api/delegations/server/methods.js | 4 +- imports/api/proposals/server/methods.js | 18 +++---- imports/api/records/server/publications.js | 2 +- imports/api/transactions/server/methods.js | 6 +-- imports/api/validators/server/methods.js | 2 +- imports/api/validators/server/publications.js | 2 +- imports/startup/server/create-indexes.js | 2 +- imports/ui/accounts/Account.jsx | 4 +- imports/ui/blocks/Block.jsx | 2 +- imports/ui/components/Account.jsx | 12 ++--- imports/ui/components/AccountTooltip.jsx | 10 ++-- imports/ui/components/Activities.jsx | 12 ++--- imports/ui/components/PowerHistory.jsx | 8 +-- imports/ui/ledger/LedgerActions.jsx | 30 +++++------ imports/ui/ledger/ledger.js | 6 +-- imports/ui/validators/Delegations.jsx | 2 +- imports/ui/validators/List.jsx | 4 +- imports/ui/validators/ListContainer.js | 10 ++-- imports/ui/validators/Validator.jsx | 50 ++++++++++--------- imports/ui/validators/ValidatorContainer.js | 2 +- 23 files changed, 100 insertions(+), 98 deletions(-) diff --git a/imports/api/accounts/server/methods.js b/imports/api/accounts/server/methods.js index faa5ec7b1..f6f9cd534 100644 --- a/imports/api/accounts/server/methods.js +++ b/imports/api/accounts/server/methods.js @@ -98,10 +98,10 @@ Meteor.methods({ // get commission let validator = Validators.findOne( - {$or: [{operator_address:address}, {delegator_address:address}, {address:address}]}) + {$or: [{operatorAddress:address}, {delegatorAddress:address}, {address:address}]}) if (validator) { - let url = LCD + '/cosmos/distribution/v1beta1/validators/' + validator.operator_address; - balance.operator_address = validator.operator_address; + let url = LCD + '/cosmos/distribution/v1beta1/validators/' + validator.operatorAddress; + balance.operatorAddress = validator.operatorAddress; try { let rewards = HTTP.get(url); if (rewards.statusCode == 200){ diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 820491531..ff68864f4 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -569,7 +569,7 @@ Meteor.methods({ // get self delegation every 30 blocks if (height == curr+1){ //if (height % 50 == 2){ - // let url = LCD+`/cosmos/staking/v1beta1/delegators/${valData.delegator_address}/delegations/${valData.operatorAddress}` + // let url = LCD+`/cosmos/staking/v1beta1/delegators/${valData.delegatorAddress}/delegations/${valData.operatorAddress}` req = new Cosmos.Staking.QueryDelegationRequest(); req.setValidatorAddr(valData.operatorAddress); req.setDelegatorAddr(valData.delegatorAddress); diff --git a/imports/api/chain/server/publications.js b/imports/api/chain/server/publications.js index 6d968610b..895139db0 100644 --- a/imports/api/chain/server/publications.js +++ b/imports/api/chain/server/publications.js @@ -23,7 +23,7 @@ publishComposite('chain.status', function(){ {fields:{ address:1, description:1, - operator_address:1, + operatorAddress:1, status:-1, jailed:1, profile_url:1 diff --git a/imports/api/delegations/server/methods.js b/imports/api/delegations/server/methods.js index a6c4be3c6..85b3c0147 100644 --- a/imports/api/delegations/server/methods.js +++ b/imports/api/delegations/server/methods.js @@ -9,8 +9,8 @@ Meteor.methods({ let delegations = []; console.log("=== Getting delegations ==="); for (v in validators){ - if (validators[v].operator_address){ - let url = LCD + '/cosmos/staking/v1beta1/validators/'+validators[v].operator_address+"/delegations"; + if (validators[v].operatorAddress){ + let url = LCD + '/cosmos/staking/v1beta1/validators/'+validators[v].operatorAddress+"/delegations"; try{ let response = HTTP.get(url); if (response.statusCode == 200){ diff --git a/imports/api/proposals/server/methods.js b/imports/api/proposals/server/methods.js index c3c5f8d46..6bddbba6d 100644 --- a/imports/api/proposals/server/methods.js +++ b/imports/api/proposals/server/methods.js @@ -106,15 +106,15 @@ const getVoteDetail = (votes) => { let voters = votes.map((vote) => vote.voter); let votingPowerMap = {}; let validatorAddressMap = {}; - Validators.find({delegator_address: {$in: voters}}).forEach((validator) => { - votingPowerMap[validator.delegator_address] = { + Validators.find({delegatorAddress: {$in: voters}}).forEach((validator) => { + votingPowerMap[validator.delegatorAddress] = { moniker: validator.description.moniker, address: validator.address, tokens: parseFloat(validator.tokens), - delegatorShares: parseFloat(validator.delegator_shares), - deductedShares: parseFloat(validator.delegator_shares) + delegatorShares: parseFloat(validator.delegatorShares), + deductedShares: parseFloat(validator.delegatorShares) } - validatorAddressMap[validator.operator_address] = validator.delegator_address; + validatorAddressMap[validator.operatorAddress] = validator.delegatorAddress; }); voters.forEach((voter) => { if (!votingPowerMap[voter]) { @@ -133,14 +133,14 @@ const getVoteDetail = (votes) => { // deduct delegated shareds from validator if a delegator votes let validator = votingPowerMap[validatorAddressMap[delegation.validator_address]]; validator.deductedShares -= shares; - if (validator.delegator_shares != 0){ // avoiding division by zero + if (validator.delegatorShares != 0){ // avoiding division by zero votingPower += (shares/validator.delegatorShares) * validator.tokens; } } else { - let validator = Validators.findOne({operator_address: delegation.validator_address}); - if (validator && validator.delegator_shares != 0){ // avoiding division by zero - votingPower += (shares/parseFloat(validator.delegator_shares)) * parseFloat(validator.tokens); + let validator = Validators.findOne({operatorAddress: delegation.validator_address}); + if (validator && validator.delegatorShares != 0){ // avoiding division by zero + votingPower += (shares/parseFloat(validator.delegatorShares)) * parseFloat(validator.tokens); } } }); diff --git a/imports/api/records/server/publications.js b/imports/api/records/server/publications.js index d0ce70b41..27200580b 100644 --- a/imports/api/records/server/publications.js +++ b/imports/api/records/server/publications.js @@ -60,7 +60,7 @@ publishComposite('missedrecords.validator', function(address, type){ find(){ return Validators.find( {}, - {fields:{address:1, description:1, operator_address:1}} + {fields:{address:1, description:1, operatorAddress:1}} ) } } diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index 666840a80..bd6c9e30e 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -94,14 +94,14 @@ Meteor.methods({ // address is either delegator address or validator operator address let validator; if (!fields) - fields = {address:1, description:1, operator_address:1, delegator_address:1}; + fields = {address:1, description:1, operatorAddress:1, delegatorAddress:1}; if (address.includes(Meteor.settings.public.bech32PrefixValAddr)){ // validator operator address - validator = Validators.findOne({operator_address:address}, {fields}); + validator = Validators.findOne({operatorAddress:address}, {fields}); } else if (address.includes(Meteor.settings.public.bech32PrefixAccAddr)){ // delegator address - validator = Validators.findOne({delegator_address:address}, {fields}); + validator = Validators.findOne({delegatorAddress:address}, {fields}); } else if (address.length === AddressLength) { validator = Validators.findOne({address:address}, {fields}); diff --git a/imports/api/validators/server/methods.js b/imports/api/validators/server/methods.js index 8b6edafc9..cfbb31e3f 100644 --- a/imports/api/validators/server/methods.js +++ b/imports/api/validators/server/methods.js @@ -7,7 +7,7 @@ Meteor.methods({ this.unblock(); // look up the create validator time to consider if the validator has never updated the commission let tx = Transactions.findOne({$and:[ - {"tx.body.messages.value.delegator_address":address}, + {"tx.body.messages.value.delegatorAddress":address}, {"tx.body.messages.type":"cosmos-sdk/MsgCreateValidator"}, {code:{$exists:false}} ]}); diff --git a/imports/api/validators/server/publications.js b/imports/api/validators/server/publications.js index a2adcc00d..30876b02f 100644 --- a/imports/api/validators/server/publications.js +++ b/imports/api/validators/server/publications.js @@ -44,7 +44,7 @@ Meteor.publish('validators.voting_power', function(){ publishComposite('validator.details', function(address){ let options = {address:address}; if (address.indexOf(Meteor.settings.public.bech32PrefixValAddr) != -1){ - options = {operator_address:address} + options = {operatorAddress:address} } return { find(){ diff --git a/imports/startup/server/create-indexes.js b/imports/startup/server/create-indexes.js index f72aeeccc..35ab91daa 100644 --- a/imports/startup/server/create-indexes.js +++ b/imports/startup/server/create-indexes.js @@ -44,7 +44,7 @@ Transactions.rawCollection().createIndex({processed:1}); Transactions.rawCollection().createIndex({"logs.events.attributes.key":1}); Transactions.rawCollection().createIndex({"logs.events.attributes.value":1}); Transactions.rawCollection().createIndex({ - "tx.value.msg.value.delegator_address":1, + "tx.value.msg.value.delegatorAddress":1, "tx.value.msg.type":1, "code": 1 },{partialFilterExpression: {code:{$exists: true}}}) diff --git a/imports/ui/accounts/Account.jsx b/imports/ui/accounts/Account.jsx index 3b1c91c38..68fcfb890 100644 --- a/imports/ui/accounts/Account.jsx +++ b/imports/ui/accounts/Account.jsx @@ -171,7 +171,7 @@ export default class AccountDetails extends Component{ this.state.total[i].amount = parseFloat(this.state.total[i].amount) + parseFloat(commissions.amount); this.setState({ - operator_address: result.operator_address, + operatorAddress: result.operatorAddress, commission: [...this.state.commission, commissionAmount], total: [...this.state.total] }) @@ -337,7 +337,7 @@ export default class AccountDetails extends Component{ {this.state.user? - {this.state.user===this.state.address?:null} + {this.state.user===this.state.address?:null} :null}
accounts.total diff --git a/imports/ui/blocks/Block.jsx b/imports/ui/blocks/Block.jsx index c018139a0..d887dd6f9 100644 --- a/imports/ui/blocks/Block.jsx +++ b/imports/ui/blocks/Block.jsx @@ -65,7 +65,7 @@ export default class Block extends Component{ common.hash {block.hash} blocks.proposer - {moniker} + {moniker} blocks.numOfTransactions {numbro(block.transNum).format("0,0")} common.time diff --git a/imports/ui/components/Account.jsx b/imports/ui/components/Account.jsx index 260b230dc..e581a6389 100644 --- a/imports/ui/components/Account.jsx +++ b/imports/ui/components/Account.jsx @@ -17,18 +17,18 @@ export default class Account extends Component{ } getFields() { - return {address:1, description:1, operator_address:1, delegator_address:1, profile_url:1}; + return {address:1, description:1, operatorAddress:1, delegatorAddress:1, profile_url:1}; } getAccount = () => { let address = this.props.address; let validator = Validators.findOne( - {$or: [{operator_address:address}, {delegator_address:address}, {address:address}]}, + {$or: [{operatorAddress:address}, {delegatorAddress:address}, {address:address}]}, {fields: this.getFields() }); if (validator) this.setState({ address: `/validator/${validator.address}`, - moniker: validator.description?validator.description.moniker:validator.operator_address, + moniker: validator.description?validator.description.moniker:validator.operatorAddress, validator: validator }); else @@ -46,7 +46,7 @@ export default class Account extends Component{ // console.log(result); this.setState({ address: `/validator/${result.address}`, - moniker: result.description?result.description.moniker:result.operator_address, + moniker: result.description?result.description.moniker:result.operatorAddress, validator: result }); } @@ -56,8 +56,8 @@ export default class Account extends Component{ getAccount = () => { let address = this.props.address; let validator = Validators.findOne( - {$or: [{operator_address:address}, {delegator_address:address}, {address:address}]}, - {fields: {address:1, description:1, operator_address:1, delegator_address:1}}); + {$or: [{operatorAddress:address}, {delegatorAddress:address}, {address:address}]}, + {fields: {address:1, description:1, operatorAddress:1, delegatorAddress:1}}); if (validator) this.setState({ address: `/validator/${validator.address}`, diff --git a/imports/ui/components/AccountTooltip.jsx b/imports/ui/components/AccountTooltip.jsx index 8a095bd17..8ad85524b 100644 --- a/imports/ui/components/AccountTooltip.jsx +++ b/imports/ui/components/AccountTooltip.jsx @@ -27,13 +27,13 @@ export default class AccountTooltip extends Account{ return { status: 1, description: 1, - delegator_shares: 1, - operator_address: 1, + delegatorShares: 1, + operatorAddress: 1, tokens: 1, commission: 1, unbonding_time: 1, jailed: 1, - delegator_address: 1, + delegatorAddress: 1, address: 1, operator_pubkey: 1, voting_power: 1, @@ -68,8 +68,8 @@ export default class AccountTooltip extends Account{ {validator.self_delegation?numbro(validator.self_delegation).format('0.00%'):'N/A'} {(isActive)? - call_split { (validator.commission.commission_rates)? - numbro(validator.commission.commission_rates.rate).format('0.00%') : numbro(validator.commission.rate).format('0.00%') } + call_split { (validator.commission.commissionRates)? + numbro(validator.commission.commissionRates.rate).format('0.00%') : numbro(validator.commission.rate).format('0.00%') } :null} {(!isActive)? access_time diff --git a/imports/ui/components/Activities.jsx b/imports/ui/components/Activities.jsx index add15196b..2c75ac407 100644 --- a/imports/ui/components/Activities.jsx +++ b/imports/ui/components/Activities.jsx @@ -57,15 +57,15 @@ export default class Activites extends Component { // staking case "cosmos-sdk/MsgCreateValidator": - return

{(this.props.invalid)?activities.failedTo:''} activities.operatingAt activities.withMoniker {msg.value.description.moniker}common.fullStop

+ return

{(this.props.invalid)?activities.failedTo:''} activities.operatingAt activities.withMoniker {msg.value.description.moniker}common.fullStop

case "cosmos-sdk/MsgEditValidator": return

{(this.props.invalid)?activities.failedTo:''}

case "cosmos-sdk/MsgDelegate": - return

{(this.props.invalid)?activities.failedTo:''} {new Coin(msg.value.amount.amount, msg.value.amount.denom).toString(6)} activities.to common.fullStop

+ return

{(this.props.invalid)?activities.failedTo:''} {new Coin(msg.value.amount.amount, msg.value.amount.denom).toString(6)} activities.to common.fullStop

case "cosmos-sdk/MsgUndelegate": - return

{(this.props.invalid)?activities.failedTo:''} {new Coin(msg.value.amount.amount, msg.value.amount.denom).toString(6)} activities.from common.fullStop

+ return

{(this.props.invalid)?activities.failedTo:''} {new Coin(msg.value.amount.amount, msg.value.amount.denom).toString(6)} activities.from common.fullStop

case "cosmos-sdk/MsgBeginRedelegate": - return

{(this.props.invalid)?activities.failedTo:''} {new Coin(msg.value.amount.amount, msg.value.amount.denom).toString(6)} activities.from activities.to common.fullStop

+ return

{(this.props.invalid)?activities.failedTo:''} {new Coin(msg.value.amount.amount, msg.value.amount.denom).toString(6)} activities.from activities.to common.fullStop

// gov case "cosmos-sdk/MsgSubmitProposal": @@ -81,9 +81,9 @@ export default class Activites extends Component { case "cosmos-sdk/MsgWithdrawValidatorCommission": return

{(this.props.invalid)?activities.failedTo:''} {(!this.props.invalid)?activities.withAmount:''}common.fullStop

case "cosmos-sdk/MsgWithdrawDelegationReward": - return

{(this.props.invalid)?activities.failedTo:''} {(!this.props.invalid)?activities.withAmount:''} activities.from common.fullStop

+ return

{(this.props.invalid)?activities.failedTo:''} {(!this.props.invalid)?activities.withAmount:''} activities.from common.fullStop

case "cosmos-sdk/MsgModifyWithdrawAddress": - return

{(this.props.invalid)?activities.failedTo:''}

+ return

{(this.props.invalid)?activities.failedTo:''}

// slashing case "cosmos-sdk/MsgUnjail": diff --git a/imports/ui/components/PowerHistory.jsx b/imports/ui/components/PowerHistory.jsx index 21cd281d9..eb5e88f48 100644 --- a/imports/ui/components/PowerHistory.jsx +++ b/imports/ui/components/PowerHistory.jsx @@ -33,7 +33,7 @@ export default class PowerHistory extends React.Component { validators.delegator - + @@ -56,7 +56,7 @@ export default class PowerHistory extends React.Component { validators.delegator - + @@ -75,7 +75,7 @@ export default class PowerHistory extends React.Component { validators.delegator - + @@ -90,7 +90,7 @@ export default class PowerHistory extends React.Component { validators.delegator - + diff --git a/imports/ui/ledger/LedgerActions.jsx b/imports/ui/ledger/LedgerActions.jsx index f84a7fcbe..b6c4410b9 100644 --- a/imports/ui/ledger/LedgerActions.jsx +++ b/imports/ui/ledger/LedgerActions.jsx @@ -270,7 +270,7 @@ class LedgerButton extends Component { }); if (this.state.actionType === Types.REDELEGATE) { - Meteor.call('accounts.getAllRedelegations', this.state.user, this.props.validator.operator_address, (error, result) => { + Meteor.call('accounts.getAllRedelegations', this.state.user, this.props.validator.operatorAddress, (error, result) => { try{ if (result) this.setStateOnSuccess('loadingRedelegations', {redelegations: result}) @@ -348,20 +348,20 @@ class LedgerButton extends Component { case Types.DELEGATE: txMsg = Ledger.createDelegate( this.getTxContext(), - this.props.validator.operator_address, + this.props.validator.operatorAddress, this.state.delegateAmount.amount) break; case Types.REDELEGATE: txMsg = Ledger.createRedelegate( this.getTxContext(), - this.props.validator.operator_address, - this.state.targetValidator.operator_address, + this.props.validator.operatorAddress, + this.state.targetValidator.operatorAddress, this.state.delegateAmount.amount) break; case Types.UNDELEGATE: txMsg = Ledger.createUndelegate( this.getTxContext(), - this.props.validator.operator_address, + this.props.validator.operatorAddress, this.state.delegateAmount.amount); break; case Types.SEND: @@ -467,7 +467,7 @@ class LedgerButton extends Component { let value; switch (dataset.type) { case 'validator': - value = { moniker: dataset.moniker, operator_address: dataset.address} + value = { moniker: dataset.moniker, operatorAddress: dataset.address} break; case 'coin': value = new Coin(target.value, target.nextSibling.innerText) @@ -537,14 +537,14 @@ class LedgerButton extends Component { {activeValidators.map((validator, i) => { if (validator.address === this.props.validator.address) return null - let redelegation = redelegations[validator.operator_address] + let redelegation = redelegations[validator.operatorAddress] let disabled = redelegation && (redelegation.count >= maxEntries); let completionTime = disabled?:null; let id = `validator-option${i}` return
+ data-moniker={validator.description.moniker} data-address={validator.operatorAddress}> {validator.description.moniker} @@ -644,8 +644,8 @@ class DelegationButtons extends LedgerButton { if (this.state.actionType === Types.REDELEGATE) isValid = isValid || (this.state.targetValidator && - this.state.targetValidator.operator_address && - isValidatorAddress(this.state.targetValidator.operator_address)) + this.state.targetValidator.operatorAddress && + isValidatorAddress(this.state.targetValidator.operatorAddress)) return isValid } @@ -657,7 +657,7 @@ class DelegationButtons extends LedgerButton { let availableStatement; let moniker = this.props.validator.description && this.props.validator.description.moniker; - let validatorAddress = this.props.validator.operator_address; + let validatorAddress = this.props.validator.operatorAddress; switch (this.state.actionType) { case Types.DELEGATE: action = 'Delegate to'; @@ -700,11 +700,11 @@ class DelegationButtons extends LedgerButton { getConfirmationMessage = () => { switch (this.state.actionType) { case Types.DELEGATE: - return You are going to delegate to with . + return You are going to delegate to with . case Types.REDELEGATE: - return You are going to redelegate from to with . + return You are going to redelegate from to with . case Types.UNDELEGATE: - return You are going to undelegate from with . + return You are going to undelegate from with . } } @@ -1077,7 +1077,7 @@ DelegationButtons.propTypes = { details: PropTypes.string, }), jailed: PropTypes.bool, - operator_address: PropTypes.string, + operatorAddress: PropTypes.string, profile_url: PropTypes.string, status: PropTypes.number }), diff --git a/imports/ui/ledger/ledger.js b/imports/ui/ledger/ledger.js index 567eee222..594210e56 100644 --- a/imports/ui/ledger/ledger.js +++ b/imports/ui/ledger/ledger.js @@ -317,7 +317,7 @@ export class Ledger { amount: uatomAmount.toString(), denom: txContext.denom, }, - delegator_address: txContext.bech32, + delegatorAddress: txContext.bech32, validator_address: validatorBech32, }, }; @@ -339,7 +339,7 @@ export class Ledger { amount: uatomAmount.toString(), denom: txContext.denom, }, - delegator_address: txContext.bech32, + delegatorAddress: txContext.bech32, validator_address: validatorBech32, }, }; @@ -362,7 +362,7 @@ export class Ledger { amount: uatomAmount.toString(), denom: txContext.denom, }, - delegator_address: txContext.bech32, + delegatorAddress: txContext.bech32, validator_dst_address: validatorDestBech32, validator_src_address: validatorSourceBech32, }, diff --git a/imports/ui/validators/Delegations.jsx b/imports/ui/validators/Delegations.jsx index 3a7df8e8a..7d585fca4 100644 --- a/imports/ui/validators/Delegations.jsx +++ b/imports/ui/validators/Delegations.jsx @@ -37,7 +37,7 @@ export default class ValidatorDelegations extends Component{ numDelegatiors:delegations.length, delegations: delegations.map((d, i) => { return - + {new Coin((d.shares/this.props.shares*this.props.tokens), this.props.denom).stakeString()} }) diff --git a/imports/ui/validators/List.jsx b/imports/ui/validators/List.jsx index 6241a9bcc..58968e478 100644 --- a/imports/ui/validators/List.jsx +++ b/imports/ui/validators/List.jsx @@ -13,10 +13,10 @@ const ValidatorRow = (props) => { return {props.index+1} - {moniker} + {moniker} power {props.validator.voting_power?numbro(props.validator.voting_power).format('0,0'):0} ({props.validator.voting_power?numbro(props.validator.voting_power/props.totalPower).format('0.00%'):"0.00%"}) equalizer {props.validator.self_delegation?numbro(props.validator.self_delegation).format('0.00%'):'N/A'} - {(!props.inactive)?call_split {(props.validator.commission&&props.validator.commission.commission_rates)?numbro(props.validator.commission.commission_rates.rate).format('0.00%'):''}:''} + {(!props.inactive)?call_split {(props.validator.commission&&props.validator.commission.commissionRates)?numbro(props.validator.commission.commissionRates.rate/Meteor.settings.public.humanizeReduction).format('0.00%'):''}:''} {(!props.inactive)?{props.validator.uptime?props.validator.uptime.toFixed(2):0}% :''} {(props.inactive)?{props.validator.lastSeen?:''}:''} {(props.inactive)?{(props.validator.status == 1)?Unbonded:Unbonding}:''} diff --git a/imports/ui/validators/ListContainer.js b/imports/ui/validators/ListContainer.js index 3b9b6f510..ca660d6be 100644 --- a/imports/ui/validators/ListContainer.js +++ b/imports/ui/validators/ListContainer.js @@ -38,7 +38,7 @@ export default ValidatorListContainer = withTracker((props) => { options = { sort:{ "description.moniker": props.monikerDir, - "commission.commission_rates.rate": props.commissionDir, + "commission.commissionRates.rate": props.commissionDir, uptime: props.uptimeDir, voting_power: props.votingPowerDir, self_delegation: props.selfDelDir @@ -51,7 +51,7 @@ export default ValidatorListContainer = withTracker((props) => { voting_power: props.votingPowerDir, "description.moniker": props.monikerDir, uptime: props.uptimeDir, - "commission.commission_rates.rate": props.commissionDir, + "commission.commissionRates.rate": props.commissionDir, self_delegation: props.selfDelDir } } @@ -62,7 +62,7 @@ export default ValidatorListContainer = withTracker((props) => { uptime: props.uptimeDir, "description.moniker": props.monikerDir, voting_power: props.votingPowerDir, - "commission.commission_rates.rate": props.commissionDir, + "commission.commissionRates.rate": props.commissionDir, self_delegation: props.selfDelDir, } } @@ -70,7 +70,7 @@ export default ValidatorListContainer = withTracker((props) => { case 3: options = { sort:{ - "commission.commission_rates.rate": props.commissionDir, + "commission.commissionRates.rate": props.commissionDir, "description.moniker": props.monikerDir, voting_power: props.votingPowerDir, uptime: props.uptimeDir, @@ -83,7 +83,7 @@ export default ValidatorListContainer = withTracker((props) => { sort:{ self_delegation: props.selfDelDir, "description.moniker": props.monikerDir, - "commission.commission_rates.rate": props.commissionDir, + "commission.commissionRates.rate": props.commissionDir, voting_power: props.votingPowerDir, uptime: props.uptimeDir, } diff --git a/imports/ui/validators/Validator.jsx b/imports/ui/validators/Validator.jsx index bd70cda76..0b79a6418 100644 --- a/imports/ui/validators/Validator.jsx +++ b/imports/ui/validators/Validator.jsx @@ -18,6 +18,7 @@ import i18n from 'meteor/universe:i18n'; import TimeStamp from '../components/TimeStamp.jsx'; import SentryBoundary from '../components/SentryBoundary.jsx'; import Coin from '../../../both/utils/coins.js'; +import { goTimeToISOString } from '../../../both/utils/time'; const T = i18n.createComponent(); @@ -55,9 +56,9 @@ export default class Validator extends Component{ getUserDelegations() { if (this.state.user && this.props.validator && this.props.validator.address) { - Meteor.call('accounts.getDelegation', this.state.user, this.props.validator.operator_address, (err, res) => { + Meteor.call('accounts.getDelegation', this.state.user, this.props.validator.operatorAddress, (err, res) => { if (res && res.shares > 0) { - res.tokenPerShare = this.props.validator.tokens/this.props.validator.delegator_shares + res.tokenPerShare = this.props.validator.tokens/this.props.validator.delegatorShares this.setState({ currentUserDelegation: res }) @@ -101,32 +102,33 @@ export default class Validator extends Component{ } if (this.props.validator.commission){ - if (this.props.validator.commission.update_time == Meteor.settings.public.genesisTime){ + let updateTime = goTimeToISOString(this.props.validator.commission.updateTime); + if (updateTime == Meteor.settings.public.genesisTime){ this.setState({ updateTime: "Never changed" }); } else{ - Meteor.call('Validators.findCreateValidatorTime', this.props.validator.delegator_address, (error, result) => { + Meteor.call('Validators.findCreateValidatorTime', this.props.validator.delegatorAddress, (error, result) => { if (error){ console.warn(error); } else{ if (result){ - if (result == this.props.validator.commission.update_time){ + if (result == updateTime){ this.setState({ updateTime: "Never changed" }); } else{ this.setState({ - updateTime: "Updated "+moment(this.props.validator.commission.update_time).fromNow() + updateTime: "Updated "+moment(updateTime).fromNow() }); } } else{ this.setState({ - updateTime: "Updated "+moment(this.props.validator.commission.update_time).fromNow() + updateTime: "Updated "+moment(updateTime).fromNow() }); } } @@ -147,7 +149,7 @@ export default class Validator extends Component{ votingPower={history.voting_power} time={history.block_time} height={history.height} - address={this.props.validator.operator_address} + address={this.props.validator.operatorAddress} /> }) }) @@ -167,10 +169,10 @@ export default class Validator extends Component{ renderShareLink() { let validator = this.props.validator; - let primaryLink = `/validator/${validator.operator_address}` + let primaryLink = `/validator/${validator.operatorAddress}` let otherLinks = [ {label: 'Delegate', url: `${primaryLink}/delegate`}, - {label: 'Transfer', url: `/account/${validator.delegator_address}/send`} + {label: 'Transfer', url: `/account/${validator.delegatorAddress}/send`} ] return @@ -225,15 +227,15 @@ export default class Validator extends Component{ validators.operatorAddress - {this.props.validator.operator_address} + {this.props.validator.operatorAddress} validators.selfDelegationAddress - {this.props.validator.delegator_address} + {this.props.validator.delegatorAddress} validators.commissionRate - {this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.rate*100).format('0.00')+"%":''} ({this.state.updateTime}) + {this.props.validator.commission&&this.props.validator.commission.commissionRates?numbro(this.props.validator.commission.commissionRates.rate*100/Meteor.settings.public.humanizeReduction).format('0.00')+"%":''} ({this.state.updateTime}) validators.maxRate - {this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.max_rate*100).format('0.00')+"%":''} + {this.props.validator.commission&&this.props.validator.commission.commissionRates?numbro(this.props.validator.commission.commissionRates.maxRate*100/Meteor.settings.public.humanizeReduction).format('0.00')+"%":''} validators.maxChangeRate - {this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.max_change_rate*100).format('0.00')+"%":''} + {this.props.validator.commission&&this.props.validator.commission.commissionRates?numbro(this.props.validator.commission.commissionRates.maxChangeRate*100/Meteor.settings.public.humanizeReduction).format('0.00')+"%":''} @@ -250,35 +252,35 @@ export default class Validator extends Component{ validators.proposerPriority {this.props.validator.proposer_priority?numbro(this.props.validator.proposer_priority).format('0,0'):'N/A'} validators.delegatorShares - {numbro(this.props.validator.delegator_shares).format('0,0.00')} + {numbro(this.props.validator.delegatorShares/Meteor.settings.public.humanizeReduction).format('0,0.00')} {(this.state.currentUserDelegation)?validators.userDelegateShares:''} - {(this.state.currentUserDelegation)?{numbro(this.state.currentUserDelegation.shares).format('0,0.00')}:''} + {(this.state.currentUserDelegation)?{numbro(this.state.currentUserDelegation.shares/Meteor.settings.public.humanizeReduction).format('0,0.00')}:''} validators.tokens {numbro(this.props.validator.tokens).format('0,0.00')} {(this.props.validator.jailed)? validators.unbondingHeight - {numbro(this.props.validator.unbonding_height).format('0,0')} + {numbro(this.props.validator.unbondingHeight).format('0,0')} validators.unbondingTime - + :''}
{this.state.history}
} /> - } /> - } /> + } /> + } />
common.backToList diff --git a/imports/ui/validators/ValidatorContainer.js b/imports/ui/validators/ValidatorContainer.js index 74b172ff8..8e4c2cdd3 100644 --- a/imports/ui/validators/ValidatorContainer.js +++ b/imports/ui/validators/ValidatorContainer.js @@ -27,7 +27,7 @@ export default ValidatorDetailsContainer = withTracker((props) => { if (Meteor.isServer || !loading){ if (props.address.indexOf(Meteor.settings.public.bech32PrefixValAddr) != -1){ - options = {operator_address:props.address} + options = {operatorAddress:props.address} } validator = Validators.findOne(options); From 11342d1f2f5ab4c2fa37e109275f4aeaf4b89e91 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 26 Jan 2021 19:19:57 +0000 Subject: [PATCH 039/127] fix get uptime --- imports/api/blocks/server/methods.js | 52 ++++++++++++++-------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index ff68864f4..585f52c38 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -68,38 +68,36 @@ getValidatorProfileUrl = (identity) => { getValidatorUptime = async (validatorSet) => { // get validator uptime - let url = LCD+'/cosmos/slashing/v1beta1/params'; - let response = HTTP.get(url); + // let url = LCD+'/cosmos/slashing/v1beta1/params'; + // let response = HTTP.get(url); let req = new Cosmos.Slashing.QueryParamsRequest(); const slashingParams = await Cosmos.gRPC.unary(Cosmos.Slashing.Query.Params, req, GRPC); - // const slashingParams = JSON.parse(response.content).result; - - Chain.upsert({chainId:Meteor.settings.public.chainId}, {$set:{"slashing.params":slashingParams}}); + Chain.upsert({chainId:Meteor.settings.public.chainId}, {$set:{"slashing":slashingParams}}); for(let key in validatorSet){ - try{ - try { - let url = LCD+'/cosmos/slashing/v1beta1/signing_infos/'+validatorSet[key].bech32ValConsAddress; - let response = HTTP.get(url); - let signingInfo = JSON.parse(response.content).result; - if (signingInfo){ - let valData = validatorSet[key] - valData.tombstoned = signingInfo.tombstoned - valData.jailed_until = signingInfo.jailed_until - valData.index_offset = signingInfo.index_offset - valData.start_height = signingInfo.start_height - valData.uptime = (slashingParams.signed_blocks_window - parseInt(signingInfo.missed_blocks_counter))/slashingParams.signed_blocks_window * 100; - Validators.upsert({bech32ConsensusPubKey:validatorSet[key].bech32ConsensusPubKey}, {$set:valData}) - } - } - catch(e){ - console.log("Getting signing info of %o: %o", validatorSet[key].bech32ConsensusPubKey, e.response.statusCode); + // console.log("Getting uptime validator: %o", validatorSet[key]); + try { + // let url = LCD+'/cosmos/slashing/v1beta1/signing_infos/'+validatorSet[key].bech32ValConsAddress; + // let response = HTTP.get(url); + // let signingInfo = JSON.parse(response.content).result; + req = new Cosmos.Slashing.QuerySigningInfoRequest(); + req.setConsAddress(validatorSet[key].bech32ValConsAddress); + let signingInfo = await Cosmos.gRPC.unary(Cosmos.Slashing.Query.SigningInfo, req, GRPC); + console.log("=== Signing Info ===: %o", signingInfo) + if (signingInfo){ + let valData = validatorSet[key] + valData.tombstoned = signingInfo.valSigningInfo.tombstoned + valData.jailed_until = goTimeToISOString(signingInfo.valSigningInfo.jailedUntil); + valData.index_offset = signingInfo.valSigningInfo.indexOffset + valData.start_height = signingInfo.valSigningInfo.startHeight + valData.uptime = (slashingParams.params.signedBlocksWindow - parseInt(signingInfo.valSigningInfo.missedBlocksCounter))/slashingParams.params.signedBlocksWindow * 100; + Validators.upsert({bech32ValConsAddress:validatorSet[key].bech32ValConsAddress}, {$set:valData}) } } catch(e){ - console.log(e); + console.log("Getting signing info of %o: %o", validatorSet[key].bech32ValConsAddress, e); } } } @@ -476,12 +474,12 @@ Meteor.methods({ valData.bech32ConsensusPubKey = Meteor.call('pubkeyToBech32', valData.consensusPubkey, Meteor.settings.public.bech32PrefixConsPub); - // assign back to the validator set so that we can use it to find the uptime - validatorSet[v].bech32ConsensusPubKey = valData.bech32ConsensusPubKey; - valData.address = Meteor.call('getAddressFromPubkey', valData.consensusPubkey); valData.bech32ValConsAddress = Meteor.call('hexToBech32', valData.address, Meteor.settings.public.bech32PrefixConsAddr); + // assign back to the validator set so that we can use it to find the uptime + validatorSet[v].bech32ValConsAddress = valData.bech32ValConsAddress; + // First time adding validator to the database. // Fetch profile picture from Keybase @@ -520,6 +518,8 @@ Meteor.methods({ // assign to valData for getting self delegation valData.delegatorAddress = valExist.delegatorAddress; + validatorSet[v].bech32ValConsAddress = valExist.bech32ValConsAddress; + if (validators[valData.consensusPubkey.value]){ // Validator exists and is in validator set, update voitng power. // If voting power is different from before, add voting power history From aea3fd632f961c95622de027e01dafe802194174 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 30 Jan 2021 10:28:30 +0000 Subject: [PATCH 040/127] add new fields to settings.json --- default_settings.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/default_settings.json b/default_settings.json index 8fa797a62..40ece161a 100644 --- a/default_settings.json +++ b/default_settings.json @@ -15,6 +15,7 @@ "bech32PrefixConsPub": "cosmosvalconspub", "bondDenom": "uatom", "powerReduction": 1000000, + "humanizeReduction": 1000000000000000000, "coins": [ { "denom": "uatom", @@ -28,6 +29,7 @@ } ], "modules": { + "bank": true, "supply": true, "minting": false, "gov": true, From 20a668465c6b7145dba92eb708d0bdce9b4b3e53 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 30 Jan 2021 10:31:02 +0000 Subject: [PATCH 041/127] only save validator data at start or after number of blcoks --- imports/api/blocks/server/methods.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 585f52c38..668541198 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -567,8 +567,9 @@ Meteor.methods({ } } + // only update validator infor during start of crawling, end of crawling or every validator update window // get self delegation every 30 blocks - if (height == curr+1){ //if (height % 50 == 2){ + if ((height == Meteor.settings.params.startHeight) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ // let url = LCD+`/cosmos/staking/v1beta1/delegators/${valData.delegatorAddress}/delegations/${valData.operatorAddress}` req = new Cosmos.Staking.QueryDelegationRequest(); req.setValidatorAddr(valData.operatorAddress); @@ -584,13 +585,12 @@ Meteor.methods({ catch(e){ console.log("Getting self delegation: %o", e) } - } - // only update validator infor during start of crawling, end of crawling or every validator update window - if ((height == curr+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ console.log("Add validator upsert to bulk operations.") bulkValidators.find({"consensusPubkey.value": valData.consensusPubkey.value}).upsert().updateOne({$set:valData}); + } + } // store valdiators exist records From 54c8ec2bb7b6e9df89152a9dc484fa183bf2ba9f Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 30 Jan 2021 10:33:21 +0000 Subject: [PATCH 042/127] remove some comments of the old LCD --- imports/api/blocks/server/methods.js | 9 --------- imports/api/chain/server/methods.js | 2 -- imports/api/transactions/server/methods.js | 4 ---- 3 files changed, 15 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 668541198..d5e73f93c 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -68,8 +68,6 @@ getValidatorProfileUrl = (identity) => { getValidatorUptime = async (validatorSet) => { // get validator uptime - // let url = LCD+'/cosmos/slashing/v1beta1/params'; - // let response = HTTP.get(url); let req = new Cosmos.Slashing.QueryParamsRequest(); const slashingParams = await Cosmos.gRPC.unary(Cosmos.Slashing.Query.Params, req, GRPC); @@ -79,9 +77,6 @@ getValidatorUptime = async (validatorSet) => { for(let key in validatorSet){ // console.log("Getting uptime validator: %o", validatorSet[key]); try { - // let url = LCD+'/cosmos/slashing/v1beta1/signing_infos/'+validatorSet[key].bech32ValConsAddress; - // let response = HTTP.get(url); - // let signingInfo = JSON.parse(response.content).result; req = new Cosmos.Slashing.QuerySigningInfoRequest(); req.setConsAddress(validatorSet[key].bech32ValConsAddress); let signingInfo = await Cosmos.gRPC.unary(Cosmos.Slashing.Query.SigningInfo, req, GRPC); @@ -218,7 +213,6 @@ Meteor.methods({ let validatorSet = {} // get latest validator candidate information - // url = LCD+'/cosmos/staking/v1beta1/validators'; let req = new Cosmos.Staking.QueryValidatorsRequest() let res; @@ -233,7 +227,6 @@ Meteor.methods({ console.log(e); } - // url = LCD+'/cosmos/staking/v1beta1/validators?status=unbonding'; try{ // response = HTTP.get(url); req.setStatus("BOND_STATUS_UNBONDING") @@ -244,7 +237,6 @@ Meteor.methods({ console.log(e); } - // url = LCD+'/cosmos/staking/v1beta1/validators?status=unbonded'; try{ req.setStatus("BOND_STATUS_UNBONDED") res = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Validators, req, GRPC); @@ -570,7 +562,6 @@ Meteor.methods({ // only update validator infor during start of crawling, end of crawling or every validator update window // get self delegation every 30 blocks if ((height == Meteor.settings.params.startHeight) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ - // let url = LCD+`/cosmos/staking/v1beta1/delegators/${valData.delegatorAddress}/delegations/${valData.operatorAddress}` req = new Cosmos.Staking.QueryDelegationRequest(); req.setValidatorAddr(valData.operatorAddress); req.setDelegatorAddr(valData.delegatorAddress); diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index 782fb6e38..105d9007f 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -122,7 +122,6 @@ Meteor.methods({ } if (Meteor.settings.public.modules.minting){ - // url = LCD + '/cosmos/minting/v1beta1/inflation'; try{ req = new Cosmos.Mint.QueryInflationRequest() let inflation = await Cosmos.gRPC.unary(Cosmos.Mint.Query.Inflation, req, GRPC); @@ -137,7 +136,6 @@ Meteor.methods({ console.log(e); } - // url = LCD + '/cosmos/minting/v1beta1/annual_provisions'; try{ req = new Cosmos.Mint.QueryAnnualProvisionsRequest(); let provisions = await Cosmos.gRPC.unary(Cosmos.Mint.Query.AnnualProvisions, req, GRPC) diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index bd6c9e30e..f8b199000 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -18,10 +18,6 @@ Meteor.methods({ const bulkTransactions = Transactions.rawCollection().initializeUnorderedBulkOp(); for (let i in transactions){ try { - // let url = LCD+ '/cosmos/tx/v1beta1/txs/'+transactions[i].txhash; - // let response = HTTP.get(url); - // let tx = JSON.parse(response.content); - let req = new Cosmos.Tx.GetTxRequest(); req.setHash(transactions[i].txhash); let tx = await Cosmos.gRPC.unary(Cosmos.Tx.Service.GetTx, req, GRPC); From d86ac79474c37e4f31ec3055c98b5c08da6d8ad9 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 30 Jan 2021 14:49:26 +0000 Subject: [PATCH 043/127] update validator delegations --- imports/api/delegations/server/methods.js | 27 +++++++++++++--------- imports/api/transactions/server/methods.js | 1 - 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/imports/api/delegations/server/methods.js b/imports/api/delegations/server/methods.js index 85b3c0147..5a2c9baba 100644 --- a/imports/api/delegations/server/methods.js +++ b/imports/api/delegations/server/methods.js @@ -1,26 +1,31 @@ import { Meteor } from 'meteor/meteor'; import { Delegations } from '../delegations.js'; import { Validators } from '../../validators/validators.js'; +import { Cosmos } from '@forbole/cosmos-protobuf-js' Meteor.methods({ - 'delegations.getDelegations': function(){ + 'delegations.getDelegations': async function(){ this.unblock(); let validators = Validators.find({}).fetch(); let delegations = []; console.log("=== Getting delegations ==="); for (v in validators){ if (validators[v].operatorAddress){ - let url = LCD + '/cosmos/staking/v1beta1/validators/'+validators[v].operatorAddress+"/delegations"; + // let url = LCD + '/cosmos/staking/v1beta1/validators/'+validators[v].operatorAddress+"/delegations"; try{ - let response = HTTP.get(url); - if (response.statusCode == 200){ - let delegation = JSON.parse(response.content).result; - // console.log(delegation); - delegations = delegations.concat(delegation); - } - else{ - console.log(response.statusCode); - } + // let response = HTTP.get(url); + // if (response.statusCode == 200){ + // let delegation = JSON.parse(response.content).result; + // // console.log(delegation); + // delegations = delegations.concat(delegation); + // } + // else{ + // console.log(response.statusCode); + // } + let req = new Cosmos.Staking.QueryValidatorDelegationsRequest(); + req.setValidatorAddr(validators[v].operatorAddress); + let delegations = await Cosmos.gRPC.unary(Cosmos.Staking.Query.ValidatorDelegations, req, GRPC); + console.log("delegations: %o", delegations); } catch (e){ console.log(url); diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index f8b199000..431b672d1 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -1,5 +1,4 @@ import { Meteor } from 'meteor/meteor'; -import { HTTP } from 'meteor/http'; import { Transactions } from '../../transactions/transactions.js'; import { Validators } from '../../validators/validators.js'; import { Cosmos } from '@forbole/cosmos-protobuf-js' From 885ca18f416d3c95b3ee1aa55a9bc218ee88d9ba Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 30 Jan 2021 15:30:49 +0000 Subject: [PATCH 044/127] update delegations --- imports/api/delegations/server/methods.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/imports/api/delegations/server/methods.js b/imports/api/delegations/server/methods.js index 5a2c9baba..ed5080ee1 100644 --- a/imports/api/delegations/server/methods.js +++ b/imports/api/delegations/server/methods.js @@ -28,20 +28,20 @@ Meteor.methods({ console.log("delegations: %o", delegations); } catch (e){ - console.log(url); + // console.log(url); console.log(e); } } } - for (i in delegations){ - if (delegations[i] && delegations[i].shares) - delegations[i].shares = parseFloat(delegations[i].shares); + for (i in delegations.delegationResponsesList){ + if (delegations.delegationResponsesList[i].delegation && delegations.delegationResponsesList[i].delegation.shares) + delegations.delegationResponsesList[i].delegation.shares = parseFloat(delegations.delegationResponsesList[i].delegation.shares); } // console.log(delegations); let data = { - delegations: delegations, + delegations: delegations.delegationResponsesList, createdAt: new Date(), } From 8ec0dcef14791805ab80d85c4988a6c4927b2c0e Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 30 Jan 2021 15:30:54 +0000 Subject: [PATCH 045/127] updat proposal list --- imports/api/blocks/server/methods.js | 1 + imports/api/proposals/server/methods.js | 18 +++++++----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index d5e73f93c..441bd97be 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -509,6 +509,7 @@ Meteor.methods({ // assign to valData for getting self delegation valData.delegatorAddress = valExist.delegatorAddress; + valData.bech32ValConsAddress = valExist.bech32ValConsAddress; validatorSet[v].bech32ValConsAddress = valExist.bech32ValConsAddress; diff --git a/imports/api/proposals/server/methods.js b/imports/api/proposals/server/methods.js index 6bddbba6d..daa246467 100644 --- a/imports/api/proposals/server/methods.js +++ b/imports/api/proposals/server/methods.js @@ -2,28 +2,24 @@ import { Meteor } from 'meteor/meteor'; import { HTTP } from 'meteor/http'; import { Proposals } from '../proposals.js'; import { Validators } from '../../validators/validators.js'; +import { Cosmos } from '@forbole/cosmos-protobuf-js' // import { Promise } from 'meteor/promise'; Meteor.methods({ - 'proposals.getProposals': function(){ + 'proposals.getProposals': async function(){ this.unblock(); try{ - let url = LCD + '/cosmos/gov/v1beta1/proposals'; - let response = HTTP.get(url); - let proposals = JSON.parse(response.content).result; - // console.log(proposals); - + let req = new Cosmos.Gov.QueryProposalsRequest(); + let proposals = await Cosmos.gRPC.unary(Cosmos.Gov.Query.Proposals, req, GRPC); let finishedProposalIds = new Set(Proposals.find( {"proposal_status":{$in:["Passed", "Rejected", "Removed"]}} ).fetch().map((p)=> p.proposalId)); let proposalIds = []; - if (proposals.length > 0){ - // Proposals.upsert() + if (proposals.proposalsList.length > 0){ const bulkProposals = Proposals.rawCollection().initializeUnorderedBulkOp(); - for (let i in proposals){ - let proposal = proposals[i]; - proposal.proposalId = parseInt(proposal.id); + for (let i in proposals.proposalsList){ + let proposal = proposals.proposalsList[i]; if (proposal.proposalId > 0 && !finishedProposalIds.has(proposal.proposalId)) { try{ let url = LCD + '/cosmos/gov/v1beta1/proposals/'+proposal.proposalId+'/proposer'; From e230a0ac5b5658116032b6c4d099b0ceca13d954 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 31 Jan 2021 15:20:55 +0000 Subject: [PATCH 046/127] update version --- private/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/version b/private/version index 51bb99b9d..1fdbdc009 100644 --- a/private/version +++ b/private/version @@ -1 +1 @@ -v0.40.x-rc1 +v0.40.x-v0.0.1 From 68be637bae0edde85a686abb276a25a5744db92b Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 31 Jan 2021 16:45:13 +0000 Subject: [PATCH 047/127] fix save validator height --- imports/api/blocks/server/methods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 441bd97be..e66db56e5 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -562,7 +562,7 @@ Meteor.methods({ // only update validator infor during start of crawling, end of crawling or every validator update window // get self delegation every 30 blocks - if ((height == Meteor.settings.params.startHeight) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ + if ((height == Meteor.settings.params.startHeight+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ req = new Cosmos.Staking.QueryDelegationRequest(); req.setValidatorAddr(valData.operatorAddress); req.setDelegatorAddr(valData.delegatorAddress); From de8734936f97079b7718b0799c0dec2ea45b132d Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 10 Feb 2021 11:31:02 +0000 Subject: [PATCH 048/127] check if validator set value exists before assigning value --- imports/api/blocks/server/methods.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index e66db56e5..9e482cdb8 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -511,7 +511,9 @@ Meteor.methods({ valData.delegatorAddress = valExist.delegatorAddress; valData.bech32ValConsAddress = valExist.bech32ValConsAddress; - validatorSet[v].bech32ValConsAddress = valExist.bech32ValConsAddress; + if (validatorSet[v]){ + validatorSet[v].bech32ValConsAddress = valExist.bech32ValConsAddress; + } if (validators[valData.consensusPubkey.value]){ // Validator exists and is in validator set, update voitng power. From 9da1dc2fb8535edd1757aa66f730f030db026fdb Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 16 Feb 2021 12:02:56 +0000 Subject: [PATCH 049/127] update cosmos protobuf --- package-lock.json | 965 ++++------------------------------------------ package.json | 2 +- 2 files changed, 66 insertions(+), 901 deletions(-) diff --git a/package-lock.json b/package-lock.json index 920554448..3a021c773 100644 --- a/package-lock.json +++ b/package-lock.json @@ -191,105 +191,10 @@ "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" }, - "@eslint/eslintrc": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", - "integrity": "sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==", - "requires": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "lodash": "^4.17.20", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "dependencies": { - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" - }, - "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==" - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "requires": { - "ms": "2.1.2" - } - }, - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" - }, - "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - } - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "requires": { - "type-fest": "^0.8.1" - } - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" - } - } - }, "@forbole/cosmos-protobuf-js": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@forbole/cosmos-protobuf-js/-/cosmos-protobuf-js-1.0.4.tgz", - "integrity": "sha512-L2TAakbFAzfV2A+qHfsqGmlaOtHW/9e1z2C1naoV6M1TrZsGEncbgbQgE9tDgY/9sJhbRqJHXerBPgB3bzoa8w==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@forbole/cosmos-protobuf-js/-/cosmos-protobuf-js-1.0.5.tgz", + "integrity": "sha512-zn6y697dcKqnK2BxiLnwkbW2b4z7QD2/vsjPB7o6DcdPV1Ce1VTyOX7vEXoaNOwAfAPCYJjBKPnmrnuRl8dKfA==", "requires": { "@improbable-eng/grpc-web": "^0.13.0", "@improbable-eng/grpc-web-node-http-transport": "^0.13.0", @@ -380,29 +285,6 @@ "integrity": "sha1-iMFN+7Si+iJY//SInM2N3Q7MsEs=", "dev": true }, - "@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", - "requires": { - "@nodelib/fs.stat": "2.0.4", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==" - }, - "@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", - "requires": { - "@nodelib/fs.scandir": "2.1.4", - "fastq": "^1.6.0" - } - }, "@popmotion/easing": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@popmotion/easing/-/easing-1.0.2.tgz", @@ -660,11 +542,6 @@ "resolved": "https://registry.npmjs.org/@types/is-plain-object/-/is-plain-object-0.0.2.tgz", "integrity": "sha1-Jbyntla6I/sDeZoGDbogGnlSED0=" }, - "@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==" - }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -704,145 +581,6 @@ "csstype": "^3.0.2" } }, - "@typescript-eslint/eslint-plugin": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.14.0.tgz", - "integrity": "sha512-IJ5e2W7uFNfg4qh9eHkHRUCbgZ8VKtGwD07kannJvM5t/GU8P8+24NX8gi3Hf5jST5oWPY8kyV1s/WtfiZ4+Ww==", - "requires": { - "@typescript-eslint/experimental-utils": "4.14.0", - "@typescript-eslint/scope-manager": "4.14.0", - "debug": "^4.1.1", - "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.15", - "regexpp": "^3.0.0", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==" - }, - "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, - "@typescript-eslint/experimental-utils": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.14.0.tgz", - "integrity": "sha512-6i6eAoiPlXMKRbXzvoQD5Yn9L7k9ezzGRvzC/x1V3650rUk3c3AOjQyGYyF9BDxQQDK2ElmKOZRD0CbtdkMzQQ==", - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.14.0", - "@typescript-eslint/types": "4.14.0", - "@typescript-eslint/typescript-estree": "4.14.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - }, - "dependencies": { - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" - } - } - }, - "@typescript-eslint/scope-manager": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.14.0.tgz", - "integrity": "sha512-/J+LlRMdbPh4RdL4hfP1eCwHN5bAhFAGOTsvE6SxsrM/47XQiPSgF5MDgLyp/i9kbZV9Lx80DW0OpPkzL+uf8Q==", - "requires": { - "@typescript-eslint/types": "4.14.0", - "@typescript-eslint/visitor-keys": "4.14.0" - } - }, - "@typescript-eslint/types": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.14.0.tgz", - "integrity": "sha512-VsQE4VvpldHrTFuVPY1ZnHn/Txw6cZGjL48e+iBxTi2ksa9DmebKjAeFmTVAYoSkTk7gjA7UqJ7pIsyifTsI4A==" - }, - "@typescript-eslint/typescript-estree": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.0.tgz", - "integrity": "sha512-wRjZ5qLao+bvS2F7pX4qi2oLcOONIB+ru8RGBieDptq/SudYwshveORwCVU4/yMAd4GK7Fsf8Uq1tjV838erag==", - "requires": { - "@typescript-eslint/types": "4.14.0", - "@typescript-eslint/visitor-keys": "4.14.0", - "debug": "^4.1.1", - "globby": "^11.0.1", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, - "@typescript-eslint/visitor-keys": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.0.tgz", - "integrity": "sha512-MeHHzUyRI50DuiPgV9+LxcM52FCJFYjJiWHtXlbyC27b80mfOwKeiKI+MHOTEpcpfmoPFm/vvQS88bYIx6PZTA==", - "requires": { - "@typescript-eslint/types": "4.14.0", - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==" - } - } - }, "acorn": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", @@ -859,6 +597,7 @@ "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "dev": true, "requires": { "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", @@ -866,11 +605,6 @@ "uri-js": "^4.2.2" } }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" - }, "ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", @@ -909,6 +643,7 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, "requires": { "sprintf-js": "~1.0.2" } @@ -999,11 +734,6 @@ } } }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" - }, "array.prototype.flat": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", @@ -1419,7 +1149,8 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base16": { "version": "1.0.0", @@ -1476,19 +1207,12 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", @@ -1529,7 +1253,8 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true }, "camelcase": { "version": "4.1.0", @@ -1815,7 +1540,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "confusing-browser-globals": { "version": "1.0.7", @@ -1896,44 +1622,6 @@ "node-fetch": "2.6.1" } }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "dependencies": { - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "requires": { - "isexe": "^2.0.0" - } - } - } - }, "crypto-js": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", @@ -2340,7 +2028,8 @@ "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true }, "define-properties": { "version": "1.1.3", @@ -2355,25 +2044,11 @@ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "requires": { - "path-type": "^4.0.0" - }, - "dependencies": { - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" - } - } - }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, "requires": { "esutils": "^2.0.2" } @@ -2489,14 +2164,6 @@ "once": "^1.4.0" } }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "requires": { - "ansi-colors": "^4.1.1" - } - }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", @@ -2929,350 +2596,11 @@ } }, "eslint-plugin-unused-imports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-1.0.1.tgz", - "integrity": "sha512-AVDcgeoZZoBH/g5743nvWQK7/V7w2RMILHvogfBnYa1s47los7G2ysEweRx0yJ8pSVnITJvxTBkefQbJowTi3w==", - "requires": { - "@typescript-eslint/eslint-plugin": "^4.5.0", - "eslint": "^7.11.0", - "eslint-rule-composer": "^0.3.0", - "requireindex": "~1.2.0", - "typescript": "^4.0.3" - }, - "dependencies": { - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" - }, - "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==" - }, - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==" - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "requires": { - "ms": "2.1.2" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "eslint": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.18.0.tgz", - "integrity": "sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ==", - "requires": { - "@babel/code-frame": "^7.0.0", - "@eslint/eslintrc": "^0.3.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.2.0", - "esutils": "^2.0.2", - "file-entry-cache": "^6.0.0", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash": "^4.17.20", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.4", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - } - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" - } - } - }, - "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==" - }, - "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" - } - } - }, - "esquery": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", - "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", - "requires": { - "estraverse": "^5.1.0" - } - }, - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "file-entry-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz", - "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==", - "requires": { - "flat-cache": "^3.0.4" - } - }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==" - }, - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "requires": { - "type-fest": "^0.8.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" - }, - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==" - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - }, - "table": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", - "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", - "requires": { - "ajv": "^7.0.2", - "lodash": "^4.17.20", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" - }, - "dependencies": { - "ajv": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.3.tgz", - "integrity": "sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - } - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "typescript": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", - "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==" - } + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-1.1.0.tgz", + "integrity": "sha512-4SLYlkCwAbudvKDKZqn/3KjHlKAoorTxnP7AkAMMXkz59pQCBUjKPEaDv5pQ7fOyfDvLPCJKLowCcTl6HXcCuA==", + "requires": { + "eslint-rule-composer": "^0.3.0" } }, "eslint-rule-composer": { @@ -3280,32 +2608,6 @@ "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==" }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "dependencies": { - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" - } - } - } - } - }, "eslint-utils": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", @@ -3343,7 +2645,8 @@ "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true }, "esquery": { "version": "1.0.1", @@ -3366,7 +2669,8 @@ "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true }, "estree-walker": { "version": "0.6.1", @@ -3406,38 +2710,20 @@ "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" - }, - "fast-glob": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", - "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - } + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" - }, - "fastq": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.0.tgz", - "integrity": "sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA==", - "requires": { - "reusify": "^1.0.4" - } + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true }, "fbemitter": { "version": "3.0.0", @@ -3497,14 +2783,6 @@ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, "find-cache-dir": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.2.0.tgz", @@ -3640,7 +2918,8 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "fsevents": { "version": "2.1.3", @@ -3656,7 +2935,8 @@ "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true }, "get-caller-file": { "version": "2.0.5", @@ -3690,6 +2970,7 @@ "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3699,39 +2980,11 @@ "path-is-absolute": "^1.0.0" } }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "requires": { - "is-glob": "^4.0.1" - } - }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, - "globby": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", - "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - }, - "dependencies": { - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" - } - } - }, "google-protobuf": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.14.0.tgz", @@ -3846,12 +3099,14 @@ "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true }, "import-fresh": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", + "dev": true, "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -3860,12 +3115,14 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -4077,34 +3334,16 @@ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, "is-negative-zero": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=" }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -4154,7 +3393,8 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "isobject": { "version": "3.0.1", @@ -4180,6 +3420,7 @@ "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -4193,7 +3434,8 @@ "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "json-stable-stringify": { "version": "1.0.1", @@ -4206,7 +3448,8 @@ "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true }, "json-stringify-safe": { "version": "5.0.1", @@ -4396,14 +3639,6 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, "make-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", @@ -4442,11 +3677,6 @@ "is-what": "^3.3.1" } }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" - }, "mersenne-twister": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mersenne-twister/-/mersenne-twister-1.1.0.tgz", @@ -5037,15 +4267,6 @@ } } }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", @@ -5066,6 +4287,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5116,7 +4338,8 @@ "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true }, "ndjson": { "version": "1.5.0", @@ -5444,6 +4667,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, "requires": { "callsites": "^3.0.0" } @@ -5478,7 +4702,8 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-is-inside": { "version": "1.0.2", @@ -5527,11 +4752,6 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" - }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -5899,7 +5119,8 @@ "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true }, "promise": { "version": "7.3.1", @@ -5941,7 +5162,8 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true }, "pure-color": { "version": "1.3.0", @@ -6284,21 +5506,11 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" - }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, - "requireindex": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", - "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==" - }, "resolve": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", @@ -6311,7 +5523,8 @@ "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true }, "resolve-pathname": { "version": "2.2.0", @@ -6328,11 +5541,6 @@ "signal-exit": "^3.0.2" } }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" - }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -6403,11 +5611,6 @@ "is-promise": "^2.1.0" } }, - "run-parallel": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", - "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==" - }, "rw": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", @@ -6559,11 +5762,6 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" - }, "slice-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", @@ -6631,7 +5829,8 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true }, "stream-shift": { "version": "1.0.1", @@ -7055,7 +6254,8 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true }, "through": { "version": "2.3.8", @@ -7120,14 +6320,6 @@ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - }, "tooltip.js": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/tooltip.js/-/tooltip.js-1.3.3.tgz", @@ -7163,14 +6355,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.8.1.tgz", "integrity": "sha1-aUavLR1lGnsYY7Ux1uWvpBqkTqw=" }, - "tsutils": { - "version": "3.19.1", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.19.1.tgz", - "integrity": "sha512-GEdoBf5XI324lu7ycad7s6laADfnAqCw6wLGI+knxvw9vsIYBaJfYdmeCEG3FMMUiSm3OGgNb+m6utsWf5h9Vw==", - "requires": { - "tslib": "^1.8.1" - } - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -7186,11 +6370,6 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" - }, "typed-styles": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/typed-styles/-/typed-styles-0.0.7.tgz", @@ -7225,6 +6404,7 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, "requires": { "punycode": "^2.1.0" } @@ -7234,11 +6414,6 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "v8-compile-cache": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", - "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==" - }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -7348,11 +6523,6 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -7406,11 +6576,6 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "yargs": { "version": "14.2.3", "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", diff --git a/package.json b/package.json index 15fa4facf..9d750eeb9 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@babel/runtime": "^7.12.5", - "@forbole/cosmos-protobuf-js": "^1.0.4", + "@forbole/cosmos-protobuf-js": "^1.0.5", "@improbable-eng/grpc-web": "^0.13.0", "@improbable-eng/grpc-web-node-http-transport": "^0.13.0", "@ledgerhq/hw-transport-webusb": "^4.78.0", From 262547fa29c75b5c880a44bee2dfaaa3294ddb15 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 10:57:33 +0000 Subject: [PATCH 050/127] revert updating validators with RPC and validator hex address --- imports/api/blocks/server/methods.js | 101 +++++++++++++++++++-------- imports/startup/server/util.js | 32 +++++++++ 2 files changed, 103 insertions(+), 30 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 9e482cdb8..ec688db5e 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -215,12 +215,16 @@ Meteor.methods({ // get latest validator candidate information let req = new Cosmos.Staking.QueryValidatorsRequest() + let pageReq = new Cosmos.Base.Query.PageRequest(); + pageReq.setCountTotal(true); + pageReq.setLimit(2000); + req.setPagination(pageReq) let res; try{ - // bonded validators req.setStatus("BOND_STATUS_BONDED") - res = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Validators, req, GRPC); + // bonded validators + res = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Validators, req, GRPC); res.validatorsList.forEach((validator) => validatorSet[validator.consensusPubkey.value] = validator); } catch(e){ @@ -228,8 +232,7 @@ Meteor.methods({ } try{ - // response = HTTP.get(url); - req.setStatus("BOND_STATUS_UNBONDING") + req.setStatus("BOND_STATUS_UNBONDING"); res = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Validators, req, GRPC); res.validatorsList.forEach((validator) => validatorSet[validator.consensusPubkey.value] = validator) } @@ -239,7 +242,7 @@ Meteor.methods({ try{ req.setStatus("BOND_STATUS_UNBONDED") - res = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Validators, req, GRPC); + res = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Validators, req, GRPC); res.validatorsList.forEach((validator) => validatorSet[validator.consensusPubkey.value] = validator) } catch(e){ @@ -252,7 +255,8 @@ Meteor.methods({ Chain.update({chainId:Meteor.settings.public.chainId}, {$set:{totalValidators:totalValidators}}); for (let height = curr+1 ; height <= until ; height++) { - let startBlockTime = new Date(); + // for (let height = curr+1 ; height <= curr+1 ; height++) { + let startBlockTime = new Date(); // add timeout here? and outside this loop (for catched up and keep fetching)? this.unblock(); // let url = RPC+'/block?height=' + height; @@ -333,15 +337,41 @@ Meteor.methods({ // let nextKey = 0; try { let validatorSetResult = {} + + let result; + do { - // url = RPC+`/validators?height=${height}&page=${++page}&per_page=100`; - page++; - req = new Cosmos.Base.Tendermint.GetValidatorSetByHeightRequest() - req.setHeight(height); - validatorSetResult = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetValidatorSetByHeight, req, GRPC); - validators = [...validators, ...validatorSetResult.validatorsList]; + let url = RPC+`/validators?height=${height}&page=${++page}&per_page=100`; + let response = HTTP.get(url); + result = JSON.parse(response.content).result; + // console.log("========= validator result ==========: %o", result) + validators = [...validators, ...result.validators]; + + // console.log(validators.length); + // console.log(parseInt(result.total)); } - while (validatorSetResult.validatorsList.length == 100 && (validatorSetResult.validatorsList.length*page < validatorSetResult.pagination?.total) ) + while (validators.length < parseInt(result.total)) + + + // do { + // // url = RPC+`/validators?height=${height}&page=${++page}&per_page=100`; + + // req = new Cosmos.Base.Tendermint.GetValidatorSetByHeightRequest() + // req.setHeight(height); + + // let pageReq = new Cosmos.Base.Query.PageRequest(); + // pageReq.setOffset(page*100); + // pageReq.setLimit(2000); + // pageReq.setCountTotal(true); + + // req.setPagination(pageReq) + // console.log(req.getPagination()) + // validatorSetResult = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetValidatorSetByHeight, req, GRPC); + // console.log(validatorSetResult.validatorsList.length); + // validators = [...validators, ...validatorSetResult.validatorsList]; + // page++; + // } + // while (validatorSetResult.validatorsList.length == 100 && (validatorSetResult.validatorsList.length*page < validatorSetResult.pagination?.total) ) } catch(e){ console.log("Getting validator set at height %o: %o", height, e) @@ -359,10 +389,12 @@ Meteor.methods({ // temporarily add bech32 concensus keys to the validator set list let tempValidators = []; for (let v in validators){ - // validators[v].consensus_pubkey = Meteor.call('pubkeyToBech32', validators[v].pub_key, Meteor.settings.public.bech32PrefixConsPub); - validators[v].valconsAddress = validators[v].address; - validators[v].address = Meteor.call('getAddressFromPubkey', validators[v].pubKey); - tempValidators[validators[v].pubKey.value] = validators[v]; + // validators[v].consensus_pubkey = Meteor.call('pubkeyToBech32Old', validators[v].pub_key, Meteor.settings.public.bech32PrefixConsPub); + // validators[v].valconsAddress = validators[v].address; + validators[v].valconsAddress = Meteor.call('hexToBech32', validators[v].address, Meteor.settings.public.bech32PrefixConsAddr); + // validators[v].address = Meteor.call('getAddressFromPubkey', validators[v].pubKey); + // tempValidators[validators[v].pubKey.value] = validators[v]; + tempValidators[validators[v].address] = validators[v]; } validators = tempValidators; @@ -470,7 +502,9 @@ Meteor.methods({ valData.bech32ValConsAddress = Meteor.call('hexToBech32', valData.address, Meteor.settings.public.bech32PrefixConsAddr); // assign back to the validator set so that we can use it to find the uptime - validatorSet[v].bech32ValConsAddress = valData.bech32ValConsAddress; + + if (validatorSet[v]) + validatorSet[v].bech32ValConsAddress = valData.bech32ValConsAddress; // First time adding validator to the database. @@ -491,8 +525,9 @@ Meteor.methods({ // insert first power change history - valData.voting_power = validators[valData.consensusPubkey.value]?parseInt(validators[valData.consensusPubkey.value].votingPower):0; - valData.proposer_priority = validators[valData.consensusPubkey.value]?parseInt(validators[valData.consensusPubkey.value].proposerPriority):0; + // valData.voting_power = validators[valData.consensusPubkey.value]?parseInt(validators[valData.consensusPubkey.value].votingPower):0; + valData.voting_power = validators[valData.address]?parseInt(validators[valData.address].votingPower):0; + valData.proposer_priority = validators[valData.address]?parseInt(validators[valData.address].proposerPriority):0; console.log("Validator not found. Insert first VP change record.") bulkVPHistory.insert({ @@ -507,6 +542,8 @@ Meteor.methods({ } else{ + valData.address = valExist.address; + // assign to valData for getting self delegation valData.delegatorAddress = valExist.delegatorAddress; valData.bech32ValConsAddress = valExist.bech32ValConsAddress; @@ -514,12 +551,14 @@ Meteor.methods({ if (validatorSet[v]){ validatorSet[v].bech32ValConsAddress = valExist.bech32ValConsAddress; } - - if (validators[valData.consensusPubkey.value]){ + // console.log(valExist); + // console.log(validators[valExist.address]) + // if (validators[valData.consensusPubkey.value]){ + if (validators[valExist.address]){ // Validator exists and is in validator set, update voitng power. // If voting power is different from before, add voting power history - valData.voting_power = parseInt(validators[valData.consensusPubkey.value].votingPower); - valData.proposer_priority = parseInt(validators[valData.consensusPubkey.value].proposerPriority); + valData.voting_power = parseInt(validators[valExist.address].voting_power); + valData.proposer_priority = parseInt(validators[valExist.address].proposer_priority); let prevVotingPower = VotingPowerHistory.findOne({address:valExist.address}, {height:-1, limit:1}); console.log("Validator already in DB. Check if VP changed."); @@ -542,7 +581,7 @@ Meteor.methods({ // Validator is not in the set and it has been removed. // Set voting power to zero and add voting power history. - + valData.address = valExist.address; valData.voting_power = 0; valData.proposer_priority = 0; @@ -564,7 +603,8 @@ Meteor.methods({ // only update validator infor during start of crawling, end of crawling or every validator update window // get self delegation every 30 blocks - if ((height == Meteor.settings.params.startHeight+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ + // if ((height == Meteor.settings.params.startHeight+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ + if ((height == curr+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ req = new Cosmos.Staking.QueryDelegationRequest(); req.setValidatorAddr(valData.operatorAddress); req.setDelegatorAddr(valData.delegatorAddress); @@ -579,12 +619,12 @@ Meteor.methods({ catch(e){ console.log("Getting self delegation: %o", e) } - - console.log("Add validator upsert to bulk operations.") - bulkValidators.find({"consensusPubkey.value": valData.consensusPubkey.value}).upsert().updateOne({$set:valData}); - } + console.log("Add validator upsert to bulk operations.") + + bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); + } // store valdiators exist records @@ -642,6 +682,7 @@ Meteor.methods({ let startVUpTime = new Date(); if (bulkValidators.length > 0){ + console.log("############ Update validators ############"); bulkValidators.execute((err, result) => { if (err){ console.log("Error while bulk insert validators: %o",err); diff --git a/imports/startup/server/util.js b/imports/startup/server/util.js index 4fa2708d9..748e639ed 100644 --- a/imports/startup/server/util.js +++ b/imports/startup/server/util.js @@ -10,6 +10,38 @@ Meteor.methods({ // addressBuffer.copy(buffer); return bech32.encode(prefix, bech32.toWords(addressBuffer)); }, + pubkeyToBech32Old: function(pubkey, prefix) { + let buffer; + + try { + if (pubkey.type.indexOf("Ed25519") > 0){ + // '1624DE6420' is ed25519 pubkey prefix + let pubkeyAminoPrefix = Buffer.from('1624DE6420', 'hex'); + buffer = Buffer.alloc(37); + + pubkeyAminoPrefix.copy(buffer, 0) + Buffer.from(pubkey.value, 'base64').copy(buffer, pubkeyAminoPrefix.length) + } + else if (pubkey.type.indexOf("Secp256k1") > 0){ + // 'EB5AE98721' is secp256k1 pubkey prefix + let pubkeyAminoPrefix = Buffer.from('EB5AE98721', 'hex'); + buffer = Buffer.alloc(38); + + pubkeyAminoPrefix.copy(buffer, 0) + Buffer.from(pubkey.value, 'base64').copy(buffer, pubkeyAminoPrefix.length) + } + else { + console.log("Pubkey type not supported."); + return false; + } + + return bech32.encode(prefix, bech32.toWords(buffer)) + } + catch (e){ + console.log("Error converting from pubkey to bech32: %o\n %o", pubkey, e); + return false + } + }, pubkeyToBech32: function(pubkey, prefix) { let buffer; From 4fa20475aacbcc149e8ff1da06f3b532fbde92e8 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 11:05:19 +0000 Subject: [PATCH 051/127] fix chain status active validators --- imports/api/chain/server/methods.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index 105d9007f..0a2e44078 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -58,15 +58,30 @@ Meteor.methods({ // Since Tendermint v0.33, validator page default set to return 30 validators. // Query latest height with page 1 and 100 validators per page. - req = new Cosmos.Base.Tendermint.GetLatestValidatorSetRequest() - let validators = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetLatestValidatorSet, req, GRPC) + // req = new Cosmos.Base.Tendermint.GetLatestValidatorSetRequest() + // let validators = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetLatestValidatorSet, req, GRPC) // console.log(validators) - validators = validators.validatorsList; + // validators = validators.validatorsList; + // chain.validators = validators.length; + + let validators = [] + let page = 0; + + do { + let url = RPC+`/validators?page=${++page}&per_page=100`; + let response = HTTP.get(url); + result = JSON.parse(response.content).result; + // console.log("========= validator result ==========: %o", result) + validators = [...validators, ...result.validators]; + + } + while (validators.length < parseInt(result.total)) + chain.validators = validators.length; let activeVP = 0; for (v in validators){ - activeVP += parseInt(validators[v].votingPower); + activeVP += parseInt(validators[v].voting_power); } chain.activeVotingPower = activeVP; From b734ed19414a4e0700d3842d6291d4fc12036df9 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 14:00:57 +0000 Subject: [PATCH 052/127] revert back using legacy api /tx endpoint for transactions --- imports/api/transactions/server/methods.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index 431b672d1..78241a952 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -1,7 +1,7 @@ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; import { Transactions } from '../../transactions/transactions.js'; import { Validators } from '../../validators/validators.js'; -import { Cosmos } from '@forbole/cosmos-protobuf-js' const AddressLength = 40; @@ -17,12 +17,11 @@ Meteor.methods({ const bulkTransactions = Transactions.rawCollection().initializeUnorderedBulkOp(); for (let i in transactions){ try { - let req = new Cosmos.Tx.GetTxRequest(); - req.setHash(transactions[i].txhash); - let tx = await Cosmos.gRPC.unary(Cosmos.Tx.Service.GetTx, req, GRPC); - console.log(tx); + let url = LCD+ '/cosmos/tx/v1beta1/txs/'+transactions[i].txhash; + let response = HTTP.get(url); + let tx = JSON.parse(response.content); - // tx.height = parseInt(tx.height); + tx.height = parseInt(tx.height); tx.processed = true; bulkTransactions.find({txhash:transactions[i].txhash}).updateOne({$set:tx}); @@ -89,14 +88,14 @@ Meteor.methods({ // address is either delegator address or validator operator address let validator; if (!fields) - fields = {address:1, description:1, operatorAddress:1, delegatorAddress:1}; + fields = {address:1, description:1, operator_address:1, delegator_address:1}; if (address.includes(Meteor.settings.public.bech32PrefixValAddr)){ // validator operator address - validator = Validators.findOne({operatorAddress:address}, {fields}); + validator = Validators.findOne({operator_address:address}, {fields}); } else if (address.includes(Meteor.settings.public.bech32PrefixAccAddr)){ // delegator address - validator = Validators.findOne({delegatorAddress:address}, {fields}); + validator = Validators.findOne({delegator_address:address}, {fields}); } else if (address.length === AddressLength) { validator = Validators.findOne({address:address}, {fields}); From b667da85e92a5c63fec3a467050fda394f95a2e8 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 14:01:28 +0000 Subject: [PATCH 053/127] using legacy /tx endpoint --- imports/api/transactions/server/methods.js | 2 +- imports/ui/components/Activities.jsx | 2 +- imports/ui/transactions/TransactionRow.jsx | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index 78241a952..aefb12583 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -17,7 +17,7 @@ Meteor.methods({ const bulkTransactions = Transactions.rawCollection().initializeUnorderedBulkOp(); for (let i in transactions){ try { - let url = LCD+ '/cosmos/tx/v1beta1/txs/'+transactions[i].txhash; + let url = LCD+ '/txs/'+transactions[i].txhash; let response = HTTP.get(url); let tx = JSON.parse(response.content); diff --git a/imports/ui/components/Activities.jsx b/imports/ui/components/Activities.jsx index 2c75ac407..6e758fed9 100644 --- a/imports/ui/components/Activities.jsx +++ b/imports/ui/components/Activities.jsx @@ -39,7 +39,7 @@ export default class Activites extends Component { } render(){ - console.log(this.props); + // console.log(this.props); const msg = this.props.msg; const events = []; for (let i in this.props.events){ diff --git a/imports/ui/transactions/TransactionRow.jsx b/imports/ui/transactions/TransactionRow.jsx index f0572b4ea..8e92dd4d0 100644 --- a/imports/ui/transactions/TransactionRow.jsx +++ b/imports/ui/transactions/TransactionRow.jsx @@ -18,19 +18,19 @@ export const TransactionRow = (props) => { let tx = props.tx; return - {(tx.tx.body.messages && tx.tx.body.messages.length >0)?tx.tx.body.messages.map((msg,i) => { + {(tx.tx.value.msg && tx.tx.value.msg.length >0)?tx.tx.value.msg.map((msg,i) => { return }):''} {tx.txhash} - schedule {tx.block()?:''}{(tx.tx.body.memo && tx.tx.body.memo != "")? + schedule {tx.block()?:''}{(tx.tx.value.memo && tx.tx.value.memo != "")? message - + :""} {(!props.blockList)? {numbro(tx.height).format("0,0")}:''} {(!tx.code)?:} - monetization_on {(tx.tx.auth_info.fee.amount.length > 0)?tx.tx.auth_info.fee.amount.map((fee,i) => { + monetization_on {(tx.tx.value.fee.amount.length > 0)?tx.tx.value.fee.amount.map((fee,i) => { return {(new Coin(parseFloat(fee.amount), (fee)?fee.denom:null)).stakeString()} }):No fee} {(tx.code)? From f041df5135615680cd10a817dae95e4e7e7f11e7 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 14:17:41 +0000 Subject: [PATCH 054/127] change LCD to API --- imports/api/accounts/server/methods.js | 20 ++++++++++---------- imports/api/delegations/server/methods.js | 2 +- imports/api/proposals/server/methods.js | 8 ++++---- imports/api/transactions/server/methods.js | 2 +- imports/api/validators/server/methods.js | 2 +- server/main.js | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/imports/api/accounts/server/methods.js b/imports/api/accounts/server/methods.js index f6f9cd534..e41c4a6c6 100644 --- a/imports/api/accounts/server/methods.js +++ b/imports/api/accounts/server/methods.js @@ -3,7 +3,7 @@ import { HTTP } from 'meteor/http'; import { Validators } from '/imports/api/validators/validators.js'; const fetchFromUrl = (url) => { try{ - let res = HTTP.get(LCD + url); + let res = HTTP.get(API + url); if (res.statusCode == 200){ return res }; @@ -16,7 +16,7 @@ const fetchFromUrl = (url) => { Meteor.methods({ 'accounts.getAccountDetail': function(address){ this.unblock(); - let url = LCD + '/cosmos/auth/v1beta1/accounts/'+ address; + let url = API + '/cosmos/auth/v1beta1/accounts/'+ address; try{ let available = HTTP.get(url); if (available.statusCode == 200){ @@ -41,7 +41,7 @@ Meteor.methods({ let balance = {} // get available atoms - let url = LCD + '/cosmos/bank/v1beta1/balances/'+ address; + let url = API + '/cosmos/bank/v1beta1/balances/'+ address; try{ let available = HTTP.get(url); if (available.statusCode == 200){ @@ -55,7 +55,7 @@ Meteor.methods({ } // get delegated amnounts - url = LCD + '/cosmos/staking/v1beta1/delegators/'+address+'/delegations'; + url = API + '/cosmos/staking/v1beta1/delegators/'+address+'/delegations'; try{ let delegations = HTTP.get(url); if (delegations.statusCode == 200){ @@ -67,7 +67,7 @@ Meteor.methods({ console.log(e); } // get unbonding - url = LCD + '/cosmos/staking/v1beta1/delegators/'+address+'/unbonding_delegations'; + url = API + '/cosmos/staking/v1beta1/delegators/'+address+'/unbonding_delegations'; try{ let unbonding = HTTP.get(url); if (unbonding.statusCode == 200){ @@ -80,7 +80,7 @@ Meteor.methods({ } // get rewards - url = LCD + '/cosmos/distribution/v1beta1/v1beta1/delegators/'+address+'/rewards'; + url = API + '/cosmos/distribution/v1beta1/v1beta1/delegators/'+address+'/rewards'; try{ let rewards = HTTP.get(url); if (rewards.statusCode == 200){ @@ -100,7 +100,7 @@ Meteor.methods({ let validator = Validators.findOne( {$or: [{operatorAddress:address}, {delegatorAddress:address}, {address:address}]}) if (validator) { - let url = LCD + '/cosmos/distribution/v1beta1/validators/' + validator.operatorAddress; + let url = API + '/cosmos/distribution/v1beta1/validators/' + validator.operatorAddress; balance.operatorAddress = validator.operatorAddress; try { let rewards = HTTP.get(url); @@ -153,7 +153,7 @@ Meteor.methods({ }, 'accounts.getAllDelegations'(address){ this.unblock(); - let url = LCD + '/cosmos/staking/v1beta1/delegators/'+address+'/delegations'; + let url = API + '/cosmos/staking/v1beta1/delegators/'+address+'/delegations'; try{ let delegations = HTTP.get(url); @@ -176,7 +176,7 @@ Meteor.methods({ }, 'accounts.getAllUnbondings'(address){ this.unblock(); - let url = LCD + '/cosmos/staking/v1beta1/delegators/'+address+'/unbonding_delegations'; + let url = API + '/cosmos/staking/v1beta1/delegators/'+address+'/unbonding_delegations'; try{ let unbondings = HTTP.get(url); @@ -208,7 +208,7 @@ Meteor.methods({ }, 'accounts.getRedelegations'(address) { this.unblock(); - let url = LCD + '/cosmos/staking/v1beta1/v1beta1/delegators/' + address +'/redelegations'; + let url = API + '/cosmos/staking/v1beta1/v1beta1/delegators/' + address +'/redelegations'; try { let userRedelegations = HTTP.get(url); diff --git a/imports/api/delegations/server/methods.js b/imports/api/delegations/server/methods.js index ed5080ee1..eb8fac9d6 100644 --- a/imports/api/delegations/server/methods.js +++ b/imports/api/delegations/server/methods.js @@ -11,7 +11,7 @@ Meteor.methods({ console.log("=== Getting delegations ==="); for (v in validators){ if (validators[v].operatorAddress){ - // let url = LCD + '/cosmos/staking/v1beta1/validators/'+validators[v].operatorAddress+"/delegations"; + // let url = API + '/cosmos/staking/v1beta1/validators/'+validators[v].operatorAddress+"/delegations"; try{ // let response = HTTP.get(url); // if (response.statusCode == 200){ diff --git a/imports/api/proposals/server/methods.js b/imports/api/proposals/server/methods.js index daa246467..f5a77e02d 100644 --- a/imports/api/proposals/server/methods.js +++ b/imports/api/proposals/server/methods.js @@ -22,7 +22,7 @@ Meteor.methods({ let proposal = proposals.proposalsList[i]; if (proposal.proposalId > 0 && !finishedProposalIds.has(proposal.proposalId)) { try{ - let url = LCD + '/cosmos/gov/v1beta1/proposals/'+proposal.proposalId+'/proposer'; + let url = API + '/cosmos/gov/v1beta1/proposals/'+proposal.proposalId+'/proposer'; let response = HTTP.get(url); if (response.statusCode == 200){ let proposer = JSON.parse(response.content).result; @@ -59,7 +59,7 @@ Meteor.methods({ if (parseInt(proposals[i].proposalId) > 0){ try{ // get proposal deposits - let url = LCD + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/deposits'; + let url = API + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/deposits'; let response = HTTP.get(url); let proposal = {proposalId: proposals[i].proposalId}; if (response.statusCode == 200){ @@ -67,14 +67,14 @@ Meteor.methods({ proposal.deposits = deposits; } - url = LCD + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/votes'; + url = API + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/votes'; response = HTTP.get(url); if (response.statusCode == 200){ let votes = JSON.parse(response.content).result; proposal.votes = getVoteDetail(votes); } - url = LCD + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/tally'; + url = API + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/tally'; response = HTTP.get(url); if (response.statusCode == 200){ let tally = JSON.parse(response.content).result; diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index aefb12583..78241a952 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -17,7 +17,7 @@ Meteor.methods({ const bulkTransactions = Transactions.rawCollection().initializeUnorderedBulkOp(); for (let i in transactions){ try { - let url = LCD+ '/txs/'+transactions[i].txhash; + let url = LCD+ '/cosmos/tx/v1beta1/txs/'+transactions[i].txhash; let response = HTTP.get(url); let tx = JSON.parse(response.content); diff --git a/imports/api/validators/server/methods.js b/imports/api/validators/server/methods.js index cfbb31e3f..f0c4d1e03 100644 --- a/imports/api/validators/server/methods.js +++ b/imports/api/validators/server/methods.js @@ -26,7 +26,7 @@ Meteor.methods({ // async 'Validators.getAllDelegations'(address){ 'Validators.getAllDelegations'(address){ this.unblock(); - let url = LCD + '/cosmos/staking/v1beta1/validators/'+address+'/delegations'; + let url = API + '/cosmos/staking/v1beta1/validators/'+address+'/delegations'; try{ let delegations = HTTP.get(url); diff --git a/server/main.js b/server/main.js index b6e16acbe..e56fddae7 100644 --- a/server/main.js +++ b/server/main.js @@ -12,7 +12,7 @@ TXSYNCING = false; COUNTMISSEDBLOCKS = false; COUNTMISSEDBLOCKSSTATS = false; RPC = Meteor.settings.remote.rpc; -LCD = Meteor.settings.remote.lcd; +API = Meteor.settings.remote.api; GRPC = Meteor.settings.remote.grpc; timerBlocks = 0; From ebfc0cc3cb4775406070b531422cb14fabc61c63 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 14:18:28 +0000 Subject: [PATCH 055/127] update default_settings.json --- default_settings.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/default_settings.json b/default_settings.json index 40ece161a..015d0ddc5 100644 --- a/default_settings.json +++ b/default_settings.json @@ -39,7 +39,9 @@ "coingeckoId": "cosmos" }, "remote":{ - "grpc":"http://grpc.cosmoshub.forbole.com:80" + "rpc":"https://rpc.stargate.forbole.com:443", + "api":"https://api.stargate.forbole.com:443", + "grpc":"https://grpc.stargate.forbole.com:443" }, "debug": { "startTimer": true From 00e130dd8acef1fd0bde54de4b97d40a7435460e Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 14:27:02 +0000 Subject: [PATCH 056/127] index tx with grpc gateway --- imports/api/transactions/server/methods.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index 78241a952..5aeeef200 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -17,11 +17,11 @@ Meteor.methods({ const bulkTransactions = Transactions.rawCollection().initializeUnorderedBulkOp(); for (let i in transactions){ try { - let url = LCD+ '/cosmos/tx/v1beta1/txs/'+transactions[i].txhash; + let url = API+ '/cosmos/tx/v1beta1/txs/'+transactions[i].txhash; let response = HTTP.get(url); let tx = JSON.parse(response.content); - tx.height = parseInt(tx.height); + tx.height = parseInt(tx.tx_response.height); tx.processed = true; bulkTransactions.find({txhash:transactions[i].txhash}).updateOne({$set:tx}); From 0d41d3c4f00f44154c4224b77065e8a261d9ce85 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 14:32:33 +0000 Subject: [PATCH 057/127] fix transaction row --- imports/ui/transactions/Transaction.jsx | 6 +++--- imports/ui/transactions/TransactionRow.jsx | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/imports/ui/transactions/Transaction.jsx b/imports/ui/transactions/Transaction.jsx index a228b2d63..ab0ad5b65 100644 --- a/imports/ui/transactions/Transaction.jsx +++ b/imports/ui/transactions/Transaction.jsx @@ -58,13 +58,13 @@ export default class Transaction extends Component{ {tx.block()? :null} transactions.fee - {(tx.tx.value.fee.amount.length > 0)?tx.tx.value.fee.amount.map((fee,i) => { + {(tx.tx.auth_info.fee.amount.length > 0)?tx.tx.auth_info.fee.amount.map((fee,i) => { return {((fee.amount/Meteor.settings.public.stakingFraction)>=1)?(new Coin(parseFloat(fee.amount), fee.denom)).stakeString():(new Coin(parseFloat(fee.amount), fee.denom)).mintString()} }):transactions.noFee} transactions.gasUsedWanted - {numbro(tx.gas_used).format("0,0")} / {numbro(tx.gas_wanted).format("0,0")} + {numbro(tx.tx_response.gas_used).format("0,0")} / {numbro(tx.tx_response.gas_wanted).format("0,0")} transactions.memo - + diff --git a/imports/ui/transactions/TransactionRow.jsx b/imports/ui/transactions/TransactionRow.jsx index 8e92dd4d0..5a96345d2 100644 --- a/imports/ui/transactions/TransactionRow.jsx +++ b/imports/ui/transactions/TransactionRow.jsx @@ -18,19 +18,19 @@ export const TransactionRow = (props) => { let tx = props.tx; return - {(tx.tx.value.msg && tx.tx.value.msg.length >0)?tx.tx.value.msg.map((msg,i) => { - return + {(tx.tx.body.messages && tx.tx.body.messages.length >0)?tx.tx.body.messages.map((msg,i) => { + return }):''} {tx.txhash} - schedule {tx.block()?:''}{(tx.tx.value.memo && tx.tx.value.memo != "")? + schedule {tx.block()?:''}{(tx.tx.body.memo && tx.tx.body.memo != "")? message - + :""} {(!props.blockList)? {numbro(tx.height).format("0,0")}:''} {(!tx.code)?:} - monetization_on {(tx.tx.value.fee.amount.length > 0)?tx.tx.value.fee.amount.map((fee,i) => { + monetization_on {(tx.tx.auth_info.fee.amount.length > 0)?tx.tx.auth_info.fee.amount.map((fee,i) => { return {(new Coin(parseFloat(fee.amount), (fee)?fee.denom:null)).stakeString()} }):No fee} {(tx.code)? From 19870b36ec26f4c512ebdecba329250c353a4eea Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 14:45:19 +0000 Subject: [PATCH 058/127] update transations and message types --- imports/api/validators/server/methods.js | 2 +- imports/startup/server/create-indexes.js | 2 +- imports/ui/blocks/BlockContainer.js | 32 ++++---- imports/ui/components/Activities.jsx | 74 +++++++++---------- imports/ui/components/MsgType.jsx | 32 ++++---- imports/ui/components/PowerHistory.jsx | 18 ++--- .../ui/components/TransactionsContainer.js | 32 ++++---- imports/ui/ledger/ledger.js | 2 +- 8 files changed, 97 insertions(+), 97 deletions(-) diff --git a/imports/api/validators/server/methods.js b/imports/api/validators/server/methods.js index f0c4d1e03..7b5774a59 100644 --- a/imports/api/validators/server/methods.js +++ b/imports/api/validators/server/methods.js @@ -8,7 +8,7 @@ Meteor.methods({ // look up the create validator time to consider if the validator has never updated the commission let tx = Transactions.findOne({$and:[ {"tx.body.messages.value.delegatorAddress":address}, - {"tx.body.messages.type":"cosmos-sdk/MsgCreateValidator"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgCreateValidator"}, {code:{$exists:false}} ]}); diff --git a/imports/startup/server/create-indexes.js b/imports/startup/server/create-indexes.js index 35ab91daa..032d767e6 100644 --- a/imports/startup/server/create-indexes.js +++ b/imports/startup/server/create-indexes.js @@ -44,7 +44,7 @@ Transactions.rawCollection().createIndex({processed:1}); Transactions.rawCollection().createIndex({"logs.events.attributes.key":1}); Transactions.rawCollection().createIndex({"logs.events.attributes.value":1}); Transactions.rawCollection().createIndex({ - "tx.value.msg.value.delegatorAddress":1, + "tx.value.msg.delegatorAddress":1, "tx.value.msg.type":1, "code": 1 },{partialFilterExpression: {code:{$exists: true}}}) diff --git a/imports/ui/blocks/BlockContainer.js b/imports/ui/blocks/BlockContainer.js index 975bc694a..162f3a228 100644 --- a/imports/ui/blocks/BlockContainer.js +++ b/imports/ui/blocks/BlockContainer.js @@ -39,42 +39,42 @@ export default BlockContainer = withTracker((props) => { block: blockExist ? block : {}, transferTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"cosmos-sdk/MsgSend"}, - {"tx.body.messages.type":"cosmos-sdk/MsgMultiSend"} + {"tx.body.messages.type":"/cosmos.v1beta1.MsgSend"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgMultiSend"} ] }).fetch() : {}, stakingTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"cosmos-sdk/MsgCreateValidator"}, - {"tx.body.messages.type":"cosmos-sdk/MsgEditValidator"}, - {"tx.body.messages.type":"cosmos-sdk/MsgDelegate"}, - {"tx.body.messages.type":"cosmos-sdk/MsgUndelegate"}, - {"tx.body.messages.type":"cosmos-sdk/MsgBeginRedelegate"} + {"tx.body.messages.type":"/cosmos.v1beta1.MsgCreateValidator"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgEditValidator"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgDelegate"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgUndelegate"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgBeginRedelegate"} ] }).fetch() : {}, distributionTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"cosmos-sdk/MsgWithdrawValidatorCommission"}, - {"tx.body.messages.type":"cosmos-sdk/MsgWithdrawDelegationReward"}, - {"tx.body.messages.type":"cosmos-sdk/MsgModifyWithdrawAddress"} + {"tx.body.messages.type":"/cosmos.v1beta1.MsgWithdrawValidatorCommission"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgWithdrawDelegationReward"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgModifyWithdrawAddress"} ] }).fetch() : {}, governanceTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"cosmos-sdk/MsgSubmitProposal"}, - {"tx.body.messages.type":"cosmos-sdk/MsgDeposit"}, - {"tx.body.messages.type":"cosmos-sdk/MsgVote"} + {"tx.body.messages.type":"/cosmos.v1beta1.MsgSubmitProposal"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgDeposit"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgVote"} ] }).fetch() : {}, slashingTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"cosmos-sdk/MsgUnjail"} + {"tx.body.messages.type":"/cosmos.v1beta1.MsgUnjail"} ] }).fetch() : {}, IBCTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"cosmos-sdk/IBCTransferMsg"}, - {"tx.body.messages.type":"cosmos-sdk/IBCReceiveMsg"} + {"tx.body.messages.type":"/cosmos.IBCTransferMsg"}, + {"tx.body.messages.type":"/cosmos.IBCReceiveMsg"} ] }).fetch() : {}, }; diff --git a/imports/ui/components/Activities.jsx b/imports/ui/components/Activities.jsx index 6e758fed9..73d85526b 100644 --- a/imports/ui/components/Activities.jsx +++ b/imports/ui/components/Activities.jsx @@ -14,7 +14,7 @@ MultiSend = (props) => {

activities.single activities.happened

activities.senders

    - {props.msg.value.inputs.map((data,i) =>{ + {props.msg.inputs.map((data,i) =>{ return
  • activities.sent {data.coins.map((coin, j) =>{ return {new Coin(coin.amount, coin.denom).toString()} })} @@ -23,7 +23,7 @@ MultiSend = (props) => {
activities.receivers
    - {props.msg.value.outputs.map((data,i) =>{ + {props.msg.outputs.map((data,i) =>{ return
  • activities.received {data.coins.map((coin,j) =>{ return {new Coin(coin.amount, coin.denom).toString()} })}
  • @@ -39,64 +39,64 @@ export default class Activites extends Component { } render(){ - // console.log(this.props); + console.log(this.props); const msg = this.props.msg; const events = []; for (let i in this.props.events){ events[this.props.events[i].type] = this.props.events[i].attributes } - switch (msg.type){ + switch (msg["@type"]){ // bank - case "cosmos-sdk/MsgSend": + case "/cosmos.bank.v1beta1.MsgSend": let amount = ''; - amount = msg.value.amount.map((coin) => new Coin(coin.amount, coin.denom).toString()).join(', ') - return

    {(this.props.invalid)?activities.failedTo:''} {amount} activities.to common.fullStop

    - case "cosmos-sdk/MsgMultiSend": + amount = msg.amount.map((coin) => new Coin(coin.amount, coin.denom).toString()).join(', ') + return

    {(this.props.invalid)?activities.failedTo:''} {amount} activities.to common.fullStop

    + case "/cosmos.bank.v1beta1.MsgMultiSend": return // staking - case "cosmos-sdk/MsgCreateValidator": - return

    {(this.props.invalid)?activities.failedTo:''} activities.operatingAt activities.withMoniker {msg.value.description.moniker}common.fullStop

    - case "cosmos-sdk/MsgEditValidator": - return

    {(this.props.invalid)?activities.failedTo:''}

    - case "cosmos-sdk/MsgDelegate": - return

    {(this.props.invalid)?activities.failedTo:''} {new Coin(msg.value.amount.amount, msg.value.amount.denom).toString(6)} activities.to common.fullStop

    - case "cosmos-sdk/MsgUndelegate": - return

    {(this.props.invalid)?activities.failedTo:''} {new Coin(msg.value.amount.amount, msg.value.amount.denom).toString(6)} activities.from common.fullStop

    - case "cosmos-sdk/MsgBeginRedelegate": - return

    {(this.props.invalid)?activities.failedTo:''} {new Coin(msg.value.amount.amount, msg.value.amount.denom).toString(6)} activities.from activities.to common.fullStop

    + case "/cosmos.staking.v1beta1.MsgCreateValidator": + return

    {(this.props.invalid)?activities.failedTo:''} activities.operatingAt activities.withMoniker {msg.description.moniker}common.fullStop

    + case "/cosmos.staking.v1beta1.MsgEditValidator": + return

    {(this.props.invalid)?activities.failedTo:''}

    + case "/cosmos.staking.v1beta1.MsgDelegate": + return

    {(this.props.invalid)?activities.failedTo:''} {new Coin(msg.amount.amount, msg.amount.denom).toString(6)} activities.to common.fullStop

    + case "/cosmos.staking.v1beta1.MsgUndelegate": + return

    {(this.props.invalid)?activities.failedTo:''} {new Coin(msg.amount.amount, msg.amount.denom).toString(6)} activities.from common.fullStop

    + case "/cosmos.staking.v1beta1.MsgBeginRedelegate": + return

    {(this.props.invalid)?activities.failedTo:''} {new Coin(msg.amount.amount, msg.amount.denom).toString(6)} activities.from activities.to common.fullStop

    // gov - case "cosmos-sdk/MsgSubmitProposal": + case "/cosmos.gov.v1beta1.MsgSubmitProposal": const proposalId = _.get(this.props, 'events[2].attributes[0].value', null) const proposalLink = proposalId ? `/proposals/${proposalId}` : "#"; - return

    activities.withTitle {msg.value.content.value.title}common.fullStop

    - case "cosmos-sdk/MsgDeposit": - return

    {(this.props.invalid)?activities.failedTo:''} {msg.value.amount.map((amount,i) =>new Coin(amount.amount, amount.denom).toString(6)).join(', ')} activities.to proposals.proposal {msg.value.proposal_id}common.fullStop

    - case "cosmos-sdk/MsgVote": - return

    {(this.props.invalid)?activities.failedTo:''} proposals.proposal {msg.value.proposal_id} activities.withA {msg.value.option}common.fullStop

    + return

    activities.withTitle {msg.content.value.title}common.fullStop

    + case "/cosmos.gov.v1beta1.MsgDeposit": + return

    {(this.props.invalid)?activities.failedTo:''} {msg.amount.map((amount,i) =>new Coin(amount.amount, amount.denom).toString(6)).join(', ')} activities.to proposals.proposal {msg.proposal_id}common.fullStop

    + case "/cosmos.gov.v1beta1.MsgVote": + return

    {(this.props.invalid)?activities.failedTo:''} proposals.proposal {msg.proposal_id} activities.withA {msg.option}common.fullStop

    // distribution - case "cosmos-sdk/MsgWithdrawValidatorCommission": - return

    {(this.props.invalid)?activities.failedTo:''} {(!this.props.invalid)?activities.withAmount:''}common.fullStop

    - case "cosmos-sdk/MsgWithdrawDelegationReward": - return

    {(this.props.invalid)?activities.failedTo:''} {(!this.props.invalid)?activities.withAmount:''} activities.from common.fullStop

    - case "cosmos-sdk/MsgModifyWithdrawAddress": - return

    {(this.props.invalid)?activities.failedTo:''}

    + case "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission": + return

    {(this.props.invalid)?activities.failedTo:''} {(!this.props.invalid)?activities.withAmount:''}common.fullStop

    + case "/cosmos.distribution.v1beta1.MsgWithdrawDelegationReward": + return

    {(this.props.invalid)?activities.failedTo:''} {(!this.props.invalid)?activities.withAmount:''} activities.from common.fullStop

    + case "/cosmos.distribution.v1beta1.MsgModifyWithdrawAddress": + return

    {(this.props.invalid)?activities.failedTo:''}

    // slashing - case "cosmos-sdk/MsgUnjail": - return

    {(this.props.invalid)?activities.failedTo:''}common.fullStop

    + case "/cosmos.slashing.v1beta1.MsgUnjail": + return

    {(this.props.invalid)?activities.failedTo:''}common.fullStop

    // ibc - case "cosmos-sdk/IBCTransferMsg": - return - case "cosmos-sdk/IBCReceiveMsg": - return + case "/cosmos.IBCTransferMsg": + return + case "/cosmos.IBCReceiveMsg": + return default: - return
    + return
    } } } diff --git a/imports/ui/components/MsgType.jsx b/imports/ui/components/MsgType.jsx index 999f57570..e8e6945bc 100644 --- a/imports/ui/components/MsgType.jsx +++ b/imports/ui/components/MsgType.jsx @@ -7,47 +7,47 @@ const T = i18n.createComponent(); export const MsgType = (props) => { switch (props.type){ // bank - case "cosmos-sdk/MsgSend": + case "/cosmos.bank.v1beta1.MsgSend": return messageTypes.send - case "cosmos-sdk/MsgMultiSend": + case "/cosmos.bank.v1beta1.MsgMultiSend": return messageTypes.multiSend // staking - case "cosmos-sdk/MsgCreateValidator": + case "/cosmos.staking.v1beta1.MsgCreateValidator": return messageTypes.createValidator; - case "cosmos-sdk/MsgEditValidator": + case "/cosmos.staking.v1beta1.MsgEditValidator": return messageTypes.editValidator; - case "cosmos-sdk/MsgDelegate": + case "/cosmos.staking.v1beta1.MsgDelegate": return messageTypes.delegate; - case "cosmos-sdk/MsgUndelegate": + case "/cosmos.staking.v1beta1.MsgUndelegate": return messageTypes.undelegate; - case "cosmos-sdk/MsgBeginRedelegate": + case "/cosmos.staking.v1beta1.MsgBeginRedelegate": return messageTypes.redelegate; // gov - case "cosmos-sdk/MsgSubmitProposal": + case "/cosmos.gov.v1beta1.MsgSubmitProposal": return messageTypes.submitProposal - case "cosmos-sdk/MsgDeposit": + case "/cosmos.gov.v1beta1.MsgDeposit": return messageTypes.deposit - case "cosmos-sdk/MsgVote": + case "/cosmos.gov.v1beta1.MsgVote": return messageTypes.vote; // distribution - case "cosmos-sdk/MsgWithdrawValidatorCommission": + case "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission": return messageTypes.withdrawComission; - case "cosmos-sdk/MsgWithdrawDelegationReward": + case "/cosmos.distribution.v1beta1.MsgWithdrawDelegationReward": return messageTypes.withdrawReward; - case "cosmos-sdk/MsgModifyWithdrawAddress": + case "/cosmos.distribution.v1beta1.MsgModifyWithdrawAddress": return messageTypes.modifyWithdrawAddress; // slashing - case "cosmos-sdk/MsgUnjail": + case "/cosmos.slashing.v1beta1.MsgUnjail": return messageTypes.unjail; // ibc - case "cosmos-sdk/IBCTransferMsg": + case "/cosmos.IBCTransferMsg": return messageTypes.IBCTransfer; - case "cosmos-sdk/IBCReceiveMsg": + case "/cosmos.IBCReceiveMsg": return messageTypes.IBCReceive; default: diff --git a/imports/ui/components/PowerHistory.jsx b/imports/ui/components/PowerHistory.jsx index eb5e88f48..adbb70f34 100644 --- a/imports/ui/components/PowerHistory.jsx +++ b/imports/ui/components/PowerHistory.jsx @@ -28,7 +28,7 @@ export default class PowerHistory extends React.Component { {(msg.tx.body.messages && msg.tx.body.messages.length > 0)?msg.tx.body.messages.map((m, j) => { switch (m.type){ - case "cosmos-sdk/MsgBeginRedelegate": + case "/cosmos.v1beta1.MsgBeginRedelegate": return @@ -50,7 +50,7 @@ export default class PowerHistory extends React.Component { - case "cosmos-sdk/MsgDelegate": + case "/cosmos.v1beta1.MsgDelegate": if (m.value.validator_address == self.props.address){ return @@ -70,7 +70,7 @@ export default class PowerHistory extends React.Component { else{ return; } - case "cosmos-sdk/MsgCreateValidator": + case "/cosmos.v1beta1.MsgCreateValidator": return @@ -85,7 +85,7 @@ export default class PowerHistory extends React.Component { - case "cosmos-sdk/MsgUndelegate": + case "/cosmos.v1beta1.MsgUndelegate": return @@ -109,19 +109,19 @@ export default class PowerHistory extends React.Component { {(msg.tx.body.messages && msg.tx.body.messages.length > 0)?msg.tx.body.messages.map((m,j) => { switch (m.type){ - case "cosmos-sdk/MsgBeginRedelegate": + case "/cosmos.v1beta1.MsgBeginRedelegate": return messageTypes.redelegate; - case "cosmos-sdk/MsgDelegate": + case "/cosmos.v1beta1.MsgDelegate": if (m.value.validator_address == self.props.address){ return messageTypes.delegate; } else return; - case "cosmos-sdk/MsgCreateValidator": + case "/cosmos.v1beta1.MsgCreateValidator": return messageTypes.createValidator; - case "cosmos-sdk/MsgUnjail": + case "/cosmos.v1beta1.MsgUnjail": return messageTypes.unjail; - case "cosmos-sdk/MsgUndelegate": + case "/cosmos.v1beta1.MsgUndelegate": return messageTypes.undelegate; } }):''} diff --git a/imports/ui/components/TransactionsContainer.js b/imports/ui/components/TransactionsContainer.js index 4d3ea22b5..d93fde725 100644 --- a/imports/ui/components/TransactionsContainer.js +++ b/imports/ui/components/TransactionsContainer.js @@ -29,42 +29,42 @@ export default TransactionsContainer = withTracker((props) => { transactionsExist, transferTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"cosmos-sdk/MsgSend"}, - {"tx.body.messages.type":"cosmos-sdk/MsgMultiSend"} + {"tx.body.messages.type":"/cosmos.v1beta1.MsgSend"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgMultiSend"} ] }).fetch() : {}, stakingTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"cosmos-sdk/MsgCreateValidator"}, - {"tx.body.messages.type":"cosmos-sdk/MsgEditValidator"}, - {"tx.body.messages.type":"cosmos-sdk/MsgDelegate"}, - {"tx.body.messages.type":"cosmos-sdk/MsgUndelegate"}, - {"tx.body.messages.type":"cosmos-sdk/MsgBeginRedelegate"} + {"tx.body.messages.type":"/cosmos.v1beta1.MsgCreateValidator"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgEditValidator"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgDelegate"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgUndelegate"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgBeginRedelegate"} ] }).fetch() : {}, distributionTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"cosmos-sdk/MsgWithdrawValidatorCommission"}, - {"tx.body.messages.type":"cosmos-sdk/MsgWithdrawDelegationReward"}, - {"tx.body.messages.type":"cosmos-sdk/MsgModifyWithdrawAddress"} + {"tx.body.messages.type":"/cosmos.v1beta1.MsgWithdrawValidatorCommission"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgWithdrawDelegationReward"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgModifyWithdrawAddress"} ] }).fetch() : {}, governanceTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"cosmos-sdk/MsgSubmitProposal"}, - {"tx.body.messages.type":"cosmos-sdk/MsgDeposit"}, - {"tx.body.messages.type":"cosmos-sdk/MsgVote"} + {"tx.body.messages.type":"/cosmos.v1beta1.MsgSubmitProposal"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgDeposit"}, + {"tx.body.messages.type":"/cosmos.v1beta1.MsgVote"} ] }).fetch() : {}, slashingTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"cosmos-sdk/MsgUnjail"} + {"tx.body.messages.type":"/cosmos.v1beta1.MsgUnjail"} ] }).fetch() : {}, IBCTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"cosmos-sdk/IBCTransferMsg"}, - {"tx.body.messages.type":"cosmos-sdk/IBCReceiveMsg"} + {"tx.body.messages.type":"/cosmos.IBCTransferMsg"}, + {"tx.body.messages.type":"/cosmos.IBCReceiveMsg"} ] }).fetch() : {} }; diff --git a/imports/ui/ledger/ledger.js b/imports/ui/ledger/ledger.js index 594210e56..ba4bba1d2 100644 --- a/imports/ui/ledger/ledger.js +++ b/imports/ui/ledger/ledger.js @@ -403,7 +403,7 @@ export class Ledger { type: 'cosmos-sdk/MsgSubmitProposal', value: { content: { - type: "cosmos-sdk/TextProposal", + type: "/cosmos.TextProposal", value: { description: description, title: title From 1b8aaa93ee8b58a57c6894bb736eb1d60ecbfad5 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 15:03:07 +0000 Subject: [PATCH 059/127] get proposal with grpc gateway --- imports/api/proposals/server/methods.js | 28 ++++++++++++++----------- imports/ui/components/Activities.jsx | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/imports/api/proposals/server/methods.js b/imports/api/proposals/server/methods.js index f5a77e02d..076386b8c 100644 --- a/imports/api/proposals/server/methods.js +++ b/imports/api/proposals/server/methods.js @@ -2,24 +2,28 @@ import { Meteor } from 'meteor/meteor'; import { HTTP } from 'meteor/http'; import { Proposals } from '../proposals.js'; import { Validators } from '../../validators/validators.js'; -import { Cosmos } from '@forbole/cosmos-protobuf-js' // import { Promise } from 'meteor/promise'; Meteor.methods({ - 'proposals.getProposals': async function(){ + 'proposals.getProposals': function(){ this.unblock(); try{ - let req = new Cosmos.Gov.QueryProposalsRequest(); - let proposals = await Cosmos.gRPC.unary(Cosmos.Gov.Query.Proposals, req, GRPC); + let url = API + '/cosmos/gov/v1beta1/proposals'; + let response = HTTP.get(url); + let proposals = JSON.parse(response.content).proposals; + console.log(proposals); + let finishedProposalIds = new Set(Proposals.find( - {"proposal_status":{$in:["Passed", "Rejected", "Removed"]}} + {"proposal_status":{$in:["PROPOSAL_STATUS_PASSED", "PROPOSAL_STATUS_REJECTED", "PROPOSAL_STATUS_REMOVED"]}} ).fetch().map((p)=> p.proposalId)); let proposalIds = []; - if (proposals.proposalsList.length > 0){ + if (proposals.length > 0){ + // Proposals.upsert() const bulkProposals = Proposals.rawCollection().initializeUnorderedBulkOp(); - for (let i in proposals.proposalsList){ - let proposal = proposals.proposalsList[i]; + for (let i in proposals){ + let proposal = proposals[i]; + proposal.proposalId = parseInt(proposal.proposal_id); if (proposal.proposalId > 0 && !finishedProposalIds.has(proposal.proposalId)) { try{ let url = API + '/cosmos/gov/v1beta1/proposals/'+proposal.proposalId+'/proposer'; @@ -40,8 +44,8 @@ Meteor.methods({ } } } - bulkProposals.find({proposalId:{$nin:proposalIds}, proposal_status:{$nin:["Passed", "Rejected", "Removed"]}}) - .update({$set: {"proposal_status": "Removed"}}); + bulkProposals.find({proposalId:{$nin:proposalIds}, status:{$nin:["PROPOSAL_STATUS_PASSED", "PROPOSAL_STATUS_REJECTED", "PROPOSAL_STATUS_REMOVED"]}}) + .update({$set: {"status": "PROPOSAL_STATUS_REMOVED"}}); bulkProposals.execute(); } return true @@ -52,7 +56,7 @@ Meteor.methods({ }, 'proposals.getProposalResults': function(){ this.unblock(); - let proposals = Proposals.find({"proposal_status":{$nin:["Passed", "Rejected", "Removed"]}}).fetch(); + let proposals = Proposals.find({"status":{$nin:["PROPOSAL_STATUS_PASSED", "PROPOSAL_STATUS_REJECTED", "PROPOSAL_STATUS_REMOVED"]}}).fetch(); if (proposals && (proposals.length > 0)){ for (let i in proposals){ @@ -115,7 +119,7 @@ const getVoteDetail = (votes) => { voters.forEach((voter) => { if (!votingPowerMap[voter]) { // voter is not a validator - let url = `${LCD}/cosmos/staking/v1beta1/delegators/${voter}/delegations`; + let url = `${API}/cosmos/staking/v1beta1/delegators/${voter}/delegations`; let delegations; let votingPower = 0; try{ diff --git a/imports/ui/components/Activities.jsx b/imports/ui/components/Activities.jsx index 73d85526b..af7423308 100644 --- a/imports/ui/components/Activities.jsx +++ b/imports/ui/components/Activities.jsx @@ -39,7 +39,7 @@ export default class Activites extends Component { } render(){ - console.log(this.props); + // console.log(this.props); const msg = this.props.msg; const events = []; for (let i in this.props.events){ From 2313e7d40fd0b312c7e816b9d09f8e2cf087a5a0 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 15:29:05 +0000 Subject: [PATCH 060/127] fix ui of proposals --- imports/api/proposals/server/methods.js | 14 ++++++++++--- imports/ui/components/Icons.jsx | 10 ++++----- imports/ui/proposals/List.jsx | 4 ++-- imports/ui/proposals/Proposal.jsx | 27 ++++++++++++++----------- 4 files changed, 33 insertions(+), 22 deletions(-) diff --git a/imports/api/proposals/server/methods.js b/imports/api/proposals/server/methods.js index 076386b8c..b69c38351 100644 --- a/imports/api/proposals/server/methods.js +++ b/imports/api/proposals/server/methods.js @@ -1,17 +1,25 @@ import { Meteor } from 'meteor/meteor'; import { HTTP } from 'meteor/http'; import { Proposals } from '../proposals.js'; +import { Chain } from '../../chain/chain.js'; import { Validators } from '../../validators/validators.js'; -// import { Promise } from 'meteor/promise'; Meteor.methods({ 'proposals.getProposals': function(){ this.unblock(); try{ - let url = API + '/cosmos/gov/v1beta1/proposals'; + + // get gov tally prarams + let url = API + '/cosmos/gov/v1beta1/params/tallying'; let response = HTTP.get(url); + let params = JSON.parse(response.content); + + Chain.update({chainId: Meteor.settings.public.chainId}, {$set:{"gov.tallyParams":params.tally_params}}); + + url = API + '/cosmos/gov/v1beta1/proposals'; + response = HTTP.get(url); let proposals = JSON.parse(response.content).proposals; - console.log(proposals); + // console.log(proposals); let finishedProposalIds = new Set(Proposals.find( {"proposal_status":{$in:["PROPOSAL_STATUS_PASSED", "PROPOSAL_STATUS_REJECTED", "PROPOSAL_STATUS_REMOVED"]}} diff --git a/imports/ui/components/Icons.jsx b/imports/ui/components/Icons.jsx index 770ee692c..4cfaf1657 100644 --- a/imports/ui/components/Icons.jsx +++ b/imports/ui/components/Icons.jsx @@ -13,15 +13,15 @@ export const DenomSymbol = (props) => { export const ProposalStatusIcon = (props) => { switch (props.status){ - case 'Passed': + case 'PROPOSAL_STATUS_PASSED': return ; - case 'Rejected': + case 'PROPOSAL_STATUS_REJECTED': return ; - case 'Removed': + case 'PROPOSAL_STATUS_REMOVED': return - case 'DepositPeriod': + case 'PROPOSAL_STATUS_DEPOSIT_PERIOD': return ; - case 'VotingPeriod': + case 'PROPOSAL_STATUS_VOTING_PERIOD': return ; default: return ; diff --git a/imports/ui/proposals/List.jsx b/imports/ui/proposals/List.jsx index 0b859889d..808c0bebb 100644 --- a/imports/ui/proposals/List.jsx +++ b/imports/ui/proposals/List.jsx @@ -14,8 +14,8 @@ const ProposalRow = (props) => { return {props.proposal.proposalId} - {props.proposal.content.value.title} - {props.proposal.proposal_status.match(/[A-Z]+[^A-Z]*|[^A-Z]+/g).join(" ")} + {props.proposal.content.title} + {props.proposal.status.substr(16)} {(props.proposal.voting_start_time != "0001-01-01T00:00:00Z")?:'Not started'} {props.proposal.total_deposit?props.proposal.total_deposit.map((deposit, i) => { diff --git a/imports/ui/proposals/Proposal.jsx b/imports/ui/proposals/Proposal.jsx index 13686bc1d..8c59ad09b 100644 --- a/imports/ui/proposals/Proposal.jsx +++ b/imports/ui/proposals/Proposal.jsx @@ -272,10 +272,13 @@ export default class Proposal extends Component{ const proposalId = Number(this.props.proposal.proposalId), maxProposalId = Number(this.props.proposalCount); const powerReduction = Meteor.settings.public.powerReduction || Coin.StakingCoin.fraction; let totalVotingPower = this.props.chain.activeVotingPower * powerReduction; + let proposalType = this.props.proposal.content["@type"].split('.'); + proposalType = proposalType[proposalType.length-1].match(/[A-Z]+[^A-Z]*|[^A-Z]+/g).join(" "); + return
    - {this.props.proposal.content.value.title} | The Big Dipper - + {this.props.proposal.content.title} | The Big Dipper +
    @@ -290,30 +293,30 @@ export default class Proposal extends Component{ proposals.title - {this.props.proposal.content.value.title} + {this.props.proposal.content.title} proposals.description - + {/* Community Pool Spend Proposal */} {(this.props.proposal.content.type === 'cosmos-sdk/CommunityPoolSpendProposal')? proposals.recipient - + :null} {(this.props.proposal.content.type === 'cosmos-sdk/CommunityPoolSpendProposal')? proposals.amount - {this.props.proposal.content.value.amount.map((amount, j) => { + {this.props.proposal.content.amount.map((amount, j) => { return
    {new Coin(amount.amount, amount.denom).toString()}
    })}
    :null} proposals.proposalType - {this.props.proposal.content.type.substr(11).match(/[A-Z]+[^A-Z]*|[^A-Z]+/g).join(" ")} + {proposalType} proposals.proposalStatus - {(this.props.proposal.proposal_status)?this.props.proposal.proposal_status.match(/[A-Z]+[^A-Z]*|[^A-Z]+/g).join(" "):''} + {(this.props.proposal.status)?this.props.proposal.status.substr(16):''} proposals.deposit @@ -335,7 +338,7 @@ export default class Proposal extends Component{ {/* Parameter Change Proposal */} - {(this.props.proposal.content.type === 'cosmos-sdk/ParameterChangeProposal')? + {(this.props.proposal.content["@type"] === '/cosmos.params.v1beta1.ParameterChangeProposal')? proposals.changes @@ -348,11 +351,11 @@ export default class Proposal extends Component{ - - - From 78d79327c876b8d0b0c9d5feb71c9e91311dc87b Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 15:40:00 +0000 Subject: [PATCH 061/127] update block tx tabs --- imports/api/validators/server/methods.js | 6 ++-- imports/ui/blocks/BlockContainer.js | 32 +++++++++---------- .../ui/components/TransactionsContainer.js | 32 +++++++++---------- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/imports/api/validators/server/methods.js b/imports/api/validators/server/methods.js index 7b5774a59..d8f9977af 100644 --- a/imports/api/validators/server/methods.js +++ b/imports/api/validators/server/methods.js @@ -7,9 +7,9 @@ Meteor.methods({ this.unblock(); // look up the create validator time to consider if the validator has never updated the commission let tx = Transactions.findOne({$and:[ - {"tx.body.messages.value.delegatorAddress":address}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgCreateValidator"}, - {code:{$exists:false}} + {"tx.body.messages.delegator_address":address}, + {"tx.body.messages.@type":"/cosmos.staking.v1beta1.MsgCreateValidator"}, + {"tx_response.code":0} ]}); if (tx){ diff --git a/imports/ui/blocks/BlockContainer.js b/imports/ui/blocks/BlockContainer.js index 162f3a228..6e849456b 100644 --- a/imports/ui/blocks/BlockContainer.js +++ b/imports/ui/blocks/BlockContainer.js @@ -39,42 +39,42 @@ export default BlockContainer = withTracker((props) => { block: blockExist ? block : {}, transferTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"/cosmos.v1beta1.MsgSend"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgMultiSend"} + {"tx.body.messages.@type":"/cosmos.bank.v1beta1.MsgSend"}, + {"tx.body.messages.@type":"/cosmos.bank.v1beta1.MsgMultiSend"} ] }).fetch() : {}, stakingTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"/cosmos.v1beta1.MsgCreateValidator"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgEditValidator"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgDelegate"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgUndelegate"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgBeginRedelegate"} + {"tx.body.messages.@type":"/cosmos.staking.v1beta1.MsgCreateValidator"}, + {"tx.body.messages.@type":"/cosmos.staking.v1beta1.MsgEditValidator"}, + {"tx.body.messages.@type":"/cosmos.staking.v1beta1.MsgDelegate"}, + {"tx.body.messages.@type":"/cosmos.staking.v1beta1.MsgUndelegate"}, + {"tx.body.messages.@type":"/cosmos.staking.v1beta1.MsgBeginRedelegate"} ] }).fetch() : {}, distributionTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"/cosmos.v1beta1.MsgWithdrawValidatorCommission"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgWithdrawDelegationReward"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgModifyWithdrawAddress"} + {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"}, + {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgWithdrawDelegationReward"}, + {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgModifyWithdrawAddress"} ] }).fetch() : {}, governanceTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"/cosmos.v1beta1.MsgSubmitProposal"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgDeposit"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgVote"} + {"tx.body.messages.@type":"/cosmos.gov.v1beta1.MsgSubmitProposal"}, + {"tx.body.messages.@type":"/cosmos.gov.v1beta1.MsgDeposit"}, + {"tx.body.messages.@type":"/cosmos.gov.v1beta1.MsgVote"} ] }).fetch() : {}, slashingTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"/cosmos.v1beta1.MsgUnjail"} + {"tx.body.messages.@type":"/cosmos.slashing.v1beta1.MsgUnjail"} ] }).fetch() : {}, IBCTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"/cosmos.IBCTransferMsg"}, - {"tx.body.messages.type":"/cosmos.IBCReceiveMsg"} + {"tx.body.messages.@type":"/cosmos.IBCTransferMsg"}, + {"tx.body.messages.@type":"/cosmos.IBCReceiveMsg"} ] }).fetch() : {}, }; diff --git a/imports/ui/components/TransactionsContainer.js b/imports/ui/components/TransactionsContainer.js index d93fde725..8e38443e9 100644 --- a/imports/ui/components/TransactionsContainer.js +++ b/imports/ui/components/TransactionsContainer.js @@ -29,42 +29,42 @@ export default TransactionsContainer = withTracker((props) => { transactionsExist, transferTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"/cosmos.v1beta1.MsgSend"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgMultiSend"} + {"tx.body.messages.@type":"/cosmos.bank.v1beta1.MsgSend"}, + {"tx.body.messages.@type":"/cosmos.bank.v1beta1.MsgMultiSend"} ] }).fetch() : {}, stakingTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"/cosmos.v1beta1.MsgCreateValidator"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgEditValidator"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgDelegate"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgUndelegate"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgBeginRedelegate"} + {"tx.body.messages.@type":"/cosmos.staking.v1beta1.MsgCreateValidator"}, + {"tx.body.messages.@type":"/cosmos.staking.v1beta1.MsgEditValidator"}, + {"tx.body.messages.@type":"/cosmos.staking.v1beta1.MsgDelegate"}, + {"tx.body.messages.@type":"/cosmos.staking.v1beta1.MsgUndelegate"}, + {"tx.body.messages.@type":"/cosmos.staking.v1beta1.MsgBeginRedelegate"} ] }).fetch() : {}, distributionTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"/cosmos.v1beta1.MsgWithdrawValidatorCommission"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgWithdrawDelegationReward"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgModifyWithdrawAddress"} + {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"}, + {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgWithdrawDelegationReward"}, + {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgModifyWithdrawAddress"} ] }).fetch() : {}, governanceTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"/cosmos.v1beta1.MsgSubmitProposal"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgDeposit"}, - {"tx.body.messages.type":"/cosmos.v1beta1.MsgVote"} + {"tx.body.messages.@type":"/cosmos.gov.v1beta1.MsgSubmitProposal"}, + {"tx.body.messages.@type":"/cosmos.gov.v1beta1.MsgDeposit"}, + {"tx.body.messages.@type":"/cosmos.gov.v1beta1.MsgVote"} ] }).fetch() : {}, slashingTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"/cosmos.v1beta1.MsgUnjail"} + {"tx.body.messages.@type":"/cosmos.slashing.v1beta1.MsgUnjail"} ] }).fetch() : {}, IBCTxs: transactionsExist ? Transactions.find({ $or: [ - {"tx.body.messages.type":"/cosmos.IBCTransferMsg"}, - {"tx.body.messages.type":"/cosmos.IBCReceiveMsg"} + {"tx.body.messages.@type":"/cosmos.IBCTransferMsg"}, + {"tx.body.messages.@type":"/cosmos.IBCReceiveMsg"} ] }).fetch() : {} }; From 2a0907454340f4afbb05b97b9d1699ffb22aca37 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 15:43:40 +0000 Subject: [PATCH 062/127] update delegator reward message type --- imports/ui/blocks/BlockContainer.js | 2 +- imports/ui/components/Activities.jsx | 14 +++++++------- imports/ui/components/MsgType.jsx | 2 +- imports/ui/components/TransactionsContainer.js | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/imports/ui/blocks/BlockContainer.js b/imports/ui/blocks/BlockContainer.js index 6e849456b..df8b979f2 100644 --- a/imports/ui/blocks/BlockContainer.js +++ b/imports/ui/blocks/BlockContainer.js @@ -55,7 +55,7 @@ export default BlockContainer = withTracker((props) => { distributionTxs: transactionsExist ? Transactions.find({ $or: [ {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"}, - {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgWithdrawDelegationReward"}, + {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"}, {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgModifyWithdrawAddress"} ] }).fetch() : {}, diff --git a/imports/ui/components/Activities.jsx b/imports/ui/components/Activities.jsx index af7423308..61ad6975e 100644 --- a/imports/ui/components/Activities.jsx +++ b/imports/ui/components/Activities.jsx @@ -57,15 +57,15 @@ export default class Activites extends Component { // staking case "/cosmos.staking.v1beta1.MsgCreateValidator": - return

    {(this.props.invalid)?activities.failedTo:''} activities.operatingAt activities.withMoniker {msg.description.moniker}common.fullStop

    + return

    {(this.props.invalid)?activities.failedTo:''} activities.operatingAt activities.withMoniker {msg.description.moniker}common.fullStop

    case "/cosmos.staking.v1beta1.MsgEditValidator": return

    {(this.props.invalid)?activities.failedTo:''}

    case "/cosmos.staking.v1beta1.MsgDelegate": - return

    {(this.props.invalid)?activities.failedTo:''} {new Coin(msg.amount.amount, msg.amount.denom).toString(6)} activities.to common.fullStop

    + return

    {(this.props.invalid)?activities.failedTo:''} {new Coin(msg.amount.amount, msg.amount.denom).toString(6)} activities.to common.fullStop

    case "/cosmos.staking.v1beta1.MsgUndelegate": - return

    {(this.props.invalid)?activities.failedTo:''} {new Coin(msg.amount.amount, msg.amount.denom).toString(6)} activities.from common.fullStop

    + return

    {(this.props.invalid)?activities.failedTo:''} {new Coin(msg.amount.amount, msg.amount.denom).toString(6)} activities.from common.fullStop

    case "/cosmos.staking.v1beta1.MsgBeginRedelegate": - return

    {(this.props.invalid)?activities.failedTo:''} {new Coin(msg.amount.amount, msg.amount.denom).toString(6)} activities.from activities.to common.fullStop

    + return

    {(this.props.invalid)?activities.failedTo:''} {new Coin(msg.amount.amount, msg.amount.denom).toString(6)} activities.from activities.to common.fullStop

    // gov case "/cosmos.gov.v1beta1.MsgSubmitProposal": @@ -80,10 +80,10 @@ export default class Activites extends Component { // distribution case "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission": return

    {(this.props.invalid)?activities.failedTo:''} {(!this.props.invalid)?activities.withAmount:''}common.fullStop

    - case "/cosmos.distribution.v1beta1.MsgWithdrawDelegationReward": - return

    {(this.props.invalid)?activities.failedTo:''} {(!this.props.invalid)?activities.withAmount:''} activities.from common.fullStop

    + case "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward": + return

    {(this.props.invalid)?activities.failedTo:''} {(!this.props.invalid)?activities.withAmount:''} activities.from common.fullStop

    case "/cosmos.distribution.v1beta1.MsgModifyWithdrawAddress": - return

    {(this.props.invalid)?activities.failedTo:''}

    + return

    {(this.props.invalid)?activities.failedTo:''}

    // slashing case "/cosmos.slashing.v1beta1.MsgUnjail": diff --git a/imports/ui/components/MsgType.jsx b/imports/ui/components/MsgType.jsx index e8e6945bc..a4b2dfccf 100644 --- a/imports/ui/components/MsgType.jsx +++ b/imports/ui/components/MsgType.jsx @@ -35,7 +35,7 @@ export const MsgType = (props) => { // distribution case "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission": return messageTypes.withdrawComission; - case "/cosmos.distribution.v1beta1.MsgWithdrawDelegationReward": + case "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward": return messageTypes.withdrawReward; case "/cosmos.distribution.v1beta1.MsgModifyWithdrawAddress": return messageTypes.modifyWithdrawAddress; diff --git a/imports/ui/components/TransactionsContainer.js b/imports/ui/components/TransactionsContainer.js index 8e38443e9..6f5bbe975 100644 --- a/imports/ui/components/TransactionsContainer.js +++ b/imports/ui/components/TransactionsContainer.js @@ -45,7 +45,7 @@ export default TransactionsContainer = withTracker((props) => { distributionTxs: transactionsExist ? Transactions.find({ $or: [ {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"}, - {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgWithdrawDelegationReward"}, + {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"}, {"tx.body.messages.@type":"/cosmos.distribution.v1beta1.MsgModifyWithdrawAddress"} ] }).fetch() : {}, From 148e66ec504a47850ceac8d8cc595fff4dd7bca4 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 16:35:31 +0000 Subject: [PATCH 063/127] update balance apis --- imports/api/accounts/server/methods.js | 41 +++++++++++++------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/imports/api/accounts/server/methods.js b/imports/api/accounts/server/methods.js index e41c4a6c6..8e25a4163 100644 --- a/imports/api/accounts/server/methods.js +++ b/imports/api/accounts/server/methods.js @@ -20,15 +20,16 @@ Meteor.methods({ try{ let available = HTTP.get(url); if (available.statusCode == 200){ - let response = JSON.parse(available.content).result; - let account; - if (response.type === 'cosmos-sdk/Account') - account = response.value; - else if (response.type === 'cosmos-sdk/DelayedVestingAccount' || response.type === 'cosmos-sdk/ContinuousVestingAccount') - account = response.value.BaseVestingAccount.BaseAccount - if (account && account.account_number != null) - return account - return null + return JSON.parse(available.content).account + // let response = JSON.parse(available.content).result; + // let account; + // if (response.type === 'cosmos-sdk/Account') + // account = response.value; + // else if (response.type === 'cosmos-sdk/DelayedVestingAccount' || response.type === 'cosmos-sdk/ContinuousVestingAccount') + // account = response.value.BaseVestingAccount.BaseAccount + // if (account && account.account_number != null) + // return account + // return null } } catch (e){ @@ -45,7 +46,7 @@ Meteor.methods({ try{ let available = HTTP.get(url); if (available.statusCode == 200){ - balance.available = JSON.parse(available.content).result; + balance.available = JSON.parse(available.content).balances; } } @@ -55,11 +56,11 @@ Meteor.methods({ } // get delegated amnounts - url = API + '/cosmos/staking/v1beta1/delegators/'+address+'/delegations'; + url = API + '/cosmos/staking/v1beta1/delegations/'+address; try{ let delegations = HTTP.get(url); if (delegations.statusCode == 200){ - balance.delegations = JSON.parse(delegations.content).result; + balance.delegations = JSON.parse(delegations.content).delegation_responses; } } catch (e){ @@ -71,7 +72,7 @@ Meteor.methods({ try{ let unbonding = HTTP.get(url); if (unbonding.statusCode == 200){ - balance.unbonding = JSON.parse(unbonding.content).result; + balance.unbonding = JSON.parse(unbonding.content).unbonding_responses; } } catch (e){ @@ -80,14 +81,14 @@ Meteor.methods({ } // get rewards - url = API + '/cosmos/distribution/v1beta1/v1beta1/delegators/'+address+'/rewards'; + url = API + '/cosmos/distribution/v1beta1/delegators/'+address+'/rewards'; try{ let rewards = HTTP.get(url); if (rewards.statusCode == 200){ //get seperate rewards value - balance.rewards = JSON.parse(rewards.content).result.rewards; + balance.rewards = JSON.parse(rewards.content).rewards; //get total rewards value - balance.total_rewards= JSON.parse(rewards.content).result.total; + balance.total_rewards= JSON.parse(rewards.content).total; } } @@ -100,14 +101,14 @@ Meteor.methods({ let validator = Validators.findOne( {$or: [{operatorAddress:address}, {delegatorAddress:address}, {address:address}]}) if (validator) { - let url = API + '/cosmos/distribution/v1beta1/validators/' + validator.operatorAddress; + let url = API + '/cosmos/distribution/v1beta1/validators/'+validator.operatorAddress+'/commission'; balance.operatorAddress = validator.operatorAddress; try { let rewards = HTTP.get(url); if (rewards.statusCode == 200){ - let content = JSON.parse(rewards.content).result; - if (content.val_commission && content.val_commission.length > 0) - balance.commission = content.val_commission; + let content = JSON.parse(rewards.content).commission; + if (content.commission && content.commission.length > 0) + balance.commission = content.commission; } From 01e128f71428aa76e8a7499947398ff68e0d0f5b Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 17:00:34 +0000 Subject: [PATCH 064/127] update validator delegation names --- imports/api/transactions/server/methods.js | 6 +++--- imports/api/validators/server/methods.js | 2 +- imports/ui/validators/Delegations.jsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index 5aeeef200..e81c74efa 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -88,14 +88,14 @@ Meteor.methods({ // address is either delegator address or validator operator address let validator; if (!fields) - fields = {address:1, description:1, operator_address:1, delegator_address:1}; + fields = {address:1, description:1, operatorAddress:1, delegatorAddress:1}; if (address.includes(Meteor.settings.public.bech32PrefixValAddr)){ // validator operator address - validator = Validators.findOne({operator_address:address}, {fields}); + validator = Validators.findOne({operatorAddress:address}, {fields}); } else if (address.includes(Meteor.settings.public.bech32PrefixAccAddr)){ // delegator address - validator = Validators.findOne({delegator_address:address}, {fields}); + validator = Validators.findOne({delegatorAddress:address}, {fields}); } else if (address.length === AddressLength) { validator = Validators.findOne({address:address}, {fields}); diff --git a/imports/api/validators/server/methods.js b/imports/api/validators/server/methods.js index d8f9977af..2f7510fc4 100644 --- a/imports/api/validators/server/methods.js +++ b/imports/api/validators/server/methods.js @@ -31,7 +31,7 @@ Meteor.methods({ try{ let delegations = HTTP.get(url); if (delegations.statusCode == 200){ - delegations = JSON.parse(delegations.content).result; + delegations = JSON.parse(delegations.content).delegation_responses; delegations.forEach((delegation, i) => { if (delegations[i] && delegations[i].shares) delegations[i].shares = parseFloat(delegations[i].shares); diff --git a/imports/ui/validators/Delegations.jsx b/imports/ui/validators/Delegations.jsx index 7d585fca4..9cca694db 100644 --- a/imports/ui/validators/Delegations.jsx +++ b/imports/ui/validators/Delegations.jsx @@ -37,8 +37,8 @@ export default class ValidatorDelegations extends Component{ numDelegatiors:delegations.length, delegations: delegations.map((d, i) => { return -
    - {new Coin((d.shares/this.props.shares*this.props.tokens), this.props.denom).stakeString()} + + {new Coin((d.balance.amount), d.balance.denom).stakeString()} }) }) From ce877533f200e8cbccb5fa686b75cfb63e9e59b0 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 17:04:29 +0000 Subject: [PATCH 065/127] update tx event search --- imports/api/transactions/server/methods.js | 32 +++++++++---------- .../api/transactions/server/publications.js | 4 +-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index e81c74efa..d22b1ccf0 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -56,26 +56,26 @@ Meteor.methods({ // following cosmos-sdk/x/slashing/spec/06_events.md and cosmos-sdk/x/staking/spec/06_events.md return Transactions.find({ $or: [{$and: [ - {"logs.events.type": "delegate"}, - {"logs.events.attributes.key": "validator"}, - {"logs.events.attributes.value": address} + {"tx_response.logs.events.type": "delegate"}, + {"tx_response.logs.events.attributes.key": "validator"}, + {"tx_response.logs.events.attributes.value": address} ]}, {$and:[ - {"logs.events.attributes.key": "action"}, - {"logs.events.attributes.value": "unjail"}, - {"logs.events.attributes.key": "sender"}, - {"logs.events.attributes.value": address} + {"tx_response.logs.events.attributes.key": "action"}, + {"tx_response.logs.events.attributes.value": "unjail"}, + {"tx_response.logs.events.attributes.key": "sender"}, + {"tx_response.logs.events.attributes.value": address} ]}, {$and:[ - {"logs.events.type": "create_validator"}, - {"logs.events.attributes.key": "validator"}, - {"logs.events.attributes.value": address} + {"tx_response.logs.events.type": "create_validator"}, + {"tx_response.logs.events.attributes.key": "validator"}, + {"tx_response.logs.events.attributes.value": address} ]}, {$and:[ - {"logs.events.type": "unbond"}, - {"logs.events.attributes.key": "validator"}, - {"logs.events.attributes.value": address} + {"tx_response.logs.events.type": "unbond"}, + {"tx_response.logs.events.attributes.key": "validator"}, + {"tx_response.logs.events.attributes.value": address} ]}, {$and:[ - {"logs.events.type": "redelegate"}, - {"logs.events.attributes.key": "destination_validator"}, - {"logs.events.attributes.value": address} + {"tx_response.logs.events.type": "redelegate"}, + {"tx_response.logs.events.attributes.key": "destination_validator"}, + {"tx_response.logs.events.attributes.value": address} ]}], "code": {$exists: false}, height:{$lt:height}}, diff --git a/imports/api/transactions/server/publications.js b/imports/api/transactions/server/publications.js index fc437c577..88c2efb32 100644 --- a/imports/api/transactions/server/publications.js +++ b/imports/api/transactions/server/publications.js @@ -25,11 +25,11 @@ publishComposite('transactions.list', function(limit = 30){ publishComposite('transactions.validator', function(validatorAddress, delegatorAddress, limit=100){ let query = {}; if (validatorAddress && delegatorAddress){ - query = {$or:[{"logs.events.attributes.value":validatorAddress}, {"logs.events.attributes.value":delegatorAddress}]} + query = {$or:[{"tx_response.logs.events.attributes.value":validatorAddress}, {"tx_response.logs.events.attributes.value":delegatorAddress}]} } if (!validatorAddress && delegatorAddress){ - query = {"logs.events.attributes.value":delegatorAddress} + query = {"tx_response.logs.events.attributes.value":delegatorAddress} } return { From da24807cff69dda8ba693332115c9279fc4b44da Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 17:08:08 +0000 Subject: [PATCH 066/127] update indexes --- imports/startup/server/create-indexes.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/imports/startup/server/create-indexes.js b/imports/startup/server/create-indexes.js index 032d767e6..90b259e8c 100644 --- a/imports/startup/server/create-indexes.js +++ b/imports/startup/server/create-indexes.js @@ -41,13 +41,13 @@ Transactions.rawCollection().createIndex({txhash:1},{unique:true}); Transactions.rawCollection().createIndex({height:-1}); Transactions.rawCollection().createIndex({processed:1}); // Transactions.rawCollection().createIndex({action:1}); -Transactions.rawCollection().createIndex({"logs.events.attributes.key":1}); -Transactions.rawCollection().createIndex({"logs.events.attributes.value":1}); +Transactions.rawCollection().createIndex({"tx_response.logs.events.attributes.key":1}); +Transactions.rawCollection().createIndex({"tx_response.logs.events.attributes.value":1}); Transactions.rawCollection().createIndex({ - "tx.value.msg.delegatorAddress":1, - "tx.value.msg.type":1, - "code": 1 -},{partialFilterExpression: {code:{$exists: true}}}) + "tx.body.messages.delegator_address":1, + "tx.body.messages.@type":1, + "tx_response.code": 1 +},{partialFilterExpression: {"tx_response.code":{$exists: true}}}) ValidatorSets.rawCollection().createIndex({block_height:-1}); From c56d109c49561b2d9f5643d7da0a581d614706af Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 17:24:26 +0000 Subject: [PATCH 067/127] update power history values --- imports/api/transactions/server/methods.js | 2 +- imports/ui/components/PowerHistory.jsx | 50 +++++++++++----------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index d22b1ccf0..818b8d1e9 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -77,7 +77,7 @@ Meteor.methods({ {"tx_response.logs.events.attributes.key": "destination_validator"}, {"tx_response.logs.events.attributes.value": address} ]}], - "code": {$exists: false}, + "tx_response.code": 0, height:{$lt:height}}, {sort:{height:-1}, limit: 1} diff --git a/imports/ui/components/PowerHistory.jsx b/imports/ui/components/PowerHistory.jsx index adbb70f34..b97656a05 100644 --- a/imports/ui/components/PowerHistory.jsx +++ b/imports/ui/components/PowerHistory.jsx @@ -21,48 +21,48 @@ export default class PowerHistory extends React.Component { // console.log(err); } if (result){ - // console.log(result); + console.log(result); let self = this; this.setState({ tx: result.map((msg, i) => {(msg.tx.body.messages && msg.tx.body.messages.length > 0)?msg.tx.body.messages.map((m, j) => { - switch (m.type){ - case "/cosmos.v1beta1.MsgBeginRedelegate": + switch (m["@type"]){ + case "/cosmos.staking.v1beta1.MsgBeginRedelegate": return validators.delegator - + - {(this.props.address == m.value.validator_dst_address)?activities.from:activities.to} - + {(this.props.address == m.validator_dst_address)?activities.from:activities.to} + validators.amount - {new Coin(m.value.amount.amount, m.value.amount.denom).toString()} + {new Coin(m.amount.amount, m.amount.denom).toString()} - case "/cosmos.v1beta1.MsgDelegate": - if (m.value.validator_address == self.props.address){ + case "/cosmos.staking.v1beta1.MsgDelegate": + if (m.validator_address == self.props.address){ return validators.delegator - + validators.amount - {new Coin(m.value.amount.amount, m.value.amount.denom).toString()} + {new Coin(m.amount.amount, m.amount.denom).toString()} @@ -70,33 +70,33 @@ export default class PowerHistory extends React.Component { else{ return; } - case "/cosmos.v1beta1.MsgCreateValidator": + case "/cosmos.staking.v1beta1.MsgCreateValidator": return validators.delegator - + validators.amount - {new Coin(m.value.value.amount, m.value.value.denom).toString()} + {new Coin(m.value.amount, m.value.denom).toString()} - case "/cosmos.v1beta1.MsgUndelegate": + case "/cosmos.staking.v1beta1.MsgUndelegate": return validators.delegator - + validators.amount - {new Coin(m.value.amount.amount, m.value.amount.denom).toString()} + {new Coin(m.amount.amount, m.amount.denom).toString()} @@ -108,27 +108,27 @@ export default class PowerHistory extends React.Component { {(msg.tx.body.messages && msg.tx.body.messages.length > 0)?msg.tx.body.messages.map((m,j) => { - switch (m.type){ - case "/cosmos.v1beta1.MsgBeginRedelegate": + switch (m["@type"]){ + case "/cosmos.staking.v1beta1.MsgBeginRedelegate": return messageTypes.redelegate; - case "/cosmos.v1beta1.MsgDelegate": - if (m.value.validator_address == self.props.address){ + case "/cosmos.staking.v1beta1.MsgDelegate": + if (m.validator_address == self.props.address){ return messageTypes.delegate; } else return; - case "/cosmos.v1beta1.MsgCreateValidator": + case "/cosmos.staking.v1beta1.MsgCreateValidator": return messageTypes.createValidator; - case "/cosmos.v1beta1.MsgUnjail": + case "/cosmos.staking.v1beta1.MsgUnjail": return messageTypes.unjail; - case "/cosmos.v1beta1.MsgUndelegate": + case "/cosmos.staking.v1beta1.MsgUndelegate": return messageTypes.undelegate; } }):''} transactions.fee - {(msg.tx.value.fee.amount&& msg.tx.value.fee.amount.length>0)?msg.tx.value.fee.amount.map((amount,i)=> new Coin(amount.amount, amount.denom).toString()).join(' ,'):'0'} + {(msg.tx.auth_info.fee.amount&& msg.tx.auth_info.fee.amount.length>0)?msg.tx.auth_info.fee.amount.map((amount,i)=> new Coin(amount.amount, amount.denom).toString()).join(' ,'):'0'} From d6eac92574063d26e5a40a1d0f95735c125dc405 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 18:00:14 +0000 Subject: [PATCH 068/127] fix vp distribution --- imports/api/blocks/server/methods.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index ec688db5e..59b823457 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -80,7 +80,7 @@ getValidatorUptime = async (validatorSet) => { req = new Cosmos.Slashing.QuerySigningInfoRequest(); req.setConsAddress(validatorSet[key].bech32ValConsAddress); let signingInfo = await Cosmos.gRPC.unary(Cosmos.Slashing.Query.SigningInfo, req, GRPC); - console.log("=== Signing Info ===: %o", signingInfo) + // console.log("=== Signing Info ===: %o", signingInfo) if (signingInfo){ let valData = validatorSet[key] valData.tombstoned = signingInfo.valSigningInfo.tombstoned @@ -99,7 +99,7 @@ getValidatorUptime = async (validatorSet) => { calculateVPDist = async (analyticsData, blockData) => { console.log("===== calculate voting power distribution ====="); - let activeValidators = Validators.find({status:2,jailed:false},{sort:{voting_power:-1}}).fetch(); + let activeValidators = Validators.find({status:3,jailed:false},{sort:{voting_power:-1}}).fetch(); let numTopTwenty = Math.ceil(activeValidators.length*0.2); let numBottomEighty = activeValidators.length - numTopTwenty; @@ -483,8 +483,10 @@ Meteor.methods({ let valData = validatorSet[v]; let valExist = Validators.findOne({"consensusPubkey.value":v}); + // console.log("===== voting power ======: %o", valData) analyticsData.voting_power += valData.voting_power + // console.log(analyticsData.voting_power); if (!valExist && valData.consensusPubkey){ // let val = getValidatorFromConsensusKey(validators, v); @@ -680,6 +682,12 @@ Meteor.methods({ let endAnalyticsInsertTime = new Date(); console.log("Analytics insert time: "+((endAnalyticsInsertTime-startAnayticsInsertTime)/1000)+"seconds."); + // calculate voting power distribution every 60 blocks ~ 5mins + + if (height % 60 == 1){ + calculateVPDist(analyticsData, blockData) + } + let startVUpTime = new Date(); if (bulkValidators.length > 0){ console.log("############ Update validators ############"); @@ -722,11 +730,7 @@ Meteor.methods({ }); } - // calculate voting power distribution every 60 blocks ~ 5mins - if (height % 60 == 1){ - calculateVPDist(analyticsData, blockData) - } // } } catch (e){ From 5d5d51dea2a0ea119ee03ff1228d78e18a2e6737 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 18:13:49 +0000 Subject: [PATCH 069/127] fix initial power change value --- imports/api/blocks/server/methods.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 59b823457..4bb8bde11 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -528,10 +528,12 @@ Meteor.methods({ // insert first power change history // valData.voting_power = validators[valData.consensusPubkey.value]?parseInt(validators[valData.consensusPubkey.value].votingPower):0; - valData.voting_power = validators[valData.address]?parseInt(validators[valData.address].votingPower):0; - valData.proposer_priority = validators[valData.address]?parseInt(validators[valData.address].proposerPriority):0; + valData.voting_power = validators[valData.address]?parseInt(validators[valData.address].voting_power):0; + valData.proposer_priority = validators[valData.address]?parseInt(validators[valData.address].proposer_priority):0; console.log("Validator not found. Insert first VP change record.") + + // console.log("first voting power: %o", valData.voting_power); bulkVPHistory.insert({ address: valData.address, prev_voting_power: 0, From e0849cde011ae9e1134cfdaae2ea3517aebf932a Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 17 Feb 2021 18:18:02 +0000 Subject: [PATCH 070/127] update version --- private/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/version b/private/version index 1fdbdc009..23653e6b5 100644 --- a/private/version +++ b/private/version @@ -1 +1 @@ -v0.40.x-v0.0.1 +v0.40.x-v0.0.3 From f4008840977c075435e5269c6e3502f9b634fd41 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 20 Feb 2021 15:33:45 +0000 Subject: [PATCH 071/127] temperary disable inflation and annual provision query --- imports/api/chain/server/methods.js | 54 ++++++++++++++--------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index 0a2e44078..4e7ff8fd5 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -136,33 +136,33 @@ Meteor.methods({ } } - if (Meteor.settings.public.modules.minting){ - try{ - req = new Cosmos.Mint.QueryInflationRequest() - let inflation = await Cosmos.gRPC.unary(Cosmos.Mint.Query.Inflation, req, GRPC); - console.log(inflation); - // response = HTTP.get(url); - // let inflation = JSON.parse(response.content).result; - if (inflation){ - chainStates.inflation = parseFloat(inflation) - } - } - catch(e){ - console.log(e); - } - - try{ - req = new Cosmos.Mint.QueryAnnualProvisionsRequest(); - let provisions = await Cosmos.gRPC.unary(Cosmos.Mint.Query.AnnualProvisions, req, GRPC) - console.log(provisions) - if (provisions){ - chainStates.annualProvisions = parseFloat(provisions) - } - } - catch(e){ - console.log(e); - } - } + // if (Meteor.settings.public.modules.minting){ + // try{ + // req = new Cosmos.Mint.QueryInflationRequest() + // let inflation = await Cosmos.gRPC.unary(Cosmos.Mint.Query.Inflation, req, GRPC); + // console.log(inflation); + // // response = HTTP.get(url); + // // let inflation = JSON.parse(response.content).result; + // if (inflation){ + // chainStates.inflation = parseFloat(inflation) + // } + // } + // catch(e){ + // console.log(e); + // } + + // try{ + // req = new Cosmos.Mint.QueryAnnualProvisionsRequest(); + // let provisions = await Cosmos.gRPC.unary(Cosmos.Mint.Query.AnnualProvisions, req, GRPC) + // console.log(provisions) + // if (provisions){ + // chainStates.annualProvisions = parseFloat(provisions) + // } + // } + // catch(e){ + // console.log(e); + // } + // } } ChainStates.insert(chainStates); From f79a92651efa83af6acb90d40c51d2b804f725ab Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 20 Feb 2021 15:38:23 +0000 Subject: [PATCH 072/127] reduce community pool to human readable number --- imports/api/chain/server/methods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index 4e7ff8fd5..d9aed577f 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -126,7 +126,7 @@ Meteor.methods({ pool.forEach((amount) => { chainStates.communityPool.push({ denom: amount.denom, - amount: parseFloat(amount.amount) + amount: parseFloat(amount.amount)/Meteor.settings.public.humanizeReduction }) }) } From f70a54fcb9fc0eb7568ba6ae63a34a7bb117fff3 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 20 Feb 2021 16:07:02 +0000 Subject: [PATCH 073/127] remove gov proposer query --- imports/api/accounts/server/methods.js | 31 +++++++---- imports/api/blocks/server/methods.js | 2 +- imports/api/proposals/server/methods.js | 64 ++++++++++++---------- imports/api/transactions/server/methods.js | 4 +- imports/api/validators/server/methods.js | 1 + 5 files changed, 59 insertions(+), 43 deletions(-) diff --git a/imports/api/accounts/server/methods.js b/imports/api/accounts/server/methods.js index 8e25a4163..f61e75d98 100644 --- a/imports/api/accounts/server/methods.js +++ b/imports/api/accounts/server/methods.js @@ -9,6 +9,7 @@ const fetchFromUrl = (url) => { }; } catch (e){ + console.log(url); console.log(e); } } @@ -192,19 +193,25 @@ Meteor.methods({ } }, 'accounts.getAllRedelegations'(address, validator){ - this.unblock(); + this.unblock(); let url = `/cosmos/staking/v1beta1/v1beta1/delegators/${address}/redelegations&src_validator_addr=${validator}`; - let result = fetchFromUrl(url); - if (result && result.data) { - let redelegations = {} - result.data.forEach((redelegation) => { - let entries = redelegation.entries; - redelegations[redelegation.validator_dst_address] = { - count: entries.length, - completionTime: entries[0].completion_time - } - }) - return redelegations + try{ + let result = fetchFromUrl(url); + if (result && result.data) { + let redelegations = {} + result.data.forEach((redelegation) => { + let entries = redelegation.entries; + redelegations[redelegation.validator_dst_address] = { + count: entries.length, + completionTime: entries[0].completion_time + } + }) + return redelegations + } + } + catch(e){ + console.log(url); + console.log(e); } }, 'accounts.getRedelegations'(address) { diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 4bb8bde11..39552d3b0 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -736,7 +736,7 @@ Meteor.methods({ // } } catch (e){ - console.log(e); + console.log("Block syncing stopped: %o", e); SYNCING = false; return "Stopped"; } diff --git a/imports/api/proposals/server/methods.js b/imports/api/proposals/server/methods.js index b69c38351..93a9db1a9 100644 --- a/imports/api/proposals/server/methods.js +++ b/imports/api/proposals/server/methods.js @@ -7,10 +7,10 @@ import { Validators } from '../../validators/validators.js'; Meteor.methods({ 'proposals.getProposals': function(){ this.unblock(); - try{ - // get gov tally prarams - let url = API + '/cosmos/gov/v1beta1/params/tallying'; + // get gov tally prarams + let url = API + '/cosmos/gov/v1beta1/params/tallying'; + try{ let response = HTTP.get(url); let params = JSON.parse(response.content); @@ -21,36 +21,38 @@ Meteor.methods({ let proposals = JSON.parse(response.content).proposals; // console.log(proposals); - let finishedProposalIds = new Set(Proposals.find( - {"proposal_status":{$in:["PROPOSAL_STATUS_PASSED", "PROPOSAL_STATUS_REJECTED", "PROPOSAL_STATUS_REMOVED"]}} - ).fetch().map((p)=> p.proposalId)); + // let finishedProposalIds = new Set(Proposals.find( + // {"proposal_status":{$in:["PROPOSAL_STATUS_PASSED", "PROPOSAL_STATUS_REJECTED", "PROPOSAL_STATUS_REMOVED"]}} + // ).fetch().map((p)=> p.proposalId)); let proposalIds = []; if (proposals.length > 0){ // Proposals.upsert() const bulkProposals = Proposals.rawCollection().initializeUnorderedBulkOp(); for (let i in proposals){ - let proposal = proposals[i]; - proposal.proposalId = parseInt(proposal.proposal_id); - if (proposal.proposalId > 0 && !finishedProposalIds.has(proposal.proposalId)) { - try{ - let url = API + '/cosmos/gov/v1beta1/proposals/'+proposal.proposalId+'/proposer'; - let response = HTTP.get(url); - if (response.statusCode == 200){ - let proposer = JSON.parse(response.content).result; - if (proposer.proposal_id && (proposer.proposal_id == proposal.id)){ - proposal.proposer = proposer.proposer; - } - } - bulkProposals.find({proposalId: proposal.proposalId}).upsert().updateOne({$set:proposal}); - proposalIds.push(proposal.proposalId); - } - catch(e){ - bulkProposals.find({proposalId: proposal.proposalId}).upsert().updateOne({$set:proposal}); - proposalIds.push(proposal.proposalId); - console.log(e.response.content); - } - } + proposalIds.push(proposals[i].proposalId); + + // let proposal = proposals[i]; + // proposal.proposalId = parseInt(proposal.proposal_id); + // if (proposal.proposalId > 0 && !finishedProposalIds.has(proposal.proposalId)) { + // try{ + // url = API + '/cosmos/gov/v1beta1/proposals/'+proposal.proposalId+'/proposer'; + // let response = HTTP.get(url); + // if (response.statusCode == 200){ + // let proposer = JSON.parse(response.content).result; + // if (proposer.proposal_id && (proposer.proposal_id == proposal.id)){ + // proposal.proposer = proposer.proposer; + // } + // } + // bulkProposals.find({proposalId: proposal.proposalId}).upsert().updateOne({$set:proposal}); + // } + // catch(e){ + // bulkProposals.find({proposalId: proposal.proposalId}).upsert().updateOne({$set:proposal}); + // proposalIds.push(proposal.proposalId); + // console.log(url); + // console.log(e.response.content); + // } + // } } bulkProposals.find({proposalId:{$nin:proposalIds}, status:{$nin:["PROPOSAL_STATUS_PASSED", "PROPOSAL_STATUS_REJECTED", "PROPOSAL_STATUS_REMOVED"]}}) .update({$set: {"status": "PROPOSAL_STATUS_REMOVED"}}); @@ -59,6 +61,7 @@ Meteor.methods({ return true } catch (e){ + console.log(url); console.log(e); } }, @@ -69,9 +72,10 @@ Meteor.methods({ if (proposals && (proposals.length > 0)){ for (let i in proposals){ if (parseInt(proposals[i].proposalId) > 0){ + let url = ""; try{ // get proposal deposits - let url = API + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/deposits'; + url = API + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/deposits'; let response = HTTP.get(url); let proposal = {proposalId: proposals[i].proposalId}; if (response.statusCode == 200){ @@ -97,7 +101,8 @@ Meteor.methods({ Proposals.update({proposalId: proposals[i].proposalId}, {$set:proposal}); } catch(e){ - + console.log(url); + console.log(e); } } } @@ -156,6 +161,7 @@ const getVoteDetail = (votes) => { } } catch (e){ + console.log(url); console.log(e.response.content); } votingPowerMap[voter] = {votingPower: votingPower}; diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index 818b8d1e9..01e4e8e0f 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -16,8 +16,9 @@ Meteor.methods({ TXSYNCING = true; const bulkTransactions = Transactions.rawCollection().initializeUnorderedBulkOp(); for (let i in transactions){ + let url = ""; try { - let url = API+ '/cosmos/tx/v1beta1/txs/'+transactions[i].txhash; + url = API+ '/cosmos/tx/v1beta1/txs/'+transactions[i].txhash; let response = HTTP.get(url); let tx = JSON.parse(response.content); @@ -29,6 +30,7 @@ Meteor.methods({ } catch(e) { + console.log(url); console.log("Getting transaction %o: %o", hash, e); } } diff --git a/imports/api/validators/server/methods.js b/imports/api/validators/server/methods.js index 2f7510fc4..5625095db 100644 --- a/imports/api/validators/server/methods.js +++ b/imports/api/validators/server/methods.js @@ -41,6 +41,7 @@ Meteor.methods({ }; } catch (e){ + console.log(url); console.log("Getting error: %o when fetching from %o", e, url); } } From ee22e4179cabcddb1332530c0770a0d427ad87c5 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 20 Feb 2021 16:08:14 +0000 Subject: [PATCH 074/127] update version --- private/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/version b/private/version index 23653e6b5..fdcd17f35 100644 --- a/private/version +++ b/private/version @@ -1 +1 @@ -v0.40.x-v0.0.3 +v0.41.x-1 From 990449f31af9e05d0e3481063e6ceb9c93355e12 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 20 Feb 2021 17:19:31 +0000 Subject: [PATCH 075/127] console log object --- server/main.js | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/server/main.js b/server/main.js index e56fddae7..19261c26c 100644 --- a/server/main.js +++ b/server/main.js @@ -30,10 +30,10 @@ const DEFAULTSETTINGS = '/default_settings.json'; updateChainStatus = () => { Meteor.call('chain.updateStatus', (error, result) => { if (error){ - console.log("updateStatus: "+error); + console.log("updateStatus: %o", error); } else{ - console.log("updateStatus: "+result); + console.log("updateStatus: %o", result); } }) } @@ -41,10 +41,10 @@ updateChainStatus = () => { updateBlock = () => { Meteor.call('blocks.blocksUpdate', (error, result) => { if (error){ - console.log("updateBlocks: "+error); + console.log("updateBlocks: %o", error); } else{ - console.log("updateBlocks: "+result); + console.log("updateBlocks: %o", result); } }) } @@ -52,10 +52,10 @@ updateBlock = () => { updateTransactions = () => { Meteor.call('Transactions.updateTransactions', (error, result) => { if (error){ - console.log("updateTransactions: "+error); + console.log("updateTransactions: %o",error); } else{ - console.log("updateTransactions: "+result); + console.log("updateTransactions: %o",result); } }) } @@ -63,7 +63,7 @@ updateTransactions = () => { getConsensusState = () => { Meteor.call('chain.getConsensusState', (error, result) => { if (error){ - console.log("get consensus: "+error) + console.log("get consensus: %o", error) } }) } @@ -71,10 +71,10 @@ getConsensusState = () => { getProposals = () => { Meteor.call('proposals.getProposals', (error, result) => { if (error){ - console.log("get proposal: "+ error); + console.log("get proposal: %o", error); } if (result){ - console.log("get proposal: "+result); + console.log("get proposal: %o", result); } }); } @@ -82,10 +82,10 @@ getProposals = () => { getProposalsResults = () => { Meteor.call('proposals.getProposalResults', (error, result) => { if (error){ - console.log("get proposals result: "+error); + console.log("get proposals result: %o", error); } if (result){ - console.log("get proposals result: "+result); + console.log("get proposals result: %o", result); } }); } @@ -93,10 +93,10 @@ getProposalsResults = () => { updateMissedBlocks = () => { Meteor.call('ValidatorRecords.calculateMissedBlocks', (error, result) =>{ if (error){ - console.log("missed blocks error: "+ error) + console.log("missed blocks error: %o", error) } if (result){ - console.log("missed blocks ok:" + result); + console.log("missed blocks ok: %o", result); } }); } @@ -104,10 +104,10 @@ updateMissedBlocks = () => { getDelegations = () => { Meteor.call('delegations.getDelegations', (error, result) => { if (error){ - console.log("get delegations error: "+ error) + console.log("get delegations error: %o", error) } else{ - console.log("get delegations ok: "+ result) + console.log("get delegations ok: %o", result) } }); } @@ -116,19 +116,19 @@ aggregateMinutely = () =>{ // doing something every min Meteor.call('Analytics.aggregateBlockTimeAndVotingPower', "m", (error, result) => { if (error){ - console.log("aggregate minutely block time error: "+error) + console.log("aggregate minutely block time error: %o", error) } else{ - console.log("aggregate minutely block time ok: "+result) + console.log("aggregate minutely block time ok: %o", result) } }); Meteor.call('coinStats.getCoinStats', (error, result) => { if (error){ - console.log("get coin stats error: "+error); + console.log("get coin stats error: %o", error); } else{ - console.log("get coin stats ok: "+result) + console.log("get coin stats ok: %o", result) } }); } @@ -137,10 +137,10 @@ aggregateHourly = () =>{ // doing something every hour Meteor.call('Analytics.aggregateBlockTimeAndVotingPower', "h", (error, result) => { if (error){ - console.log("aggregate hourly block time error: "+error) + console.log("aggregate hourly block time error: %o", error) } else{ - console.log("aggregate hourly block time ok: "+result) + console.log("aggregate hourly block time ok: %o", result) } }); } @@ -149,19 +149,19 @@ aggregateDaily = () =>{ // doing somthing every day Meteor.call('Analytics.aggregateBlockTimeAndVotingPower', "d", (error, result) => { if (error){ - console.log("aggregate daily block time error: "+error) + console.log("aggregate daily block time error: %o", error) } else{ - console.log("aggregate daily block time ok: "+result) + console.log("aggregate daily block time ok: %o", result) } }); Meteor.call('Analytics.aggregateValidatorDailyBlockTime', (error, result) => { if (error){ - console.log("aggregate validators block time error:"+ error) + console.log("aggregate validators block time error: %o", error) } else { - console.log("aggregate validators block time ok:"+ result); + console.log("aggregate validators block time ok: %o", result); } }) } From 0d6d4f316a377f434b8ddbf3babf0f15abffb8e5 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 20 Feb 2021 17:49:02 +0000 Subject: [PATCH 076/127] fix transactions not being saved --- imports/api/chain/server/methods.js | 3 ++- imports/api/transactions/server/methods.js | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index d9aed577f..85efbcf6f 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -43,6 +43,7 @@ Meteor.methods({ }, 'chain.updateStatus': async function(){ this.unblock(); + let url = ""; try{ let req = new Cosmos.Base.Tendermint.GetLatestBlockRequest(); let latestBlock = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetLatestBlock, req, GRPC); @@ -69,7 +70,7 @@ Meteor.methods({ let page = 0; do { - let url = RPC+`/validators?page=${++page}&per_page=100`; + url = RPC+`/validators?page=${++page}&per_page=100`; let response = HTTP.get(url); result = JSON.parse(response.content).result; // console.log("========= validator result ==========: %o", result) diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index 01e4e8e0f..69618a0d0 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -21,17 +21,19 @@ Meteor.methods({ url = API+ '/cosmos/tx/v1beta1/txs/'+transactions[i].txhash; let response = HTTP.get(url); let tx = JSON.parse(response.content); - + + // console.log(tx); + tx.height = parseInt(tx.tx_response.height); tx.processed = true; bulkTransactions.find({txhash:transactions[i].txhash}).updateOne({$set:tx}); - } - catch(e) { - console.log(url); - console.log("Getting transaction %o: %o", hash, e); + catch(error) { + // console.log(url); + // console.log("tx not found: %o") + console.log("Getting transaction %o: %o", transactions[i].txhash, error); } } if (bulkTransactions.length > 0){ From 57f26845290c37ebde6d48df9cb59b49cc82addb Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 20 Feb 2021 17:53:33 +0000 Subject: [PATCH 077/127] save proposal correctly --- imports/api/proposals/server/methods.js | 50 ++++++++++++------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/imports/api/proposals/server/methods.js b/imports/api/proposals/server/methods.js index 93a9db1a9..bf7378fa4 100644 --- a/imports/api/proposals/server/methods.js +++ b/imports/api/proposals/server/methods.js @@ -21,38 +21,36 @@ Meteor.methods({ let proposals = JSON.parse(response.content).proposals; // console.log(proposals); - // let finishedProposalIds = new Set(Proposals.find( - // {"proposal_status":{$in:["PROPOSAL_STATUS_PASSED", "PROPOSAL_STATUS_REJECTED", "PROPOSAL_STATUS_REMOVED"]}} - // ).fetch().map((p)=> p.proposalId)); + let finishedProposalIds = new Set(Proposals.find( + {"proposal_status":{$in:["PROPOSAL_STATUS_PASSED", "PROPOSAL_STATUS_REJECTED", "PROPOSAL_STATUS_REMOVED"]}} + ).fetch().map((p)=> p.proposalId)); let proposalIds = []; if (proposals.length > 0){ // Proposals.upsert() const bulkProposals = Proposals.rawCollection().initializeUnorderedBulkOp(); for (let i in proposals){ - proposalIds.push(proposals[i].proposalId); - - // let proposal = proposals[i]; - // proposal.proposalId = parseInt(proposal.proposal_id); - // if (proposal.proposalId > 0 && !finishedProposalIds.has(proposal.proposalId)) { - // try{ - // url = API + '/cosmos/gov/v1beta1/proposals/'+proposal.proposalId+'/proposer'; - // let response = HTTP.get(url); - // if (response.statusCode == 200){ - // let proposer = JSON.parse(response.content).result; - // if (proposer.proposal_id && (proposer.proposal_id == proposal.id)){ - // proposal.proposer = proposer.proposer; - // } - // } - // bulkProposals.find({proposalId: proposal.proposalId}).upsert().updateOne({$set:proposal}); - // } - // catch(e){ - // bulkProposals.find({proposalId: proposal.proposalId}).upsert().updateOne({$set:proposal}); - // proposalIds.push(proposal.proposalId); - // console.log(url); - // console.log(e.response.content); - // } - // } + let proposal = proposals[i]; + proposal.proposalId = parseInt(proposal.proposal_id); + if (proposal.proposalId > 0 && !finishedProposalIds.has(proposal.proposalId)) { + try{ + // url = API + '/cosmos/gov/v1beta1/proposals/'+proposal.proposalId+'/proposer'; + // let response = HTTP.get(url); + // if (response.statusCode == 200){ + // let proposer = JSON.parse(response.content).result; + // if (proposer.proposal_id && (proposer.proposal_id == proposal.id)){ + // proposal.proposer = proposer.proposer; + // } + // } + bulkProposals.find({proposalId: proposal.proposalId}).upsert().updateOne({$set:proposal}); + } + catch(e){ + bulkProposals.find({proposalId: proposal.proposalId}).upsert().updateOne({$set:proposal}); + proposalIds.push(proposal.proposalId); + console.log(url); + console.log(e.response.content); + } + } } bulkProposals.find({proposalId:{$nin:proposalIds}, status:{$nin:["PROPOSAL_STATUS_PASSED", "PROPOSAL_STATUS_REJECTED", "PROPOSAL_STATUS_REMOVED"]}}) .update({$set: {"status": "PROPOSAL_STATUS_REMOVED"}}); From 873b60e3ef9d699cfec79e303c98cd0542fe9cb9 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 20 Feb 2021 18:06:59 +0000 Subject: [PATCH 078/127] save missing flag to tx if index is missing --- imports/api/transactions/server/methods.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index 69618a0d0..5587337ee 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -22,18 +22,17 @@ Meteor.methods({ let response = HTTP.get(url); let tx = JSON.parse(response.content); - // console.log(tx); - tx.height = parseInt(tx.tx_response.height); tx.processed = true; bulkTransactions.find({txhash:transactions[i].txhash}).updateOne({$set:tx}); } - catch(error) { + catch(e) { // console.log(url); // console.log("tx not found: %o") - console.log("Getting transaction %o: %o", transactions[i].txhash, error); + console.log("Getting transaction %o: %o", transactions[i].txhash, e); + bulkTransactions.find({txhash:transactions[i].txhash}).updateOne({$set:{processed:true, missing:true}}); } } if (bulkTransactions.length > 0){ From 28f4c69b1dafda561f37602e735e17d47dcf5f32 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sat, 20 Feb 2021 18:07:02 +0000 Subject: [PATCH 079/127] update version --- private/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/version b/private/version index fdcd17f35..cac69461b 100644 --- a/private/version +++ b/private/version @@ -1 +1 @@ -v0.41.x-1 +v0.41.x-2 From d1c79aa5e7546cf4b95f2237deeb7d98eaf58696 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 22 Feb 2021 09:37:05 +0000 Subject: [PATCH 080/127] remove custom grpc call in chain state update --- imports/api/chain/server/methods.js | 98 +++++++++++++++-------------- private/version | 2 +- 2 files changed, 52 insertions(+), 48 deletions(-) diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index 85efbcf6f..f05d07ac9 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -2,8 +2,6 @@ import { Meteor } from 'meteor/meteor'; import { HTTP } from 'meteor/http'; import { Chain, ChainStates } from '../chain.js'; import Coin from '../../../../both/utils/coins.js'; -import { goTimeToISOString } from '../../../../both/utils/time'; -import { Cosmos } from '@forbole/cosmos-protobuf-js' findVotingPower = (validator, genValidators) => { for (let v in genValidators){ @@ -45,13 +43,14 @@ Meteor.methods({ this.unblock(); let url = ""; try{ - let req = new Cosmos.Base.Tendermint.GetLatestBlockRequest(); - let latestBlock = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetLatestBlock, req, GRPC); - // console.log(JSON.stringify(latestBlock)); + url = API + '/blocks/latest'; + let response = HTTP.get(url); + let latestBlock = JSON.parse(response.content); + let chain = {}; - chain.chainId = latestBlock.block.header.chainId; - chain.latestBlockHeight = latestBlock.block.header.height; - chain.latestBlockTime = goTimeToISOString(latestBlock.block.header.time) + chain.chainId = latestBlock.block.header.chain_id; + chain.latestBlockHeight = parseInt(latestBlock.block.header.height); + chain.latestBlockTime = latestBlock.block.header.time; let latestState = ChainStates.findOne({}, {sort: {height: -1}}) if (latestState && latestState.height >= chain.latestBlockHeight) { return `no updates (getting block ${chain.latestBlockHeight} at block ${latestState.height})` @@ -73,7 +72,6 @@ Meteor.methods({ url = RPC+`/validators?page=${++page}&per_page=100`; let response = HTTP.get(url); result = JSON.parse(response.content).result; - // console.log("========= validator result ==========: %o", result) validators = [...validators, ...result.validators]; } @@ -95,10 +93,11 @@ Meteor.methods({ chainStates.time = new Date(chain.latestBlockTime); try{ - req = new Cosmos.Staking.QueryPoolRequest(); - let bonding = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Pool, req, GRPC); - chainStates.bondedTokens = parseInt(bonding.pool.bondedTokens); - chainStates.notBondedTokens = parseInt(bonding.pool.notBondedTokens); + url = API + '/cosmos/staking/v1beta1/pool'; + let response = HTTP.get(url); + let bonding = JSON.parse(response.content).pool; + chainStates.bondedTokens = parseInt(bonding.bonded_tokens); + chainStates.notBondedTokens = parseInt(bonding.not_bonded_tokens); } catch(e){ console.log(e); @@ -107,9 +106,9 @@ Meteor.methods({ if ( Coin.StakingCoin.denom ) { if (Meteor.settings.public.modules.bank){ try{ - req = new Cosmos.Bank.QuerySupplyOfRequest(); - req.setDenom(Coin.StakingCoin.denom); - let supply = await Cosmos.gRPC.unary(Cosmos.Bank.Query.SupplyOf, req, GRPC); + url = API + '/cosmos/bank/v1beta1/supply/' + Coin.StakingCoin.denom; + let response = HTTP.get(url); + let supply = JSON.parse(response.content); chainStates.totalSupply = parseInt(supply.amount.amount); } catch(e){ @@ -119,15 +118,17 @@ Meteor.methods({ if (Meteor.settings.public.modules.distribution){ try { - req = new Cosmos.Distribution.QueryCommunityPoolRequest(); - let pool = await Cosmos.gRPC.unary(Cosmos.Distribution.Query.CommunityPool, req, GRPC); - pool = pool.poolList; + // req = new Cosmos.Distribution.QueryCommunityPoolRequest(); + // let pool = await Cosmos.gRPC.unary(Cosmos.Distribution.Query.CommunityPool, req, GRPC); + url = API + '/cosmos/distribution/v1beta1/community_pool'; + let response = HTTP.get(url); + let pool = JSON.parse(response.content).pool; if (pool && pool.length > 0){ chainStates.communityPool = []; pool.forEach((amount) => { chainStates.communityPool.push({ denom: amount.denom, - amount: parseFloat(amount.amount)/Meteor.settings.public.humanizeReduction + amount: parseFloat(amount.amount) }) }) } @@ -137,33 +138,36 @@ Meteor.methods({ } } - // if (Meteor.settings.public.modules.minting){ - // try{ - // req = new Cosmos.Mint.QueryInflationRequest() - // let inflation = await Cosmos.gRPC.unary(Cosmos.Mint.Query.Inflation, req, GRPC); - // console.log(inflation); - // // response = HTTP.get(url); - // // let inflation = JSON.parse(response.content).result; - // if (inflation){ - // chainStates.inflation = parseFloat(inflation) - // } - // } - // catch(e){ - // console.log(e); - // } - - // try{ - // req = new Cosmos.Mint.QueryAnnualProvisionsRequest(); - // let provisions = await Cosmos.gRPC.unary(Cosmos.Mint.Query.AnnualProvisions, req, GRPC) - // console.log(provisions) - // if (provisions){ - // chainStates.annualProvisions = parseFloat(provisions) - // } - // } - // catch(e){ - // console.log(e); - // } - // } + if (Meteor.settings.public.modules.minting){ + try{ + url = API + '/cosmos/mint/v1beta1/inflation'; + let response = HTTP.get(url); + let inflation = JSON.parse(response.content).inflation; + // response = HTTP.get(url); + // let inflation = JSON.parse(response.content).result; + if (inflation){ + chainStates.inflation = parseFloat(inflation) + } + } + catch(e){ + console.log(e); + } + + try{ + // req = new Cosmos.Mint.QueryAnnualProvisionsRequest(); + // let provisions = await Cosmos.gRPC.unary(Cosmos.Mint.Query.AnnualProvisions, req, GRPC) + url = API + '/cosmos/mint/v1beta1/annual_provisions'; + let response = HTTP.get(url); + let provisions = JSON.parse(response.content).annual_provisions; + console.log(provisions) + if (provisions){ + chainStates.annualProvisions = parseFloat(provisions) + } + } + catch(e){ + console.log(e); + } + } } ChainStates.insert(chainStates); diff --git a/private/version b/private/version index cac69461b..2246eac46 100644 --- a/private/version +++ b/private/version @@ -1 +1 @@ -v0.41.x-2 +v0.41.x-3 From 645e385003bf1a8fbe639acd82a30ba2f9bd86aa Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 22 Feb 2021 09:44:08 +0000 Subject: [PATCH 081/127] update npm packages --- package-lock.json | 62 +++++++++++++++++++++++------------------------ package.json | 14 +++++------ 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a021c773..3aff1af08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -105,9 +105,9 @@ "integrity": "sha512-I5nW8AhGpOXGCCNYGc+p7ExQIBxRFnS2fd/d862bNOKvmoEPjYPcfIjsfdy0ujagYOIYPczKgD9l3FsgTkAzKA==" }, "@babel/runtime": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", - "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "version": "7.12.18", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.18.tgz", + "integrity": "sha512-BogPQ7ciE6SYAUPtlm9tWbgI9+2AgqSam6QivMgXgAT+fKbgppaj4ZX15MHeLC1PVF5sNk70huBu20XxWOs8Cg==", "requires": { "regenerator-runtime": "^0.13.4" } @@ -1267,9 +1267,9 @@ "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" }, "chai": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", - "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.0.tgz", + "integrity": "sha512-/BFd2J30EcOwmdOgXvVsmM48l0Br0nmZPlO0uOW4XKh6kpsUumRXBgPV+IlaqFaqr9cYbeoZAM1Npx0i4A+aiA==", "dev": true, "requires": { "assertion-error": "^1.1.0", @@ -2922,9 +2922,9 @@ "dev": true }, "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "optional": true }, "function-bind": { @@ -2986,9 +2986,9 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, "google-protobuf": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.14.0.tgz", - "integrity": "sha512-bwa8dBuMpOxg7COyqkW6muQuvNnWgVN8TX/epDRGW5m0jcrmq2QJyCyiV8ZE2/6LaIIqJtiv9bYokFhfpy/o6w==" + "version": "3.15.1", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.15.1.tgz", + "integrity": "sha512-Ss2fADC0TpZXn6bqGgPJMUWoD1y9J7BTtJRVvf+quNxXRtQnrpubiFCdgoown+OetNsU4H3YbJgnpxYY/3kH6g==" }, "graceful-fs": { "version": "4.2.3", @@ -3617,9 +3617,9 @@ } }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lodash.curry": { "version": "4.1.1", @@ -4312,9 +4312,9 @@ "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" }, "moment-timezone": { - "version": "0.5.32", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.32.tgz", - "integrity": "sha512-Z8QNyuQHQAmWucp8Knmgei8YNo28aLjJq6Ma+jy1ZSpSk5nyfRT8xgUbSQvD2+2UajISfenndwvFuH3NGS+nvA==", + "version": "0.5.33", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz", + "integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==", "requires": { "moment": ">= 2.9.0" } @@ -4747,9 +4747,9 @@ } }, "pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, "pify": { @@ -5248,9 +5248,9 @@ } }, "react-json-view": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/react-json-view/-/react-json-view-1.20.2.tgz", - "integrity": "sha512-DOGrMqhDHrvBwzwiIU/LKpZ7CFrOHrjoQ+e+d1aOJHn82t++PKuB4atiNR1Ko8UBEoGrMv44RagRSyYWTsEHKg==", + "version": "1.21.1", + "resolved": "https://registry.npmjs.org/react-json-view/-/react-json-view-1.21.1.tgz", + "integrity": "sha512-AonvGea4nWlsnNXCbnSdUHsetyNS8rUMhbFHS9eFaDB1oeaxgHcVsqo5LhGRMvWybfDdjVUo0xzDoMQP7jbrXw==", "requires": { "flux": "^4.0.1", "react-base16-styling": "^0.6.0", @@ -5560,11 +5560,11 @@ } }, "rollup": { - "version": "2.37.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.37.1.tgz", - "integrity": "sha512-V3ojEeyGeSdrMSuhP3diBb06P+qV4gKQeanbDv+Qh/BZbhdZ7kHV0xAt8Yjk4GFshq/WjO7R4c7DFM20AwTFVQ==", + "version": "2.39.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.39.0.tgz", + "integrity": "sha512-+WR3bttcq7zE+BntH09UxaW3bQo3vItuYeLsyk4dL2tuwbeSKJuvwiawyhEnvRdRgrII0Uzk00FpctHO/zB1kw==", "requires": { - "fsevents": "~2.1.2" + "fsevents": "~2.3.1" } }, "rollup-plugin-typescript2": { @@ -6386,9 +6386,9 @@ "integrity": "sha512-8JYVOPZiEP/YPNUyhDi+nzA9ZqtaKfanISeP56/7zOBnf9Ci7WYUWojjp456xXUNc20jJgvJXgaIewti45bRxA==" }, "ua-parser-js": { - "version": "0.7.23", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.23.tgz", - "integrity": "sha512-m4hvMLxgGHXG3O3fQVAyyAQpZzDOvwnhOTjYz5Xmr7r/+LpkNy3vJXdVRWgd1TkAb7NGROZuSy96CrlNVjA7KA==" + "version": "0.7.24", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.24.tgz", + "integrity": "sha512-yo+miGzQx5gakzVK3QFfN0/L9uVhosXBBO7qmnk7c2iw1IhL212wfA3zbnI54B0obGwC/5NWub/iT9sReMx+Fw==" }, "ultron": { "version": "1.1.1", diff --git a/package.json b/package.json index 9d750eeb9..74f5e2d7c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "genversion": "./scripts/genversion.sh" }, "dependencies": { - "@babel/runtime": "^7.12.5", + "@babel/runtime": "^7.12.18", "@forbole/cosmos-protobuf-js": "^1.0.5", "@improbable-eng/grpc-web": "^0.13.0", "@improbable-eng/grpc-web-node-http-transport": "^0.13.0", @@ -26,14 +26,14 @@ "crypto-js": "^3.3.0", "d3": "^5.16.0", "fibers": "^4.0.3", - "google-protobuf": "^3.14.0", + "google-protobuf": "^3.15.1", "jquery": "^3.5.1", "js-sha256": "^0.9.0", "ledger-cosmos-js": "^2.1.8", - "lodash": "^4.17.20", + "lodash": "^4.17.21", "meteor-node-stubs": "^0.4.1", "moment": "^2.27.0", - "moment-timezone": "^0.5.32", + "moment-timezone": "^0.5.33", "numbro": "^2.3.2", "plottable": "^3.9.0", "prop-types": "^15.7.2", @@ -43,14 +43,14 @@ "react-google-tag-manager": "^2.2.1", "react-helmet": "^5.2.1", "react-jazzicon": "^0.1.3", - "react-json-view": "^1.20.2", + "react-json-view": "^1.21.1", "react-pose": "^4.0.10", "react-router-dom": "^4.3.1", "react-showdown": "^1.6.0", "react-sidebar": "^3.0.2", "react-toastify": "^4.5.2", "reactstrap": "^8.9.0", - "rollup": "^2.37.1", + "rollup": "^2.39.0", "secp256k1": "^3.8.0", "styled-components": "^4.4.1", "tendermint": "^4.0.8", @@ -61,7 +61,7 @@ "devDependencies": { "@meteorjs/eslint-config-meteor": "^1.0.5", "babel-eslint": "^10.1.0", - "chai": "^4.2.0", + "chai": "^4.3.0", "eslint": "^5.16.0", "eslint-config-airbnb": "^17.1.1", "eslint-import-resolver-meteor": "^0.4.0", From d7e99ab28bcaa91034eb512b0f868d018a51503b Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 24 Feb 2021 11:37:39 +0000 Subject: [PATCH 082/127] disable getting all validator delegations --- imports/api/delegations/server/methods.js | 40 +++++++++++------------ server/main.js | 6 ++-- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/imports/api/delegations/server/methods.js b/imports/api/delegations/server/methods.js index eb8fac9d6..b2703888f 100644 --- a/imports/api/delegations/server/methods.js +++ b/imports/api/delegations/server/methods.js @@ -1,7 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Delegations } from '../delegations.js'; import { Validators } from '../../validators/validators.js'; -import { Cosmos } from '@forbole/cosmos-protobuf-js' +// import { Cosmos } from '@forbole/cosmos-protobuf-js' Meteor.methods({ 'delegations.getDelegations': async function(){ @@ -11,21 +11,21 @@ Meteor.methods({ console.log("=== Getting delegations ==="); for (v in validators){ if (validators[v].operatorAddress){ - // let url = API + '/cosmos/staking/v1beta1/validators/'+validators[v].operatorAddress+"/delegations"; + let url = API + '/cosmos/staking/v1beta1/validators/'+validators[v].operatorAddress+"/delegations"; try{ - // let response = HTTP.get(url); - // if (response.statusCode == 200){ - // let delegation = JSON.parse(response.content).result; - // // console.log(delegation); - // delegations = delegations.concat(delegation); - // } - // else{ - // console.log(response.statusCode); - // } - let req = new Cosmos.Staking.QueryValidatorDelegationsRequest(); - req.setValidatorAddr(validators[v].operatorAddress); - let delegations = await Cosmos.gRPC.unary(Cosmos.Staking.Query.ValidatorDelegations, req, GRPC); - console.log("delegations: %o", delegations); + let response = HTTP.get(url); + if (response.statusCode == 200){ + let delegation = JSON.parse(response.content).result; + // console.log(delegation); + delegations = delegations.concat(delegation); + } + else{ + console.log(response.statusCode); + } + // let req = new Cosmos.Staking.QueryValidatorDelegationsRequest(); + // req.setValidatorAddr(validators[v].operatorAddress); + // let delegations = await Cosmos.gRPC.unary(Cosmos.Staking.Query.ValidatorDelegations, req, GRPC); + // console.log("delegations: %o", delegations); } catch (e){ // console.log(url); @@ -34,14 +34,14 @@ Meteor.methods({ } } - for (i in delegations.delegationResponsesList){ - if (delegations.delegationResponsesList[i].delegation && delegations.delegationResponsesList[i].delegation.shares) - delegations.delegationResponsesList[i].delegation.shares = parseFloat(delegations.delegationResponsesList[i].delegation.shares); - } + // for (i in delegations.delegationResponsesList){ + // if (delegations.delegationResponsesList[i].delegation && delegations.delegationResponsesList[i].delegation.shares) + // delegations.delegationResponsesList[i].delegation.shares = parseFloat(delegations.delegationResponsesList[i].delegation.shares); + // } // console.log(delegations); let data = { - delegations: delegations.delegationResponsesList, + delegations: delegations, createdAt: new Date(), } diff --git a/server/main.js b/server/main.js index 19261c26c..ed85b7ef9 100644 --- a/server/main.js +++ b/server/main.js @@ -217,9 +217,9 @@ Meteor.startup(async function(){ updateMissedBlocks(); }, Meteor.settings.params.missedBlocksInterval); - timerDelegation = Meteor.setInterval(function(){ - getDelegations(); - }, Meteor.settings.params.delegationInterval); + // timerDelegation = Meteor.setInterval(function(){ + // getDelegations(); + // }, Meteor.settings.params.delegationInterval); timerAggregate = Meteor.setInterval(function(){ let now = new Date(); From 9f5b5e2fec3faabdb23ea0ae3b8e551effc7c1de Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 10:41:43 +0000 Subject: [PATCH 083/127] revert grpc to use sdk grpc gateway api --- imports/api/blocks/server/methods.js | 158 ++++++++++------------ imports/api/chain/server/methods.js | 7 - imports/api/delegations/server/methods.js | 13 +- imports/startup/server/util.js | 13 +- 4 files changed, 76 insertions(+), 115 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 39552d3b0..83a20cfa9 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -11,8 +11,6 @@ import { Evidences } from '../../evidences/evidences.js'; import { sha256 } from 'js-sha256'; // import { getAddress } from 'tendermint/lib/pubkey'; import * as cheerio from 'cheerio'; -import { Cosmos } from '@forbole/cosmos-protobuf-js' -import { goTimeToISOString } from '../../../../both/utils/time'; getRemovedValidators = (prevValidators, validators) => { @@ -68,30 +66,33 @@ getValidatorProfileUrl = (identity) => { getValidatorUptime = async (validatorSet) => { // get validator uptime - - let req = new Cosmos.Slashing.QueryParamsRequest(); - const slashingParams = await Cosmos.gRPC.unary(Cosmos.Slashing.Query.Params, req, GRPC); + + let url = `${API}/cosmos/slashing/v1beta1/params`; + let response = HTTP.get(url); + let slashingParams = JSON.parse(response.content) Chain.upsert({chainId:Meteor.settings.public.chainId}, {$set:{"slashing":slashingParams}}); for(let key in validatorSet){ // console.log("Getting uptime validator: %o", validatorSet[key]); try { - req = new Cosmos.Slashing.QuerySigningInfoRequest(); - req.setConsAddress(validatorSet[key].bech32ValConsAddress); - let signingInfo = await Cosmos.gRPC.unary(Cosmos.Slashing.Query.SigningInfo, req, GRPC); // console.log("=== Signing Info ===: %o", signingInfo) + + url = `${API}/cosmos/slashing/v1beta1/signing_infos/${validatorSet[key].bech32ValConsAddress}` + let response = HTTP.get(url); + let signingInfo = JSON.parse(response.content).val_signing_info; if (signingInfo){ let valData = validatorSet[key] - valData.tombstoned = signingInfo.valSigningInfo.tombstoned - valData.jailed_until = goTimeToISOString(signingInfo.valSigningInfo.jailedUntil); - valData.index_offset = signingInfo.valSigningInfo.indexOffset - valData.start_height = signingInfo.valSigningInfo.startHeight - valData.uptime = (slashingParams.params.signedBlocksWindow - parseInt(signingInfo.valSigningInfo.missedBlocksCounter))/slashingParams.params.signedBlocksWindow * 100; + valData.tombstoned = signingInfo.tombstoned; + valData.jailed_until = signingInfo.jailed_until; + valData.index_offset = parseInt(signingInfo.index_offset); + valData.start_height = parseInt(signingInfo.start_height); + valData.uptime = (slashingParams.params.signed_blocks_window - parseInt(signingInfo.missed_blocks_counter))/slashingParams.params.signed_blocks_window * 100; Validators.upsert({bech32ValConsAddress:validatorSet[key].bech32ValConsAddress}, {$set:valData}) } } catch(e){ + console.log(url); console.log("Getting signing info of %o: %o", validatorSet[key].bech32ValConsAddress, e); } } @@ -211,41 +212,40 @@ Meteor.methods({ if (until > curr) { SYNCING = true; - let validatorSet = {} + let validatorSet = []; // get latest validator candidate information - let req = new Cosmos.Staking.QueryValidatorsRequest() - let pageReq = new Cosmos.Base.Query.PageRequest(); - pageReq.setCountTotal(true); - pageReq.setLimit(2000); - req.setPagination(pageReq) - let res; + let url = API + '/cosmos/staking/v1beta1/validators?status=BOND_STATUS_BONDED&pagination.limit=200&pagination.count_total=true'; try{ - req.setStatus("BOND_STATUS_BONDED") - // bonded validators - res = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Validators, req, GRPC); - res.validatorsList.forEach((validator) => validatorSet[validator.consensusPubkey.value] = validator); + let response = HTTP.get(url); + let result = JSON.parse(response.content).validators; + result.forEach((validator) => validatorSet[validator.consensus_pubkey.key] = validator); } catch(e){ + console.log(url); console.log(e); } try{ - req.setStatus("BOND_STATUS_UNBONDING"); - res = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Validators, req, GRPC); - res.validatorsList.forEach((validator) => validatorSet[validator.consensusPubkey.value] = validator) + url = API + '/cosmos/staking/v1beta1/validators?status=BOND_STATUS_UNBONDING&pagination.limit=200&pagination.count_total=true'; + let response = HTTP.get(url); + let result = JSON.parse(response.content).validators; + result.forEach((validator) => validatorSet[validator.consensus_pubkey.key] = validator); } catch(e){ + console.log(url); console.log(e); } try{ - req.setStatus("BOND_STATUS_UNBONDED") - res = await Cosmos.gRPC.unary(Cosmos.Staking.Query.Validators, req, GRPC); - res.validatorsList.forEach((validator) => validatorSet[validator.consensusPubkey.value] = validator) + url = API + '/cosmos/staking/v1beta1/validators?status=BOND_STATUS_UNBONDED&pagination.limit=200&pagination.count_total=true'; + let response = HTTP.get(url); + let result = JSON.parse(response.content).validators; + result.forEach((validator) => validatorSet[validator.consensus_pubkey.key] = validator); } catch(e){ + console.log(url); console.log(e); } @@ -261,9 +261,7 @@ Meteor.methods({ this.unblock(); // let url = RPC+'/block?height=' + height; - req = new Cosmos.Base.Tendermint.GetBlockByHeightRequest(); - req.setHeight(height); - + url = `${API}/blocks/${height}`; let analyticsData = {}; const bulkValidators = Validators.rawCollection().initializeUnorderedBulkOp(); @@ -275,25 +273,27 @@ Meteor.methods({ console.log("Getting block at height: %o", height); try{ let startGetHeightTime = new Date(); - // let response = HTTP.get(url); - let block = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetBlockByHeight, req, GRPC); + + let response = HTTP.get(url); + // store height, hash, numtransaction and time in db let blockData = {}; + let block = JSON.parse(response.content); blockData.height = height; - blockData.hash = Buffer.from(block.blockId.hash, 'base64').toString('hex').toUpperCase(); - blockData.transNum = block.block.data.txsList?block.block.data.txsList.length:0; - blockData.time = new Date(goTimeToISOString(block.block.header.time)); - blockData.lastBlockHash = Buffer.from(block.block.header.lastBlockId.hash, 'base64').toString('hex').toUpperCase(); - blockData.proposerAddress = Buffer.from(block.block.header.proposerAddress, 'base64').toString('hex').toUpperCase(); + blockData.hash = block.block_id.hash; + blockData.transNum = block.block.data.txs?block.block.data.txs.length:0; + blockData.time = block.block.header.time; + blockData.lastBlockHash = block.block.header.last_block_id.hash; + blockData.proposerAddress = block.block.header.proposer_address; blockData.validators = []; // save txs in database - if (block.block.data.txsList && block.block.data.txsList.length > 0){ - for (t in block.block.data.txsList){ + if (block.block.data.txs && block.block.data.txs.length > 0){ + for (t in block.block.data.txs){ bulkTransactions.insert({ // hash has to be in uppercase - txhash: sha256(Buffer.from(block.block.data.txsList[t], 'base64')).toUpperCase(), + txhash: sha256(Buffer.from(block.block.data.txs[t], 'base64')).toUpperCase(), height: parseInt(height), processed: false }) @@ -321,7 +321,7 @@ Meteor.methods({ // console.log("signatures: %o", block.block.lastCommit.signaturesList) - blockData.precommitsCount = block.block.lastCommit.signaturesList.length; + blockData.precommitsCount = block.block.last_commit.signatures.length; analyticsData.height = height; @@ -336,8 +336,6 @@ Meteor.methods({ let page = 0; // let nextKey = 0; try { - let validatorSetResult = {} - let result; do { @@ -352,26 +350,6 @@ Meteor.methods({ } while (validators.length < parseInt(result.total)) - - // do { - // // url = RPC+`/validators?height=${height}&page=${++page}&per_page=100`; - - // req = new Cosmos.Base.Tendermint.GetValidatorSetByHeightRequest() - // req.setHeight(height); - - // let pageReq = new Cosmos.Base.Query.PageRequest(); - // pageReq.setOffset(page*100); - // pageReq.setLimit(2000); - // pageReq.setCountTotal(true); - - // req.setPagination(pageReq) - // console.log(req.getPagination()) - // validatorSetResult = await Cosmos.gRPC.unary(Cosmos.Base.Tendermint.Service.GetValidatorSetByHeight, req, GRPC); - // console.log(validatorSetResult.validatorsList.length); - // validators = [...validators, ...validatorSetResult.validatorsList]; - // page++; - // } - // while (validatorSetResult.validatorsList.length == 100 && (validatorSetResult.validatorsList.length*page < validatorSetResult.pagination?.total) ) } catch(e){ console.log("Getting validator set at height %o: %o", height, e) @@ -401,12 +379,12 @@ Meteor.methods({ // console.log("before comparing precommits: %o", validators); // Tendermint v0.33 start using "signatures" in last block instead of "precommits" - let precommits = block.block.lastCommit.signaturesList; + let precommits = block.block.last_commit.signatures; if (precommits != null){ // console.log(precommits); for (let i=0; i 0){ + if (pubkey["@type"].indexOf("ed25519") > 0){ // '1624DE6420' is ed25519 pubkey prefix let pubkeyAminoPrefix = Buffer.from('1624DE6420', 'hex'); buffer = Buffer.alloc(37); pubkeyAminoPrefix.copy(buffer, 0) - Buffer.from(pubkey.value, 'base64').copy(buffer, pubkeyAminoPrefix.length) + Buffer.from(pubkey.key, 'base64').copy(buffer, pubkeyAminoPrefix.length) } - else if (pubkey.typeUrl.indexOf("secp256k1") > 0){ + else if (pubkey["@type"].indexOf("secp256k1") > 0){ // 'EB5AE98721' is secp256k1 pubkey prefix let pubkeyAminoPrefix = Buffer.from('EB5AE98721', 'hex'); buffer = Buffer.alloc(38); pubkeyAminoPrefix.copy(buffer, 0) - Buffer.from(pubkey.value, 'base64').copy(buffer, pubkeyAminoPrefix.length) + Buffer.from(pubkey.key, 'base64').copy(buffer, pubkeyAminoPrefix.length) } else { console.log("Pubkey type not supported."); @@ -102,9 +102,8 @@ Meteor.methods({ } }, getAddressFromPubkey: function(pubkey){ - var bytes = Buffer.from(pubkey.value, 'base64'); - // there are two extra byte in the protobuf result - return tmhash(bytes.slice(2)).slice(0, 20).toString('hex').toUpperCase(); + var bytes = Buffer.from(pubkey.key, 'base64'); + return tmhash(bytes).slice(0, 20).toString('hex').toUpperCase(); }, getDelegator: function(operatorAddr){ let address = bech32.decode(operatorAddr); From 4be82714e39437cd272faeadb931982d489462b0 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 11:10:44 +0000 Subject: [PATCH 084/127] update validator ui with correct field names --- imports/api/validators/server/publications.js | 2 +- imports/ui/components/AccountTooltip.jsx | 4 +- imports/ui/validators/List.jsx | 4 +- imports/ui/validators/ListContainer.js | 24 +++++---- imports/ui/validators/Validator.jsx | 53 +++++++++---------- imports/ui/validators/ValidatorContainer.js | 2 +- 6 files changed, 46 insertions(+), 43 deletions(-) diff --git a/imports/api/validators/server/publications.js b/imports/api/validators/server/publications.js index 30876b02f..a2adcc00d 100644 --- a/imports/api/validators/server/publications.js +++ b/imports/api/validators/server/publications.js @@ -44,7 +44,7 @@ Meteor.publish('validators.voting_power', function(){ publishComposite('validator.details', function(address){ let options = {address:address}; if (address.indexOf(Meteor.settings.public.bech32PrefixValAddr) != -1){ - options = {operatorAddress:address} + options = {operator_address:address} } return { find(){ diff --git a/imports/ui/components/AccountTooltip.jsx b/imports/ui/components/AccountTooltip.jsx index 8ad85524b..a867609da 100644 --- a/imports/ui/components/AccountTooltip.jsx +++ b/imports/ui/components/AccountTooltip.jsx @@ -68,8 +68,8 @@ export default class AccountTooltip extends Account{ {validator.self_delegation?numbro(validator.self_delegation).format('0.00%'):'N/A'} {(isActive)? - call_split { (validator.commission.commissionRates)? - numbro(validator.commission.commissionRates.rate).format('0.00%') : numbro(validator.commission.rate).format('0.00%') } + call_split { (validator.commission.commission_rates)? + numbro(validator.commission.commission_rates.rate).format('0.00%') : numbro(validator.commission.rate).format('0.00%') } :null} {(!isActive)? access_time diff --git a/imports/ui/validators/List.jsx b/imports/ui/validators/List.jsx index 58968e478..6241a9bcc 100644 --- a/imports/ui/validators/List.jsx +++ b/imports/ui/validators/List.jsx @@ -13,10 +13,10 @@ const ValidatorRow = (props) => { return {props.index+1} - {moniker} + {moniker} power{props.validator.voting_power?numbro(props.validator.voting_power).format('0,0'):0} ({props.validator.voting_power?numbro(props.validator.voting_power/props.totalPower).format('0.00%'):"0.00%"})equalizer{props.validator.self_delegation?numbro(props.validator.self_delegation).format('0.00%'):'N/A'} - {(!props.inactive)?call_split{(props.validator.commission&&props.validator.commission.commissionRates)?numbro(props.validator.commission.commissionRates.rate/Meteor.settings.public.humanizeReduction).format('0.00%'):''}:''} + {(!props.inactive)?call_split{(props.validator.commission&&props.validator.commission.commission_rates)?numbro(props.validator.commission.commission_rates.rate).format('0.00%'):''}:''} {(!props.inactive)?{props.validator.uptime?props.validator.uptime.toFixed(2):0}% :''} {(props.inactive)?{props.validator.lastSeen?:''}:''} {(props.inactive)?{(props.validator.status == 1)?Unbonded:Unbonding}:''} diff --git a/imports/ui/validators/ListContainer.js b/imports/ui/validators/ListContainer.js index ca660d6be..64155a540 100644 --- a/imports/ui/validators/ListContainer.js +++ b/imports/ui/validators/ListContainer.js @@ -18,15 +18,19 @@ export default ValidatorListContainer = withTracker((props) => { // console.log(props); if (props.inactive){ validatorsCond = { - $or: [ - { status: { $lt : 3 } }, - // { jailed: true } - ] + status: { $ne:'BOND_STATUS_BONDED' } } + // validatorsCond = { + // $or: [ + // { status: 'BOND_STATUS_UNBONDED' }, + // { status: 'BOND_STATUS_BONDED' } + // // { jailed: true } + // ] + // } } else{ validatorsCond = { - status: 3 + status: 'BOND_STATUS_BONDED' } } @@ -38,7 +42,7 @@ export default ValidatorListContainer = withTracker((props) => { options = { sort:{ "description.moniker": props.monikerDir, - "commission.commissionRates.rate": props.commissionDir, + "commission.commission_rates.rate": props.commissionDir, uptime: props.uptimeDir, voting_power: props.votingPowerDir, self_delegation: props.selfDelDir @@ -51,7 +55,7 @@ export default ValidatorListContainer = withTracker((props) => { voting_power: props.votingPowerDir, "description.moniker": props.monikerDir, uptime: props.uptimeDir, - "commission.commissionRates.rate": props.commissionDir, + "commission.commission_rates.rate": props.commissionDir, self_delegation: props.selfDelDir } } @@ -62,7 +66,7 @@ export default ValidatorListContainer = withTracker((props) => { uptime: props.uptimeDir, "description.moniker": props.monikerDir, voting_power: props.votingPowerDir, - "commission.commissionRates.rate": props.commissionDir, + "commission.commission_rates.rate": props.commissionDir, self_delegation: props.selfDelDir, } } @@ -70,7 +74,7 @@ export default ValidatorListContainer = withTracker((props) => { case 3: options = { sort:{ - "commission.commissionRates.rate": props.commissionDir, + "commission.commission_rates.rate": props.commissionDir, "description.moniker": props.monikerDir, voting_power: props.votingPowerDir, uptime: props.uptimeDir, @@ -83,7 +87,7 @@ export default ValidatorListContainer = withTracker((props) => { sort:{ self_delegation: props.selfDelDir, "description.moniker": props.monikerDir, - "commission.commissionRates.rate": props.commissionDir, + "commission.commission_rates.rate": props.commissionDir, voting_power: props.votingPowerDir, uptime: props.uptimeDir, } diff --git a/imports/ui/validators/Validator.jsx b/imports/ui/validators/Validator.jsx index 0b79a6418..e8a29e770 100644 --- a/imports/ui/validators/Validator.jsx +++ b/imports/ui/validators/Validator.jsx @@ -18,7 +18,6 @@ import i18n from 'meteor/universe:i18n'; import TimeStamp from '../components/TimeStamp.jsx'; import SentryBoundary from '../components/SentryBoundary.jsx'; import Coin from '../../../both/utils/coins.js'; -import { goTimeToISOString } from '../../../both/utils/time'; const T = i18n.createComponent(); @@ -47,7 +46,7 @@ export default class Validator extends Component{ identity: "", records: "", history: "", - updateTime: "", + update_time: "", user: localStorage.getItem(CURRENTUSERADDR), denom: "", } @@ -56,9 +55,9 @@ export default class Validator extends Component{ getUserDelegations() { if (this.state.user && this.props.validator && this.props.validator.address) { - Meteor.call('accounts.getDelegation', this.state.user, this.props.validator.operatorAddress, (err, res) => { + Meteor.call('accounts.getDelegation', this.state.user, this.props.validator.operator_address, (err, res) => { if (res && res.shares > 0) { - res.tokenPerShare = this.props.validator.tokens/this.props.validator.delegatorShares + res.tokenPerShare = this.props.validator.tokens/this.props.validator.delegator_shares this.setState({ currentUserDelegation: res }) @@ -102,10 +101,10 @@ export default class Validator extends Component{ } if (this.props.validator.commission){ - let updateTime = goTimeToISOString(this.props.validator.commission.updateTime); - if (updateTime == Meteor.settings.public.genesisTime){ + let update_time = this.props.validator.commission.update_time; + if (update_time == Meteor.settings.public.genesisTime){ this.setState({ - updateTime: "Never changed" + update_time: "Never changed" }); } else{ @@ -115,20 +114,20 @@ export default class Validator extends Component{ } else{ if (result){ - if (result == updateTime){ + if (result == update_time){ this.setState({ - updateTime: "Never changed" + update_time: "Never changed" }); } else{ this.setState({ - updateTime: "Updated "+moment(updateTime).fromNow() + update_time: "Updated "+moment(update_time).fromNow() }); } } else{ this.setState({ - updateTime: "Updated "+moment(updateTime).fromNow() + update_time: "Updated "+moment(update_time).fromNow() }); } } @@ -149,7 +148,7 @@ export default class Validator extends Component{ votingPower={history.voting_power} time={history.block_time} height={history.height} - address={this.props.validator.operatorAddress} + address={this.props.validator.operator_adddress} /> }) }) @@ -169,7 +168,7 @@ export default class Validator extends Component{ renderShareLink() { let validator = this.props.validator; - let primaryLink = `/validator/${validator.operatorAddress}` + let primaryLink = `/validator/${validator.operator_address}` let otherLinks = [ {label: 'Delegate', url: `${primaryLink}/delegate`}, {label: 'Transfer', url: `/account/${validator.delegatorAddress}/send`} @@ -227,15 +226,15 @@ export default class Validator extends Component{ validators.operatorAddress - {this.props.validator.operatorAddress} + {this.props.validator.operator_address}validators.selfDelegationAddress - {this.props.validator.delegatorAddress} + {this.props.validator.delegator_address}validators.commissionRate - {this.props.validator.commission&&this.props.validator.commission.commissionRates?numbro(this.props.validator.commission.commissionRates.rate*100/Meteor.settings.public.humanizeReduction).format('0.00')+"%":''} ({this.state.updateTime}) - validators.maxRate - {this.props.validator.commission&&this.props.validator.commission.commissionRates?numbro(this.props.validator.commission.commissionRates.maxRate*100/Meteor.settings.public.humanizeReduction).format('0.00')+"%":''} - validators.maxChangeRate - {this.props.validator.commission&&this.props.validator.commission.commissionRates?numbro(this.props.validator.commission.commissionRates.maxChangeRate*100/Meteor.settings.public.humanizeReduction).format('0.00')+"%":''} + {this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.rate*100).format('0.00')+"%":''} ({this.state.update_time}) + validators.max_rate + {this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.max_rate*100).format('0.00')+"%":''} + validators.max_change_rate + {this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.max_change_rate*100).format('0.00')+"%":''} @@ -252,9 +251,9 @@ export default class Validator extends Component{ validators.proposerPriority{this.props.validator.proposer_priority?numbro(this.props.validator.proposer_priority).format('0,0'):'N/A'}validators.delegatorShares - {numbro(this.props.validator.delegatorShares/Meteor.settings.public.humanizeReduction).format('0,0.00')} + {numbro(this.props.validator.delegator_shares).format('0,0.00')} {(this.state.currentUserDelegation)?validators.userDelegateShares:''} - {(this.state.currentUserDelegation)?{numbro(this.state.currentUserDelegation.shares/Meteor.settings.public.humanizeReduction).format('0,0.00')}:''} + {(this.state.currentUserDelegation)?{numbro(this.state.currentUserDelegation.shares).format('0,0.00')}:''} validators.tokens{numbro(this.props.validator.tokens).format('0,0.00')} {(this.props.validator.jailed)?@@ -268,19 +267,19 @@ export default class Validator extends Component{
    {this.state.history}
    } /> - } /> - } /> + } /> + } />
    common.backToList diff --git a/imports/ui/validators/ValidatorContainer.js b/imports/ui/validators/ValidatorContainer.js index 8e4c2cdd3..74b172ff8 100644 --- a/imports/ui/validators/ValidatorContainer.js +++ b/imports/ui/validators/ValidatorContainer.js @@ -27,7 +27,7 @@ export default ValidatorDetailsContainer = withTracker((props) => { if (Meteor.isServer || !loading){ if (props.address.indexOf(Meteor.settings.public.bech32PrefixValAddr) != -1){ - options = {operatorAddress:props.address} + options = {operator_address:props.address} } validator = Validators.findOne(options); From 014d95a707be166fa7cc738a064dad9173bee791 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 11:12:35 +0000 Subject: [PATCH 085/127] update home page validator list field name --- imports/ui/home/TopValidatorsContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/ui/home/TopValidatorsContainer.js b/imports/ui/home/TopValidatorsContainer.js index 920b590d1..1d00be409 100644 --- a/imports/ui/home/TopValidatorsContainer.js +++ b/imports/ui/home/TopValidatorsContainer.js @@ -21,7 +21,7 @@ export default TopValidatorsContainer = withTracker(() => { if (Meteor.isServer || !loading){ status = Chain.findOne({chainId:Meteor.settings.public.chainId}); - validators = Validators.find({status: 3}).fetch(); + validators = Validators.find({status: 'BOND_STATUS_BONDED'}).fetch(); if (Meteor.isServer){ // loading = false; From 371b70d7f93a6ba22a6e7192aca99dc564ae04fd Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 17:46:40 +0000 Subject: [PATCH 086/127] remove unused components --- imports/ui/transactions/List.jsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/imports/ui/transactions/List.jsx b/imports/ui/transactions/List.jsx index 30b701a9e..c96ed1b21 100644 --- a/imports/ui/transactions/List.jsx +++ b/imports/ui/transactions/List.jsx @@ -1,11 +1,5 @@ import React, { Component } from 'react'; -import { Link } from 'react-router-dom'; -import { Row, Col, Card, Alert, Spinner } from 'reactstrap'; -import { TxIcon } from '../components/Icons.jsx'; -import Activities from '../components/Activities.jsx'; -import CosmosErrors from '../components/CosmosErrors.jsx'; -import TimeAgo from '../components/TimeAgo.jsx'; -import numbro from 'numbro'; +import { Row, Col, Spinner } from 'reactstrap'; import { TransactionRow } from './TransactionRow.jsx'; import i18n from 'meteor/universe:i18n'; From 0bdb6c6103dcd3b839c5fbe411d0b2a8d3893a54 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 18:02:53 +0000 Subject: [PATCH 087/127] display voting power with tokens --- imports/ui/components/AccountTooltip.jsx | 2 +- imports/ui/home/TopValidators.jsx | 2 +- imports/ui/ledger/LedgerActions.jsx | 2 +- imports/ui/validators/List.jsx | 2 +- imports/ui/validators/Validator.jsx | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/imports/ui/components/AccountTooltip.jsx b/imports/ui/components/AccountTooltip.jsx index a867609da..76691fceb 100644 --- a/imports/ui/components/AccountTooltip.jsx +++ b/imports/ui/components/AccountTooltip.jsx @@ -61,7 +61,7 @@ export default class AccountTooltip extends Account{ power - {validator.voting_power?numbro(validator.voting_power).format('0,0'):0} + {validator.tokens?numbro(Math.floor(validator.tokens/Meteor.settings.public.powerReduction)).format('0,0'):0} equalizer diff --git a/imports/ui/home/TopValidators.jsx b/imports/ui/home/TopValidators.jsx index c4d89e507..69cf23491 100644 --- a/imports/ui/home/TopValidators.jsx +++ b/imports/ui/home/TopValidators.jsx @@ -30,7 +30,7 @@ export default class TopValidators extends Component{ {validator.description.moniker} - + }) diff --git a/imports/ui/ledger/LedgerActions.jsx b/imports/ui/ledger/LedgerActions.jsx index b6c4410b9..3c78405c3 100644 --- a/imports/ui/ledger/LedgerActions.jsx +++ b/imports/ui/ledger/LedgerActions.jsx @@ -549,7 +549,7 @@ class LedgerButton extends Component { {validator.description.moniker}power - {validator.voting_power?numbro(validator.voting_power).format('0,0'):0} + {validator.tokens?numbro(Math.floor(validator.tokens/Meteor.settings.public.powerReduction)).format('0,0'):0} diff --git a/imports/ui/validators/List.jsx b/imports/ui/validators/List.jsx index 6241a9bcc..43e0a8df1 100644 --- a/imports/ui/validators/List.jsx +++ b/imports/ui/validators/List.jsx @@ -14,7 +14,7 @@ const ValidatorRow = (props) => { {props.index+1}{moniker} - power{props.validator.voting_power?numbro(props.validator.voting_power).format('0,0'):0} ({props.validator.voting_power?numbro(props.validator.voting_power/props.totalPower).format('0.00%'):"0.00%"}) + power{props.validator.tokens?numbro(Math.floor(props.validator.tokens/Meteor.settings.public.powerReduction)).format('0,0'):0} ({props.validator.tokens?numbro(props.validator.tokens/Meteor.settings.public.powerReduction/props.totalPower).format('0.00%'):"0.00%"})equalizer{props.validator.self_delegation?numbro(props.validator.self_delegation).format('0.00%'):'N/A'} {(!props.inactive)?call_split{(props.validator.commission&&props.validator.commission.commission_rates)?numbro(props.validator.commission.commission_rates.rate).format('0.00%'):''}:''} {(!props.inactive)?{props.validator.uptime?props.validator.uptime.toFixed(2):0}% :''} diff --git a/imports/ui/validators/Validator.jsx b/imports/ui/validators/Validator.jsx index e8a29e770..c86480913 100644 --- a/imports/ui/validators/Validator.jsx +++ b/imports/ui/validators/Validator.jsx @@ -245,9 +245,9 @@ export default class Validator extends Component{ currentDelegation={this.state.currentUserDelegation} history={this.props.history} stakingParams={this.props.chainStatus.staking?this.props.chainStatus.staking.params:null}/>:''} - {this.props.validator.voting_power?

    {numbro(this.props.validator.voting_power).format('0,0')}

    (~{numbro(this.props.validator.voting_power/this.props.chainStatus.activeVotingPower).format('0.00%')}):''} + {this.props.validator.tokens?

    {numbro(Math.floor(this.props.validator.tokens/Meteor.settings.public.powerReduction)).format('0,0')}

    (~{numbro(this.props.validator.tokens/Meteor.settings.public.powerReduction/this.props.chainStatus.activeVotingPower).format('0.00%')}):''} validators.selfDelegationRatio - {this.props.validator.self_delegation?{numbro(this.props.validator.self_delegation).format("0,0.00%")} (~{numbro(this.props.validator.voting_power*this.props.validator.self_delegation).format({thousandSeparated: true,mantissa:0})} {Coin.StakingCoin.displayName}):'N/A'} + {this.props.validator.self_delegation?{numbro(this.props.validator.self_delegation).format("0,0.00%")} (~{numbro(this.props.validator.tokens/Meteor.settings.public.powerReduction*this.props.validator.self_delegation).format({thousandSeparated: true,mantissa:0})} {Coin.StakingCoin.displayName}):'N/A'}validators.proposerPriority{this.props.validator.proposer_priority?numbro(this.props.validator.proposer_priority).format('0,0'):'N/A'}validators.delegatorShares From 0a7791528c1beaad292663c385faf353f5db7ab3 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 18:08:51 +0000 Subject: [PATCH 088/127] sorting with number of tokens --- imports/api/blocks/server/methods.js | 3 +++ imports/ui/validators/ListContainer.js | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 83a20cfa9..272497fad 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -461,6 +461,9 @@ Meteor.methods({ let startFindValidatorsNameTime = new Date(); for (v in validatorSet){ let valData = validatorSet[v]; + + valData.tokens = parseInt(valData.tokens); + let valExist = Validators.findOne({"consensus_pubkey.key":v}); // console.log(valData); diff --git a/imports/ui/validators/ListContainer.js b/imports/ui/validators/ListContainer.js index 64155a540..93271524f 100644 --- a/imports/ui/validators/ListContainer.js +++ b/imports/ui/validators/ListContainer.js @@ -44,7 +44,7 @@ export default ValidatorListContainer = withTracker((props) => { "description.moniker": props.monikerDir, "commission.commission_rates.rate": props.commissionDir, uptime: props.uptimeDir, - voting_power: props.votingPowerDir, + tokens: props.votingPowerDir, self_delegation: props.selfDelDir } } @@ -52,7 +52,7 @@ export default ValidatorListContainer = withTracker((props) => { case 1: options = { sort:{ - voting_power: props.votingPowerDir, + tokens: props.votingPowerDir, "description.moniker": props.monikerDir, uptime: props.uptimeDir, "commission.commission_rates.rate": props.commissionDir, @@ -65,7 +65,7 @@ export default ValidatorListContainer = withTracker((props) => { sort:{ uptime: props.uptimeDir, "description.moniker": props.monikerDir, - voting_power: props.votingPowerDir, + tokens: props.votingPowerDir, "commission.commission_rates.rate": props.commissionDir, self_delegation: props.selfDelDir, } @@ -76,7 +76,7 @@ export default ValidatorListContainer = withTracker((props) => { sort:{ "commission.commission_rates.rate": props.commissionDir, "description.moniker": props.monikerDir, - voting_power: props.votingPowerDir, + tokens: props.votingPowerDir, uptime: props.uptimeDir, self_delegation: props.selfDelDir } @@ -88,7 +88,7 @@ export default ValidatorListContainer = withTracker((props) => { self_delegation: props.selfDelDir, "description.moniker": props.monikerDir, "commission.commission_rates.rate": props.commissionDir, - voting_power: props.votingPowerDir, + tokens: props.votingPowerDir, uptime: props.uptimeDir, } } From 9c586ba4baddd2147758c16d386a880ce8b08d54 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 18:14:32 +0000 Subject: [PATCH 089/127] update label to show bonded tokens for inactive validators --- both/i18n/en-us.i18n.yml | 1 + imports/ui/validators/ValidatorsList.jsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/both/i18n/en-us.i18n.yml b/both/i18n/en-us.i18n.yml index a565b91da..bd274b95f 100644 --- a/both/i18n/en-us.i18n.yml +++ b/both/i18n/en-us.i18n.yml @@ -23,6 +23,7 @@ common: cancel: 'Cancel' retry: 'Retry' rewards: 'Rewards' + bondedTokens: 'Bonded Tokens' navbar: siteName: 'BIG DIPPER' version: '-' diff --git a/imports/ui/validators/ValidatorsList.jsx b/imports/ui/validators/ValidatorsList.jsx index 2e565886f..fe1beb2ce 100644 --- a/imports/ui/validators/ValidatorsList.jsx +++ b/imports/ui/validators/ValidatorsList.jsx @@ -102,7 +102,7 @@ export default class Validators extends Component{  this.toggleDir('moniker',e)}>perm_contact_calendarvalidators.moniker {renderToggleIcon(this.state.monikerDir)} - this.toggleDir('votingPower',e)}>powercommon.votingPower {renderToggleIcon(this.state.votingPowerDir)} + this.toggleDir('votingPower',e)}>power{(this.props.inactive)?common.bondedTokens:common.votingPower} {renderToggleIcon(this.state.votingPowerDir)} this.toggleDir('selfDel',e)}>equalizervalidators.selfPercentage {renderToggleIcon(this.state.selfDelDir==1)} {(!this.props.inactive)?this.toggleDir('commission',e)}>call_splitvalidators.commission {renderToggleIcon(this.state.commissionDir==1)}:''} {(!this.props.inactive)?this.toggleDir('uptime',e)}>flash_onvalidators.uptime ({Meteor.settings.public.slashingWindow} ) {renderToggleIcon(this.state.uptimeDir==1)}:''} From fcf4f8230d0f4bb19f9bc545c26a5c2c2285a56e Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 18:18:47 +0000 Subject: [PATCH 090/127] update language --- both/i18n/zh-hans.i18n.yml | 1 + both/i18n/zh-hant.i18n.yml | 1 + imports/ui/validators/Validator.jsx | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/both/i18n/zh-hans.i18n.yml b/both/i18n/zh-hans.i18n.yml index 91623894c..3b102f10b 100644 --- a/both/i18n/zh-hans.i18n.yml +++ b/both/i18n/zh-hans.i18n.yml @@ -22,6 +22,7 @@ common: searchPlaceholder: '搜寻交易哈希 / 区块高度 / 地址' cancel: '取消' retry: '重试' + bondedTokens: '受委托量' navbar: siteName: '北斗' validators: '验证人' diff --git a/both/i18n/zh-hant.i18n.yml b/both/i18n/zh-hant.i18n.yml index 93a561274..a75a777d7 100644 --- a/both/i18n/zh-hant.i18n.yml +++ b/both/i18n/zh-hant.i18n.yml @@ -22,6 +22,7 @@ common: searchPlaceholder: '搜尋交易哈希 / 區塊高度 / 地址' cancel: '取消' retry: '重試' + bondedTokens: '受委托量' navbar: siteName: '北斗' validators: '驗證人' diff --git a/imports/ui/validators/Validator.jsx b/imports/ui/validators/Validator.jsx index c86480913..7dc86b5cc 100644 --- a/imports/ui/validators/Validator.jsx +++ b/imports/ui/validators/Validator.jsx @@ -260,7 +260,7 @@ export default class Validator extends Component{ validators.unbondingHeight{numbro(this.props.validator.unbondingHeight).format('0,0')}validators.unbondingTime - + :''} From bfa2887a16cf35ba81e92e453c7954b445d2f480 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 18:23:52 +0000 Subject: [PATCH 091/127] remove cosmos-protobuf-js --- default_settings.json | 3 +-- package-lock.json | 42 +++++++++--------------------------------- package.json | 7 +++---- server/main.js | 2 -- 4 files changed, 13 insertions(+), 41 deletions(-) diff --git a/default_settings.json b/default_settings.json index 015d0ddc5..351c6016f 100644 --- a/default_settings.json +++ b/default_settings.json @@ -40,8 +40,7 @@ }, "remote":{ "rpc":"https://rpc.stargate.forbole.com:443", - "api":"https://api.stargate.forbole.com:443", - "grpc":"https://grpc.stargate.forbole.com:443" + "api":"https://api.stargate.forbole.com:443" }, "debug": { "startTimer": true diff --git a/package-lock.json b/package-lock.json index 3aff1af08..aef5ce7e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -105,9 +105,9 @@ "integrity": "sha512-I5nW8AhGpOXGCCNYGc+p7ExQIBxRFnS2fd/d862bNOKvmoEPjYPcfIjsfdy0ujagYOIYPczKgD9l3FsgTkAzKA==" }, "@babel/runtime": { - "version": "7.12.18", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.18.tgz", - "integrity": "sha512-BogPQ7ciE6SYAUPtlm9tWbgI9+2AgqSam6QivMgXgAT+fKbgppaj4ZX15MHeLC1PVF5sNk70huBu20XxWOs8Cg==", + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.8.tgz", + "integrity": "sha512-CwQljpw6qSayc0fRG1soxHAKs1CnQMOChm4mlQP6My0kf9upVGizj/KhlTTgyUnETmHpcUXjaluNAkteRFuafg==", "requires": { "regenerator-runtime": "^0.13.4" } @@ -191,17 +191,6 @@ "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" }, - "@forbole/cosmos-protobuf-js": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@forbole/cosmos-protobuf-js/-/cosmos-protobuf-js-1.0.5.tgz", - "integrity": "sha512-zn6y697dcKqnK2BxiLnwkbW2b4z7QD2/vsjPB7o6DcdPV1Ce1VTyOX7vEXoaNOwAfAPCYJjBKPnmrnuRl8dKfA==", - "requires": { - "@improbable-eng/grpc-web": "^0.13.0", - "@improbable-eng/grpc-web-node-http-transport": "^0.13.0", - "eslint-plugin-unused-imports": "^1.0.1", - "google-protobuf": "^3.14.0" - } - }, "@improbable-eng/grpc-web": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.13.0.tgz", @@ -2595,19 +2584,6 @@ } } }, - "eslint-plugin-unused-imports": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-1.1.0.tgz", - "integrity": "sha512-4SLYlkCwAbudvKDKZqn/3KjHlKAoorTxnP7AkAMMXkz59pQCBUjKPEaDv5pQ7fOyfDvLPCJKLowCcTl6HXcCuA==", - "requires": { - "eslint-rule-composer": "^0.3.0" - } - }, - "eslint-rule-composer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", - "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==" - }, "eslint-utils": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", @@ -2986,9 +2962,9 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, "google-protobuf": { - "version": "3.15.1", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.15.1.tgz", - "integrity": "sha512-Ss2fADC0TpZXn6bqGgPJMUWoD1y9J7BTtJRVvf+quNxXRtQnrpubiFCdgoown+OetNsU4H3YbJgnpxYY/3kH6g==" + "version": "3.15.3", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.15.3.tgz", + "integrity": "sha512-+q6w/pTPS8hmdeHe+OWO7PRKOkqtPM4+dxUUOtC9lLgiaLUd7FQq+0EkTt9UmEHf2KMigkbV1fIxSr73t/JG/A==" }, "graceful-fs": { "version": "4.2.3", @@ -5560,9 +5536,9 @@ } }, "rollup": { - "version": "2.39.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.39.0.tgz", - "integrity": "sha512-+WR3bttcq7zE+BntH09UxaW3bQo3vItuYeLsyk4dL2tuwbeSKJuvwiawyhEnvRdRgrII0Uzk00FpctHO/zB1kw==", + "version": "2.40.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.40.0.tgz", + "integrity": "sha512-WiOGAPbXoHu+TOz6hyYUxIksOwsY/21TRWoO593jgYt8mvYafYqQl+axaA8y1z2HFazNUUrsMSjahV2A6/2R9A==", "requires": { "fsevents": "~2.3.1" } diff --git a/package.json b/package.json index 74f5e2d7c..3b536284f 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,7 @@ "genversion": "./scripts/genversion.sh" }, "dependencies": { - "@babel/runtime": "^7.12.18", - "@forbole/cosmos-protobuf-js": "^1.0.5", + "@babel/runtime": "^7.13.8", "@improbable-eng/grpc-web": "^0.13.0", "@improbable-eng/grpc-web-node-http-transport": "^0.13.0", "@ledgerhq/hw-transport-webusb": "^4.78.0", @@ -26,7 +25,7 @@ "crypto-js": "^3.3.0", "d3": "^5.16.0", "fibers": "^4.0.3", - "google-protobuf": "^3.15.1", + "google-protobuf": "^3.15.3", "jquery": "^3.5.1", "js-sha256": "^0.9.0", "ledger-cosmos-js": "^2.1.8", @@ -50,7 +49,7 @@ "react-sidebar": "^3.0.2", "react-toastify": "^4.5.2", "reactstrap": "^8.9.0", - "rollup": "^2.39.0", + "rollup": "^2.40.0", "secp256k1": "^3.8.0", "styled-components": "^4.4.1", "tendermint": "^4.0.8", diff --git a/server/main.js b/server/main.js index ed85b7ef9..f2bef67d7 100644 --- a/server/main.js +++ b/server/main.js @@ -5,8 +5,6 @@ import '/imports/startup/both'; // import moment from 'moment'; // import '/imports/api/blocks/blocks.js'; -import { Cosmos } from '@forbole/cosmos-protobuf-js' - SYNCING = false; TXSYNCING = false; COUNTMISSEDBLOCKS = false; From 2fa349e2470b1c6e9e223c0af3f4ef22feb7cf42 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 18:25:00 +0000 Subject: [PATCH 092/127] update meteor packages --- .meteor/versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.meteor/versions b/.meteor/versions index ec360e1b3..67580c0ac 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -63,7 +63,7 @@ ordered-dict@1.1.0 promise@0.11.2 random@1.2.0 react-fast-refresh@0.1.0 -react-meteor-data@2.2.1 +react-meteor-data@2.2.2 reactive-var@1.0.11 reload@1.3.1 retry@1.1.0 From 1a7cd2dfac4429b3971938f9be102b7d279a27ac Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 19:02:05 +0000 Subject: [PATCH 093/127] added jailed until --- both/i18n/en-us.i18n.yml | 1 + both/i18n/zh-hans.i18n.yml | 1 + both/i18n/zh-hant.i18n.yml | 1 + imports/api/blocks/server/methods.js | 1 + imports/ui/validators/Validator.jsx | 6 ++++-- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/both/i18n/en-us.i18n.yml b/both/i18n/en-us.i18n.yml index bd274b95f..10747ba54 100644 --- a/both/i18n/en-us.i18n.yml +++ b/both/i18n/en-us.i18n.yml @@ -103,6 +103,7 @@ validators: tokens: 'Tokens' unbondingHeight: 'Unbonding Height' unbondingTime: 'Unbonding Time' + jailedUntil: 'Jailed Until' powerChange: 'Power Change' delegations: 'Delegations' transactions: 'Transactions' diff --git a/both/i18n/zh-hans.i18n.yml b/both/i18n/zh-hans.i18n.yml index 3b102f10b..48a98066e 100644 --- a/both/i18n/zh-hans.i18n.yml +++ b/both/i18n/zh-hans.i18n.yml @@ -101,6 +101,7 @@ validators: tokens: '代币数量' unbondingHeight: '解绑高度' unbondingTime: '解绑时间' + jailedUntil: '被禁制至' powerChange: '投票权变更' delegations: '委托' transactions: '交易' diff --git a/both/i18n/zh-hant.i18n.yml b/both/i18n/zh-hant.i18n.yml index a75a777d7..d9edec4e8 100644 --- a/both/i18n/zh-hant.i18n.yml +++ b/both/i18n/zh-hant.i18n.yml @@ -101,6 +101,7 @@ validators: tokens: '代幣數量' unbondingHeight: '解綁高度' unbondingTime: '解綁時間' + jailedUntil: '被禁制至' powerChange: '投票權變更' delegations: '委托' transactions: '交易' diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 272497fad..c48d91557 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -463,6 +463,7 @@ Meteor.methods({ let valData = validatorSet[v]; valData.tokens = parseInt(valData.tokens); + valData.unbonding_height = parseInt(valData.unbonding_height) let valExist = Validators.findOne({"consensus_pubkey.key":v}); diff --git a/imports/ui/validators/Validator.jsx b/imports/ui/validators/Validator.jsx index 7dc86b5cc..dec18443f 100644 --- a/imports/ui/validators/Validator.jsx +++ b/imports/ui/validators/Validator.jsx @@ -258,9 +258,11 @@ export default class Validator extends Component{ {numbro(this.props.validator.tokens).format('0,0.00')} {(this.props.validator.jailed)?validators.unbondingHeight - {numbro(this.props.validator.unbondingHeight).format('0,0')} + {numbro(this.props.validator.unbonding_height).format('0,0')}validators.unbondingTime - + + validators.jailedUntil + :''} From e32b1d574b45cb9d2d270621cc4563bbcf5d5eb7 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 19:03:49 +0000 Subject: [PATCH 094/127] update language --- imports/ui/validators/Validator.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/ui/validators/Validator.jsx b/imports/ui/validators/Validator.jsx index dec18443f..12746e8ba 100644 --- a/imports/ui/validators/Validator.jsx +++ b/imports/ui/validators/Validator.jsx @@ -231,9 +231,9 @@ export default class Validator extends Component{ {this.props.validator.delegator_address}validators.commissionRate{this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.rate*100).format('0.00')+"%":''} ({this.state.update_time}) - validators.max_rate + validators.maxRate{this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.max_rate*100).format('0.00')+"%":''} - validators.max_change_rate + validators.maxChangeRate{this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.max_change_rate*100).format('0.00')+"%":''} From dbf9e40ac51ebca105b3b8312f72a2d8f3a770c3 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 19:11:35 +0000 Subject: [PATCH 095/127] update power distribution --- imports/api/blocks/server/methods.js | 2 +- imports/api/validators/server/publications.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index c48d91557..45b78b491 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -100,7 +100,7 @@ getValidatorUptime = async (validatorSet) => { calculateVPDist = async (analyticsData, blockData) => { console.log("===== calculate voting power distribution ====="); - let activeValidators = Validators.find({status:3,jailed:false},{sort:{voting_power:-1}}).fetch(); + let activeValidators = Validators.find({status:'BOND_STATUS_BONDED',jailed:false},{sort:{voting_power:-1}}).fetch(); let numTopTwenty = Math.ceil(activeValidators.length*0.2); let numBottomEighty = activeValidators.length - numTopTwenty; diff --git a/imports/api/validators/server/publications.js b/imports/api/validators/server/publications.js index a2adcc00d..8041d223e 100644 --- a/imports/api/validators/server/publications.js +++ b/imports/api/validators/server/publications.js @@ -25,7 +25,7 @@ publishComposite('validators.firstSeen',{ Meteor.publish('validators.voting_power', function(){ return Validators.find({ - status: 3, + status: 'BOND_STATUS_BONDED', jailed:false },{ sort:{ From cbe62629fcfff3a70711d4f037d3c47254517dd5 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 19:17:16 +0000 Subject: [PATCH 096/127] reduce update validator info --- imports/api/blocks/server/methods.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 45b78b491..9acb65696 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -604,6 +604,10 @@ Meteor.methods({ let selfDelegation = JSON.parse(response.content).delegation_response; valData.self_delegation = (selfDelegation.delegation && selfDelegation.delegation.shares)?parseFloat(selfDelegation.delegation.shares)/parseFloat(valData.delegator_shares):0; + + console.log("Add validator upsert to bulk operations.") + + bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); } catch(e){ console.log(url); @@ -611,9 +615,6 @@ Meteor.methods({ } } - console.log("Add validator upsert to bulk operations.") - - bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); } From deb71a21739ce52336c307a9cd41e9a2e7305d00 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 19:22:47 +0000 Subject: [PATCH 097/127] fix self delegation address --- imports/ui/validators/Validator.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/ui/validators/Validator.jsx b/imports/ui/validators/Validator.jsx index 12746e8ba..c3e15bce0 100644 --- a/imports/ui/validators/Validator.jsx +++ b/imports/ui/validators/Validator.jsx @@ -228,7 +228,7 @@ export default class Validator extends Component{ validators.operatorAddress{this.props.validator.operator_address}validators.selfDelegationAddress - {this.props.validator.delegator_address} + {this.props.validator.delegator_address}validators.commissionRate{this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.rate*100).format('0.00')+"%":''} ({this.state.update_time})validators.maxRate From 21b5209001c60db54b6e6864fcbee45d8a82471d Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 19:44:18 +0000 Subject: [PATCH 098/127] update validator account field names --- imports/ui/components/AccountTooltip.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imports/ui/components/AccountTooltip.jsx b/imports/ui/components/AccountTooltip.jsx index 76691fceb..84adaea04 100644 --- a/imports/ui/components/AccountTooltip.jsx +++ b/imports/ui/components/AccountTooltip.jsx @@ -27,13 +27,13 @@ export default class AccountTooltip extends Account{ return { status: 1, description: 1, - delegatorShares: 1, - operatorAddress: 1, + delegator_shares: 1, + operator_address: 1, tokens: 1, commission: 1, unbonding_time: 1, jailed: 1, - delegatorAddress: 1, + delegator_address: 1, address: 1, operator_pubkey: 1, voting_power: 1, @@ -49,7 +49,7 @@ export default class AccountTooltip extends Account{ return let validator = this.state.validator; let moniker = (validator.description && validator.description.moniker) || validator.address; - let isActive = validator.status == 3 && !validator.jailed; + let isActive = validator.status == 'BOND_STATUS_BONDED' && !validator.jailed; return From 31e06a99db2ea841c7d2864a25170b5b1cc124ea Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Sun, 28 Feb 2021 19:46:15 +0000 Subject: [PATCH 099/127] update version --- private/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/version b/private/version index 2246eac46..a4b53a17b 100644 --- a/private/version +++ b/private/version @@ -1 +1 @@ -v0.41.x-3 +v0.41.x-4 \ No newline at end of file From 2c4f489279ea7840072322e3e0ca77636d388aeb Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 1 Mar 2021 10:26:14 +0000 Subject: [PATCH 100/127] remove uncessary flag --- default_settings.json | 1 - 1 file changed, 1 deletion(-) diff --git a/default_settings.json b/default_settings.json index 351c6016f..5c4367854 100644 --- a/default_settings.json +++ b/default_settings.json @@ -15,7 +15,6 @@ "bech32PrefixConsPub": "cosmosvalconspub", "bondDenom": "uatom", "powerReduction": 1000000, - "humanizeReduction": 1000000000000000000, "coins": [ { "denom": "uatom", From 9f762539afbaa49be0756f2cb561e98f62a42342 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 1 Mar 2021 10:26:28 +0000 Subject: [PATCH 101/127] fix account page query --- imports/api/accounts/server/methods.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/api/accounts/server/methods.js b/imports/api/accounts/server/methods.js index f61e75d98..7d457c279 100644 --- a/imports/api/accounts/server/methods.js +++ b/imports/api/accounts/server/methods.js @@ -100,9 +100,9 @@ Meteor.methods({ // get commission let validator = Validators.findOne( - {$or: [{operatorAddress:address}, {delegatorAddress:address}, {address:address}]}) + {$or: [{operator_address:address}, {delegator_address:address}, {address:address}]}) if (validator) { - let url = API + '/cosmos/distribution/v1beta1/validators/'+validator.operatorAddress+'/commission'; + let url = API + '/cosmos/distribution/v1beta1/validators/'+validator.operator_address+'/commission'; balance.operatorAddress = validator.operatorAddress; try { let rewards = HTTP.get(url); From ffaacbfe16e1e8012e4703686b194fda5c9fee4d Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 1 Mar 2021 10:31:55 +0000 Subject: [PATCH 102/127] update operatorAddress variable name --- imports/api/accounts/server/methods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/api/accounts/server/methods.js b/imports/api/accounts/server/methods.js index 7d457c279..fe9ac613f 100644 --- a/imports/api/accounts/server/methods.js +++ b/imports/api/accounts/server/methods.js @@ -103,7 +103,7 @@ Meteor.methods({ {$or: [{operator_address:address}, {delegator_address:address}, {address:address}]}) if (validator) { let url = API + '/cosmos/distribution/v1beta1/validators/'+validator.operator_address+'/commission'; - balance.operatorAddress = validator.operatorAddress; + balance.operatorAddress = validator.operator_address; try { let rewards = HTTP.get(url); if (rewards.statusCode == 200){ From b656cc594d6f2e4b2f72449894300ed5f12ed052 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 1 Mar 2021 10:40:46 +0000 Subject: [PATCH 103/127] fix validator name query in Account component --- imports/api/transactions/server/methods.js | 6 +++--- imports/ui/components/Account.jsx | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/imports/api/transactions/server/methods.js b/imports/api/transactions/server/methods.js index 5587337ee..8bfb59a57 100644 --- a/imports/api/transactions/server/methods.js +++ b/imports/api/transactions/server/methods.js @@ -91,14 +91,14 @@ Meteor.methods({ // address is either delegator address or validator operator address let validator; if (!fields) - fields = {address:1, description:1, operatorAddress:1, delegatorAddress:1}; + fields = {address:1, description:1, operator_address:1, delegator_address:1}; if (address.includes(Meteor.settings.public.bech32PrefixValAddr)){ // validator operator address - validator = Validators.findOne({operatorAddress:address}, {fields}); + validator = Validators.findOne({operator_address:address}, {fields}); } else if (address.includes(Meteor.settings.public.bech32PrefixAccAddr)){ // delegator address - validator = Validators.findOne({delegatorAddress:address}, {fields}); + validator = Validators.findOne({delegator_address:address}, {fields}); } else if (address.length === AddressLength) { validator = Validators.findOne({address:address}, {fields}); diff --git a/imports/ui/components/Account.jsx b/imports/ui/components/Account.jsx index e581a6389..260b230dc 100644 --- a/imports/ui/components/Account.jsx +++ b/imports/ui/components/Account.jsx @@ -17,18 +17,18 @@ export default class Account extends Component{ } getFields() { - return {address:1, description:1, operatorAddress:1, delegatorAddress:1, profile_url:1}; + return {address:1, description:1, operator_address:1, delegator_address:1, profile_url:1}; } getAccount = () => { let address = this.props.address; let validator = Validators.findOne( - {$or: [{operatorAddress:address}, {delegatorAddress:address}, {address:address}]}, + {$or: [{operator_address:address}, {delegator_address:address}, {address:address}]}, {fields: this.getFields() }); if (validator) this.setState({ address: `/validator/${validator.address}`, - moniker: validator.description?validator.description.moniker:validator.operatorAddress, + moniker: validator.description?validator.description.moniker:validator.operator_address, validator: validator }); else @@ -46,7 +46,7 @@ export default class Account extends Component{ // console.log(result); this.setState({ address: `/validator/${result.address}`, - moniker: result.description?result.description.moniker:result.operatorAddress, + moniker: result.description?result.description.moniker:result.operator_address, validator: result }); } @@ -56,8 +56,8 @@ export default class Account extends Component{ getAccount = () => { let address = this.props.address; let validator = Validators.findOne( - {$or: [{operatorAddress:address}, {delegatorAddress:address}, {address:address}]}, - {fields: {address:1, description:1, operatorAddress:1, delegatorAddress:1}}); + {$or: [{operator_address:address}, {delegator_address:address}, {address:address}]}, + {fields: {address:1, description:1, operator_address:1, delegator_address:1}}); if (validator) this.setState({ address: `/validator/${validator.address}`, From 28d1e894963dec9b7b72f01566a04a1905be3caf Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 1 Mar 2021 12:37:09 +0000 Subject: [PATCH 104/127] fix delegation rewards --- imports/ui/accounts/Account.jsx | 11 ++++++----- imports/ui/accounts/Delegations.jsx | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/imports/ui/accounts/Account.jsx b/imports/ui/accounts/Account.jsx index 68fcfb890..e0dd943a5 100644 --- a/imports/ui/accounts/Account.jsx +++ b/imports/ui/accounts/Account.jsx @@ -39,7 +39,7 @@ export default class AccountDetails extends Component{ user: localStorage.getItem(CURRENTUSERADDR), commission: [defaultCoin], denom: '', - rewardsForEachDel: [defaultCoin], + rewardsForEachDel: {defaultCoin}, rewardDenomType: [defaultCoin], } } @@ -71,7 +71,6 @@ export default class AccountDetails extends Component{ } if (result){ - if (result.available && (result.available.length > 0)){ this.setState({ @@ -145,19 +144,21 @@ export default class AccountDetails extends Component{ if (result.rewards && result.rewards.length > 0){ - + console.log(result.rewards); for(let c = 0; c < result.rewards.length; c++){ if(result.rewards[c].reward != null){ numRewards[result.rewards[c]["validator_address"]] = result.rewards[c].reward; } } + console.log(numRewards); for(let e in numRewards){ for(let f in numRewards[e]){ + console.log(numRewards[e][f]); if(this.state.denom === numRewards[e][f].denom){ this.setState({ rewardDenomType: numRewards[e][f].denom, rewardsForEachDel: numRewards, - }) + }, console.log(this.state.rewardsForEachDel)) } } @@ -207,7 +208,7 @@ export default class AccountDetails extends Component{ price: 0, reward: [], denom: '', - rewardsForEachDel: [], + rewardsForEachDel: {}, rewardDenomType: [], }, () => { this.getBalance(); diff --git a/imports/ui/accounts/Delegations.jsx b/imports/ui/accounts/Delegations.jsx index 502c0b31f..3d077a7f5 100644 --- a/imports/ui/accounts/Delegations.jsx +++ b/imports/ui/accounts/Delegations.jsx @@ -31,7 +31,7 @@ export default class AccountDelegations extends Component{ {this.props.delegations.sort((b, a) => (a.balance - b.balance)).map((d, i) => { - let reward = this.props.rewardsForEachDel[d.validator_address]; + let reward = this.props.rewardsForEachDel[d.delegation.validator_address]; rewardDenom =(reward)?reward.find(({denom}) => denom === denomType): null; return From e7684eb29a66a6bab687f2187001b23cf2bef726 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 1 Mar 2021 12:39:30 +0000 Subject: [PATCH 105/127] remove console log --- imports/ui/accounts/Account.jsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/imports/ui/accounts/Account.jsx b/imports/ui/accounts/Account.jsx index e0dd943a5..e756371c4 100644 --- a/imports/ui/accounts/Account.jsx +++ b/imports/ui/accounts/Account.jsx @@ -144,21 +144,18 @@ export default class AccountDetails extends Component{ if (result.rewards && result.rewards.length > 0){ - console.log(result.rewards); for(let c = 0; c < result.rewards.length; c++){ if(result.rewards[c].reward != null){ numRewards[result.rewards[c]["validator_address"]] = result.rewards[c].reward; } } - console.log(numRewards); for(let e in numRewards){ for(let f in numRewards[e]){ - console.log(numRewards[e][f]); if(this.state.denom === numRewards[e][f].denom){ this.setState({ rewardDenomType: numRewards[e][f].denom, rewardsForEachDel: numRewards, - }, console.log(this.state.rewardsForEachDel)) + }) } } From a4ced0b91da7c9caba3ac5c064e5fc1ea28a6d48 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 1 Mar 2021 12:39:58 +0000 Subject: [PATCH 106/127] update version --- private/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/version b/private/version index a4b53a17b..c630118f9 100644 --- a/private/version +++ b/private/version @@ -1 +1 @@ -v0.41.x-4 \ No newline at end of file +v0.41.x-5 \ No newline at end of file From 671b87d97ed16e2528f79113d04fa6f9bded6bed Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 1 Mar 2021 13:31:07 +0000 Subject: [PATCH 107/127] handle unbonded validator if not in database --- imports/api/blocks/server/methods.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 9acb65696..2ec3bdfbe 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -611,7 +611,9 @@ Meteor.methods({ } catch(e){ console.log(url); - console.log("Getting self delegation: %o", e) + console.log("Getting self delegation: %o", e); + valData.self_delegation = 0; + bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); } } From cf2fba55b31a4d7cc0b194701d651728ce31d481 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 1 Mar 2021 13:48:01 +0000 Subject: [PATCH 108/127] only start and update height to update validator info --- imports/api/blocks/server/methods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 2ec3bdfbe..1ca7af500 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -594,7 +594,7 @@ Meteor.methods({ // only update validator infor during start of crawling, end of crawling or every validator update window // get self delegation every 30 blocks // if ((height == Meteor.settings.params.startHeight+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ - if ((height == curr+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ + if ((height == curr+1) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ url = `${API}/cosmos/staking/v1beta1/validators/${valData.operator_address}/delegations/${valData.delegator_address}` try{ From df642b392ebcdd61bd203f0a34dfa897e117d5b5 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 1 Mar 2021 13:49:53 +0000 Subject: [PATCH 109/127] validator info can be updated every block but not delegation --- imports/api/blocks/server/methods.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 1ca7af500..21e0e160c 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -605,18 +605,17 @@ Meteor.methods({ valData.self_delegation = (selfDelegation.delegation && selfDelegation.delegation.shares)?parseFloat(selfDelegation.delegation.shares)/parseFloat(valData.delegator_shares):0; - console.log("Add validator upsert to bulk operations.") - - bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); } catch(e){ console.log(url); console.log("Getting self delegation: %o", e); valData.self_delegation = 0; - bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); + } } + console.log("Add validator upsert to bulk operations.") + bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); } From c1dfe7d3d5c72b301f07dc23fadde923e46e6eae Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 1 Mar 2021 14:21:17 +0000 Subject: [PATCH 110/127] only update validator self delegation at start or update interval --- imports/api/blocks/server/methods.js | 35 ++++++++++++++-------------- imports/api/ledger/server/methods.js | 6 ++--- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 21e0e160c..8c839e179 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -594,23 +594,24 @@ Meteor.methods({ // only update validator infor during start of crawling, end of crawling or every validator update window // get self delegation every 30 blocks // if ((height == Meteor.settings.params.startHeight+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ - if ((height == curr+1) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ - - url = `${API}/cosmos/staking/v1beta1/validators/${valData.operator_address}/delegations/${valData.delegator_address}` - try{ - console.log("Getting self delegation"); - - let response = HTTP.get(url); - let selfDelegation = JSON.parse(response.content).delegation_response; - - valData.self_delegation = (selfDelegation.delegation && selfDelegation.delegation.shares)?parseFloat(selfDelegation.delegation.shares)/parseFloat(valData.delegator_shares):0; - - } - catch(e){ - console.log(url); - console.log("Getting self delegation: %o", e); - valData.self_delegation = 0; - + if ((height == Meteor.settings.params.startHeight+1) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ + if (valData.status == 'BOND_STATUS_BONDED'){ + url = `${API}/cosmos/staking/v1beta1/validators/${valData.operator_address}/delegations/${valData.delegator_address}` + try{ + console.log("Getting self delegation"); + + let response = HTTP.get(url); + let selfDelegation = JSON.parse(response.content).delegation_response; + + valData.self_delegation = (selfDelegation.delegation && selfDelegation.delegation.shares)?parseFloat(selfDelegation.delegation.shares)/parseFloat(valData.delegator_shares):0; + + } + catch(e){ + console.log(url); + console.log("Getting self delegation: %o", e); + valData.self_delegation = 0; + + } } } diff --git a/imports/api/ledger/server/methods.js b/imports/api/ledger/server/methods.js index 16ab2db06..79bdc9067 100644 --- a/imports/api/ledger/server/methods.js +++ b/imports/api/ledger/server/methods.js @@ -3,7 +3,7 @@ import { HTTP } from 'meteor/http'; Meteor.methods({ 'transaction.submit': function(txInfo) { this.unblock(); - const url = `${LCD}/txs`; + const url = `${API}/txs`; data = { "tx": txInfo.value, "mode": "sync" @@ -22,7 +22,7 @@ Meteor.methods({ }, 'transaction.execute': function(body, path) { this.unblock(); - const url = `${LCD}/${path}`; + const url = `${API}/${path}`; data = { "base_req": { ...body, @@ -37,7 +37,7 @@ Meteor.methods({ }, 'transaction.simulate': function(txMsg, from, path, adjustment='1.2') { this.unblock(); - const url = `${LCD}/${path}`; + const url = `${API}/${path}`; data = {...txMsg, "base_req": { "from": from, From 42f430a4f647f2569274d8a4c669d378578ece96 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Mon, 1 Mar 2021 14:38:17 +0000 Subject: [PATCH 111/127] don't update validator info every block --- imports/api/blocks/server/methods.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 8c839e179..ad9b3a99b 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -612,12 +612,11 @@ Meteor.methods({ valData.self_delegation = 0; } + + console.log("Add validator upsert to bulk operations.") + bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); } } - - console.log("Add validator upsert to bulk operations.") - bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); - } // store valdiators exist records From 4e07a36cdf49aab7ba7fae1e74cc4e0d42d2a083 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 3 Mar 2021 11:46:03 +0000 Subject: [PATCH 112/127] upload ledger login message and settings --- both/i18n/en-us.i18n.yml | 2 +- both/i18n/it-IT.i18n.yml | 2 +- both/i18n/pl-PL.i18n.yml | 2 +- both/i18n/pt-BR.i18n.yml | 2 +- both/i18n/ru-RU.i18n.yml | 2 +- default_settings.json | 9 +++++++-- imports/ui/ledger/LedgerModal.jsx | 2 +- imports/ui/ledger/ledger.js | 13 ++++++------- 8 files changed, 19 insertions(+), 15 deletions(-) diff --git a/both/i18n/en-us.i18n.yml b/both/i18n/en-us.i18n.yml index 10747ba54..b09a24509 100644 --- a/both/i18n/en-us.i18n.yml +++ b/both/i18n/en-us.i18n.yml @@ -203,7 +203,7 @@ accounts: signInText: 'You are signed in as ' toLoginAs: 'To log in as' signInWithLedger: 'Sign In With Ledger' - signInWarning: 'Please make sure your Ledger device is connected and Cosmos App 1.5.0 or above is opened.' + signInWarning: 'Please make sure your Ledger device is connected and {$network} App {$version} or above is opened.' pleaseAccept: 'please accept in your Ledger device.' noRewards: 'No Rewards' activities: diff --git a/both/i18n/it-IT.i18n.yml b/both/i18n/it-IT.i18n.yml index 2d12bb8d0..6df80d259 100644 --- a/both/i18n/it-IT.i18n.yml +++ b/both/i18n/it-IT.i18n.yml @@ -200,7 +200,7 @@ accounts: signInText: 'Registrati come' toLoginAs: 'Accedi come' signInWithLedger: 'Registrati con un Ledger' - signInWarning: 'Per favore assicurati che il tuo Ledger sia connesso e Cosmos App 1.5.0 or above che sia aperto.' + signInWarning: 'Per favore assicurati che il tuo Ledger sia connesso e {$network} App {$version} or above che sia aperto.' pleaseAccept: 'Per favore accetta nel tuo Ledger' noRewards: 'Nessun reward' activities: diff --git a/both/i18n/pl-PL.i18n.yml b/both/i18n/pl-PL.i18n.yml index 02cad4339..04ce2f7d0 100644 --- a/both/i18n/pl-PL.i18n.yml +++ b/both/i18n/pl-PL.i18n.yml @@ -200,7 +200,7 @@ accounts: signInText: 'Zalogowany jako ' toLoginAs: 'Aby zalogować się jako ' signInWithLedger: 'Zaloguj się z Ledgerem' - signInWarning: 'Upewnij się, że Twój Ledger jest podłączony do komputera oraz aplikacja Cosmos App 1.5.0 lub nowsza jest uruchomiona.' + signInWarning: 'Upewnij się, że Twój Ledger jest podłączony do komputera oraz aplikacja {$network} App {$version} lub nowsza jest uruchomiona.' pleaseAccept: 'zaakceptuj połączenie na Twoim Ledgerze.' noRewards: 'Brak Nagród' activities: diff --git a/both/i18n/pt-BR.i18n.yml b/both/i18n/pt-BR.i18n.yml index e2a6cb4a7..cca44d89c 100644 --- a/both/i18n/pt-BR.i18n.yml +++ b/both/i18n/pt-BR.i18n.yml @@ -199,7 +199,7 @@ accounts: signInText: 'Você está conectado como ' toLoginAs: 'Para entrar como' signInWithLedger: 'Entrar com Ledger' - signInWarning: 'Certifique-se de que seu dispositivo Ledger esteja conectado e o Cosmos App 1.5.0 ou superior esteja aberto.' + signInWarning: 'Certifique-se de que seu dispositivo Ledger esteja conectado e o {$network} App {$version} ou superior esteja aberto.' pleaseAccept: 'por favor, aceite em seu dispositivo Ledger.' noRewards: 'Sem recompensas' activities: diff --git a/both/i18n/ru-RU.i18n.yml b/both/i18n/ru-RU.i18n.yml index 915dbf0ff..d15efab34 100644 --- a/both/i18n/ru-RU.i18n.yml +++ b/both/i18n/ru-RU.i18n.yml @@ -192,7 +192,7 @@ accounts: signInText: 'Войти' toLoginAs: 'Войти' signInWithLedger: 'Войти с Ledger' - signInWarning: 'Пожалуйста, убедитесь, что устройство Ledger подключен и Cosmos App 1.5.0 или выше открыто.' + signInWarning: 'Пожалуйста, убедитесь, что устройство Ledger подключен и {$network} App {$version} или выше открыто.' pleaseAccept: 'пожалуйста, примите в свой Ledger устройство.' activities: single: ' ' diff --git a/default_settings.json b/default_settings.json index 5c4367854..d47365a6f 100644 --- a/default_settings.json +++ b/default_settings.json @@ -1,6 +1,6 @@ { "public":{ - "chainName": "Cosmos Testnet", + "chainName": "Cosmos", "chainId": "{Chain ID}", "gtm": "{Add your Google Tag Manager ID here}", "slashingWindow": 10000, @@ -27,6 +27,12 @@ "fraction": 1000000 } ], + "ledger":{ + "coinType": 118, + "appName": "Cosmos", + "appVersion": "2.16.0", + "gasPrice": 0.02 + }, "modules": { "bank": true, "supply": true, @@ -34,7 +40,6 @@ "gov": true, "distribution": false }, - "gasPrice": 0.02, "coingeckoId": "cosmos" }, "remote":{ diff --git a/imports/ui/ledger/LedgerModal.jsx b/imports/ui/ledger/LedgerModal.jsx index 4326de205..1f2c2eecf 100644 --- a/imports/ui/ledger/LedgerModal.jsx +++ b/imports/ui/ledger/LedgerModal.jsx @@ -101,7 +101,7 @@ class LedgerModal extends React.Component { - accounts.signInWarning + accounts.signInWarning {this.state.currentUser?You are currently logged in as {this.state.currentUser}.:null} diff --git a/imports/ui/ledger/ledger.js b/imports/ui/ledger/ledger.js index ba4bba1d2..07746d9b3 100644 --- a/imports/ui/ledger/ledger.js +++ b/imports/ui/ledger/ledger.js @@ -2,23 +2,20 @@ // https://github.com/zondax/cosmos-delegation-js/ // https://github.com/cosmos/ledger-cosmos-js/blob/master/src/index.js import 'babel-polyfill'; -import Cosmos from "@lunie/cosmos-js" import TransportWebUSB from "@ledgerhq/hw-transport-webusb"; import CosmosApp from "ledger-cosmos-js" import { signatureImport } from "secp256k1" import semver from "semver" import bech32 from "bech32"; -import secp256k1 from "secp256k1"; import sha256 from "crypto-js/sha256" import ripemd160 from "crypto-js/ripemd160" import CryptoJS from "crypto-js" // TODO: discuss TIMEOUT value const INTERACTION_TIMEOUT = 10000 -const REQUIRED_COSMOS_APP_VERSION = "2.0.0" -const DEFAULT_DENOM = 'uatom'; -const DEFAULT_GAS = 200000; -export const DEFAULT_GAS_PRICE = 0.025; +const REQUIRED_COSMOS_APP_VERSION = Meteor.settings.public.ledger.ledgerAppVersion || "2.16.0"; +const DEFAULT_DENOM = Meteor.settings.public.bondDenom || 'uatom'; +export const DEFAULT_GAS_PRICE = parseFloat(Meteor.settings.public.ledger.gasPrice) || 0.025; export const DEFAULT_MEMO = 'Sent via Big Dipper' /* @@ -26,7 +23,9 @@ HD wallet derivation path (BIP44) DerivationPath{44, 118, account, 0, index} */ -const HDPATH = [44, 118, 0, 0, 0] +const COINTYPE = Meteor.settings.public.ledger.coinType || 118; + +const HDPATH = [44, COINTYPE, 0, 0, 0] const BECH32PREFIX = Meteor.settings.public.bech32PrefixAccAddr function bech32ify(address, prefix) { From bb71a2c343e9772c3e18e96716f8044f14cf65e5 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 9 Mar 2021 10:42:34 +0000 Subject: [PATCH 113/127] change validator update schedule --- imports/api/blocks/server/methods.js | 44 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index ad9b3a99b..2bb9411f1 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -592,30 +592,30 @@ Meteor.methods({ } // only update validator infor during start of crawling, end of crawling or every validator update window - // get self delegation every 30 blocks - // if ((height == Meteor.settings.params.startHeight+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ - if ((height == Meteor.settings.params.startHeight+1) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ - if (valData.status == 'BOND_STATUS_BONDED'){ - url = `${API}/cosmos/staking/v1beta1/validators/${valData.operator_address}/delegations/${valData.delegator_address}` - try{ - console.log("Getting self delegation"); - - let response = HTTP.get(url); - let selfDelegation = JSON.parse(response.content).delegation_response; - - valData.self_delegation = (selfDelegation.delegation && selfDelegation.delegation.shares)?parseFloat(selfDelegation.delegation.shares)/parseFloat(valData.delegator_shares):0; - - } - catch(e){ - console.log(url); - console.log("Getting self delegation: %o", e); - valData.self_delegation = 0; - + if ((height == curr+1) || (height == Meteor.settings.params.startHeight+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ + if ((height == Meteor.settings.params.startHeight+1) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ + if (valData.status == 'BOND_STATUS_BONDED'){ + url = `${API}/cosmos/staking/v1beta1/validators/${valData.operator_address}/delegations/${valData.delegator_address}` + try{ + console.log("Getting self delegation"); + + let response = HTTP.get(url); + let selfDelegation = JSON.parse(response.content).delegation_response; + + valData.self_delegation = (selfDelegation.delegation && selfDelegation.delegation.shares)?parseFloat(selfDelegation.delegation.shares)/parseFloat(valData.delegator_shares):0; + + } + catch(e){ + console.log(url); + console.log("Getting self delegation: %o", e); + valData.self_delegation = 0; + + } } - - console.log("Add validator upsert to bulk operations.") - bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); } + + console.log("Add validator upsert to bulk operations.") + bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); } } From 8ebfdf60b376e649930330432a323b97087d7640 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 9 Mar 2021 10:44:19 +0000 Subject: [PATCH 114/127] update version --- private/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/version b/private/version index c630118f9..022e091a7 100644 --- a/private/version +++ b/private/version @@ -1 +1 @@ -v0.41.x-5 \ No newline at end of file +v0.41.x-6 \ No newline at end of file From 392c4eb788cc0d71395d1acdc4cfb674df45d2b5 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Tue, 9 Mar 2021 12:01:36 +0000 Subject: [PATCH 115/127] fix lint --- imports/api/blocks/server/methods.js | 730 +++++++++++------------ imports/ui/components/AccountTooltip.jsx | 24 +- imports/ui/components/PowerHistory.jsx | 1 - imports/ui/validators/Validator.jsx | 10 +- 4 files changed, 382 insertions(+), 383 deletions(-) diff --git a/imports/api/blocks/server/methods.js b/imports/api/blocks/server/methods.js index 2bb9411f1..b089e3a4a 100644 --- a/imports/api/blocks/server/methods.js +++ b/imports/api/blocks/server/methods.js @@ -256,7 +256,7 @@ Meteor.methods({ for (let height = curr+1 ; height <= until ; height++) { // for (let height = curr+1 ; height <= curr+1 ; height++) { - let startBlockTime = new Date(); + let startBlockTime = new Date(); // add timeout here? and outside this loop (for catched up and keep fetching)? this.unblock(); // let url = RPC+'/block?height=' + height; @@ -276,447 +276,447 @@ Meteor.methods({ let response = HTTP.get(url); - // store height, hash, numtransaction and time in db - let blockData = {}; - let block = JSON.parse(response.content); - blockData.height = height; - blockData.hash = block.block_id.hash; - blockData.transNum = block.block.data.txs?block.block.data.txs.length:0; - blockData.time = block.block.header.time; - blockData.lastBlockHash = block.block.header.last_block_id.hash; - blockData.proposerAddress = block.block.header.proposer_address; - blockData.validators = []; - - - // save txs in database - if (block.block.data.txs && block.block.data.txs.length > 0){ - for (t in block.block.data.txs){ - bulkTransactions.insert({ - // hash has to be in uppercase - txhash: sha256(Buffer.from(block.block.data.txs[t], 'base64')).toUpperCase(), - height: parseInt(height), - processed: false - }) - } - - if (bulkTransactions.length > 0){ - bulkTransactions.execute((err, result) => { - if (err){ - console.log(err); - } - if (result){ - // console.log(result); - } - }); - } + // store height, hash, numtransaction and time in db + let blockData = {}; + let block = JSON.parse(response.content); + blockData.height = height; + blockData.hash = block.block_id.hash; + blockData.transNum = block.block.data.txs?block.block.data.txs.length:0; + blockData.time = block.block.header.time; + blockData.lastBlockHash = block.block.header.last_block_id.hash; + blockData.proposerAddress = block.block.header.proposer_address; + blockData.validators = []; + + + // save txs in database + if (block.block.data.txs && block.block.data.txs.length > 0){ + for (t in block.block.data.txs){ + bulkTransactions.insert({ + // hash has to be in uppercase + txhash: sha256(Buffer.from(block.block.data.txs[t], 'base64')).toUpperCase(), + height: parseInt(height), + processed: false + }) } - // save double sign evidences - if (block.block.evidence.evidenceList){ - Evidences.insert({ - height: height, - evidence: block.block.evidence.evidenceList + if (bulkTransactions.length > 0){ + bulkTransactions.execute((err, result) => { + if (err){ + console.log(err); + } + if (result){ + // console.log(result); + } }); } + } - // console.log("signatures: %o", block.block.lastCommit.signaturesList) - - blockData.precommitsCount = block.block.last_commit.signatures.length; + // save double sign evidences + if (block.block.evidence.evidenceList){ + Evidences.insert({ + height: height, + evidence: block.block.evidence.evidenceList + }); + } - analyticsData.height = height; + // console.log("signatures: %o", block.block.lastCommit.signaturesList) - let endGetHeightTime = new Date(); - console.log("Get height time: "+((endGetHeightTime-startGetHeightTime)/1000)+"seconds."); + blockData.precommitsCount = block.block.last_commit.signatures.length; + analyticsData.height = height; - let startGetValidatorsTime = new Date(); - // update chain status + let endGetHeightTime = new Date(); + console.log("Get height time: "+((endGetHeightTime-startGetHeightTime)/1000)+"seconds."); - let validators = [] - let page = 0; - // let nextKey = 0; - try { - let result; - do { - let url = RPC+`/validators?height=${height}&page=${++page}&per_page=100`; - let response = HTTP.get(url); - result = JSON.parse(response.content).result; - // console.log("========= validator result ==========: %o", result) - validators = [...validators, ...result.validators]; - - // console.log(validators.length); - // console.log(parseInt(result.total)); - } - while (validators.length < parseInt(result.total)) - - } - catch(e){ - console.log("Getting validator set at height %o: %o", height, e) - } + let startGetValidatorsTime = new Date(); + // update chain status - // console.log(validators) + let validators = [] + let page = 0; + // let nextKey = 0; + try { + let result; - ValidatorSets.insert({ - block_height: height, - validators: validators - }) - - blockData.validatorsCount = validators.length; - - // temporarily add bech32 concensus keys to the validator set list - let tempValidators = []; - for (let v in validators){ - // validators[v].consensus_pubkey = Meteor.call('pubkeyToBech32Old', validators[v].pub_key, Meteor.settings.public.bech32PrefixConsPub); - // validators[v].valconsAddress = validators[v].address; - validators[v].valconsAddress = Meteor.call('hexToBech32', validators[v].address, Meteor.settings.public.bech32PrefixConsAddr); - // validators[v].address = Meteor.call('getAddressFromPubkey', validators[v].pubKey); - // tempValidators[validators[v].pubKey.value] = validators[v]; - tempValidators[validators[v].address] = validators[v]; + do { + let url = RPC+`/validators?height=${height}&page=${++page}&per_page=100`; + let response = HTTP.get(url); + result = JSON.parse(response.content).result; + // console.log("========= validator result ==========: %o", result) + validators = [...validators, ...result.validators]; + + // console.log(validators.length); + // console.log(parseInt(result.total)); } - validators = tempValidators; - - // console.log("before comparing precommits: %o", validators); - - // Tendermint v0.33 start using "signatures" in last block instead of "precommits" - let precommits = block.block.last_commit.signatures; - if (precommits != null){ - // console.log(precommits); - for (let i=0; i 1){ - // record precommits and calculate uptime - // only record from block 2 - console.log("Inserting precommits") - for (i in validators){ - let address = validators[i].address; - let record = { - height: height, - address: address, - exists: false, - voting_power: parseInt(validators[i].voting_power) - } + analyticsData.precommits = precommits.length; + // record for analytics + // PrecommitRecords.insert({height:height, precommits:precommits.length}); + } + + if (height > 1){ + // record precommits and calculate uptime + // only record from block 2 + console.log("Inserting precommits") + for (i in validators){ + let address = validators[i].address; + let record = { + height: height, + address: address, + exists: false, + voting_power: parseInt(validators[i].voting_power) + } - for (j in precommits){ - if (precommits[j] != null){ - let precommitAddress = precommits[j].validator_address; - if (address == precommitAddress){ - record.exists = true; - bulkUpdateLastSeen.find({address:precommitAddress}).upsert().updateOne({$set:{lastSeen:blockData.time}}); - precommits.splice(j,1); - break; - } + for (j in precommits){ + if (precommits[j] != null){ + let precommitAddress = precommits[j].validator_address; + if (address == precommitAddress){ + record.exists = true; + bulkUpdateLastSeen.find({address:precommitAddress}).upsert().updateOne({$set:{lastSeen:blockData.time}}); + precommits.splice(j,1); + break; } } - - bulkValidatorRecords.insert(record); - // ValidatorRecords.update({height:height,address:record.address},record); } + + bulkValidatorRecords.insert(record); + // ValidatorRecords.update({height:height,address:record.address},record); } + } - let startBlockInsertTime = new Date(); - Blockscon.insert(blockData); - let endBlockInsertTime = new Date(); - console.log("Block insert time: "+((endBlockInsertTime-startBlockInsertTime)/1000)+"seconds."); - - let chainStatus = Chain.findOne({chainId:block.block.header.chain_id}); - let lastSyncedTime = chainStatus?chainStatus.lastSyncedTime:0; - let timeDiff; - let blockTime = Meteor.settings.params.defaultBlockTime; - if (lastSyncedTime){ - let dateLatest = new Date(blockData.time); - let dateLast = new Date(lastSyncedTime); - let genesisTime = new Date(Meteor.settings.public.genesisTime); - timeDiff = Math.abs(dateLatest.getTime() - dateLast.getTime()); - // blockTime = (chainStatus.blockTime * (blockData.height - 1) + timeDiff) / blockData.height; - blockTime = (dateLatest.getTime() - genesisTime.getTime()) / blockData.height; - } - - let endGetValidatorsTime = new Date(); - console.log("Get height validators time: "+((endGetValidatorsTime-startGetValidatorsTime)/1000)+"seconds."); - - Chain.update({chainId:block.block.header.chainId}, {$set:{lastSyncedTime:blockData.time, blockTime:blockTime}}); - - analyticsData.averageBlockTime = blockTime; - analyticsData.timeDiff = timeDiff; - - analyticsData.time = blockData.time; - - // initialize validator data at first block - // if (height == 1){ - // Validators.remove({}); - // } + let startBlockInsertTime = new Date(); + Blockscon.insert(blockData); + let endBlockInsertTime = new Date(); + console.log("Block insert time: "+((endBlockInsertTime-startBlockInsertTime)/1000)+"seconds."); + + let chainStatus = Chain.findOne({chainId:block.block.header.chain_id}); + let lastSyncedTime = chainStatus?chainStatus.lastSyncedTime:0; + let timeDiff; + let blockTime = Meteor.settings.params.defaultBlockTime; + if (lastSyncedTime){ + let dateLatest = new Date(blockData.time); + let dateLast = new Date(lastSyncedTime); + let genesisTime = new Date(Meteor.settings.public.genesisTime); + timeDiff = Math.abs(dateLatest.getTime() - dateLast.getTime()); + // blockTime = (chainStatus.blockTime * (blockData.height - 1) + timeDiff) / blockData.height; + blockTime = (dateLatest.getTime() - genesisTime.getTime()) / blockData.height; + } + + let endGetValidatorsTime = new Date(); + console.log("Get height validators time: "+((endGetValidatorsTime-startGetValidatorsTime)/1000)+"seconds."); + + Chain.update({chainId:block.block.header.chainId}, {$set:{lastSyncedTime:blockData.time, blockTime:blockTime}}); + + analyticsData.averageBlockTime = blockTime; + analyticsData.timeDiff = timeDiff; + + analyticsData.time = blockData.time; + + // initialize validator data at first block + // if (height == 1){ + // Validators.remove({}); + // } - analyticsData.voting_power = 0; + analyticsData.voting_power = 0; - let startFindValidatorsNameTime = new Date(); - for (v in validatorSet){ - let valData = validatorSet[v]; + let startFindValidatorsNameTime = new Date(); + for (v in validatorSet){ + let valData = validatorSet[v]; - valData.tokens = parseInt(valData.tokens); - valData.unbonding_height = parseInt(valData.unbonding_height) + valData.tokens = parseInt(valData.tokens); + valData.unbonding_height = parseInt(valData.unbonding_height) - let valExist = Validators.findOne({"consensus_pubkey.key":v}); + let valExist = Validators.findOne({"consensus_pubkey.key":v}); - // console.log(valData); + // console.log(valData); - // console.log("===== voting power ======: %o", valData) - analyticsData.voting_power += valData.voting_power + // console.log("===== voting power ======: %o", valData) + analyticsData.voting_power += valData.voting_power - // console.log(analyticsData.voting_power); - if (!valExist && valData.consensus_pubkey){ + // console.log(analyticsData.voting_power); + if (!valExist && valData.consensus_pubkey){ - // let val = getValidatorFromConsensusKey(validators, v); - // get the validator hex address and other bech32 addresses. + // let val = getValidatorFromConsensusKey(validators, v); + // get the validator hex address and other bech32 addresses. - valData.delegator_address = Meteor.call('getDelegator', valData.operator_address); + valData.delegator_address = Meteor.call('getDelegator', valData.operator_address); - // console.log("get hex address") - // valData.address = getAddress(valData.consensusPubkey); - console.log("get bech32 consensus pubkey"); - valData.bech32ConsensusPubKey = Meteor.call('pubkeyToBech32', valData.consensus_pubkey, Meteor.settings.public.bech32PrefixConsPub); + // console.log("get hex address") + // valData.address = getAddress(valData.consensusPubkey); + console.log("get bech32 consensus pubkey"); + valData.bech32ConsensusPubKey = Meteor.call('pubkeyToBech32', valData.consensus_pubkey, Meteor.settings.public.bech32PrefixConsPub); - valData.address = Meteor.call('getAddressFromPubkey', valData.consensus_pubkey); - valData.bech32ValConsAddress = Meteor.call('hexToBech32', valData.address, Meteor.settings.public.bech32PrefixConsAddr); + valData.address = Meteor.call('getAddressFromPubkey', valData.consensus_pubkey); + valData.bech32ValConsAddress = Meteor.call('hexToBech32', valData.address, Meteor.settings.public.bech32PrefixConsAddr); - // assign back to the validator set so that we can use it to find the uptime + // assign back to the validator set so that we can use it to find the uptime - if (validatorSet[v]) - validatorSet[v].bech32ValConsAddress = valData.bech32ValConsAddress; + if (validatorSet[v]) + validatorSet[v].bech32ValConsAddress = valData.bech32ValConsAddress; - // First time adding validator to the database. - // Fetch profile picture from Keybase + // First time adding validator to the database. + // Fetch profile picture from Keybase - if (valData.description && valData.description.identity){ - try{ - valData.profile_url = getValidatorProfileUrl(valData.description.identity) - } - catch (e){ - console.log("Error fetching keybase: %o", e) - } + if (valData.description && valData.description.identity){ + try{ + valData.profile_url = getValidatorProfileUrl(valData.description.identity) + } + catch (e){ + console.log("Error fetching keybase: %o", e) } + } - valData.accpub = Meteor.call('pubkeyToBech32', valData.consensus_pubkey, Meteor.settings.public.bech32PrefixAccPub); - valData.operator_pubkey = Meteor.call('pubkeyToBech32', valData.consensus_pubkey, Meteor.settings.public.bech32PrefixValPub); + valData.accpub = Meteor.call('pubkeyToBech32', valData.consensus_pubkey, Meteor.settings.public.bech32PrefixAccPub); + valData.operator_pubkey = Meteor.call('pubkeyToBech32', valData.consensus_pubkey, Meteor.settings.public.bech32PrefixValPub); - // insert first power change history + // insert first power change history - // valData.voting_power = validators[valData.consensusPubkey.value]?parseInt(validators[valData.consensusPubkey.value].votingPower):0; - valData.voting_power = validators[valData.address]?parseInt(validators[valData.address].voting_power):0; - valData.proposer_priority = validators[valData.address]?parseInt(validators[valData.address].proposer_priority):0; + // valData.voting_power = validators[valData.consensusPubkey.value]?parseInt(validators[valData.consensusPubkey.value].votingPower):0; + valData.voting_power = validators[valData.address]?parseInt(validators[valData.address].voting_power):0; + valData.proposer_priority = validators[valData.address]?parseInt(validators[valData.address].proposer_priority):0; - console.log("Validator not found. Insert first VP change record.") + console.log("Validator not found. Insert first VP change record.") - // console.log("first voting power: %o", valData.voting_power); - bulkVPHistory.insert({ - address: valData.address, - prev_voting_power: 0, - voting_power: valData.voting_power, - type: 'add', - height: blockData.height, - block_time: blockData.time - }); - // } - } - else{ - // console.log(valData); - valData.address = valExist.address; - - // assign to valData for getting self delegation - valData.delegator_address = valExist.delegator_address; - valData.bech32ValConsAddress = valExist.bech32ValConsAddress; - - if (validatorSet[v]){ - validatorSet[v].bech32ValConsAddress = valExist.bech32ValConsAddress; - } - // console.log(valExist); - // console.log(validators[valExist.address]) - // if (validators[valData.consensusPubkey.value]){ - if (validators[valExist.address]){ - // Validator exists and is in validator set, update voitng power. - // If voting power is different from before, add voting power history - valData.voting_power = parseInt(validators[valExist.address].voting_power); - valData.proposer_priority = parseInt(validators[valExist.address].proposer_priority); - let prevVotingPower = VotingPowerHistory.findOne({address:valExist.address}, {height:-1, limit:1}); - - console.log("Validator already in DB. Check if VP changed."); - if (prevVotingPower){ - if (prevVotingPower.voting_power != valData.voting_power){ - let changeType = (prevVotingPower.voting_power > valData.voting_power)?'down':'up'; - let changeData = { - address: valExist.address, - prev_voting_power: prevVotingPower.voting_power, - voting_power: valData.voting_power, - type: changeType, - height: blockData.height, - block_time: blockData.time - }; - bulkVPHistory.insert(changeData); - } - } - } - else{ - // Validator is not in the set and it has been removed. - // Set voting power to zero and add voting power history. - - valData.address = valExist.address; - valData.voting_power = 0; - valData.proposer_priority = 0; + // console.log("first voting power: %o", valData.voting_power); + bulkVPHistory.insert({ + address: valData.address, + prev_voting_power: 0, + voting_power: valData.voting_power, + type: 'add', + height: blockData.height, + block_time: blockData.time + }); + // } + } + else{ + // console.log(valData); + valData.address = valExist.address; - let prevVotingPower = VotingPowerHistory.findOne({address:valExist.address}, {height:-1, limit:1}); + // assign to valData for getting self delegation + valData.delegator_address = valExist.delegator_address; + valData.bech32ValConsAddress = valExist.bech32ValConsAddress; - if (prevVotingPower && (prevVotingPower.voting_power > 0)){ - console.log("Validator is in DB but not in validator set now. Add remove VP change."); - bulkVPHistory.insert({ + if (validatorSet[v]){ + validatorSet[v].bech32ValConsAddress = valExist.bech32ValConsAddress; + } + // console.log(valExist); + // console.log(validators[valExist.address]) + // if (validators[valData.consensusPubkey.value]){ + if (validators[valExist.address]){ + // Validator exists and is in validator set, update voitng power. + // If voting power is different from before, add voting power history + valData.voting_power = parseInt(validators[valExist.address].voting_power); + valData.proposer_priority = parseInt(validators[valExist.address].proposer_priority); + let prevVotingPower = VotingPowerHistory.findOne({address:valExist.address}, {height:-1, limit:1}); + + console.log("Validator already in DB. Check if VP changed."); + if (prevVotingPower){ + if (prevVotingPower.voting_power != valData.voting_power){ + let changeType = (prevVotingPower.voting_power > valData.voting_power)?'down':'up'; + let changeData = { address: valExist.address, - prev_voting_power: prevVotingPower, - voting_power: 0, - type: 'remove', + prev_voting_power: prevVotingPower.voting_power, + voting_power: valData.voting_power, + type: changeType, height: blockData.height, block_time: blockData.time - }); + }; + bulkVPHistory.insert(changeData); } } } + else{ + // Validator is not in the set and it has been removed. + // Set voting power to zero and add voting power history. + + valData.address = valExist.address; + valData.voting_power = 0; + valData.proposer_priority = 0; + + let prevVotingPower = VotingPowerHistory.findOne({address:valExist.address}, {height:-1, limit:1}); + + if (prevVotingPower && (prevVotingPower.voting_power > 0)){ + console.log("Validator is in DB but not in validator set now. Add remove VP change."); + bulkVPHistory.insert({ + address: valExist.address, + prev_voting_power: prevVotingPower, + voting_power: 0, + type: 'remove', + height: blockData.height, + block_time: blockData.time + }); + } + } + } - // only update validator infor during start of crawling, end of crawling or every validator update window - if ((height == curr+1) || (height == Meteor.settings.params.startHeight+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ - if ((height == Meteor.settings.params.startHeight+1) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ - if (valData.status == 'BOND_STATUS_BONDED'){ - url = `${API}/cosmos/staking/v1beta1/validators/${valData.operator_address}/delegations/${valData.delegator_address}` - try{ - console.log("Getting self delegation"); + // only update validator infor during start of crawling, end of crawling or every validator update window + if ((height == curr+1) || (height == Meteor.settings.params.startHeight+1) || (height == until) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ + if ((height == Meteor.settings.params.startHeight+1) || (height % Meteor.settings.params.validatorUpdateWindow == 0)){ + if (valData.status == 'BOND_STATUS_BONDED'){ + url = `${API}/cosmos/staking/v1beta1/validators/${valData.operator_address}/delegations/${valData.delegator_address}` + try{ + console.log("Getting self delegation"); - let response = HTTP.get(url); - let selfDelegation = JSON.parse(response.content).delegation_response; + let response = HTTP.get(url); + let selfDelegation = JSON.parse(response.content).delegation_response; - valData.self_delegation = (selfDelegation.delegation && selfDelegation.delegation.shares)?parseFloat(selfDelegation.delegation.shares)/parseFloat(valData.delegator_shares):0; + valData.self_delegation = (selfDelegation.delegation && selfDelegation.delegation.shares)?parseFloat(selfDelegation.delegation.shares)/parseFloat(valData.delegator_shares):0; - } - catch(e){ - console.log(url); - console.log("Getting self delegation: %o", e); - valData.self_delegation = 0; + } + catch(e){ + console.log(url); + console.log("Getting self delegation: %o", e); + valData.self_delegation = 0; - } } } - - console.log("Add validator upsert to bulk operations.") - bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); } - } - // store valdiators exist records - // let existingValidators = Validators.find({address:{$exists:true}}).fetch(); - - // update uptime by the end of the crawl or update window - if ((height % Meteor.settings.params.validatorUpdateWindow == 0) || (height == until)){ - console.log("Update validator uptime.") - getValidatorUptime(validatorSet) + console.log("Add validator upsert to bulk operations.") + bulkValidators.find({"address": valData.address}).upsert().updateOne({$set:valData}); } - - // fetching keybase every base on keybaseFetchingInterval settings - // default to every 5 hours - - if (height == curr+1){ - - // check the last fetching time - - let now = Date.now(); - let lastKeybaseFetchTime = Date.parse(chainStatus.lastKeybaseFetchTime) || 0 - console.log("Now: %o", now) - console.log("Last fetch time: %o", lastKeybaseFetchTime) - - if (!lastKeybaseFetchTime || (now - lastKeybaseFetchTime) > Meteor.settings.params.keybaseFetchingInterval ){ - console.log('Fetching keybase...') - // eslint-disable-next-line no-loop-func - Validators.find({}).forEach(async (validator) => { - try { - if (validator.description && validator.description.identity){ - let profileUrl = getValidatorProfileUrl(validator.description.identity) - if (profileUrl) { - bulkValidators.find({address: validator.address}).upsert().updateOne({$set:{'profile_url':profileUrl}}); - } - } - } catch (e) { - console.log("Error fetching Keybase for %o: %o", validator.address, e) + } + + // store valdiators exist records + // let existingValidators = Validators.find({address:{$exists:true}}).fetch(); + + // update uptime by the end of the crawl or update window + if ((height % Meteor.settings.params.validatorUpdateWindow == 0) || (height == until)){ + console.log("Update validator uptime.") + getValidatorUptime(validatorSet) + } + + // fetching keybase every base on keybaseFetchingInterval settings + // default to every 5 hours + + if (height == curr+1){ + + // check the last fetching time + + let now = Date.now(); + let lastKeybaseFetchTime = Date.parse(chainStatus.lastKeybaseFetchTime) || 0 + console.log("Now: %o", now) + console.log("Last fetch time: %o", lastKeybaseFetchTime) + + if (!lastKeybaseFetchTime || (now - lastKeybaseFetchTime) > Meteor.settings.params.keybaseFetchingInterval ){ + console.log('Fetching keybase...') + // eslint-disable-next-line no-loop-func + Validators.find({}).forEach(async (validator) => { + try { + if (validator.description && validator.description.identity){ + let profileUrl = getValidatorProfileUrl(validator.description.identity) + if (profileUrl) { + bulkValidators.find({address: validator.address}).upsert().updateOne({$set:{'profile_url':profileUrl}}); + } } - }) - - Chain.update({chainId:block.block.header.chainId}, {$set:{lastKeybaseFetchTime:new Date().toUTCString()}}); - } + } catch (e) { + console.log("Error fetching Keybase for %o: %o", validator.address, e) + } + }) + Chain.update({chainId:block.block.header.chainId}, {$set:{lastKeybaseFetchTime:new Date().toUTCString()}}); } - let endFindValidatorsNameTime = new Date(); - console.log("Get validators name time: "+((endFindValidatorsNameTime-startFindValidatorsNameTime)/1000)+"seconds."); + } - // record for analytics - let startAnayticsInsertTime = new Date(); - Analytics.insert(analyticsData); - let endAnalyticsInsertTime = new Date(); - console.log("Analytics insert time: "+((endAnalyticsInsertTime-startAnayticsInsertTime)/1000)+"seconds."); + let endFindValidatorsNameTime = new Date(); + console.log("Get validators name time: "+((endFindValidatorsNameTime-startFindValidatorsNameTime)/1000)+"seconds."); - // calculate voting power distribution every 60 blocks ~ 5mins + // record for analytics + let startAnayticsInsertTime = new Date(); + Analytics.insert(analyticsData); + let endAnalyticsInsertTime = new Date(); + console.log("Analytics insert time: "+((endAnalyticsInsertTime-startAnayticsInsertTime)/1000)+"seconds."); - if (height % 60 == 1){ - calculateVPDist(analyticsData, blockData) - } + // calculate voting power distribution every 60 blocks ~ 5mins - let startVUpTime = new Date(); - if (bulkValidators.length > 0){ - console.log("############ Update validators ############"); - bulkValidators.execute((err, result) => { - if (err){ - console.log("Error while bulk insert validators: %o",err); - } - if (result){ - bulkUpdateLastSeen.execute((err, result) => { - if (err){ - console.log("Error while bulk update validator last seen: %o",err); - } - if (result){ - } - }) - } - }); - } + if (height % 60 == 1){ + calculateVPDist(analyticsData, blockData) + } - let endVUpTime = new Date(); - console.log("Validator update time: "+((endVUpTime-startVUpTime)/1000)+"seconds."); + let startVUpTime = new Date(); + if (bulkValidators.length > 0){ + console.log("############ Update validators ############"); + bulkValidators.execute((err, result) => { + if (err){ + console.log("Error while bulk insert validators: %o",err); + } + if (result){ + bulkUpdateLastSeen.execute((err, result) => { + if (err){ + console.log("Error while bulk update validator last seen: %o",err); + } + if (result){ + } + }) + } + }); + } - let startVRTime = new Date(); - if (bulkValidatorRecords.length > 0){ - bulkValidatorRecords.execute((err) => { - if (err){ - console.log(err); - } - }); - } + let endVUpTime = new Date(); + console.log("Validator update time: "+((endVUpTime-startVUpTime)/1000)+"seconds."); - let endVRTime = new Date(); - console.log("Validator records update time: "+((endVRTime-startVRTime)/1000)+"seconds."); + let startVRTime = new Date(); + if (bulkValidatorRecords.length > 0){ + bulkValidatorRecords.execute((err) => { + if (err){ + console.log(err); + } + }); + } - if (bulkVPHistory.length > 0){ - bulkVPHistory.execute((err) => { - if (err){ - console.log(err); - } - }); - } + let endVRTime = new Date(); + console.log("Validator records update time: "+((endVRTime-startVRTime)/1000)+"seconds."); + + if (bulkVPHistory.length > 0){ + bulkVPHistory.execute((err) => { + if (err){ + console.log(err); + } + }); + } // } diff --git a/imports/ui/components/AccountTooltip.jsx b/imports/ui/components/AccountTooltip.jsx index 84adaea04..1fc84da1b 100644 --- a/imports/ui/components/AccountTooltip.jsx +++ b/imports/ui/components/AccountTooltip.jsx @@ -55,10 +55,10 @@ export default class AccountTooltip extends Account{ -

    {moniker}

    +

    {moniker}

    -
    - + + power {validator.tokens?numbro(Math.floor(validator.tokens/Meteor.settings.public.powerReduction)).format('0,0'):0} @@ -72,20 +72,20 @@ export default class AccountTooltip extends Account{ numbro(validator.commission.commission_rates.rate).format('0.00%') : numbro(validator.commission.rate).format('0.00%') } :null} {(!isActive)? - access_time - {validator.lastSeen?: - (validator.unbonding_time?:null)} + access_time + {validator.lastSeen?: + (validator.unbonding_time?:null)} :null} {(!isActive)? -
    {(validator.status == 1)?Unbonded:Unbonding} - {validator.jailed?Jailed:''} + {(validator.status == 1)?Unbonded:Unbonding} + {validator.jailed?Jailed:''}:null} {(isActive)? - flash_on{validator.uptime?numbro(validator.uptime/100).format('0%'):0} - + flash_on{validator.uptime?numbro(validator.uptime/100).format('0%'):0} + :null} - - + + } diff --git a/imports/ui/components/PowerHistory.jsx b/imports/ui/components/PowerHistory.jsx index b97656a05..735cf6255 100644 --- a/imports/ui/components/PowerHistory.jsx +++ b/imports/ui/components/PowerHistory.jsx @@ -21,7 +21,6 @@ export default class PowerHistory extends React.Component { // console.log(err); } if (result){ - console.log(result); let self = this; this.setState({ tx: result.map((msg, i) => diff --git a/imports/ui/validators/Validator.jsx b/imports/ui/validators/Validator.jsx index c3e15bce0..426746b0b 100644 --- a/imports/ui/validators/Validator.jsx +++ b/imports/ui/validators/Validator.jsx @@ -101,8 +101,8 @@ export default class Validator extends Component{ } if (this.props.validator.commission){ - let update_time = this.props.validator.commission.update_time; - if (update_time == Meteor.settings.public.genesisTime){ + let updateTime = this.props.validator.commission.update_time; + if (updateTime == Meteor.settings.public.genesisTime){ this.setState({ update_time: "Never changed" }); @@ -114,20 +114,20 @@ export default class Validator extends Component{ } else{ if (result){ - if (result == update_time){ + if (result == updateTime){ this.setState({ update_time: "Never changed" }); } else{ this.setState({ - update_time: "Updated "+moment(update_time).fromNow() + update_time: "Updated "+moment(updateTime).fromNow() }); } } else{ this.setState({ - update_time: "Updated "+moment(update_time).fromNow() + update_time: "Updated "+moment(updateTime).fromNow() }); } } From 4da3bd184f792c3e6b7b4bf18d22b7ed6eb9df3f Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 10 Mar 2021 06:07:31 +0000 Subject: [PATCH 116/127] update proposal status --- imports/api/proposals/server/methods.js | 5 +++-- imports/ui/proposals/List.jsx | 3 ++- imports/ui/proposals/Proposal.jsx | 3 ++- package-lock.json | 30 +++++++++++++++++-------- package.json | 1 + 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/imports/api/proposals/server/methods.js b/imports/api/proposals/server/methods.js index bf7378fa4..3364c8f39 100644 --- a/imports/api/proposals/server/methods.js +++ b/imports/api/proposals/server/methods.js @@ -32,6 +32,7 @@ Meteor.methods({ for (let i in proposals){ let proposal = proposals[i]; proposal.proposalId = parseInt(proposal.proposal_id); + proposalIds.push(proposal.proposalId); if (proposal.proposalId > 0 && !finishedProposalIds.has(proposal.proposalId)) { try{ // url = API + '/cosmos/gov/v1beta1/proposals/'+proposal.proposalId+'/proposer'; @@ -46,13 +47,13 @@ Meteor.methods({ } catch(e){ bulkProposals.find({proposalId: proposal.proposalId}).upsert().updateOne({$set:proposal}); - proposalIds.push(proposal.proposalId); + // proposalIds.push(proposal.proposalId); console.log(url); console.log(e.response.content); } } } - bulkProposals.find({proposalId:{$nin:proposalIds}, status:{$nin:["PROPOSAL_STATUS_PASSED", "PROPOSAL_STATUS_REJECTED", "PROPOSAL_STATUS_REMOVED"]}}) + bulkProposals.find({proposalId:{$nin:proposalIds}, status:{$nin:["PROPOSAL_STATUS_VOTING_PERIOD", "PROPOSAL_STATUS_PASSED", "PROPOSAL_STATUS_REJECTED", "PROPOSAL_STATUS_REMOVED"]}}) .update({$set: {"status": "PROPOSAL_STATUS_REMOVED"}}); bulkProposals.execute(); } diff --git a/imports/ui/proposals/List.jsx b/imports/ui/proposals/List.jsx index 808c0bebb..0e955fb85 100644 --- a/imports/ui/proposals/List.jsx +++ b/imports/ui/proposals/List.jsx @@ -7,6 +7,7 @@ import i18n from 'meteor/universe:i18n'; import Coin from '/both/utils/coins.js' import TimeStamp from '../components/TimeStamp.jsx'; import { SubmitProposalButton } from '../ledger/LedgerActions.jsx'; +import voca from 'voca'; const T = i18n.createComponent(); @@ -15,7 +16,7 @@ const ProposalRow = (props) => { return - + proposals.proposalStatus - {(this.props.proposal.status)?this.props.proposal.status.substr(16):''} + {(this.props.proposal.status)?voca.chain(this.props.proposal.status.substr(16)).replace('_', ' ').titleCase().value():''} proposals.deposit diff --git a/package-lock.json b/package-lock.json index aef5ce7e3..6c6e5b0c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2127,17 +2127,24 @@ } }, "elliptic": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", - "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", + "bn.js": "^4.11.9", + "brorand": "^1.1.0", "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "emoji-regex": { @@ -6430,6 +6437,11 @@ "velocity-animate": "^1.4.0" } }, + "voca": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/voca/-/voca-1.4.0.tgz", + "integrity": "sha512-8Xz4H3vhYRGbFupLtl6dHwMx0ojUcjt0HYkqZ9oBCfipd/5mD7Md58m2/dq7uPuZU/0T3Gb1m66KS9jn+I+14Q==" + }, "warning": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", diff --git a/package.json b/package.json index 3b536284f..6d344fdb2 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "tendermint": "^4.0.8", "tooltip.js": "^1.3.3", "velocity-react": "^1.4.3", + "voca": "^1.4.0", "ws": "^6.2.1" }, "devDependencies": { From 1697180f454aed2bde4e73e56d115c8fb1de8b47 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 10 Mar 2021 13:10:07 +0000 Subject: [PATCH 117/127] fix ledger tx skeleton --- imports/api/accounts/server/methods.js | 33 +++++++++++++++++--------- imports/api/ledger/server/methods.js | 12 +++++++++- imports/ui/ledger/LedgerActions.jsx | 26 +++++++++++--------- imports/ui/ledger/ledger.js | 4 ++-- 4 files changed, 50 insertions(+), 25 deletions(-) diff --git a/imports/api/accounts/server/methods.js b/imports/api/accounts/server/methods.js index fe9ac613f..d623cf25e 100644 --- a/imports/api/accounts/server/methods.js +++ b/imports/api/accounts/server/methods.js @@ -17,20 +17,31 @@ const fetchFromUrl = (url) => { Meteor.methods({ 'accounts.getAccountDetail': function(address){ this.unblock(); - let url = API + '/cosmos/auth/v1beta1/accounts/'+ address; + let url = API + '/auth/accounts/'+ address; try{ let available = HTTP.get(url); if (available.statusCode == 200){ - return JSON.parse(available.content).account - // let response = JSON.parse(available.content).result; - // let account; - // if (response.type === 'cosmos-sdk/Account') - // account = response.value; - // else if (response.type === 'cosmos-sdk/DelayedVestingAccount' || response.type === 'cosmos-sdk/ContinuousVestingAccount') - // account = response.value.BaseVestingAccount.BaseAccount - // if (account && account.account_number != null) - // return account - // return null + // return JSON.parse(available.content).account + let response = JSON.parse(available.content).result; + let account; + if ((response.type === 'cosmos-sdk/Account') || (response.type === 'cosmos-sdk/BaseAccount')) + account = response.value; + else if (response.type === 'cosmos-sdk/DelayedVestingAccount' || response.type === 'cosmos-sdk/ContinuousVestingAccount') + account = response.value.BaseVestingAccount.BaseAccount + + try{ + url = API + '/bank/balances/' + address; + response = HTTP.get(url); + let balances = JSON.parse(response.content).result; + account.coins = balances; + + if (account && account.account_number != null) + return account + return null + } + catch (e){ + return null; + } } } catch (e){ diff --git a/imports/api/ledger/server/methods.js b/imports/api/ledger/server/methods.js index 79bdc9067..48e4099fc 100644 --- a/imports/api/ledger/server/methods.js +++ b/imports/api/ledger/server/methods.js @@ -1,4 +1,5 @@ import { HTTP } from 'meteor/http'; +import { Validators } from '../../validators/validators'; Meteor.methods({ 'transaction.submit': function(txInfo) { @@ -35,7 +36,7 @@ Meteor.methods({ return JSON.parse(response.content); } }, - 'transaction.simulate': function(txMsg, from, path, adjustment='1.2') { + 'transaction.simulate': function(txMsg, from, accountNumber, sequence, path, adjustment='1.2') { this.unblock(); const url = `${API}/${path}`; data = {...txMsg, @@ -43,12 +44,21 @@ Meteor.methods({ "from": from, "chain_id": Meteor.settings.public.chainId, "gas_adjustment": adjustment, + "account_number": accountNumber, + "sequence": sequence, "simulate": true } }; + console.log(url); + console.log(data); let response = HTTP.post(url, {data}); if (response.statusCode == 200) { return JSON.parse(response.content).gas_estimate; } }, + 'isValidator': function(address){ + this.unblock(); + let validator = Validators.findOne({delegator_address:address}) + return validator; + } }) \ No newline at end of file diff --git a/imports/ui/ledger/LedgerActions.jsx b/imports/ui/ledger/LedgerActions.jsx index 3c78405c3..8452f37b9 100644 --- a/imports/ui/ledger/LedgerActions.jsx +++ b/imports/ui/ledger/LedgerActions.jsx @@ -128,7 +128,7 @@ const Amount = (props) => { const Fee = (props) => { - return as fee + return as fee } const isActiveValidator = (validator) => { @@ -220,6 +220,7 @@ class LedgerButton extends Component { } setStateOnError = (action, errorMsg, state={}) => { + console.log(action); this.setState({ loading: false, [action]: false, @@ -337,7 +338,7 @@ class LedgerButton extends Component { sequence: this.state.currentUser.sequence, denom: Coin.StakingCoin.denom, pk: this.state.pubKey, - path: [44, 118, 0, 0, 0], + path: [44, Meteor.settings.public.ledger.coinType, 0, 0, 0], memo: this.state.memo } } @@ -417,9 +418,9 @@ class LedgerButton extends Component { runSimulatation = (txMsg, simulateBody) => { let gasAdjustment = TypeMeta[this.state.actionType].gasAdjustment || DEFAULT_GAS_ADJUSTMENT; - Meteor.call('transaction.simulate', simulateBody, this.state.user, this.getPath(), gasAdjustment, (err, res) =>{ + Meteor.call('transaction.simulate', simulateBody, this.state.user, this.state.currentUser.accountNumber, this.state.currentUser.sequence, this.getPath(), gasAdjustment, (err, res) =>{ if (res){ - Ledger.applyGas(txMsg, res, Meteor.settings.public.gasPrice, Coin.StakingCoin.denom); + Ledger.applyGas(txMsg, res, Meteor.settings.public.ledger.gasPrice, Coin.StakingCoin.denom); this.setStateOnSuccess('simulating', { gasEstimate: res, activeTab: '3', @@ -457,6 +458,7 @@ class LedgerButton extends Component { } }, (err) => this.setStateOnError('signing', err.message)) } catch (e) { + console.log('everything sign'); this.setStateOnError('signing', e.message) } } @@ -758,13 +760,15 @@ class WithdrawButton extends LedgerButton { createMessage = (callback) => { Meteor.call('transaction.execute', {from: this.state.user}, this.getPath(), (err, res) =>{ if (res){ - if (this.props.address) { - res.value.msg.push({ - type: 'cosmos-sdk/MsgWithdrawValidatorCommission', - value: { validator_address: this.props.address } - }) - } - callback(res, res) + Meteor.call('isValidator', this.state.user, (error, result) => { + if (result && result.address){ + res.value.msg.push({ + type: 'cosmos-sdk/MsgWithdrawValidatorCommission', + value: { validator_address: result.address } + }) + } + callback(res, res) + }) } else { this.setState({ diff --git a/imports/ui/ledger/ledger.js b/imports/ui/ledger/ledger.js index 07746d9b3..0f1723090 100644 --- a/imports/ui/ledger/ledger.js +++ b/imports/ui/ledger/ledger.js @@ -209,8 +209,8 @@ export class Ledger { account_number: txContext.accountNumber.toString(), chain_id: txContext.chainId, fee: tx.value.fee, - memo: tx.body.memo, - msgs: tx.body.messages, + memo: tx.value.memo, + msgs: tx.value.msg, sequence: txContext.sequence.toString(), }; From 7988c9a6333f3758960deaea11be37607d7b5895 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 10 Mar 2021 13:13:08 +0000 Subject: [PATCH 118/127] fixed ledger button validator proptypes --- imports/ui/ledger/LedgerActions.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/ui/ledger/LedgerActions.jsx b/imports/ui/ledger/LedgerActions.jsx index 8452f37b9..bd5ebb372 100644 --- a/imports/ui/ledger/LedgerActions.jsx +++ b/imports/ui/ledger/LedgerActions.jsx @@ -1083,7 +1083,7 @@ DelegationButtons.propTypes = { jailed: PropTypes.bool, operatorAddress: PropTypes.string, profile_url: PropTypes.string, - status: PropTypes.number + status: PropTypes.string }), history: PropTypes.shape({ length:PropTypes.number, From 44cd8d04808e56dd9d56b37f5202e7cf3b0edb0e Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 10 Mar 2021 13:14:38 +0000 Subject: [PATCH 119/127] fixed unmatched bonding status in ledger buttons --- imports/ui/ledger/LedgerActions.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/ui/ledger/LedgerActions.jsx b/imports/ui/ledger/LedgerActions.jsx index bd5ebb372..53a74731b 100644 --- a/imports/ui/ledger/LedgerActions.jsx +++ b/imports/ui/ledger/LedgerActions.jsx @@ -132,7 +132,7 @@ const Fee = (props) => { } const isActiveValidator = (validator) => { - return !validator.jailed && validator.status == 3; + return !validator.jailed && validator.status == 'BOND_STATUS_BONDED'; } const isBetween = (value, min, max) => { From c59b39d96803af378db1f7c585e4e8b74d9014c1 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 10 Mar 2021 13:15:12 +0000 Subject: [PATCH 120/127] update validator bond status --- imports/ui/ledger/LedgerActions.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/ui/ledger/LedgerActions.jsx b/imports/ui/ledger/LedgerActions.jsx index 53a74731b..129a4c94f 100644 --- a/imports/ui/ledger/LedgerActions.jsx +++ b/imports/ui/ledger/LedgerActions.jsx @@ -526,7 +526,7 @@ class LedgerButton extends Component { getValidatorOptions = () => { let activeValidators = Validators.find( - {"jailed": false, "status": 3}, + {"jailed": false, "status": 'BOND_STATUS_BONDED'}, {"sort":{"description.moniker":1}} ); let redelegations = this.state.redelegations || {}; From 674fbc19cd2a208a5a32a0b7f074b53ec0663176 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 10 Mar 2021 13:49:51 +0000 Subject: [PATCH 121/127] fixed delegate message --- imports/api/chain/server/methods.js | 55 ++++++++++++++++++++- imports/api/ledger/server/methods.js | 1 + imports/ui/ledger/LedgerActions.jsx | 12 ++--- imports/ui/ledger/ledger.js | 6 +-- imports/ui/validators/ValidatorContainer.js | 4 +- 5 files changed, 66 insertions(+), 12 deletions(-) diff --git a/imports/api/chain/server/methods.js b/imports/api/chain/server/methods.js index 6bbe7b92d..ccf171bdb 100644 --- a/imports/api/chain/server/methods.js +++ b/imports/api/chain/server/methods.js @@ -81,8 +81,16 @@ Meteor.methods({ } chain.activeVotingPower = activeVP; + // update staking params + try { + url = API + '/cosmos/staking/v1beta1/params'; + response = HTTP.get(url); + chain.staking = JSON.parse(response.content); + } + catch(e){ + console.log(e); + } - Chain.update({chainId:chain.chainId}, {$set:chain}, {upsert: true}); // Get chain states if (parseInt(chain.latestBlockHeight) > 0){ let chainStates = {}; @@ -111,6 +119,17 @@ Meteor.methods({ catch(e){ console.log(e); } + + // update bank params + try { + url = API + '/cosmos/bank/v1beta1/params'; + response = HTTP.get(url); + chain.bank = JSON.parse(response.content); + } + catch(e){ + console.log(e); + } + } if (Meteor.settings.public.modules.distribution){ @@ -131,6 +150,16 @@ Meteor.methods({ catch (e){ console.log(e) } + + // update distribution params + try { + url = API + '/cosmos/distribution/v1beta1/params'; + response = HTTP.get(url); + chain.distribution = JSON.parse(response.content); + } + catch(e){ + console.log(e); + } } if (Meteor.settings.public.modules.minting){ @@ -160,12 +189,36 @@ Meteor.methods({ catch(e){ console.log(e); } + + // update mint params + try { + url = API + '/cosmos/mint/v1beta1/params'; + response = HTTP.get(url); + chain.mint = JSON.parse(response.content); + } + catch(e){ + console.log(e); + } + } + + if (Meteor.settings.public.modules.gov){ + // update mint params + try { + url = API + '/cosmos/gov/v1beta1/params'; + response = HTTP.get(url); + chain.gov = JSON.parse(response.content); + } + catch(e){ + console.log(e); + } } } ChainStates.insert(chainStates); } + Chain.update({chainId:chain.chainId}, {$set:chain}, {upsert: true}); + // chain.totalVotingPower = totalVP; // validators = Validators.find({}).fetch(); diff --git a/imports/api/ledger/server/methods.js b/imports/api/ledger/server/methods.js index 48e4099fc..1f3c40b63 100644 --- a/imports/api/ledger/server/methods.js +++ b/imports/api/ledger/server/methods.js @@ -39,6 +39,7 @@ Meteor.methods({ 'transaction.simulate': function(txMsg, from, accountNumber, sequence, path, adjustment='1.2') { this.unblock(); const url = `${API}/${path}`; + console.log(txMsg); data = {...txMsg, "base_req": { "from": from, diff --git a/imports/ui/ledger/LedgerActions.jsx b/imports/ui/ledger/LedgerActions.jsx index 129a4c94f..e2c737039 100644 --- a/imports/ui/ledger/LedgerActions.jsx +++ b/imports/ui/ledger/LedgerActions.jsx @@ -1,10 +1,8 @@ /* eslint-disable react/no-unused-prop-types */ import qs from 'querystring'; -import Cosmos from "@lunie/cosmos-js" import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { Button, Spinner, TabContent, TabPane, Row, Col, Modal, ModalHeader, - Form, ModalBody, ModalFooter, InputGroup, InputGroupAddon, Input, Progress, +import { Button, Spinner, TabContent, TabPane, Row, Col, Modal, ModalBody, ModalFooter, InputGroup, InputGroupAddon, Input, Progress, UncontrolledTooltip, UncontrolledDropdown, DropdownToggle, DropdownMenu, DropdownItem} from 'reactstrap'; import { Ledger, DEFAULT_MEMO } from './ledger.js'; import { Validators } from '/imports/api/validators/validators.js'; @@ -349,20 +347,20 @@ class LedgerButton extends Component { case Types.DELEGATE: txMsg = Ledger.createDelegate( this.getTxContext(), - this.props.validator.operatorAddress, + this.props.validator.operator_address, this.state.delegateAmount.amount) break; case Types.REDELEGATE: txMsg = Ledger.createRedelegate( this.getTxContext(), - this.props.validator.operatorAddress, - this.state.targetValidator.operatorAddress, + this.props.validator.operator_address, + this.state.targetValidator.operator_address, this.state.delegateAmount.amount) break; case Types.UNDELEGATE: txMsg = Ledger.createUndelegate( this.getTxContext(), - this.props.validator.operatorAddress, + this.props.validator.operator_address, this.state.delegateAmount.amount); break; case Types.SEND: diff --git a/imports/ui/ledger/ledger.js b/imports/ui/ledger/ledger.js index 0f1723090..6f7375c5f 100644 --- a/imports/ui/ledger/ledger.js +++ b/imports/ui/ledger/ledger.js @@ -316,7 +316,7 @@ export class Ledger { amount: uatomAmount.toString(), denom: txContext.denom, }, - delegatorAddress: txContext.bech32, + delegator_address: txContext.bech32, validator_address: validatorBech32, }, }; @@ -338,7 +338,7 @@ export class Ledger { amount: uatomAmount.toString(), denom: txContext.denom, }, - delegatorAddress: txContext.bech32, + delegator_address: txContext.bech32, validator_address: validatorBech32, }, }; @@ -361,7 +361,7 @@ export class Ledger { amount: uatomAmount.toString(), denom: txContext.denom, }, - delegatorAddress: txContext.bech32, + delegator_address: txContext.bech32, validator_dst_address: validatorDestBech32, validator_src_address: validatorSourceBech32, }, diff --git a/imports/ui/validators/ValidatorContainer.js b/imports/ui/validators/ValidatorContainer.js index 74b172ff8..f2b7e7e5c 100644 --- a/imports/ui/validators/ValidatorContainer.js +++ b/imports/ui/validators/ValidatorContainer.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; import { withTracker } from 'meteor/react-meteor-data'; import { Validators } from '/imports/api/validators/validators.js'; import { ValidatorRecords } from '/imports/api/records/records.js'; @@ -21,6 +22,7 @@ export default ValidatorDetailsContainer = withTracker((props) => { let options = {address:props.address}; let chainStatus; + let stakingParams; let validatorExist; let validator; let validatorRecords; @@ -53,6 +55,6 @@ export default ValidatorDetailsContainer = withTracker((props) => { validatorExist, validator: validatorExist ? validator : {}, records: validatorExist ? validatorRecords : {}, - chainStatus: validatorExist ? chainStatus : {} + chainStatus: validatorExist ? chainStatus : {}, }; })(Validator); From 9c8d2e9c4b27d0f421287527a0b3f02f387d0aef Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 10 Mar 2021 15:21:01 +0000 Subject: [PATCH 122/127] fixed ledger redelegation --- imports/api/accounts/server/methods.js | 13 ++++++------ imports/ui/ledger/LedgerActions.jsx | 28 +++++++++++++------------- imports/ui/validators/Validator.jsx | 2 +- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/imports/api/accounts/server/methods.js b/imports/api/accounts/server/methods.js index d623cf25e..b80f25d48 100644 --- a/imports/api/accounts/server/methods.js +++ b/imports/api/accounts/server/methods.js @@ -135,15 +135,16 @@ Meteor.methods({ }, 'accounts.getDelegation'(address, validator){ this.unblock(); - let url = `/cosmos/staking/v1beta1/delegators/${address}/delegations/${validator}`; + let url = `/cosmos/staking/v1beta1/validators/${validator}/delegations/${address}`; let delegations = fetchFromUrl(url); - delegations = delegations && delegations.data.result; - if (delegations && delegations.shares) - delegations.shares = parseFloat(delegations.shares); + console.log(delegations); + delegations = delegations && delegations.data.delegation_response; + if (delegations && delegations.delegation.shares) + delegations.delegation.shares = parseFloat(delegations.delegation.shares); url = `/cosmos/staking/v1beta1/delegators/${address}/redelegations?dst_validator_addr=${validator}`; let relegations = fetchFromUrl(url); - relegations = relegations && relegations.data.result; + relegations = relegations && relegations.data.redelegation_responses; let completionTime; if (relegations) { relegations.forEach((relegation) => { @@ -155,7 +156,7 @@ Meteor.methods({ delegations.redelegationCompletionTime = completionTime; } - url = `/cosmos/staking/v1beta1/delegators/${address}/unbonding_delegations/${validator}`; + url = `/cosmos/staking/v1beta1/validators/${validator}/delegations/${address}/unbonding_delegation`; let undelegations = fetchFromUrl(url); undelegations = undelegations && undelegations.data.result; if (undelegations) { diff --git a/imports/ui/ledger/LedgerActions.jsx b/imports/ui/ledger/LedgerActions.jsx index e2c737039..162258f69 100644 --- a/imports/ui/ledger/LedgerActions.jsx +++ b/imports/ui/ledger/LedgerActions.jsx @@ -269,7 +269,7 @@ class LedgerButton extends Component { }); if (this.state.actionType === Types.REDELEGATE) { - Meteor.call('accounts.getAllRedelegations', this.state.user, this.props.validator.operatorAddress, (error, result) => { + Meteor.call('accounts.getAllRedelegations', this.state.user, this.props.validator.operator_address, (error, result) => { try{ if (result) this.setStateOnSuccess('loadingRedelegations', {redelegations: result}) @@ -467,7 +467,7 @@ class LedgerButton extends Component { let value; switch (dataset.type) { case 'validator': - value = { moniker: dataset.moniker, operatorAddress: dataset.address} + value = { moniker: dataset.moniker, operator_address: dataset.address} break; case 'coin': value = new Coin(target.value, target.nextSibling.innerText) @@ -537,14 +537,14 @@ class LedgerButton extends Component { {activeValidators.map((validator, i) => { if (validator.address === this.props.validator.address) return null - let redelegation = redelegations[validator.operatorAddress] + let redelegation = redelegations[validator.operator_address] let disabled = redelegation && (redelegation.count >= maxEntries); let completionTime = disabled?:null; let id = `validator-option${i}` return
    + data-moniker={validator.description.moniker} data-address={validator.operator_address}>
    {validator.description.moniker}@@ -621,8 +621,8 @@ class DelegationButtons extends LedgerButton { } getDelegatedToken = (currentDelegation) => { - if (currentDelegation && currentDelegation.shares && currentDelegation.tokenPerShare) { - return new Coin(currentDelegation.shares * currentDelegation.tokenPerShare); + if (currentDelegation && currentDelegation.delegation.shares && currentDelegation.tokenPerShare) { + return new Coin(currentDelegation.delegation.shares * currentDelegation.tokenPerShare); } return null } @@ -644,8 +644,8 @@ class DelegationButtons extends LedgerButton { if (this.state.actionType === Types.REDELEGATE) isValid = isValid || (this.state.targetValidator && - this.state.targetValidator.operatorAddress && - isValidatorAddress(this.state.targetValidator.operatorAddress)) + this.state.targetValidator.operator_address && + isValidatorAddress(this.state.targetValidator.operator_address)) return isValid } @@ -657,7 +657,7 @@ class DelegationButtons extends LedgerButton { let availableStatement; let moniker = this.props.validator.description && this.props.validator.description.moniker; - let validatorAddress = this.props.validator.operatorAddress; + let validatorAddress = this.props.validator.operator_address; switch (this.state.actionType) { case Types.DELEGATE: action = 'Delegate to'; @@ -691,7 +691,7 @@ class DelegationButtons extends LedgerButton { } getWarningMessage = () => { - let duration = this.props.stakingParams.unbonding_time; + let duration = parseInt(this.props.stakingParams.unbonding_time.substr(0, this.props.stakingParams.unbonding_time.length-1)); let maxEntries = this.props.stakingParams.max_entries; let warning = TypeMeta[this.state.actionType].warning; return warning && warning(duration, maxEntries); @@ -700,11 +700,11 @@ class DelegationButtons extends LedgerButton { getConfirmationMessage = () => { switch (this.state.actionType) { case Types.DELEGATE: - return You are going to delegate to with . + return You are going to delegate to with . case Types.REDELEGATE: - return You are going to redelegate from to with . + return You are going to redelegate from to with . case Types.UNDELEGATE: - return You are going to undelegate from with . + return You are going to undelegate from with . } } @@ -1079,7 +1079,7 @@ DelegationButtons.propTypes = { details: PropTypes.string, }), jailed: PropTypes.bool, - operatorAddress: PropTypes.string, + operator_address: PropTypes.string, profile_url: PropTypes.string, status: PropTypes.string }), diff --git a/imports/ui/validators/Validator.jsx b/imports/ui/validators/Validator.jsx index 426746b0b..e8ff83885 100644 --- a/imports/ui/validators/Validator.jsx +++ b/imports/ui/validators/Validator.jsx @@ -56,7 +56,7 @@ export default class Validator extends Component{ getUserDelegations() { if (this.state.user && this.props.validator && this.props.validator.address) { Meteor.call('accounts.getDelegation', this.state.user, this.props.validator.operator_address, (err, res) => { - if (res && res.shares > 0) { + if (res && res.delegation.shares > 0) { res.tokenPerShare = this.props.validator.tokens/this.props.validator.delegator_shares this.setState({ currentUserDelegation: res From 4c62ec3075a58d90f05485aba1d6bfbcd71c6d19 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 10 Mar 2021 15:25:42 +0000 Subject: [PATCH 123/127] update version --- imports/ui/validators/Validator.jsx | 2 +- private/version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/ui/validators/Validator.jsx b/imports/ui/validators/Validator.jsx index e8ff83885..9b1f961e6 100644 --- a/imports/ui/validators/Validator.jsx +++ b/imports/ui/validators/Validator.jsx @@ -253,7 +253,7 @@ export default class Validator extends Component{ validators.delegatorShares{numbro(this.props.validator.delegator_shares).format('0,0.00')} {(this.state.currentUserDelegation)?validators.userDelegateShares:''} - {(this.state.currentUserDelegation)?{numbro(this.state.currentUserDelegation.shares).format('0,0.00')}:''} + {(this.state.currentUserDelegation)?{numbro(this.state.currentUserDelegation.delegation.shares).format('0,0.00')}:''} validators.tokens{numbro(this.props.validator.tokens).format('0,0.00')} {(this.props.validator.jailed)?diff --git a/private/version b/private/version index 022e091a7..058ac2acd 100644 --- a/private/version +++ b/private/version @@ -1 +1 @@ -v0.41.x-6 \ No newline at end of file +v0.41.x-7 \ No newline at end of file From 190e0cf60b49ead1f7e1158c6bea9f48b67f804c Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Wed, 10 Mar 2021 17:39:44 +0000 Subject: [PATCH 124/127] get correct votes and tally results --- imports/api/proposals/server/methods.js | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/imports/api/proposals/server/methods.js b/imports/api/proposals/server/methods.js index 3364c8f39..d2603c994 100644 --- a/imports/api/proposals/server/methods.js +++ b/imports/api/proposals/server/methods.js @@ -74,25 +74,25 @@ Meteor.methods({ let url = ""; try{ // get proposal deposits - url = API + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/deposits'; + url = API + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/deposits?pagination.limit=2000&pagination.count_total=true'; let response = HTTP.get(url); let proposal = {proposalId: proposals[i].proposalId}; if (response.statusCode == 200){ - let deposits = JSON.parse(response.content).result; + let deposits = JSON.parse(response.content).deposits; proposal.deposits = deposits; } - url = API + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/votes'; + url = API + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/votes?pagination.limit=2000&pagination.count_total=true'; response = HTTP.get(url); if (response.statusCode == 200){ - let votes = JSON.parse(response.content).result; + let votes = JSON.parse(response.content).votes; proposal.votes = getVoteDetail(votes); } url = API + '/cosmos/gov/v1beta1/proposals/'+proposals[i].proposalId+'/tally'; response = HTTP.get(url); if (response.statusCode == 200){ - let tally = JSON.parse(response.content).result; + let tally = JSON.parse(response.content).tally; proposal.tally = tally; } @@ -118,41 +118,41 @@ const getVoteDetail = (votes) => { let voters = votes.map((vote) => vote.voter); let votingPowerMap = {}; let validatorAddressMap = {}; - Validators.find({delegatorAddress: {$in: voters}}).forEach((validator) => { - votingPowerMap[validator.delegatorAddress] = { + Validators.find({delegator_address: {$in: voters}}).forEach((validator) => { + votingPowerMap[validator.delegator_address] = { moniker: validator.description.moniker, address: validator.address, tokens: parseFloat(validator.tokens), - delegatorShares: parseFloat(validator.delegatorShares), - deductedShares: parseFloat(validator.delegatorShares) + delegatorShares: parseFloat(validator.delegator_shares), + deductedShares: parseFloat(validator.delegator_shares) } - validatorAddressMap[validator.operatorAddress] = validator.delegatorAddress; + validatorAddressMap[validator.operator_address] = validator.delegator_address; }); voters.forEach((voter) => { if (!votingPowerMap[voter]) { // voter is not a validator - let url = `${API}/cosmos/staking/v1beta1/delegators/${voter}/delegations`; + let url = `${API}/cosmos/staking/v1beta1/delegations/${voter}`; let delegations; let votingPower = 0; try{ let response = HTTP.get(url); if (response.statusCode == 200){ - delegations = JSON.parse(response.content).result; + delegations = JSON.parse(response.content).delegations_response; if (delegations && delegations.length > 0) { delegations.forEach((delegation) => { - let shares = parseFloat(delegation.shares); - if (validatorAddressMap[delegation.validator_address]) { + let shares = parseFloat(delegation.delegation.shares); + if (validatorAddressMap[delegation.delegation.validator_address]) { // deduct delegated shareds from validator if a delegator votes let validator = votingPowerMap[validatorAddressMap[delegation.validator_address]]; validator.deductedShares -= shares; if (validator.delegatorShares != 0){ // avoiding division by zero - votingPower += (shares/validator.delegatorShares) * validator.tokens; + votingPower += (shares/validator.delegatorShares) * validator.tokens / Meteor.settings.public.powerReduction; } } else { let validator = Validators.findOne({operatorAddress: delegation.validator_address}); if (validator && validator.delegatorShares != 0){ // avoiding division by zero - votingPower += (shares/parseFloat(validator.delegatorShares)) * parseFloat(validator.tokens); + votingPower += (shares/parseFloat(validator.delegatorShares)) * parseFloat(validator.tokens) / Meteor.settings.public.powerReduction; } } }); @@ -171,7 +171,7 @@ const getVoteDetail = (votes) => { let votingPower = voter.votingPower; if (votingPower == undefined) { // voter is a validator - votingPower = voter.delegatorShares?((voter.deductedShares/voter.delegatorShares) * voter.tokens):0; + votingPower = voter.delegatorShares?((voter.deductedShares/voter.delegatorShares) * voter.tokens / Meteor.settings.public.powerReduction):0; } return {...vote, votingPower}; }); From 79749632429f2e41261b69b8bc0a1fc6865d175a Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Thu, 11 Mar 2021 08:08:36 +0000 Subject: [PATCH 125/127] fix gov proposal chart --- imports/api/proposals/server/methods.js | 6 ++-- imports/ui/proposals/Proposal.jsx | 44 +++++++++++++++---------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/imports/api/proposals/server/methods.js b/imports/api/proposals/server/methods.js index d2603c994..01e64f8ab 100644 --- a/imports/api/proposals/server/methods.js +++ b/imports/api/proposals/server/methods.js @@ -146,13 +146,13 @@ const getVoteDetail = (votes) => { let validator = votingPowerMap[validatorAddressMap[delegation.validator_address]]; validator.deductedShares -= shares; if (validator.delegatorShares != 0){ // avoiding division by zero - votingPower += (shares/validator.delegatorShares) * validator.tokens / Meteor.settings.public.powerReduction; + votingPower += (shares/validator.delegatorShares) * validator.tokens; } } else { let validator = Validators.findOne({operatorAddress: delegation.validator_address}); if (validator && validator.delegatorShares != 0){ // avoiding division by zero - votingPower += (shares/parseFloat(validator.delegatorShares)) * parseFloat(validator.tokens) / Meteor.settings.public.powerReduction; + votingPower += (shares/parseFloat(validator.delegatorShares)) * parseFloat(validator.tokens); } } }); @@ -171,7 +171,7 @@ const getVoteDetail = (votes) => { let votingPower = voter.votingPower; if (votingPower == undefined) { // voter is a validator - votingPower = voter.delegatorShares?((voter.deductedShares/voter.delegatorShares) * voter.tokens / Meteor.settings.public.powerReduction):0; + votingPower = voter.delegatorShares?((voter.deductedShares/voter.delegatorShares) * voter.tokens):0; } return {...vote, votingPower}; }); diff --git a/imports/ui/proposals/Proposal.jsx b/imports/ui/proposals/Proposal.jsx index ab4aded66..860d63193 100644 --- a/imports/ui/proposals/Proposal.jsx +++ b/imports/ui/proposals/Proposal.jsx @@ -41,7 +41,15 @@ export default class Proposal extends Component{ noWithVetoPercent: 0, proposalValid: false, orderDir: -1, - breakDownSelection: 'Bar' + breakDownSelection: 'Bar', + chartOptions : { + 'Bar':'Bar', + 'All':'All', + 'Yes':'VOTE_OPTION_YES', + 'Abstain':'VOTE_OPTION_ABSTAIN', + 'No': 'VOTE_OPTION_NO', + 'No With Veto':'VOTE_OPTION_NO_WITH_VETO' + } } if (Meteor.isServer){ @@ -132,14 +140,14 @@ export default class Proposal extends Component{ } populateChartData() { - const optionOrder = {'Yes': 0, 'Abstain': 1, 'No': 2, 'NoWithVeto': 3}; + const optionOrder = {'VOTE_OPTION_YES': 0, 'VOTE_OPTION_ABSTAIN': 1, 'VOTE_OPTION_NO': 2, 'VOTE_OPTION_NO_WITH_VETO': 3}; let votes = this.props.proposal.votes?this.props.proposal.votes.sort( (vote1, vote2) => vote2['votingPower'] - vote1['votingPower'] ).sort( (vote1, vote2) => optionOrder[vote1.option] - optionOrder[vote2.option]):null; let maxVotingPower = {'N/A': 1}; let totalVotingPower = {'N/A': 0}; - let votesByOptions = {'All': votes, 'Yes': [], 'Abstain': [], 'No': [], 'NoWithVeto': []}; + let votesByOptions = {'All': votes, 'VOTE_OPTION_YES': [], 'VOTE_OPTION_ABSTAIN': [], 'VOTE_OPTION_NO': [], 'VOTE_OPTION_NO_WITH_VETO': []}; let emtpyData = [{'votingPower': 1, option: 'N/A'}]; @@ -165,7 +173,7 @@ export default class Proposal extends Component{ let scales = [{ scaleId: 'colorScale', type: 'Color', - domain: ['Yes', 'Abstain', 'No', 'NoWithVeto', 'N/A'], + domain: ['VOTE_OPTION_YES', 'VOTE_OPTION_ABSTAIN', 'VOTE_OPTION_NO', 'VOTE_OPTION_NO_WITH_VETO', 'N/A'], range: ['#4CAF50', '#ff9800', '#e51c23', '#9C27B0', '#BDBDBD'] }]; let isDataEmtpy = votesByOptions[this.state.breakDownSelection] && votesByOptions[this.state.breakDownSelection].length==0; @@ -251,7 +259,7 @@ export default class Proposal extends Component{ power - {(vote.votingPower!==undefined)?numbro(vote.votingPower).format('0,0.00'):""} + {(vote.votingPower!==undefined)?numbro(vote.votingPower/Meteor.settings.public.powerReduction).format('0,0.000000'):""} equalizer @@ -368,44 +376,44 @@ export default class Proposal extends Component{ Yes - {this.state.tally?numbro(this.state.tally.yes).format("0,0"):''} + {this.state.tally?numbro(parseInt(this.state.tally.yes)/Meteor.settings.public.powerReduction).format("0,0.000000"):''}this.handleClick(1,e)}>{this.state.open === 1 ? 'arrow_drop_down' : 'arrow_left'}- {this.renderTallyResultDetail(1, 'Yes')} + {this.renderTallyResultDetail(1, 'VOTE_OPTION_YES')} Abstain - {this.state.tally?numbro(this.state.tally.abstain).format("0,0"):''} + {this.state.tally?numbro(parseInt(this.state.tally.abstain)/Meteor.settings.public.powerReduction).format("0,0.000000"):''}this.handleClick(2,e)}>{this.state.open === 2 ? 'arrow_drop_down' : 'arrow_left'}- {this.renderTallyResultDetail(2, 'Abstain')} + {this.renderTallyResultDetail(2, 'VOTE_OPTION_ABSTAIN')} No - {this.state.tally?numbro(this.state.tally.no).format("0,0"):''} + {this.state.tally?numbro(parseInt(this.state.tally.no)/Meteor.settings.public.powerReduction).format("0,0.000000"):''}this.handleClick(3,e)}>{this.state.open === 3 ? 'arrow_drop_down' : 'arrow_left'}- {this.renderTallyResultDetail(3, 'No')} + {this.renderTallyResultDetail(3, 'VOTE_OPTION_NO')} No with Veto - {this.state.tally?numbro(this.state.tally.no_with_veto).format("0,0"):''} + {this.state.tally?numbro(parseInt(this.state.tally.no_with_veto)/Meteor.settings.public.powerReduction).format("0,0.000000"):''}this.handleClick(4,e)}>{this.state.open === 4 ? 'arrow_drop_down' : 'arrow_left'}- {this.renderTallyResultDetail(4, 'NoWithVeto')} + {this.renderTallyResultDetail(4, 'VOTE_OPTION_NO_WITH_VETO')} {this.state.voteStarted? @@ -431,7 +439,7 @@ export default class Proposal extends Component{ proposals.percentageVoted
    - {this.state.proposalValid?proposals.validMessage:(this.state.voteEnded)?proposals.invalidMessage:proposals.moreVoteMessage} + {this.state.proposalValid?proposals.validMessage:(this.state.voteEnded)?proposals.invalidMessage:proposals.moreVoteMessage}
    From aa3cd03791837340ae3bacb7c494c4384e144a43 Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Thu, 11 Mar 2021 08:17:26 +0000 Subject: [PATCH 126/127] remove gov buttons until --- imports/ui/proposals/List.jsx | 4 ++-- imports/ui/proposals/Proposal.jsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/imports/ui/proposals/List.jsx b/imports/ui/proposals/List.jsx index 0e955fb85..9ec46017f 100644 --- a/imports/ui/proposals/List.jsx +++ b/imports/ui/proposals/List.jsx @@ -6,7 +6,7 @@ import numbro from 'numbro'; import i18n from 'meteor/universe:i18n'; import Coin from '/both/utils/coins.js' import TimeStamp from '../components/TimeStamp.jsx'; -import { SubmitProposalButton } from '../ledger/LedgerActions.jsx'; +// import { SubmitProposalButton } from '../ledger/LedgerActions.jsx'; import voca from 'voca'; const T = i18n.createComponent(); @@ -70,7 +70,7 @@ export default class List extends Component{ else{ return (
    - {this.state.user?:null} + {/* {this.state.user?:null} */}
    {this.props.proposal.content.value.changes ? this.props.proposal.content.value.changes.map((changesItem, i) => { + {this.props.proposal.content.changes ? this.props.proposal.content.changes.map((changesItem, i) => { return
    {changesItem.subspace.charAt(0).toUpperCase() + changesItem.subspace.slice(1)}
    }): ''}
    {this.props.proposal.content.value.changes ? this.props.proposal.content.value.changes.map((changesItem, i) => { + {this.props.proposal.content.changes ? this.props.proposal.content.changes.map((changesItem, i) => { return
    {changesItem.key.match(/[A-Z]+[^A-Z]*|[^A-Z]+/g).join(" ")}
    }): ''}
    {this.props.proposal.content.value.changes ? this.props.proposal.content.value.changes.map((changesItem, i) => { + {this.props.proposal.content.changes ? this.props.proposal.content.changes.map((changesItem, i) => { return parseFloat(changesItem.value.replace(/"/g, "")) ?
    {numbro(changesItem.value.replace(/"/g, "")).format("0,000")}
    :
    {changesItem.value.replace(/"|}|{/g, "")}
    }): ''}
    {numbro(validator.voting_power).format('0,0')}{numbro(Math.floor(validator.tokens/Meteor.settings.public.powerReduction)).format('0,0')} {validator.uptime?validator.uptime.toFixed(2):0}%
    {props.proposal.proposalId} {props.proposal.content.title} {props.proposal.status.substr(16)} {voca.chain(props.proposal.status.substr(16)).replace('_', ' ').titleCase().value()} {(props.proposal.voting_start_time != "0001-01-01T00:00:00Z")?:'Not started'} {props.proposal.total_deposit?props.proposal.total_deposit.map((deposit, i) => { diff --git a/imports/ui/proposals/Proposal.jsx b/imports/ui/proposals/Proposal.jsx index 8c59ad09b..ab4aded66 100644 --- a/imports/ui/proposals/Proposal.jsx +++ b/imports/ui/proposals/Proposal.jsx @@ -15,6 +15,7 @@ import { Meteor } from 'meteor/meteor'; import Coin from '/both/utils/coins.js'; import TimeStamp from '../components/TimeStamp.jsx'; import { ProposalActionButtons } from '../ledger/LedgerActions.jsx'; +import voca from 'voca'; const T = i18n.createComponent(); @@ -316,7 +317,7 @@ export default class Proposal extends Component{
    diff --git a/imports/ui/proposals/Proposal.jsx b/imports/ui/proposals/Proposal.jsx index 860d63193..7e81fe5ff 100644 --- a/imports/ui/proposals/Proposal.jsx +++ b/imports/ui/proposals/Proposal.jsx @@ -14,7 +14,7 @@ import i18n from 'meteor/universe:i18n'; import { Meteor } from 'meteor/meteor'; import Coin from '/both/utils/coins.js'; import TimeStamp from '../components/TimeStamp.jsx'; -import { ProposalActionButtons } from '../ledger/LedgerActions.jsx'; +// import { ProposalActionButtons } from '../ledger/LedgerActions.jsx'; import voca from 'voca'; const T = i18n.createComponent(); @@ -294,7 +294,7 @@ export default class Proposal extends Component{ proposals.proposalID{this.props.proposal.proposalId} - {this.state.user?:null} + {/* {this.state.user?:null} */} proposals.proposer From df25d9ebfc2924852abc10847fad0d1fea7fda5d Mon Sep 17 00:00:00 2001 From: Kwun Yeung Date: Thu, 11 Mar 2021 11:46:21 +0000 Subject: [PATCH 127/127] update changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a014b340..de2cd7399 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## v.41.x-7 (Stargate compatible) + +* [#472] Fix missing transactions +* [#449] Migrate API to gRPC gateway +* [#360] Update validator info correctly +* [#311] Update validator status to display validators correctly +* [#321] Enable module related components which will display 0 or hide the components when the Cosmos SDK modules are not implemented +* [#485] Query proposal tally results correctly +* Update transaction skeletons for Ledger to work properly +* Config correct Ledger app and app version + ## v0.39.x-7 * [#452] Fix VP Chart not being shown