NodeJS API client for Hermes
npm install @hermes-core/api-client-
Clone or download this repository.
-
Install dependencies:
npm install- Create a
.envfile in the root directory with the required environment variables:
API_URL=your_api_url_here
SOCKET_URL=your_socket_url_here
API_KEY=your_api_key_here
Import and initialize the client in your Node.js application:
import { createHermesClient } from '@hermes-core/api-client';
const client = createHermesClient({
apiUrl: 'https://placeholder.com',
socketUrl: 'https://placeholder.com',
apiKey: 'YOUR_API_KEY',
});
// Example: Fetch private wallets
const wallets = await client.private.getWallets();
console.log(wallets);
// Example: Send a tip
const tipResult = await client.private.tip({
ticker: 'RUNES',
recipientIds: ['user_id_1', 'user_id_2'],
amountPerRecipient: '0.001',
notifyChannelId: 'channel_id' // Optional
});
console.log(tipResult);import { createHermesClient } from './index.mjs'; // Adjust path as needed
const client = createHermesClient(); // Automatically uses process.env for config
// Example: Fetch private wallets
const wallets = await client.private.getWallets();
console.log(wallets);
// Example: Send a tip
const tipResult = await client.private.tip({
ticker: 'RUNES',
recipientIds: ['user_id_1', 'user_id_2'],
amountPerRecipient: '0.001',
notifyChannelId: 'channel_id' // Optional
});
console.log(tipResult);Refer to the source code (index.mjs) for full API methods, including public endpoints, guild operations, reactdrops, and socket events.
# Run all tests
node src/test-integration.mjs
# Run specific tests (comma-separated flags)
node src/test-integration.mjs --wallets --tip --sockets
# Run a single test
node src/test-integration.mjs --guild-tip