@evnoti/sdk-nodejs
v1.0.4-Alpha1
Published
This is a Node.js SDK project for simplifying interactions with external APIs. ## Getting Started To get started with this SDK, follow these steps: 1. Clone this repository to your local machine. ``` git clone https://github.com/noti-io/sdk-nodejs.git ```
Downloads
1
Readme
Noti - SDK-Node
This is a Node.js SDK project for simplifying interactions with external APIs.
Getting Started
To get started with this SDK, follow these steps:
- Clone this repository to your local machine.
git clone https://github.com/noti-io/sdk-nodejs.git
- Install dependencies using npm:
npm install or npm i
For Dev
npm run dev
For Build
npm run build
For Snipe Test
npm run snipeUnitTest
For Wallet Test
npm run walletUnitTest
For Usage
Installation
To install the SDK, use npm:
npm install sdk-nodejs
How to Use in Your Project
Import SDK
import {
createWallet,
importWallet,
deleteWallet,
getWallets,
setApiKey,
getWallet,
deleteSnipe,
createSnipe,
getSnipeBatchById,
setSnipeApiKey,
getSnipeBatch,
} from "sdk-nodejs"
For Snipe
Setting API Key
Before making any requests, you need to set your Snipe API key:
setSnipeApiKey('YOUR_API_KEY');
Get All Snipes
To retrieve all snipes, use:
const snipes = await getSnipeBatch();
This will return an array of SnipeResponse objects.
Get Snipes by ID
To retrieve snipes by ID, use:
const snipesById = await getSnipeBatchById('BATCH_ID');
Replace 'BATCH_ID' with the desired batch ID. This will return an array of SnipeResponse objects.
Create Snipe
To create a new snipe, use:
const newSnipe = await createSnipe({
token: 'TOKEN',
amount: 'AMOUNT',
boost: 'BOOST'
});
Replace 'TOKEN', 'AMOUNT', and 'BOOST' with the desired values. This will return a CreateSnipeResponse object.
Delete Snipe
To delete a snipe, use:
const deletedSnipe = await deleteSnipe('BATCH_ID');
Replace 'BATCH_ID' with the ID of the snipe to be deleted. This will return a SnipeResponse object.
For Wallet
Setting API Key
Before making any requests, you need to set your Wallet API key:
setApiKey('YOUR_API_KEY');
This initializes the API request instance with the provided API key.
Create Wallet
To create new wallets, use:
const walletNames = ['wallet1', 'wallet2'];
const wallets = await createWallet(walletNames);
This will create new wallets with the given names and return an array of Wallet objects containing the address and privateKey for each wallet.
Import Wallet
To import existing wallets, use:
const walletsToImport = [
{ name: 'wallet1', privateKey: 'PRIVATE_KEY1' },
{ name: 'wallet2', privateKey: 'PRIVATE_KEY2' }
];
const importedWallets = await importWallet(walletsToImport);
This will import the provided wallets and return an array of Wallet objects.
Get All Wallets
To retrieve all wallets, use:
const wallets = await getWallets();
This will return an array of Wallet objects containing the address and privateKey for each wallet.
Get Wallet by ID
To retrieve a wallet by its ID, use:
const wallet = await getWallet('WALLET_ID');
Replace 'WALLET_ID' with the desired wallet ID. This will return a Wallet object.
Delete Wallet
To delete a wallet by its ID, use:
const deletedWallet = await deleteWallet('WALLET_ID');
Replace 'WALLET_ID' with the ID of the wallet to be deleted. This will return the deleted Wallet object.