0.39.8 • Published 1 year ago

@opexa/portal-sdk v0.39.8

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

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'
                  | '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;
      turnoverRequirementContributionPercentagePerGameProvider?: JSON;
      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'
      | 'DIGITAIN'
      | '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;
              };
        };
0.20.0

1 year ago

0.17.0

1 year ago

0.0.205

1 year ago

0.0.204

1 year ago

0.0.203

1 year ago

0.0.202

1 year ago

0.0.209

1 year ago

0.0.208

1 year ago

0.0.207

1 year ago

0.0.206

1 year ago

0.32.0

1 year ago

0.0.201

1 year ago

0.0.200

1 year ago

0.29.0

1 year ago

0.7.0

1 year ago

0.0.216

1 year ago

0.0.215

1 year ago

0.0.214

1 year ago

0.0.213

1 year ago

0.0.219

1 year ago

0.0.217

1 year ago

0.21.0

1 year ago

0.0.212

1 year ago

0.0.211

1 year ago

0.0.210

1 year ago

0.33.0

1 year ago

0.10.1

1 year ago

0.18.0

1 year ago

0.0.227

1 year ago

0.0.226

1 year ago

0.0.225

1 year ago

0.0.224

1 year ago

0.10.0

1 year ago

0.0.223

1 year ago

0.0.222

1 year ago

0.0.221

1 year ago

0.0.220

1 year ago

0.22.0

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.8.2

1 year ago

0.35.11

1 year ago

0.35.12

1 year ago

0.35.10

1 year ago

0.0.197

1 year ago

0.0.196

1 year ago

0.0.194

1 year ago

0.0.199

1 year ago

0.0.198

1 year ago

0.38.1

1 year ago

0.38.0

1 year ago

0.0.193

1 year ago

0.0.192

1 year ago

0.0.191

1 year ago

0.0.190

1 year ago

0.15.0

1 year ago

0.35.13

1 year ago

0.35.14

1 year ago

0.30.0

1 year ago

0.27.0

1 year ago

0.5.0

1 year ago

0.39.1

1 year ago

0.39.0

1 year ago

0.39.8

1 year ago

0.39.7

1 year ago

0.39.6

1 year ago

0.39.5

1 year ago

0.39.4

1 year ago

0.16.0

1 year ago

0.39.3

1 year ago

0.39.2

1 year ago

0.31.0

1 year ago

0.28.1

1 year ago

0.28.0

1 year ago

0.6.0

1 year ago

0.0.159

1 year ago

0.0.158

1 year ago

0.0.153

1 year ago

0.0.152

2 years ago

0.0.151

2 years ago

0.0.150

2 years ago

0.0.157

1 year ago

0.0.156

1 year ago

0.0.155

1 year ago

0.0.154

1 year ago

0.36.0

1 year ago

0.13.0

1 year ago

0.0.169

1 year ago

0.0.164

1 year ago

0.0.163

1 year ago

0.0.162

1 year ago

0.0.161

1 year ago

0.0.168

1 year ago

0.0.167

1 year ago

0.0.166

1 year ago

0.0.165

1 year ago

0.3.0

1 year ago

0.25.0

1 year ago

0.0.160

1 year ago

0.0.175

1 year ago

0.0.174

1 year ago

0.0.173

1 year ago

0.0.172

1 year ago

0.0.179

1 year ago

0.0.178

1 year ago

0.0.177

1 year ago

0.0.176

1 year ago

0.37.3

1 year ago

0.37.2

1 year ago

0.37.1

1 year ago

0.37.0

1 year ago

0.0.171

1 year ago

0.0.170

1 year ago

0.14.0

1 year ago

0.37.5

1 year ago

0.37.4

1 year ago

0.0.186

1 year ago

0.0.185

1 year ago

0.0.184

1 year ago

0.0.183

1 year ago

0.0.189

1 year ago

0.0.188

1 year ago

0.0.187

1 year ago

0.26.0

1 year ago

0.0.182

1 year ago

0.0.181

1 year ago

0.0.180

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.34.6

1 year ago

0.19.0

1 year ago

0.34.5

1 year ago

0.34.4

1 year ago

