1.2.4-rc.1 • Published 6 months ago

@nymproject/nodejs-client-commonjs v1.2.4-rc.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
6 months ago

Nym NodeJS wrapper for Sphinx webassembly client

This package is a NodeJS client that uses the wasm from the Sphinx webassembly client, runs it inside a NodeJS Worker thread and allows users to send and receive Sphinx packets to/from a Nym mixnet.

Usage

const { createNymMixnetClient } = require('@nymproject/nodejs-client-commonjs');

async () => {
  const nym = await createNymMixnetClient();

  nym.events.subscribeToTextMessageReceivedEvent(async (e) => {
    console.log("message received", e.args.payload);
  });

  const nymApiUrl = 'https://validator.nymtech.net/api/';

  // start the client and connect to a gateway
  await nym.client.start({
    nymApiUrl,
    clientId: 'my-client',
  });

  nym.events.subscribeToConnected(async (e) => {
    // send a message to yourself
    const message = 'Hello';
    const recipient = await nym.client.selfAddress();
    await nym.client.send({ payload: { message, mimeType: 'text/plain' }, recipient });
  });
};
1.2.4-rc.1

6 months ago

1.2.4-rc.0

6 months ago

1.2.3

6 months ago

1.2.3-rc.0

6 months ago

1.2.2

6 months ago

1.2.1

6 months ago

1.2.1-rc.3

7 months ago

1.2.1-rc.2

7 months ago

1.2.1-rc.1

7 months ago