1.1.0 • Published 2 years ago

coolbux-wrapper v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

CoolBux API Wrapper

A Promise-based CoolBux API Wrapper for NodeJS. Please contact saipeaks#8059 for bugs. Will make a documentation for CoolBuxUser and GiveawayClient soon.

Site Link

Table of Contents

Installation

Using npm:

$ npm install coolbux-wrapper

How to Use

Import the Module:

// Requires the CoolBux Wrapper Module.
const Module = require('coolbux-wrapper')

Create a new APIWrapper Instance:

// Creates a new Wrapper Instance.
const Wrapper = new Module.APIWrapper()

Create a new CoolBuxUser Instance:

// Creates a new CoolBuxUser Instance with the username "ROBLOX".
const User = new Module.CoolBuxUser({user: 'ROBLOX'})

Examples

/* !! This module uses JavaScript Promises. !! */

// There are many functions on this wrapper, one of which is the information function:
Wrapper.information({user: User}) // Gets the information of a CoolBux User.
    .then(console.log)
    .catch(console.error)

// Some may require your account pin, for example:
var User = new CoolBuxUser({ user: "ROBLOX", pin: "examplepin" })

Wrapper.validate({user: User}) // Checks if the pin "examplepin" is valid.
    .then(console.log)
    .catch(console.error)

// Some may require two CoolBuxUser Instances, for example:
var User = new CoolBuxUser({ user: "ROBLOX" })
var Referrer = new CoolBuxUser({ user: "builderman" })

Wrapper.register({ user: User, referrer: Referrer}) // Registers the User account with the referral of Referrer.
    .then(console.log)
    .catch(console.error)

// And some may require BTC/LTC wallet addresses, for example:
var User = new CoolBuxUser({ user: "ROBLOX", btcwallet: "examplebtcaddress", ltcwallet: "exampleltcaddress" })
Wrapper.payout({ user: User, method: 'btc', amount: 250 })
Wrapper.payout({ user: User, method: 'ltc', amount: 250 })

Documentation

NOTE: All these functions return raw JSON data from the official CoolBux API.

Wrapper.claim({ user, type })

// Claims the free rewards
var user = new CoolBuxUser({user: "ROBLOX"})
Wrapper.claim({ user, type: "yt" }).then(json => {/* ... */})
OptionTypeDefaultRequiredDescription
userObject (CoolBuxUser)NoneUser to perform action
typestring'yt'Type of reward to redeem (yt, dc).

Wrapper.headshot({ user })

// Gets the ROBLOX profile picture
var user = new CoolBuxUser({user: "ROBLOX"})
Wrapper.headshot({ user }).then(json => {/* ... */})
OptionTypeDefaultRequiredDescription
userObject (CoolBuxUser)NoneUser to perform action

Wrapper.history({ user })

// Gets the CoolBux history
var user = new CoolBuxUser({user: "ROBLOX"})
Wrapper.history({ user }).then(json => {/* ... */})
OptionTypeDefaultRequiredDescription
userObject (CoolBuxUser)NoneUser to perform action

Wrapper.information({ user })

// Gets the information
var user = new CoolBuxUser({user: "ROBLOX"})
Wrapper.information({ user }).then(json => {/* ... */})
OptionTypeDefaultRequiredDescription
userObject (CoolBuxUser)NoneUser to perform action

Wrapper.offers({ user })

// Gets the offer balance
var user = new CoolBuxUser({user: "ROBLOX"})
Wrapper.offers({ user }).then(json => {/* ... */})
OptionTypeDefaultRequiredDescription
userObject (CoolBuxUser)NoneUser to perform action

Wrapper.payout({ user })

// Pays out the ROBUX
var user = new CoolBuxUser({user: "ROBLOX"})
Wrapper.payout({ user, method: 'rbx', amount: 100, force_v2: true}).then(json => {/* ... */})
OptionTypeDefaultRequiredDescription
userObject (CoolBuxUser)NoneUser to perform action
methodstring'rbx'Method of Payout (rbx, btc, ltc, gift, toy)
amountnumber10Amount to pay out
force_v2booleanfalseWhether to use V2 API in ROBUX payouts

Wrapper.redeem({ user, code })

// Redeems a Promocode
var user = new CoolBuxUser({user: "ROBLOX"})
Wrapper.redeem({ user, code: "examplecode" }).then(json => {/* ... */})
OptionTypeDefaultRequiredDescription
userObject (CoolBuxUser)NoneUser to perform action
codestringNonePromocode to redeem

Wrapper.referrals({ user })

// Gets the referral statistics
var user = new CoolBuxUser({user: "ROBLOX"})
Wrapper.referrals({ user }).then(json => {/* ... */})
OptionTypeDefaultRequiredDescription
userObject (CoolBuxUser)NoneUser to perform action

Wrapper.register({ user, referrer})

// Registers an account (with optional referrer)
var user = new CoolBuxUser({user: "ROBLOX"})
var referrer = new CoolBuxUser({user: "builderman"})
Wrapper.register({ user, referrer }).then(json => {/* ... */})
OptionTypeDefaultRequiredDescription
userObject (CoolBuxUser)NoneUser to perform action
referrerObject (CoolBuxUser)NoneReferrer to user

Wrapper.validate({ user })

// Validates the PIN of User
var user = new CoolBuxUser({user: "ROBLOX", pin: "examplepin"})
Wrapper.validate({ user }).then(json => {/* ... */})
OptionTypeDefaultRequiredDescription
userObject (CoolBuxUser)NoneUser to perform action

Wrapper.vip({ user })

// Gets the VIP Payout Place
var user = new CoolBuxUser({user: "ROBLOX"})
Wrapper.vip({ user }).then(json => {/* ... */})
OptionTypeDefaultRequiredDescription
userObject (CoolBuxUser)NoneUser to perform action
1.1.0

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago