Tweak namings
This commit is contained in:
+3
-3
@@ -4,11 +4,11 @@ import { useChains } from "../../../context/ChainsContext";
|
||||
import { printableCoin } from "../../../lib/displayHelpers";
|
||||
import HashView from "../HashView";
|
||||
|
||||
interface TxMsgRedelegateDetailsProps {
|
||||
interface TxMsgBeginRedelegateDetailsProps {
|
||||
readonly msgValue: MsgBeginRedelegate;
|
||||
}
|
||||
|
||||
const TxMsgRedelegateDetails = ({ msgValue }: TxMsgRedelegateDetailsProps) => {
|
||||
const TxMsgBeginRedelegateDetails = ({ msgValue }: TxMsgBeginRedelegateDetailsProps) => {
|
||||
const { chain } = useChains();
|
||||
assert(
|
||||
msgValue.amount,
|
||||
@@ -65,4 +65,4 @@ const TxMsgRedelegateDetails = ({ msgValue }: TxMsgRedelegateDetailsProps) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default TxMsgRedelegateDetails;
|
||||
export default TxMsgBeginRedelegateDetails;
|
||||
+5
-3
@@ -1,11 +1,13 @@
|
||||
import { MsgWithdrawDelegatorReward } from "cosmjs-types/cosmos/distribution/v1beta1/tx";
|
||||
import HashView from "../HashView";
|
||||
|
||||
interface TxMsgClaimRewardsDetailsProps {
|
||||
interface TxMsgWithdrawDelegatorRewardDetailsProps {
|
||||
readonly msgValue: MsgWithdrawDelegatorReward;
|
||||
}
|
||||
|
||||
const TxMsgClaimRewardsDetails = ({ msgValue }: TxMsgClaimRewardsDetailsProps) => (
|
||||
const TxMsgWithdrawDelegatorRewardDetails = ({
|
||||
msgValue,
|
||||
}: TxMsgWithdrawDelegatorRewardDetailsProps) => (
|
||||
<>
|
||||
<li>
|
||||
<h3>MsgWithdrawDelegatorReward</h3>
|
||||
@@ -44,4 +46,4 @@ const TxMsgClaimRewardsDetails = ({ msgValue }: TxMsgClaimRewardsDetailsProps) =
|
||||
</>
|
||||
);
|
||||
|
||||
export default TxMsgClaimRewardsDetails;
|
||||
export default TxMsgWithdrawDelegatorRewardDetails;
|
||||
+13
-10
@@ -1,5 +1,5 @@
|
||||
import SelectValidator from "@/components/SelectValidator";
|
||||
import { EncodeObject } from "@cosmjs/proto-signing";
|
||||
import { MsgBeginRedelegateEncodeObject } from "@cosmjs/stargate";
|
||||
import { useEffect, useState } from "react";
|
||||
import { MsgGetter } from "..";
|
||||
import { useChains } from "../../../../context/ChainsContext";
|
||||
@@ -9,17 +9,17 @@ import { MsgCodecs, MsgTypeUrls } from "../../../../types/txMsg";
|
||||
import Input from "../../../inputs/Input";
|
||||
import StackableContainer from "../../../layout/StackableContainer";
|
||||
|
||||
interface MsgRedelegateFormProps {
|
||||
readonly delegatorAddress: string;
|
||||
interface MsgBeginRedelegateFormProps {
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgRedelegateForm = ({
|
||||
delegatorAddress,
|
||||
const MsgBeginRedelegateForm = ({
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
deleteMsg,
|
||||
}: MsgRedelegateFormProps) => {
|
||||
}: MsgBeginRedelegateFormProps) => {
|
||||
const { chain } = useChains();
|
||||
|
||||
const [validatorSrcAddress, setValidatorSrcAddress] = useState("");
|
||||
@@ -81,13 +81,16 @@ const MsgRedelegateForm = ({
|
||||
})();
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.BeginRedelegate].fromPartial({
|
||||
delegatorAddress,
|
||||
delegatorAddress: senderAddress,
|
||||
validatorSrcAddress,
|
||||
validatorDstAddress,
|
||||
amount: microCoin,
|
||||
});
|
||||
|
||||
const msg: EncodeObject = { typeUrl: MsgTypeUrls.BeginRedelegate, value: msgValue };
|
||||
const msg: MsgBeginRedelegateEncodeObject = {
|
||||
typeUrl: MsgTypeUrls.BeginRedelegate,
|
||||
value: msgValue,
|
||||
};
|
||||
|
||||
setMsgGetter({ isMsgValid, msg });
|
||||
}, [
|
||||
@@ -95,7 +98,7 @@ const MsgRedelegateForm = ({
|
||||
chain.assets,
|
||||
chain.chainId,
|
||||
chain.displayDenom,
|
||||
delegatorAddress,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
trimmedInputs,
|
||||
]);
|
||||
@@ -173,4 +176,4 @@ const MsgRedelegateForm = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default MsgRedelegateForm;
|
||||
export default MsgBeginRedelegateForm;
|
||||
@@ -13,13 +13,13 @@ import Input from "../../../inputs/Input";
|
||||
import StackableContainer from "../../../layout/StackableContainer";
|
||||
|
||||
interface MsgCreateVestingAccountFormProps {
|
||||
readonly fromAddress: string;
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgCreateVestingAccountForm = ({
|
||||
fromAddress,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
deleteMsg,
|
||||
}: MsgCreateVestingAccountFormProps) => {
|
||||
@@ -87,7 +87,7 @@ const MsgCreateVestingAccountForm = ({
|
||||
})();
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.CreateVestingAccount].fromPartial({
|
||||
fromAddress,
|
||||
fromAddress: senderAddress,
|
||||
toAddress,
|
||||
amount: microCoin ? [microCoin] : [],
|
||||
endTime: timestampFromDatetimeLocal(endTime, "s"),
|
||||
@@ -103,7 +103,7 @@ const MsgCreateVestingAccountForm = ({
|
||||
chain.chainId,
|
||||
chain.displayDenom,
|
||||
delayed,
|
||||
fromAddress,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
trimmedInputs,
|
||||
]);
|
||||
|
||||
@@ -10,12 +10,12 @@ import Input from "../../../inputs/Input";
|
||||
import StackableContainer from "../../../layout/StackableContainer";
|
||||
|
||||
interface MsgDelegateFormProps {
|
||||
readonly delegatorAddress: string;
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgDelegateForm = ({ delegatorAddress, setMsgGetter, deleteMsg }: MsgDelegateFormProps) => {
|
||||
const MsgDelegateForm = ({ senderAddress, setMsgGetter, deleteMsg }: MsgDelegateFormProps) => {
|
||||
const { chain } = useChains();
|
||||
|
||||
const [validatorAddress, setValidatorAddress] = useState("");
|
||||
@@ -66,7 +66,7 @@ const MsgDelegateForm = ({ delegatorAddress, setMsgGetter, deleteMsg }: MsgDeleg
|
||||
})();
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.Delegate].fromPartial({
|
||||
delegatorAddress,
|
||||
delegatorAddress: senderAddress,
|
||||
validatorAddress,
|
||||
amount: microCoin,
|
||||
});
|
||||
@@ -79,7 +79,7 @@ const MsgDelegateForm = ({ delegatorAddress, setMsgGetter, deleteMsg }: MsgDeleg
|
||||
chain.assets,
|
||||
chain.chainId,
|
||||
chain.displayDenom,
|
||||
delegatorAddress,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
trimmedInputs,
|
||||
]);
|
||||
|
||||
@@ -25,13 +25,13 @@ const getDenomOptions = (assets: ChainInfo["assets"]) => {
|
||||
};
|
||||
|
||||
interface MsgExecuteContractFormProps {
|
||||
readonly fromAddress: string;
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgExecuteContractForm = ({
|
||||
fromAddress,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
deleteMsg,
|
||||
}: MsgExecuteContractFormProps) => {
|
||||
@@ -126,23 +126,26 @@ const MsgExecuteContractForm = ({
|
||||
}
|
||||
})();
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.Execute].fromPartial({
|
||||
sender: fromAddress,
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.ExecuteContract].fromPartial({
|
||||
sender: senderAddress,
|
||||
contract: contractAddress,
|
||||
msg: msgContentUtf8Array,
|
||||
funds: microCoin ? [microCoin] : [],
|
||||
});
|
||||
|
||||
const msg: MsgExecuteContractEncodeObject = { typeUrl: MsgTypeUrls.Execute, value: msgValue };
|
||||
const msg: MsgExecuteContractEncodeObject = {
|
||||
typeUrl: MsgTypeUrls.ExecuteContract,
|
||||
value: msgValue,
|
||||
};
|
||||
|
||||
setMsgGetter({ isMsgValid, msg });
|
||||
}, [
|
||||
chain.addressPrefix,
|
||||
chain.assets,
|
||||
chain.chainId,
|
||||
fromAddress,
|
||||
msgContent,
|
||||
selectedDenom.value,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
trimmedInputs,
|
||||
]);
|
||||
|
||||
@@ -25,13 +25,13 @@ const getDenomOptions = (assets: ChainInfo["assets"]) => {
|
||||
};
|
||||
|
||||
interface MsgInstantiateContract2FormProps {
|
||||
readonly fromAddress: string;
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgInstantiateContract2Form = ({
|
||||
fromAddress,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
deleteMsg,
|
||||
}: MsgInstantiateContract2FormProps) => {
|
||||
@@ -163,8 +163,8 @@ const MsgInstantiateContract2Form = ({
|
||||
}
|
||||
})();
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.Instantiate2].fromPartial({
|
||||
sender: fromAddress,
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.InstantiateContract2].fromPartial({
|
||||
sender: senderAddress,
|
||||
codeId: BigInt(codeId),
|
||||
label,
|
||||
admin: adminAddress,
|
||||
@@ -175,7 +175,7 @@ const MsgInstantiateContract2Form = ({
|
||||
});
|
||||
|
||||
const msg: MsgInstantiateContract2EncodeObject = {
|
||||
typeUrl: MsgTypeUrls.Instantiate2,
|
||||
typeUrl: MsgTypeUrls.InstantiateContract2,
|
||||
value: msgValue,
|
||||
};
|
||||
|
||||
@@ -184,9 +184,9 @@ const MsgInstantiateContract2Form = ({
|
||||
chain.addressPrefix,
|
||||
chain.assets,
|
||||
chain.chainId,
|
||||
fromAddress,
|
||||
msgContent,
|
||||
selectedDenom.value,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
trimmedInputs,
|
||||
]);
|
||||
|
||||
@@ -25,13 +25,13 @@ const getDenomOptions = (assets: ChainInfo["assets"]) => {
|
||||
};
|
||||
|
||||
interface MsgInstantiateContractFormProps {
|
||||
readonly fromAddress: string;
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgInstantiateContractForm = ({
|
||||
fromAddress,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
deleteMsg,
|
||||
}: MsgInstantiateContractFormProps) => {
|
||||
@@ -141,8 +141,8 @@ const MsgInstantiateContractForm = ({
|
||||
}
|
||||
})();
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.Instantiate].fromPartial({
|
||||
sender: fromAddress,
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.InstantiateContract].fromPartial({
|
||||
sender: senderAddress,
|
||||
codeId: BigInt(codeId),
|
||||
label,
|
||||
admin: adminAddress,
|
||||
@@ -151,7 +151,7 @@ const MsgInstantiateContractForm = ({
|
||||
});
|
||||
|
||||
const msg: MsgInstantiateContractEncodeObject = {
|
||||
typeUrl: MsgTypeUrls.Instantiate,
|
||||
typeUrl: MsgTypeUrls.InstantiateContract,
|
||||
value: msgValue,
|
||||
};
|
||||
|
||||
@@ -160,9 +160,9 @@ const MsgInstantiateContractForm = ({
|
||||
chain.addressPrefix,
|
||||
chain.assets,
|
||||
chain.chainId,
|
||||
fromAddress,
|
||||
msgContent,
|
||||
selectedDenom.value,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
trimmedInputs,
|
||||
]);
|
||||
|
||||
@@ -12,13 +12,13 @@ import StackableContainer from "../../../layout/StackableContainer";
|
||||
const JsonEditor = dynamic(() => import("../../../inputs/JsonEditor"), { ssr: false });
|
||||
|
||||
interface MsgMigrateContractFormProps {
|
||||
readonly fromAddress: string;
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgMigrateContractForm = ({
|
||||
fromAddress,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
deleteMsg,
|
||||
}: MsgMigrateContractFormProps) => {
|
||||
@@ -69,17 +69,20 @@ const MsgMigrateContractForm = ({
|
||||
}
|
||||
})();
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.Migrate].fromPartial({
|
||||
sender: fromAddress,
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.MigrateContract].fromPartial({
|
||||
sender: senderAddress,
|
||||
contract: contractAddress,
|
||||
codeId: BigInt(codeId),
|
||||
msg: msgContentUtf8Array,
|
||||
});
|
||||
|
||||
const msg: MsgMigrateContractEncodeObject = { typeUrl: MsgTypeUrls.Migrate, value: msgValue };
|
||||
const msg: MsgMigrateContractEncodeObject = {
|
||||
typeUrl: MsgTypeUrls.MigrateContract,
|
||||
value: msgValue,
|
||||
};
|
||||
|
||||
setMsgGetter({ isMsgValid, msg });
|
||||
}, [chain.addressPrefix, chain.chainId, fromAddress, msgContent, setMsgGetter, trimmedInputs]);
|
||||
}, [chain.addressPrefix, chain.chainId, msgContent, senderAddress, setMsgGetter, trimmedInputs]);
|
||||
|
||||
return (
|
||||
<StackableContainer lessPadding lessMargin>
|
||||
|
||||
@@ -21,12 +21,12 @@ const getDenomOptions = (assets: readonly RegistryAsset[]) => {
|
||||
};
|
||||
|
||||
interface MsgSendFormProps {
|
||||
readonly fromAddress: string;
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgSendForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgSendFormProps) => {
|
||||
const MsgSendForm = ({ senderAddress, setMsgGetter, deleteMsg }: MsgSendFormProps) => {
|
||||
const { chain } = useChains();
|
||||
|
||||
const denomOptions = getDenomOptions(chain.assets);
|
||||
@@ -103,7 +103,7 @@ const MsgSendForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgSendFormProps)
|
||||
})();
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.Send].fromPartial({
|
||||
fromAddress,
|
||||
fromAddress: senderAddress,
|
||||
toAddress,
|
||||
amount: microCoin ? [microCoin] : [],
|
||||
});
|
||||
@@ -115,8 +115,8 @@ const MsgSendForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgSendFormProps)
|
||||
chain.addressPrefix,
|
||||
chain.assets,
|
||||
chain.chainId,
|
||||
fromAddress,
|
||||
selectedDenom.value,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
trimmedInputs,
|
||||
]);
|
||||
|
||||
@@ -8,13 +8,13 @@ import Input from "../../../inputs/Input";
|
||||
import StackableContainer from "../../../layout/StackableContainer";
|
||||
|
||||
interface MsgSetWithdrawAddressFormProps {
|
||||
readonly delegatorAddress: string;
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgSetWithdrawAddressForm = ({
|
||||
delegatorAddress,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
deleteMsg,
|
||||
}: MsgSetWithdrawAddressFormProps) => {
|
||||
@@ -42,13 +42,13 @@ const MsgSetWithdrawAddressForm = ({
|
||||
};
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.SetWithdrawAddress].fromPartial({
|
||||
delegatorAddress,
|
||||
delegatorAddress: senderAddress,
|
||||
withdrawAddress,
|
||||
});
|
||||
const msg: EncodeObject = { typeUrl: MsgTypeUrls.SetWithdrawAddress, value: msgValue };
|
||||
|
||||
setMsgGetter({ isMsgValid, msg });
|
||||
}, [chain.addressPrefix, chain.chainId, delegatorAddress, setMsgGetter, trimmedInputs]);
|
||||
}, [chain.addressPrefix, chain.chainId, senderAddress, setMsgGetter, trimmedInputs]);
|
||||
|
||||
return (
|
||||
<StackableContainer lessPadding lessMargin>
|
||||
|
||||
@@ -24,12 +24,12 @@ const humanTimestampOptions = [
|
||||
];
|
||||
|
||||
interface MsgTransferFormProps {
|
||||
readonly fromAddress: string;
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgTransferForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgTransferFormProps) => {
|
||||
const MsgTransferForm = ({ senderAddress, setMsgGetter, deleteMsg }: MsgTransferFormProps) => {
|
||||
const { chain } = useChains();
|
||||
|
||||
const [toAddress, setToAddress] = useState("");
|
||||
@@ -107,7 +107,7 @@ const MsgTransferForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgTransferFo
|
||||
};
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.Transfer].fromPartial({
|
||||
sender: fromAddress,
|
||||
sender: senderAddress,
|
||||
receiver: toAddress,
|
||||
token: { denom, amount },
|
||||
sourcePort,
|
||||
@@ -119,7 +119,7 @@ const MsgTransferForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgTransferFo
|
||||
const msg: MsgTransferEncodeObject = { typeUrl: MsgTypeUrls.Transfer, value: msgValue };
|
||||
|
||||
setMsgGetter({ isMsgValid, msg });
|
||||
}, [chain.chainId, fromAddress, setMsgGetter, trimmedInputs]);
|
||||
}, [chain.chainId, senderAddress, setMsgGetter, trimmedInputs]);
|
||||
|
||||
return (
|
||||
<StackableContainer lessPadding lessMargin>
|
||||
|
||||
@@ -10,16 +10,12 @@ import Input from "../../../inputs/Input";
|
||||
import StackableContainer from "../../../layout/StackableContainer";
|
||||
|
||||
interface MsgUndelegateFormProps {
|
||||
readonly delegatorAddress: string;
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgUndelegateForm = ({
|
||||
delegatorAddress,
|
||||
setMsgGetter,
|
||||
deleteMsg,
|
||||
}: MsgUndelegateFormProps) => {
|
||||
const MsgUndelegateForm = ({ senderAddress, setMsgGetter, deleteMsg }: MsgUndelegateFormProps) => {
|
||||
const { chain } = useChains();
|
||||
|
||||
const [validatorAddress, setValidatorAddress] = useState("");
|
||||
@@ -70,7 +66,7 @@ const MsgUndelegateForm = ({
|
||||
})();
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.Undelegate].fromPartial({
|
||||
delegatorAddress,
|
||||
delegatorAddress: senderAddress,
|
||||
validatorAddress,
|
||||
amount: microCoin,
|
||||
});
|
||||
@@ -83,7 +79,7 @@ const MsgUndelegateForm = ({
|
||||
chain.assets,
|
||||
chain.chainId,
|
||||
chain.displayDenom,
|
||||
delegatorAddress,
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
trimmedInputs,
|
||||
]);
|
||||
|
||||
@@ -8,12 +8,16 @@ import Input from "../../../inputs/Input";
|
||||
import StackableContainer from "../../../layout/StackableContainer";
|
||||
|
||||
interface MsgUpdateAdminFormProps {
|
||||
readonly fromAddress: string;
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgUpdateAdminForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgUpdateAdminFormProps) => {
|
||||
const MsgUpdateAdminForm = ({
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
deleteMsg,
|
||||
}: MsgUpdateAdminFormProps) => {
|
||||
const { chain } = useChains();
|
||||
|
||||
const [contractAddress, setContractAddress] = useState("");
|
||||
@@ -52,7 +56,7 @@ const MsgUpdateAdminForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgUpdateA
|
||||
};
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.UpdateAdmin].fromPartial({
|
||||
sender: fromAddress,
|
||||
sender: senderAddress,
|
||||
contract: contractAddress,
|
||||
newAdmin: newAdminAddress,
|
||||
});
|
||||
@@ -60,7 +64,7 @@ const MsgUpdateAdminForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgUpdateA
|
||||
const msg: MsgUpdateAdminEncodeObject = { typeUrl: MsgTypeUrls.UpdateAdmin, value: msgValue };
|
||||
|
||||
setMsgGetter({ isMsgValid, msg });
|
||||
}, [chain.addressPrefix, chain.chainId, fromAddress, setMsgGetter, trimmedInputs]);
|
||||
}, [chain.addressPrefix, chain.chainId, senderAddress, setMsgGetter, trimmedInputs]);
|
||||
|
||||
return (
|
||||
<StackableContainer lessPadding lessMargin>
|
||||
|
||||
@@ -20,12 +20,12 @@ const selectVoteOptions = voteOptions.map((opt) => {
|
||||
});
|
||||
|
||||
interface MsgVoteFormProps {
|
||||
readonly fromAddress: string;
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgVoteForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgVoteFormProps) => {
|
||||
const MsgVoteForm = ({ senderAddress, setMsgGetter, deleteMsg }: MsgVoteFormProps) => {
|
||||
const [proposalId, setProposalId] = useState("0");
|
||||
const [selectedVote, setSelectedVote] = useState(selectVoteOptions[0]);
|
||||
|
||||
@@ -64,7 +64,7 @@ const MsgVoteForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgVoteFormProps)
|
||||
})();
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.Vote].fromPartial({
|
||||
voter: fromAddress,
|
||||
voter: senderAddress,
|
||||
proposalId: proposalIdBigInt,
|
||||
option: selectedVote.value,
|
||||
});
|
||||
@@ -72,7 +72,7 @@ const MsgVoteForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgVoteFormProps)
|
||||
const msg: MsgVoteEncodeObject = { typeUrl: MsgTypeUrls.Vote, value: msgValue };
|
||||
|
||||
setMsgGetter({ isMsgValid, msg });
|
||||
}, [fromAddress, selectedVote.value, setMsgGetter, trimmedInputs]);
|
||||
}, [selectedVote.value, senderAddress, setMsgGetter, trimmedInputs]);
|
||||
|
||||
return (
|
||||
<StackableContainer lessPadding lessMargin>
|
||||
|
||||
+8
-8
@@ -8,17 +8,17 @@ import { MsgCodecs, MsgTypeUrls } from "../../../../types/txMsg";
|
||||
import Input from "../../../inputs/Input";
|
||||
import StackableContainer from "../../../layout/StackableContainer";
|
||||
|
||||
interface MsgClaimRewardsFormProps {
|
||||
readonly delegatorAddress: string;
|
||||
interface MsgWithdrawDelegatorRewardFormProps {
|
||||
readonly senderAddress: string;
|
||||
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
|
||||
readonly deleteMsg: () => void;
|
||||
}
|
||||
|
||||
const MsgClaimRewardsForm = ({
|
||||
delegatorAddress,
|
||||
const MsgWithdrawDelegatorRewardForm = ({
|
||||
senderAddress,
|
||||
setMsgGetter,
|
||||
deleteMsg,
|
||||
}: MsgClaimRewardsFormProps) => {
|
||||
}: MsgWithdrawDelegatorRewardFormProps) => {
|
||||
const { chain } = useChains();
|
||||
|
||||
const [validatorAddress, setValidatorAddress] = useState("");
|
||||
@@ -45,7 +45,7 @@ const MsgClaimRewardsForm = ({
|
||||
};
|
||||
|
||||
const msgValue = MsgCodecs[MsgTypeUrls.WithdrawDelegatorReward].fromPartial({
|
||||
delegatorAddress,
|
||||
delegatorAddress: senderAddress,
|
||||
validatorAddress,
|
||||
});
|
||||
|
||||
@@ -55,7 +55,7 @@ const MsgClaimRewardsForm = ({
|
||||
};
|
||||
|
||||
setMsgGetter({ isMsgValid, msg });
|
||||
}, [chain.addressPrefix, chain.chainId, delegatorAddress, setMsgGetter, trimmedInputs]);
|
||||
}, [chain.addressPrefix, chain.chainId, senderAddress, setMsgGetter, trimmedInputs]);
|
||||
|
||||
return (
|
||||
<StackableContainer lessPadding lessMargin>
|
||||
@@ -100,4 +100,4 @@ const MsgClaimRewardsForm = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default MsgClaimRewardsForm;
|
||||
export default MsgWithdrawDelegatorRewardForm;
|
||||
Reference in New Issue
Block a user