This is a Node.js SDK project for simplifying interactions with external APIs.
To get started with this SDK, follow these steps:
- To install the SDK in your project, use npm:
npm install @noti-io/sdk-nodejs
const {
setApiKey,
createWallet,
importWallet,
deleteWallet,
getWallets,
getWallet,
deleteSnipe,
createSnipe,
getSnipeBatchById,
setSnipeApiKey,
getSnipeBatch,
} = require("@noti-io/sdk-nodejs")
Before making any requests, you need to set your Snipe API key:
setApiKey('YOUR_API_KEY');
To retrieve all snipes, use:
const snipes = await getSnipeBatch();
This will return an array of SnipeResponse objects.
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.
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.
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.
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.
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.
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.
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.
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.