Skip to content

Commit

Permalink
feat: try replacing asset list link
Browse files Browse the repository at this point in the history
  • Loading branch information
mattverse committed Aug 27, 2024
1 parent 8bc655a commit 48b87cd
Showing 1 changed file with 67 additions and 67 deletions.
134 changes: 67 additions & 67 deletions docs/osmosis-core/AssetData.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ const AssetData = () => {
const [selectedUrl, setSelectedUrl] = useState('https://raw.githubusercontent.com/osmosis-labs/assetlists/main/osmosis-1/osmosis-1.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

0 comments on commit 48b87cd

Please sign in to comment.