Skip to content
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

fix: fix broken asset list link #270

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 68 additions & 68 deletions docs/osmosis-core/AssetData.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React, { useState, useEffect } from 'react';

const AssetData = () => {
const [assets, setAssets] = useState(null);
const [selectedUrl, setSelectedUrl] = useState('https://raw.githubusercontent.com/osmosis-labs/assetlists/main/osmosis-1/osmosis-1.assetlist.json');
const [selectedUrl, setSelectedUrl] = useState('https://raw.githubusercontent.com/osmosis-labs/assetlists/main/osmosis-1/generated/chain_registry/assetlist.json');

const assetUrls = {
mainnet: 'https://raw.githubusercontent.com/osmosis-labs/assetlists/main/osmosis-1/osmosis-1.assetlist.json',
mainnet: 'https://raw.githubusercontent.com/osmosis-labs/assetlists/main/osmosis-1/generated/chain_registry/assetlist.json',
osmo_test_4: 'https://raw.githubusercontent.com/osmosis-labs/assetlists/main/osmo-test-5/osmo-test-5.assetlist.json',
osmo_test_5: 'https://raw.githubusercontent.com/osmosis-labs/assetlists/main/osmo-test-5/osmo-test-5.assetlist.json',
};


const chainButtonStyle = {
backgroundColor: '#322dc2',
border: 'none',
Expand All @@ -22,13 +22,13 @@ const AssetData = () => {
fontSize: '16px',
margin: '4px 2px',
borderRadius: '8px',
transition: 'background-color 0.2s ease-in-out',
transition: 'background-color 0.2s ease-in-out',
':hover': {
backgroundColor: '#5f4bea',
}
};



useEffect(() => {
const fetchAssets = () => {
Expand All @@ -48,74 +48,74 @@ const AssetData = () => {
<>
<div> <h3> Select a chain </h3>
{Object.entries(assetUrls).map(([key, url]) => (
<button key={key} onClick={() => handleUrlChange(url)} style={chainButtonStyle}>
<button key={key} onClick={() => handleUrlChange(url)} style={chainButtonStyle}>
{key}
</button>
))}
</div>
{assets ? (
<table>
<thead>
<tr>
<th>
<code>Name</code>
</th>
<th>
<code>Information</code>
</th>
</tr>
</thead>
<tbody>
{assets.map((asset) => (
<tr key={asset.symbol}>
<td>{asset.name}</td>
<td>
<div>
<b>Symbol:</b> {asset.symbol}
<br /><b>IBC Denom:</b> {asset.base}
</div>
{asset.traces?.map((trace, index) => (
<div key={`${asset.symbol}-trace-${index}`}>
{trace.provider && <span><b> Provider</b>: {trace.provider}</span>}
<div>
<ul>
<li> {trace.type}
<ul>
<li><b>Destination Chain:</b> {trace.counterparty.chain_name} Denom:{trace.counterparty.base_denom}</li>


{trace.type === "ibc" ? (
<>
<li>
<b>Destination Channel:</b> {trace.counterparty.channel_id}
</li>
<li>
<b>Source Channel:</b> {trace.chain.channel_id}
</li>
</>
) : null}

<li><b>Base Denom:</b> {trace.counterparty.base_denom}</li>
</ul>
</li>
</ul>

</div>

</div>
))}

</td>
</tr>
))}
</tbody>



</table>
<thead>
<tr>
<th>
<code>Name</code>
</th>
<th>
<code>Information</code>
</th>
</tr>
</thead>
<tbody>
{assets.map((asset) => (
<tr key={asset.symbol}>
<td>{asset.name}</td>
<td>
<div>
<b>Symbol:</b> {asset.symbol}
<br /><b>IBC Denom:</b> {asset.base}
</div>
{asset.traces?.map((trace, index) => (
<div key={`${asset.symbol}-trace-${index}`}>
{trace.provider && <span><b> Provider</b>: {trace.provider}</span>}

<div>

<ul>
<li> {trace.type}
<ul>
<li><b>Destination Chain:</b> {trace.counterparty.chain_name} Denom:{trace.counterparty.base_denom}</li>


{trace.type === "ibc" ? (
<>
<li>
<b>Destination Channel:</b> {trace.counterparty.channel_id}
</li>
<li>
<b>Source Channel:</b> {trace.chain.channel_id}
</li>
</>
) : null}


<li><b>Base Denom:</b> {trace.counterparty.base_denom}</li>
</ul>
</li>
</ul>

</div>

</div>
))}

</td>
</tr>
))}
</tbody>



</table>
) : (
<h1>Fetching Assets...</h1>
)}
Expand Down
Loading