Node Primedice
Node.js library for accessing Primedice's API
Instalation
Install with the Node.js package manager npm:
npm install --save primedice
API
Primedice(accessToken:String)
Initialize a new Primedice
with the given accessToken
Example:
var Primedice = ;var accessToken = 'abc123'; var client1 = accessToken; //Can only execute operations that doesn't require authenticationvar client2 = ;
Primedice.users(userName:String, callback:Function)
Get your own info or a user's info with the given username
Examples:
userName's info
Primedice;
Your own info
Primedice;
Primedice.deposit(callback:Function)
Get your deposit address
Example:
Primedice;
Primedice.deposits(callback:Function)
Get your deposits
Example:
Primedice;
Primedice.withdraw(amount:Number, address:String, callback:Function)
Withdraw an amount
Example:
//withdraw 100000 (10000 is the transaction fee) Primedice;
Primedice.withdrawals(callback:Function)
Get your withdrawals
Example:
Primedice;
Primedice.bet(amount:Number, target:Number, condition:String, callback:Function)
Make a bet
Example:
//for a bet of 0.00000010 with 2x Payout (Roll under 49.5 to win) Primedice;
Primedice.seed(seed:String, callback:Function)
Change your seed
Example:
Primedice;
Primedice.mybets(callback:Function)
Get your last 30 bets
Example:
Primedice;
Primedice.bets(BetID:Number, callback:Function)
Get last 30 bets of the site or lookup a bet id
Examples:
30 bets of the site
Primedice;
lookup a bet id
Primedice;
Primedice.send(room:String, message:String, toUsername:String, callback:Function)
Send a message to a chat room or a PM to a specific user
Examples:
Send a message to the english chat room
Primedice;
Send a message to user Visions
Primedice;
Primedice.rooms(callback:Function)
Get list of rooms
Example:
Primedice;
Primedice.messages(room:String, callback:Function)
Get chat messages from a room
Examples:
No room (defaults to English room)
Primedice;
Specific room
Primedice;
Primedice.allmessages(callback:Function)
Get chat messages from all available rooms
Example:
Primedice;
License
MIT