From a7f9cb7db0d9b8b45cd67ab3166d2e8d721abb2d Mon Sep 17 00:00:00 2001 From: Lorexia Date: Fri, 3 Nov 2023 12:48:55 +0100 Subject: [PATCH] mimxnet client examples updates --- .../docs/code-examples/mixfetch-example-code.mdx | 10 ++++++++-- sdk/typescript/docs/components/traffic.tsx | 1 + sdk/typescript/docs/pages/examples/mix-fetch.mdx | 4 ---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sdk/typescript/docs/code-examples/mixfetch-example-code.mdx b/sdk/typescript/docs/code-examples/mixfetch-example-code.mdx index 70ba77f9d1..780df512ed 100644 --- a/sdk/typescript/docs/code-examples/mixfetch-example-code.mdx +++ b/sdk/typescript/docs/code-examples/mixfetch-example-code.mdx @@ -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 = () => { ); }; + ``` diff --git a/sdk/typescript/docs/components/traffic.tsx b/sdk/typescript/docs/components/traffic.tsx index 9205382d2d..344ce476a1 100644 --- a/sdk/typescript/docs/components/traffic.tsx +++ b/sdk/typescript/docs/components/traffic.tsx @@ -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 diff --git a/sdk/typescript/docs/pages/examples/mix-fetch.mdx b/sdk/typescript/docs/pages/examples/mix-fetch.mdx index ec0095e1d5..4f24271f04 100644 --- a/sdk/typescript/docs/pages/examples/mix-fetch.mdx +++ b/sdk/typescript/docs/pages/examples/mix-fetch.mdx @@ -72,10 +72,6 @@ import { mixFetch } from "@nymproject/mix-fetch-full-fat"; ##### Example: using the `mixFetch` client: - - Again, for this example, we will be using the `full-fat` version of the ESM SDK. - - `Get` and `Post` outputs will be observable from your console. ```ts