refactor: simplifies multiple trx version support#2052
Conversation
| "name": "@akashnetwork/console-web", | ||
| "version": "2.115.0", | ||
| "license": "Apache-2.0", | ||
| "dependencies": { |
There was a problem hiding this comment.
🔄 Carefully review the package-lock.json diff
Resolve the comment if everything is ok
+ apps/stats-web/node_modules/@akashnetwork/chain-sdk 1.0.0-alpha.8
+ apps/stats-web/node_modules/@cosmjs/crypto 0.33.1
+ apps/stats-web/node_modules/@cosmjs/json-rpc 0.33.1
+ apps/stats-web/node_modules/@cosmjs/math 0.33.1
+ apps/stats-web/node_modules/@cosmjs/proto-signing 0.33.1
+ apps/stats-web/node_modules/@cosmjs/socket 0.33.1
+ apps/stats-web/node_modules/@cosmjs/stargate/node_modules/@cosmjs/amino 0.33.1
+ apps/stats-web/node_modules/@cosmjs/stargate 0.33.1
+ apps/stats-web/node_modules/@cosmjs/stream 0.33.1
+ apps/stats-web/node_modules/@cosmjs/tendermint-rpc/node_modules/@cosmjs/encoding 0.33.1
+ apps/stats-web/node_modules/@cosmjs/tendermint-rpc 0.33.1
+ apps/stats-web/node_modules/@cosmjs/utils 0.33.1
+ apps/stats-web/node_modules/ws 7.5.10
WalkthroughRefactors transaction message rendering to a version-gated HOC and lookup registry, consolidates Akash message views into a barrel, removes per-version duplicate files, migrates network/type imports to @akashnetwork/chain-sdk, lazy-loads react-intl in TransactionInfo, and widens AKTAmount uakt prop to accept string. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant TxRow as TxMessageRow
participant AkashIdx as Akash index (./akash/index)
participant GenericIdx as Generic index (./generic/index)
participant MsgComp as MsgComponent (createMsgView)
participant Fallback as DynamicReactJson
User->>TxRow: pass tx type + message
TxRow->>TxRow: parse type -> {namespace, version, name}
alt namespace == "akash"
TxRow->>AkashIdx: lookup component by name
else
TxRow->>GenericIdx: lookup component by name
end
alt component found
TxRow->>MsgComp: render({message, version})
else
TxRow->>Fallback: render(deep-cloned message JSON)
end
sequenceDiagram
autonumber
participant Parent as ParentRenderer
participant Wrapper as createMsgView
participant Inner as InnerView
participant Fallback as DynamicReactJson
Parent->>Wrapper: render({version, message})
alt version in supportedVersions
Wrapper->>Inner: render(props)
else
Wrapper->>Fallback: render(cloned props)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2052 +/- ##
==========================================
- Coverage 46.10% 46.09% -0.02%
==========================================
Files 1020 1020
Lines 28786 28786
Branches 7530 7511 -19
==========================================
- Hits 13273 13270 -3
+ Misses 15128 14317 -811
- Partials 385 1199 +814
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
apps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsx (1)
13-13: Fix potential crash: JSON.parse on undefined attributesJSON.parse(JSON.stringify(message?.data?.attributes)) throws if attributes is undefined. Pass the object directly and guard.
Apply:
- <LabelValue label="Attributes" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.attributes))} />} /> + <LabelValue label="Attributes" value={message?.data?.attributes ? <DynamicReactJson src={message.data.attributes} /> : undefined} />apps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsx (1)
13-13: Fix potential crash: JSON.parse on undefined attributesSame issue as MsgUpdateProvider. Guard and avoid deep-clone.
Apply:
- <LabelValue label="Attributes" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.attributes))} />} /> + <LabelValue label="Attributes" value={message?.data?.attributes ? <DynamicReactJson src={message.data.attributes} /> : undefined} />
🧹 Nitpick comments (10)
apps/stats-web/src/lib/mathHelpers.ts (1)
46-46: Consider replacinganycast with proper type guard.As per coding guidelines, avoid casting to
any. Use a type guard to check ifcoinsis an array.Apply this diff to improve type safety:
export function coinsToAmount(coins: Coin[] | Coin, denom: string) { - const currentCoin = (coins as any).length !== undefined ? (coins as Coin[]).find(c => c.denom === denom) : (coins as Coin); + const currentCoin = Array.isArray(coins) ? coins.find(c => c.denom === denom) : coins; if (!currentCoin) return 0; return currentCoin.amount; }apps/stats-web/src/components/transactions/createMsgView.tsx (1)
5-12: Safer fallback and minor perf tweak
- Prefer showing message.data; avoid deep-cloning entire props.
- JSON.stringify can throw (cycles/BigInt). Use raw value; fall back only if needed.
- Precompute a Set for versions.
Apply:
-export function createMsgView<T extends { message: TransactionMessage; version: string }>(supportedVersions: string[], Component: React.FunctionComponent<T>) { - return (props: T) => { - if (supportedVersions.includes(props.version)) { - return <Component {...props} />; - } - - return <DynamicReactJson src={JSON.parse(JSON.stringify(props))} />; - }; -} +export function createMsgView<T extends { message: TransactionMessage; version: string }>(supportedVersions: string[], Component: React.FunctionComponent<T>) { + const supported = new Set(supportedVersions); + return (props: T) => { + if (supported.has(props.version)) { + return <Component {...props} />; + } + return <DynamicReactJson src={props.message?.data ?? props} />; + }; +}apps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx (1)
7-14: Avoid repeating version arrays across Msg files*Centralize common version lists (e.g., AKASH_CERT_VERSIONS) to reduce drift and ease future upgrades.
apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx (1)
10-24: Deduplicate supported versionsExtract a shared AKASH_LEASE_VERSIONS constant to avoid manual updates across multiple Msg* components.
apps/stats-web/src/services/api-url/api-url.service.ts (1)
1-1: Add explicit return type and unreachable-case guardMake return type explicit and fail fast if config shape is unexpected.
- getBaseApiUrlFor(network: NetworkId) { + getBaseApiUrlFor(network: NetworkId): string { @@ - if ("NEXT_PUBLIC_BASE_API_MAINNET_URL" in this.config) { + if ("NEXT_PUBLIC_BASE_API_MAINNET_URL" in this.config) { @@ - } + } + throw new Error("ApiUrlService: no base API URL configured for provided config"); }Also applies to: 13-35
apps/stats-web/src/components/transactions/TxMessageRow.tsx (1)
31-47: Harden parsing and simplify fallback; consider typed registries
- Defensive parsing for atypical type strings.
- Avoid JSON stringify; pass raw data.
- Optional: expose explicit registries from barrels to avoid dynamic indexing implicit-any.
- const [namespace, ...typeDetails] = message.type.split("."); - const version = typeDetails[typeDetails.length - 2]; - const name = typeDetails[typeDetails.length - 1]; - let MsgComponent: React.FunctionComponent<TxMessageProps & { version: string }>; + const parts = message.type?.split(".") ?? []; + const namespace = parts[0]; + const typeDetails = parts.slice(1); + const version = typeDetails.length >= 2 ? typeDetails[typeDetails.length - 2] : ""; + const name = typeDetails[typeDetails.length - 1]; + let MsgComponent: React.FunctionComponent<TxMessageProps & { version: string }> | undefined; @@ - if (!MsgComponent) { - return <DynamicReactJson src={JSON.parse(JSON.stringify(message?.data))} />; + if (!MsgComponent) { + return <DynamicReactJson src={message?.data ?? { type: message.type }} />; }Optionally, export a registry from "./akash" and "./generic" (Record<MsgName, FC>) and use it here to avoid dynamic namespace indexing.
apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx (1)
14-14: Reminder: Address the TODO comment.The TODO comment indicates that a link to the provider page is needed.
Do you want me to generate the implementation for the provider page link or open a new issue to track this task?
apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsx (1)
10-22: Approve with reminder to address TODO.The component correctly uses the
createMsgViewwrapper to support multiple transaction versions (v1beta1–v1beta5). The fallback pattern on Line 11 appropriately handles version differences in the bid ID structure.However, Line 15 contains a TODO comment about adding a link to the provider page.
Do you want me to generate the implementation for the provider page link or open a new issue to track this task?
apps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsx (1)
10-21: Consider extracting shared lease rendering logic.The component correctly uses the
createMsgViewwrapper to support multiple transaction versions. However, Lines 11-20 are nearly identical toMsgCreateLease.tsx(Lines 11-20), suggesting an opportunity to reduce code duplication.Consider extracting the shared bid ID rendering logic into a reusable component:
// helpers/BidIdDetails.tsx export const BidIdDetails: React.FC<{ bidId: any }> = ({ bidId }) => ( <> <LabelValue label="Owner" value={<AddressLink address={bidId?.owner} />} /> <LabelValue label="Provider" value={<Link href={UrlService.address(bidId?.provider)}>{bidId?.provider}</Link>} /> <LabelValue label="dseq" value={<Link href={UrlService.deployment(bidId?.owner, bidId?.dseq)}>{bidId?.dseq}</Link>} /> <LabelValue label="gseq" value={bidId?.gseq} /> <LabelValue label="oseq" value={bidId?.oseq} /> </> );Then use it in both components:
export const MsgWithdrawLease = createMsgView(["v1beta1", "v1beta2", "v1beta3", "v1beta4", "v1beta5"], ({ message }) => { const bidId = message?.data?.id || message?.data?.bidId; - return ( - <> - <LabelValue label="Owner" value={<AddressLink address={bidId?.owner} />} /> - <LabelValue label="Provider" value={<Link href={UrlService.address(bidId?.provider)}>{bidId?.provider}</Link>} /> - <LabelValue label="dseq" value={<Link href={UrlService.deployment(bidId?.owner, bidId?.dseq)}>{bidId?.dseq}</Link>} /> - <LabelValue label="gseq" value={bidId?.gseq} /> - <LabelValue label="oseq" value={bidId?.oseq} /> - </> - ); + return <BidIdDetails bidId={bidId} />; });apps/stats-web/src/components/transactions/akash/MsgCreateBid.tsx (1)
26-30: Drop deep-clone for DynamicReactJson and remove stray whitespace
- JSON.parse(JSON.stringify(...)) is unnecessary here; pass the object directly.
- Remove the trailing {" "} artifact.
Apply:
- {message?.data?.resourcesOffer && ( - <LabelValue label="Resources Offer" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.resourcesOffer))} />} /> - )}{" "} + {message?.data?.resourcesOffer && ( + <LabelValue label="Resources Offer" value={<DynamicReactJson src={message.data.resourcesOffer} />} /> + )}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (80)
apps/stats-web/package.json(1 hunks)apps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsx(2 hunks)apps/stats-web/src/components/AKTAmount.tsx(1 hunks)apps/stats-web/src/components/transactions/TxMessageRow.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseBid.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateBid.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgStartGroup.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/index.ts(1 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgRevokeCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgSignProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgStartGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgDeleteProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgDepositDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgPauseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgRevokeCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgSignProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgDepositDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgPauseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgStartGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgUpdateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/createMsgView.tsx(1 hunks)apps/stats-web/src/components/transactions/generic/index.ts(1 hunks)apps/stats-web/src/config/denom.config.ts(1 hunks)apps/stats-web/src/lib/mathHelpers.ts(1 hunks)apps/stats-web/src/services/api-url/api-url.service.ts(1 hunks)
💤 Files with no reviewable changes (50)
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgDepositDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgRevokeCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgDepositDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgDeleteProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgSignProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgPauseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgStartGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgStartGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgRevokeCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgSignProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgPauseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProviderAttributes.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Never use type any or cast to type any. Always define the proper TypeScript types.
Files:
apps/stats-web/src/components/transactions/createMsgView.tsxapps/stats-web/src/lib/mathHelpers.tsapps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsxapps/stats-web/src/components/AKTAmount.tsxapps/stats-web/src/components/transactions/TxMessageRow.tsxapps/stats-web/src/services/api-url/api-url.service.tsapps/stats-web/src/components/transactions/akash/MsgCreateLease.tsxapps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsxapps/stats-web/src/components/transactions/akash/MsgCloseLease.tsxapps/stats-web/src/components/transactions/akash/MsgCreateBid.tsxapps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsxapps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsxapps/stats-web/src/components/transactions/akash/MsgStartGroup.tsxapps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsxapps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsxapps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsxapps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsxapps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsxapps/stats-web/src/components/transactions/akash/index.tsapps/stats-web/src/components/transactions/akash/MsgCloseBid.tsxapps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsxapps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsxapps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsxapps/stats-web/src/components/transactions/generic/index.tsapps/stats-web/src/config/denom.config.tsapps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsx
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
**/*.{js,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code
Files:
apps/stats-web/src/components/transactions/createMsgView.tsxapps/stats-web/src/lib/mathHelpers.tsapps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsxapps/stats-web/src/components/AKTAmount.tsxapps/stats-web/src/components/transactions/TxMessageRow.tsxapps/stats-web/src/services/api-url/api-url.service.tsapps/stats-web/src/components/transactions/akash/MsgCreateLease.tsxapps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsxapps/stats-web/src/components/transactions/akash/MsgCloseLease.tsxapps/stats-web/src/components/transactions/akash/MsgCreateBid.tsxapps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsxapps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsxapps/stats-web/src/components/transactions/akash/MsgStartGroup.tsxapps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsxapps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsxapps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsxapps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsxapps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsxapps/stats-web/src/components/transactions/akash/index.tsapps/stats-web/src/components/transactions/akash/MsgCloseBid.tsxapps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsxapps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsxapps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsxapps/stats-web/src/components/transactions/generic/index.tsapps/stats-web/src/config/denom.config.tsapps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsx
🧠 Learnings (1)
📚 Learning: 2025-09-04T04:27:50.638Z
Learnt from: stalniy
PR: akash-network/console#1868
File: apps/api/src/billing/services/managed-signer/managed-signer.service.ts:1-1
Timestamp: 2025-09-04T04:27:50.638Z
Learning: In the akash-network/console project, importing MsgCreateLease from "akashnetwork/akash-api/v1beta3" instead of v1beta4 is considered non-critical by the maintainers, likely due to backward compatibility or project-specific requirements.
Applied to files:
apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsxapps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx
🧬 Code graph analysis (22)
apps/stats-web/src/components/transactions/createMsgView.tsx (2)
apps/provider-console/src/types/transaction.ts (1)
TransactionMessage(16-22)apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)
apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (3)
apps/provider-console/src/types/coin.ts (1)
Coin(1-4)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/AKTAmount.tsx (1)
AKTAmount(18-57)
apps/stats-web/src/components/transactions/TxMessageRow.tsx (1)
apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)
apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgCreateBid.tsx (6)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/AKTAmount.tsx (1)
AKTAmount(18-57)apps/stats-web/src/lib/mathHelpers.ts (1)
coinsToAmount(45-49)apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (1)
DepositDetail(9-20)apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)
apps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsx (4)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (1)
DepositDetail(9-20)
apps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgStartGroup.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx (3)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)
apps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsx (3)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/stats-web/src/components/AKTAmount.tsx (1)
AKTAmount(18-57)apps/stats-web/src/lib/mathHelpers.ts (1)
coinsToAmount(45-49)
apps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgCloseBid.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx (4)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (1)
DepositDetail(9-20)apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)
apps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
- GitHub Check: validate (apps/indexer) / validate-unsafe
- GitHub Check: validate (apps/provider-proxy) / validate-unsafe
- GitHub Check: validate (apps/provider-console) / validate-unsafe
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: test-build
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: test-build
- GitHub Check: validate / validate-app
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: test-build
🔇 Additional comments (20)
apps/stats-web/src/lib/mathHelpers.ts (1)
48-48: LGTM! Clean simplification.The removal of the else branch is a valid simplification. The early return on line 47 ensures
currentCoinis truthy, so directly returningcurrentCoin.amountis correct.apps/stats-web/src/components/AKTAmount.tsx (1)
11-11: LGTM; helper accepts string | number inputs TheudenomToDenomsignature is_amount: string | numberand correctly parses string values.apps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsx (1)
18-20: Approve dynamic react-intl imports; verify hydrationClient-only dynamic imports reduce SSR bundle—manually check for any flicker or hydration mismatch on initial render of the time component.
apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx (1)
4-5: LGTM!Import paths correctly updated to align with the new component structure and multi-version support pattern.
apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx (1)
11-20: LGTM!The component correctly uses the
createMsgViewwrapper to support multiple transaction versions (v1beta1–v1beta4). The fallback pattern on Line 16 (message?.data?.version || message?.data?.hash) appropriately handles version differences in the message data structure.apps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsx (1)
10-19: LGTM!The component correctly uses the
createMsgViewwrapper and cleanly renders account deposit information. The data extraction to a local constant improves readability.apps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsx (1)
4-5: Verify version support scope.The component correctly uses the
createMsgViewwrapper. However, this component supports versions v1beta1–v1beta3, while other similar deployment-related components (e.g.,MsgUpdateDeployment,MsgCloseGroup) support up to v1beta4.Please confirm whether the exclusion of v1beta4 is intentional due to API schema changes in that version, or if it should be added to the supported versions list.
Also applies to: 12-21
apps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsx (1)
4-5: LGTM!Import paths correctly updated and the component properly uses the
createMsgViewwrapper to support multiple transaction versions (v1beta1–v1beta4).Also applies to: 10-18
apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx (1)
12-12: Ensure consistent v1beta5 support for deployment messages
MsgCreateDeployment currently lists ["v1beta1", "v1beta2", "v1beta3", "v1beta4"] (as does MsgUpdateDeployment), while other Akash views include "v1beta5". Confirm whether the v1beta5 deployment messages exist in the protobuf registry and, if so, add "v1beta5" here.apps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsx (1)
10-10: Leave MsgPauseGroup versions as-is: it mirrors MsgStartGroup and MsgCloseGroup, which don’t support v1beta5.Likely an incorrect or invalid review comment.
apps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsx (1)
7-7: MsgCreateCertificate version list is correct – it matches MsgRevokeCertificate and MsgSignProviderAttributes, and no v1beta4 or v1beta5 variants are present for certificate messages.apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsx (2)
4-5: LGTM: Import paths correctly updated.The import path adjustments align with the refactored directory structure, and the createMsgView import introduces the version-gating pattern central to this PR.
10-17: LGTM: Version-gating wrapper correctly applied.The createMsgView wrapper cleanly supports multiple transaction versions (v1beta1-v1beta4) while preserving the original rendering logic. This aligns with the PR's goal to simplify multi-version transaction support.
apps/stats-web/src/config/denom.config.ts (2)
5-8: LGTM: Type refinement using Exclude utility.The type change to
Record<Exclude<NetworkId, "testnet">, string>is more concise and maintainable than the explicit union type. It correctly expresses that USDC denoms are defined for mainnet and sandbox networks only.
1-1: Verify chain-sdk dependency and NetworkId export
- Ensure
@akashnetwork/chain-sdkis listed in package.json dependencies.- Confirm
NetworkIdis exported from@akashnetwork/chain-sdk/weband includes the expected union (mainnet|sandbox|testnet).apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx (2)
4-5: LGTM: Import paths correctly updated.The import adjustments are consistent with the refactored structure across all Akash message components.
11-20: LGTM: Version-gating wrapper correctly applied with v1 stable API support.The wrapper correctly supports versions v1beta1-v1beta3 plus the stable "v1" API. This differs from other components that support v1beta4, which is appropriate as different message types may have different version progressions based on when they were promoted to stable.
apps/stats-web/src/components/transactions/akash/MsgStartGroup.tsx (1)
4-18: LGTM: Consistent refactoring pattern applied.The component successfully adopts the createMsgView wrapper pattern with support for versions v1beta1-v1beta4, maintaining the original rendering logic for Owner, dseq, and gseq fields.
apps/stats-web/src/components/transactions/akash/index.ts (1)
1-19: LGTM: Well-organized barrel exports.This barrel module consolidates all Akash transaction message components into a single entry point, improving import ergonomics and maintainability. The pattern is consistent and follows best practices.
apps/stats-web/src/components/transactions/generic/index.ts (1)
1-34: LGTM: Comprehensive barrel exports for generic transactions.This barrel module consolidates generic Cosmos SDK transaction message components, providing a centralized import point for IBC, staking, governance, distribution, and other standard transaction types. The organization complements the Akash-specific barrel.
apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx
Show resolved
Hide resolved
apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx
Show resolved
Hide resolved
692232c to
4a0c74a
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx (1)
10-24: Add explicit TypeScript types for the component props.The component function destructures
{ message }without type annotations, which may result in implicitanytype inference. According to the coding guidelines, you must always define proper TypeScript types and never use typeany.Apply this diff to add proper typing:
-export const MsgCloseLease = createMsgView(["v1beta1", "v1beta2", "v1beta3", "v1beta4", "v1beta5"], ({ message }) => { +export const MsgCloseLease = createMsgView(["v1beta1", "v1beta2", "v1beta3", "v1beta4", "v1beta5"], ({ message }: { message: { data: { leaseId: { owner: string; dseq: string; gseq: string; oseq: string; provider: string } } } }) => {Alternatively, define a proper interface for better maintainability:
interface MsgCloseLeaseData { data: { leaseId: { owner: string; dseq: string; gseq: string; oseq: string; provider: string; }; }; } export const MsgCloseLease = createMsgView(["v1beta1", "v1beta2", "v1beta3", "v1beta4", "v1beta5"], ({ message }: { message: MsgCloseLeaseData }) => { // ... });As per coding guidelines.
apps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsx (1)
11-15: Avoid JSON.parse on maybe-undefined and guard AddressLinkJSON.parse(JSON.stringify(message?.data?.attributes)) throws when attributes is undefined. Also guard AddressLink from receiving undefined.
- <LabelValue label="Owner" value={<AddressLink address={message?.data?.owner} />} /> + <LabelValue label="Owner" value={message?.data?.owner ? <AddressLink address={message.data.owner} /> : undefined} /> @@ - <LabelValue label="Attributes" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.attributes))} />} /> + <LabelValue + label="Attributes" + value={message?.data?.attributes ? <DynamicReactJson src={message.data.attributes} /> : undefined} + />apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx (1)
11-18: Same pattern: guard Links/AddressLink and avoid JSON.parseProtect href construction and avoid JSON.parse on optional attributes.
- <LabelValue label="Provider" value={<Link href={UrlService.address(message?.data?.owner)}>{message?.data?.owner}</Link>} /> + <LabelValue + label="Provider" + value={message?.data?.owner ? <Link href={UrlService.address(message.data.owner)}>{message.data.owner}</Link> : undefined} + /> @@ - <LabelValue label="Auditor" value={<AddressLink address={message?.data?.auditor} />} /> + <LabelValue label="Auditor" value={message?.data?.auditor ? <AddressLink address={message.data.auditor} /> : undefined} /> - <LabelValue label="Attributes" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.attributes))} />} /> + <LabelValue + label="Attributes" + value={message?.data?.attributes ? <DynamicReactJson src={message.data.attributes} /> : undefined} + />apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx (1)
10-17: Guard optional fields and simplify JSON rendering
- Provider/Auditor: check
message.data?.owner/message.data?.auditorbefore callingUrlService.addressto avoid undefined hrefs.- Keys: remove
JSON.parse(JSON.stringify(...)); render<DynamicReactJson src={message.data.keys} />only ifmessage.data?.keysexists.- Confirm that
["v1beta1", "v1beta2", "v1beta3", "v1"]matches the Chain SDK versions for this message type.- <LabelValue label="Provider" value={<Link href={UrlService.address(message?.data?.owner)}>{message?.data?.owner}</Link>} /> + <LabelValue + label="Provider" + value={message.data?.owner ? <Link href={UrlService.address(message.data.owner)}>{message.data.owner}</Link> : undefined} + /> @@ - <LabelValue label="Auditor" value={<Link href={UrlService.address(message?.data?.auditor)}>{message?.data?.auditor}</Link>} /> + <LabelValue + label="Auditor" + value={message.data?.auditor ? <Link href={UrlService.address(message.data.auditor)}>{message.data.auditor}</Link> : undefined} + /> @@ - <LabelValue label="Keys" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.keys))} />} /> + <LabelValue + label="Keys" + value={message.data?.keys ? <DynamicReactJson src={message.data.keys} /> : undefined} + />
♻️ Duplicate comments (3)
apps/stats-web/package.json (1)
16-16: Verify SDK migration completeness across the monorepo.The dependency update in this package is correct. However, ensure that
@akashnetwork/akashjshas been removed from all packages in the monorepo and that all code imports have been migrated to@akashnetwork/chain-sdk.Run this script to verify the migration is complete:
#!/bin/bash # Find any remaining akashjs references in package.json files fd -e json package.json --exec grep -l '@akashnetwork/akashjs' # Find any remaining akashjs imports in code rg -n '@akashnetwork/akashjs' --type ts --type tsx --type jsapps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (1)
8-11: Fix the type guard to prevent null pointer exceptions.The type guard contains a critical flaw. The condition
!valuereturnstruefornull,undefined,false,0,"", etc. Ifvalueisnullorundefined,isCoinwill returntrue, but then Line 11 attempts to accessvalue.amount, causing a runtime null pointer exception.Apply this diff to fix the type guard:
-const isCoin = (value: unknown): value is Coin => !value || (typeof value === "object" && "denom" in value && "amount" in value); +const isCoin = (value: unknown): value is Coin => value != null && typeof value === "object" && "denom" in value && "amount" in value;apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx (1)
21-26: Fix crashes: guard Links/AddressLink, conditionally render Deposit/Groups, drop JSON.parse(JSON.stringify(...))JSON.parse on undefined throws; Link/AddressLink with undefined props or hrefs can crash. This was flagged previously and remains. Please guard and pass raw objects to DynamicReactJson.
- <LabelValue label="Owner" value={<AddressLink address={data?.id?.owner} />} /> - <LabelValue label="dseq" value={<Link href={UrlService.deployment(data?.id?.owner, data?.id?.dseq)}>{data?.id?.dseq}</Link>} /> + <LabelValue + label="Owner" + value={data?.id?.owner ? <AddressLink address={data.id.owner} /> : undefined} + /> + <LabelValue + label="dseq" + value={ + data?.id?.owner && data?.id?.dseq + ? <Link href={UrlService.deployment(data.id.owner, data.id.dseq)}>{data.id.dseq}</Link> + : undefined + } + /> @@ - {data?.depositor && <LabelValue label="Depositor" value={<Link href={UrlService.address(data?.depositor)}>{data?.depositor}</Link>} />} - <DepositDetail value={data?.deposit} /> - <LabelValue label="Groups" value={<DynamicReactJson src={JSON.parse(JSON.stringify(data?.groups))} />} /> + {data?.depositor && <LabelValue label="Depositor" value={<AddressLink address={data.depositor} />} />} + {data?.deposit && <DepositDetail value={data.deposit} />} + {data?.groups && <LabelValue label="Groups" value={<DynamicReactJson src={data.groups} />} />}
🧹 Nitpick comments (6)
apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx (1)
21-21: Address the TODO comment.There's a pending task to add a link to the provider page. This enhancement would improve navigation for users viewing transaction details.
Do you want me to generate the implementation for linking to a provider detail page, or should I open a new issue to track this task?
apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (1)
14-19: Add defensive checks for nested property access.Lines 16-17 assume that
value.amount.amountandvalue.sourcesexist and are well-formed. If theDepositobject is malformed or missing nested properties, this will throw runtime errors.Consider adding optional chaining or validation:
- <LabelValue label="Deposit Amount" value={<AKTAmount uakt={value.amount.amount} showAKTLabel showUSD />} /> - <LabelValue label="Deposit Sources" value={value.sources.map(source => DepositSource[source]).join(", ")} /> + <LabelValue label="Deposit Amount" value={<AKTAmount uakt={value.amount?.amount ?? 0} showAKTLabel showUSD />} /> + <LabelValue label="Deposit Sources" value={value.sources?.map(source => DepositSource[source]).join(", ") ?? "N/A"} />apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx (1)
17-17: Consider removing unnecessary deep clone.The
JSON.parse(JSON.stringify(...))pattern creates a deep clone before passing data toDynamicReactJson. UnlessDynamicReactJsonmutates its input (which is unlikely for a JSON viewer component), this deep clone is unnecessary and adds performance overhead.Simplify to:
- {message?.data?.groups && <LabelValue label="Groups" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.groups))} />} />} + {message?.data?.groups && <LabelValue label="Groups" value={<DynamicReactJson src={message.data.groups} />} />}Note: This same pattern appears in other Msg components (see
MsgUpdateProvider.tsxLine 13). If you confirm the deep clone is unnecessary, consider removing it consistently across all components.apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx (1)
13-15: Track TODO or scope it behind issueThe TODO about grouping resources from base64 is unresolved. Convert to an issue and link it, or define a follow-up task.
I can draft a helper to decode and present grouped resources neatly; want me to propose it?
apps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsx (1)
12-19: Guard Owner and DSEQ rendering in MsgDepositDeployment.tsx
- Wrap
AddressLinkandLinkin conditional checks onmessage.data.id.owner(and.dseq) to avoid undefined values:- <LabelValue label="Owner" value={<AddressLink address={message?.data?.id?.owner} />} /> - <LabelValue label="DSEQ" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} /> + <LabelValue + label="Owner" + value={message?.data?.id?.owner ? <AddressLink address={message.data.id.owner} /> : undefined} + /> + <LabelValue + label="DSEQ" + value={ + message?.data?.id?.owner && message?.data?.id?.dseq + ? <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}>{message.data.id.dseq}</Link> + : undefined + } + />
- Optional: confirm the version array includes all supported protocol versions (e.g., should v1beta4/v1beta5 be added)
apps/stats-web/src/components/transactions/generic/index.ts (1)
1-34: LGTM! Clean barrel file consolidation.The barrel file correctly consolidates all generic transaction message components into a single export point, which aligns well with the PR's goal of simplifying multi-version transaction support. The exports are alphabetically sorted, making them easy to maintain.
Consider adding a brief JSDoc comment at the top to document the purpose of this barrel file:
+/** + * Generic transaction message components. + * Re-exports all Msg* components for consolidated imports. + */ export * from "./MsgAcknowledgement"; export * from "./MsgBeginRedelegate";
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (80)
apps/stats-web/package.json(1 hunks)apps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsx(2 hunks)apps/stats-web/src/components/AKTAmount.tsx(1 hunks)apps/stats-web/src/components/transactions/TxMessageRow.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseBid.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateBid.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgStartGroup.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/index.ts(1 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgRevokeCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgSignProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgStartGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgDeleteProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgDepositDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgPauseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgRevokeCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgSignProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgDepositDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgPauseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgStartGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgUpdateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/createMsgView.tsx(1 hunks)apps/stats-web/src/components/transactions/generic/index.ts(1 hunks)apps/stats-web/src/config/denom.config.ts(1 hunks)apps/stats-web/src/lib/mathHelpers.ts(1 hunks)apps/stats-web/src/services/api-url/api-url.service.ts(1 hunks)
💤 Files with no reviewable changes (50)
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgSignProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgStartGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgStartGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgDeleteProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgRevokeCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgDepositDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgRevokeCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgPauseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgSignProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgDepositDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgPauseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgWithdrawLease.tsx
🚧 Files skipped from review as they are similar to previous changes (12)
- apps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsx
- apps/stats-web/src/components/transactions/TxMessageRow.tsx
- apps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx
- apps/stats-web/src/components/transactions/akash/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsx
- apps/stats-web/src/lib/mathHelpers.ts
- apps/stats-web/src/components/transactions/akash/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/index.ts
- apps/stats-web/src/components/transactions/createMsgView.tsx
- apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsx
- apps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Never use type any or cast to type any. Always define the proper TypeScript types.
Files:
apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsxapps/stats-web/src/components/AKTAmount.tsxapps/stats-web/src/services/api-url/api-url.service.tsapps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsxapps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsxapps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsxapps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsxapps/stats-web/src/config/denom.config.tsapps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsxapps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsxapps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsxapps/stats-web/src/components/transactions/akash/MsgStartGroup.tsxapps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsxapps/stats-web/src/components/transactions/generic/index.tsapps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsxapps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
**/*.{js,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code
Files:
apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsxapps/stats-web/src/components/AKTAmount.tsxapps/stats-web/src/services/api-url/api-url.service.tsapps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsxapps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsxapps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsxapps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsxapps/stats-web/src/config/denom.config.tsapps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsxapps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsxapps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsxapps/stats-web/src/components/transactions/akash/MsgStartGroup.tsxapps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsxapps/stats-web/src/components/transactions/generic/index.tsapps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsxapps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx
🧠 Learnings (1)
📚 Learning: 2025-09-04T04:27:50.638Z
Learnt from: stalniy
PR: akash-network/console#1868
File: apps/api/src/billing/services/managed-signer/managed-signer.service.ts:1-1
Timestamp: 2025-09-04T04:27:50.638Z
Learning: In the akash-network/console project, importing MsgCreateLease from "akashnetwork/akash-api/v1beta3" instead of v1beta4 is considered non-critical by the maintainers, likely due to backward compatibility or project-specific requirements.
Applied to files:
apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx
🧬 Code graph analysis (12)
apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsx (3)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/stats-web/src/components/AKTAmount.tsx (1)
AKTAmount(18-57)apps/stats-web/src/lib/mathHelpers.ts (1)
coinsToAmount(45-49)
apps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx (3)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)
apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgStartGroup.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx (4)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (1)
DepositDetail(9-20)apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)
apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (3)
apps/provider-console/src/types/coin.ts (1)
Coin(1-4)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/AKTAmount.tsx (1)
AKTAmount(18-57)
apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: validate / validate-app
- GitHub Check: validate / validate-app
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: test-build
- GitHub Check: test-build
🔇 Additional comments (10)
apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx (1)
13-20: AI summary inconsistency detected.The AI-generated summary mentions
bidIdfields (owner, provider, dseq, gseq, oseq), but the actual code usesleaseIdfields. For aMsgCloseLeasemessage,leaseIdis semantically correct, so the code is accurate but the summary is misleading.apps/stats-web/src/config/denom.config.ts (2)
1-1: LGTM! Consistent migration to chain-sdk.The import source migration is consistent with the broader refactor across the codebase (e.g.,
api-url.service.ts).
5-8: Verify NetworkId compatibility with MAINNET_ID / SANDBOX_IDNetworkId is imported from an external package (not present in this repo). I confirmed MAINNET_ID and SANDBOX_ID are typed as MainnetNetworkId / SandboxNetworkId in packages/network-store/src/network.config.ts and apps/stats-web uses Record<Exclude<NetworkId, "testnet">, string> (apps/stats-web/src/config/denom.config.ts).
- Verify that NetworkId (from @akashnetwork/chain-sdk or @akashnetwork/akashjs) is a string-literal union that includes "mainnet" and "sandbox" so MAINNET_ID/SANDBOX_ID satisfy Exclude<NetworkId, "testnet">.
- If not, make the type explicit (e.g., Record<MainnetNetworkId | SandboxNetworkId, string>) or update the external type definitions.
apps/stats-web/src/services/api-url/api-url.service.ts (1)
1-1: Verify NetworkId type compatibility after chain-sdk migration. Confirm thatNetworkIdimported from@akashnetwork/chain-sdk/webincludes the same set of network identifiers (e.g.TESTNET_ID,SANDBOX_ID) required bygetBaseApiUrlFor(lines 13–35).apps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsx (1)
18-19: Verify the need forssr: falsein dynamic imports.Disabling server-side rendering for
FormattedRelativeTimeandFormattedDatewill cause the Time label to render incompletely until client-side hydration finishes. This can degrade the initial user experience with a flash of missing content.react-intl generally supports SSR. Unless there's a specific technical constraint (e.g., reliance on browser-only APIs in your setup), consider enabling SSR for these components to improve perceived performance and SEO.
If SSR must remain disabled, verify that:
- The Time label renders a skeleton or placeholder during hydration
- The flash of missing content is acceptable for your UX requirements
Otherwise, remove
{ ssr: false }to enable SSR:-const FormattedRelativeTime = dynamic(() => import("react-intl").then(mod => mod.FormattedRelativeTime), { ssr: false }); -const FormattedDate = dynamic(() => import("react-intl").then(mod => mod.FormattedDate), { ssr: false }); +const FormattedRelativeTime = dynamic(() => import("react-intl").then(mod => mod.FormattedRelativeTime)); +const FormattedDate = dynamic(() => import("react-intl").then(mod => mod.FormattedDate));apps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsx (1)
8-18: LGTM!The migration to
createMsgViewwrapper is correctly implemented with proper version support and defensive property access using optional chaining.apps/stats-web/src/components/transactions/akash/MsgStartGroup.tsx (1)
10-18: LGTM!The migration to
createMsgViewwrapper is correctly implemented with proper version support and defensive property access.apps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsx (1)
7-15: LGTM!The migration to
createMsgViewwrapper is correctly implemented with proper version support (including stable v1) and defensive property access.apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx (1)
11-20: LGTM with optional refactor suggestion!The migration to
createMsgViewwrapper is correctly implemented with proper version support and defensive property access. The version fallback pattern (version || hash) is a good approach for handling multiple proto versions.apps/stats-web/src/components/AKTAmount.tsx (1)
11-11: Wideneduaktprop is safe
udenomToDenominapps/stats-web/src/lib/mathHelpers.tsalready accepts and parsesstring | number, so no additional coercion is needed.
4a0c74a to
145561f
Compare
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx (1)
13-21: Guard Links/AddressLink to prevent invalid hrefs and "undefined" renderingWrap Link/AddressLink creation in conditionals; pass undefined when missing so LabelValue omits the value.
- <LabelValue label="Owner" value={<AddressLink address={message?.data?.leaseId?.owner} />} /> + <LabelValue label="Owner" value={message?.data?.leaseId?.owner ? <AddressLink address={message.data.leaseId.owner} /> : undefined} /> @@ - value={<Link href={UrlService.deployment(message?.data?.leaseId?.owner, message?.data?.leaseId?.dseq)}>{message?.data?.leaseId?.dseq}</Link>} + value={ + message?.data?.leaseId?.owner && message?.data?.leaseId?.dseq ? ( + <Link href={UrlService.deployment(message.data.leaseId.owner, message.data.leaseId.dseq)}>{message.data.leaseId.dseq}</Link> + ) : undefined + } @@ - <LabelValue label="gseq" value={message?.data?.leaseId?.gseq} /> - <LabelValue label="oseq" value={message?.data?.leaseId?.oseq} /> + <LabelValue label="gseq" value={message?.data?.leaseId?.gseq ?? undefined} /> + <LabelValue label="oseq" value={message?.data?.leaseId?.oseq ?? undefined} /> @@ - <LabelValue label="Provider" value={<Link href={UrlService.address(message?.data?.leaseId?.provider)}>{message?.data?.leaseId?.provider}</Link>} /> + <LabelValue + label="Provider" + value={message?.data?.leaseId?.provider ? <Link href={UrlService.address(message.data.leaseId.provider)}>{message.data.leaseId.provider}</Link> : undefined} + />apps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsx (1)
11-16: Fix potential runtime crash and guard AddressLink
- JSON.parse(JSON.stringify(message?.data?.attributes)) throws when attributes is undefined.
- Guard Owner AddressLink to avoid rendering with undefined.
- <LabelValue label="Owner" value={<AddressLink address={message?.data?.owner} />} /> + <LabelValue label="Owner" value={message?.data?.owner ? <AddressLink address={message.data.owner} /> : undefined} /> @@ - <LabelValue label="Attributes" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.attributes))} />} /> + <LabelValue + label="Attributes" + value={message?.data?.attributes ? <DynamicReactJson src={message.data.attributes} /> : undefined} + />apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx (1)
13-17: Fix potential runtime crash and guard Links
- JSON.parse(JSON.stringify(message?.data?.keys)) throws when keys is undefined.
- Guard Link creation for owner/auditor to avoid invalid hrefs.
- <LabelValue label="Provider" value={<Link href={UrlService.address(message?.data?.owner)}>{message?.data?.owner}</Link>} /> + <LabelValue + label="Provider" + value={message?.data?.owner ? <Link href={UrlService.address(message.data.owner)}>{message.data.owner}</Link> : undefined} + /> @@ - <LabelValue label="Auditor" value={<Link href={UrlService.address(message?.data?.auditor)}>{message?.data?.auditor}</Link>} /> + <LabelValue + label="Auditor" + value={message?.data?.auditor ? <Link href={UrlService.address(message.data.auditor)}>{message.data.auditor}</Link> : undefined} + /> @@ - <LabelValue label="Keys" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.keys))} />} /> + <LabelValue label="Keys" value={message?.data?.keys ? <DynamicReactJson src={message.data.keys} /> : undefined} />
♻️ Duplicate comments (3)
apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (1)
8-8: Fix the type guard to prevent null pointer exceptions.The type guard contains a critical flaw already flagged in previous reviews. The condition
!valuereturnstruefornull,undefined,false,0,"", etc. Ifvalueisnullorundefined,isCoinwill returntrue, but then Line 11 attempts to accessvalue.amount, causing a runtime null pointer exception.Apply this diff to fix the type guard:
-const isCoin = (value: unknown): value is Coin => !value || (typeof value === "object" && "denom" in value && "amount" in value); +const isCoin = (value: unknown): value is Coin => value != null && typeof value === "object" && "denom" in value && "amount" in value;apps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsx (1)
14-14: Guard dseq Link to avoid invalid hrefs.This issue was previously flagged: building a deployment link when owner or dseq is missing creates an invalid href.
Apply this diff:
- <LabelValue label="dseq" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} /> + <LabelValue + label="dseq" + value={ + message?.data?.id?.owner && message?.data?.id?.dseq + ? <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}>{message.data.id.dseq}</Link> + : message?.data?.id?.dseq + } + />apps/stats-web/src/components/transactions/akash/MsgCloseBid.tsx (1)
14-19: Guard Links/values to avoid "undefined" text and invalid hrefsCreate Link/AddressLink only when underlying values exist. Otherwise pass undefined to value (LabelValue omits it).
- <LabelValue label="Provider" value={<Link href={UrlService.address(bidId?.provider)}>{bidId?.provider}</Link>} /> + <LabelValue + label="Provider" + value={bidId?.provider ? <Link href={UrlService.address(bidId.provider)}>{bidId.provider}</Link> : undefined} + /> @@ - <LabelValue label="Owner" value={<AddressLink address={bidId?.owner} />} /> + <LabelValue label="Owner" value={bidId?.owner ? <AddressLink address={bidId.owner} /> : undefined} /> @@ - <LabelValue label="dseq" value={<Link href={UrlService.deployment(bidId?.owner, bidId?.dseq)}>{bidId?.dseq}</Link>} /> + <LabelValue + label="dseq" + value={bidId?.owner && bidId?.dseq ? <Link href={UrlService.deployment(bidId.owner, bidId.dseq)}>{bidId.dseq}</Link> : undefined} + /> @@ - <LabelValue label="gseq" value={bidId?.gseq} /> - <LabelValue label="oseq" value={bidId?.oseq} /> + <LabelValue label="gseq" value={bidId?.gseq ?? undefined} /> + <LabelValue label="oseq" value={bidId?.oseq ?? undefined} />
🧹 Nitpick comments (5)
apps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsx (1)
18-19: Consider adding loading fallbacks for dynamic imports.The dynamic imports lack loading fallbacks, which may cause the Time label to briefly render empty content until the react-intl module loads. While not critical, this could create a minor visual glitch.
Apply this diff to add loading placeholders:
-const FormattedRelativeTime = dynamic(() => import("react-intl").then(mod => mod.FormattedRelativeTime), { ssr: false }); -const FormattedDate = dynamic(() => import("react-intl").then(mod => mod.FormattedDate), { ssr: false }); +const FormattedRelativeTime = dynamic(() => import("react-intl").then(mod => mod.FormattedRelativeTime), { + ssr: false, + loading: () => <span>Loading...</span> +}); +const FormattedDate = dynamic(() => import("react-intl").then(mod => mod.FormattedDate), { + ssr: false, + loading: () => <span>Loading...</span> +});apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx (1)
17-17: Guard JSON operations against undefined.When
message?.data?.groupsis undefined,JSON.parse(JSON.stringify(undefined))will produceundefined, but it's safer to check explicitly before rendering.Apply this diff:
- {message?.data?.groups && <LabelValue label="Groups" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.groups))} />} />} + {message?.data?.groups && <LabelValue label="Groups" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message.data.groups))} />} />}apps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsx (1)
13-13: Guard JSON operations against undefined.When
message?.data?.attributesis undefined, the JSON operations are unnecessary. Although optional chaining prevents errors, an explicit check improves clarity.Apply this diff:
- <LabelValue label="Attributes" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.attributes))} />} /> + {message?.data?.attributes && <LabelValue label="Attributes" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message.data.attributes))} />} />}apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsx (1)
15-15: Address TODO: Provider page link.The TODO comment indicates a missing feature for linking to the provider page. The current implementation already uses
UrlService.address(bidId?.provider)which should navigate to the provider address page.Verify whether
UrlService.address()provides the intended provider page link, or if a dedicatedUrlService.provider()method is needed. If the current implementation is sufficient, the TODO can be removed.apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx (1)
17-17: Consider using structured clone or passing the object directly.The pattern
JSON.parse(JSON.stringify(message?.data?.attributes))performs a deep clone but is inefficient. SinceDynamicReactJsonlikely handles object serialization internally, consider passing the object directly unless deep cloning is explicitly required for mutation safety.If deep cloning is unnecessary, apply this diff:
- <LabelValue label="Attributes" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.attributes))} />} /> + <LabelValue label="Attributes" value={<DynamicReactJson src={message?.data?.attributes} />} />If deep cloning is required, consider using
structuredClone()(available in modern environments) for better performance:- <LabelValue label="Attributes" value={<DynamicReactJson src={JSON.parse(JSON.stringify(message?.data?.attributes))} />} /> + <LabelValue label="Attributes" value={<DynamicReactJson src={structuredClone(message?.data?.attributes)} />} />
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (80)
apps/stats-web/package.json(1 hunks)apps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsx(2 hunks)apps/stats-web/src/components/AKTAmount.tsx(1 hunks)apps/stats-web/src/components/transactions/TxMessageRow.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseBid.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateBid.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgStartGroup.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/index.ts(1 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgRevokeCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgSignProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgStartGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgDeleteProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgDepositDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgPauseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgRevokeCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgSignProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgDepositDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgPauseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgStartGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgUpdateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/createMsgView.tsx(1 hunks)apps/stats-web/src/components/transactions/generic/index.ts(1 hunks)apps/stats-web/src/config/denom.config.ts(1 hunks)apps/stats-web/src/lib/mathHelpers.ts(1 hunks)apps/stats-web/src/services/api-url/api-url.service.ts(1 hunks)
💤 Files with no reviewable changes (50)
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgRevokeCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgStartGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgSignProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgDepositDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgSignProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgStartGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgRevokeCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgDepositDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgDeleteProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgPauseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgPauseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseGroup.tsx
🚧 Files skipped from review as they are similar to previous changes (10)
- apps/stats-web/package.json
- apps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsx
- apps/stats-web/src/components/transactions/akash/MsgCreateBid.tsx
- apps/stats-web/src/lib/mathHelpers.ts
- apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx
- apps/stats-web/src/components/AKTAmount.tsx
- apps/stats-web/src/components/transactions/TxMessageRow.tsx
- apps/stats-web/src/components/transactions/createMsgView.tsx
- apps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsx
- apps/stats-web/src/components/transactions/generic/index.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Never use type any or cast to type any. Always define the proper TypeScript types.
Files:
apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsxapps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsxapps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsxapps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsxapps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsxapps/stats-web/src/services/api-url/api-url.service.tsapps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsxapps/stats-web/src/components/transactions/akash/index.tsapps/stats-web/src/components/transactions/akash/MsgCloseLease.tsxapps/stats-web/src/components/transactions/akash/MsgCloseBid.tsxapps/stats-web/src/config/denom.config.tsapps/stats-web/src/components/transactions/akash/MsgStartGroup.tsxapps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsxapps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsxapps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsxapps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsxapps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsxapps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
**/*.{js,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code
Files:
apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsxapps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsxapps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsxapps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsxapps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsxapps/stats-web/src/services/api-url/api-url.service.tsapps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsxapps/stats-web/src/components/transactions/akash/index.tsapps/stats-web/src/components/transactions/akash/MsgCloseLease.tsxapps/stats-web/src/components/transactions/akash/MsgCloseBid.tsxapps/stats-web/src/config/denom.config.tsapps/stats-web/src/components/transactions/akash/MsgStartGroup.tsxapps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsxapps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsxapps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsxapps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsxapps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsxapps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx
🧠 Learnings (1)
📚 Learning: 2025-09-04T04:27:50.638Z
Learnt from: stalniy
PR: akash-network/console#1868
File: apps/api/src/billing/services/managed-signer/managed-signer.service.ts:1-1
Timestamp: 2025-09-04T04:27:50.638Z
Learning: In the akash-network/console project, importing MsgCreateLease from "akashnetwork/akash-api/v1beta3" instead of v1beta4 is considered non-critical by the maintainers, likely due to backward compatibility or project-specific requirements.
Applied to files:
apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsxapps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx
🧬 Code graph analysis (16)
apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsx (4)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/AKTAmount.tsx (1)
AKTAmount(18-57)apps/stats-web/src/lib/mathHelpers.ts (1)
coinsToAmount(45-49)
apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx (3)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)
apps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgCloseBid.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgStartGroup.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (2)
apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/AKTAmount.tsx (1)
AKTAmount(18-57)
apps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: validate / validate-app
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: test-build
- GitHub Check: test-build
🔇 Additional comments (7)
apps/stats-web/src/config/denom.config.ts (2)
1-1: Import migration aligns with chain-sdk adoption.The change from
@akashnetwork/akashjs/build/types/networkto@akashnetwork/chain-sdk/webis consistent with the broader migration strategy.
5-5: Verify NetworkId includes “testnet” as a literal
Exclude<NetworkId, "testnet"> relies on NetworkId being a string-literal union containing "testnet"; please confirm its definition covers exactly that before merging.apps/stats-web/src/services/api-url/api-url.service.ts (1)
1-1: Confirm NetworkId union from chain-sdk
Import change aligns with migration strategy; manually verify thatNetworkIdfrom@akashnetwork/chain-sdk/webmatches the union ofMAINNET_ID,TESTNET_ID, andSANDBOX_IDfrom@akashnetwork/network-storeand type-checks inapi-url.service.tsanddenom.config.ts.apps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx (1)
7-12: Remove guard suggestion; createMsgView handles version filtering and “v1” is valid.Likely an incorrect or invalid review comment.
apps/stats-web/src/components/transactions/akash/MsgStartGroup.tsx (1)
10-18: LGTM!The wrapper conversion follows the established pattern correctly. The component now supports multiple transaction versions (
v1beta1throughv1beta4) and falls back to JSON rendering for unsupported versions.apps/stats-web/src/components/transactions/akash/index.ts (1)
1-19: LGTM!This barrel export file consolidates Akash transaction message components, making imports cleaner across the codebase. The structure is straightforward and follows standard practices.
apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx (1)
11-11: No change needed for version array:MsgSignProviderAttributesaligns with other provider-attribute and certificate messages that support v1 only.
| return ( | ||
| <> | ||
| <LabelValue label="Owner" value={<AddressLink address={message?.data?.id?.owner} />} /> | ||
| <LabelValue label="dseq" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} /> |
There was a problem hiding this comment.
Guard dseq Link to avoid invalid hrefs.
Building a deployment link when owner or dseq is missing creates an invalid href, consistent with similar issues in other message components.
Apply this diff:
- <LabelValue label="dseq" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} />
+ <LabelValue
+ label="dseq"
+ value={
+ message?.data?.id?.owner && message?.data?.id?.dseq
+ ? <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}>{message.data.id.dseq}</Link>
+ : message?.data?.id?.dseq
+ }
+ />📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <LabelValue label="dseq" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} /> | |
| <LabelValue | |
| label="dseq" | |
| value={ | |
| message?.data?.id?.owner && message?.data?.id?.dseq | |
| ? <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}>{message.data.id.dseq}</Link> | |
| : message?.data?.id?.dseq | |
| } | |
| /> |
🤖 Prompt for AI Agents
In apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsx
around line 14, the Link is built unconditionally using UrlService.deployment
with message?.data?.id?.owner and message?.data?.id?.dseq which can produce
invalid hrefs when owner or dseq is missing; update the JSX to first check both
owner and dseq are present and non-null/undefined and only render the Link when
they are, otherwise render the dseq value (or a fallback like '-') as plain text
so no invalid href is produced.
| <LabelValue label="Owner" value={<AddressLink address={message?.data?.id?.owner} />} /> | ||
| <LabelValue label="dseq" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} /> | ||
| <LabelValue label="gseq" value={message?.data?.id?.gseq} /> | ||
| </> |
There was a problem hiding this comment.
Guard Links/AddressLink to avoid invalid hrefs and "undefined" text
Conditionally construct Link/AddressLink; otherwise pass undefined so LabelValue omits value.
- <LabelValue label="Owner" value={<AddressLink address={message?.data?.id?.owner} />} />
- <LabelValue label="dseq" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} />
- <LabelValue label="gseq" value={message?.data?.id?.gseq} />
+ <LabelValue label="Owner" value={message?.data?.id?.owner ? <AddressLink address={message.data.id.owner} /> : undefined} />
+ <LabelValue
+ label="dseq"
+ value={
+ message?.data?.id?.owner && message?.data?.id?.dseq ? (
+ <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}>{message.data.id.dseq}</Link>
+ ) : undefined
+ }
+ />
+ <LabelValue label="gseq" value={message?.data?.id?.gseq ?? undefined} />📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <LabelValue label="Owner" value={<AddressLink address={message?.data?.id?.owner} />} /> | |
| <LabelValue label="dseq" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} /> | |
| <LabelValue label="gseq" value={message?.data?.id?.gseq} /> | |
| </> | |
| <LabelValue | |
| label="Owner" | |
| value={ | |
| message?.data?.id?.owner | |
| ? <AddressLink address={message.data.id.owner} /> | |
| : undefined | |
| } | |
| /> | |
| <LabelValue | |
| label="dseq" | |
| value={ | |
| message?.data?.id?.owner && message?.data?.id?.dseq | |
| ? ( | |
| <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}> | |
| {message.data.id.dseq} | |
| </Link> | |
| ) | |
| : undefined | |
| } | |
| /> | |
| <LabelValue | |
| label="gseq" | |
| value={message?.data?.id?.gseq ?? undefined} | |
| /> |
| <LabelValue label="Provider" value={<Link href={UrlService.address(bidId?.provider)}>{bidId?.provider}</Link>} /> | ||
| {/* TODO: Add link to provider page */} | ||
| <LabelValue label="Owner" value={<AddressLink address={bidId?.owner} />} /> | ||
| <LabelValue label="dseq" value={<Link href={UrlService.deployment(bidId?.owner, bidId?.dseq)}>{bidId?.dseq}</Link>} /> |
There was a problem hiding this comment.
Guard Link hrefs to avoid invalid URLs.
Lines 14 and 17 build links with potentially undefined values. When bidId, bidId.provider, bidId.owner, or bidId.dseq are missing, invalid hrefs are created.
Apply this diff:
- <LabelValue label="Provider" value={<Link href={UrlService.address(bidId?.provider)}>{bidId?.provider}</Link>} />
+ <LabelValue
+ label="Provider"
+ value={bidId?.provider ? <Link href={UrlService.address(bidId.provider)}>{bidId.provider}</Link> : undefined}
+ />
{/* TODO: Add link to provider page */}
<LabelValue label="Owner" value={<AddressLink address={bidId?.owner} />} />
- <LabelValue label="dseq" value={<Link href={UrlService.deployment(bidId?.owner, bidId?.dseq)}>{bidId?.dseq}</Link>} />
+ <LabelValue
+ label="dseq"
+ value={
+ bidId?.owner && bidId?.dseq
+ ? <Link href={UrlService.deployment(bidId.owner, bidId.dseq)}>{bidId.dseq}</Link>
+ : bidId?.dseq
+ }
+ />📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <LabelValue label="Provider" value={<Link href={UrlService.address(bidId?.provider)}>{bidId?.provider}</Link>} /> | |
| {/* TODO: Add link to provider page */} | |
| <LabelValue label="Owner" value={<AddressLink address={bidId?.owner} />} /> | |
| <LabelValue label="dseq" value={<Link href={UrlService.deployment(bidId?.owner, bidId?.dseq)}>{bidId?.dseq}</Link>} /> | |
| <LabelValue | |
| label="Provider" | |
| value={bidId?.provider | |
| ? <Link href={UrlService.address(bidId.provider)}>{bidId.provider}</Link> | |
| : undefined | |
| } | |
| /> | |
| {/* TODO: Add link to provider page */} | |
| <LabelValue label="Owner" value={<AddressLink address={bidId?.owner} />} /> | |
| <LabelValue | |
| label="dseq" | |
| value={ | |
| bidId?.owner && bidId?.dseq | |
| ? <Link href={UrlService.deployment(bidId.owner, bidId.dseq)}>{bidId.dseq}</Link> | |
| : bidId?.dseq | |
| } | |
| /> |
🤖 Prompt for AI Agents
In apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsx around
lines 14 to 17, the Link hrefs are built from possibly undefined bidId
properties which can produce invalid URLs; guard these by only calling
UrlService.address/UrlService.deployment when the underlying values exist and
otherwise render a safe fallback (e.g., plain text, disabled link, or '#' href).
Concretely: check bidId and bidId.provider before creating the Provider Link,
check bidId and bidId.dseq and bidId.owner before creating the dseq Link, and
for missing values render the raw value or a placeholder without using
UrlService; ensure AddressLink receives a valid address or is replaced with a
fallback display when bidId.owner is missing.
| export const MsgDepositDeployment = createMsgView(["v1beta1", "v1beta2", "v1beta3"], ({ message }) => { | ||
| return ( | ||
| <> | ||
| <LabelValue label="Owner" value={<AddressLink address={message?.data?.id?.owner} />} /> | ||
| <LabelValue label="DSEQ" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} /> | ||
| {message?.data?.depositor && <LabelValue label="Depositor" value={<AddressLink address={message?.data?.depositor} />} />} | ||
| <LabelValue label="Deposit" value={<AKTAmount uakt={coinsToAmount(message?.data?.amount, "uakt")} showAKTLabel showUSD />} /> | ||
| </> |
There was a problem hiding this comment.
🧩 Analysis chain
Guard Links/AddressLink and include v1beta4 support
- Prevent invalid hrefs and "undefined" text by guarding before creating Link/AddressLink.
- Likely need v1beta4 in supported versions for SDK upgrade.
Apply:
-export const MsgDepositDeployment = createMsgView(["v1beta1", "v1beta2", "v1beta3"], ({ message }) => {
+export const MsgDepositDeployment = createMsgView(["v1beta1", "v1beta2", "v1beta3", "v1beta4"], ({ message }) => {
return (
<>
- <LabelValue label="Owner" value={<AddressLink address={message?.data?.id?.owner} />} />
- <LabelValue label="DSEQ" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} />
+ <LabelValue label="Owner" value={message?.data?.id?.owner ? <AddressLink address={message.data.id.owner} /> : undefined} />
+ <LabelValue
+ label="DSEQ"
+ value={
+ message?.data?.id?.owner && message?.data?.id?.dseq ? (
+ <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}>{message.data.id.dseq}</Link>
+ ) : undefined
+ }
+ />
{message?.data?.depositor && <LabelValue label="Depositor" value={<AddressLink address={message?.data?.depositor} />} />}
<LabelValue label="Deposit" value={<AKTAmount uakt={coinsToAmount(message?.data?.amount, "uakt")} showAKTLabel showUSD />} />
</>
);
});🏁 Script executed:
#!/bin/bash
rg -n "createMsgView" -C2 --glob '**/*.ts*'Length of output: 21049
Add v1beta4 support and guard AddressLink/Link in MsgDepositDeployment
- Include
"v1beta4"in thecreateMsgViewversions array. - Wrap
AddressLinkandLinkvalues in guards to avoid rendering with undefined props:
-export const MsgDepositDeployment = createMsgView(["v1beta1", "v1beta2", "v1beta3"], ({ message }) => {
+export const MsgDepositDeployment = createMsgView(["v1beta1", "v1beta2", "v1beta3", "v1beta4"], ({ message }) => {
return (
<>
- <LabelValue label="Owner" value={<AddressLink address={message?.data?.id?.owner} />} />
- <LabelValue label="DSEQ" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} />
+ <LabelValue
+ label="Owner"
+ value={message?.data?.id?.owner ? <AddressLink address={message.data.id.owner} /> : undefined}
+ />
+ <LabelValue
+ label="DSEQ"
+ value={
+ message?.data?.id?.owner && message?.data?.id?.dseq
+ ? <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}>{message.data.id.dseq}</Link>
+ : undefined
+ }
+ />
{message?.data?.depositor && <LabelValue label="Depositor" value={<AddressLink address={message.data.depositor} />} />}
<LabelValue label="Deposit" value={<AKTAmount uakt={coinsToAmount(message.data.amount, "uakt")} showAKTLabel showUSD />} />
</>
);
});Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In apps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsx
around lines 12 to 19, the version list passed to createMsgView needs to include
"v1beta4" and the AddressLink/Link props must be guarded to avoid passing
undefined values; update the versions array to ["v1beta1", "v1beta2", "v1beta3",
"v1beta4"] and change the LabelValue renderings to only render AddressLink and
Link when the underlying values exist (e.g., check message?.data?.id?.owner and
message?.data?.id?.dseq before rendering the Owner and DSEQ LabelValue, and
check message?.data?.depositor before rendering Depositor) so no undefined props
are passed.
| return ( | ||
| <> | ||
| <LabelValue label="Owner" value={<AddressLink address={message?.data?.id?.owner} />} /> | ||
| <LabelValue label="dseq" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} /> |
There was a problem hiding this comment.
Guard dseq Link to avoid invalid hrefs.
Building a deployment link when owner or dseq is missing creates an invalid href. This issue is similar to concerns raised in MsgPauseGroup.
Apply this diff:
- <LabelValue label="dseq" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} />
+ <LabelValue
+ label="dseq"
+ value={
+ message?.data?.id?.owner && message?.data?.id?.dseq
+ ? <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}>{message.data.id.dseq}</Link>
+ : message?.data?.id?.dseq
+ }
+ />📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <LabelValue label="dseq" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} /> | |
| <LabelValue | |
| label="dseq" | |
| value={ | |
| message?.data?.id?.owner && message?.data?.id?.dseq | |
| ? <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}> | |
| {message.data.id.dseq} | |
| </Link> | |
| : message?.data?.id?.dseq | |
| } | |
| /> |
🤖 Prompt for AI Agents
In apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx
around line 15, the Link for dseq is built unguarded and can produce an invalid
href when message?.data?.id?.owner or message?.data?.id?.dseq is missing; change
the JSX to check both owner and dseq before rendering the Link (e.g., render
Link only when owner && dseq are truthy), and if either is missing render a safe
fallback such as the raw dseq value or a plain text/placeholder so no invalid
href is produced.
| <LabelValue label="Provider" value={<Link href={UrlService.address(bidId?.provider)}>{bidId?.provider}</Link>} /> | ||
| <LabelValue label="dseq" value={<Link href={UrlService.deployment(bidId?.owner, bidId?.dseq)}>{bidId?.dseq}</Link>} /> | ||
| <LabelValue label="gseq" value={bidId?.gseq} /> |
There was a problem hiding this comment.
Guard Link hrefs to avoid invalid URLs.
Lines 15-17 build links with potentially undefined values. When bidId, bidId.provider, bidId.owner, or bidId.dseq are missing, invalid hrefs are created.
Apply this diff:
- <LabelValue label="Provider" value={<Link href={UrlService.address(bidId?.provider)}>{bidId?.provider}</Link>} />
+ <LabelValue
+ label="Provider"
+ value={bidId?.provider ? <Link href={UrlService.address(bidId.provider)}>{bidId.provider}</Link> : undefined}
+ />
<LabelValue label="Owner" value={<AddressLink address={bidId?.owner} />} />
- <LabelValue label="dseq" value={<Link href={UrlService.deployment(bidId?.owner, bidId?.dseq)}>{bidId?.dseq}</Link>} />
+ <LabelValue
+ label="dseq"
+ value={
+ bidId?.owner && bidId?.dseq
+ ? <Link href={UrlService.deployment(bidId.owner, bidId.dseq)}>{bidId.dseq}</Link>
+ : bidId?.dseq
+ }
+ />Committable suggestion skipped: line range outside the PR's diff.
145561f to
f6217ba
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (11)
apps/stats-web/package.json (1)
16-16: Duplicate: SDK migration already flagged.A previous review comment already identified the need to verify complete removal of
@akashnetwork/akashjsimports across the codebase.apps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsx (1)
15-16: Guard Link hrefs to prevent invalid URLs.Lines 15-16 construct Links with potentially undefined values. When
bidId?.provider,bidId?.owner, orbidId?.dseqare missing, invalid hrefs are created.Apply this diff:
- <LabelValue label="Provider" value={<Link href={UrlService.address(bidId?.provider)}>{bidId?.provider}</Link>} /> - <LabelValue label="dseq" value={<Link href={UrlService.deployment(bidId?.owner, bidId?.dseq)}>{bidId?.dseq}</Link>} /> + <LabelValue + label="Provider" + value={bidId?.provider ? <Link href={UrlService.address(bidId.provider)}>{bidId.provider}</Link> : undefined} + /> + <LabelValue + label="dseq" + value={ + bidId?.owner && bidId?.dseq + ? <Link href={UrlService.deployment(bidId.owner, bidId.dseq)}>{bidId.dseq}</Link> + : bidId?.dseq + } + />apps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsx (1)
14-14: Guard the dseq Link to avoid invalid hrefs.Line 14 constructs a deployment link when
ownerordseqmight be missing, resulting in an invalid href.Apply this diff:
- <LabelValue label="dseq" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} /> + <LabelValue + label="dseq" + value={ + message?.data?.id?.owner && message?.data?.id?.dseq + ? <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}>{message.data.id.dseq}</Link> + : message?.data?.id?.dseq + } + />apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx (2)
21-22: Guard the dseq Link to prevent invalid hrefs.Line 22 creates a deployment link without checking if
ownerordseqare present, which can produce an invalid href.Apply this diff:
- <LabelValue label="dseq" value={<Link href={UrlService.deployment(data?.id?.owner, data?.id?.dseq)}>{data?.id?.dseq}</Link>} /> + <LabelValue + label="dseq" + value={ + data?.id?.owner && data?.id?.dseq + ? <Link href={UrlService.deployment(data.id.owner, data.id.dseq)}>{data.id.dseq}</Link> + : data?.id?.dseq + } + />
25-26: Conditionally render DepositDetail and guard JSON operations.Lines 25-26 can crash when optional fields are absent:
DepositDetailexpects a non-undefined value but receivesdata?.depositwhich can be undefined.JSON.parse(JSON.stringify(data?.groups))throws whengroupsis undefined.Apply this diff:
- <DepositDetail value={data?.deposit} /> - <LabelValue label="Groups" value={<DynamicReactJson src={JSON.parse(JSON.stringify(data?.groups))} />} /> + {data?.deposit && <DepositDetail value={data.deposit} />} + {data?.groups && <LabelValue label="Groups" value={<DynamicReactJson src={data.groups} />} />}apps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsx (2)
12-12: Add v1beta4 support to the versions array.Line 12 is missing
"v1beta4"in the supported versions array, which is likely needed to support messages after the chain SDK upgrade.Apply this diff:
-export const MsgDepositDeployment = createMsgView(["v1beta1", "v1beta2", "v1beta3"], ({ message }) => { +export const MsgDepositDeployment = createMsgView(["v1beta1", "v1beta2", "v1beta3", "v1beta4"], ({ message }) => {
15-16: Guard AddressLink and Link to prevent invalid hrefs.Lines 15-16 pass potentially undefined values to
AddressLinkandLink, which can result in invalid hrefs or render "undefined" as text.Apply this diff:
- <LabelValue label="Owner" value={<AddressLink address={message?.data?.id?.owner} />} /> - <LabelValue label="DSEQ" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} /> + <LabelValue + label="Owner" + value={message?.data?.id?.owner ? <AddressLink address={message.data.id.owner} /> : undefined} + /> + <LabelValue + label="DSEQ" + value={ + message?.data?.id?.owner && message?.data?.id?.dseq + ? <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}>{message.data.id.dseq}</Link> + : undefined + } + />apps/stats-web/src/components/transactions/akash/MsgCreateBid.tsx (3)
18-18: Guard the Provider Link to avoid invalid hrefs.Line 18 constructs a Link with
UrlService.address(message?.data?.provider)without checking ifprovideris defined, which can produce an invalid href.Apply this diff:
- <LabelValue label="Provider" value={<Link href={UrlService.address(message?.data?.provider)}>{message?.data?.provider}</Link>} /> + <LabelValue + label="Provider" + value={message?.data?.provider ? <Link href={UrlService.address(message.data.provider)}>{message.data.provider}</Link> : undefined} + />
20-21: Guard Owner and dseq Links to prevent invalid hrefs.Lines 20-21 pass potentially undefined values to
AddressLinkandLink, resulting in invalid hrefs whenownerordseqare missing.Apply this diff:
- <LabelValue label="Owner" value={<AddressLink address={order?.owner} />} /> - <LabelValue label="dseq" value={<Link href={UrlService.deployment(order?.owner, order?.dseq)}>{order?.dseq}</Link>} /> + <LabelValue label="Owner" value={order?.owner ? <AddressLink address={order.owner} /> : undefined} /> + <LabelValue + label="dseq" + value={order?.owner && order?.dseq ? <Link href={UrlService.deployment(order.owner, order.dseq)}>{order.dseq}</Link> : undefined} + />
25-25: Conditionally render DepositDetail to avoid passing undefined.Line 25 passes
message?.data?.depositdirectly toDepositDetail, which expects aCoin | Depositvalue. Whendepositis undefined, this can cause a crash insideDepositDetail.Apply this diff:
- <DepositDetail value={message?.data?.deposit} /> + {message?.data?.deposit && <DepositDetail value={message.data.deposit} />}apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsx (1)
14-14: Guard the dseq Link to avoid invalid hrefs.Line 14 builds a deployment link when
ownerordseqmay be missing, creating an invalid href.Apply this diff:
- <LabelValue label="dseq" value={<Link href={UrlService.deployment(message?.data?.id?.owner, message?.data?.id?.dseq)}>{message?.data?.id?.dseq}</Link>} /> + <LabelValue + label="dseq" + value={ + message?.data?.id?.owner && message?.data?.id?.dseq + ? <Link href={UrlService.deployment(message.data.id.owner, message.data.id.dseq)}>{message.data.id.dseq}</Link> + : message?.data?.id?.dseq + } + />
🧹 Nitpick comments (3)
apps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsx (1)
18-19: Consider SSR implications of client-only date formatting.The
FormattedRelativeTimeandFormattedDatecomponents are now dynamically loaded withssr: false, meaning they won't render during SSR. This will cause:
- A hydration delay where these components appear blank initially
- Potential layout shift as they populate on the client
If the goal is to avoid timezone mismatches between server and client, consider using a loading skeleton or alternative approach.
apps/stats-web/src/components/transactions/TxMessageRow.tsx (1)
31-34: Initialize MsgComponent or use const with type assertion.The variable
MsgComponentis declared withletbut not initialized, and TypeScript will infer it asundefinedbefore the conditional assignments. Consider initializing it toundefinedexplicitly or restructuring the logic.Apply this diff:
- let MsgComponent: React.FunctionComponent<TxMessageProps & { version: string }>; + let MsgComponent: React.FunctionComponent<TxMessageProps & { version: string }> | undefined;apps/stats-web/src/components/transactions/createMsgView.tsx (1)
11-11: Consider performance impact of JSON deep clone.The fallback uses
JSON.parse(JSON.stringify(props))to deep clone props before passing toDynamicReactJson. While this sanitizes the data for JSON viewing:
- It's computationally expensive for large message objects
- It strips functions, undefined values, and non-enumerable properties
If
DynamicReactJsoncan handle the raw props object, consider passingpropsdirectly. Otherwise, this is acceptable for fallback scenarios.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (81)
apps/deploy-web/package.json(1 hunks)apps/stats-web/package.json(1 hunks)apps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsx(2 hunks)apps/stats-web/src/components/AKTAmount.tsx(1 hunks)apps/stats-web/src/components/transactions/TxMessageRow.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseBid.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateBid.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgStartGroup.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsx(2 hunks)apps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx(1 hunks)apps/stats-web/src/components/transactions/akash/index.ts(1 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgRevokeCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgSignProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgStartGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta1/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgDeleteProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgDepositDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgPauseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgRevokeCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgSignProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta2/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateCertificate.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProvider.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProviderAttributes.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgDepositDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgPauseGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgStartGroup.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgUpdateDeployment.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta3/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateBid.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateLease.tsx(0 hunks)apps/stats-web/src/components/transactions/akash/v1beta4/MsgWithdrawLease.tsx(0 hunks)apps/stats-web/src/components/transactions/createMsgView.tsx(1 hunks)apps/stats-web/src/components/transactions/generic/index.ts(1 hunks)apps/stats-web/src/config/denom.config.ts(1 hunks)apps/stats-web/src/lib/mathHelpers.ts(1 hunks)apps/stats-web/src/services/api-url/api-url.service.ts(1 hunks)
💤 Files with no reviewable changes (50)
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgDepositDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgRevokeCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgRevokeCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCloseDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgDepositDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgPauseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgUpdateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgDeleteProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgDeleteProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgSignProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgPauseGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateCertificate.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateProvider.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgWithdrawLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgDeleteProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgCloseDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta1/MsgStartGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateBid.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgSignProviderAttributes.tsx
- apps/stats-web/src/components/transactions/akash/v1beta3/MsgStartGroup.tsx
- apps/stats-web/src/components/transactions/akash/v1beta2/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/v1beta4/MsgCloseBid.tsx
🚧 Files skipped from review as they are similar to previous changes (11)
- apps/stats-web/src/lib/mathHelpers.ts
- apps/stats-web/src/services/api-url/api-url.service.ts
- apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx
- apps/stats-web/src/components/transactions/akash/MsgUpdateDeployment.tsx
- apps/stats-web/src/components/transactions/akash/MsgCreateLease.tsx
- apps/stats-web/src/components/transactions/akash/MsgCloseLease.tsx
- apps/stats-web/src/components/transactions/akash/MsgUpdateProvider.tsx
- apps/stats-web/src/components/transactions/generic/index.ts
- apps/stats-web/src/components/transactions/akash/MsgCloseBid.tsx
- apps/stats-web/src/components/transactions/akash/index.ts
- apps/stats-web/src/components/transactions/akash/MsgCloseGroup.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Never use type any or cast to type any. Always define the proper TypeScript types.
Files:
apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsxapps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsxapps/stats-web/src/components/transactions/createMsgView.tsxapps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsxapps/stats-web/src/components/transactions/akash/MsgStartGroup.tsxapps/stats-web/src/config/denom.config.tsapps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsxapps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsxapps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsxapps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgCreateBid.tsxapps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsxapps/stats-web/src/components/transactions/TxMessageRow.tsxapps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsxapps/stats-web/src/components/AKTAmount.tsxapps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
**/*.{js,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code
Files:
apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsxapps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsxapps/stats-web/src/components/transactions/createMsgView.tsxapps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsxapps/stats-web/src/components/transactions/akash/MsgStartGroup.tsxapps/stats-web/src/config/denom.config.tsapps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsxapps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsxapps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsxapps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsxapps/stats-web/src/components/transactions/akash/MsgCreateBid.tsxapps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsxapps/stats-web/src/components/transactions/TxMessageRow.tsxapps/stats-web/src/app/transactions/[hash]/TransactionInfo.tsxapps/stats-web/src/components/AKTAmount.tsxapps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx
🧬 Code graph analysis (15)
apps/stats-web/src/components/transactions/akash/MsgCloseDeployment.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsx (4)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (1)
DepositDetail(9-20)
apps/stats-web/src/components/transactions/akash/MsgCreateDeployment.tsx (4)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (1)
DepositDetail(9-20)apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)
apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/createMsgView.tsx (2)
apps/provider-console/src/types/transaction.ts (1)
TransactionMessage(16-22)apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)
apps/stats-web/src/components/transactions/akash/MsgPauseGroup.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgStartGroup.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/akash/MsgWithdrawLease.tsx (2)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)
apps/stats-web/src/components/transactions/akash/MsgDepositDeployment.tsx (4)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/AKTAmount.tsx (1)
AKTAmount(18-57)apps/stats-web/src/lib/mathHelpers.ts (1)
coinsToAmount(45-49)
apps/stats-web/src/components/transactions/akash/MsgCreateBid.tsx (6)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)apps/deploy-web/src/components/shared/LabelValue.tsx (1)
LabelValue(11-22)apps/stats-web/src/components/AKTAmount.tsx (1)
AKTAmount(18-57)apps/stats-web/src/lib/mathHelpers.ts (1)
coinsToAmount(45-49)apps/stats-web/src/components/transactions/akash/helpers/DepositDetail.tsx (1)
DepositDetail(9-20)apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)
apps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
apps/stats-web/src/components/transactions/TxMessageRow.tsx (1)
apps/stats-web/src/components/DynamicJsonView.tsx (1)
DynamicReactJson(20-23)
apps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx (1)
apps/stats-web/src/components/transactions/createMsgView.tsx (1)
createMsgView(5-13)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: test-build
- GitHub Check: test-build
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: validate / validate-app
- GitHub Check: test-build
- GitHub Check: validate / validate-app
🔇 Additional comments (16)
apps/stats-web/src/components/transactions/akash/MsgAccountDeposit.tsx (1)
10-19: LGTM!The component correctly uses
createMsgViewfor version gating and handles data access safely with optional chaining.apps/stats-web/src/components/transactions/akash/MsgCreateCertificate.tsx (1)
7-15: LGTM!The refactor successfully wraps the certificate message view with
createMsgViewto support multiple proto versions (v1beta1 through v1), aligning with the PR's objectives.apps/stats-web/src/components/transactions/createMsgView.tsx (1)
5-12: Well-designed version-gating HOC.The
createMsgViewutility provides a clean pattern for supporting multiple transaction proto versions with fallback to JSON rendering. This aligns perfectly with the PR objectives.apps/stats-web/src/components/AKTAmount.tsx (1)
11-11:uaktprop widening is safeudenomToDenomaccepts bothstringandnumber(parsing strings internally), so no changes are required.apps/stats-web/src/components/transactions/TxMessageRow.tsx (1)
31-33: Verify message type parsing assumptions. Parsing assumes dot-separated types with ≥3 segments, version always the penultimate segment, and name the last—confirm this holds for all message.type values.apps/deploy-web/package.json (1)
30-30: Include breaking changes and migration steps for alpha.8.Please summarize any breaking changes and migration steps from
@akashnetwork/chain-sdkv1.0.0-alpha.7 to v1.0.0-alpha.8 in the PR description to verify compatibility.apps/stats-web/src/config/denom.config.ts (1)
1-8: LGTM! Clean migration to chain-sdk types.The import path has been correctly updated from
@akashnetwork/akashjsto@akashnetwork/chain-sdk/web, and the type signature forUSDC_IBC_DENOMSnow uses the newNetworkIdtype with proper exclusion of"testnet".apps/stats-web/src/components/transactions/akash/MsgRevokeCertificate.tsx (1)
1-14: LGTM! Clean migration to createMsgView wrapper.The refactor correctly applies the multi-version wrapper pattern via
createMsgViewwith versions["v1beta1", "v1beta2", "v1beta3", "v1"]. The render logic is preserved, and import paths are updated appropriately.apps/stats-web/src/components/transactions/akash/MsgCreateProvider.tsx (2)
2-3: LGTM! Import path updates are correct.The import path changes align with the refactoring to consolidate transaction components. The LabelValue import is correctly updated to reflect the new relative path, and createMsgView is properly imported for the version-aware wrapper pattern.
8-18: LGTM! Version-aware wrapper pattern correctly applied.The component is properly wrapped with
createMsgViewto support multiple transaction versions. The version array["v1beta1", "v1beta2", "v1beta3", "v1beta4"]enables rendering for all supported versions, with automatic fallback to JSON display for unsupported versions. The rendering logic is preserved correctly.apps/stats-web/src/components/transactions/akash/MsgDeleteProviderAttributes.tsx (2)
4-5: LGTM! Import updates are correct.The import path changes properly reflect the directory structure refactoring, moving LabelValue up one level and adding the createMsgView import.
10-19: No change needed to version array for MsgDeleteProviderAttributes. It correctly ends with"v1", matching MsgSignProviderAttributes, MsgRevokeCertificate, and MsgCreateCertificate.apps/stats-web/src/components/transactions/akash/MsgStartGroup.tsx (2)
4-5: LGTM! Import changes are correct.The import updates properly reflect the refactored directory structure and add the necessary createMsgView wrapper.
10-18: LGTM! Version-aware wrapper correctly implemented.The component is properly wrapped with
createMsgViewusing the version array["v1beta1", "v1beta2", "v1beta3", "v1beta4"]. The rendering logic for Owner, dseq, and gseq is preserved correctly.apps/stats-web/src/components/transactions/akash/MsgSignProviderAttributes.tsx (2)
4-5: LGTM! Import updates are correct.The import path changes properly reflect the directory structure refactoring.
11-20: No changes needed for version array: The["v1beta1","v1beta2","v1beta3","v1"]array correctly maps to the currentakash.provider.v1message types.
|
Merge in main-sdk-next? |
No, into main :) because it only affects how transactions are displayed. The current version of blockchain doesn't have these transactions and they won't be displayed. So, it's safe to merge into main |
Why
To support new messages after chain sdk upgrade. Fixes #1922
Summary by CodeRabbit
New Features
Improvements
Chores