Skip to content

Commit

Permalink
update nym sdk version
Browse files Browse the repository at this point in the history
  • Loading branch information
cgi-bin committed Nov 5, 2023
1 parent f42f675 commit 470ae76
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.14.13",
"@nymproject/mix-fetch-full-fat": "^1.2.1",
"@nymproject/mix-fetch-full-fat": "^1.2.2",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
Expand Down
75 changes: 37 additions & 38 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ const extra = {

const extra = {
hiddenGateways: [
{
owner: 'n1phyudpgd98can5gqzywpumv7h47lkqfl458c8z',
host: 'gw1.notrustverify.ch',
explicitIp: '172.105.93.66',
identityKey: 'EBT8jTD8o4tKng2NXrrcrzVhJiBnKpT1bJy5CMeArt2w',
sphinxKey: '3Q9pBR2RZ2xd6WJJPXPxpQniqvdtpv4fUTSFGL4vhqJJ',
},
],
};
{
owner: 'n1phyudpgd98can5gqzywpumv7h47lkqfl458c8z',
host: 'gw1.notrustverify.ch',
explicitIp: '172.105.93.66',
identityKey: 'EBT8jTD8o4tKng2NXrrcrzVhJiBnKpT1bJy5CMeArt2w',
sphinxKey: '3Q9pBR2RZ2xd6WJJPXPxpQniqvdtpv4fUTSFGL4vhqJJ'
}
]
};

const mixFetchOptions: SetupMixFetchOps = {
preferredGateway: 'EBT8jTD8o4tKng2NXrrcrzVhJiBnKpT1bJy5CMeArt2w',
Expand All @@ -46,7 +46,6 @@ const mixFetchOptions: SetupMixFetchOps = {
mixFetchOverride: {
requestTimeoutMs: 60_000
},
extra: extra,
forceTls: true
};

Expand All @@ -62,14 +61,12 @@ function App() {
const response = await mixFetch(url, args, mixFetchOptions);
console.log(response);

if(response.ok){
if (response.ok) {
setData(JSON.parse(await response.text()));
}
else
setData({"error": response.statusText})
} else setData({ error: response.statusText });
} catch (err) {
setData({"error": err})
console.log(JSON.stringify(err))
setData({ error: err });
console.log(JSON.stringify(err));
console.log(err);
}
}, [url]);
Expand All @@ -81,25 +78,25 @@ function App() {
}
}, []);


return (
<>
<br/>
<br />
<Typography variant="h4">Privacy preserved Cryptocurrency Prices</Typography>
<Box
sx={{
width: '100%',
height: 60,
textAlign: 'center',
padding: "1em"
padding: '1em'
}}
>
<Typography align="center" variant='caption'>Developed by <a href='https://notrustverify.ch'>No Trust Verify</a>, powered by <a href="https://nymtech.net/">Nym</a></Typography>
<Typography align="center" variant="caption">
Developed by <a href="https://notrustverify.ch">No Trust Verify</a>, powered by{' '}
<a href="https://nymtech.net/">Nym</a>
</Typography>
</Box>
<div>
{
data && data.hasOwnProperty("error") && <>Error with application: {JSON.stringify(data.error)}</>
}
{data && data.hasOwnProperty('error') && <>Error with application: {JSON.stringify(data.error)}</>}
{
<TableContainer>
<Table>
Expand All @@ -111,29 +108,31 @@ function App() {
<TableCell>High (24h)</TableCell>
<TableCell>Low (24h)</TableCell>
<TableCell>Price Change (24h)</TableCell>

</TableRow>
</TableHead>
<TableBody>
{data ? !data.hasOwnProperty("error") &&
data.map(ticker => {
return (
<TableRow key={ticker.id}>
<TableCell>{ticker.market_cap_rank}</TableCell>
<TableCell>{ticker.id.charAt(0).toUpperCase() + ticker.id.slice(1)}</TableCell>
<TableCell>${ticker.current_price}</TableCell>
<TableCell>${ticker.high_24h}</TableCell>
<TableCell>${ticker.low_24h}</TableCell>
<TableCell>{ticker.price_change_percentage_24h}%</TableCell>
</TableRow>
);
}) : "Loading"}
{data
? !data.hasOwnProperty('error') &&
data.map(ticker => {
return (
<TableRow key={ticker.id}>
<TableCell>{ticker.market_cap_rank}</TableCell>
<TableCell>
{ticker.id.charAt(0).toUpperCase() + ticker.id.slice(1)}
</TableCell>
<TableCell>${ticker.current_price}</TableCell>
<TableCell>${ticker.high_24h}</TableCell>
<TableCell>${ticker.low_24h}</TableCell>
<TableCell>{ticker.price_change_percentage_24h}%</TableCell>
</TableRow>
);
})
: 'Loading'}
</TableBody>
</Table>
</TableContainer>
}
</div>

</>
);
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2082,10 +2082,10 @@
read-package-json-fast "^3.0.0"
which "^3.0.0"

"@nymproject/mix-fetch-full-fat@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@nymproject/mix-fetch-full-fat/-/mix-fetch-full-fat-1.2.1.tgz#7e9c28acd98aac8daddb2ffc34212fb476e4f1e4"
integrity sha512-rvSzQIfcBmhFKN0ZlDyMS9rK1RUWCszqZZDXlIL0AImwvJnnpJxAHx6wMABMx9u5np9LE0tbmXSZVhZCM/Q4Ww==
"@nymproject/mix-fetch-full-fat@^1.2.2":
version "1.2.2"
resolved "https://registry.yarnpkg.com/@nymproject/mix-fetch-full-fat/-/mix-fetch-full-fat-1.2.2.tgz#636f7e3b66a1ca1281d6c91bd6bb9c28cfbc407e"
integrity sha512-JoXf3Mq+7VgATZtEMsMHVj7mzXxNZva2c+yk0YprJGSzFabTprn7QdrfvgJISi7F0Cs9F8XhffdpKIOZE+VENQ==

"@octokit/auth-token@^2.4.4":
version "2.5.0"
Expand Down

0 comments on commit 470ae76

Please sign in to comment.