0.0.5 • Published 9 months ago

bitskins-v2-api v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Bitskins Wrapper

Installation

  $ npm install bitskins-v2-api

API Usage Example

In order to use API coverage through this SDK, one needs to create an instace of BitskinsApiV2, after that API requests are made by simply calling the methods on the instance. Usage example following

import { BitskinsApiV2 } from 'bitskins-v2-api';

const api = new BitskinsApiV2({ apiKey: process.env.BITSKINS_API_KEY });

// API usage example
const testApi = async () => {
  const profileData: ICurrentSession = await api.account.profile.get_current_session();

  console.log('Currently logged in with: ', profileData);
};

Socket Usage Example

In order to use socket services provided by Bitskins API v2, one needs to create an instance of BitskinsApiV2, after that connect all of the required listeners (on_connect, on_disconnect, on_auth, add_listener) and then to call instance.socket.connect() method.

Intended flow that should be set up is

  1. Connect sockets
  2. Authorize sockets
  3. Subscribe to desired channels (SocketChannel enum)

Usage example for properly connecting sockets following

import { BitskinsApiV2, ISocketChannelData, SocketChannel } from 'bitskins-v2-api';

const api = new BitskinsApiV2({ apiKey: process.env.BITSKINS_API_KEY });

// After connection call `authorize`
api.socket.on_connect(() => {
  console.log('SOCKETS OPENED');

  api.socket.authorize();
});

// React somehow to disconnect
api.socket.on_disconnect(() => {
  console.log('SOCKETS CLOSED');
});

// After authorization subscribe to desired channels (or all)
api.socket.on_auth(() => {
  console.log('USER AUTHORIZED');

  api.socket.subscribe_to_all();
});

// Add listeners for all of the channels that you'll subscribe
api.socket.add_listener(SocketChannel.listed, (data: ISocketChannelData<SocketChannel.listed>) => {
  console.log('[EVENT]: listed: ');
  console.log(data);
});

api.socket.add_listener(SocketChannel.delisted_or_sold, (data: ISocketChannelData<SocketChannel.delisted_or_sold>) => {
  console.log('[EVENT]: delisted_or_sold: ');
  console.log(data);
});

api.socket.add_listener(SocketChannel.extra_info, (data: ISocketChannelData<SocketChannel.extra_info>) => {
  console.log('[EVENT]: extra_info: ');
  console.log(data);
});

api.socket.add_listener(SocketChannel.price_changed, (data: ISocketChannelData<SocketChannel.price_changed>) => {
  console.log('[EVENT]: price_changed: ');
  console.log(data);
});

// After connecting all handlers, call `connect`
api.socket.connect();

Features complete coverage of the Bitskins API in its entirety.

A comprehensive and exhaustive encompassment of every function and capability offered by the Bitskins API

API

In order to initiate a call, the prerequisite is to instantiate the Bitskins.API class by providing your Bitskins API key.

For a deeper insight, refer to the documentation offered by the Bitskins API.

Each call issued yields a promise containing the data sourced from the response. If, however, an issue arises during the request formation or the response status from Bitskins deviates from the expected "success," the promise will undergo rejection.

For a comprehensive illustration, refer to the contents within the examples directory.

Account

Affiliate

get_affiliate_info()\ Allows you to retrive information about your profile at Bitskins\ Bitskins docs

claim_money()\ Allows you to claim available money\ Bitskins docs

list_historical_rewards({ limit?: number, offset?: number })\ Gives you the award history\ Bitskins docs

set_or_change_affiliate_code({ code: string })\ Allows you to set or change your affiliate code\ Bitskins docs

API Access

create_api_key()\ Create API key, so you will be able to use it in next requests instead of token. Keep it safe!\ Bitskins docs

disable_api_key()\ Revoke current API key.\ Bitskins docs

Profile

get_current_session()\ Get current session information.\ Bitskins docs

get_account_balance()\ Get account balance.\ Bitskins docs

update_account({ set: { o_settings?: number, o_notify?: number, store_alias?: string, currency?: Currency, language?: Language }})\ Update account information app settings, notifications, store, currency, language, etc.\ Bitskins docs

update_trade_link({ tradelink: string })\ Update steam trade link. You can get it here: https://steamcommunity.com/my/tradeoffers/privacy#trade_offer_access_url\ Bitskins docs

block_my_account({ steam_token: string})\ If you believe that your account has been compromised you can temporarily block it. We will unblock your account after contacting our support. Bitskins docs

2FA

create_twofa_code()\ In response you will get twofa_secret, you can use to generate 2FA codes.\ Bitskins docs

verify_twofa_code({ email_code: string, twofa_code: string})\ Verifies 2FA code\ Bitskins docs

disable_twofa_code({ twoda_code: string })\ Dissable 2FA\ Bitskins docs

verify_disabling_twfa_code({ email_code: string })\ Verifies disabling 2FA code\ Bitskins docs

lock_twofa()\ Lock account, so it will need to enter 2FA code to make requests.\ Bitskins docs

