npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

synnq-sdk

v1.0.7

Published

A TypeScript SDK for interacting with the Synnq platform.

Readme

SYYNNQ SDK

A TypeScript SDK for interacting with the Synnq platform. This SDK provides easy-to-use methods for managing wallets, transactions, governance, neural network interactions, block management, contract execution, and authentication.

Features

  • Wallet Management: Create and manage wallets, retrieve wallet details, and manage permissions and roles.
  • Transaction Handling: Create and retrieve transactions.
  • Governance: Submit and vote on proposals.
  • Neural Network: Make predictions and update models.
  • Block Management: Query block height.
  • Contract Management: Execute and deploy contracts.
  • Authentication: Authenticate wallets and verify tokens.

Installation

Install the SDK using npm:

npm install synnq-sdk

Usage

Import the SDK

First, import the SDK into your project:

import { SynnqSDK } from 'synnq-sdk';

Initialize the SDK Client

Initialize the SDK client with the default base URL (https://rest.synnq.io):

const client = new SynnqSDK();

You can also specify a custom base URL if needed:

const client = new SynnqSDK('https://custom-api-url.com');

Wallet Management

Create a Wallet

You can create a new wallet using the createWallet method:

async function createWallet() {
  const walletResponse = await client.wallet.createWallet({
    prefix: 'synnq',
  });
  console.log(walletResponse);
}

createWallet();

Retrieve a Wallet by Mnemonic

Retrieve a wallet using a mnemonic phrase:

async function retrieveWalletFromMnemonic() {
  const walletResponse = await client.wallet.retrieveWalletFromMnemonic({
    mnemonic: 'your-mnemonic',
  });
  console.log(walletResponse);
}

retrieveWalletFromMnemonic();

Query Wallet Balance

Query the balance of a wallet for a specific token:

async function queryBalance() {
  const balanceResponse = await client.wallet.queryBalance({
    address: 'wallet-address',
    symbol: 'SYQ',
  });
  console.log(balanceResponse);
}

queryBalance();

Get Wallets Holding a Specific Coin

Retrieve all wallets that hold a specific coin:

async function getWalletsHoldingCoin() {
  const walletsResponse = await client.wallet.getWalletsHoldingCoin({
    coinSymbol: 'SYQ',
  });
  console.log(walletsResponse);
}

getWalletsHoldingCoin();

Get Wallets Count

Retrieve the total count of wallets:

async function getWalletsCount() {
  const countResponse = await client.wallet.getWalletsCount();
  console.log(countResponse);
}

getWalletsCount();

Transaction Handling

Create a Transaction

Create a new transaction between two addresses:

async function createTransaction() {
  const transactionResponse = await client.transaction.createTransaction({
    transaction_type: 'payment',
    sender: 'sender-address',
    receiver: 'receiver-address',
    amount: 100,
    denom: 'USYQ',
    privateKey: 'your-private-key',
    flags: '1',
    data_type: 'data',
    data: {
      key: 'value',
    },
    metadata: {
      key: 'value',
    },
    model_type: 'default_model',
  });
  console.log(transactionResponse);
}

createTransaction();

Get a Transaction by Hash

Retrieve transaction details using its hash:

async function getTransaction() {
  const transaction = await client.transaction.getTransactionByHash({
    hash: 'transaction-hash',
  });
  console.log(transaction);
}

getTransaction();

Governance

Submit a Proposal

Submit a new proposal for voting:

async function submitProposal() {
  const proposalResponse = await client.governance.submitProposal({
    proposer: 'proposer-address',
    parameters: { some: 'parameter' },
    description: 'Proposal description',
    votingDeadline: '2024-12-31T23:59:59Z',
  });
  console.log(proposalResponse);
}

submitProposal();

Vote on a Proposal

Cast a vote on an existing proposal:

async function voteOnProposal() {
  const voteResponse = await client.governance.voteOnProposal({
    nodeId: 'node-address',
    proposalId: 1,
    vote: true,
  });
  console.log(voteResponse);
}

voteOnProposal();

Neural Network

Make a Prediction

Use the neural network to make a prediction based on input data:

async function makePrediction() {
  const predictionResponse = await client.neural.predict({
    modelType: 'exampleModel',
    sender: 'sender-address',
    data: { input: 'some data' },
    privateKey: 'your-private-key',
  });
  console.log(predictionResponse);
}

makePrediction();

Make a Forecast

Use the neural network to make a forecast:

async function makeForecast() {
  const forecastingResponse = await client.neural.forecast({
    modelType: 'exampleModel',
    sender: 'sender-address',
    data: { input: 'forecast data' },
    privateKey: 'your-private-key',
  });
  console.log(forecastingResponse);
}

makeForecast();

Block Management

Get Block Height

Retrieve the current block height:

async function getBlockHeight() {
  const blockHeightResponse = await client.transaction.getBlockHeight();
  console.log(blockHeightResponse);
}

getBlockHeight();

Contract Management

Execute a Contract

Execute a smart contract:

async function executeContract() {
  const executeResponse = await client.wallet.executeContract({
    walletAddress: 'wallet-address',
    contractId: 'contract-id',
    method: 'methodName',
    args: ['arg1', 'arg2'],
    privateKey: 'your-private-key',
  });
  console.log(executeResponse);
}

executeContract();

Deploy a Contract

Deploy a new smart contract:

async function deployContract() {
  const deployResponse = await client.wallet.deployContract({
    walletAddress: 'wallet-address',
    contractBase64: 'base64EncodedContract',
    contractType: 'contractType',
    privateKey: 'your-private-key',
  });
  console.log(deployResponse);
}

deployContract();

Authentication

Authenticate a Wallet

Authenticate a wallet to receive a token:

async function authenticateWallet() {
  const authResponse = await client.wallet.authenticate({
    address: 'wallet-address',
    privateKey: 'your-private-key',
    message: 'authentication message',
  });
  console.log(authResponse);
}

authenticateWallet();

Verify an Authentication Token

Verify if an authentication token is still valid:

async function verifyAuthToken() {
  const verifyResponse = await client.wallet.verifyAuthToken({
    token: 'your-auth-token',
  });
  console.log(verifyResponse);
}

verifyAuthToken();

Additional Notes

  • Error Handling: Ensure you add error handling to your asynchronous functions to manage any issues that might arise during API calls.
  • Configuration: The base URL (https://rest.synnq.io) is set by default, but you can override it by providing a different URL when initializing the SDK client.

License

This project is licensed under the ISC License - see the LICENSE file for details.


Summary of Changes

  • New Sections: Added examples for querying wallet balance, getting wallets holding a specific coin, getting wallets count, contract execution, contract deployment, wallet authentication, and verifying authentication tokens.
  • Block Management: Added a section to demonstrate querying block height.
  • Consistent Formatting: Ensured that the formatting is consistent across all examples and sections.

This updated README.md provides a comprehensive guide to using the synnq-sdk package, including the newly added methods and types.