-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Configuring MANTRA Explorer, plus OMSTEAD customisations #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
when clicking the volume tab of the chat, hover tip remains Price, should be Volume
[FIX] fix typo in pricemarket chart
remove truncation of blockspeed to more accurately estimate block arrival
bfhevm-testnet
Updating rest port to correctly configure api
fix: class binding for reactive `kind` variable
chore: fixed issues with Vue 3 component setup
* chore(ci): Upgrade ci machine * chore(data): Adjust staking APR calculation
* chore(token): Display IBC token name * chore(code): Follow Vue best practice
* chore(lib): Add new libs * feat(util): Add utils functions * feat(display): Refactor to display denom and amount * feat(display): Format factory tokens * feat(display): Display address balance correctly * chore(codes): Improve error handling
* fix(data): Fix data type * chore(ci): Add a PR ci
* fix(data): Display native token balance * fix(data): Display wrong parsed number
* chore(lib): Update libs * chore(chains): Add chains internal connections * chore(chains): Reads internal chains
WalkthroughThis update introduces new MANTRA chain configuration files, adds group governance API support and types, and restructures several UI components for improved user experience. It also updates branding, analytics, and wallet integration, including Leap wallet support. Additional enhancements include error handling, configuration loading logic, and the removal of obsolete GitHub Actions workflows. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant WalletSuggest
participant LeapWallet
participant KeplrWallet
participant MetaMask
User->>WalletSuggest: Selects wallet (leap/keplr/metamask)
alt If leap
WalletSuggest->>LeapWallet: experimentalSuggestChain(config)
LeapWallet-->>WalletSuggest: Response/Error
else If keplr
WalletSuggest->>KeplrWallet: experimentalSuggestChain(config)
KeplrWallet-->>WalletSuggest: Response/Error
else If metamask
WalletSuggest->>MetaMask: initSnap(config)
MetaMask-->>WalletSuggest: Response/Error
end
sequenceDiagram
participant User
participant WasmClient
participant API
User->>WasmClient: Request suggested contract queries
WasmClient->>API: GET smart query with template
API-->>WasmClient: Response with message
WasmClient->>User: Return extracted suggested queries
Possibly related PRs
Suggested reviewers
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
💤 Files with no reviewable changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Deploying mantrachain-explorer-ping-pub with
|
| Latest commit: |
94a544b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://84e25ef1.mantrachain-explorer-ping-pub.pages.dev |
| Branch Preview URL: | https://aaron-evm-internal.mantrachain-explorer-ping-pub.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 22
🧹 Nitpick comments (27)
chains/testnet/3_mantra-canary-net.json (1)
17-17: Consider adding snapshot provider informationThe
snapshot_providerfield is currently empty. This is not critical but consider adding a snapshot provider if one becomes available for this testnet chain.chains/mainnet/1_mantra-dukong.json (1)
17-17: Consider adding snapshot provider informationThe
snapshot_providerfield is currently empty. If snapshot services are available for this chain, consider adding that information.src/App.vue (1)
7-7: Add a TODO or tracking issue for this temporary codeSince this is explicitly marked as temporary ("until dukong is ready"), consider adding a TODO comment with a specific condition for removal or reference to a tracking issue to ensure this code doesn't accidentally remain in production.
- // Clear Local Storage temporarily until dukong is ready + // TODO: Remove this localStorage clear once dukong chain is ready - tracked in issue #XX + // Clear Local Storage temporarily until dukong is readysrc/modules/[chain]/block/block.ts (2)
20-21: Finalize the blocktime implementation.You've changed the blocktime from 6000ms to 3000ms, but left a "todo later" comment which suggests this might not be the final implementation.
if (this.recents.length < 2) return 3000; - return 3000; // todo later + return 3000;
54-54: Update commented-out code to match new blocktime.There's commented-out code that still references the old 6000ms timeout value, which should be updated to maintain consistency with your blocktime changes if this code might be used in the future.
- // setTimeout(timer, 6000) + // setTimeout(timer, 3000)src/modules/[chain]/staking/[validator].vue (1)
74-74: APR calculation adjusted with 0.6 multiplier for MANTRA Chain specifics.The APR calculation formula now includes a 0.6 multiplier (60%), effectively reducing the displayed APR by 40% compared to the original calculation. This appears to be a chain-specific adjustment for the MANTRA ecosystem to provide more conservative estimates.
Please ensure this adjustment has been properly communicated to stakeholders, as it significantly impacts the displayed validator returns.
Consider adding a comment explaining why this multiplier was introduced to improve code maintainability, especially for future developers who might question this adjustment.
- return format.percent(0.6 * (1 - communityTax) * (1 - rate) * Number(inflation) / bondedRatio); + // 0.6 multiplier applied to adjust APR calculations specifically for MANTRA Chain + return format.percent(0.6 * (1 - communityTax) * (1 - rate) * Number(inflation) / bondedRatio);src/modules/wallet/accounts.vue (1)
1-193: Remove unused import.While formatting improvements are good, there's an unused import that should be removed.
-import AdBanner from '@/components/ad/AdBanner.vue';This import is not used in the component after the AdBanner element was removed from the template.
src/modules/[chain]/tx/[hash].vue (1)
57-57: Fix typo in class name.There appears to be a typo in the class name 'dark:inver-x'. It should likely be 'dark:invert' or 'dark:invert-x'.
- class="text-primary dark:inver-x">{{ tx.tx_response.height + class="text-primary dark:invert">{{ tx.tx_response.heightsrc/libs/http.ts (1)
7-17: Consider implementing environment variable validation.The code assumes that Cloudflare Access credentials will be available in the environment. It would be good to add validation or fallback handling if these variables are not set.
if (url.includes("https://rpc.mantrachain.io") || url.includes("https://api.mantrachain.io")) { + const clientId = import.meta.env.VITE_CF_ACCESS_CLIENT_ID; + const clientSecret = import.meta.env.VITE_CF_ACCESS_CLIENT_SECRET; + + if (!clientId || !clientSecret) { + console.warn('Cloudflare Access credentials not found in environment variables'); + } + options = { headers: { - "CF-Access-Client-Id": import.meta.env.VITE_CF_ACCESS_CLIENT_ID, - "CF-Access-Client-Secret": import.meta.env.VITE_CF_ACCESS_CLIENT_SECRET + "CF-Access-Client-Id": clientId, + "CF-Access-Client-Secret": clientSecret } } }src/modules/[chain]/gov/[proposal_id].vue (1)
200-209: Consider adding more specific error logging.While the try-catch block is great for preventing crashes, it would be better to log the specific error for debugging purposes.
try { const { data } = fromBech32(voter); const hex = toHex(data); const v = stakingStore.validators.find( (x) => toHex(fromBech32(x.operator_address).data) === hex ); return v ? v.description.moniker : voter; } catch(e){ + console.error('Error processing voter address:', e); return voter; }index.html (1)
36-36: Consider using a specific version instead of @latest.While updating to the new package namespace is good, using "@latest" for production could lead to unexpected breaking changes if the library is updated. Consider pinning to a specific version for better stability.
-<script type="module" src="https://cdn.jsdelivr.net/npm/@ping-pub/widget@latest/dist/widget.min.js"></script> +<script type="module" src="https://cdn.jsdelivr.net/npm/@ping-pub/widget@1.0.0/dist/widget.min.js"></script>Replace "1.0.0" with the current stable version number.
src/modules/[chain]/cosmwasm/WasmClient.ts (1)
112-121: New method for extracting available contract queries, but regex pattern may be too restrictiveThe new
getWasmContractQueriesmethod elegantly extracts query methods from smart contracts. However, the regex pattern/(\w+)/gonly matches word characters within backticks. This may not capture query methods that contain hyphens, underscores, or other valid characters in method names.Consider using a more permissive regex that could match a wider range of method names:
- let re = /`(\w+)`/g + let re = /`([a-zA-Z0-9_-]+)`/gAlso, consider adding a comment explaining the expected response format from a contract that would contain these backtick-wrapped method names, as this pattern is specific to certain CosmWasm error messages.
.devcontainer/devcontainer.json (1)
4-4: Consider updating container name for consistency.The container is named "Oracle UI" but the project is being rebranded as "MANTRA Explorer". Consider updating the name to align with the new branding.
- "name": "Oracle UI", + "name": "MANTRA Explorer",src/style.css (1)
58-72: Added gradient divider element stylingNew CSS class for gradient dividers enhances visual styling, but contains a potential issue with margin properties.
Fix the conflicting margin properties:
.section-grad__divider { opacity: .5; background-image: linear-gradient(90deg, #f8b99400, #f8b994 17%, #ff97d5 75%, #ff97d500); width: 18.75em; height: 1px; margin-left: auto; margin-right: auto; position: absolute; inset: 0% 0% auto; display: block; line-height: 20px; - margin: 0; padding: 0; box-sizing: border-box; }The shorthand
margin: 0overrides the previously setmargin-left: autoandmargin-right: auto, which is likely not intended.🧰 Tools
🪛 Biome (1.9.4)
[error] 69-69: Unexpected shorthand property margin after margin-left
(lint/suspicious/noShorthandPropertyOverrides)
[error] 69-69: Unexpected shorthand property margin after margin-right
(lint/suspicious/noShorthandPropertyOverrides)
src/pages/index.vue (1)
84-84: Remove unused import pathThere appears to be an unused import path at the end of the file that should be removed.
-@/components/ad/adsrc/types/group.ts (1)
29-29: Consider stronger typing for messages arrayThe
messagesproperty inGroupProposalis typed asany[], which is too permissive and could lead to type safety issues.If possible, consider using a more specific type for the messages array to improve type safety:
- messages: any[], + messages: Array<{type_url: string, value: Uint8Array}>,src/layouts/components/DefaultLayout.vue (1)
10-10: Remove unused component importThe
Sponsorscomponent is imported but not used in the template. This appears to be leftover from the removal of advertisement elements.-import Sponsors from '@/layouts/components/Sponsors.vue';src/modules/[chain]/cosmwasm/[code_id]/transactions.vue (3)
58-65: Remove residual console debugging & guard against empty responsesA
console.login production can clutter the browser console and (when verbose output is enabled) expose internal data.
Additionally,selectQuery(res[0])is invoked without checking thatres[0]is defined, although you already safeguard forres && res.length > 0– but an empty-string element would still throw JSON-parse errors later.- wasmStore.wasmClient.getWasmContractQueries(contractAddress).then(res => { - console.log("queries: ", res) - queries.value = res - if (res && res.length > 0) { - selectQuery(res[0]) - } - }) + wasmStore.wasmClient + .getWasmContractQueries(contractAddress) + .then((res = []) => { + queries.value = res.filter(Boolean); // drop falsy entries + if (queries.value.length) { + selectQuery(queries.value[0]); + } + });
138-143: Dead code:selectedRadiois never changed by the UI
selectedRadiodefaults to'smart', yet no control lets the user toggle it.
The'raw'branch insidequeryContract()is therefore unreachable, increasing maintenance surface.Either:
- Remove
selectedRadioand the unreachable branch, or- Reintroduce a radio/segmented control so users can choose between smart and raw queries.
146-153: Duplicate markup between “Query” and “Execute” blocksBoth sections share nearly identical structure (suggested-message chips, textarea, action button). Duplicated templates are brittle and expensive to maintain; a change in one place is often forgotten in the other.
Extract a small presentational component, e.g.
<WasmMessagePanel :label="..." :action="..." @submit="..."/>, and reuse it for both tabs.Also applies to: 252-272, 276-296
src/libs/assets.ts (1)
24-41: Optional-chaining simplifies null checks & avoids false positivesThe static analyser flagged the explicit
assetDetail && assetDetail.denom_unitsguard. Optional chaining conveys intent succinctly and sidesteps accidental typos.- if (assetDetail && assetDetail.denom_units) { + if (assetDetail?.denom_units) {🧰 Tools
🪛 Biome (1.9.4)
[error] 29-29: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
src/modules/[chain]/account/[address].vue (2)
244-245: Comma removal only affects first occurrence
replace(',', '')removes a single comma. Use a global regex orreplaceAllto handle larger numbers:-{{ `${balanceItem.amount.toString().replace(',', '')} ${balanceItem.denom}` }} +{{ `${balanceItem.amount.toString().replaceAll(',', '')} ${balanceItem.denom}` }}
152-161:mapAmountunconditionally allocates on every callThe helper is executed for every rendered row; parsing and base64-decoding every time can be costly. Cache the result in
recentReceivedparsing step or use acomputed.README.md (1)
3-137: Excellent rebranding, but a few minor improvements needed.The README has been comprehensively rewritten to rebrand from "Ping Dashboard" to "MANTRA Explorer" with strong organization and clarity. There are a few minor items to address:
- The repository URL on line 51 should be updated to point to the actual MANTRA-Chain repository rather than "yourusername".
- Missing articles in some sentences (lines 31 and 79) - consider adding "the" before "MANTRA Chain".
- The code blocks should use markdown syntax (``` instead of
<code>tags) for better rendering.Change the repository URL:
-git clone https://github.com/yourusername/mantra-chain-explorer.git +git clone https://github.com/MANTRA-Chain/explorer.gitAnd use proper markdown code blocks:
-<code> -yarn install -</code> +``` +yarn install +```🧰 Tools
🪛 LanguageTool
[uncategorized] ~31-~31: You might be missing the article “the” here.
Context: ...ew detailed information about blocks on MANTRA Chain. - Transaction Explorer: Sear...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~79-~79: You might be missing the article “the” here.
Context: ...tp://localhost:5173` to start exploring MANTRA Chain. ## Building for Production To ...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[style] ~133-~133: Using many exclamation marks might seem excessive (in this case: 4 exclamation marks for a text that’s 2786 characters long)
Context: ... --- Happy exploring the MANTRA Chain! ## Contributors Developers: @liangpi...(EN_EXCESSIVE_EXCLAMATION)
src/libs/api/customization/atomone.ts (2)
1-1: Fix import spacing.There's a missing space after
typein the import statement.-import type{ RequestRegistry } from '@/libs/api/registry' +import type { RequestRegistry } from '@/libs/api/registry'
6-9: Clarify purpose of store and name constants.The comment "which registry is store" is ambiguous. Consider adding clearer documentation about what these constants represent and how they're used in the application.
-// which registry is store +// The registry location where this customization should be applied export const store = 'name' // name or version -// Blockchain Name +// The blockchain identifier for this customization export const name = 'atomone'src/stores/useDashboard.ts (1)
387-389: Consider adding error handling in the loadLocalConfig method.Similar to other areas, this method could benefit from try/catch blocks to handle potential errors when parsing JSON configurations.
- Object.values<LocalConfig>(source).forEach((x: LocalConfig) => { - config[x.chain_name] = fromLocal(x); - }); + try { + Object.values<LocalConfig>(source).forEach((x: LocalConfig) => { + config[x.chain_name] = fromLocal(x); + }); + } catch (error) { + console.error('Error loading local configurations:', error); + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (7)
public/favicon.icois excluded by!**/*.icopublic/logo.svgis excluded by!**/*.svgsrc/assets/images/networks/diamond-logo.pngis excluded by!**/*.pngsrc/assets/images/networks/diamond-logo.svgis excluded by!**/*.svgsrc/assets/images/networks/om.pngis excluded by!**/*.pngsrc/assets/logo.svgis excluded by!**/*.svgyarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (71)
.devcontainer/devcontainer.json(1 hunks).github/FUNDING.yml(0 hunks).github/workflows/config-check.yaml(0 hunks).github/workflows/docker.yaml(0 hunks).github/workflows/mainnet-deploy.yaml.disabled(0 hunks).github/workflows/testnet-deploy.yaml(0 hunks).gitignore(1 hunks)README.md(1 hunks)chains/mainnet/0_mantra.json(1 hunks)chains/mainnet/1_mantra-dukong.json(1 hunks)chains/mainnet/2_mantra-omstead.json(1 hunks)chains/mainnet/axelar.json(0 hunks)chains/mainnet/cosmos.json(0 hunks)chains/mainnet/neutron.json(0 hunks)chains/mainnet/nolus.json(0 hunks)chains/mainnet/osmosis.json(0 hunks)chains/testnet/3_mantra-canary-net.json(1 hunks)chains/testnet/4_mantra-canary-net-evm.json(1 hunks)chains/testnet/crossfi.json(0 hunks)index.html(2 hunks)package.json(4 hunks)src/App.vue(1 hunks)src/components/charts/DonutChart.vue(0 hunks)src/components/charts/PriceMarketChart.vue(1 hunks)src/components/dynamic/TxsElement.vue(2 hunks)src/layouts/components/DefaultLayout.vue(12 hunks)src/layouts/components/NavFooter.vue(2 hunks)src/layouts/components/NavbarThemeSwitcher.vue(1 hunks)src/libs/api/customization/atomone.ts(1 hunks)src/libs/api/index.ts(1 hunks)src/libs/api/registry.ts(2 hunks)src/libs/assets.ts(1 hunks)src/libs/client.ts(2 hunks)src/libs/http.ts(2 hunks)src/libs/index.ts(1 hunks)src/main.ts(1 hunks)src/modules/[chain]/account/[address].vue(12 hunks)src/modules/[chain]/block/[height].vue(1 hunks)src/modules/[chain]/block/block.ts(2 hunks)src/modules/[chain]/cosmwasm/WasmClient.ts(2 hunks)src/modules/[chain]/cosmwasm/[code_id]/transactions.vue(7 hunks)src/modules/[chain]/cosmwasm/index.vue(4 hunks)src/modules/[chain]/faucet/index.vue(5 hunks)src/modules/[chain]/gov/[proposal_id].vue(2 hunks)src/modules/[chain]/group/index.vue(1 hunks)src/modules/[chain]/ibc/connection/[connection_id].vue(1 hunks)src/modules/[chain]/index.vue(8 hunks)src/modules/[chain]/staking/[validator].vue(1 hunks)src/modules/[chain]/staking/index.vue(3 hunks)src/modules/[chain]/supply/index.vue(3 hunks)src/modules/[chain]/tx/[hash].vue(4 hunks)src/modules/[chain]/widget/index.vue(2 hunks)src/modules/wallet/accounts.vue(7 hunks)src/modules/wallet/keplr.vue(2 hunks)src/modules/wallet/portfolio.vue(3 hunks)src/modules/wallet/suggest.vue(5 hunks)src/modules/wallet/unisat.vue(2 hunks)src/pages/[...all].vue(1 hunks)src/pages/index.vue(3 hunks)src/plugins/i18n/locales/en.json(2 hunks)src/plugins/i18n/locales/id.json(1 hunks)src/plugins/i18n/locales/zh.json(1 hunks)src/stores/useBlockchain.ts(7 hunks)src/stores/useDashboard.ts(14 hunks)src/stores/useFormatter.ts(1 hunks)src/stores/useGroupStore.ts(1 hunks)src/stores/useStakingStore.ts(1 hunks)src/style.css(2 hunks)src/types/group.ts(1 hunks)src/types/index.ts(1 hunks)tailwind.config.js(2 hunks)
💤 Files with no reviewable changes (12)
- .github/FUNDING.yml
- chains/mainnet/axelar.json
- chains/mainnet/osmosis.json
- chains/mainnet/nolus.json
- .github/workflows/mainnet-deploy.yaml.disabled
- src/components/charts/DonutChart.vue
- chains/testnet/crossfi.json
- chains/mainnet/cosmos.json
- .github/workflows/testnet-deploy.yaml
- chains/mainnet/neutron.json
- .github/workflows/docker.yaml
- .github/workflows/config-check.yaml
🧰 Additional context used
🧬 Code Graph Analysis (6)
src/libs/client.ts (2)
src/libs/api/registry.ts (1)
Request(51-54)src/libs/http.ts (1)
get(43-45)
src/libs/api/registry.ts (1)
src/types/group.ts (4)
PaginatedGroups(47-49)GroupProposal(22-37)GroupTallyResult(15-20)PaginatedGroupProposals(51-53)
src/stores/useBlockchain.ts (1)
src/stores/useDashboard.ts (1)
Endpoint(13-17)
src/libs/api/customization/atomone.ts (3)
src/types/gov.ts (2)
GovProposal(23-55)PaginatedProposals(75-77)src/libs/api/registry.ts (1)
RequestRegistry(61-169)src/modules/[chain]/indexStore.ts (1)
proposals(139-142)
src/types/group.ts (1)
src/types/common.ts (1)
PaginatedResponse(45-47)
src/stores/useDashboard.ts (2)
src/libs/http.ts (1)
get(43-45)src/stores/useBlockchain.ts (1)
useBlockchain(29-210)
🪛 Biome (1.9.4)
src/stores/useFormatter.ts
[error] 264-264: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
src/style.css
[error] 69-69: Unexpected shorthand property margin after margin-left
(lint/suspicious/noShorthandPropertyOverrides)
[error] 69-69: Unexpected shorthand property margin after margin-right
(lint/suspicious/noShorthandPropertyOverrides)
src/types/group.ts
[error] 12-13: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
src/libs/assets.ts
[error] 29-29: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
src/stores/useDashboard.ts
[error] 191-191: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
🪛 LanguageTool
README.md
[uncategorized] ~31-~31: You might be missing the article “the” here.
Context: ...ew detailed information about blocks on MANTRA Chain. - Transaction Explorer: Sear...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~79-~79: You might be missing the article “the” here.
Context: ...tp://localhost:5173` to start exploring MANTRA Chain. ## Building for Production To ...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[style] ~133-~133: Using many exclamation marks might seem excessive (in this case: 4 exclamation marks for a text that’s 2786 characters long)
Context: ... --- Happy exploring the MANTRA Chain! ## Contributors Developers: @liangpi...
(EN_EXCESSIVE_EXCLAMATION)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Cloudflare Pages
- GitHub Check: Cloudflare Pages
🔇 Additional comments (116)
src/pages/[...all].vue (1)
6-24: Clean formatting improvements!The code formatting changes improve readability and consistency in the template structure without affecting functionality.
src/components/charts/PriceMarketChart.vue (1)
19-19: Great UX improvement for chart labels!Dynamically changing the chart series name between 'Price' and 'Volume' based on the selected data type provides clearer context to users.
src/modules/[chain]/faucet/index.vue (5)
19-19: Improved type safety with explicit typingAdding the explicit
FaucetResponsetype annotation toret.valueimproves code maintainability and type safety.
24-24: Enhanced type safety for callback functionAdding the type annotation to the callback parameter in the
findIndexmethod improves code clarity and type checking.
55-55: Fixed spacing in conditional checkRemoving the extra space in the early return condition improves code consistency.
153-156: Improved template readabilityBreaking the RouterLink element into multiple lines enhances code readability and maintainability.
158-160: Enhanced loading state markup structureImproving the formatting of the loading state element makes the template structure more consistent and easier to read.
chains/mainnet/0_mantra.json (3)
1-33: Well-structured MANTRA chain configurationThe configuration provides all necessary parameters for integrating the MANTRA-1 mainnet:
- Proper API and RPC endpoints
- Correct SDK version and address prefix
- Complete asset definition with proper denomination and exponent
- Coingecko IDs for price tracking
This aligns with the PR objective of configuring MANTRA Explorer.
20-20:Details
✅ Verification successful
Verify minimum transaction fee
The minimum transaction fee is set to "100000". Ensure this value is correct for the MANTRA chain to avoid transaction failures.
🏁 Script executed:
#!/bin/bash # Check if there are other MANTRA chain configuration files with different min_tx_fee values fd -t f -e json -p 'chains/.*mantra.*\.json' --exec grep -l "min_tx_fee" {} \; | xargs grep -A 1 -B 1 "min_tx_fee"Length of output: 1119
Minimum transaction fee confirmed as consistent
The
min_tx_feevalue is set to"100000"in all Mantra chain configuration files, ensuring uniformity and preventing transaction failures.Checked files:
- chains/mainnet/0_mantra.json
- chains/mainnet/1_mantra-dukong.json
- chains/mainnet/2_mantra-omstead.json
- chains/testnet/3_mantra-canary-net.json
- chains/testnet/4_mantra-canary-net-evm.json
No changes required.
29-30:Details
❓ Verification inconclusive
Validate CoinGecko ID and logo path
Ensure the CoinGecko ID "mantra-dao" is current and that the relative logo path "../assets/images/coins/om.jpg" resolves correctly in the application.
🌐 Web query:
Is "mantra-dao" the correct CoinGecko ID for MANTRA's OM token?💡 Result:
Yes, "mantra-dao" is the correct CoinGecko ID for MANTRA's OM token. You can find detailed information about the OM token on its CoinGecko page: (coingecko.com).
Citations:
🏁 Script executed:
#!/bin/bash # Locate any files named om.jpg in the repo (case-insensitive) find . -type f -iname "om.jpg"Length of output: 30
🏁 Script executed:
#!/bin/bash # Find any directories with "coins" in the path and list their contents to verify available logo files find . -type d | grep -i coins | while read dir; do echo "Directory: $dir" ls -1 "$dir" 2>/dev/null || echo " (no files)" doneLength of output: 43
Verify logo path for OM token
I’ve confirmed that the CoinGecko ID
"mantra-dao"is correct. However, I couldn’t locate a file at../assets/images/coins/om.jpgin the repository. Please ensure the logo exists at that path or update it accordingly.• File: chains/mainnet/0_mantra.json (lines 29–30) – verify
"logo": "../assets/images/coins/om.jpg"chains/testnet/3_mantra-canary-net.json (2)
1-33: JSON configuration for MANTRA-Canary-Net looks good!The configuration looks well-structured with all required fields for a testnet chain. It properly defines the API and RPC endpoints, SDK version, address prefix, and asset details.
22-22: Verify logo URL for Canary-NetThe logo URL references "dukong.svg" although this is for the Canary-Net configuration. Please verify if this is the correct logo asset for this chain.
chains/mainnet/1_mantra-dukong.json (1)
1-33: Overall configuration structure looks goodApart from the type inconsistency, the configuration contains all necessary information for the MANTRA-Dukong chain including properly formatted API/RPC endpoints and asset details.
src/layouts/components/NavbarThemeSwitcher.vue (1)
41-41: Formatting improvement looks goodThe consolidation of the multiline button tag into a single line improves code readability without changing functionality.
.gitignore (1)
5-8: LGTM! Good addition of common ignore patterns.Adding
.idea,.env, and.DS_STOREto the gitignore file is an appropriate practice to prevent IDE settings, environment variables, and macOS system files from being committed to the repository.src/modules/[chain]/block/block.ts (1)
33-33: LGTM! Minor formatting improvement.Adding a space in the empty catch block improves code formatting consistency.
src/types/index.ts (1)
11-12:Details
✅ Verification successful
LGTM! Proper exposure of new type modules.
Adding exports for slashing and group modules makes these types available throughout the application, supporting the new group management functionality described in the PR.
🏁 Script executed:
#!/bin/bash # Verify that the referenced type modules exist echo "Checking for slashing and group type modules:" if [ -f "src/types/slashing.ts" ]; then echo "✓ src/types/slashing.ts exists" else echo "✗ src/types/slashing.ts does not exist" fi if [ -f "src/types/group.ts" ]; then echo "✓ src/types/group.ts exists" else echo "✗ src/types/group.ts does not exist" fi # Check the content of the group.ts file to verify it has the expected types if [ -f "src/types/group.ts" ]; then echo -e "\nGroup type definitions:" grep -E "interface Group|interface GroupPolicy|interface GroupProposal" src/types/group.ts fiLength of output: 645
Exports Verified: slashing and group type modules are correctly exposed
Both
src/types/slashing.tsandsrc/types/group.tsexist and contain the expected interfaces:
src/types/slashing.tsis presentsrc/types/group.tsdeclaresGroup,GroupPolicy,GroupTallyResult,GroupProposal, andGroupVoteThese exports properly make the new types available application-wide. Great work!
src/libs/index.ts (1)
5-5: Properly exports new assets module.The addition of this export statement makes the new assets module's functionality available to the rest of the application, which aligns with the PR's focus on enhancing asset and IBC token handling capabilities.
src/main.ts (1)
31-31:Details
✅ Verification successful
Block fetch interval reduced from 6s to 3s.
The block fetch interval has been reduced from 6 seconds to 3 seconds, which will make the application more responsive by providing more frequent updates. The request counter logic still properly limits concurrent requests to prevent overwhelming the backend.
Consider monitoring API usage after this change to ensure the increased request frequency doesn't approach rate limits on the backend.
🏁 Script executed:
#!/bin/bash # Description: Check if there are any rate limits in the code or configuration that might be affected by the increased request frequency # Look for rate limit configurations in the project echo "Searching for rate limit configurations..." rg -i "rate.?limit|throttle" --type ts --type js --type jsonLength of output: 1529
No client-side rate limits detected after interval reduction
The block fetch interval reduction from 6 s to 3 s is safe—our search found no explicit rate-limit or throttle configurations in the codebase (aside from auto-imports of VueUse utilities). The existing request-counter logic still prevents concurrent overloads. Continue monitoring API usage on the backend to ensure the higher request frequency doesn’t approach any server-side rate limits.src/modules/wallet/portfolio.vue (3)
124-124: Code formatting improvementA space was added after the ternary operator for better readability, which follows common JavaScript formatting conventions.
203-204: Code formatting improvementA space was added after the
switchkeyword for better readability, following standard formatting practices.
261-261: Removed unused AdBanner componentThe AdBanner component was removed from the UI, which simplifies the template structure while maintaining the same functionality.
src/modules/wallet/unisat.vue (4)
19-19: Code formatting improvementA space was added after the
ifkeyword for better readability, following standard formatting conventions.
21-21: Removed trailing whitespaceTrailing whitespace was removed after the async call, improving code cleanliness.
88-88: Removed unused AdBanner componentThe AdBanner component was removed from the UI, which simplifies the template structure while maintaining the same functionality.
95-96: Formatted button text for better readabilityThe button text was split into two lines for improved code readability, which doesn't affect the rendered output.
src/stores/useFormatter.ts (1)
264-266: Support added for factory token denomsThis addition properly handles factory-created token denominations by extracting the third segment of the denom string when it starts with "factory/". This enhancement will improve support for tokens created via factory contracts, which is common in CosmWasm-enabled chains.
The implementation correctly checks if
denomexists before attempting to use string methods on it, ensuring null safety.🧰 Tools
🪛 Biome (1.9.4)
[error] 264-264: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
src/modules/wallet/keplr.vue (4)
16-16: Removed unnecessary whitespaceRemoved extra whitespace/line between the chain assignment and function call, improving code cleanliness.
21-21: Code formatting improvementA space was added after the
ifkeyword for better readability, following standard formatting conventions.
23-23: Removed trailing whitespaceTrailing whitespace was removed after the async call, improving code cleanliness.
96-97: Formatted button text for better readabilityThe button text was split into two lines for improved code readability, which doesn't affect the rendered output.
src/modules/[chain]/widget/index.vue (2)
16-16: Improved code formatting.The hdPath computation is now more cleanly formatted without unnecessary spaces inside the template literal.
25-31: LGTM!The formatting improvements for the select element and its options enhance readability.
src/plugins/i18n/locales/zh.json (1)
25-27: Updated Chinese localization to reflect MANTRA rebranding.The localization strings have been correctly updated to reference MANTRA Dashboard instead of the previous branding.
src/layouts/components/NavFooter.vue (3)
4-4: LGTM!Changed background color from dark blue (#171d30) to black (#000000) to better align with MANTRA branding.
18-24: Added attribution for MANTRA customization.The footer now properly credits MANTRA for the customization work while maintaining attribution to the original Ping.pub project.
31-32: Updated GitHub repository links to MANTRA-Chain.Repository links have been properly updated to point to the MANTRA-Chain organization instead of ping-pub.
Also applies to: 37-38
src/modules/[chain]/block/[height].vue (1)
41-42: Simplified block time estimation calculation.The calculation for estimating block time has been simplified to directly multiply remaining blocks by the blocktime, making the code more readable while maintaining functionality.
src/libs/client.ts (1)
1-1: Added import for thegetfunction.The import statement has been updated to include the
getfunction, which is consistent with the new method being added to theBaseRestClientclass.src/plugins/i18n/locales/id.json (1)
24-24: Updated branding from Ping Dashboard to MANTRA Dashboard.The Indonesian localization has been updated to reflect the rebranding from "Ping Dashboard" to "MANTRA Dashboard" with MANTRA-specific slogan and description. This change is aligned with the project's rebranding objectives.
Also applies to: 28-29
src/modules/[chain]/supply/index.vue (1)
2-6: Refactored imports and added formatIbcToken utility.The imports have been reorganized and the
formatIbcTokenutility has been added to improve IBC token handling. This is consistent with the PR objective of enhancing asset formatting.src/modules/wallet/accounts.vue (5)
131-131: Code formatting improvement.The formatting change adds proper spacing in the array argument to make the code more readable.
183-183: Removed unnecessary empty line.Removing this empty line improves code readability by reducing unnecessary whitespace.
229-231: SVG attribute formatting improvement.The SVG tag attributes are now better formatted with proper line breaks, making the complex SVG element more readable.
252-254: Improved HTML element formatting.The div structure is now better formatted with proper indentation, enhancing readability of the nested structure.
260-265: Improved template formatting for better clarity.The nested elements in the account display section are now better formatted with consistent indentation, making the hierarchy clearer.
src/modules/[chain]/tx/[hash].vue (3)
26-32: Improved formatting in computed property.The formatting changes in the
messagescomputed property improve readability by adding proper spacing around arrow function parameters and conditionals.
57-59: Better RouterLink formatting for readability.The RouterLink element is now better formatted across multiple lines, making its structure and attributes clearer.
125-126: Improved JsonViewer component formatting.The JsonViewer component is now properly formatted across multiple lines, making its numerous props easier to read and maintain.
src/libs/http.ts (3)
21-21: Enhanced error messaging for failed requests.The improved error message now includes HTTP status code and status text, which will make debugging failed API requests much easier.
44-44: Code formatting improvements in get and getB functions.The formatting changes in these functions improve readability and consistency.
Also applies to: 48-48
7-17:Details
❓ Verification inconclusive
Added Cloudflare Access authentication for MANTRA Chain endpoints.
The implementation correctly adds Cloudflare Access authentication headers when fetching from MANTRA Chain-specific endpoints. This is essential for secure access to protected API resources.
Verify that environment variables are properly set in the deployment environment:
🏁 Script executed:
#!/bin/bash # Check if the required Cloudflare Access environment variables are defined # in the project configuration # Look for environment variable definitions in common config files echo "Checking for Cloudflare Access environment variables..." grep -r "VITE_CF_ACCESS_CLIENT" --include="*.env*" --include="*.yaml" --include="*.yml" . # Note: This will only show if the variables are defined, not their values # The actual values should be kept secure and not exposed in logsLength of output: 210
Manually verify Cloudflare Access environment variable definitions
I didn’t find
VITE_CF_ACCESS_CLIENT_IDorVITE_CF_ACCESS_CLIENT_SECRETdefined anywhere in the repo. Please ensure these variables are configured before deployment to avoid runtime failures when calling Mantra Chain endpoints.• Check your local
.envfiles (e.g..env,.env.example) and add:VITE_CF_ACCESS_CLIENT_ID=your_cf_access_client_id VITE_CF_ACCESS_CLIENT_SECRET=your_cf_access_client_secret• Verify your CI/CD or hosting environment (GitHub Actions secrets, Vercel/Netlify env settings, etc.) includes these two variables.
src/modules/[chain]/gov/[proposal_id].vue (2)
200-209: Added error handling to prevent failures when processing addresses.Great improvement by adding a try-catch block around the Bech32 address decoding and hex conversion. This prevents errors when dealing with invalid addresses, ensuring the UI continues to function even with malformed data.
403-403: Improved vote option display condition.The enhanced condition now properly excludes the 'VOTE_OPTION_UNSPECIFIED' string from rendering, resulting in a cleaner UI by avoiding the display of unhelpful vote option values.
src/plugins/i18n/locales/en.json (2)
26-26: LGTM! Branding updates applied correctly.The branding changes from "Ping Dashboard" to "MANTRA Dashboard" have been properly implemented, with appropriate updates to the slogan and description as part of the MANTRA Chain rebranding.
Also applies to: 30-31
133-134: LGTM! New localization keys added for CosmWasm features.These new keys for "suggested_messages" and "result" support the UI elements in the refactored CosmWasm contract transactions and queries components, aligning with the functionality enhancements in this PR.
src/modules/[chain]/cosmwasm/index.vue (5)
35-38: LGTM! Improved code formatting.The conditional statements have been properly reformatted for better readability, with each condition on its own line.
50-57: LGTM! Enhanced template readability.The select element and its options have been nicely reformatted with each element on its own line, improving code maintainability.
62-63: LGTM! Consistent formatting applied.The option element formatting follows the same pattern as other template elements, maintaining consistency.
83-83: LGTM! Updated CSS class for MANTRA styling.The RouterLink class has been updated to use the MANTRA-specific styling.
98-99: LGTM! Improved template formatting.The label element has been reformatted to span multiple lines for better readability, consistent with other template changes.
index.html (4)
4-10: LGTM! Google Tag Manager integration added.Google Tag Manager script has been properly implemented in the head section for analytics tracking.
12-12: LGTM! Updated favicon format.The favicon has been changed from ICO to WEBP format, which generally provides better compression and quality.
14-15: LGTM! Updated title and meta description.The page title and meta description now correctly reflect MANTRA Chain branding, which is appropriate for this rebranding effort.
19-22: LGTM! Added noscript GTM tracking.The Google Tag Manager noscript iframe has been properly implemented for tracking when JavaScript is disabled.
src/components/dynamic/TxsElement.vue (5)
12-26: LGTM! Improved error handling for transaction decoding.The addition of try-catch logic for transaction decoding is a great improvement that prevents the application from crashing when encountering malformed transactions. The new
injectedflag appropriately tracks decoding failures.
37-37: LGTM! Added column for injected transactions.The new "Injected" column properly indicates to users which transactions failed to decode.
45-50: LGTM! Conditional rendering based on transaction status.The conditional rendering logic appropriately displays the transaction hash as either plain text (for injected transactions) or as a clickable link (for successfully decoded transactions).
53-60: LGTM! Prevented rendering errors for failed transactions.Wrapping the message display in a conditional prevents rendering errors when transaction decoding fails.
61-61: LGTM! Conditional memo display added.Similar to the message display, conditionally rendering the memo field prevents errors for malformed transactions.
src/modules/[chain]/cosmwasm/WasmClient.ts (1)
107-111: Good refactor to use the new get methodThe switch from
this.requesttothis.getaligns with the rest of the codebase's HTTP handling patterns. This change improves consistency.tailwind.config.js (2)
14-24: Comprehensive color palette update for MANTRA brandingThe new color palette introduces a consistent set of branded colors that will provide a unified look across the application. The primary pink color (#FF97D6) aligns with MANTRA branding seen in other files.
34-56: Consistent theme implementation across light and dark modesGood implementation of the same color palette across both light and dark themes, maintaining brand consistency while still providing appropriate contrast for each mode. I notice there's a commented-out alternative for the dark theme's base-100 color (#000000) that wasn't chosen.
chains/mainnet/2_mantra-omstead.json (3)
33-38: Keplr features include EVM compatibilityThe inclusion of EVM-specific Keplr features confirms this chain's EVM compatibility. This is consistent with the chain name "MANTRA-OMStead-EVM" and the coin type "60" (which is Ethereum's coin type).
1-39:Details
✅ Verification successful
Comprehensive MANTRA-OMStead-EVM testnet configuration
The configuration includes all necessary fields for the chain including endpoints, token information, and wallet features. The inclusion of EVM-specific Keplr features (
eth-address-gen,eth-key-sign,eth-secp256k1-cosmos) indicates this is an EVM-compatible chain.
🏁 Script executed:
#!/bin/bash # Verify that the endpoints are formatted correctly and follow the pattern of other chain configs # Check for other chain configs for comparison echo "Examining other chain configs:" fd -e json -p 'chains/' --exec head -n 20 {} \; # Check if any other chain configs have the same endpoints (potential duplication) echo "Checking for duplicate endpoints:" rg -F "https://api.omstead.io" --type json rg -F "https://rpc.omstead.io" --type jsonLength of output: 2732
All endpoints and configuration are correct
The
MANTRA-OMStead-EVMtestnet configuration matches the formatting and structure of other chains. No duplicate or misformatted endpoints were found.
22-23:Details
✅ Verification successful
Verify logo URL and theme color consistency
The logo URL points to an external resource at MANTRA's domain, and the theme color matches the primary color defined in the Tailwind config (#FF97D6).
🌐 Web query:
Is https://assets.mantra.finance/images/networks/dukong.svg a valid and accessible URL?💡 Result:
The URL
https://assets.mantra.finance/images/networks/dukong.svgappears to be a valid and accessible link. It points to an SVG image associated with the Dukong network, which is part of the MANTRA Chain ecosystem. The Dukong network is a testnet for MANTRA Chain, designed for developers to build and test decentralized applications (dApps) in a secure and compliant environment. (mantrachain.io)The image at the provided URL likely represents the Dukong network's logo or icon, serving as a visual identifier for the network.
Citations:
Logo URL and theme color verified
The logo URL (
https://assets.mantra.finance/images/networks/dukong.svg) is valid and accessible, and the theme color (#FF97D6) matches the primary color defined in our Tailwind config. No further changes are required.• File:
chains/mainnet/2_mantra-omstead.jsonlines 22–23"logo": "https://assets.mantra.finance/images/networks/dukong.svg", "theme_color": "#FF97D6",chains/testnet/4_mantra-canary-net-evm.json (3)
1-50: MANTRA-Canary-EVM Testnet configuration looks well-structured.The configuration is comprehensive, containing all the necessary elements for a testnet chain: endpoints, SDK version, coin type, address prefix, asset details, and supported features.
33-49: Comprehensive feature set is appropriate.The inclusion of both standard Cosmos features (governance, staking, transactions) and Ethereum-specific features (eth-address-gen, eth-key-sign) is appropriate for an EVM-compatible chain.
22-22:Details
✅ Verification successful
Potential logo discrepancy.
The logo URL points to "dukong.svg" while this is a Canary-EVM chain configuration. Verify if this is the correct logo for this specific chain or if it should be a Canary-specific image.
🏁 Script executed:
#!/bin/bash # Check for other MANTRA chain configurations to compare logo URLs grep -r "logo.*mantra" --include="*.json" chains/Length of output: 597
No logo discrepancy – consistent usage of dukong.svg across Mantra networks
All Mantra chain configurations (mainnet and testnet) reference the same
dukong.svglogo, including:
- chains/mainnet/0_mantra.json
- chains/mainnet/1_mantra-dukong.json
- chains/mainnet/2_mantra-omstead.json
- chains/testnet/3_mantra-canary-net.json
- chains/testnet/4_mantra-canary-net-evm.json
No change required.
.devcontainer/devcontainer.json (1)
1-28: Development container setup helps ensure consistent development environments.The VS Code development container configuration is properly structured with:
- Base TypeScript-Node image on Debian Bullseye
- Essential extensions for Vue.js development (Prettier, ESLint, Volar)
- Commented placeholders for future customization options
This setup will ensure consistent development environments for all contributors working on the MANTRA Explorer project.
src/modules/[chain]/index.vue (5)
207-223: Expanded SVG icon markup improves code clarity.The expanded SVG markup is more readable and follows best practices for maintaining SVG code. This allows for easier future modifications if needed.
236-238: Improved input element formatting enhances readability.The reformatted input element attributes are now more consistently structured and easier to read.
Also applies to: 246-248
254-256: Multi-line class binding enhances maintainability.The restructured class bindings into multi-line objects improve code readability and make future style modifications easier.
357-364: Improved RouterLink formatting enhances code organization.The reformatted RouterLink component with proper line breaks and indentation improves code organization and readability.
395-402: UI element updates align with project rebranding.The commented out swap button and hidden receive button reflect the UI refinements related to the MANTRA rebranding effort.
src/libs/api/registry.ts (2)
8-10: Appropriate type imports for group governance features.The addition of group-related type imports (Group, GroupProposal, GroupTallyResult, PaginatedGroupProposals, PaginatedGroups) correctly supports the new group governance functionality.
Also applies to: 13-14
134-139: Well-structured group API endpoints extend governance capabilities.The addition of six group-related API endpoints to the RequestRegistry interface provides comprehensive support for group governance features:
- Querying paginated groups
- Filtering groups by admin or member
- Accessing individual group proposals and tally results
- Filtering proposals by group policy
These additions properly align with the group-related types defined in
src/types/group.ts.src/stores/useBlockchain.ts (4)
45-48: Code formatting improvements enhance readability.Minor code formatting improvements, including consistent spacing and semicolon usage, enhance readability and maintain code quality.
Also applies to: 75-75
122-139: Ecosystem menu section commented out for focused branding.The Ecosystem navigation menu section, including "Favorite" and "All Blockchains" items, has been temporarily disabled. This change supports the focused branding on MANTRA chains while preserving the code for potential future reactivation.
161-171: Consistent formatting in endpoint selection methods.The formatting improvements in the endpoint selection methods maintain code consistency without changing the core logic of endpoint selection.
Also applies to: 175-178
196-199: Case-sensitive name lookup is properly formatted.The improved formatting of the case-sensitive chain name lookup code enhances readability while maintaining the original functionality.
src/modules/[chain]/staking/index.vue (4)
135-137: Good code formatting improvements for better readabilityThe function signature and conditional check are now properly formatted with consistent spacing, improving code readability.
156-177: Well-structured function with improved documentationThe
fetchAvatarfunction has been refactored with better spacing, indentation, and comment documentation, making it easier to understand and maintain.
186-202: Improved function structure and documentationThe
loadAvatarsfunction has been reformatted with better spacing, indentation, and comment documentation. The conditional logic is now more readable with clearer Promise handling.
227-428: Excellent template restructuringThe template has been significantly improved with better organization, consistent indentation, and clear component structure. This enhances readability and maintainability without changing functionality.
src/modules/wallet/suggest.vue (5)
12-12: Default wallet changed to "leap"The default wallet selection has been changed from "keplr" to "leap", which aligns with the MANTRA branding and configuration changes.
34-34: Conditional logic updated for wallet initializationThe condition has been reversed to call
initSnap()only when Metamask is selected, otherwise defaulting toinitParamsForKeplr(), which now handles both Keplr and Leap wallets.
131-139: Added support for Leap walletNew code block adds proper support for the Leap wallet by checking for its availability in the window object and calling its experimental suggest chain method.
165-177: User interface updated to include Leap wallet optionThe radio button options have been reorganized to include Leap as the first wallet option, followed by Keplr and Metamask. This matches the default wallet selection in the script.
187-189: Fixed typo in wallet support messageCorrected "offically" to "officially" in the help text, improving the text quality.
src/style.css (3)
27-27: Added base background variable for themingNew CSS variable
--bg-basewith black color (#000000) enhances the theming capabilities and aligns with the MANTRA branding.
33-36: Updated dark theme colors for MANTRA brandingThe
--text-secondarycolor has been changed to a bright pink (#FF97D6) to match MANTRA branding, along with other dark theme adjustments.
74-79: Added gradient text effect for brandingNew CSS class for gradient text effects enhances the visual styling consistent with MANTRA branding colors.
package.json (4)
2-2: Rebranding project name 👍The name change from "ping.pub" to "mantra-explorer" aligns with the rebranding effort mentioned in the PR title.
10-11: Adding distinct build script variantsAdding separate build scripts for public and internal deployments is a good practice. The
build:publicscript removes testnet chain configurations before building, which is appropriate for public-facing deployments.
82-82: Added package manager specificationAdding the packageManager field ensures consistent builds across different environments, which is good practice.
35-35:Details
✅ Verification successful
Dependency updates and additions
The dependency updates (axios, postcss, vue-i18n) and addition of chain-registry support the enhanced chain configuration management mentioned in the PR description.
Also applies to: 38-38, 48-48, 54-54
🏁 Script executed:
#!/bin/bash # Check if axios 1.8.2 has any known security issues npm audit --package=axios@1.8.2 --json | jq '.vulnerabilities'Length of output: 416
🏁 Script executed:
#!/bin/bash # Fetch known security advisories for axios from the npm registry curl -s "https://registry.npmjs.org/-/npm/v1/security/advisories?module=axios" | jq '.objects[] | {id, title, vulnerable_versions}'Length of output: 191
🏁 Script executed:
#!/bin/bash # Initialize a minimal npm project and install axios lockfile for auditing npm init -y >/dev/null 2>&1 npm install axios@1.8.2 --package-lock-only >/dev/null 2>&1 npm audit --json | jq '.advisories'Length of output: 100
Approve dependency updates
- Updated dependencies (
axios@^1.8.2,postcss,vue-i18n) and addedchain-registrysupport as described.- Verified via
npm auditin a minimal project that axios 1.8.2 has no known security advisories.- No further action required.
Applies to
package.jsonlines 35, 38, 48, and 54.src/pages/index.vue (2)
30-34: Focused featured chains listReducing the featured chains list to only MANTRA-specific chains aligns with the rebranding effort and provides a clearer focus for users.
44-47: Updated branding elementsReplacing the SVG logo with an empty div and wrapping the title in the new
grad-spanclass modernizes the UI while aligning with the MANTRA branding.src/layouts/components/DefaultLayout.vue (3)
83-83: Dark theme color updateChanging the dark background from dark blue (#171d30) to pure black (#000000) creates a more modern aesthetic aligned with the MANTRA branding.
90-92: Simplified header with centered logoThe sidebar header has been simplified by centering the logo and removing the "Ping.pub" text, which aligns with the rebranding effort.
276-276: Updated external links to MANTRA resourcesExternal links have been appropriately updated to point to MANTRA-specific resources:
- Twitter handle changed to "MANTRA_Chain"
- Discord invite URL updated
- Documentation link updated
This ensures users are directed to the correct community resources.
Also applies to: 288-288, 300-300, 308-308
src/modules/[chain]/cosmwasm/[code_id]/transactions.vue (1)
275-306:executetab is unreachable from navigationA full template is rendered for
tab === 'execute', but no tab button or route setstabto'execute'. Users cannot reach this UI, implying dead code or a missing navigation control.Confirm intention and either expose the tab or remove the block to prevent confusion.
src/modules/[chain]/account/[address].vue (1)
256-257:format.tokenValue()expects rawCoin, not pre-formatted strings
balanceItemhere is already prettified (amountmay contain thousand separators or be a Decimal string). Passing it intotokenValue()(which internally atomics-parses the amount) risks NaN/incorrect USD calculations.Either:
- Keep a reference to the original
Coinwhen callingtokenValue, or- Extend
tokenValueto robustly accept formatted amounts.src/stores/useDashboard.ts (2)
349-358: LGTM! Conditional loading of testnet configurations.The approach of conditionally loading testnet configurations based on hostname patterns is a good way to manage different environments.
359-362: LGTM! Merging mainnet and testnet configurations.Merging the mainnet and testnet configurations ensures a consistent approach to handling chain definitions across environments.
| { | ||
| "chain_name": "MANTRA-Dukong", | ||
| "coingecko": "om", | ||
| "type": "testnet", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chain type inconsistency
This file is located in the chains/mainnet/ directory but has "type": "testnet". This inconsistency could lead to confusion. Please update either the file location or the type value to ensure they match.
- "type": "testnet",
+ "type": "mainnet",📝 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.
| "type": "testnet", | |
| "type": "mainnet", |
| // Clear Local Storage temporarily until dukong is ready | ||
| localStorage.clear(); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Reconsider clearing all localStorage data
Clearing all localStorage data could have unintended consequences:
- It will remove all user preferences and cached data
- It may create a jarring experience for returning users
- The temporary nature suggests this code will need to be removed later
Consider a more targeted approach by clearing only specific keys needed for the transition to "dukong".
- // Clear Local Storage temporarily until dukong is ready
- localStorage.clear();
+ // Clear only specific keys temporarily until dukong is ready
+ // Remove keys related to previous chain configurations
+ const keysToRemove = ['selectedChain', 'recentChains', 'cachedChainData'];
+ keysToRemove.forEach(key => localStorage.removeItem(key));📝 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.
| // Clear Local Storage temporarily until dukong is ready | |
| localStorage.clear(); | |
| // Clear only specific keys temporarily until dukong is ready | |
| // Remove keys related to previous chain configurations | |
| const keysToRemove = ['selectedChain', 'recentChains', 'cachedChainData']; | |
| keysToRemove.forEach(key => localStorage.removeItem(key)); |
| export const useStoreName = defineStore('group', { | ||
| state: () => { | ||
| return {}; | ||
| }, | ||
| getters: {}, | ||
| actions: {}, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Implement actual functionality in this store.
This appears to be a placeholder store with empty state, getters, and actions. Based on the AI summary, this is meant to support group module functionality, but lacks any implementation.
Consider implementing the necessary state properties, getters, and actions to support group functionality as indicated in the broader changes to the codebase. This could include:
state: () => {
return {
groups: [] as Group[],
groupPolicies: [] as GroupPolicy[],
proposals: [] as GroupProposal[],
// other relevant state properties
};
},
getters: {
// implement getters for accessing and filtering groups and proposals
},
actions: {
// implement actions for fetching groups, proposals, and handling votes
async fetchGroups() {
// Implementation to fetch groups using the API
},
// other actions
}🛠️ Refactor suggestion
Rename function to match store purpose.
The store is correctly defined with the identifier 'group', but the exported function is named useStoreName which is a generic placeholder. This doesn't follow Pinia naming conventions.
-export const useStoreName = defineStore('group', {
+export const useGroupStore = defineStore('group', {
state: () => {
return {};
},
getters: {},
actions: {},
});📝 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.
| export const useStoreName = defineStore('group', { | |
| state: () => { | |
| return {}; | |
| }, | |
| getters: {}, | |
| actions: {}, | |
| }); | |
| export const useGroupStore = defineStore('group', { | |
| state: () => { | |
| return {}; | |
| }, | |
| getters: {}, | |
| actions: {}, | |
| }); |
| </div> | ||
| <div class="text-sm text-gray-500 dark:text-gray-400"> | ||
| {{ conn.counterparty?.connection_id }} {{ clientState.client_id }} | ||
| {{ conn.counterparty?.connection_id }} {{ conn.counterparty?.client_id }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed client identifier display for counterparty connection.
This change corrects the client identifier display in the connection counterparty section. It now correctly shows conn.counterparty?.client_id instead of using the client ID from the clientState object, providing more accurate information about the counterparty connection.
| <div class="mockup-code bg-base-200 my-2"> | ||
| <pre | ||
| data-prefix="1"><code class="text-gray-800 dark:invert"><script type="module" src="https://unpkg.com/ping-widget@latest/dist/ping-widget.js"></code></pre> | ||
| </div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Widget names still reference "ping" despite MANTRA rebranding.
The code snippets still reference "ping-widget", "ping-connect-wallet", and "PingTokenConvert" despite the project being rebranded to MANTRA Explorer.
Should these widget names be updated to maintain consistent branding with the rest of the application?
Also applies to: 45-56
🏁 Script executed:
#!/bin/bash
# Search for any references to ping-widget in the codebase
echo "Searching for ping-widget references..."
rg "ping-widget" -A 1 -B 1
echo "Searching for ping-connect-wallet references..."
rg "ping-connect-wallet" -A 1 -B 1
echo "Searching for PingTokenConvert references..."
rg "PingTokenConvert" -A 1 -B 1Length of output: 2864
Update all “ping” widget references to MANTRA naming
The code still contains multiple ping-widget, ping-connect-wallet, and PingTokenConvert references that need renaming to align with the MANTRA rebrand.
• public/test.html
<script src="https://unpkg.com/ping-widget@latest/..."></script><ping-connect-wallet …/><ping-token-convert …/>
• src/main.ts
import 'ping-widget';
• vite.config.ts
- Plugins:
'ping-connect-wallet','ping-token-convert'
• src/modules/[chain]/widget/index.vue (lines 35–38, 45–56)
- Script tag pointing at
ping-widget.js <ping-connect-wallet>and<label for="PingTokenConvert">…in code preview
• src/layouts/components/NavBarWallet.vue
<ping-connect-wallet :chain-id=… :hd-path=…/>
• src/modules/[chain]/index.vue
- Commented
<label for="PingTokenConvert">…
Suggested renames:
- <script type="module" src="https://unpkg.com/ping-widget@latest/dist/ping-widget.js"></script>
+ <script type="module" src="https://unpkg.com/mantra-widget@latest/dist/mantra-widget.js"></script>
- <ping-connect-wallet …/>
+ <mantra-connect-wallet …/>
- <ping-token-convert …/>
+ <mantra-token-convert …/>
- <label for="PingTokenConvert" …>…</label>
+ <label for="MantraTokenConvert" …>…</label>Ensure you also update imports (import 'mantra-widget'), plugin entries in vite.config.ts, component registrations, and any associated styles or tests.
| url: '/atomone/gov/v1beta1/proposals/{proposal_id}', | ||
| adapter: async (source: any): Promise<{proposal: GovProposal}> => { | ||
| return { | ||
| proposal: proposalAdapter(source.proposal) | ||
| } | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add error handling to the gov_proposals_proposal_id adapter.
Similar to the previous adapter, this one lacks error handling for unexpected data structures.
gov_proposals_proposal_id: {
url: '/atomone/gov/v1beta1/proposals/{proposal_id}',
adapter: async (source: any): Promise<{proposal: GovProposal}> => {
+ try {
return {
proposal: proposalAdapter(source.proposal)
}
+ } catch (error) {
+ console.error('Error in gov_proposals_proposal_id adapter:', error);
+ return { proposal: {} as GovProposal };
+ }
},
},📝 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.
| url: '/atomone/gov/v1beta1/proposals/{proposal_id}', | |
| adapter: async (source: any): Promise<{proposal: GovProposal}> => { | |
| return { | |
| proposal: proposalAdapter(source.proposal) | |
| } | |
| }, | |
| }, | |
| gov_proposals_proposal_id: { | |
| url: '/atomone/gov/v1beta1/proposals/{proposal_id}', | |
| adapter: async (source: any): Promise<{proposal: GovProposal}> => { | |
| try { | |
| return { | |
| proposal: proposalAdapter(source.proposal) | |
| } | |
| } catch (error) { | |
| console.error('Error in gov_proposals_proposal_id adapter:', error); | |
| return { proposal: {} as GovProposal }; | |
| } | |
| }, | |
| }, |
| function proposalAdapter(p: any): GovProposal { | ||
| if(p) { | ||
| if(p.messages && p.messages.length >= 1) p.content = p.messages[0].content || p.messages[0] | ||
| //p.proposal_id = p.id | ||
| p.final_tally_result = { | ||
| yes: p.final_tally_result?.yes_count, | ||
| no: p.final_tally_result?.no_count, | ||
| no_with_veto: p.final_tally_result?.no_with_veto_count, | ||
| abstain: p.final_tally_result?.abstain_count, | ||
| } | ||
| } | ||
| return p | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add error handling and improve the proposalAdapter function.
The function lacks proper error handling and has a commented-out line that should either be used or removed. Additionally, the function assumes certain properties exist in the input object.
function proposalAdapter(p: any): GovProposal {
- if(p) {
+ if (!p) return p;
+
+ try {
if(p.messages && p.messages.length >= 1) p.content = p.messages[0].content || p.messages[0]
- //p.proposal_id = p.id
+ // If proposal_id doesn't exist but id does, map it
+ if (!p.proposal_id && p.id) p.proposal_id = p.id
+
p.final_tally_result = {
- yes: p.final_tally_result?.yes_count,
- no: p.final_tally_result?.no_count,
- no_with_veto: p.final_tally_result?.no_with_veto_count,
- abstain: p.final_tally_result?.abstain_count,
+ yes: p.final_tally_result?.yes_count || '0',
+ no: p.final_tally_result?.no_count || '0',
+ no_with_veto: p.final_tally_result?.no_with_veto_count || '0',
+ abstain: p.final_tally_result?.abstain_count || '0',
}
+ return p;
+ } catch (error) {
+ console.error('Error in proposalAdapter:', error);
+ return p;
}
- return p
}📝 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.
| function proposalAdapter(p: any): GovProposal { | |
| if(p) { | |
| if(p.messages && p.messages.length >= 1) p.content = p.messages[0].content || p.messages[0] | |
| //p.proposal_id = p.id | |
| p.final_tally_result = { | |
| yes: p.final_tally_result?.yes_count, | |
| no: p.final_tally_result?.no_count, | |
| no_with_veto: p.final_tally_result?.no_with_veto_count, | |
| abstain: p.final_tally_result?.abstain_count, | |
| } | |
| } | |
| return p | |
| } | |
| function proposalAdapter(p: any): GovProposal { | |
| if (!p) return p; | |
| try { | |
| if (p.messages && p.messages.length >= 1) | |
| p.content = p.messages[0].content || p.messages[0]; | |
| // If proposal_id doesn't exist but id does, map it | |
| if (!p.proposal_id && p.id) | |
| p.proposal_id = p.id; | |
| p.final_tally_result = { | |
| yes: p.final_tally_result?.yes_count || '0', | |
| no: p.final_tally_result?.no_count || '0', | |
| no_with_veto: p.final_tally_result?.no_with_veto_count || '0', | |
| abstain: p.final_tally_result?.abstain_count || '0', | |
| }; | |
| return p; | |
| } catch (error) { | |
| console.error('Error in proposalAdapter:', error); | |
| return p; | |
| } | |
| } |
| conf.features = lc.features | ||
| conf.logo = lc.logo.startsWith('http') ? lc.logo : `https://ping.pub${lc.logo}`; | ||
| conf.features = lc.features; | ||
| conf.logo = lc.logo && lc.logo.startsWith('http') ? lc.logo : `${lc.logo}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use optional chaining for the logo path.
The current code doesn't use optional chaining which could lead to runtime errors if lc.logo is undefined.
- conf.logo = lc.logo && lc.logo.startsWith('http') ? lc.logo : `${lc.logo}`;
+ conf.logo = lc.logo?.startsWith('http') ? lc.logo : `${lc.logo}`;📝 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.
| conf.logo = lc.logo && lc.logo.startsWith('http') ? lc.logo : `${lc.logo}`; | |
| conf.logo = lc.logo?.startsWith('http') ? lc.logo : `${lc.logo}`; |
🧰 Tools
🪛 Biome (1.9.4)
[error] 191-191: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
Signed-off-by: ₿igto <164835500+BigtoMantraDev@users.noreply.github.com>
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Chores
Refactor
Documentation