mimxnet client examples updates

This commit is contained in:
Lorexia
2023-11-03 12:48:55 +01:00
parent c1f2bf4f27
commit a7f9cb7db0
3 changed files with 9 additions and 6 deletions
@@ -8,16 +8,21 @@ import Box from '@mui/material/Box';
import { mixFetch } from '@nymproject/mix-fetch-full-fat';
import Stack from '@mui/material/Stack';
import Paper from '@mui/material/Paper';
import type { SetupMixFetchOps } from '@nymproject/mix-fetch';
const defaultUrl = 'https://nymtech.net/favicon.svg';
const args = { mode: 'unsafe-ignore-cors' };
const mixFetchOptions = {
preferredGateway: 'E3mvZTHQCdBvhfr178Swx9g4QG3kkRUun7YnToLMcMbM',
const mixFetchOptions: SetupMixFetchOps = {
preferredGateway: 'E3mvZTHQCdBvhfr178Swx9g4QG3kkRUun7YnToLMcMbM', // with WSS
preferredNetworkRequester:
'GiRjFWrMxt58pEMuusm4yT3RxoMD1MMPrR9M2N4VWRJP.3CNZBPq4vg7v7qozjGjdPMXcvDmkbWPCgbGCjQVw9n6Z@2xU4CBE6QiiYt6EyBXSALwxkNvM7gqJfjHXaMkjiFmYW',
mixFetchOverride: {
requestTimeoutMs: 60_000,
},
forceTls: true, // force WSS
extra: {},
};
export const MixFetch = () => {
@@ -77,4 +82,5 @@ export const MixFetch = () => {
</div>
);
};
```
@@ -26,6 +26,7 @@ export const Traffic = () => {
await client?.client.start({
clientId: crypto.randomUUID(),
nymApiUrl,
preferredGatewayIdentityKey: 'E3mvZTHQCdBvhfr178Swx9g4QG3kkRUun7YnToLMcMbM', // force WSS
});
// check when is connected and set the self address
@@ -72,10 +72,6 @@ import { mixFetch } from "@nymproject/mix-fetch-full-fat";
##### Example: using the `mixFetch` client:
<Callout type="info" emoji="️">
Again, for this example, we will be using the `full-fat` version of the ESM SDK.
</Callout>
`Get` and `Post` outputs will be observable from your console.
```ts