refactor(docs): move source for doc pages here (#119)

* docs: move dev docs to dev-docs folder

* docs: move source for doc pages here

* docs: improve docs
This commit is contained in:
Einliterflasche 2024-10-25 03:55:18 +02:00 committed by GitHub
parent 5341587dfa
commit bfc82c0534
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 6307 additions and 0 deletions

View file

@ -0,0 +1,55 @@
import { useState, useEffect } from "react";
export default function SwapProviderTable() {
function satsToBtc(sats) {
return sats / 100000000;
}
async function getProviders() {
// from https://unstoppableswap.net/api/list with cors disabled
const response = await fetch("https://api.unstoppableswap.net/api/list");
const data = await response.json();
return data;
}
const [providers, setProviders] = useState([]);
useEffect(() => {
getProviders().then((data) => {
setProviders(data);
});
}, []);
return (
<div
style={{
overflowX: "scroll",
}}
>
<table>
<thead>
<tr>
<th>Multiaddress</th>
<th>Peer ID</th>
<th>Minimum Amount</th>
<th>Maximum Amount</th>
<th>Exchange Rate</th>
<th>Uptime</th>
</tr>
</thead>
<tbody>
{providers.map((provider) => (
<tr key={provider.peerId}>
<td>{provider.multiAddr}</td>
<td>{provider.peerId}</td>
<td>{satsToBtc(provider.minSwapAmount)} BTC</td>
<td>{satsToBtc(provider.maxSwapAmount)} BTC</td>
<td>{satsToBtc(provider.price)} XMR/BTC</td>
<td>{(provider.uptime * 100).toFixed(1)}%</td>
</tr>
))}
</tbody>
</table>
</div>
);
}