diff --git a/sdk/typescript/packages/nodejs-client/README.md b/sdk/typescript/packages/nodejs-client/README.md index d9c2f33992f..db694fbe961 100644 --- a/sdk/typescript/packages/nodejs-client/README.md +++ b/sdk/typescript/packages/nodejs-client/README.md @@ -10,13 +10,10 @@ const { createNymMixnetClient } = require('../dist/cjs/index.js'); async () => { const nym = await createNymMixnetClient(); - nym.events.subscribeToLoaded((e) => { - console.log('Loaded'); - }); - nym.events.subscribeToTextMessageReceivedEvent(async (e) => { - console.log(e.args.payload); - if (e.args.payload === 'Hello') await nym.client.stop(); + if (e.args.payload === 'Hello') { + await nym.client.stop(); + } }); const nymApiUrl = 'https://validator.nymtech.net/api/'; @@ -28,7 +25,6 @@ async () => { }); nym.events.subscribeToConnected(async (e) => { - console.log('Connected'); // send a message to yourself const message = 'Hello'; const recipient = await nym.client.selfAddress(); diff --git a/sdk/typescript/packages/nodejs-client/internal/index.mjs b/sdk/typescript/packages/nodejs-client/internal/index.mjs deleted file mode 100644 index 28c214a8d08..00000000000 --- a/sdk/typescript/packages/nodejs-client/internal/index.mjs +++ /dev/null @@ -1,28 +0,0 @@ -import { createNymMixnetClient } from '../dist/cjs/index.js'; - -const nym = await createNymMixnetClient(); - -nym.events.subscribeToLoaded((e) => { - console.log('Loaded'); -}); - -nym.events.subscribeToTextMessageReceivedEvent(async (e) => { - console.log(e.args.payload); - if (e.args.payload === 'Hello') await nym.client.stop(); -}); - -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) => { - console.log('Connected'); - // send a message to yourself - const message = 'Hello'; - const recipient = await nym.client.selfAddress(); - await nym.client.send({ payload: { message, mimeType: 'text/plain' }, recipient }); -});