Skip to content

SheriffCarry/kirkajs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kirkajs

NPM version NPM downloads NPM downloads

npm i kirkajs

Promise-based Example Usage

// Require the NPM Module
const KirkaJSmodule = require("kirkajs");

//default url: "kirka.io"
const KirkaJS = new KirkaJSmodule();
//proxy
//const KirkaJS = new KirkaJSmodule("fpsiogame.com");

// Get the stats of the user
KirkaJS.getStats("WERWER")
  .then((data) => {
    console.log(data);
  })
  .catch(console.error);

async/await-Based Example

// Require the NPM Module
const KirkaJSmodule = require("kirkajs");

const KirkaJS = new KirkaJSmodule();

// Get the stats of the user
(async () => {
  try {
    const user = await KirkaJS.getStats("WERWER");
    console.log(user);
  } catch (error) {
    console.error(error);
  }
})();

global chat Example

// Require the NPM Module
const KirkaJSmodule = require("kirkajs");

const KirkaJS = new KirkaJSmodule();
// Opens the Kirka.io Global Chat
KirkaJS.connectWebSocket();

// Logs the Kirka.io Global Chat
KirkaJS.setOnMessageHandler((message) => {
  console.log("Received message: ", message);
});

// System for automatic reconnecting
KirkaJS.setOnCloseHandler(() => {
  KirkaJS.connectWebSocket();
});

// Closes the Kirka.io Global Chat (after 5 seconds)
setTimeout(() => {
  KirkaJS.closeWebSocket();
  console.log("CLOSED");
}, 5000);

// If you want to be able to send messages:
KirkaJS.connectWebSocket(token);
KirkaJS.sendGlobalChat("UwU");

Websocket interaction

connectWebSocket()

connectWebSocket(token);

setOnMessageHandler((message) => {})

setTrademessageHandler((message) => {})

setOnTradeAccepted((message) => {})

setOnTradeCancel((message) => {})

setOnTradeSend((message) => {})

setOnCloseHandler(() => {})

sendGlobalChat(message);

closeWebSocket()

Current functions:

user

getStats(shortId)

example: getStats(#WERWER)

getStatsLongID(longid)

example: getStatsLongID("4b10e588-c33e-42e4-8b35-3c48220be499")

getMyProfile(token)

example: getMyProfile("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOltdLCJjbGllbnRfaW")

sendFriendrequest(token, shortId) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

acceptFriendrequest(token, longid) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

declineFriendrequest(token, longid) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

removeFriend(token, longid) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

rename(token, name)

inventory

getInventory(apikey, longid)

example: getInventory("sheriff_75a7214e-", "4b10e588-c33e-42e4-8b35-3c48220be499")

getMyInventory(token)

example: getMyInventory("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOltdLCJjbGllbnRfaW")

getAllItems(apikey) {apikey is optional, but it is better to use one}

example: getAllItems("sheriff_75a7214e-")

openChest(token, itemId)

openGoldenChest(token)

openIceChest(token)

openWoodChest(token)

openCharacterCard(token, itemId)

openColdCharacterCard(token)

openGirlsBandCharacterCard(token)

openPartyCharacterCard(token)

openSoldiersCharacterCard(token)

equipItem(token, itemId) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

listItem(token, itemId, price) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

quickSell(token, itemId, amount)

quickSellOne(token, itemId)

market

getMarket(token)

searchMarket(token, skin, rarity)

marketBuy(token, longid, itemId)

rewards

getRewards(token)

getAds(token)

getAdReward()

claimRewards(token)

claimAd(token)

clan

getClan(name)

example: getClan("aim")

inviteClan(token, shortId) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

getMyClan(token)

example: getMyClan("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOltdLCJjbGllbnRfaW")

updateClanDescription(token, clanId, description)

updateClanDiscordLink(token, clanId, discordLink)

acceptInvite(token, inviteId) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

declineInvite(token, inviteId) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

leaveClan(token) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

setRole(token, longid, role)

setOfficer(token, longid)

setNewbie(token, longid)

setLeader(token, longid)

clanKick(token, longid)

createClan(token, name)

notification

getNotification(token)

sawNotification(token) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

leaderboard

getSoloLeaderboard()

getClanLeaderboard()

shop

getSets()

getBundles()

storeBuy(token, id)

storeBuyset(token, id)

buyWood(token) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

buyIce(token) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

buyGolden(token) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

buyParty(token) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

buySoldiers(token) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

buyGirlsBand(token) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

buyCold(token) {returns the request Statuscode as integer, if worked. If not it should return a JSON object containing a code and Statuscode use "requestErrorCodeTranslate" to translate code to error}

quests

getAllQuests(token)

getDailyQuests(token)

getEventQuests(token)

getHourlyQuests(token)

getQuests(token, type)

conent

getVideos()

getStreams()

matchmaker

getLobbies(region)

getEULobbies()

getNALobbies()

getSALobbies()

getASIALobbies()

getOCELobbies()

getSTAGINGLobbies()

getPlayercount(region)

getEUPlayercount()

getNAPlayercount()

getSAPlayercount()

getASIAPlayercount()

getOCEPlayercount()

getSTAGINGPlayercount()

NO API FETCHES

getCharacterRender(skinname)

example: getCharacterRender("Kod") (can return: base64 string, url, null)

getLevelRewards()

pricebvl(skinname)

priceyzzzmtz(skinname)

pricecustom(skinname, namefield, pricefield, opensheeturl)

example: pricecustom("Gold", "SKIN NAME", "PRICE", "https://opensheet.elk.sh/1bD0vkBtVrOQiRHqRHisWicnoAbXShRO1ogCx3qzyH-s/Alphabetical+Order")

inventoryvaluebvl(inventory)

inventoryvalueyzzzmtz(inventory)

inventoryvaluecustom(inventory, namefield, pricefield, opensheeturl)

NO API STUFF:

requestErrorCodeTranslate(errorcode)

example: requestErrorCodeTranslate(404)

FORBIDDEN RESOURCES:

getShop(token)

reports(token)

UNKNOWN RESOURCES:

https://api.kirka.io/api/shop/token (POST) some id

https://api.kirka.io/api/notification/read (POST) some id

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published