Switch new forms and details

This commit is contained in:
abefernan
2023-07-10 18:43:44 +02:00
parent b3076b6921
commit 8ffb2a725a
3 changed files with 27 additions and 0 deletions
@@ -7,6 +7,9 @@ import StackableContainer from "../../layout/StackableContainer";
import TxMsgClaimRewardsDetails from "./TxMsgClaimRewardsDetails";
import TxMsgCreateVestingAccountDetails from "./TxMsgCreateVestingAccountDetails";
import TxMsgDelegateDetails from "./TxMsgDelegateDetails";
import TxMsgExecuteContractDetails from "./TxMsgExecuteContractDetails";
import TxMsgInstantiateContract2Details from "./TxMsgInstantiateContract2Details";
import TxMsgInstantiateContractDetails from "./TxMsgInstantiateContractDetails";
import TxMsgRedelegateDetails from "./TxMsgRedelegateDetails";
import TxMsgSendDetails from "./TxMsgSendDetails";
import TxMsgSetWithdrawAddressDetails from "./TxMsgSetWithdrawAddressDetails";
@@ -31,6 +34,12 @@ const TxMsgDetails = ({ typeUrl, value: msgValue }: EncodeObject) => {
return <TxMsgCreateVestingAccountDetails msgValue={msgValue} />;
case MsgTypeUrls.Transfer:
return <TxMsgTransferDetails msgValue={msgValue} />;
case MsgTypeUrls.Execute:
return <TxMsgExecuteContractDetails msgValue={msgValue} />;
case MsgTypeUrls.Instantiate:
return <TxMsgInstantiateContractDetails msgValue={msgValue} />;
case MsgTypeUrls.Instantiate2:
return <TxMsgInstantiateContract2Details msgValue={msgValue} />;
default:
return null;
}
@@ -3,6 +3,9 @@ import { MsgTypeUrl, MsgTypeUrls } from "../../../../types/txMsg";
import MsgClaimRewardsForm from "./MsgClaimRewardsForm";
import MsgCreateVestingAccountForm from "./MsgCreateVestingAccountForm";
import MsgDelegateForm from "./MsgDelegateForm";
import MsgExecuteContractForm from "./MsgExecuteContractForm";
import MsgInstantiateContract2Form from "./MsgInstantiateContract2Form";
import MsgInstantiateContractForm from "./MsgInstantiateContractForm";
import MsgRedelegateForm from "./MsgRedelegateForm";
import MsgSendForm from "./MsgSendForm";
import MsgSetWithdrawAddressForm from "./MsgSetWithdrawAddressForm";
@@ -34,6 +37,12 @@ const MsgForm = ({ msgType, senderAddress, ...restProps }: MsgFormProps) => {
return <MsgCreateVestingAccountForm fromAddress={senderAddress} {...restProps} />;
case MsgTypeUrls.Transfer:
return <MsgTransferForm fromAddress={senderAddress} {...restProps} />;
case MsgTypeUrls.Execute:
return <MsgExecuteContractForm fromAddress={senderAddress} {...restProps} />;
case MsgTypeUrls.Instantiate:
return <MsgInstantiateContractForm fromAddress={senderAddress} {...restProps} />;
case MsgTypeUrls.Instantiate2:
return <MsgInstantiateContract2Form fromAddress={senderAddress} {...restProps} />;
default:
return null;
}
+9
View File
@@ -179,6 +179,15 @@ const CreateTxForm = ({ router, senderAddress, accountOnChain }: CreateTxFormPro
onClick={() => addMsgType(MsgTypeUrls.CreateVestingAccount)}
/>
<Button label="Add MsgTransfer" onClick={() => addMsgType(MsgTypeUrls.Transfer)} />
<Button label="Add MsgExecuteContract" onClick={() => addMsgType(MsgTypeUrls.Execute)} />
<Button
label="Add MsgInstantiateContract"
onClick={() => addMsgType(MsgTypeUrls.Instantiate)}
/>
<Button
label="Add MsgInstantiateContract2"
onClick={() => addMsgType(MsgTypeUrls.Instantiate2)}
/>
</StackableContainer>
{showCreateTxError ? (
<StackableContainer lessMargin lessPadding>