- {props.msg.value.inputs.map((data,i) =>{
- return activities.sent {data.coins.map((coin, j) =>{
- return {new Coin(coin.amount, coin.denom).toString()}
- })}
-
+ return (
+
+
+ activities.single {" "}
+ activities.happened
+
+
+ activities.senders
+
+ {props.msg.value.inputs.map((data, i) => {
+ return (
+
+ activities.sent {" "}
+ {data.coins.map((coin, j) => {
+ return (
+
+ {new Coin(coin.amount, coin.denom).toString()}
+
+ );
})}
-
-
activities.receivers
-
- {props.msg.value.outputs.map((data,i) =>{
- return activities.received {data.coins.map((coin,j) =>{
- return {new Coin(coin.amount, coin.denom).toString()}
- })}
+
+ );
+ })}
+
+
activities.receivers
+
+ {props.msg.value.outputs.map((data, i) => {
+ return (
+
+ activities.received {" "}
+ {data.coins.map((coin, j) => {
+ return (
+
+ {new Coin(coin.amount, coin.denom).toString()}
+
+ );
})}
-
-
+
+ );
+ })}
+
+
-}
+ );
+};
+function getCoinDecimals (symbol) {
+ // console.log(Meteor.settings.public.coins)
+ const coin = Meteor.settings.public.coins.find((item) => {
+ return item.denom === symbol
+ })
+ return coin.fraction.toString().length - 1
+}
export default class Activites extends Component {
- constructor(props){
- super(props);
+ constructor(props) {
+ super(props);
+ }
+
+ render() {
+ 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;
}
- render(){
- // 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){
- // bank
- case "cosmos-sdk/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":
- 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
-
- // gov
- case "cosmos-sdk/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
-
- // 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 :''}
-
- // slashing
- case "cosmos-sdk/MsgUnjail":
- return {(this.props.invalid)?activities.failedTo :''}common.fullStop
-
- // ibc
- case "cosmos-sdk/IBCTransferMsg":
- return
- case "cosmos-sdk/IBCReceiveMsg":
- return
-
- default:
- return
- }
+ switch (msg.type) {
+ // bank
+ case "cosmos-sdk/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":
+ 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
+
+ );
+
+ // gov
+ case "cosmos-sdk/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
+
+ );
+
+ // 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 : ""}
+
+
+ );
+
+ // slashing
+ case "cosmos-sdk/MsgUnjail":
+ return (
+
+ {" "}
+ {this.props.invalid ? activities.failedTo : ""}
+
+ common.fullStop
+
+ );
+
+ // ibc
+ case "cosmos-sdk/IBCTransferMsg":
+ return ;
+ case "cosmos-sdk/IBCReceiveMsg":
+ return ;
+
+ // clp
+ case "clp/Swap":
+ // console.log(getCoinDecimals(msg.value.SentAsset.symbol))
+ return (
+
+ {/*
{" "}
+
+
+ {new Coin(
+ msg.value.SentAmount,
+ msg.value.SentAsset.symbol
+ ).toString(6)}
+ {" "}
+
+
for
+
+ {new Coin(
+ msg.value.MinReceivingAmount,
+ msg.value.ReceivedAsset.symbol
+ ).toString(6)}
+ {" "}*/}
+
+
Swap
+
+ )
+
+ case "ethbridge/MsgLock":
+ return (
+
+
+ Unpeg
+
+ )
+
+ case "ethbridge/MsgBurn":
+ return (
+
+
+ Unpeg
+
+ )
+
+ case "ethbridge/MsgCreateEthBridgeClaim":
+ return (
+
+
+ Peg
+
+ )
+
+ case "clp/AddLiquidity":
+ return (
+
+
+ Add Liquidity
+
+ )
+
+ case "clp/RemoveLiquidity":
+ return (
+
+
+ Remove Liquidity
+
+ )
+
+
+
+ default:
+ return (
+
+
+ {msg.type}
+
+ );
}
+ }
}
diff --git a/imports/ui/components/Header.jsx b/imports/ui/components/Header.jsx
index 565cdf1fb..b3f2e2915 100644
--- a/imports/ui/components/Header.jsx
+++ b/imports/ui/components/Header.jsx
@@ -169,11 +169,15 @@ export default class Header extends Component {
let signedInAddress = getUser();
return (