rugplay
v1.0.1
Published
API Wrapper for the Currently Available RugPlay Endpoints
Readme
RugPlay
API Wrapper for the rugplay API
Installation
npm install rugplayUsage
const RugPlayClient = require('rugplay');
const client = new RugPlayClient('rgpl_your_api_key');
// Get top 50 coins
client.getTopCoins().then(console.log).catch(console.error);
// Get market data
client.getMarketData({ search: 'TEST', sortBy: 'marketCap', sortOrder: 'desc' })
.then(console.log)
.catch(console.error);
// Get coin details
client.getCoinDetails('TEST', '1h').then(console.log).catch(console.error);
// Get coin holders
client.getCoinHolders('TEST', 100).then(console.log).catch(console.error);
// Get prediction markets (hopium)
client.getHopium({ status: 'ACTIVE', page: 1, limit: 20 })
.then(console.log)
.catch(console.error);
// Get prediction market details
client.getHopiumDetails(101).then(console.log).catch(console.error);Error Handling
Errors from the RugPlay API are returned with descriptive messages, for example:
RugPlay API Responded with 429 - You are being rate limitedRugPlay API Responded with 401 - Unauthorized (invalid or missing API key)
Endpoints
getTopCoins()— Top 50 coins by market capgetMarketData(params)— Paginated market data (see API docs for params)getCoinDetails(symbol, timeframe)— Details for a specific coingetCoinHolders(symbol, limit)— Top holders for a coingetHopium(params)— Prediction marketsgetHopiumDetails(questionId)— Prediction market details
See RugPlay API Documentation for more details.
