0.0.121 • Published 8 months ago

@opexa/portal-sdk v0.0.121

Weekly downloads
-
License
-
Repository
-
Last release
8 months 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'
                  | '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;
              };
        };
0.0.119

8 months ago

0.0.118

8 months ago

0.0.120

8 months ago

0.0.121

8 months ago

0.0.117

8 months ago

0.0.116

8 months ago

0.0.115

8 months ago

0.0.114

8 months ago

0.0.113

8 months ago

0.0.112

8 months ago

0.0.111

8 months ago

0.0.109

9 months ago

0.0.110

9 months ago

0.0.108

9 months ago

0.0.107

9 months ago

0.0.86

9 months ago

0.0.87

9 months ago

0.0.88

9 months ago

0.0.89

9 months ago

0.0.106

9 months ago

0.0.105

9 months ago

0.0.104

9 months ago

0.0.103

9 months ago

0.0.102

9 months ago

0.0.101

9 months ago

0.0.100

9 months ago

0.0.95

9 months ago

0.0.96

9 months ago

0.0.97

9 months ago

0.0.98

9 months ago

0.0.99

9 months ago

0.0.90

9 months ago

0.0.91

9 months ago

0.0.92

9 months ago

0.0.93

9 months ago

0.0.94

9 months ago

0.0.84

9 months ago

0.0.85

9 months ago

0.0.80

9 months ago

0.0.81

9 months ago

0.0.82

9 months ago

0.0.83

9 months ago

0.0.73

9 months ago

0.0.74

9 months ago

0.0.75

9 months ago

0.0.76

9 months ago

0.0.77

9 months ago

0.0.78

9 months ago

0.0.79

9 months ago

0.0.71

10 months ago

0.0.72

9 months ago

0.0.70

10 months ago

0.0.62

10 months ago

0.0.63

10 months ago

0.0.64

10 months ago

0.0.65

10 months ago

0.0.66

10 months ago

0.0.68

10 months ago

0.0.61

10 months ago

0.0.59

10 months ago

0.0.56

10 months ago

0.0.57

10 months ago

0.0.58

10 months ago

0.0.55

10 months ago

0.0.54

10 months ago

0.0.53

10 months ago

0.0.52

10 months ago

0.0.51

10 months ago

0.0.50

10 months ago

0.0.49

11 months ago

0.0.48

11 months ago

0.0.47

11 months ago

0.0.45

11 months ago

0.0.44

11 months ago

0.0.43

11 months ago

0.0.42

11 months ago

0.0.41

11 months ago

0.0.40

11 months ago

0.0.39

11 months ago

0.0.38

11 months ago

0.0.37

11 months ago

0.0.36

11 months ago

0.0.35

11 months ago

0.0.34

11 months ago

0.0.33

11 months ago

0.0.32

11 months ago

0.0.31

11 months ago

0.0.30

11 months ago

0.0.29

11 months ago

0.0.28

11 months ago

0.0.27

11 months ago

0.0.26

11 months ago

0.0.25

11 months ago

0.0.24

11 months ago

0.0.23

11 months ago

0.0.22

11 months ago

0.0.21

11 months ago

0.0.20

11 months ago

0.0.19

11 months ago

0.0.18

11 months ago

0.0.17

11 months ago

0.0.16

11 months ago

0.0.15

11 months ago

0.0.14

11 months ago

0.0.13

11 months ago

0.0.12

11 months ago

0.0.11

11 months ago

0.0.10

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago