npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@opexa/portal-sdk

v0.0.141

Published

A library that provides a set of functions to interact with Opexa Portal API.

Downloads

3,054

Readme

Opexa Portal SDK

A library that provides a set of functions to interact with Opexa Portal API.

Installation

npm install @opexa/portal-sdk

Usage

  • Create sdk instance
// lib/sdk.js
import Sdk from '@opexa/portal-sdk';

export const sdk = new Sdk({
  platform: 'Z892',
  environment: 'development',
});
  • Use sdk instance
import { sdk } from '$lib/sdk';
import * as React from 'react';

function Page() {
  const [account, setAccount] = React.useState();

  React.useEffect(function () {
    sdk.account().then(setAccount);
  }, []);

  return (
    <pre>
      <code>{JSON.stringify(account, null, 2)}</code>
    </pre>
  );
}

API

Sdk

Sdk accepts the following options:

  • *site - The site ID to be used
  • *sitePlatform - The site platform ID to be used
  • *platform - The platform code to be used
  • *environment - Whether to use production/development api

, and returns the following methods:

  • signIn - Start user session

    signIn(input: SignInInput): Promise<SignInReturn>
    type SignInInput =
      | {
          type: 'NAME_AND_PASSWORD';
          name: string;
          password: string;
        }
      | {
          type: 'MOBILE_NUMBER';
          mobileNumber: string;
          verificationCode: string;
        };
    
    type SignInReturn =
      | {
          ok: true;
        }
      | {
          ok: false;
          error:
            | HttpError
            | {
                name: 'AccountNotFound';
                message: string;
              };
        };
  • signOut - End current user session

    signOut(): Promise<void>
  • site - Retrieve site details

    site(): Promise<SiteReturn>
    interface Site {
      id: string;
      name: string;
      logo?: string;
    }
    type SiteReturn =
      | {
          ok: true;
          data: Site;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • platform - Retrieve current platform details

    platform(): Promise<PlatformReturn>
    interface Platform {
      paymentSettings: {
        minimumFirstDepositAmount?: number;
        restrictWithdrawalsToVerifiedMembers: boolean;
        depositGateway: {
          bank: GatewaySettings;
          gcash: GatewaySettings;
          maya: GatewaySettings;
          mayaApp: GatewaySettings;
        };
        withdrawalGateway: {
          bank: GatewaySettings;
          gcash: GatewaySettings;
          maya: GatewaySettings;
          mayaApp: GatewaySettings;
        };
      };
      pointsClubSettings: {
        multiplier: number;
      };
    }
    
    type PlatformReturn =
      | {
          ok: true;
          data: Platform;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • account - Retrieve current user's details

    account(): Promise<AccountReturn>
    interface Account {
      id: string;
      name: string;
      status: MemberAccountStatus;
      realName?: string;
      nickName?: string;
      dateOfBirth?: Date;
      validId?: string;
      emailAddress?: string;
      mobileNumber?: string;
      verified: boolean;
      verificationStatus: MemberAccountVerificationStatus;
      mobileNumberVerified: boolean;
      mobileNumberVerificationRequired: boolean;
      transactionPassword: boolean;
      dateTimeLastActive?: Date;
      dateTimeCreated: Date;
      dateTimeLastUpdated: Date;
    }
    
    type AccountReturn =
      | {
          ok: true;
          data: Account;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • createAccount - Create new user account

    createAccount(input: CreateAccountInput): Promise<CreateAccountReturn>
    interface CreateAccountInput {
      id?: string;
      name: string;
      password: string;
      mobileNumber: string;
      dateOfBirth: string;
      btag?: string;
      domain?: string;
      referralCode?: string;
      verificationCode?: string;
      reCAPTCHAResponse?: string;
    }
    
    type CreateAccountReturn =
      | {
          ok: true;
          error?: never;
          data: {
            id: string;
          };
        }
      | {
          ok: false;
          data?: never;
          error:
            | HttpError
            | {
                name:
                  | 'AccountNameNotAvailableError'
                  | 'InvalidPlatformError'
                  | 'InvalidReCAPTCHAResponseError'
                  | 'InvalidSMSVerificationCodeError'
                  | 'MinimumAgeRequirementError'
                  | 'MobileNumberNotAvailableError';
                message: string;
              };
        };
  • updateAccount - Update current user's details

    updateAccount(input: UpdateAccountInput): Promise<UpdateAccountReturn>
    type UpdateAccountReturn =
      | {
          ok: true;
          data?: never;
          error?: never;
        }
      | {
          ok: false;
          data?: never;
          error: {
            name:
              | 'AccountNameNotAvailableError'
              | 'EmailAddressNotAvailableError'
              | 'InvalidTransactionPasswordError'
              | 'MobileNumberNotAvailableError'
              | 'NickNameNotAvailableError'
              | 'RealNameAlreadySetError'
              | 'ValidIdAlreadySetError';
            message: string;
          };
        };
  • deleteAccount - Delete current user's account

    deleteAccount(id: string): Promise<DeleteAccountReturn>
    type DeleteAccountReturn =
      | {
          ok: true;
        }
      | {
          ok: false;
          error: UnknownError | HttpError;
        };
  • resetPassword - Reset user's password

    resetPassword(input: ResetPasswordInput): Promise<ResetPasswordReturn>
    interface ResetPasswordInput {
      mobileNumber: string;
      newPassword: string;
      verificationCode: string;
    }
    
    type ResetPasswordReturn =
      | {
          ok: true;
        }
      | {
          ok: false;
          error:
            | HttpError
            | {
                name: 'AccountNotFoundError' | 'InvalidVerificationCodeError';
                message: string;
              };
        };
  • verificationDetails - Retrieve user's verification details

    verificationDetails(): Promise<VerificationDetailsReturn>
    interface VerificationDetails {
      id: string;
      status: MemberVerificationStatus;
      address: string;
      sourceOfIncome: string;
      natureOfWork: string;
      nationality: string;
      placeOfBirth: string;
      idFrontImage: File;
      selfieImage: File;
    }
    
    type VerificationDetailsReturn =
      | {
          ok: true;
          data: VerificationDetails;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • submitVerificationDetails - Submit current user's verification details

    submitVerificationDetails(input: SubmitVerificationDetailsInput): Promise<SubmitVerificationDetailsReturn>
    interface SubmitVerificationDetailsInput {
      id?: string;
      idFrontImage: string;
      selfieImage: string;
      address: string;
      sourceOfIncome: string;
      natureOfWork: string;
      nationality: string;
      placeOfBirth: string;
    }
    
    type SubmitVerificationDetailsReturn =
      | {
          ok: true;
          data: {
            id: string;
          };
        }
      | {
          ok: false;
          error:
            | HttpError
            | {
                name:
                  | 'FileDoesNotExistError'
                  | 'FileNotReadyError'
                  | 'MemberVerificationAlreadyExistsError';
                message: string;
              };
        };
  • updateVerificationDetails - Update current user's verification details

    updateVerificationDetails(input: UpdateVerificationDetailsInput): Promise<UpdateVerificationDetailsReturn>
    interface UpdateVerificationDetailsInput {
      idFrontImage: string;
      selfieImage: string;
      address: string;
      permanentAddress: string;
      sourceOfIncome: string;
      natureOfWork: string;
      nationality: string;
      placeOfBirth: string;
    }
    
    type UpdateVerificationDetailsReturn =
      | {
          ok: true;
        }
      | {
          ok: false;
          error:
            | HttpError
            | {
                name:
                  | 'FileDoesNotExistError'
                  | 'FileNotReadyError'
                  | 'MemberVerificationAlreadyApprovedError'
                  | 'MemberVerificationDoesNotExistError';
                message: string;
              };
        };
  • verifyMobileNumber - Verify current user's mobile number

    verifyMobileNumber(verificationCode: string): Promise<VerifyMobileNumberReturn>
    type VerifyMobileNumberReturn =
      | {
          ok: true;
        }
      | {
          ok: false;
          error:
            | HttpError
            | {
                name: 'InvalidSMSVerificationCodeError' | 'MobileNumberAlreadyVerifiedError';
                message: string;
              };
        };
  • profileCompletion - Retrieve current user's profile completion status

    profileCompletion(): Promise<ProfileCompletionReturn>
    interface ProfileCompletion {
      completionPercentage: number;
      personalInformation: boolean;
      accountVerification: boolean;
      mobileNumberVerification: boolean;
      transactionPassword: boolean;
      accountPassword: boolean;
    }
    
    type ProfileCompletionReturn =
      | {
          ok: true;
          data: ProfileCompletion;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • sendVerificationCode - Send verification code to mobile number or email address

    sendVerificationCode(mobileNumber: string): Promise<SendVerificationCodeReturn>
    type SendVerificationCodeReturn =
      | {
          ok: true;
        }
      | {
          ok: false;
          error:
            | HttpError
            | {
                name: 'InvalidPlatformError' | 'NotReadyToSendVerficationCodeError';
                message: string;
              };
        };
  • wallet - Retrieve current user's wallet details

    wallet(): Promise<WalletReturn>
    interface Wallet {
      id: string;
      balance: number;
      currency: Currency;
      dateTimeCreated: Date;
      dateTimeLastUpdated: Date;
    }
    
    type WalletReturn =
      | {
          ok: true;
          data: Wallet | null;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • announcements - Retrieve announcements for current platform

    announcements(input?: AnnouncementsInput): Promise<AnnouncementsReturn>
    interface AnnouncementsInput {
      first?: number;
      after?: string;
    }
    
    interface Announcement {
      id: string;
      type: 'RELEASE' | 'SCHEDULED_MAINTENANCE';
      title: string;
      status: 'ACTIVE' | 'INACTIVE';
      message: string;
      activationStartDateTime: Date;
      activationEndDateTime: Date;
      dateTimeCreated: Date;
      dateTimeLastUpdated: Date;
    }
    
    type AnnouncementsReturn =
      | {
          ok: true;
          data: {
            announcements: (Announcement & { cursor: string })[];
            totalCount: number;
            hasNextPage: boolean;
            endCursor?: string;
          };
        }
      | {
          ok: false;
          error: HttpError;
        };
  • createWithdrawal - Create new withdrawal request

    createWithdrawal(input: CreateWithdrawalInput): Promise<CreateWithdrawalReturn>
    interface CreateBankWithdrawalInput {
      id?: string;
      type: 'BANK';
      amount: number;
      transactionPassword: string;
    }
    
    interface CreateGCashWithdrawalInput {
      id?: string;
      type: 'GCASH';
      amount: number;
      transactionPassword: string;
      recipientMobileNumber: string;
    }
    
    interface CreateMayaWithdrawalInput {
      id?: string;
      type: 'MAYA';
      amount: number;
      transactionPassword: string;
      recipientMobileNumber: string;
    }
    
    interface CreateMayaAppWithdrawalInput {
      id?: string;
      type: 'MAYA_APP';
      amount: number;
      transactionPassword: string;
    }
    
    type CreateWithdrawalInput =
      | CreateBankWithdrawalInput
      | CreateGCashWithdrawalInput
      | CreateMayaWithdrawalInput
      | CreateMayaAppWithdrawalInput;
    
    type CreateWithdrawalReturn =
      | {
          ok: true;
          data: {
            id: string;
          };
        }
      | {
          ok: false;
          error:
            | HttpError
            | {
                name:
                  | 'MobileNumberNotVerifiedError'
                  | 'AccountNotVerifiedError'
                  | 'InvalidWithdrawalAmountError'
                  | 'WithdrawalDailyLimitExceededError'
                  | 'InvalidTransactionPasswordError'
                  | 'NotEnoughBalanceError';
                message: string;
              };
        };
  • withdrawalRecords - Retrieve current user's withdrawal records

    withdrawalRecords(input?: WithdrawalRecordsInput): Promise<WithdrawalRecordsReturn>
    type WithdrawalRecordType = 'MANUAL' | 'BANK' | 'GCASH' | 'MAYA';
    type WithdrawalRecordStatus = 'PENDING' | 'APPROVED' | 'REJECTED' | 'CONFIRMED' | 'CANCELLED';
    
    interface WithdrawalRecordsInput {
      first?: number;
      after?: string;
      filter?: {
        type?: {
          equal?: WithdrawalRecordType;
          notEqual?: WithdrawalRecordType;
          in?: WithdrawalRecordType[];
          notIn?: WithdrawalRecordType[];
        };
        status?: {
          equal?: WithdrawalRecordStatus;
          notEqual?: WithdrawalRecordStatus;
          in?: WithdrawalRecordStatus[];
          notIn?: WithdrawalRecordStatus[];
        };
        reference?: {
          equal?: string;
          notEqual?: string;
          in?: string[];
          notIn?: string[];
          contains?: string;
          startsWith?: string;
        };
        withdrawalNumber?: {
          equal?: string;
          notEqual?: string;
          in?: string[];
          notIn?: string[];
          contains?: string;
          startsWith?: string;
        };
        dateTimeCreated?: {
          equal?: Date | string;
          notEqual?: Date | string;
          in?: Date | string[];
          notIn?: Date | string[];
          lesserThan?: Date | string;
          lesserThanOrEqual?: Date | string;
          greaterThan?: Date | string;
          greaterThanOrEqual?: Date | string;
        };
        dateTimeLastUpdated?: {
          equal?: Date | string;
          notEqual?: Date | string;
          in?: Date | string[];
          notIn?: Date | string[];
          lesserThan?: Date | string;
          lesserThanOrEqual?: Date | string;
          greaterThan?: Date | string;
          greaterThanOrEqual?: Date | string;
        };
      };
    }
    
    interface WithdrawalRecord {
      id: string;
      type: WithdrawalRecordType;
      bank?: 'AUBKPHMM' | 'MBTCPHMM' | 'BNORPHMM' | 'MKRUPHM1';
      fee: number;
      amount: number;
      netAmount: number;
      status: WithdrawalRecordStatus;
      reference?: string;
      withdrawalNumber: string;
      recipientMobileNumber?: string;
      dateTimeConfirmed?: Date;
      dateTimeCreated: Date;
      dateTimeLastUpdated: Date;
    }
    
    type WithdrawalRecordsReturn =
      | {
          ok: true;
          data: {
            withdrawalRecords: (WithdrawalRecord & { cursor: string })[];
            totalCount: number;
            hasNextPage: boolean;
            endCursor?: string;
          };
        }
      | {
          ok: false;
          error: HttpError;
        };
  • remainingDailyWithdrawalsCount - Retrieve current user's remaining daily withdrawals count

    remainingDailyWithdrawalsCount(): Promise<RemainingDailyWithdrawalsCountReturn>
    type RemainingDailyWithdrawalsCountReturn =
      | {
          ok: true;
          data: number;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • createDeposit - Create new deposit request

    createDeposit(input: CreateDepositInput): Promise<CreateDepositReturn>
    interface CreateMayaDepositInput {
      id?: string;
      type: 'MAYA';
      amount: number;
      promo?: string;
    }
    
    interface CreateGCashDepositInput {
      id?: string;
      type: 'GCASH';
      amount: number;
      promo?: string;
    }
    
    interface CreateMayaAppDepositInput {
      id?: string;
      type: 'MAYA_APP';
      amount: number;
      promo?: string;
    }
    
    type CreateDepositInput =
      | CreateMayaDepositInput
      | CreateGCashDepositInput
      | CreateMayaAppDepositInput;
    
    type CreateDepositReturn =
      | {
          ok: true;
          data: {
            id: string;
          };
        }
      | {
          ok: false;
          error:
            | HttpError
            | {
                name:
                  | 'DepositPromoMaximumAmountExceededError'
                  | 'DepositPromoMinimumAmountNotMetError'
                  | 'HasActiveBonusError'
                  | 'MaximumDepositAmountExceededError'
                  | 'MinimumDepositAmountNotMetError'
                  | 'MinimumFirstDepositAmountNotMetError'
                  | 'PromoNotEnabledError'
                  | 'WalletDoesNotExistError';
                message: string;
              };
        };
  • deposit - Retrieve deposit details

    deposit(id: string): Promise<DepositReturn>
    interface Deposit {
      id: string;
      type: 'BANK' | 'GCASH' | 'MANUAL' | 'MAYA' | 'MAYA_APP';
      status: 'PENDING' | 'ACCEPTED' | 'APPROVED' | 'REJECTED' | 'CONFIRMED' | 'CANCELLED';
      amount: number;
      netAmount: number;
      fee: number;
      reference?: string;
      checkoutUrl?: string;
      dateTimeCreated: Date;
      dateTimeLastUpdated: Date;
    }
    
    type DepositReturn =
      | {
          ok: true;
          data: Deposit | null;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • depositRecords - Retrieve current user's deposit records

    depositRecords(input?: DepositRecordsInput): Promise<DepositRecordsReturn>
    type DepositRecordType = 'BANK' | 'GCASH' | 'MANUAL' | 'MAYA' | 'MAYA_APP';
    type DepositRecordStatus =
      | 'PENDING'
      | 'ACCEPTED'
      | 'APPROVED'
      | 'REJECTED'
      | 'CONFIRMED'
      | 'CANCELLED';
    
    interface DepositRecordsInput {
      first?: number;
      after?: string;
      filter?: {
        type?: {
          equal?: DepositRecordType;
          notEqual?: DepositRecordType;
          in?: DepositRecordType[];
          notIn?: DepositRecordType[];
        };
        status?: {
          equal?: DepositRecordStatus;
          notEqual?: DepositRecordStatus;
          in?: DepositRecordStatus[];
          notIn?: DepositRecordStatus[];
        };
        reference?: {
          equal?: string;
          notEqual?: string;
          in?: string[];
          notIn?: string[];
          contains?: string;
          startsWith?: string;
        };
        depositNumber?: {
          equal?: string;
          notEqual?: string;
          in?: string[];
          notIn?: string[];
          contains?: string;
          startsWith?: string;
        };
        dateTimeCreated?: {
          equal?: Date | string;
          notEqual?: Date | string;
          in?: Date | string[];
          notIn?: Date | string[];
          lesserThan?: Date | string;
          lesserThanOrEqual?: Date | string;
          greaterThan?: Date | string;
          greaterThanOrEqual?: Date | string;
        };
        dateTimeLastUpdated?: {
          equal?: Date | string;
          notEqual?: Date | string;
          in?: Date | string[];
          notIn?: Date | string[];
          lesserThan?: Date | string;
          lesserThanOrEqual?: Date | string;
          greaterThan?: Date | string;
          greaterThanOrEqual?: Date | string;
        };
      };
    }
    
    interface DepositRecord {
      id: string;
      type: DepositRecordType;
      status: DepositRecordStatus;
      amount: number;
      netAmount: number;
      fee: number;
      reference?: string;
      depositNumber: string;
      dateTimeCreated: Date;
      dateTimeLastUpdated: Date;
    }
    
    type DepositRecordsReturn =
      | {
          ok: true;
          data: {
            depositRecords: (DepositRecord & { cursor: string })[];
            totalCount: number;
            hasNextPage: boolean;
            endCursor?: string;
          };
        }
      | {
          ok: false;
          error: HttpError;
        };
  • depositsCount - Retrieve current user's deposits count

    depositsCount(): Promise<DepositsCountReturn>
    type DepositsCountReturn =
      | {
          ok: true;
          data: number;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • betRecords - Retrieve current user's bet records

    betRecords(input?: BetRecordsInput): Promise<BetRecordsReturn>
    type BetRecordStatus = 'STARTED' | 'SETTLED' | 'CANCELLED';
    
    interface BetRecordsInput {
      first?: number;
      after?: string;
      sort?: SortOrder;
      filter?: {
        serialCode?: {
          equal?: string;
          notEqual?: string;
          in?: string[];
          notIn?: string[];
          contains?: string;
          startsWith?: string;
        };
        game?: {
          equal?: string;
          notEqual?: string;
          in?: string[];
          notIn?: string[];
        };
        game__externalId?: {
          equal?: string;
          notEqual?: string;
          in?: string[];
          notIn?: string[];
          contains?: string;
          startsWith?: string;
        };
        game__type?: {
          equal?: GameType;
          notEqual?: GameType;
          in?: GameType[];
          notIn?: GameType[];
        };
        game__provider?: {
          equal?: GameProvider;
          notEqual?: GameProvider;
          in?: GameProvider[];
          notIn?: GameProvider[];
        };
        dateTimeCreated?: {
          equal?: Date | string;
          notEqual?: Date | string;
          in?: Date | string[];
          notIn?: Date | string[];
          lesserThan?: Date | string;
          lesserThanOrEqual?: Date | string;
          greaterThan?: Date | string;
          greaterThanOrEqual?: Date | string;
        };
        vendorRoundId?: {
          equal?: string;
          notEqual?: string;
          in?: string[];
          notIn?: string[];
          contains?: string;
          startsWith?: string;
        };
        status?: {
          equal?: BetRecordStatus;
          notEqual?: BetRecordStatus;
          in?: BetRecordStatus[];
          notIn?: BetRecordStatus[];
        };
      };
      startDateTime?: {
        equal?: Date | string;
        notEqual?: Date | string;
        in?: Date | string[];
        notIn?: Date | string[];
        lesserThan?: Date | string;
        lesserThanOrEqual?: Date | string;
        greaterThan?: Date | string;
        greaterThanOrEqual?: Date | string;
      };
      endDateTime?: {
        equal?: Date | string;
        notEqual?: Date | string;
        in?: Date | string[];
        notIn?: Date | string[];
        lesserThan?: Date | string;
        lesserThanOrEqual?: Date | string;
        greaterThan?: Date | string;
        greaterThanOrEqual?: Date | string;
      };
    }
    
    interface BetRecord {
      id: string;
      game: Game;
      status: BetRecordStatus;
      serialCode: string;
      vendorRoundId?: string;
      bet: number;
      payout: number;
      validBet: number;
      jackpotContribution: number;
      jackpotPayout: number;
      winloss?: number;
      betContent?: string;
      contestName?: string;
      externalCategory?: string;
      dateTimeSettled?: Date;
      dateTimeCreated: Date;
      dateTimeLastUpdated: Date;
      metadata: {
        odds?: string;
        validBet?: number;
      };
    }
    
    type BetRecordsReturn =
      | {
          ok: true;
          data: {
            betRecords: (BetRecord & { cursor: string })[];
            totalCount: number;
            hasNextPage: boolean;
            endCursor?: string;
          };
        }
      | {
          ok: false;
          error: HttpError;
        };
  • transactionRecords - Retrieve current user's transaction records

    transactionRecords(input?: TransactionRecordsInput): Promise<TransactionRecordsReturn>
    type TransactionRecordType =
      | 'DEPOSIT'
      | 'PAYOUT'
      | 'WITHDRAWAL_REFUND'
      | 'TRANSFER_IN'
      | 'WITHDRAWAL'
      | 'BET'
      | 'TRANSFER_OUT'
      | 'ROLLBACK'
      | 'BET_REFUND'
      | 'PAYOUT_REFUND'
      | 'CASHBACK_BONUS'
      | 'BONUS'
      | 'RESERVE'
      | 'REJECT_WITHDRAWAL'
      | 'MANUAL_DEPOSIT'
      | 'GCASH_DEPOSIT'
      | 'MANUAL_WITHDRAWAL'
      | 'BANK_WITHDRAWAL'
      | 'GCASH_WITHDRAWAL'
      | 'COMMIT_RESERVE'
      | 'ROLLBACK_PAYOUT'
      | 'ROLLBACK_RESERVE';
    
    interface TransactionRecordsInput {
      first?: number;
      after?: string;
      filter?: {
        type?: {
          equal?: TransactionRecordType;
          notEqual?: TransactionRecordType;
          in?: TransactionRecordType[];
          notIn?: TransactionRecordType[];
        };
        referenceNumber?: {
          equal?: string;
          notEqual?: string;
          in?: string[];
          notIn?: string[];
          contains?: string;
          startsWith?: string;
        };
        dateTimeCreated?: {
          equal?: Date | string;
          notEqual?: Date | string;
          in?: Date | string[];
          notIn?: Date | string[];
          lesserThan?: Date | string;
          lesserThanOrEqual?: Date | string;
          greaterThan?: Date | string;
          greaterThanOrEqual?: Date | string;
        };
      };
    }
    
    interface TransactionRecord {
      id: string;
      type: TransactionRecordType;
      amount: number;
      content?: string;
      currentBalance: number;
      referenceNumber: string;
      dateTimeCreated: Date;
      dateTimeLastUpdated: Date;
    }
    
    type TransactionRecordsReturn =
      | {
          ok: true;
          data: {
            transactionRecords: (TransactionRecord & { cursor: string })[];
            totalCount: number;
            hasNextPage: boolean;
            endCursor?: string;
          };
        }
      | {
          ok: false;
          error: HttpError;
        };
  • promos - Retrieve promos for current platform

    promos(): Promise<PromosReturn>
    interface Promo {
      id: string;
      type: 'DEPOSIT';
      name: string;
      banner: {
        id: string;
        url: string;
        status: 'READY';
        dateTimeCreated: Date;
      };
      status: 'ACTIVE' | 'INACTIVE' | 'DISABLED' | 'EXPIRED';
      description: string;
      minimumBonusAmount?: number;
      maximumBonusAmount?: number;
      minimumDepositAmount?: number;
      maximumDepositAmount?: number;
      activationStartDateTime: Date;
      activationEndDateTime: Date;
      dateTimeCreated: Date;
      dateTimeLastUpdated: Date;
    }
    
    type PromosReturn =
      | {
          ok: true;
          data: Promo[];
        }
      | {
          ok: false;
          error: HttpError;
        };
  • availablePromos - Retrieve available promos for current user

    availablePromos(): Promise<PromosReturn>
  • bonus - Retrieve current user's bonus details

    bonus(): Promise<BonusReturn>
    interface Bonus {
      id: string;
      promo: Promo;
      deposit?: {
        type: DepositRecordType;
        status: DepositRecordStatus;
        amount: number;
        netAmount: number;
        fee: number;
        reference?: string;
        dateTimeCreated: Date;
        dateTimeLastUpdated: Date;
      };
      amount: number;
      balance: number;
      turnoverRequirement: number;
      currentTurnoverRequirementContribution: number;
      currentTurnoverRequirementContributionPercentage: number;
      expiration: Date;
      dateTimeCreated: Date;
      dateTimeLastUpdated: Date;
    }
    
    type BonusReturn =
      | {
          ok: true;
          data: Bonus | null;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • cashbacks - Retrieve cashbacks for current platform

    cashbacks(): Promise<CashbackReturn>
    interface Cashback {
      id: string;
      name: string;
      banner: {
        id: string;
        url: string;
        status: 'READY';
        dateTimeCreated: Date;
      };
      status: CashbackStatus;
      description: string;
      activationStartDateTime: Date;
      activationEndDateTime: Date;
      dateTimeCreated: Date;
      dateTimeLastUpdated: Date;
    }
    
    type CashbackReturn =
      | {
          ok: true;
          data: Cashback[];
        }
      | {
          ok: false;
          error: HttpError;
        };
  • cashbackBonuses - Retrieve current user's cashback bonuses

    cashbackBonuses(): Promise<CashbackBonusesReturn>
    interface CashbackBonus {
      id: string;
      balance: number;
      cashback: Cashback;
      dateTimeCreated: Date;
      dateTimeLastUpdated: Date;
    }
    
    type CashbackBonusesReturn =
      | {
          ok: true;
          data: CashbackBonus[];
        }
      | {
          ok: false;
          error: HttpError;
        };
  • claimCashbackBonus - Claim cashback bonus

    claimCashbackBonus(id: string): Promise<ClaimCashbackBonusReturn>
    type ClaimCashbackBonusReturn =
      | {
          ok: true;
        }
      | {
          ok: false;
          error:
            | HttpError
            | {
                name: 'CashbackBonusDoesNotExistError';
                message: string;
              };
        };
  • games - Retrieve games

    games(input?: GamesInput): Promise<GamesReturn>
    type GameType = 'SLOTS' | 'SPORTS' | 'BINGO' | 'FISHING' | 'LIVE' | 'GAMES';
    type GameProvider =
      | 'JILI'
      | 'PGSOFT'
      | 'FACHAI'
      | 'PLAYTECH'
      | 'CQ9'
      | 'JDB'
      | 'BOOONGO'
      | 'HABANERO'
      | 'RELAXGAMING'
      | 'DG'
      | 'E2E'
      | 'BTI'
      | 'DARWIN'
      | 'MEGABALL'
      | 'DRBINGO'
      | 'RTG';
    
    interface GamesInput {
      after?: string;
      first?: number;
      filter?: {
        id?: {
          equal?: string;
          notEqual?: string;
          in?: string[];
          notIn?: string[];
        };
        name?: {
          equal?: string;
          notEqual?: string;
          in?: string[];
          notIn?: string[];
          contains?: string;
          startsWith?: string;
        };
        type?: {
          equal?: GameType;
          notEqual?: GameType;
          in?: GameType[];
          notIn?: GameType[];
        };
        provider?: {
          equal?: GameProvider;
          notEqual?: GameProvider;
          in?: GameProvider[];
          notIn?: GameProvider[];
        };
      };
    }
    
    interface Game {
      id: string;
      type: GameType;
      name: string;
      image: string;
      provider: GameProvider;
    }
    
    type GamesReturn =
      | {
          ok: true;
          data: {
            games: (Game & { cursor: string })[];
            totalCount: number;
            hasNextPage: boolean;
            endCursor?: string;
          };
        }
      | {
          ok: false;
          error: HttpError;
        };
  • gameSession - Retrieve game session details

    gameSession(id: string): Promise<GameSessionReturn>
    type GameSession =
      | {
          id: string;
          game: Game;
          status: 'READY';
          launchUrl: string;
          dateTimeCreated: Date;
          dateTimeLastUpdated: Date;
        }
      | {
          id: string;
          game: Game;
          status: 'PENDING' | 'STARTING' | 'ENDED' | 'CANCELLED';
          dateTimeCreated: Date;
          dateTimeLastUpdated: Date;
        };
    
    type GameSessionReturn =
      | {
          ok: true;
          data: GameSession | null;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • createGameSession - Create new game session

    createGameSession(input:CreateGameSessionInput): Promise<CreateGameSessionReturn>
    interface CreateGameSessionInput {
      id?: string;
      game: string;
    }
    
    type CreateGameSessionReturn =
      | {
          ok: true;
          data: {
            id: string;
          };
        }
      | {
          ok: false;
          error:
            | HttpError
            | {
                name: 'GameDoesNotExistError';
                message: string;
              };
        };
  • endGameSession - End game session

    endGameSession(id: string): Promise<EndGameSessionReturn>
    type EndGameSessionReturn =
      | {
          ok: true;
        }
      | {
          ok: false;
          error: HttpError | UnknownError;
        };
  • file - Retrieve file details

    file(id: string): Promise<FileReturn>
    type File =
      | {
          id: string;
          url?: never;
          status: 'UPLOADING' | 'FAILED';
          dateTimeCreated: Date;
        }
      | {
          id: string;
          url: string;
          status: 'READY';
          dateTimeCreated: Date;
        }
      | {
          id: string;
          url?: string;
          status: 'DELETED';
          dateTimeCreated: Date;
        };
    
    type FileReturn =
      | {
          ok: true;
          data: File | null;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • uploadImageFile - Upload image file

    uploadImageFile(input: globalThis.File): Promise<UploadImageFileReturn>
    type UploadImageFileReturn =
      | {
          ok: true;
          data: {
            id: string;
          };
        }
      | {
          ok: false;
          error:
            | HttpError
            | {
                name: 'FileFormatNotSupportedError' | 'FileNameTooLongError' | 'FileSizeTooBigError';
                message: string;
              };
        };
  • pointsWallet - Retrieve current user's points wallet details

    pointsWallet(): Promise<PointsWalletReturn>
    interface PointsWallet {
      id: string;
      points: number;
      account: string;
      dateTimeCreated: Date;
    }
    
    type PointsWalletReturn =
      | {
          ok: true;
          data: PointsWallet | null;
        }
      | {
          ok: false;
          error: HttpError;
        };
  • pointsToCashConversion - Convert points to cash

    pointsToCashConversion(amount: number): Promise<PointsToCashConversionReturn>
    type PointsToCashConversionReturn =
      | {
          ok: true;
        }
      | {
          ok: false;
          error:
            | HttpError
            | {
                name: 'InsufficientPointsError';
                message: string;
              };
        };