0.34.3

1 year ago

0.34.2

1 year ago

0.34.1

1 year ago

0.34.0

1 year ago

0.11.0

1 year ago

0.11.1

1 year ago

0.11.2

1 year ago

0.0.128

2 years ago

0.0.127

2 years ago

0.0.126

2 years ago

0.0.129

2 years ago

0.0.124

2 years ago

0.0.123

2 years ago

0.0.122

2 years ago

0.1.0

1 year ago

0.23.1

1 year ago

0.23.0

1 year ago

0.9.0

1 year ago

0.0.139

2 years ago

0.0.138

2 years ago

0.0.137

2 years ago

0.0.136

2 years ago

0.0.131

2 years ago

0.0.130

2 years ago

0.0.135

2 years ago

0.0.134

2 years ago

0.0.133

2 years ago

0.0.132

2 years ago

0.35.5

1 year ago

0.35.4

1 year ago

0.35.3

1 year ago

0.35.2

1 year ago

0.35.1

1 year ago

0.35.0

1 year ago

0.12.0

1 year ago

0.35.9

1 year ago

0.35.8

1 year ago

0.35.7

1 year ago

0.35.6

1 year ago

0.0.149

2 years ago

0.0.148

2 years ago

0.0.147

2 years ago

0.0.142

2 years ago

0.0.141

2 years ago

0.0.140

2 years ago

0.0.146

2 years ago

0.0.145

2 years ago

0.0.144

2 years ago

0.0.143

2 years ago

0.2.0

1 year ago

0.24.0

1 year ago

0.0.119

2 years ago

0.0.118

2 years ago

0.0.120

2 years ago

0.0.121

2 years ago

0.0.117

2 years ago

0.0.116

2 years ago

0.0.115

2 years ago

0.0.114

2 years ago

0.0.113

2 years ago

0.0.112

2 years ago

0.0.111

2 years ago

0.0.109

2 years ago

0.0.110

2 years ago

0.0.108

2 years ago

0.0.107

2 years ago

0.0.86

2 years ago

0.0.87

2 years ago

0.0.88

2 years ago

0.0.89

2 years ago

0.0.106

2 years ago

0.0.105

2 years ago

0.0.104

2 years ago

0.0.103

2 years ago

0.0.102

2 years ago

0.0.101

2 years ago

0.0.100

2 years ago

0.0.95

2 years ago

0.0.96

2 years ago

0.0.97

2 years ago

0.0.98

2 years ago

0.0.99

2 years ago

0.0.90

2 years ago

0.0.91

2 years ago

0.0.92

2 years ago

0.0.93

2 years ago

0.0.94

2 years ago

0.0.84

2 years ago

0.0.85

2 years ago

0.0.80

2 years ago

0.0.81

2 years ago

0.0.82

2 years ago

0.0.83

2 years ago

0.0.73

2 years ago

0.0.74

2 years ago

0.0.75

2 years ago

0.0.76

2 years ago

0.0.77

2 years ago

0.0.78

2 years ago

0.0.79

2 years ago

0.0.71

2 years ago

0.0.72

2 years ago

0.0.70

2 years ago

0.0.62

2 years ago

0.0.63

2 years ago

0.0.64

2 years ago

0.0.65

2 years ago

0.0.66

2 years ago

0.0.68

2 years ago

0.0.61

2 years ago

0.0.59

2 years ago

0.0.56

2 years ago

0.0.57

2 years ago

0.0.58

2 years ago

0.0.55

2 years ago

0.0.54

2 years ago

0.0.53

2 years ago

0.0.52

2 years ago

0.0.51

2 years ago

0.0.50

2 years ago

0.0.49

2 years ago

0.0.48

2 years ago

0.0.47

2 years ago

0.0.45

2 years ago

0.0.44

2 years ago

0.0.43

2 years ago

0.0.42

2 years ago

0.0.41

2 years ago

0.0.40

2 years ago

0.0.39

2 years ago

0.0.38

2 years ago

0.0.37

2 years ago

0.0.36

2 years ago

0.0.35

2 years ago

0.0.34

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago

0.0.31

2 years ago

0.0.30

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago