Installation

Overview

The different modules in the Typescript SDK allow developers to start building browser-based applications quickly. Simply import the SDK module of your choice – depending on the component from the Nym architecture you want to use – into your code via NPM, as you would any other TypeScript library.

ℹ️

Other than the Contract Clients, SDK modules come in four different flavours (ESM, CJS and full-fat for ESM and CJS). This documentation focuses on examples using the full-fat versions.

Install all

npm install @nymproject/contract-clients @cosmjs/cosmwasm-stargate @cosmjs/proto-signing @nymproject/sdk-full-fat @nymproject/mix-fetch-full-fat 

MixFetch

Overview

MixFetch is a drop-in replacement for fetch (opens in a new tab) that sends HTTP requests through the Nym mixnet. It does this by grabbing the same arguments as traditional fetch and constructing a SOCKS5 request that will be made to the destination host on the Internet via a SOCKS5 (opens in a new tab) Network Requester (opens in a new tab).

Installation: MixFetch package

In order to fetch data through mixFetch you'll need to use the MixFetch package (opens in a new tab).

First install the package and its dependencies:

npm install @nymproject/mix-fetch-full-fat 

Mixnet

Overview

The Nym mixnet (opens in a new tab) provides extremely robust protection against network-level surveillance. It splits data into smaller, identically sized,Sphinx encrypted packet (opens in a new tab), which are then mixed in with dummy traffic and dispersed through Nym nodes around the world at randomised intervals. Finally these are decrypted and reassembled, preventing the observation of metadata and providing pattern privacy so that it cannot be determined who is communicating with whom. The Nym mixnet is based on a modified version of the Loopix design (opens in a new tab).

You can explore the Nym mixnet using the mixnet explorer (opens in a new tab) here.

Installation: Mixnet Client

In order to send or receive traffic over the mixnet, you'll need to use the Mixnet Client (opens in a new tab).

First install the package and its dependencies:

npm install @nymproject/sdk-full-fat 

Nym Smart Contracts

Overview

The Nyx blockchain is a general-purpose CosmWasm-enabled smart contract platform, and the home of the smart contracts which keep track of the mixnet, amongst others. Further information about the chain can be found on the Nyx blockchain explorer (opens in a new tab).

Using the Nym mixnet smart contract clients (opens in a new tab), you will be able to query contract states or execute methods when providing a signing key.

You can learn about our different methods to interact with the chain here (opens in a new tab).

Installation: Contract Clients

In order to query or execute on any of the Nym smart contracts, you'll need to use the Contract Clients (opens in a new tab), which contains read-only query and signing clients for all Nyx's smart contracts.

First install the package and its dependencies from Cosmos Stargate:

npm install @nymproject/contract-clients @cosmjs/cosmwasm-stargate @cosmjs/proto-signing