@noti-io/sdk-nodejs
v1.0.23
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. To install the SDK in your project, use npm:
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:
- To install the SDK in your project, use npm:
npm install @noti-io/sdk-nodejs
For Usage
How to Use in Your Project
Import SDK
const {
setApiKey,
createWallet,
importWallet,
deleteWallet,
getWallets,
getWallet,
deleteSnipe,
createSnipe,
getSnipeBatchById,
setSnipeApiKey,
getSnipeBatch,
} = require("@noti-io/sdk-nodejs")
Api Key
Setting API Key
Before making any requests, you need to set your Snipe API key:
setApiKey('YOUR_API_KEY');
For Snipe
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
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.