unlock_twofa({ twofa_code: string })\ Unlock account with 2FA code.\ Bitskins docs

Config

get_currency_rates()\ Get fiat and crypto rates on the platform. Fiat rates are used for provisional preview only. All in-platform transactions are calculated in USD. Crypto currencies are used as based rates for depositing and withdrawing.\ Bitskins docs

get_fee_plans()\ Get available sale fee plans.\ Bitskins docs

get_platform_status()\ Get platform status\ Bitskins docs

Market

Pricing

get_sales({ app_id: AppId, skin_id: number, date_from?: string, date_to?: string})\ Get latest sales for item.\ Bitskins docs

get_pricing_summary({ app_id: AppId, skin_id: number, date: string, price_min: number, price_max: number, price_avg: number, counter: number})\ Get sales stats for item, can be filtered by date.\ Bitskins docs

Market Items

search_tf2({limit?: number, offset?: number; order?: SearchTF2Field[], where_mine?: IWhereMine, where?: ISearchRF2Where})\ Search for items on the TF2 market.\ Bitskins docs

search_dota2({ limit?: number, offset?: number, order?: SearchDota2Field[], where_mine?: IWhereMine, where?: ISearchDota2Where})\ Search for items on the Dota 2 market.\ Bitskins docs

search_csgo({ limit?: number, offset?: number, order?: SearchCSGOField[]})\ Search for items on the CS:GO market.\ Bitskins docs

search_rust({ limit?: number, offset?: number, order?: SearchRustField[], where_mine?: IWhereMine, where?: ISearchRustWhere})\ Search for items on the Rust market.\ Bitskins docs

search_store({ store_alias: string, store_hash?: string })\ Get amount of items in the user store.\ Bitskins docs

get_item_details({ app_id, id?: string, asset_id?: string, hash?: string })\ Get item details of single item.\ Bitskins docs

search_skin({ where: ISearchSkinWhere, limit?: number })\ Search for item skins in game\ Bitskins docs

get_filters({ app_id: AppId })\ Get available items filters for game.\ Bitskins docs

Buy Item

buy_single_item({ app_id?: AppId, id: string, max_price: number, hash?: string })\ Buy item\ Bitskins docs

buy_multiple_items({ app_id?: AppId, items: IBuyItemPayload[] })\ Buy multiple items\ Bitskins docs

buy_bulk_items({ app_id?: AppId, skin_id: number, max_price: number, quantity: number })\ Buy multiple items at once. You will buy items based on specified quantity and max price.\ Bitskins docs

Withdraw

withdraw_single_item({ app_id: AppId, id: string, external?: { steam_id: string, steam_token: string }})\ Withdraw item from BitSkins inventory to your Steam account. Steam trade will be created.\ Bitskins docs

withdraw_multiple_items({ items: { id: string, success: boolean }[] })\ Withdraw multiple items from BitSkins inventory to your Steam account. Steam trades will be created.\ Bitskins docs

Delist

delist_single_item({ app_id: AppId, id: string })\ Delist item from market. Item will be moved to BitSkins inventory.\ Bitskins docs

delist_multiple_items({ items: { id: string, success: boolean }[] })\ Delist multiple items from market. Items will be moved to BitSkins inventory.\ Bitskins docs

Relist

relist_single_item({ app_id: AppId, id: string, price: number, type: DepositStatus })\ Relist single item from BitSkins inventory to market.\ Bitskins docs

relist_multiple_item({ items: { id: string, success: boolean }[] })\ Relist multiple items from BitSkins inventory to market.\ Bitskins docs

Update price

update_single_item_price({ app_id: AppId, id: string, price: number })\ Update single item price on market.\ Bitskins docs

update_multiple_items_prices({ items: { id: string, success: boolean }[] })\ Update multiple items on market.\ Bitskins docs

Items History

get_items_history({ type: MarketHistoryStatus, limit?: number, offset?: number, order?: { field: ItemHistoryField, order: Order }[],where?: { app_id?: AppId, skin_id?: number, price_from?: number, price_to?: number } })\ Get history of bought and sold items.\ Bitskins docs

get_item_history({ type: MarketHistoryStatus, id: string })\ Get history of bought and sold specific item.\ Bitskins docs

Receipt

get_receipt({ app_id: AppId, id: string })\ Get receipt for bought items.\ Bitskins docs

Bump UP

bump_single_item({ app_id: AppId, id: string })\ Bump up item to make it visible on first place to all users.\ Bitskins docs

get_bumped_items({ app_id: AppId })\ Get list of bumped items\ Bitskins docs

enable_bumping({ app_id: AppId, id: string, period: AutoBumpPeriod, quantity: number, delayed: number })\ Enable bumbing\ Bitskins docs

disable_bumping({ app_id: AppId, id: string })\ Disable bumping\ Bitskins docs

buy_bumps_package({ id: string })\ Buy bump packages\ Bitskins docs

All available skins

get_all_tf2_skins({ id: number, name: string, class_id: string, suggested_price?: number })\ Get list of all skins\ Bitskins docs

