Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

king-coin-api

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

king-coin-api - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

21

index.js
const { post } = require('axios')
const url = 'https://kcbot.ru/server/api/'
exports.KingCoinApi = class {
constructor({ token } = {}) {
constructor({token} = this) {
this.token = token
}
callApi(data = {}) {
return post(url, data).then(data => data?.data).catch((err) => err)
callApi(data, token = this.token) {
return post("https://kcbot.ru/server/api/", {token, ...data}).then(({data}) => data)
}
getMyBalance({ action = 'myBalance', token = this.token } = {}) {
return this.callApi({ action, token })
getMyBalance(action = 'myBalance') {
return this.callApi({ action })
}
getUserBalance({ action = 'balance', token = this.token, user_ids = this.user_ids } = {}) {
return this.callApi({ action, token, user_ids })
getUserBalance({action = 'balance', user_ids = this.user_ids} = this) {
return this.callApi({ action, user_ids })
}
getHistory({ action = 'tx', token = this.token, filter = this.filter, count = this.count, offset = this.offset } = {}) {
getHistory({ action = 'tx', filter = this.filter, count = this.count, offset = this.offset } = this) {
return this.callApi({
action,
token,
filter: !filter ? 'ALL' : filter,

@@ -30,6 +28,5 @@ count: !count ? 20 : count,

sendCoins({ action = 'transfer', token = this.token, receiver = this.receiver, amount = this.amount, payload = this.payload } = {}) {
sendCoins({action = 'transfer', receiver = this.receiver, amount = this.amount, payload = this.payload} = this) {
return this.callApi({
action,
token,
receiver,

@@ -36,0 +33,0 @@ amount,

{
"name": "king-coin-api",
"version": "1.0.4",
"version": "1.0.5",
"description": "Модуль для удобного использования KingCoin API",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc