From 508d807cf57f41c070265e043d86669065c23988 Mon Sep 17 00:00:00 2001 From: ejmg Date: Thu, 23 May 2024 16:45:33 -0500 Subject: [PATCH 1/8] finished cleaning up sub-components of SwapView --- src/components/ActionView/index.tsx | 98 ++++++++++++----------------- 1 file changed, 39 insertions(+), 59 deletions(-) diff --git a/src/components/ActionView/index.tsx b/src/components/ActionView/index.tsx index 2596638..c0e6a6a 100644 --- a/src/components/ActionView/index.tsx +++ b/src/components/ActionView/index.tsx @@ -160,14 +160,11 @@ const AssetIdBytes = GenericKV; const EquivalentValueView: FC<{ equivalentValue: EquivalentValueT }> = ({ equivalentValue }) => { return ( - -

Equivalent Value

+ +

Equivalent Value

{equivalentValue.equivalentAmount ? : null} {equivalentValue.numeraire ? : null} - -

Height

-
{equivalentValue.asOfHeight.toString()}
-
+
); }; @@ -175,15 +172,9 @@ const EquivalentValueView: FC<{ equivalentValue: EquivalentValueT }> = ({ equiva const Height: FC<{ height: HeightT }> = ({ height }) => { return ( -

Height

- -

Revision Number

-
{height.revisionNumber.toString()}
-
- -

Revision Height

-
{height.revisionHeight.toString()}
-
+

Height

+ +
); }; @@ -192,7 +183,6 @@ const Epoch: FC<{ epoch: EpochT, label?: string }> = ({ epoch, label }) => { const title = label !== undefined && label !== "" ? label : "Epoch"; return ( - {/*

{title}

*/}
@@ -201,39 +191,30 @@ const Epoch: FC<{ epoch: EpochT, label?: string }> = ({ epoch, label }) => { // NOTE: the way ValueView's opaque vs visible cases are handled is by the fact that metadata, equivalentValues, and extendedMetadata // should never be defined in the case of an UnknownAssetId and we only render assetId when valueView.case is unknownAssetId. -const ValueView: FC<{ valueView: ValueViewT, label?: "Asset 1" | "Asset 2" | string }> = ({ valueView, label }) => { +const ValueView: FC<{ valueView: ValueViewT, label?: string }> = ({ valueView, label }) => { + const title = (label ?? "") ? label : "Value View"; const amount = getAmount(valueView); const metadata = getMetadata.optional()(valueView); const equivalentValues = getEquivalentValues.optional()(valueView); const extendedMetadata = getExtendedMetadata.optional()(valueView); const assetId = getAssetIdFromValueView(valueView); return ( - - {(label ?? "") ?

{label} ValueView

:

ValueView

} + +

{title}

{metadata ? : null} - {equivalentValues ? ( - - {equivalentValues.map((equivalentValue, i) => )} - - ) : null} - {extendedMetadata ? ( - -

Extended Metadata

-
{extendedMetadata.toJsonString()}
-
- ) : null} - {valueView.valueView.case === "unknownAssetId" ? ( - - ) : null} + {equivalentValues?.map((equivalentValue, i) => )} + {extendedMetadata ? : null} + {valueView.valueView.case === "unknownAssetId" ? : null}
); }; const Value: FC<{ value: ValueT, label?: string }> = ({ value, label }) => { + const title = label !== undefined && label !== "" ? label : "Value"; return ( - - {(label ?? "") ?

{label}

:

Value

} + +

{title}

{value.amount ? : null} {value.assetId ? : null}
@@ -287,8 +268,8 @@ const AddressView: FC<{ addressView: AddressViewT }> = ({ addressView }) => { const NoteView : FC<{note: NoteViewT}>= ({ note }) => { return ( - -

Note View

+ +

Note View

{note.address ? : null}
@@ -366,8 +347,8 @@ const TradingPair: FC<{ tradingPair?: TradingPairT }> = ({ tradingPair }) => { const asset2 = getAsset2(tradingPair); return ( - -

Trading Pair

+ +

Trading Pair

@@ -398,7 +379,8 @@ const Amount: FC<{ amount: AmountT, label?: string }> = ({ amount, label }) => { const SwapPayload: FC<{ swapPayload: SwapPayloadT }> = ({ swapPayload }) => { return ( - + +

Swap Payload

{swapPayload.commitment ? : null}
@@ -414,34 +396,31 @@ const BatchSwapOutputData: FC<{ batchSwapOutput: BatchSwapOutputDataT }> = ({ ba const unfilled2 = getBatchSwapOutputUnfilled2Amount(batchSwapOutput); const tradingPair = getBatchSwapOutputTradingPair(batchSwapOutput); const height = batchSwapOutput.height; - const startingEpoch = batchSwapOutput.epochStartingHeight; + const startingEpoch = batchSwapOutput?.epochStartingHeight; + const sctPositionPrefix = batchSwapOutput.sctPositionPrefix; return ( - -

BatchSwapOutputData

+ +

Batch Swap Output Data

- -

Height

-
{height.toString()}
-
+ - -

Epoch Starting Height

-
{startingEpoch.toString()}
-
+ +
); }; const Metadata: FC<{ metaData: MetadataT, label?: string }> = ({ metaData, label }) => { + const title = (label ?? "") ? label : "Asset Metadata"; const assetId = getAssetId(metaData); return ( - - {(label ?? "") ?

{label}

:

Asset Metadata

} + +

{title}

@@ -527,7 +506,8 @@ const SwapPlaintext: FC<{ swapPlaintext: SwapPlaintextT }> = ({ swapPlaintext }) const claimFee = getSwapPlaintextFee(swapPlaintext); const claimAddress = getSwapPlaintextAddress(swapPlaintext); return ( - + +

Swap Plaintext

@@ -885,8 +865,8 @@ const SwapViewOpaque: FC<{ swapView: SwapViewT }> = ({ swapView }) => { return ( {batchSwapOutput ? : null} - {outputValue1 ? : null} - {outputValue2 ? : null} + {outputValue1 ? : null} + {outputValue2 ? : null} {metadata1 ? : null} {metadata2 ? : null} @@ -925,8 +905,8 @@ const SwapView: FC<{ swapView: SwapViewT }> = ({ swapView }) => {

Swap View

{swapProof? : null} - -

Swap Body

+ +

Swap Body

@@ -1469,7 +1449,7 @@ const ActionDutchAuctionWithdrawView: FC<{ actionDutchAuctionWithdrawView: Actio {reservesCommitment ? : null} {reserves.length !== 0 ? ( -

Reserves

+

Reserves

{reserves.map((valueView, i) => )}
) : null} From 7218ecfa77c7d5fb375e964210c5c92e3f095f3c Mon Sep 17 00:00:00 2001 From: ejmg Date: Thu, 23 May 2024 16:53:08 -0500 Subject: [PATCH 2/8] SwapViewClaim cleaned up --- src/components/ActionView/index.tsx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/components/ActionView/index.tsx b/src/components/ActionView/index.tsx index c0e6a6a..0ef9f0d 100644 --- a/src/components/ActionView/index.tsx +++ b/src/components/ActionView/index.tsx @@ -400,7 +400,7 @@ const BatchSwapOutputData: FC<{ batchSwapOutput: BatchSwapOutputDataT }> = ({ ba const sctPositionPrefix = batchSwapOutput.sctPositionPrefix; return ( -

Batch Swap Output Data

+

Batch Swap Output Data

@@ -944,13 +944,13 @@ const SwapClaimView: FC<{ swapClaimView: SwapClaimViewT}> = ({ swapClaimView }) // NOTE: This might be a good model to copy for SwapView. Cleanly eliminates the unnecessary nesting of Opaque & Visible variants. return ( - -

Swap Claim View

- - {swapClaimProof ? : null} + +

Swap Claim View

+ + {swapClaimProof ? : null} {swapClaimBody ? ( - -

SwapClaimBody

+ +

Swap Claim Body

{bodyNullifier ? : null} {bodyFee ? : null} {bodyOutput1Commitment ? : null} @@ -958,10 +958,7 @@ const SwapClaimView: FC<{ swapClaimView: SwapClaimViewT}> = ({ swapClaimView }) {bodyOutputData ? : null}
) : null} - -

Epoch Duration

-
{swapEpochDuration.toString()}
-
+ {isVisible && swapClaimNoteOutput1 ? : null} {isVisible && swapClaimNoteOutput2 ? : null} {isVisible && swapClaimTxId ? : null} From 4459cfa6fddf040ed193a36bb213dc19d5dcecbb Mon Sep 17 00:00:00 2001 From: ejmg Date: Thu, 23 May 2024 17:54:46 -0500 Subject: [PATCH 3/8] ProposalSubmit, DelegatorVoteView, IbcRelayAction updated, Amount and TxRow fixes --- src/components/ActionView/index.tsx | 73 +++++++++-------------------- 1 file changed, 23 insertions(+), 50 deletions(-) diff --git a/src/components/ActionView/index.tsx b/src/components/ActionView/index.tsx index 0ef9f0d..a886007 100644 --- a/src/components/ActionView/index.tsx +++ b/src/components/ActionView/index.tsx @@ -74,11 +74,11 @@ function useCopyToClipboard() { return copyToClipboard; }; -const TxRow: FC<{ label: string, value?: string | bigint | number, className?: string }> = ({ label: name, value, className }) => { +const TxRow: FC<{ label: string, value?: string | bigint | number | boolean, className?: string }> = ({ label: name, value, className }) => { const copyToClipboard = useCopyToClipboard(); let text : string; if (value !== undefined) { - if (typeof value === "number" || typeof value === "bigint") { + if (typeof value === "number" || typeof value === "bigint" || typeof value === "boolean") { text = value.toString(); } else { text = value !== "" ? value : "N/A"; @@ -157,6 +157,7 @@ const AddressBytes = GenericKV; const OutputProof = GenericKV; const EncryptedNote = GenericKV; const AssetIdBytes = GenericKV; +const IbcRelayRawValue = GenericKV; const EquivalentValueView: FC<{ equivalentValue: EquivalentValueT }> = ({ equivalentValue }) => { return ( @@ -361,7 +362,7 @@ const Amount: FC<{ amount: AmountT, label?: string }> = ({ amount, label }) => { const amountText = joinLoHiAmount(amount).toString(); return ( - +

{title}

@@ -985,24 +986,15 @@ const DelegatorVoteView: FC<{ delegatorVoteView: DelegatorVoteViewT }> = ({ dele const isVisible = delegatorVoteView.delegatorVote.case === "visible"; const delegatorVoteViewNote = getDelegatorVoteViewNote.optional()(delegatorVoteView); return ( - -

Delegator Vote View

- + +

Delegator Vote View

+ {delegatorVoteBody ? ( - -

DelegatorVoteBody

- {bodyProposal !== undefined ? ( - -

Proposal

-
{bodyProposal.toString()}
-
- ) : null} - {bodyStartPosition !== undefined ? ( - -

Proposal

-
{bodyStartPosition.toString()}
-
- ) : null} + +

Delegator Vote Body

+ + {bodyProposal !== undefined ? : null} + {bodyStartPosition !== undefined ? : null} {bodyVote ? : null} {bodyValue ? : null} {bodyUnboundedAmount ? : null} @@ -1058,20 +1050,10 @@ const IBCRelayAction: FC<{ ibcRelayAction: IbcRelay }> = ({ ibcRelayAction }) => const ibcValue = ibcRelayAction.rawAction?.value; const ibcTypeURL = ibcRelayAction.rawAction?.typeUrl; return ( - -

IBC Relay Raw Action

- {ibcValue ? ( - -

Value

-
{ibcValue}
-
- ) : null} - {ibcTypeURL?.length !== undefined ? ( - -

Proto URL Resource

-
{ibcTypeURL}
-
- ) : null} + +

IBC Relay Raw Action

+ {ibcValue ? : null} + {ibcTypeURL?.length !== undefined ? : null}
); }; @@ -1081,23 +1063,14 @@ const ProposalSubmit: FC<{ proposalSubmit: ProposalSubmitT }> = ({ proposalSubmi const proposalId = getProposalId(proposalSubmit); const proposalTitle = getProposalTitle(proposalSubmit); const proposalDescription = getProposalDescription(proposalSubmit); - const proposalPayload = getProposalPayload(proposalSubmit); + const proposalPayload = getProposalPayload.optional()(proposalSubmit); return ( - -

Proposal Submit

- -

ID

-
{proposalId.toString()}
-
- -

Title

-

{proposalTitle}

-
- -

Description

-

{proposalDescription}

-
- + +

Proposal Submit

+ + + + {proposalPayload ? : null} {proposalSubmitAmount ? : null}
); From eedb514c9a1a11b428e8b8c7afeb3cc3faee4254 Mon Sep 17 00:00:00 2001 From: ejmg Date: Fri, 24 May 2024 01:49:53 -0500 Subject: [PATCH 4/8] ProposalSubmit, IBCRelayAction, ProposalPayload, and ChangeParameters. Added EncodedParameters and GasPrices. Removed irrelevant getters. --- src/components/ActionView/index.tsx | 388 +++++++++++----------------- src/components/Navbar/index.tsx | 2 +- src/lib/protobuf.ts | 18 +- 3 files changed, 156 insertions(+), 252 deletions(-) diff --git a/src/components/ActionView/index.tsx b/src/components/ActionView/index.tsx index a886007..b446dc7 100644 --- a/src/components/ActionView/index.tsx +++ b/src/components/ActionView/index.tsx @@ -3,10 +3,10 @@ import React from "react"; import { type SwapView as SwapViewT, type SwapClaimView as SwapClaimViewT, type TradingPair as TradingPairT, type SwapPayload as SwapPayloadT, type BatchSwapOutputData as BatchSwapOutputDataT, type SwapPlaintext as SwapPlaintextT, type PositionOpen as PositionOpenT, type Position as PositionT, type TradingFunction as TradingFunctionT, PositionState_PositionStateEnum, type PositionClose as PositionCloseT, type PositionWithdraw as PositionWithdrawT, type PositionRewardClaim as PositionRewardClaimT} from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/dex/v1/dex_pb"; import type { NoteView as NoteViewT, NotePayload as NotePayloadT, SpendView as SpendViewT, OutputView as OutputViewT} from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/shielded_pool/v1/shielded_pool_pb"; import type { ActionView as ActionViewT } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/transaction/v1/transaction_pb"; -import { type ValidatorVote as ValidatorVoteT, type ChangedAppParameters as ChangeAppParametersT, type DelegatorVoteView as DelegatorVoteViewT, type ProposalSubmit as ProposalSubmitT, type ProposalWithdraw as ProposalWithdrawT, type Proposal_CommunityPoolSpend, type Proposal_Emergency, type Proposal_FreezeIbcClient, type Proposal_ParameterChange, type Proposal_Signaling, type Proposal_UnfreezeIbcClient, type Proposal_UpgradePlan, type ProposalDepositClaim as ProposalDepositClaimT, type CommunityPoolSpend as CommunityPoolSpendT, type CommunityPoolOutput as CommunityPoolOutputT, type CommunityPoolDeposit as CommunityPoolDepositT} from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/governance/v1/governance_pb"; +import { type ValidatorVote as ValidatorVoteT, type ChangedAppParameters as ChangeAppParametersT, type DelegatorVoteView as DelegatorVoteViewT, type ProposalSubmit as ProposalSubmitT, type ProposalWithdraw as ProposalWithdrawT, type Proposal_CommunityPoolSpend, type Proposal_Emergency, type Proposal_FreezeIbcClient, type Proposal_ParameterChange, type Proposal_Signaling, type Proposal_UnfreezeIbcClient, type Proposal_UpgradePlan, type ProposalDepositClaim as ProposalDepositClaimT, type CommunityPoolSpend as CommunityPoolSpendT, type CommunityPoolOutput as CommunityPoolOutputT, type CommunityPoolDeposit as CommunityPoolDepositT, type EncodedParameter as EncodedParameterT } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/governance/v1/governance_pb"; import { getAddressIndex } from "@penumbra-zone/getters/src/address-view"; import { getAsset1, getAsset2 } from "@penumbra-zone/getters/src/trading-pair"; -import { getBatchSwapOutputDelta1Amount, getBatchSwapOutputDelta2Amount, getBatchSwapOutputTradingPair, getBatchSwapOutputLambda1Amount, getBatchSwapOutputLambda2Amount, getBatchSwapOutputUnfilled1Amount, getBatchSwapOutputUnfilled2Amount , getBatchSwapOutputData, getOutputViewKey, getOutputViewNote, getSpendNote, getSwapViewBodyAmounts, getSwapViewBodyFeeCommitment, getSwapViewBodyPayload, getSwapMetadata1, getSwapMetadata2, getWalletId, getOutputValue1FromSwapView, getOutputValue2FromSwapView, getSwapTransactionId, getSwapPlaintext, getSwapNoteViewOutput1, getSwapNoteViewOutput2, getSwapPlaintextTradingPair, getSwapPlaintextDelta1, getSwapPlaintextDelta2, getSwapPlaintextFee, getSwapPlaintextAddress, getFeeAmount, getFeeAssetId, getSwapClaimViewZKProof, getSwapClaimViewBody, getSwapClaimViewEpochDuration, getSwapClaimBodyNullifier, getSwapClaimBodyFee, getSwapClaimBodyOutput1Commitment, getSwapClaimBodyOutput2Commitment, getSwapClaimBodyBatchOutputData, getSwapClaimNoteOutput1, getSwapClaimNoteOutput2, getSwapClaimTransactionId, getDelegatorVoteViewBody, getDelegatorVoteViewAuthSig, getDelegatorVoteViewProof, getDelegatorVoteViewNote, getDelegatorVoteBodyProposal, getDelegatorVoteBodyStartPosition, getDelegatorVoteBodyVote, getDelegatorVoteBodyValue, getDelegatorVoteBodyUnbondedAmount, getDelegatorVoteBodyNullifier, getDelegatorVoteBodyRK, getValidatorIdentityKey, getValidatorConsensusKey, getValidatorName, getValidatorWebsite, getValidatorDescription, getValidatorEnabled, getValidatorFundingStream, getValidatorSequenceNumber, getValidatorGovernanceKey, getValidatorAuthSig, getFundingStreamToAddress, getFundingStreamRateBps, getProposalSubmitDepositAmount, getProposalId, getProposalTitle, getProposalDescription, getProposalPayload, getChangeAppSctParameter, getChangeAppCommunityPoolParameter, getChangeAppGovernanceParameter, getChangeAppIbcParameters, getChangeAppStakeParameters, getChangeAppFeeParameters, getChangeAppDistributionParameters, getChangeAppFundingParameters, getChangeAppShieldedParameters, getChangeAppDexParameters, getChangeAppAuctionParameters, getGasPriceBlockSpacePrice, getGasPriceCompactBlockSpacePrice, getGasPriceVerificationPrice, getGasPriceExecutionPrice, getValidatorVoteBodyProposal, getValidatorVoteBodyVote, getValidatorVoteBodyIdentityKey, getValidatorVoteBodyGovernanceKey, getValidatorVoteBodyReason, getValidatorVoteBody, getValidatorVoteAuthSig, getProposalDepositClaimAmount, getProposalDepositClaimOutcome, getProposalDepositClaimOutcomeReason, getPositionOpen, getPositionTradingFunction, getPositionNonce, getPositionState, getPositionStateSequence, getPositionReservesAmount1, getPositionReservesAmount2, getPositionCloseOnFill, getTradingFunctionFee, getTradingFunctionAmountQ, getTradingFunctionAmountP, getTradingFunctionPair, getPositionClosePositionId, getPositionWithdrawPositionId, getPositionWithdrawBalanceCommitment, getPositionWithdrawSequence, getPositionRewardClaimPositionId, getPositionRewardClaimBalanceCommitment, getCommunityPoolSpendValue, getCommunityPoolOutputValue, getCommunityPoolOutputAddress, getCommunityPoolDepositValue, getUndelegateClaimIdentityKey, getUndelegateClaimStartEpochIndex, getUndelegateClaimPenalty, getUndelegateClaimBalanceCommitment, getUndelegateClaimUnbondingStartHeight, getUndelegateClaimProof, getIcs20WithdrawalAmount, getIcs20WithdrawalDenom, getIcs20WithdrawalDestinationAddress, getIcs20WithdrawalReturnAddress, getIcs20WithdrawalTimeoutHeight, getIcs20WithdrawalTimeoutTime, getIcs20WithdrawalSourceChannel, getDelegateIdentityKey, getDelegateEpochIndex, getDelegateUnbondedAmount, getDelegateDelegationAmount, getUndelegateStartEpochIndex, getUndelegateUnbondedAmount, getUndelegateDelegationAmount, getUndelegateFromEpoch, getUndelegateIdentityKey, getInputFromActionDutchAuctionScheduleView, getOutputIdFromActionDutchAuctionScheduleView, getMaxOutputFromActionDutchAuctionScheduleView, getMinOutputFromActionDutchAuctionScheduleView, getStartHeightFromActionDutchAuctionScheduleView, getEndHeightFromActionDutchAuctionScheduleView, getStepCountFromActionDutchAuctionScheduleView, getNonceFromActionDutchAuctionScheduleView, getActionDutchAuctionScheduleViewAuctionId, getActionDutchAuctionScheduleViewInputMetadata, getActionDutchAuctionScheduleViewOutputMetadata, getAuctionIdFromActionDutchAuctionEnd, getReservesCommitmentFromActionDutchAuctionWithdrawView, getReservesFromActionDutchAuctionWithdrawView, getAuctionIdFromActionDutchAuctionWithdrawView, getSeqFromActionDutchAuctionWithdrawView, getSpendViewBodyNullifier, getSpendViewAuthSig, getSpendViewProof, getSpendViewBodySpendVerificationKey, getSpendViewBodyBalanceCommitment, getOutputViewBodyNotePayload, getOutputViewProof, getOutputViewBodyBalanceCommitment, getOutputViewBodyWrappedMemoKey, getOutputViewBodyOvkWrappedKey, getSwapViewProof, getSwapViewBodyTradingPair } from "@/lib/protobuf"; +import { getBatchSwapOutputDelta1Amount, getBatchSwapOutputDelta2Amount, getBatchSwapOutputTradingPair, getBatchSwapOutputLambda1Amount, getBatchSwapOutputLambda2Amount, getBatchSwapOutputUnfilled1Amount, getBatchSwapOutputUnfilled2Amount , getBatchSwapOutputData, getOutputViewKey, getOutputViewNote, getSpendNote, getSwapViewBodyAmounts, getSwapViewBodyFeeCommitment, getSwapViewBodyPayload, getSwapMetadata1, getSwapMetadata2, getWalletId, getOutputValue1FromSwapView, getOutputValue2FromSwapView, getSwapTransactionId, getSwapPlaintext, getSwapNoteViewOutput1, getSwapNoteViewOutput2, getSwapPlaintextTradingPair, getSwapPlaintextDelta1, getSwapPlaintextDelta2, getSwapPlaintextFee, getSwapPlaintextAddress, getFeeAmount, getFeeAssetId, getSwapClaimViewZKProof, getSwapClaimViewBody, getSwapClaimViewEpochDuration, getSwapClaimBodyNullifier, getSwapClaimBodyFee, getSwapClaimBodyOutput1Commitment, getSwapClaimBodyOutput2Commitment, getSwapClaimBodyBatchOutputData, getSwapClaimNoteOutput1, getSwapClaimNoteOutput2, getSwapClaimTransactionId, getDelegatorVoteViewBody, getDelegatorVoteViewAuthSig, getDelegatorVoteViewProof, getDelegatorVoteViewNote, getDelegatorVoteBodyProposal, getDelegatorVoteBodyStartPosition, getDelegatorVoteBodyVote, getDelegatorVoteBodyValue, getDelegatorVoteBodyUnbondedAmount, getDelegatorVoteBodyNullifier, getDelegatorVoteBodyRK, getValidatorIdentityKey, getValidatorConsensusKey, getValidatorName, getValidatorWebsite, getValidatorDescription, getValidatorEnabled, getValidatorFundingStream, getValidatorSequenceNumber, getValidatorGovernanceKey, getValidatorAuthSig, getFundingStreamToAddress, getFundingStreamRateBps, getProposalSubmitDepositAmount, getProposalId, getProposalTitle, getProposalDescription, getProposalPayload, getChangeAppSctParameter, getChangeAppCommunityPoolParameter, getChangeAppGovernanceParameter, getChangeAppIbcParameters, getChangeAppStakeParameters, getChangeAppFeeParameters, getChangeAppDistributionParameters, getChangeAppFundingParameters, getChangeAppShieldedParameters, getChangeAppDexParameters, getChangeAppAuctionParameters, getValidatorVoteBodyProposal, getValidatorVoteBodyVote, getValidatorVoteBodyIdentityKey, getValidatorVoteBodyGovernanceKey, getValidatorVoteBodyReason, getValidatorVoteBody, getValidatorVoteAuthSig, getProposalDepositClaimAmount, getProposalDepositClaimOutcome, getProposalDepositClaimOutcomeReason, getPositionOpen, getPositionTradingFunction, getPositionNonce, getPositionState, getPositionStateSequence, getPositionReservesAmount1, getPositionReservesAmount2, getPositionCloseOnFill, getTradingFunctionFee, getTradingFunctionAmountQ, getTradingFunctionAmountP, getTradingFunctionPair, getPositionClosePositionId, getPositionWithdrawPositionId, getPositionWithdrawBalanceCommitment, getPositionWithdrawSequence, getPositionRewardClaimPositionId, getPositionRewardClaimBalanceCommitment, getCommunityPoolSpendValue, getCommunityPoolOutputValue, getCommunityPoolOutputAddress, getCommunityPoolDepositValue, getUndelegateClaimIdentityKey, getUndelegateClaimStartEpochIndex, getUndelegateClaimPenalty, getUndelegateClaimBalanceCommitment, getUndelegateClaimUnbondingStartHeight, getUndelegateClaimProof, getIcs20WithdrawalAmount, getIcs20WithdrawalDenom, getIcs20WithdrawalDestinationAddress, getIcs20WithdrawalReturnAddress, getIcs20WithdrawalTimeoutHeight, getIcs20WithdrawalTimeoutTime, getIcs20WithdrawalSourceChannel, getDelegateIdentityKey, getDelegateEpochIndex, getDelegateUnbondedAmount, getDelegateDelegationAmount, getUndelegateStartEpochIndex, getUndelegateUnbondedAmount, getUndelegateDelegationAmount, getUndelegateFromEpoch, getUndelegateIdentityKey, getInputFromActionDutchAuctionScheduleView, getOutputIdFromActionDutchAuctionScheduleView, getMaxOutputFromActionDutchAuctionScheduleView, getMinOutputFromActionDutchAuctionScheduleView, getStartHeightFromActionDutchAuctionScheduleView, getEndHeightFromActionDutchAuctionScheduleView, getStepCountFromActionDutchAuctionScheduleView, getNonceFromActionDutchAuctionScheduleView, getActionDutchAuctionScheduleViewAuctionId, getActionDutchAuctionScheduleViewInputMetadata, getActionDutchAuctionScheduleViewOutputMetadata, getAuctionIdFromActionDutchAuctionEnd, getReservesCommitmentFromActionDutchAuctionWithdrawView, getReservesFromActionDutchAuctionWithdrawView, getAuctionIdFromActionDutchAuctionWithdrawView, getSeqFromActionDutchAuctionWithdrawView, getSpendViewBodyNullifier, getSpendViewAuthSig, getSpendViewProof, getSpendViewBodySpendVerificationKey, getSpendViewBodyBalanceCommitment, getOutputViewBodyNotePayload, getOutputViewProof, getOutputViewBodyBalanceCommitment, getOutputViewBodyWrappedMemoKey, getOutputViewBodyOvkWrappedKey, getSwapViewProof, getSwapViewBodyTradingPair } from "@/lib/protobuf"; import { joinLoHiAmount } from "@penumbra-zone/types/src/amount"; import { uint8ArrayToBase64 } from "@penumbra-zone/types/src/base64"; import { getAssetId } from "@penumbra-zone/getters/src/metadata"; @@ -15,7 +15,7 @@ import type { Address as AddressT, AddressIndex as AddressIndexT, AddressView as import { type AssetId as AssetIdT, type EquivalentValue as EquivalentValueT, type Metadata as MetadataT, type Value as ValueT, type ValueView as ValueViewT } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb"; import { FlexCol, FlexRow } from "../ui/flex"; import type { Amount as AmountT } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/num/v1/num_pb"; -import type { FeeParameters as FeeParametersT, Fee as FeeT } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/fee/v1/fee_pb"; +import type { Fee as FeeT, GasPrices as GasPricesT } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/fee/v1/fee_pb"; import type { ValidatorDefinition as ValidatorDefinitionT, FundingStream as FundingStreamT, UndelegateClaim as UndelegateClaimT, Delegate as DelegateT, Undelegate as UndelegateT } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb"; import type { IbcRelay, Ics20Withdrawal as Ics20WithdrawalT } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/ibc/v1/ibc_pb"; import type { Height as HeightT} from "@buf/cosmos_ibc.bufbuild_es/ibc/core/client/v1/client_pb"; @@ -157,7 +157,6 @@ const AddressBytes = GenericKV; const OutputProof = GenericKV; const EncryptedNote = GenericKV; const AssetIdBytes = GenericKV; -const IbcRelayRawValue = GenericKV; const EquivalentValueView: FC<{ equivalentValue: EquivalentValueT }> = ({ equivalentValue }) => { return ( @@ -356,10 +355,10 @@ const TradingPair: FC<{ tradingPair?: TradingPairT }> = ({ tradingPair }) => { ); }; -const Amount: FC<{ amount: AmountT, label?: string }> = ({ amount, label }) => { +const Amount: FC<{ amount?: AmountT, label?: string }> = ({ amount, label }) => { const copyToClipboard = useCopyToClipboard(); const title = label !== undefined && label !== "" ? label : "Amount"; - const amountText = joinLoHiAmount(amount).toString(); + const amountText = amount ? joinLoHiAmount(amount).toString() : "N/A"; return ( @@ -451,30 +450,14 @@ const Fee: FC<{ fee: FeeT}> = ({ fee }) => { ); }; -const FeeParameters: FC<{ feeParameters: FeeParametersT }> = ({ feeParameters }) => { - const blockSpacePrice = getGasPriceBlockSpacePrice(feeParameters); - const compactBlockSpacePrice = getGasPriceCompactBlockSpacePrice(feeParameters); - const verificationPrice = getGasPriceVerificationPrice(feeParameters); - const executionPrice = getGasPriceExecutionPrice(feeParameters); +const GasPrices: FC<{ gasPrices: GasPricesT, label: "Fixed Gas Prices" | "Fixed Alternative Gas Price" }> = ({ gasPrices, label }) => { return ( -

Gas Prices

- -

Block Space Price

-
{blockSpacePrice.toString()}
-
- -

Compact Block Space Price

-
{compactBlockSpacePrice.toString()}
-
- -

Verification Price

-
{verificationPrice.toString()}
-
- -

Execution Price

-
{executionPrice.toString()}
-
+

{label}

+ {gasPrices.assetId ? : null} + + +
); }; @@ -521,7 +504,7 @@ const SwapPlaintext: FC<{ swapPlaintext: SwapPlaintextT }> = ({ swapPlaintext }) const ChangeParameters: FC<{ parameters: ChangeAppParametersT, - label: "Old App Parameters" | "New App Parameters" + label: "Old App Parameters (DEPRECATED)" | "New App Parameters (DEPRECATED)" }> = ({ parameters, label }) => { const sctParameters = getChangeAppSctParameter.optional()(parameters); const communityPoolParameters = getChangeAppCommunityPoolParameter.optional()(parameters); @@ -535,258 +518,204 @@ const ChangeParameters: FC<{ const dexParameters = getChangeAppDexParameters.optional()(parameters); const auctionParameters = getChangeAppAuctionParameters.optional()(parameters); return ( - -

{label}

+ +

{label}

{sctParameters ? ( - -

SCT Parameters

-
{sctParameters.epochDuration.toString()}
-
+ +

SCT Parameters

+ +
) : null} {communityPoolParameters ? ( - -

Community Pool Parameter

-
-

Community Pool Spend Proposals Enabled

-
{communityPoolParameters.communityPoolSpendProposalsEnabled}
-
-
+ +

Community Pool Parameters

+ +
) : null} {governanceParameters ? ( -

Governance Parameters

- -

Proposal Voting Blocks

-
{governanceParameters.proposalVotingBlocks.toString()}
-
- {governanceParameters.proposalDepositAmount ? ( - -

Proposal Deposit Amount

- -
- ) : null} - -

Proposal Valid Quorum

-
{governanceParameters.proposalValidQuorum}
-
- -

Proposal Pass Threshold

-
{governanceParameters.proposalValidQuorum}
-
- -

Proposal Slash Threshold

-
{governanceParameters.proposalSlashThreshold}
-
+

Governance Parameters

+ + + + +
) : null} {ibcParameters ? ( -

IBC Parameters

- -

IBC Enabled

-
{ibcParameters.ibcEnabled}
-
- -

Inbound ICS-20 Transfers Enabled

-
{ibcParameters.inboundIcs20TransfersEnabled}
-
- -

Outbound ICS-20 Transfers Enabled

-
{ibcParameters.outboundIcs20TransfersEnabled}
-
+

IBC Parameters

+ + +
) : null} {stakeParameters ? ( -

Stake Parameters

- -

Unbonding Epochs

-
{stakeParameters.unbondingDelay.toString()}
-
- -

Active Validators Limit

-
{stakeParameters.activeValidatorLimit.toString()}
-
- -

Base Reward Rate

-
{stakeParameters.baseRewardRate.toString()}
-
- -

Slashing Penalty Misbehavior

-
{stakeParameters.slashingPenaltyMisbehavior.toString()}
-
- -

Slashing Penalty Downtown

-
{stakeParameters.slashingPenaltyDowntime.toString()}
-
- -

Signed Blocks Window Length

-
{stakeParameters.signedBlocksWindowLen.toString()}
-
- -

Missed Blocks Maximium

-
{stakeParameters.missedBlocksMaximum.toString()}
-
- -

Minimum Validator Stake

- {stakeParameters.minValidatorStake ? : null} -
- -

Unbonding Delay

-
{stakeParameters.unbondingDelay.toString()}
-
+

Stake Parameters

+ + + + + + + + +
) : null} {feeParameters ? ( -

Fee Parameters

- +

Fee Parameters

+ {feeParameters.fixedGasPrices + ? + : } + {feeParameters.fixedAltGasPrices.length !== 0 ? ( + + {feeParameters.fixedAltGasPrices.map((gasPrices, i) => )} + + ) : }
) : null} {distributionParameters ? ( - -

Distribution Parameters

- -

Staking Issuance Per Block

-
{distributionParameters.stakingIssuancePerBlock.toString()}
-
+ +

Distribution Parameters

+
) : null} {fundingParameters ? ( - -

Funding Parameters

+ +

Funding Parameters

{/* TODO?: there are no fields to this message type */} -
This message type currently has no fields defined by Penumbra.
-
+
This message type currently has no fields defined by Penumbra.
+
) : null} {shieldedParameters ? ( - -

Shielded Parameters

+ +

Shielded Pool Parameters

{shieldedParameters.fixedFmdParams ? ( - -

Fuzzy Message Detection

- -

Precision Bits

-
{shieldedParameters.fixedFmdParams.precisionBits}
-
- -

As Of Block Height

-
{shieldedParameters.fixedFmdParams.asOfBlockHeight.toString()}
-
+ +

FmdParameters

+ +
- ) : null} + ) : }
) : null} {dexParameters ? ( - -

Dex Parameters

- -

Is Enabled

-
{dexParameters.isEnabled}
-
- -

Fixed Candidates

+ +

Dex Parameters

+ + +

Fixed Candidates

{dexParameters.fixedCandidates.map((assetId, i) => )}
- -

Max Hops

-
{dexParameters.maxHops}
-
- -

Max Positions Per Pair

-
{dexParameters.maxPositionsPerPair}
-
+ +
) : null} {auctionParameters ? ( - -

Auction Parameters

- {/* TODO?: there are no fields to this message type */} -
This message type currently has no fields defined by Penumbra.
-
+ +

Auction Parameters

+ {/* TODO?: there are no fields to this message type */} +
This message type currently has no fields defined by Penumbra.
+
) : null}
); }; +const EncodedParameters: FC<{ encodedParameters: EncodedParameterT[], label: "Preconditions" | "Changes" }> = ({ encodedParameters, label }) => { + const title = label === "Preconditions" ? "Encoded Parameter Precondition" : "Encoded Parameter Changes"; + return ( + +

{label}

+ {label === "Preconditions" && encodedParameters.length === 0 ?
None
: null} + {encodedParameters.map((parameter, i) => ( + +

{title}

+ + + +
+ ))} +
+ ); +}; + const ProposalPayload: FC<{ payload: ProposalSubmitKind }> = ({ payload }) => { switch (payload.case) { - case "signaling": + case "signaling": { return ( - -

Commit

-
{payload.value.commit}
-
+ +

Signaling Proposal

+ +
); - case "emergency": + } + case "emergency": { return ( - -

Emergency Halt Chain

-
{payload.value.haltChain}
-
+ +

Emergency Proposal

+ +
); + } case "parameterChange": return ( - -

Change App Parameters

- {payload.value.oldParameters ? - : null} - {payload.value.newParameters ? - : null} - -

New Parameters

-
+ +

Parameter Change Proposal

+ {payload.value.oldParameters + ? + : null} + {payload.value.newParameters + ? + : null} + +
); case "communityPoolSpend": { - const ibcValue = payload.value.transactionPlan?.value; - const ibcTypeURL = payload.value.transactionPlan?.typeUrl; return ( - -

Community Pool Spend

- {ibcValue ? ( - -

Value

-
{ibcValue}
-
- ) : null} - {ibcTypeURL?.length !== undefined ? ( - -

Proto URL Resource

-
{ibcTypeURL}
-
- ) : null} -
+ +

Community Pool Spend Proposal

+ +
); } - case "upgradePlan": + case "upgradePlan": { return ( - -

Upgrade Height

-
{payload.value.height.toString()}
-
+ +

Upgrade Plan Proposal

+ +
); - case "freezeIbcClient": + } + case "freezeIbcClient": { return ( - -

Freeze IBC Client ID

-
{payload.value.clientId}
-
+ +

Freeze IBC Client Proposal

+ +
); - case "unfreezeIbcClient": + } + case "unfreezeIbcClient": { return ( - -

Unfreeze IBC Client ID

-
{payload.value.clientId}
-
+ +

Unfreeze IBC Client Proposal

+ +
); + } // TODO: start adding UI motifs/messaging for bad/unlikely outcomes when rendering queried data. - default: - break; + default: { + return ( + +

Proposal Payload

+
N/A
+
+ ); + } } }; @@ -1046,14 +975,11 @@ const ValidatorDefinition: FC<{ validatorDefinition: ValidatorDefinitionT }> = ( ); }; -const IBCRelayAction: FC<{ ibcRelayAction: IbcRelay }> = ({ ibcRelayAction }) =>{ - const ibcValue = ibcRelayAction.rawAction?.value; - const ibcTypeURL = ibcRelayAction.rawAction?.typeUrl; +const IBCRelayAction: FC<{ ibcRelayAction: IbcRelay }> = ({ ibcRelayAction : { rawAction } }) =>{ return ( -

IBC Relay Raw Action

- {ibcValue ? : null} - {ibcTypeURL?.length !== undefined ? : null} +

IBC Relay Action

+
); }; @@ -1079,16 +1005,10 @@ const ProposalSubmit: FC<{ proposalSubmit: ProposalSubmitT }> = ({ proposalSubmi const ProposalWithdraw: FC<{ proposalWithdraw: ProposalWithdrawT }> = ({ proposalWithdraw }) => { return ( - -

Proposal Withdraw

- -

Proposal

-
{proposalWithdraw.proposal.toString()}
-
- -

Reason

-
{proposalWithdraw.reason.toString()}
-
+ +

Proposal Withdraw

+ +
); }; diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 3ee5ef8..c94fd1e 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -15,4 +15,4 @@ const Navbar : FC = () => { ); }; -export default Navbar; \ No newline at end of file +export default Navbar; diff --git a/src/lib/protobuf.ts b/src/lib/protobuf.ts index f1cf773..5543576 100644 --- a/src/lib/protobuf.ts +++ b/src/lib/protobuf.ts @@ -6,7 +6,7 @@ import { createGetter } from "./getter/create-getter"; import { SwapView, SwapView_Opaque, SwapClaimView, SwapClaimView_Opaque, type BatchSwapOutputData, type SwapPlaintext, type Position, PositionState_PositionStateEnum, type TradingFunction, type PositionOpen, type PositionClose, type PositionWithdraw, type PositionRewardClaim } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/dex/v1/dex_pb"; import { type ChangedAppParameters, DelegatorVoteView, DelegatorVoteView_Opaque, type ProposalSubmit, type ValidatorVote, type ProposalDepositClaim, type CommunityPoolSpend, type CommunityPoolOutput, type CommunityPoolDeposit } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/governance/v1/governance_pb"; import { getAsset1, getAsset2 } from "@penumbra-zone/getters/src/trading-pair"; -import type { Fee, FeeParameters } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/fee/v1/fee_pb"; +import type { Fee } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/fee/v1/fee_pb"; import type { Delegate, FundingStream, Undelegate, UndelegateClaim, ValidatorDefinition } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb"; import type { Ics20Withdrawal } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/ibc/v1/ibc_pb"; import type { ActionDutchAuctionEnd, ActionDutchAuctionSchedule, ActionDutchAuctionScheduleView, ActionDutchAuctionWithdrawView, DutchAuctionDescription } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/auction/v1/auction_pb"; @@ -576,22 +576,6 @@ export const getChangeAppAuctionParameters = createGetter((changeAppParameter?: changeAppParameter?.auctionParams ? changeAppParameter.auctionParams : undefined, ); -export const getGasPriceBlockSpacePrice = createGetter((feeParameters?: FeeParameters) => - feeParameters?.fixedGasPrices ? feeParameters.fixedGasPrices.blockSpacePrice : undefined, -); - -export const getGasPriceCompactBlockSpacePrice = createGetter((feeParameters?: FeeParameters) => - feeParameters?.fixedGasPrices ? feeParameters.fixedGasPrices.compactBlockSpacePrice : undefined, -); - -export const getGasPriceVerificationPrice = createGetter((feeParameters?: FeeParameters) => - feeParameters?.fixedGasPrices ? feeParameters.fixedGasPrices.verificationPrice : undefined, -); - -export const getGasPriceExecutionPrice = createGetter((feeParameters?: FeeParameters) => - feeParameters?.fixedGasPrices ? feeParameters.fixedGasPrices.executionPrice : undefined, -); - export const getValidatorVoteBody = createGetter((validatorVote?: ValidatorVote) => validatorVote?.body ? validatorVote.body : undefined, ); From ae11347a95f0ac25fd55636a86a9e8e7b7f99553 Mon Sep 17 00:00:00 2001 From: ejmg Date: Fri, 24 May 2024 03:05:38 -0500 Subject: [PATCH 5/8] ValidatorVote, ProposalDepositClaim, PositionOpen, PositionWithdraw, PositionRewardClaim, CommunityPoolSpend, CommunityPoolOutput, and CommunityPoolDeposit caught up. Simplified Amount, Epoch, Value, TradingFunction, and Position. --- src/components/ActionView/index.tsx | 210 ++++++++++++---------------- 1 file changed, 92 insertions(+), 118 deletions(-) diff --git a/src/components/ActionView/index.tsx b/src/components/ActionView/index.tsx index b446dc7..61c3f38 100644 --- a/src/components/ActionView/index.tsx +++ b/src/components/ActionView/index.tsx @@ -157,6 +157,7 @@ const AddressBytes = GenericKV; const OutputProof = GenericKV; const EncryptedNote = GenericKV; const AssetIdBytes = GenericKV; +const Nonce = GenericKV; const EquivalentValueView: FC<{ equivalentValue: EquivalentValueT }> = ({ equivalentValue }) => { return ( @@ -182,9 +183,10 @@ const Height: FC<{ height: HeightT }> = ({ height }) => { const Epoch: FC<{ epoch: EpochT, label?: string }> = ({ epoch, label }) => { const title = label !== undefined && label !== "" ? label : "Epoch"; return ( - - - + +

{title}

+ +
); }; @@ -210,13 +212,14 @@ const ValueView: FC<{ valueView: ValueViewT, label?: string }> = ({ valueView, l ); }; -const Value: FC<{ value: ValueT, label?: string }> = ({ value, label }) => { +const Value: FC<{ value?: ValueT, label?: string }> = ({ value, label }) => { const title = label !== undefined && label !== "" ? label : "Value"; return ( - -

{title}

- {value.amount ? : null} - {value.assetId ? : null} + +

{title}

+ {!value ?
N/A
: null} + +
); }; @@ -330,14 +333,15 @@ const OutputView: FC<{ outputView: OutputViewT }> = ({ outputView }) => { ); }; -const AssetId: FC<{ assetId: AssetIdT, label?: string }> = ({ assetId, label }) => { +const AssetId: FC<{ assetId?: AssetIdT, label?: string }> = ({ assetId, label }) => { const title = label !== undefined && label !== "" ? label : "Asset ID"; return (

{title}

- - - + {!assetId ?
N/A
: null} + {assetId?.inner ? : null} + +
); }; @@ -727,16 +731,13 @@ const TradingFunction: FC<{ tradingFunction: TradingFunctionT }> = ({ tradingFun const amountP = getTradingFunctionAmountP.optional()(tradingFunction); const tradingPair = getTradingFunctionPair.optional()(tradingFunction); return ( - -

Trading Function

- -

Fee

-
{tradingFee}
-
+ +

Trading Function

+ {/* TODO: Also, how should these values be communicated? Should BareTradingFunction be explicilty described. */} - {amountQ ? : null} - {amountP ? : null} - {tradingPair ? : null} + + +
); }; @@ -749,39 +750,33 @@ const Position: FC<{ position: PositionT }> = ({ position }) => { const positionReservesAmount1 = getPositionReservesAmount1.optional()(position); const positionReservesAmount2 = getPositionReservesAmount2.optional()(position); const closeOnFill = getPositionCloseOnFill(position); + + const positionStateValue = positionState?.state === PositionState_PositionStateEnum.UNSPECIFIED ? "UNSPECIFIED" + : positionState?.state === PositionState_PositionStateEnum.OPENED ? "OPENED" + : positionState?.state === PositionState_PositionStateEnum.CLOSED ? "CLOSED" + : positionState?.state === PositionState_PositionStateEnum.WITHDRAWN ? "WITHDRAWN" + : positionState?.state === PositionState_PositionStateEnum.CLAIMED ? "CLAIMED" + : undefined; + const hasPositionSequence = positionSequence !== undefined && positionStateValue === "WITHDRAWN"; + return ( - -

Position

+ +

Position

{phi ? : null} - -

Nonce

-
{nonce.toString()}
-
+ {positionState ? ( - -

Position State

- {positionState.state === PositionState_PositionStateEnum.UNSPECIFIED ?
UNSPECIFIED
- : positionState.state === PositionState_PositionStateEnum.OPENED ?
OPENED
- : positionState.state === PositionState_PositionStateEnum.CLOSED ?
CLOSED
- : positionState.state === PositionState_PositionStateEnum.WITHDRAWN ?
WITHDRAWN
- : null} - {positionSequence !== undefined && positionState.state === PositionState_PositionStateEnum.WITHDRAWN ? ( - -

Sequence

-
{positionSequence.toString()}
-
- ) : null} + +

Position State

+ + {hasPositionSequence ? : null}
) : null} - -

Reserves

- {positionReservesAmount1 ? : null} - {positionReservesAmount2 ? : null} + +

Reserves

+ +
- -

Close On Fill

-
{closeOnFill}
-
+
); }; @@ -922,11 +917,11 @@ const DelegatorVoteView: FC<{ delegatorVoteView: DelegatorVoteViewT }> = ({ dele

Delegator Vote Body

- {bodyProposal !== undefined ? : null} - {bodyStartPosition !== undefined ? : null} + + {bodyVote ? : null} - {bodyValue ? : null} - {bodyUnboundedAmount ? : null} + + {bodyNullifier ? : null} {bodyRK ? : null}
@@ -1023,25 +1018,16 @@ const ValidatorVote: FC<{ validatorVote: ValidatorVoteT }> = ({ validatorVote }) const bodyReason = getValidatorVoteBodyReason.optional()(validatorVote); return ( - -

Validator Vote

+ +

Validator Vote

{voteBody ? ( - - {bodyProposal ? ( - -

Proposal

-
{bodyProposal.toString()}
-
- ) : null} - {bodyVote ? : null} + +

Validator Vote Body

+ + {bodyIdKey ? : null} {bodyGovernanceKey ? : null} - {bodyReason ? ( - -

Reason

-
{bodyReason.reason}
-
- ) : null} +
) : null} {voteAuthSig ? : null} @@ -1054,31 +1040,22 @@ const ProposalDepositClaim: FC<{ proposalDepositClaim: ProposalDepositClaimT }> const proposalDepositAmount = getProposalDepositClaimAmount.optional()(proposalDepositClaim); const proposalDepositOutcome = getProposalDepositClaimOutcome.optional()(proposalDepositClaim); const withdrawReason = getProposalDepositClaimOutcomeReason.optional()(proposalDepositClaim); + const outcome = proposalDepositOutcome?.case === "passed" ? "Passed" + : proposalDepositOutcome?.case === "failed" ? "Failed" + : proposalDepositOutcome?.case === "slashed" ? "Slashed" + : undefined; return ( - -

Proposal Deposit Claim

- -

Proposal

-
{proposal.toString()}
-
- {proposalDepositAmount ? : null} + +

Proposal Deposit Claim

+ + {proposalDepositOutcome ? ( - - -

Proposal Outcome

- {proposalDepositOutcome.case === "passed" ?
Passed
- : proposalDepositOutcome.case === "failed" ?
Failed
- : proposalDepositOutcome.case === "slashed" ?
Slashed
- : null} -
- {(withdrawReason ?? "") ? ( - -

Reason

-
{withdrawReason}
-
- ) : null} + +

Proposal Outcome

+ +
- ) : null} + ) : }
); }; @@ -1086,11 +1063,11 @@ const ProposalDepositClaim: FC<{ proposalDepositClaim: ProposalDepositClaimT }> const PositionOpen: FC<{ positionOpen: PositionOpenT }> = ({ positionOpen }) => { const position = getPositionOpen.optional()(positionOpen); return ( - -

Position Open

+ +

Position Open

{position ? ( - ) : null} + ) : }
); }; @@ -1098,9 +1075,9 @@ const PositionOpen: FC<{ positionOpen: PositionOpenT }> = ({ positionOpen }) => const PositionClose: FC<{ positionClose: PositionCloseT }> = ({ positionClose }) => { const positionId = getPositionClosePositionId.optional()(positionClose); return ( - -

Position Close

- {positionId ? : null} + +

Position Close

+ {positionId ? :
N/A
}
); }; @@ -1110,14 +1087,11 @@ const PositionWithdraw: FC<{ positionWithdraw: PositionWithdrawT }> = ({ positio const balanceCommitment = getPositionWithdrawBalanceCommitment.optional()(positionWithdraw); const sequence = getPositionWithdrawSequence(positionWithdraw); return ( - -

Position Withdraw

- {positionId ? : null} + +

Position Withdraw

+ {positionId ? :
N/A
} {balanceCommitment ? : null} - -

Sequence

-
{sequence.toString()}
-
+
); }; @@ -1127,8 +1101,8 @@ const PositionRewardClaim: FC<{ positionRewardClaim: PositionRewardClaimT }> = ( const positionId = getPositionRewardClaimPositionId.optional()(positionRewardClaim); const balanceCommitment = getPositionRewardClaimBalanceCommitment.optional()(positionRewardClaim); return ( - -

Position Reward Claim

+ +

Position Reward Claim

{positionId ? : null} {balanceCommitment ? : null}
@@ -1138,9 +1112,9 @@ const PositionRewardClaim: FC<{ positionRewardClaim: PositionRewardClaimT }> = ( const CommunityPoolSpend: FC<{ communityPoolSpend: CommunityPoolSpendT }> = ({ communityPoolSpend }) => { const value = getCommunityPoolSpendValue.optional()(communityPoolSpend); return ( - -

Community Pool Spend

- {value ? : null} + +

Community Pool Spend

+
); }; @@ -1151,7 +1125,7 @@ const CommunityPoolOutput: FC<{ communityPoolOutput: CommunityPoolOutputT }> = ( return (

Community Pool Output

- {value ? : null} + {address ?
: null} ); @@ -1162,7 +1136,7 @@ const CommunityPoolDeposit: FC<{ communityPoolDeposit: CommunityPoolDepositT }> return (

Community Pool Deposit

- {value ? : null} +
); }; @@ -1241,8 +1215,8 @@ const Delegate: FC<{ delegate: DelegateT }> = ({ delegate }) => {

Delegate

{validatorID ? : null} - {unbondedAmount ? : null} - {delegationAmount ? : null} + + ); }; @@ -1260,8 +1234,8 @@ const Undelegate: FC<{ undelegate: UndelegateT }> = ({ undelegate }) => {

Undelegate

{validatorID ? : null} - {unbondedAmount ? : null} - {delegationAmount ? : null} + + {fromEpoch ? : null} ); @@ -1286,10 +1260,10 @@ const ActionDutchActionScheduleView: FC<{ dutchAuctionScheduleView: ActionDutchA

Action Dutch Auction Schedule View

Dutch Action Description

- {input ? : null} - {outputId ? : null} - {maxOutput ? : null} - {minOutput ? : null} + + + +

Start Height

{startHeight.toString()}
From 4a9fed8e840912eb7c23f597ac6c8b18506e8e89 Mon Sep 17 00:00:00 2001 From: ejmg Date: Fri, 24 May 2024 03:43:51 -0500 Subject: [PATCH 6/8] changed GenericKV's param list to match TxRow, about to refactor to a single row type. --- src/components/ActionView/index.tsx | 215 +++++++++++------------ src/components/TransactionView/index.tsx | 4 +- 2 files changed, 102 insertions(+), 117 deletions(-) diff --git a/src/components/ActionView/index.tsx b/src/components/ActionView/index.tsx index 61c3f38..586f611 100644 --- a/src/components/ActionView/index.tsx +++ b/src/components/ActionView/index.tsx @@ -74,14 +74,18 @@ function useCopyToClipboard() { return copyToClipboard; }; -const TxRow: FC<{ label: string, value?: string | bigint | number | boolean, className?: string }> = ({ label: name, value, className }) => { +const TxRow: FC<{ label: string, value?: string | bigint | Uint8Array | number | boolean, className?: string }> = ({ label: name, value, className }) => { const copyToClipboard = useCopyToClipboard(); let text : string; if (value !== undefined) { - if (typeof value === "number" || typeof value === "bigint" || typeof value === "boolean") { + if (typeof value === "string") { + text = value !== "" ? value : "N/A"; + } else if (typeof value === "number" || typeof value === "bigint" || typeof value === "boolean") { text = value.toString(); + } else if (Object.prototype.toString.call(value) === "[object Uint8Array]") { + text = uint8ArrayToBase64(value); } else { - text = value !== "" ? value : "N/A"; + text = "N/A"; } } else { text = "N/A"; @@ -104,7 +108,7 @@ const TxRow: FC<{ label: string, value?: string | bigint | number | boolean, cla ); }; -export const GenericKV: FC<{ name: string, value: Uint8Array, className?: string }> = ({ name, value, className }) => { +export const GenericKV: FC<{ label: string, value: Uint8Array, className?: string }> = ({ label: name, value, className }) => { const base64Value = uint8ArrayToBase64(value); const copyToClipboard = useCopyToClipboard(); @@ -161,9 +165,9 @@ const Nonce = GenericKV; const EquivalentValueView: FC<{ equivalentValue: EquivalentValueT }> = ({ equivalentValue }) => { return ( - -

Equivalent Value

- {equivalentValue.equivalentAmount ? : null} + +

Equivalent Value

+ {equivalentValue.numeraire ? : null}
@@ -206,7 +210,7 @@ const ValueView: FC<{ valueView: ValueViewT, label?: string }> = ({ valueView, l {metadata ? : null} {equivalentValues?.map((equivalentValue, i) => )} - {extendedMetadata ? : null} + {valueView.valueView.case === "unknownAssetId" ? : null}
); @@ -228,20 +232,22 @@ const NotePayload: FC<{ notePayload: NotePayloadT }> = ({ notePayload }) => { return (

Note Payload

- {notePayload.noteCommitment ? : null} - - {notePayload.encryptedNote ? : null} + {notePayload.noteCommitment ? : null} + + {notePayload.encryptedNote ? : null}
); }; -const Address :FC<{ address: AddressT }> = ({ address }) => { +const Address :FC<{ address?: AddressT }> = ({ address }) => { return ( - +

Address

- - + {!address ?
N/A
: null} + {/* NOTE: Keep these components gated behind the address check */} + {address ? : null} + {address ? : null}
); }; @@ -251,7 +257,7 @@ const AddressIndex : FC<{ index: AddressIndexT }> = ({ index }) => {

Address Index

- +
); }; @@ -263,7 +269,7 @@ const AddressView: FC<{ addressView: AddressViewT }> = ({ addressView }) => {

Address View

{addressIndex ? : null} - {walletId ? : null} + {walletId ? : null}
); }; @@ -274,7 +280,7 @@ const NoteView : FC<{note: NoteViewT}>= ({ note }) => {

Note View

{note.address ? : null} - +
); }; @@ -290,14 +296,14 @@ const SpendView : FC<{ spendView: SpendViewT }> = ({ spendView }) => { return (

Spend View

- {spendProof ? : null} - {spendAuthSig ? : null} + {spendProof ? : null} + {spendAuthSig ? : null} {(spendBodyNullifier ?? spendBodyRk) ?? spendBodyBalance ? (

Spend Body

- {spendBodyNullifier ? : null} - {spendBodyRk ? : null} - {spendBodyBalance ? : null} + {spendBodyNullifier ? : null} + {spendBodyRk ? : null} + {spendBodyBalance ? : null}
) : null} {noteView ? : null} @@ -320,14 +326,14 @@ const OutputView: FC<{ outputView: OutputViewT }> = ({ outputView }) => {

Output View

{noteView ? : null} - {payloadKey ? : null} + {payloadKey ? : null}

Output Body

{bodyNotePayload ? : null} - {bodyBalanceCommitment ? : null} - - - {outputProof ? : null} + {bodyBalanceCommitment ? : null} + + + {outputProof ? : null}
); @@ -339,7 +345,7 @@ const AssetId: FC<{ assetId?: AssetIdT, label?: string }> = ({ assetId, label })

{title}

{!assetId ?
N/A
: null} - {assetId?.inner ? : null} + {assetId?.inner ? : null}
@@ -385,8 +391,8 @@ const SwapPayload: FC<{ swapPayload: SwapPayloadT }> = ({ swapPayload }) => { return (

Swap Payload

- {swapPayload.commitment ? : null} - + {swapPayload.commitment ? : null} +
); }; @@ -449,7 +455,7 @@ const Fee: FC<{ fee: FeeT}> = ({ fee }) => {

Fee

- {assetId ? : null} +
); }; @@ -458,7 +464,7 @@ const GasPrices: FC<{ gasPrices: GasPricesT, label: "Fixed Gas Prices" | "Fixed return (

{label}

- {gasPrices.assetId ? : null} + @@ -501,7 +507,7 @@ const SwapPlaintext: FC<{ swapPlaintext: SwapPlaintextT }> = ({ swapPlaintext })
- + ); }; @@ -763,11 +769,12 @@ const Position: FC<{ position: PositionT }> = ({ position }) => {

Position

{phi ? : null} - + {positionState ? (

Position State

+ {/* NOTE: Keep gated behind hasPositionSequence, only valid when WITHDRAWN is also true */} {hasPositionSequence ? : null}
) : null} @@ -809,7 +816,7 @@ const SwapViewVisible: FC<{ swapView: SwapViewT }> = ({ swapView }) => { return ( - {transactionId ? : null} + {transactionId ? : null} {batchSwapOutput ? : null} {noteOuput1 ? : null} {noteOuput2 ? : null} @@ -829,13 +836,13 @@ const SwapView: FC<{ swapView: SwapViewT }> = ({ swapView }) => { return (

Swap View

- {swapProof? : null} + {swapProof? : null}

Swap Body

- +
{swapView.swapView.case === "visible" ? ( @@ -872,21 +879,21 @@ const SwapClaimView: FC<{ swapClaimView: SwapClaimViewT}> = ({ swapClaimView })

Swap Claim View

- {swapClaimProof ? : null} + {swapClaimProof ? : null} {swapClaimBody ? (

Swap Claim Body

- {bodyNullifier ? : null} + {bodyNullifier ? : null} {bodyFee ? : null} - {bodyOutput1Commitment ? : null} - {bodyOutput2Commitment ? : null} + {bodyOutput1Commitment ? : null} + {bodyOutput2Commitment ? : null} {bodyOutputData ? : null}
) : null} {isVisible && swapClaimNoteOutput1 ? : null} {isVisible && swapClaimNoteOutput2 ? : null} - {isVisible && swapClaimTxId ? : null} + {isVisible && swapClaimTxId ? : null}
); @@ -919,15 +926,15 @@ const DelegatorVoteView: FC<{ delegatorVoteView: DelegatorVoteViewT }> = ({ dele - {bodyVote ? : null} + - {bodyNullifier ? : null} - {bodyRK ? : null} + {bodyNullifier ? : null} + {bodyRK ? : null}
) : null} - {delegatorVoteAuthSig ? : null} - {delegatorVoteProof ? : null} + {delegatorVoteAuthSig ? : null} + {delegatorVoteProof ? : null}
{isVisible && delegatorVoteViewNote ? : null}
@@ -951,8 +958,8 @@ const ValidatorDefinition: FC<{ validatorDefinition: ValidatorDefinitionT }> = ( return (

Validator Definition

- {validatorIdKey ? : null} - {validatorConsensusKey ? : null} + {validatorIdKey ? : null} + {validatorConsensusKey ? : null} @@ -963,9 +970,9 @@ const ValidatorDefinition: FC<{ validatorDefinition: ValidatorDefinitionT }> = ( {validatorFundingStreams.map((fundingStream, i) => )}
) : null} - {validatorSequenceNumber !== undefined ? : null} - {validatorGovernanceKey ? : null} - {validatorAuthSig ? : null} + + {validatorGovernanceKey ? : null} + {validatorAuthSig ? : null} ); }; @@ -992,7 +999,7 @@ const ProposalSubmit: FC<{ proposalSubmit: ProposalSubmitT }> = ({ proposalSubmi {proposalPayload ? : null} - {proposalSubmitAmount ? : null} + ); @@ -1025,12 +1032,12 @@ const ValidatorVote: FC<{ validatorVote: ValidatorVoteT }> = ({ validatorVote })

Validator Vote Body

- {bodyIdKey ? : null} - {bodyGovernanceKey ? : null} + {bodyIdKey ? : null} + {bodyGovernanceKey ? : null} ) : null} - {voteAuthSig ? : null} + {voteAuthSig ? : null} ); }; @@ -1077,7 +1084,7 @@ const PositionClose: FC<{ positionClose: PositionCloseT }> = ({ positionClose }) return (

Position Close

- {positionId ? :
N/A
} + {positionId ? :
N/A
}
); }; @@ -1089,8 +1096,8 @@ const PositionWithdraw: FC<{ positionWithdraw: PositionWithdrawT }> = ({ positio return (

Position Withdraw

- {positionId ? :
N/A
} - {balanceCommitment ? : null} + {positionId ? :
N/A
} + {balanceCommitment ? : null}
); @@ -1103,8 +1110,8 @@ const PositionRewardClaim: FC<{ positionRewardClaim: PositionRewardClaimT }> = ( return (

Position Reward Claim

- {positionId ? : null} - {balanceCommitment ? : null} + {positionId ? : null} + {balanceCommitment ? : null}
); }; @@ -1126,7 +1133,7 @@ const CommunityPoolOutput: FC<{ communityPoolOutput: CommunityPoolOutputT }> = (

Community Pool Output

- {address ?
: null} +
); }; @@ -1153,12 +1160,12 @@ const UndelegateClaim: FC<{ undelegateClaim: UndelegateClaimT }> = ({ undelegate return (

Undelegate Claim

- {validatorID ? : null} + {validatorID ? : null} - {penalty ? : null} - {balanceCommitment ? : null} + {penalty ? : null} + {balanceCommitment ? : null} - +
); }; @@ -1173,19 +1180,11 @@ const Ics20Withdrawal: FC<{ ics20Withdrawal: Ics20WithdrawalT }> = ({ ics20Withd const sourceChannel = getIcs20WithdrawalSourceChannel(ics20Withdrawal); return ( - -

ICS20 Withdrawal

- {withdrawalAmount ? : null} - {(denom ?? "") ? ( - -

Denom

-
{denom}
-
- ) : null} - -

Destination Address

-
{destinationAddress}
-
+ +

ICS20 Withdrawal

+ + + {returnAddress ? (

Return Address

@@ -1213,7 +1212,7 @@ const Delegate: FC<{ delegate: DelegateT }> = ({ delegate }) => { return (

Delegate

- {validatorID ? : null} + {validatorID ? : null} @@ -1232,7 +1231,7 @@ const Undelegate: FC<{ undelegate: UndelegateT }> = ({ undelegate }) => { return (

Undelegate

- {validatorID ? : null} + {validatorID ? : null} @@ -1256,32 +1255,20 @@ const ActionDutchActionScheduleView: FC<{ dutchAuctionScheduleView: ActionDutchA const inputMetadata = getActionDutchAuctionScheduleViewInputMetadata.optional()(dutchAuctionScheduleView); const outputMetadata = getActionDutchAuctionScheduleViewOutputMetadata.optional()(dutchAuctionScheduleView); return ( - -

Action Dutch Auction Schedule View

- -

Dutch Action Description

+ +

Action Dutch Auction Schedule View

+ +

Dutch Action Description

- -

Start Height

-
{startHeight.toString()}
-
- -

End Height

-
{endHeight.toString()}
-
- -

Step Count

-
{stepCount.toString()}
-
- -

Nonce

-
{nonce.toString()}
-
+ + + +
- {auctionId ? : null} + {auctionId ? : null} {inputMetadata ? : null} {outputMetadata ? : null}
@@ -1291,9 +1278,9 @@ const ActionDutchActionScheduleView: FC<{ dutchAuctionScheduleView: ActionDutchA const ActionDutchAuctionEnd: FC<{ actionDutchAuctionEnd: ActionDutchAuctionEndT }> = ({ actionDutchAuctionEnd }) => { const auctionId = getAuctionIdFromActionDutchAuctionEnd.optional()(actionDutchAuctionEnd); return ( - -

Action Dutch Auction End

- {auctionId ? : null} + +

Action Dutch Auction End

+ {auctionId ? : null}
); }; @@ -1304,16 +1291,14 @@ const ActionDutchAuctionWithdrawView: FC<{ actionDutchAuctionWithdrawView: Actio const reservesCommitment = getReservesCommitmentFromActionDutchAuctionWithdrawView.optional()(actionDutchAuctionWithdrawView); const reserves = getReservesFromActionDutchAuctionWithdrawView(actionDutchAuctionWithdrawView); return ( - - {auctionId ? : null} - -

Sequence

-
{seq.toString()}
-
- {reservesCommitment ? : null} + +

Action Dutch Auction Withdraw View

+ {auctionId ? : null} + + {reservesCommitment ? : null} {reserves.length !== 0 ? ( - -

Reserves

+ +

Reserves

{reserves.map((valueView, i) => )}
) : null} diff --git a/src/components/TransactionView/index.tsx b/src/components/TransactionView/index.tsx index 3cf2a8a..821efe4 100644 --- a/src/components/TransactionView/index.tsx +++ b/src/components/TransactionView/index.tsx @@ -43,8 +43,8 @@ export const TransactionView : FC = ({ tx }) => {

Transaction View

{txView.bodyView ? : "None"} - {txView.bindingSig ? : null} - {txView.anchor ? : null} + {txView.bindingSig ? : null} + {txView.anchor ? : null}
); }; From bccede99479930c66664e50722d198e9533c324b Mon Sep 17 00:00:00 2001 From: ejmg Date: Fri, 24 May 2024 04:03:11 -0500 Subject: [PATCH 7/8] removed GenericKV and replaced with TxRow. Renamed TxRow to ActionRow. Removed all unnecessary ternary checks. --- src/components/ActionView/index.tsx | 379 +++++++++++++--------------- 1 file changed, 177 insertions(+), 202 deletions(-) diff --git a/src/components/ActionView/index.tsx b/src/components/ActionView/index.tsx index 586f611..81da9b0 100644 --- a/src/components/ActionView/index.tsx +++ b/src/components/ActionView/index.tsx @@ -74,7 +74,7 @@ function useCopyToClipboard() { return copyToClipboard; }; -const TxRow: FC<{ label: string, value?: string | bigint | Uint8Array | number | boolean, className?: string }> = ({ label: name, value, className }) => { +const ActionRow: FC<{ label: string, value?: string | bigint | Uint8Array | number | boolean, className?: string }> = ({ label: name, value, className }) => { const copyToClipboard = useCopyToClipboard(); let text : string; if (value !== undefined) { @@ -108,60 +108,36 @@ const TxRow: FC<{ label: string, value?: string | bigint | Uint8Array | number | ); }; -export const GenericKV: FC<{ label: string, value: Uint8Array, className?: string }> = ({ label: name, value, className }) => { - - const base64Value = uint8ArrayToBase64(value); - const copyToClipboard = useCopyToClipboard(); - - return ( - -
-

{name}

-
-
-
 {
-            void (async () => {
-              await copyToClipboard(base64Value);
-            })();
-        }}>{base64Value}
-
-
- ); -}; - -// TODO: Fold logic of GenericKV into TxRow and we eliminate all of this. -// TODO: Would also be useful because it would eliminate a lot of undefine checks while also visibly signaling that a field is missing. -const OvkWrappedKey = GenericKV; -const WrappedMemoKey = GenericKV; -const EphemeralKey = GenericKV; -const ZKSwapProof = GenericKV; -const StateCommitment = GenericKV; -const BalanceCommitment = GenericKV; -const EncryptedSwap = GenericKV; -const RSeed = GenericKV; -const TransactionId = GenericKV; -const Nullifier = GenericKV; -const SpendAuthSignature = GenericKV; -const SpendVerificationKey = GenericKV; -const SpendProof = GenericKV; -const ZKDelegatorVoteProof = GenericKV; -const AuthSignature = GenericKV; -const IdentityKey = GenericKV; -const GovernanceKey = GenericKV; -const ConsensusKey = GenericKV; -const PositionId = GenericKV; -const Penalty = GenericKV; -const UndelegateClaimProof = GenericKV; -const AuctionId = GenericKV; -const PayloadKey = GenericKV; -const WalletId = GenericKV; -const IndexRandomizer = GenericKV; -const AddressBytes = GenericKV; -const OutputProof = GenericKV; -const EncryptedNote = GenericKV; -const AssetIdBytes = GenericKV; -const Nonce = GenericKV; +const OvkWrappedKey = ActionRow; +const WrappedMemoKey = ActionRow; +const EphemeralKey = ActionRow; +const ZKSwapProof = ActionRow; +const StateCommitment = ActionRow; +const BalanceCommitment = ActionRow; +const EncryptedSwap = ActionRow; +const RSeed = ActionRow; +const TransactionId = ActionRow; +const Nullifier = ActionRow; +const SpendAuthSignature = ActionRow; +const SpendVerificationKey = ActionRow; +const SpendProof = ActionRow; +const ZKDelegatorVoteProof = ActionRow; +const AuthSignature = ActionRow; +const IdentityKey = ActionRow; +const GovernanceKey = ActionRow; +const ConsensusKey = ActionRow; +const PositionId = ActionRow; +const Penalty = ActionRow; +const UndelegateClaimProof = ActionRow; +const AuctionId = ActionRow; +const PayloadKey = ActionRow; +const WalletId = ActionRow; +const IndexRandomizer = ActionRow; +const AddressBytes = ActionRow; +const OutputProof = ActionRow; +const EncryptedNote = ActionRow; +const AssetIdBytes = ActionRow; +const Nonce = ActionRow; const EquivalentValueView: FC<{ equivalentValue: EquivalentValueT }> = ({ equivalentValue }) => { return ( @@ -169,7 +145,7 @@ const EquivalentValueView: FC<{ equivalentValue: EquivalentValueT }> = ({ equiva

Equivalent Value

{equivalentValue.numeraire ? : null} - +
); }; @@ -178,8 +154,8 @@ const Height: FC<{ height: HeightT }> = ({ height }) => { return (

Height

- - + +
); }; @@ -189,8 +165,8 @@ const Epoch: FC<{ epoch: EpochT, label?: string }> = ({ epoch, label }) => { return (

{title}

- - + +
); }; @@ -210,7 +186,7 @@ const ValueView: FC<{ valueView: ValueViewT, label?: string }> = ({ valueView, l {metadata ? : null} {equivalentValues?.map((equivalentValue, i) => )} - + {valueView.valueView.case === "unknownAssetId" ? : null}
); @@ -232,9 +208,9 @@ const NotePayload: FC<{ notePayload: NotePayloadT }> = ({ notePayload }) => { return (

Note Payload

- {notePayload.noteCommitment ? : null} + - {notePayload.encryptedNote ? : null} +
); }; @@ -246,8 +222,8 @@ const Address :FC<{ address?: AddressT }> = ({ address }) => {

Address

{!address ?
N/A
: null} {/* NOTE: Keep these components gated behind the address check */} - {address ? : null} - {address ? : null} + + {address ? : null}
); }; @@ -256,7 +232,7 @@ const AddressIndex : FC<{ index: AddressIndexT }> = ({ index }) => { return (

Address Index

- +
); @@ -269,7 +245,7 @@ const AddressView: FC<{ addressView: AddressViewT }> = ({ addressView }) => {

Address View

{addressIndex ? : null} - {walletId ? : null} +
); }; @@ -296,14 +272,14 @@ const SpendView : FC<{ spendView: SpendViewT }> = ({ spendView }) => { return (

Spend View

- {spendProof ? : null} - {spendAuthSig ? : null} + + {(spendBodyNullifier ?? spendBodyRk) ?? spendBodyBalance ? (

Spend Body

- {spendBodyNullifier ? : null} - {spendBodyRk ? : null} - {spendBodyBalance ? : null} + + +
) : null} {noteView ? : null} @@ -326,14 +302,14 @@ const OutputView: FC<{ outputView: OutputViewT }> = ({ outputView }) => {

Output View

{noteView ? : null} - {payloadKey ? : null} +

Output Body

{bodyNotePayload ? : null} - {bodyBalanceCommitment ? : null} + - {outputProof ? : null} +
); @@ -344,10 +320,9 @@ const AssetId: FC<{ assetId?: AssetIdT, label?: string }> = ({ assetId, label }) return (

{title}

- {!assetId ?
N/A
: null} - {assetId?.inner ? : null} - - + + +
); }; @@ -391,7 +366,7 @@ const SwapPayload: FC<{ swapPayload: SwapPayloadT }> = ({ swapPayload }) => { return (

Swap Payload

- {swapPayload.commitment ? : null} +
); @@ -417,10 +392,10 @@ const BatchSwapOutputData: FC<{ batchSwapOutput: BatchSwapOutputDataT }> = ({ ba - + - - + +
); }; @@ -431,19 +406,19 @@ const Metadata: FC<{ metaData: MetadataT, label?: string }> = ({ metaData, label return (

{title}

- - - + + + - - + + {/* TODO: This needs to be fleshed out. Skipping aliases and information for exponents. Could easily blow up the UI without collapsable elements as it is. */}

Denomination Units

{metaData.denomUnits.map((denomUnit, i) =>
{denomUnit.denom}
)}
{/* TODO: Skipping AssetImage images field entirely */} - +
); }; @@ -465,9 +440,9 @@ const GasPrices: FC<{ gasPrices: GasPricesT, label: "Fixed Gas Prices" | "Fixed

{label}

- - - + + +
); }; @@ -478,16 +453,16 @@ const FundingStream: FC<{ fundingStream: FundingStreamT }> = ({ fundingStream }) if (fundingStreamToAddress !== undefined) { return ( - - - + + + ); } else { return ( - - + + ); } @@ -533,45 +508,45 @@ const ChangeParameters: FC<{ {sctParameters ? (

SCT Parameters

- +
) : null} {communityPoolParameters ? (

Community Pool Parameters

- +
) : null} {governanceParameters ? (

Governance Parameters

- + - - - + + +
) : null} {ibcParameters ? (

IBC Parameters

- - - + + +
) : null} {stakeParameters ? (

Stake Parameters

- - - - - - - + + + + + + + - +
) : null} {feeParameters ? ( @@ -579,18 +554,18 @@ const ChangeParameters: FC<{

Fee Parameters

{feeParameters.fixedGasPrices ? - : } + : } {feeParameters.fixedAltGasPrices.length !== 0 ? ( {feeParameters.fixedAltGasPrices.map((gasPrices, i) => )} - ) : } + ) : }
) : null} {distributionParameters ? (

Distribution Parameters

- +
) : null} {fundingParameters ? ( @@ -606,22 +581,22 @@ const ChangeParameters: FC<{ {shieldedParameters.fixedFmdParams ? (

FmdParameters

- - + +
- ) : } + ) : }
) : null} {dexParameters ? (

Dex Parameters

- +

Fixed Candidates

{dexParameters.fixedCandidates.map((assetId, i) => )}
- - + +
) : null} {auctionParameters ? ( @@ -644,9 +619,9 @@ const EncodedParameters: FC<{ encodedParameters: EncodedParameterT[], label: "Pr {encodedParameters.map((parameter, i) => (

{title}

- - - + + +
))}
@@ -659,7 +634,7 @@ const ProposalPayload: FC<{ payload: ProposalSubmitKind }> = ({ payload }) => { return (

Signaling Proposal

- +
); } @@ -667,7 +642,7 @@ const ProposalPayload: FC<{ payload: ProposalSubmitKind }> = ({ payload }) => { return (

Emergency Proposal

- +
); } @@ -689,7 +664,7 @@ const ProposalPayload: FC<{ payload: ProposalSubmitKind }> = ({ payload }) => { return (

Community Pool Spend Proposal

- +
); } @@ -697,7 +672,7 @@ const ProposalPayload: FC<{ payload: ProposalSubmitKind }> = ({ payload }) => { return (

Upgrade Plan Proposal

- +
); } @@ -705,7 +680,7 @@ const ProposalPayload: FC<{ payload: ProposalSubmitKind }> = ({ payload }) => { return (

Freeze IBC Client Proposal

- +
); } @@ -713,7 +688,7 @@ const ProposalPayload: FC<{ payload: ProposalSubmitKind }> = ({ payload }) => { return (

Unfreeze IBC Client Proposal

- +
); } @@ -739,7 +714,7 @@ const TradingFunction: FC<{ tradingFunction: TradingFunctionT }> = ({ tradingFun return (

Trading Function

- + {/* TODO: Also, how should these values be communicated? Should BareTradingFunction be explicilty described. */} @@ -773,9 +748,9 @@ const Position: FC<{ position: PositionT }> = ({ position }) => { {positionState ? (

Position State

- + {/* NOTE: Keep gated behind hasPositionSequence, only valid when WITHDRAWN is also true */} - {hasPositionSequence ? : null} + {hasPositionSequence ? : null}
) : null} @@ -783,7 +758,7 @@ const Position: FC<{ position: PositionT }> = ({ position }) => { - +
); }; @@ -816,7 +791,7 @@ const SwapViewVisible: FC<{ swapView: SwapViewT }> = ({ swapView }) => { return ( - {transactionId ? : null} + {batchSwapOutput ? : null} {noteOuput1 ? : null} {noteOuput2 ? : null} @@ -836,7 +811,7 @@ const SwapView: FC<{ swapView: SwapViewT }> = ({ swapView }) => { return (

Swap View

- {swapProof? : null} +

Swap Body

@@ -879,18 +854,18 @@ const SwapClaimView: FC<{ swapClaimView: SwapClaimViewT}> = ({ swapClaimView })

Swap Claim View

- {swapClaimProof ? : null} + {swapClaimBody ? (

Swap Claim Body

- {bodyNullifier ? : null} + {bodyFee ? : null} - {bodyOutput1Commitment ? : null} - {bodyOutput2Commitment ? : null} + + {bodyOutputData ? : null}
) : null} - + {isVisible && swapClaimNoteOutput1 ? : null} {isVisible && swapClaimNoteOutput2 ? : null} {isVisible && swapClaimTxId ? : null} @@ -923,18 +898,18 @@ const DelegatorVoteView: FC<{ delegatorVoteView: DelegatorVoteViewT }> = ({ dele {delegatorVoteBody ? (

Delegator Vote Body

- - - - + + + + - {bodyNullifier ? : null} - {bodyRK ? : null} + +
) : null} - {delegatorVoteAuthSig ? : null} - {delegatorVoteProof ? : null} + +
{isVisible && delegatorVoteViewNote ? : null}
@@ -958,21 +933,21 @@ const ValidatorDefinition: FC<{ validatorDefinition: ValidatorDefinitionT }> = ( return (

Validator Definition

- {validatorIdKey ? : null} - {validatorConsensusKey ? : null} - - - - + + + + + + {validatorFundingStreams?.length !== undefined ? (

Funding Streams

{validatorFundingStreams.map((fundingStream, i) => )}
) : null} - - {validatorGovernanceKey ? : null} - {validatorAuthSig ? : null} + + +
); }; @@ -981,7 +956,7 @@ const IBCRelayAction: FC<{ ibcRelayAction: IbcRelay }> = ({ ibcRelayAction : { r return (

IBC Relay Action

- +
); }; @@ -995,9 +970,9 @@ const ProposalSubmit: FC<{ proposalSubmit: ProposalSubmitT }> = ({ proposalSubmi return (

Proposal Submit

- - - + + + {proposalPayload ? : null}
@@ -1009,8 +984,8 @@ const ProposalWithdraw: FC<{ proposalWithdraw: ProposalWithdrawT }> = ({ proposa return (

Proposal Withdraw

- - + +
); }; @@ -1030,14 +1005,14 @@ const ValidatorVote: FC<{ validatorVote: ValidatorVoteT }> = ({ validatorVote }) {voteBody ? (

Validator Vote Body

- - - {bodyIdKey ? : null} - {bodyGovernanceKey ? : null} - + + + + +
) : null} - {voteAuthSig ? : null} +
); }; @@ -1054,15 +1029,15 @@ const ProposalDepositClaim: FC<{ proposalDepositClaim: ProposalDepositClaimT }> return (

Proposal Deposit Claim

- + {proposalDepositOutcome ? (

Proposal Outcome

- - + +
- ) : } + ) : }
); }; @@ -1074,7 +1049,7 @@ const PositionOpen: FC<{ positionOpen: PositionOpenT }> = ({ positionOpen }) =>

Position Open

{position ? ( - ) : } + ) : }
); }; @@ -1084,7 +1059,7 @@ const PositionClose: FC<{ positionClose: PositionCloseT }> = ({ positionClose }) return (

Position Close

- {positionId ? :
N/A
} +
); }; @@ -1096,9 +1071,9 @@ const PositionWithdraw: FC<{ positionWithdraw: PositionWithdrawT }> = ({ positio return (

Position Withdraw

- {positionId ? :
N/A
} - {balanceCommitment ? : null} - + + +
); }; @@ -1110,8 +1085,8 @@ const PositionRewardClaim: FC<{ positionRewardClaim: PositionRewardClaimT }> = ( return (

Position Reward Claim

- {positionId ? : null} - {balanceCommitment ? : null} + +
); }; @@ -1160,11 +1135,11 @@ const UndelegateClaim: FC<{ undelegateClaim: UndelegateClaimT }> = ({ undelegate return (

Undelegate Claim

- {validatorID ? : null} - - {penalty ? : null} - {balanceCommitment ? : null} - + + + + +
); @@ -1183,8 +1158,8 @@ const Ics20Withdrawal: FC<{ ics20Withdrawal: Ics20WithdrawalT }> = ({ ics20Withd

ICS20 Withdrawal

- - + + {returnAddress ? (

Return Address

@@ -1212,8 +1187,8 @@ const Delegate: FC<{ delegate: DelegateT }> = ({ delegate }) => { return (

Delegate

- {validatorID ? : null} - + +
@@ -1231,8 +1206,8 @@ const Undelegate: FC<{ undelegate: UndelegateT }> = ({ undelegate }) => { return (

Undelegate

- {validatorID ? : null} - + + {fromEpoch ? : null} @@ -1263,12 +1238,12 @@ const ActionDutchActionScheduleView: FC<{ dutchAuctionScheduleView: ActionDutchA - - - + + +
- {auctionId ? : null} + {inputMetadata ? : null} {outputMetadata ? : null}
@@ -1280,7 +1255,7 @@ const ActionDutchAuctionEnd: FC<{ actionDutchAuctionEnd: ActionDutchAuctionEndT return (

Action Dutch Auction End

- {auctionId ? : null} +
); }; @@ -1293,9 +1268,9 @@ const ActionDutchAuctionWithdrawView: FC<{ actionDutchAuctionWithdrawView: Actio return (

Action Dutch Auction Withdraw View

- {auctionId ? : null} - - {reservesCommitment ? : null} + + + {reserves.length !== 0 ? (

Reserves

From 3aecde38e48f99ef2dad34cde346808fe6f96897 Mon Sep 17 00:00:00 2001 From: ejmg Date: Fri, 24 May 2024 04:05:41 -0500 Subject: [PATCH 8/8] exported ActionRow --- pnpm-lock.yaml | 32 ++++++++++++------------ src/components/ActionView/index.tsx | 2 +- src/components/TransactionView/index.tsx | 6 ++--- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 57e86e1..1142a7a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^1.8.0-20240215124455-b32ecf3ebbcb.2 version: 1.8.0-20240327103030-e2006674271c.2(@bufbuild/protobuf@1.7.2) '@buf/penumbra-zone_penumbra.bufbuild_es': - specifier: ^1.9.0-20240426013425-8bd0992b1afd.1 - version: 1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2) + specifier: ^1.9.0-20240516191513-d29d4eb45a4b.1 + version: 1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2) '@bufbuild/protobuf': specifier: ^1.4.2 version: 1.7.2 @@ -28,10 +28,10 @@ importers: version: 1.23.0(@types/react@18.2.28)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@penumbra-zone/getters': specifier: ^2.0.0 - version: 2.0.1(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2))(@bufbuild/protobuf@1.7.2) + version: 2.0.1(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2))(@bufbuild/protobuf@1.7.2) '@penumbra-zone/types': specifier: ^2.0.0 - version: 2.0.1(@buf/cosmos_ibc.bufbuild_es@1.8.0-20240327103030-e2006674271c.2(@bufbuild/protobuf@1.7.2))(@buf/cosmos_ibc.connectrpc_es@1.4.0-20240327103030-e2006674271c.2(@bufbuild/protobuf@1.7.2)(@connectrpc/connect@1.3.0(@bufbuild/protobuf@1.7.2)))(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2))(@buf/penumbra-zone_penumbra.connectrpc_es@1.4.0-20240331004851-c3b058e666bc.2(@bufbuild/protobuf@1.7.2)(@connectrpc/connect@1.3.0(@bufbuild/protobuf@1.7.2)))(@bufbuild/protobuf@1.7.2) + version: 2.0.1(@buf/cosmos_ibc.bufbuild_es@1.8.0-20240327103030-e2006674271c.2(@bufbuild/protobuf@1.7.2))(@buf/cosmos_ibc.connectrpc_es@1.4.0-20240327103030-e2006674271c.2(@bufbuild/protobuf@1.7.2)(@connectrpc/connect@1.3.0(@bufbuild/protobuf@1.7.2)))(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2))(@buf/penumbra-zone_penumbra.connectrpc_es@1.4.0-20240331004851-c3b058e666bc.2(@bufbuild/protobuf@1.7.2)(@connectrpc/connect@1.3.0(@bufbuild/protobuf@1.7.2)))(@bufbuild/protobuf@1.7.2) '@prisma/client': specifier: ^5.4.1 version: 5.4.2(prisma@5.4.2) @@ -371,8 +371,8 @@ packages: peerDependencies: '@bufbuild/protobuf': ^1.7.2 - '@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240501193854-ea3cc743390d.1': - resolution: {tarball: https://buf.build/gen/npm/v1/@buf/penumbra-zone_penumbra.bufbuild_es/-/penumbra-zone_penumbra.bufbuild_es-1.9.0-20240501193854-ea3cc743390d.1.tgz} + '@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240524044626-61ea2a2f7b91.1': + resolution: {tarball: https://buf.build/gen/npm/v1/@buf/penumbra-zone_penumbra.bufbuild_es/-/penumbra-zone_penumbra.bufbuild_es-1.9.0-20240524044626-61ea2a2f7b91.1.tgz} peerDependencies: '@bufbuild/protobuf': ^1.9.0 @@ -2677,7 +2677,7 @@ snapshots: '@buf/googleapis_googleapis.bufbuild_es': 1.7.2-20221214150216-75b4300737fb.1(@bufbuild/protobuf@1.7.2) '@bufbuild/protobuf': 1.7.2 - '@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2)': + '@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2)': dependencies: '@buf/cosmos_cosmos-proto.bufbuild_es': 1.9.0-20211202220400-1935555c206d.1(@bufbuild/protobuf@1.7.2) '@buf/cosmos_cosmos-sdk.bufbuild_es': 1.9.0-20230522115704-e7a85cef453e.1(@bufbuild/protobuf@1.7.2) @@ -2819,28 +2819,28 @@ snapshots: dependencies: bech32: 2.0.0 - '@penumbra-zone/constants@3.0.0(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2))(@bufbuild/protobuf@1.7.2)': + '@penumbra-zone/constants@3.0.0(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2))(@bufbuild/protobuf@1.7.2)': dependencies: - '@buf/penumbra-zone_penumbra.bufbuild_es': 1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2) + '@buf/penumbra-zone_penumbra.bufbuild_es': 1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2) '@bufbuild/protobuf': 1.7.2 - '@penumbra-zone/getters@2.0.1(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2))(@bufbuild/protobuf@1.7.2)': + '@penumbra-zone/getters@2.0.1(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2))(@bufbuild/protobuf@1.7.2)': dependencies: - '@buf/penumbra-zone_penumbra.bufbuild_es': 1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2) + '@buf/penumbra-zone_penumbra.bufbuild_es': 1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2) '@bufbuild/protobuf': 1.7.2 '@penumbra-zone/bech32': 2.0.0 - '@penumbra-zone/constants': 3.0.0(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2))(@bufbuild/protobuf@1.7.2) + '@penumbra-zone/constants': 3.0.0(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2))(@bufbuild/protobuf@1.7.2) - '@penumbra-zone/types@2.0.1(@buf/cosmos_ibc.bufbuild_es@1.8.0-20240327103030-e2006674271c.2(@bufbuild/protobuf@1.7.2))(@buf/cosmos_ibc.connectrpc_es@1.4.0-20240327103030-e2006674271c.2(@bufbuild/protobuf@1.7.2)(@connectrpc/connect@1.3.0(@bufbuild/protobuf@1.7.2)))(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2))(@buf/penumbra-zone_penumbra.connectrpc_es@1.4.0-20240331004851-c3b058e666bc.2(@bufbuild/protobuf@1.7.2)(@connectrpc/connect@1.3.0(@bufbuild/protobuf@1.7.2)))(@bufbuild/protobuf@1.7.2)': + '@penumbra-zone/types@2.0.1(@buf/cosmos_ibc.bufbuild_es@1.8.0-20240327103030-e2006674271c.2(@bufbuild/protobuf@1.7.2))(@buf/cosmos_ibc.connectrpc_es@1.4.0-20240327103030-e2006674271c.2(@bufbuild/protobuf@1.7.2)(@connectrpc/connect@1.3.0(@bufbuild/protobuf@1.7.2)))(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2))(@buf/penumbra-zone_penumbra.connectrpc_es@1.4.0-20240331004851-c3b058e666bc.2(@bufbuild/protobuf@1.7.2)(@connectrpc/connect@1.3.0(@bufbuild/protobuf@1.7.2)))(@bufbuild/protobuf@1.7.2)': dependencies: '@buf/cosmos_ibc.bufbuild_es': 1.8.0-20240327103030-e2006674271c.2(@bufbuild/protobuf@1.7.2) '@buf/cosmos_ibc.connectrpc_es': 1.4.0-20240327103030-e2006674271c.2(@bufbuild/protobuf@1.7.2)(@connectrpc/connect@1.3.0(@bufbuild/protobuf@1.7.2)) - '@buf/penumbra-zone_penumbra.bufbuild_es': 1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2) + '@buf/penumbra-zone_penumbra.bufbuild_es': 1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2) '@buf/penumbra-zone_penumbra.connectrpc_es': 1.4.0-20240331004851-c3b058e666bc.2(@bufbuild/protobuf@1.7.2)(@connectrpc/connect@1.3.0(@bufbuild/protobuf@1.7.2)) '@bufbuild/protobuf': 1.7.2 '@penumbra-zone/bech32': 2.0.0 - '@penumbra-zone/constants': 3.0.0(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2))(@bufbuild/protobuf@1.7.2) - '@penumbra-zone/getters': 2.0.1(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240501193854-ea3cc743390d.1(@bufbuild/protobuf@1.7.2))(@bufbuild/protobuf@1.7.2) + '@penumbra-zone/constants': 3.0.0(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2))(@bufbuild/protobuf@1.7.2) + '@penumbra-zone/getters': 2.0.1(@buf/penumbra-zone_penumbra.bufbuild_es@1.9.0-20240524044626-61ea2a2f7b91.1(@bufbuild/protobuf@1.7.2))(@bufbuild/protobuf@1.7.2) bignumber.js: 9.1.2 idb: 8.0.0 zod: 3.22.4 diff --git a/src/components/ActionView/index.tsx b/src/components/ActionView/index.tsx index 81da9b0..92d9d44 100644 --- a/src/components/ActionView/index.tsx +++ b/src/components/ActionView/index.tsx @@ -74,7 +74,7 @@ function useCopyToClipboard() { return copyToClipboard; }; -const ActionRow: FC<{ label: string, value?: string | bigint | Uint8Array | number | boolean, className?: string }> = ({ label: name, value, className }) => { +export const ActionRow: FC<{ label: string, value?: string | bigint | Uint8Array | number | boolean, className?: string }> = ({ label: name, value, className }) => { const copyToClipboard = useCopyToClipboard(); let text : string; if (value !== undefined) { diff --git a/src/components/TransactionView/index.tsx b/src/components/TransactionView/index.tsx index 821efe4..02b8a42 100644 --- a/src/components/TransactionView/index.tsx +++ b/src/components/TransactionView/index.tsx @@ -3,10 +3,10 @@ import { TransactionView as TransactionViewSchema, type Transaction, Transaction import { makeActionView } from "@/lib/protobuf"; import { TransactionBodyView } from "./TransactionBodyView"; import { FlexRow } from "../ui/flex"; -import { GenericKV } from "../ActionView"; +import { ActionRow } from "../ActionView"; -const BindingSig = GenericKV; -const MerkleRoot = GenericKV; +const BindingSig = ActionRow; +const MerkleRoot = ActionRow; const makeTransactionView = ({ body, ...tx }: Transaction) : TransactionViewSchema => {