get_all_dota2_skins({ id: number, name: string, class_id: string, suggested_price?: number })\ Get list of all Dota2 skins\ Bitskins docs

get_all_CSGO_skins({ id: number, name: string, class_id: string, suggested_price?: number })\ Get list of all CSGO skins\ Bitskins docs

get_all_rust_skins({ id: number, name: string, class_id: string, suggested_price?: number })\ Get list of all Rust skins\ Bitskins docs

All insell items

get_list_of_items_in_sell_for_tf2()\ Get list of all items in sell for TF2\ Bitskins docs

get_list_of_items_in_sell_for_dota2()\ Get list of all items in sell for Dota 2\ Bitskins docs

get_list_of_items_in_sell_for_csgo()\ Get list of all items in sell for CSGO\ Bitskins docs

get_list_of_items_in_sell_for_rust()\ Get list of all items in sell for Rust\ Bitskins docs

Steam

Steam Inventory

get_steam_inventory({ app_id: AppId })\ Get list of items in your Steam inventory.\ Bitskins docs

Steam deposit

deposit_steam_items({ app_id: AppId, items: { asset_id: string, price: number }[] })\ Deposit Steam item and list it on BitSkins market. Steam trade will be created.\ Bitskins docs

Steam trades

get_steam_trades({ limit?: number, offset?: number, where?: { tradeofferid?: string, app_id?: AppId, type?: SteamTradesType, hash?: string[] } })\ Get all steam trades\ Bitskins docs

get_active_steam_trades({ limit?: number, offset?: number, where?: { tradeofferid?: string, app_id?: AppId, type?: SteamTradesType, hash?: string[] } })\ Get active steam trades\ Bitskins docs

get_hashes_of_active_steam_trades()\ Get hashes of all active steam trades\ Bitskins docs

Wallet

Stats

get_wallet_stats()\ Get wallet statistics\ Bitskins docs

get_kyc_limits()\ Get KYC limits\ Bitskins docs

Wallet transactions

get_wallet_transactions({ limit?: number, offset?: number, order?: { field: WalletTransactionsField, order: Order }, where?: { amount_from?: number, amount_to?: number, date_from?: string, date_to?: string, date?: string, service_id?: WalletTransactionsServiceId } })\ Get wallet transactions\ Bitskins docs

get_wallet_pending_transactions({ limit?: number, offset?: number, order?: { field: WalletTransactionsField, order: Order }, where?: { amount_from?: number, amount_to?: number, date_from?: string, date_to?: string, date?: string, service_id?: WalletTransactionsServiceId } })\ Get list of your pending transactions\ Bitskins docs

Wallet reports

get_wallet_reports({ limit?: number, offset?: number, order?: { field: WalletReportsOrderType, order: Order }, where?: { type?: ReportType, status?: ReportStatus } })\ Get all your reports\ Bitskins docs

generate_wallet_report({ type: ReportType, date: string })\ Generate new report\ Bitskins docs

download_wallet_report({ id: number })\ Download report\ Bitskins docs

Wallet deposit

Binance

deposit_binance({ amount: number })\ Deposit binance\ Bitskins docs

Cryptocurrency

get_crypto_addresses()\ Get cryptocurrency addresses\ Bitskins docs

get_ltc_address({ type: CryptoDepositType })\ Get Litecoin addresses\ Bitskins docs

get_btc_address({ type: CryptoDepositType })\ Get bitcoin addresses\ Bitskins docs

get_eth_address()\ Get Etherium addresses\ Bitskins docs

Gift code

use_gift_code({ code: string })\ Use gift code\ Bitskins docs

get_used_gift_codes()\ Get list of used gift codes\ Bitskins docs

Zen

deposit_zen({ amount: number })\ Deposit via zen\ Bitskins docs

Card

add_card({ amount: number, card: ICardInfo, billing_address: { country: string, city: string, addr_line_1: string, addr_line_2: string, zip: string } })\ Add credit card\ Bitskins docs

list_cards()\ Get list of your credit cards Bitskins docs

deposit_card({ card_id: number, amount: number, security_code: string })\ Deposit money on BitSkins via card saved on BitSkins.\ Bitskins docs

Wallet withdraw

Cryptocurrency

withdraw_bitcoin({ twofa_code: string, amount: number, address: string })\ Withdraw bitcoin\ Bitskins docs

withdraw_litecoin({ twofa_code: string, amount: number, address: string })\ Withdraw litecoin\ Bitskins docs

withdraw_ethereum({ twofa_code: string, amount: number, address: string })\ Withdraw etherium\ Bitskins docs

Binance

withdraw_binance({ twoda_code: string, amount: number, receiver: string, receiver_type: WithdrawBinanceReceiverType })\ Withdraw funds to your Binance account, using BinanceID.\ Bitskins docs

Visa

withdraw_visa({ card_id: number, amount: number, security_code: string, twofa_code: string})\ Withdraw funds to your Visa card.\ Bitskins docs

P2P

transfer_to_p2p({ amount: number })\ Transfer funds to your account with same Steam ID on P2P market\ Bitskins docs

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago