100HP
  1. Implementation Guide
100HP
  • 100HP API for partners v2.9.1
    • General
      • Overview
      • FAQ
        • Rollback and billing resolver general flow
        • HTTP status codes and custom error codes
        • IP Whitelisting
    • Integration
      • Preparation for integration
      • General API provision
    • 100HP Gaming API
      • Game list
      • Launch game url
      • Video replay
    • 100HP Game flow API
      • Player authorization
      • Get balance
      • Withdrawal money
      • Deposit money
      • Rollback money
    • Implementation Guide
      • YourCasino.js
      • Casino.js
      • TestCasino.js
      • DDL-example
        • mongodb.js
        • mysql.js
        • postgres.js
    • Testing
      • Automated Test Service
    • API INFO
      • API Changelog
  1. Implementation Guide

YourCasino.js

import Casino from './Casino.js';

export default class YourCasino extends Casino {

  // -------------------------
  // Core Methods
  // -------------------------

  /**
     * Retrieve session information.
     * @param {string} sessionId
     * @returns {Promise<{userId: string, currency: string}>}
     */
  static async getSession(sessionId) {
    // TODO: implement logic
    throw new Error('getSession not implemented');
  }

  /**
     * Retrieve user information.
     * @param {string} userId
     * @returns {Promise<{userName: string, status: "active"|"blocked", type: "real"|"test", segment: string[]}>}
     */
  static async getUser(userId) {
    // TODO: implement logic
    throw new Error('getUser not implemented');
  }

  /**
     * Retrieve user balance.
     * @param {string} userId
     * @param {string} currency
     * @returns {Promise<{balance: string}>}
     */
  static async getBalance(userId, currency) {
    // TODO: implement logic
    throw new Error('getBalance not implemented');
  }

  // -------------------------
  // Transaction Methods (ACID)
  // -------------------------

  /**
     * Withdraw funds from user balance.
     * @param {string} userId
     * @param {string} currency
     * @param {string} amount
     * @param {string} txId
     * @returns {Promise<{balance: string}>}
     */
  static async makeWithdrawal(userId, currency, amount, txId) {
    // TODO: implement logic and modify balance
    throw new Error('makeWithdrawal not implemented');
  }

  /**
     * Deposit funds to user balance.
     * @param {string} userId
     * @param {string} currency
     * @param {string} amount
     * @param {string} txId
     * @returns {Promise<{balance: string}>}
     */
  static async makeDeposit(userId, currency, amount, txId) {
    // TODO: implement logic and modify balance
    throw new Error('makeDeposit not implemented');
  }

  /**
     * Deposit funds with a promotion applied.
     * @param {string} userId
     * @param {string} currency
     * @param {string} amount
     * @param {string} txId
     * @param {string} promoId
     * @returns {Promise<{balance: string}>}
     */
  static async makeDepositWithPromo(userId, currency, amount, txId, promoId) {
    // TODO: implement logic and modify balance
    throw new Error('makeDepositWithPromo not implemented');
  }

  /**
     * Rollback a previous transaction.
     * @param {string} userId
     * @param {string} txId
     * @returns {Promise<{balance: string}>}
     */
  static async makeRollback(userId, txId) {
    // TODO: implement logic and modify balance
    throw new Error('makeRollback not implemented');
  }

  // -------------------------
  // Utility Methods
  // -------------------------

  /**
     * Check liveness of your service or DB.
     * @returns {Promise<boolean>}
     */
  static async liveness() {
    // TODO: implement DB or service check
    throw new Error('liveness not implemented');
  }
}
Modified at 2026-01-28 13:44:15
Previous
Implementation Guide
Next
Casino.js
Built with