diff --git a/documentation/docs/pages/developers/typescript/examples/cosmos-kit.mdx b/documentation/docs/pages/developers/typescript/examples/cosmos-kit.mdx index c25403aa7f4..1df3855ffa2 100644 --- a/documentation/docs/pages/developers/typescript/examples/cosmos-kit.mdx +++ b/documentation/docs/pages/developers/typescript/examples/cosmos-kit.mdx @@ -1,5 +1,11 @@ +import { Callout } from 'nextra/components' + # Cosmos Kit + +The Typescript SDK is currently undergoing maintenance: a network upgrade elsewhere has temporarily caused a problem. These docs are likely to change after we upgrade the SDK. + + The wonderful people of Cosmology have made some [fantastic components](https://cosmoskit.com/) that can be used with Nym. These include: @@ -17,7 +23,7 @@ npm create vite@latest During the environment setup, choose React and subsequently opt for Typescript if you want your application to function smoothly following this tutorial. Next, navigate to your application directory and run the following commands: ```bash cd < YOUR_APP > -npm i +npm i npm run dev ``` @@ -57,7 +63,7 @@ export default defineConfig({ Your components have to be wrapped into a [ChainProvider](https://docs.cosmoskit.com/chain-provider), in order to use the `useChain('nyx')` hook. The nyx chain is provided in the 'chain-registry' NPM package by default. -Now, go to the `src` folder and open your `App.tsx` file to replace all the code with the following, which will allow you to connect and disconnect a Ledger or Keplr wallet to Nyx: +Now, go to the `src` folder and open your `App.tsx` file to replace all the code with the following, which will allow you to connect and disconnect a Ledger or Keplr wallet to Nyx: ```ts import "./App.css"; @@ -68,7 +74,7 @@ import { wallets as ledger } from '@cosmos-kit/ledger'; import { wallets as keplr } from '@cosmos-kit/keplr'; import { AminoMsg, makeSignDoc } from '@cosmjs/amino'; import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx'; - + export const getDoc = (address: string) => { const chainId = 'nyx'; const msg: AminoMsg = { @@ -89,28 +95,28 @@ export const getDoc = (address: string) => { const doc = makeSignDoc([msg], fee, chainId, memo, accountNumber, sequence); return doc }; - + function MyComponent() { const {wallet, address, connect, disconnect, getOfflineSignerAmino } = useChain('nyx'); - + React.useEffect(() => { connect(); disconnect(); }, []); - + const sign = async () => { if (!address) return const doc = getDoc(address); return getOfflineSignerAmino().signAmino(address, doc); }; - + return ( -
+
- {wallet && -
-
Connected to {wallet?.prettyName}
+ {wallet && +
+
Connected to {wallet?.prettyName}
Address: {address}
}
@@ -126,7 +132,7 @@ function MyComponent() {
); } - + export default function App() { const assetsFixedUp = React.useMemo(() => { const nyx = assets.find((a) => a.chain_name === 'nyx'); @@ -139,7 +145,7 @@ export default function App() { } return assets; }, [assets]); - + return ( c.chain_id === 'nyx')!]} @@ -149,10 +155,10 @@ export default function App() { preferredSignType: () => 'amino', }} > - + - + ) } ``` diff --git a/documentation/docs/pages/developers/typescript/examples/mix-fetch.mdx b/documentation/docs/pages/developers/typescript/examples/mix-fetch.mdx index 1633c4f4a4d..ceb90645029 100644 --- a/documentation/docs/pages/developers/typescript/examples/mix-fetch.mdx +++ b/documentation/docs/pages/developers/typescript/examples/mix-fetch.mdx @@ -1,7 +1,9 @@ import { Callout } from 'nextra/components'; # `mixFetch` - + +The Typescript SDK is currently undergoing maintenance: a network upgrade elsewhere has temporarily caused a problem. These docs are likely to change after we upgrade the SDK. + An easy way to secure parts or all of your web app is to replace calls to [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) with `mixFetch`: MixFetch works the same as vanilla `fetch` as it's a proxied wrapper around the original function. @@ -35,9 +37,9 @@ curl -X 'GET' \ import type { SetupMixFetchOps } from '@nymproject/mix-fetch'; const mixFetchOptions: SetupMixFetchOps = { - preferredGateway: '6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B', // with WSS + preferredGateway: '23A7CSaBSA2L67PWuFTPXUnYrCdyVcB7ATYsjUsfdftb', // with WSS preferredNetworkRequester: - '8rRGWy54oC8drFL9DepMegBt2DLrsqQwCoHMXt9nsnTo.2XjCPVbb4FpQ9hNRcXwb9mTzEAVVk1zf1tcch3wdtNEA@6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B', + 'HuNL1pFprNSKW6jdqppibXP5KNKCNJxDh7ivpYcoULN9.C62NahRTUf6kqpNtDVHXoVriQr6yyaU5LtxdgpbsGrtA@23A7CSaBSA2L67PWuFTPXUnYrCdyVcB7ATYsjUsfdftb', mixFetchOverride: { requestTimeoutMs: 60_000, }, @@ -90,9 +92,9 @@ import { mixFetch, SetupMixFetchOps } from '@nymproject/mix-fetch-full-fat'; import React from 'react'; const mixFetchOptions: SetupMixFetchOps = { - preferredGateway: '6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B', // with WSS + preferredGateway: '23A7CSaBSA2L67PWuFTPXUnYrCdyVcB7ATYsjUsfdftb', // with WSS preferredNetworkRequester: - '8rRGWy54oC8drFL9DepMegBt2DLrsqQwCoHMXt9nsnTo.2XjCPVbb4FpQ9hNRcXwb9mTzEAVVk1zf1tcch3wdtNEA@6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B', + 'HuNL1pFprNSKW6jdqppibXP5KNKCNJxDh7ivpYcoULN9.C62NahRTUf6kqpNtDVHXoVriQr6yyaU5LtxdgpbsGrtA@23A7CSaBSA2L67PWuFTPXUnYrCdyVcB7ATYsjUsfdftb', mixFetchOverride: { requestTimeoutMs: 60_000, }, diff --git a/documentation/docs/pages/developers/typescript/examples/mixnet.mdx b/documentation/docs/pages/developers/typescript/examples/mixnet.mdx index 00bd17d5d06..e5210a17805 100644 --- a/documentation/docs/pages/developers/typescript/examples/mixnet.mdx +++ b/documentation/docs/pages/developers/typescript/examples/mixnet.mdx @@ -1,7 +1,9 @@ import { Callout } from 'nextra/components' # Mixnet Client - + +The Typescript SDK is currently undergoing maintenance: a network upgrade elsewhere has temporarily caused a problem. These docs are likely to change after we upgrade the SDK. + As you know by now, in order to send or receive messages over the mixnet, you'll need to use the [`SDK Client`](https://www.npmjs.com/package/@nymproject/sdk), which will allow you to create apps that can use the Nym mixnet and Coconut credentials. This client is message based - it can only send a one-way message to another client's address. diff --git a/documentation/docs/pages/developers/typescript/examples/nym-smart-contracts.mdx b/documentation/docs/pages/developers/typescript/examples/nym-smart-contracts.mdx index 669d284611e..d0e4ca7fafe 100644 --- a/documentation/docs/pages/developers/typescript/examples/nym-smart-contracts.mdx +++ b/documentation/docs/pages/developers/typescript/examples/nym-smart-contracts.mdx @@ -1,7 +1,9 @@ import { Callout } from 'nextra/components' # Nym Smart Contract Clients - + +The Typescript SDK is currently undergoing maintenance: a network upgrade elsewhere has temporarily caused a problem. These docs are likely to change after we upgrade the SDK. + As previously mentioned, to query or execute on any of the Nym contracts, you'll need to use one of the [`Contract Clients`](https://www.npmjs.com/package/@nymproject/contract-clients), which contains read-only query and signing clients for all of Nym's smart contracts. ##### Contract Clients list @@ -29,14 +31,14 @@ npm create vite@latest During the environment setup, choose React and subsequently opt for Typescript if you want your application to function smoothly following this tutorial. Next, navigate to your application directory and run the following commands: ```bash cd < YOUR_APP > -npm i +npm i npm run dev ``` ##### Installation Install the packages and their dependencies if you don't already have them: ```bash -npm install @nymproject/contract-clients @cosmjs/cosmwasm-stargate +npm install @nymproject/contract-clients @cosmjs/cosmwasm-stargate ``` ## Query clients @@ -143,7 +145,7 @@ import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate"; import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { GasPrice } from "@cosmjs/stargate"; import { settings } from "./settings"; - + export default function Exec() { let signer: DirectSecp256k1HdWallet; let signerMixnetClient: any; @@ -153,7 +155,7 @@ export default function Exec() { let nodeAddress: string; let amountToSend: string; let delegations: any; - + async function ExecuteOnNyx() { // Cosmos client signer = await DirectSecp256k1HdWallet.fromMnemonic(settings.mnemonic, { @@ -168,7 +170,7 @@ export default function Exec() { ); // Save globally cosmWasmSigningClient = cosmWasmClient; - + // Nym client const mixnetClient = new contracts.Mixnet.MixnetClient( cosmWasmSigningClient, @@ -177,9 +179,9 @@ export default function Exec() { ); // Save globally signerMixnetClient = mixnetClient; - + } - + // Get delegations const getDelegations = async () => { if (!signerMixnetClient) { @@ -190,7 +192,7 @@ export default function Exec() { }); delegations = delegationsObject; }; - + // Make delegation const doDelegation = async () => { if (!signerMixnetClient) { @@ -204,7 +206,7 @@ export default function Exec() { ); console.log(res); }; - + // Undelegate all const doUndelegateAll = async () => { for (const delegation of delegations.delegations) { @@ -214,7 +216,7 @@ export default function Exec() { ); } }; - + // Sending tokens const doSendTokens = async () => { const memo = "test sending tokens"; @@ -227,10 +229,10 @@ export default function Exec() { ); console.log(res); }; - + ExecuteOnNyx(); setTimeout(() => getDelegations(), 1000); - + return (

Exec

diff --git a/documentation/docs/pages/developers/typescript/playground/cosmos-kit.mdx b/documentation/docs/pages/developers/typescript/playground/cosmos-kit.mdx index 6fcea580fb6..f1dfb89ea37 100644 --- a/documentation/docs/pages/developers/typescript/playground/cosmos-kit.mdx +++ b/documentation/docs/pages/developers/typescript/playground/cosmos-kit.mdx @@ -1,10 +1,15 @@ import "@interchain-ui/react/styles" import { CosmosKit } from "../../../../components/cosmos-kit"; -import { Callout } from 'nextra/components' import FormattedCosmoskitExampleCode from '../../../../code-examples/sdk/typescript/cosmoskit-example-code.mdx'; # Cosmos Kit +import { Callout } from 'nextra/components' + + +The Typescript SDK is currently undergoing maintenance: a network upgrade elsewhere has temporarily caused a problem. These docs are likely to change after we upgrade the SDK. + + Below is an example that uses [CosmosKit](https://cosmoskit.com/) to connect and sign a fake transaction with your [Keplr wallet](https://www.keplr.app/) or [Ledger hardware wallet](https://www.ledger.com/) to this page: diff --git a/documentation/docs/pages/developers/typescript/playground/mixfetch.mdx b/documentation/docs/pages/developers/typescript/playground/mixfetch.mdx index e2ce8248536..b1dccf5ae25 100644 --- a/documentation/docs/pages/developers/typescript/playground/mixfetch.mdx +++ b/documentation/docs/pages/developers/typescript/playground/mixfetch.mdx @@ -5,6 +5,10 @@ import Box from '@mui/material/Box'; import FormattedMixFetchExampleCode from '../../../../code-examples/sdk/typescript/mixfetch-example-code.mdx'; import { Callout } from 'nextra/components' + +The Typescript SDK is currently undergoing maintenance: a network upgrade elsewhere has temporarily caused a problem. These docs are likely to change after we upgrade the SDK. + + Right now Gateways are not required to run a Secure Websocket (WSS) listener, so only a subset of nodes running in Gateway mode have configured their nodes to do so. diff --git a/documentation/docs/pages/developers/typescript/playground/mixnodes.mdx b/documentation/docs/pages/developers/typescript/playground/mixnodes.mdx index 3327f3d650a..4937051fb2f 100644 --- a/documentation/docs/pages/developers/typescript/playground/mixnodes.mdx +++ b/documentation/docs/pages/developers/typescript/playground/mixnodes.mdx @@ -3,6 +3,11 @@ import { Mixnodes } from '../../../../components/mixnodes'; import Box from '@mui/material/Box'; import FormattedExampleCode from '../../../../code-examples/sdk/typescript/mixnodes-example-code.mdx'; +import { Callout } from 'nextra/components' + + +The Typescript SDK is currently undergoing maintenance: a network upgrade elsewhere has temporarily caused a problem. These docs are likely to change after we upgrade the SDK. + The Nym Mixnet contract keeps a directory of all mixnodes that can be used to mix traffic. diff --git a/documentation/docs/pages/developers/typescript/playground/traffic.mdx b/documentation/docs/pages/developers/typescript/playground/traffic.mdx index 81af690fedb..d1851b878b2 100644 --- a/documentation/docs/pages/developers/typescript/playground/traffic.mdx +++ b/documentation/docs/pages/developers/typescript/playground/traffic.mdx @@ -4,6 +4,9 @@ import { Traffic } from '../../../../components/traffic'; import Box from '@mui/material/Box'; import FormattedTrafficExampleCode from '../../../../code-examples/sdk/typescript/traffic-example-code.mdx'; + +The Typescript SDK is currently undergoing maintenance: a network upgrade elsewhere has temporarily caused a problem. These docs are likely to change after we upgrade the SDK. + Use this tool to experiment with the mixnet: send and receive messages! diff --git a/documentation/docs/pages/developers/typescript/playground/wallet.mdx b/documentation/docs/pages/developers/typescript/playground/wallet.mdx index f384dd226ab..99f39816cca 100644 --- a/documentation/docs/pages/developers/typescript/playground/wallet.mdx +++ b/documentation/docs/pages/developers/typescript/playground/wallet.mdx @@ -10,6 +10,13 @@ import FormattedWalletConnectCode from '../../../../code-examples/sdk/typescript import FormattedWalletSendTokensCode from '../../../../code-examples/sdk/typescript/wallet-sendTokens-code.mdx'; import FormattedWalletDelegationsCode from '../../../../code-examples/sdk/typescript/wallet-delegations-code.mdx'; + +import { Callout } from 'nextra/components' + + +The Typescript SDK is currently undergoing maintenance: a network upgrade elsewhere has temporarily caused a problem. These docs are likely to change after we upgrade the SDK. + + Here's a small wallet example using testnet for you to test out!