Installation

Overview

The Typescript SDK's different modules allow developers to start building browser-based applications quickly, by simply importing the SDK module of their choice - depending on the component from the Nym architecture they want to use - into their code via NPM as they would any other Typescript library.

ℹ️

SDK modules come in four different flavours (ESM, CJS and full-fat for ESM and CJS). This documentation only shows instructions and examples for the unbundled ESM variant.

Install all

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

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. 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 --save

Mixnet

Overview

The Nym mixnet (opens in a new tab) provides very strong security guarantees against network-level surveillance. It wraps into packets and mixes together IP traffic from many users inside the mixnet. It encrypts and mixes Sphinx packet (opens in a new tab) traffic so that it cannot be determined who is communicating with whom. Our mixnet is based on a modified version of the Loopix design.

You can explore our mixnet using our 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 --save

MixFetch

Overview

MixFetch is a drop-in replacement for fetch (opens in a new tab) that sends HTTP requests through the 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 --save