@opexa/portal-sdk 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +1591 -1591
  2. package/dist/index.d.ts +0 -3
  3. package/dist/index.js +66 -59
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +759 -574
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/sdk/index.d.ts +4 -0
  8. package/dist/{sdk.d.ts → sdk/sdk.d.ts} +38 -2
  9. package/dist/{session-manager.d.ts → sdk/session-manager.d.ts} +6 -2
  10. package/dist/{transformer.d.ts → sdk/transformer.d.ts} +1 -1
  11. package/dist/{types.d.ts → sdk/types.d.ts} +120 -94
  12. package/dist/services/account.service.d.ts +3 -2
  13. package/dist/services/auth.service.d.ts +8 -6
  14. package/dist/services/bet-record.d.ts +1 -7
  15. package/dist/services/bonus.d.ts +3 -2
  16. package/dist/services/cashback.d.ts +2 -4
  17. package/dist/services/deposit.d.ts +8 -17
  18. package/dist/services/file.d.ts +20 -10
  19. package/dist/services/file.service.d.ts +1 -1
  20. package/dist/services/game.d.ts +26 -12
  21. package/dist/services/game.service.d.ts +3 -2
  22. package/dist/services/member.d.ts +15 -9
  23. package/dist/services/platform.d.ts +1 -1
  24. package/dist/services/points.d.ts +3 -2
  25. package/dist/services/portal.service.d.ts +1 -1
  26. package/dist/services/promo.d.ts +2 -4
  27. package/dist/services/report.service.d.ts +2 -1
  28. package/dist/services/session.d.ts +64 -9
  29. package/dist/services/types.d.ts +9 -32
  30. package/dist/services/wallet.service.d.ts +3 -1
  31. package/dist/services/withdrawal.d.ts +6 -5
  32. package/dist/utils/graphql-client.d.ts +4 -11
  33. package/dist/utils/rest-client.d.ts +34 -0
  34. package/dist/utils/status-code-to-error.d.ts +3 -0
  35. package/dist/utils/types.d.ts +25 -3
  36. package/package.json +78 -78
  37. package/dist/utils/http-error.d.ts +0 -26
  38. /package/dist/{logger.d.ts → sdk/logger.d.ts} +0 -0
  39. /package/dist/{object-id.d.ts → sdk/object-id.d.ts} +0 -0
  40. /package/dist/{object-type.d.ts → sdk/object-type.d.ts} +0 -0
package/README.md CHANGED
@@ -1,1591 +1,1591 @@
1
- ## Opexa Portal SDK
2
-
3
- A library that provides a set of functions to interact with Opexa Portal API.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @highoutputventures/opexa-portal-sdk
9
- ```
10
-
11
- ## Usage
12
-
13
- - Create sdk instance
14
-
15
- ```ts
16
- // lib/sdk.js
17
- import Sdk from '@highoutputventures/opexa-portal-sdk';
18
-
19
- export const sdk = new Sdk({
20
- platform: 'Z892',
21
- baseUrl: 'https://portal.development.opexa.io',
22
- });
23
- ```
24
-
25
- - Use sdk instance
26
-
27
- ```jsx
28
- import { sdk } from '$lib/sdk';
29
- import * as React from 'react';
30
-
31
- function Page() {
32
- const [account, setAccount] = React.useState();
33
-
34
- React.useEffect(function () {
35
- sdk.account().then(setAccount);
36
- }, []);
37
-
38
- return (
39
- <pre>
40
- <code>{JSON.stringify(account, null, 2)}</code>
41
- </pre>
42
- );
43
- }
44
- ```
45
-
46
- ## API
47
-
48
- ### `Sdk`
49
-
50
- `Sdk` accepts the following options:
51
-
52
- - `*platform` - The platform to be used
53
- - `*environment` - Whether to use production/development api
54
-
55
- , and returns the following methods:
56
-
57
- - `signIn` - Start user session
58
-
59
- ```ts
60
- signIn(input: SignInInput): Promise<SignInReturn>
61
- ```
62
-
63
- ```ts
64
- type SignInInput =
65
- | {
66
- name: string;
67
- password: string;
68
- }
69
- | {
70
- mobileNumber: string;
71
- verificationCode: string;
72
- };
73
-
74
- type SignInReturn =
75
- | {
76
- ok: true;
77
- }
78
- | {
79
- ok: false;
80
- error:
81
- | HttpError
82
- | {
83
- code: 'AccountNotFound';
84
- message: string;
85
- };
86
- };
87
- ```
88
-
89
- - `signOut` - End current user session
90
-
91
- ```ts
92
- signOut(): Promise<void>
93
- ```
94
-
95
- - `platform` - Retrieve current platform details
96
-
97
- ```ts
98
- platform(): Promise<PlatformReturn>
99
- ```
100
-
101
- ```ts
102
- interface Platform {
103
- paymentSettings: {
104
- minimumFirstDepositAmount?: number;
105
- restrictWithdrawalsToVerifiedMembers: boolean;
106
- depositGateway: {
107
- bank: GatewaySettings;
108
- gcash: GatewaySettings;
109
- maya: GatewaySettings;
110
- mayaApp: GatewaySettings;
111
- };
112
- withdrawalGateway: {
113
- bank: GatewaySettings;
114
- gcash: GatewaySettings;
115
- maya: GatewaySettings;
116
- mayaApp: GatewaySettings;
117
- };
118
- };
119
- pointsClubSettings: {
120
- multiplier: number;
121
- };
122
- }
123
-
124
- type PlatformReturn =
125
- | {
126
- ok: true;
127
- data: Platform;
128
- }
129
- | {
130
- ok: false;
131
- error: HttpError;
132
- };
133
- ```
134
-
135
- - `account` - Retrieve current user's details
136
-
137
- ```ts
138
- account(): Promise<AccountReturn>
139
- ```
140
-
141
- ```ts
142
- interface Account {
143
- id: string;
144
- name: string;
145
- status: MemberAccountStatus;
146
- realName?: string;
147
- nickName?: string;
148
- dateOfBirth?: Date;
149
- validId?: string;
150
- emailAddress?: string;
151
- mobileNumber?: string;
152
- verified: boolean;
153
- verificationStatus: MemberAccountVerificationStatus;
154
- mobileNumberVerified: boolean;
155
- mobileNumberVerificationRequired: boolean;
156
- transactionPassword: boolean;
157
- dateTimeLastActive?: Date;
158
- dateTimeCreated: Date;
159
- dateTimeLastUpdated: Date;
160
- }
161
-
162
- type AccountReturn =
163
- | {
164
- ok: true;
165
- data: Account;
166
- }
167
- | {
168
- ok: false;
169
- error: HttpError;
170
- };
171
- ```
172
-
173
- - `createAccount` - Create new user account
174
-
175
- ```ts
176
- createAccount(input: CreateAccountInput): Promise<CreateAccountReturn>
177
- ```
178
-
179
- ```ts
180
- interface CreateAccountInput {
181
- id?: string;
182
- name: string;
183
- password: string;
184
- mobileNumber: string;
185
- dateOfBirth: string;
186
- btag?: string;
187
- domain?: string;
188
- referralCode?: string;
189
- verificationCode?: string;
190
- reCAPTCHAResponse?: string;
191
- }
192
-
193
- type CreateAccountReturn =
194
- | {
195
- ok: true;
196
- error?: never;
197
- data: {
198
- id: string;
199
- };
200
- }
201
- | {
202
- ok: false;
203
- data?: never;
204
- error:
205
- | HttpError
206
- | {
207
- code:
208
- | 'AccountNameNotAvailableError'
209
- | 'InvalidPlatformError'
210
- | 'InvalidReCAPTCHAResponseError'
211
- | 'InvalidSMSVerificationCodeError'
212
- | 'MinimumAgeRequirementError'
213
- | 'MobileNumberNotAvailableError';
214
- message: string;
215
- };
216
- };
217
- ```
218
-
219
- - `updateAccount` - Update current user's details
220
-
221
- ```ts
222
- updateAccount(input: UpdateAccountInput): Promise<UpdateAccountReturn>
223
- ```
224
-
225
- ```ts
226
- type UpdateAccountReturn =
227
- | {
228
- ok: true;
229
- data?: never;
230
- error?: never;
231
- }
232
- | {
233
- ok: false;
234
- data?: never;
235
- error: {
236
- code:
237
- | 'AccountNameNotAvailableError'
238
- | 'EmailAddressNotAvailableError'
239
- | 'InvalidTransactionPasswordError'
240
- | 'MobileNumberNotAvailableError'
241
- | 'NickNameNotAvailableError'
242
- | 'RealNameAlreadySetError'
243
- | 'ValidIdAlreadySetError';
244
- message: string;
245
- };
246
- };
247
- ```
248
-
249
- - `deleteAccount` - Delete current user's account
250
-
251
- ```ts
252
- deleteAccount(id: string): Promise<DeleteAccountReturn>
253
- ```
254
-
255
- ```ts
256
- type DeleteAccountReturn =
257
- | {
258
- ok: true;
259
- }
260
- | {
261
- ok: false;
262
- error: UnknownError | HttpError;
263
- };
264
- ```
265
-
266
- - `resetPassword` - Reset user's password
267
-
268
- ```ts
269
- resetPassword(input: ResetPasswordInput): Promise<ResetPasswordReturn>
270
- ```
271
-
272
- ```ts
273
- interface ResetPasswordInput {
274
- mobileNumber: string;
275
- newPassword: string;
276
- verificationCode: string;
277
- }
278
-
279
- type ResetPasswordReturn =
280
- | {
281
- ok: true;
282
- }
283
- | {
284
- ok: false;
285
- error:
286
- | HttpError
287
- | {
288
- code: 'AccountNotFoundError' | 'InvalidVerificationCodeError';
289
- message: string;
290
- };
291
- };
292
- ```
293
-
294
- - `verificationDetails` - Retrieve user's verification details
295
-
296
- ```ts
297
- verificationDetails(): Promise<VerificationDetailsReturn>
298
- ```
299
-
300
- ```ts
301
- interface VerificationDetails {
302
- id: string;
303
- status: MemberVerificationStatus;
304
- address: string;
305
- sourceOfIncome: string;
306
- natureOfWork: string;
307
- nationality: string;
308
- placeOfBirth: string;
309
- idFrontImage: File;
310
- selfieImage: File;
311
- }
312
-
313
- type VerificationDetailsReturn =
314
- | {
315
- ok: true;
316
- data: VerificationDetails;
317
- }
318
- | {
319
- ok: false;
320
- error: HttpError;
321
- };
322
- ```
323
-
324
- - `submitVerificationDetails` - Submit current user's verification details
325
-
326
- ```ts
327
- submitVerificationDetails(input: SubmitVerificationDetailsInput): Promise<SubmitVerificationDetailsReturn>
328
- ```
329
-
330
- ```ts
331
- interface SubmitVerificationDetailsInput {
332
- id?: string;
333
- idFrontImage: string;
334
- selfieImage: string;
335
- address: string;
336
- sourceOfIncome: string;
337
- natureOfWork: string;
338
- nationality: string;
339
- placeOfBirth: string;
340
- }
341
-
342
- type SubmitVerificationDetailsReturn =
343
- | {
344
- ok: true;
345
- data: {
346
- id: string;
347
- };
348
- }
349
- | {
350
- ok: false;
351
- error:
352
- | HttpError
353
- | {
354
- code:
355
- | 'FileDoesNotExistError'
356
- | 'FileNotReadyError'
357
- | 'MemberVerificationAlreadyExistsError';
358
- message: string;
359
- };
360
- };
361
- ```
362
-
363
- - `updateVerificationDetails` - Update current user's verification details
364
-
365
- ```ts
366
- updateVerificationDetails(input: UpdateVerificationDetailsInput): Promise<UpdateVerificationDetailsReturn>
367
- ```
368
-
369
- ```ts
370
- interface UpdateVerificationDetailsInput {
371
- idFrontImage: string;
372
- selfieImage: string;
373
- address: string;
374
- sourceOfIncome: string;
375
- natureOfWork: string;
376
- nationality: string;
377
- placeOfBirth: string;
378
- }
379
-
380
- type UpdateVerificationDetailsReturn =
381
- | {
382
- ok: true;
383
- }
384
- | {
385
- ok: false;
386
- error:
387
- | HttpError
388
- | {
389
- code:
390
- | 'FileDoesNotExistError'
391
- | 'FileNotReadyError'
392
- | 'MemberVerificationAlreadyApprovedError'
393
- | 'MemberVerificationDoesNotExistError';
394
- message: string;
395
- };
396
- };
397
- ```
398
-
399
- - `verifyMobileNumber` - Verify current user's mobile number
400
-
401
- ```ts
402
- verifyMobileNumber(verificationCode: string): Promise<VerifyMobileNumberReturn>
403
- ```
404
-
405
- ```ts
406
- type VerifyMobileNumberReturn =
407
- | {
408
- ok: true;
409
- }
410
- | {
411
- ok: false;
412
- error:
413
- | HttpError
414
- | {
415
- code: 'InvalidSMSVerificationCodeError' | 'MobileNumberAlreadyVerifiedError';
416
- message: string;
417
- };
418
- };
419
- ```
420
-
421
- - `profileCompletion` - Retrieve current user's profile completion status
422
-
423
- ```ts
424
- profileCompletion(): Promise<ProfileCompletionReturn>
425
- ```
426
-
427
- ```ts
428
- interface ProfileCompletion {
429
- completionPercentage: number;
430
- personalInformation: boolean;
431
- accountVerification: boolean;
432
- mobileNumberVerification: boolean;
433
- transactionPassword: boolean;
434
- accountPassword: boolean;
435
- }
436
-
437
- type ProfileCompletionReturn =
438
- | {
439
- ok: true;
440
- data: ProfileCompletion;
441
- }
442
- | {
443
- ok: false;
444
- error: HttpError;
445
- };
446
- ```
447
-
448
- - `sendVerificationCode` - Send verification code to mobile number or email address
449
-
450
- ```ts
451
- sendVerificationCode(mobileNumber: string): Promise<SendVerificationCodeReturn>
452
- ```
453
-
454
- ```ts
455
- type SendVerificationCodeReturn =
456
- | {
457
- ok: true;
458
- }
459
- | {
460
- ok: false;
461
- error:
462
- | HttpError
463
- | {
464
- code: 'InvalidPlatformError' | 'NotReadyToSendVerficationCodeError';
465
- message: string;
466
- };
467
- };
468
- ```
469
-
470
- - `wallet` - Retrieve current user's wallet details
471
-
472
- ```ts
473
- wallet(): Promise<WalletReturn>
474
- ```
475
-
476
- ```ts
477
- interface Wallet {
478
- id: string;
479
- balance: number;
480
- currency: Currency;
481
- dateTimeCreated: Date;
482
- dateTimeLastUpdated: Date;
483
- }
484
-
485
- type WalletReturn =
486
- | {
487
- ok: true;
488
- data: Wallet | null;
489
- }
490
- | {
491
- ok: false;
492
- error: HttpError;
493
- };
494
- ```
495
-
496
- - `announcements` - Retrieve announcements for current platform
497
-
498
- ```ts
499
- announcements(input?: AnnouncementsInput): Promise<AnnouncementsReturn>
500
- ```
501
-
502
- ```ts
503
- interface AnnouncementsInput {
504
- first?: number;
505
- after?: string;
506
- }
507
-
508
- interface Announcement {
509
- id: string;
510
- type: 'RELEASE' | 'SCHEDULED_MAINTENANCE';
511
- title: string;
512
- status: 'ACTIVE' | 'INACTIVE';
513
- message: string;
514
- activationStartDateTime: Date;
515
- activationEndDateTime: Date;
516
- dateTimeCreated: Date;
517
- dateTimeLastUpdated: Date;
518
- }
519
-
520
- type AnnouncementsReturn =
521
- | {
522
- ok: true;
523
- data: {
524
- announcements: (Announcement & { cursor: string })[];
525
- totalCount: number;
526
- hasNextPage: boolean;
527
- nextCursor?: string;
528
- };
529
- }
530
- | {
531
- ok: false;
532
- error: HttpError;
533
- };
534
- ```
535
-
536
- - `createWithdrawal` - Create new withdrawal request
537
-
538
- ```ts
539
- createWithdrawal(input: CreateWithdrawalInput): Promise<CreateWithdrawalReturn>
540
- ```
541
-
542
- ```ts
543
- interface CreateBankWithdrawalInput {
544
- id?: string;
545
- type: 'BANK';
546
- amount: number;
547
- transactionPassword: string;
548
- }
549
-
550
- interface CreateGCashWithdrawalInput {
551
- id?: string;
552
- type: 'GCASH';
553
- amount: number;
554
- transactionPassword: string;
555
- recipientMobileNumber: string;
556
- }
557
-
558
- interface CreateMayaWithdrawalInput {
559
- id?: string;
560
- type: 'MAYA';
561
- amount: number;
562
- transactionPassword: string;
563
- recipientMobileNumber: string;
564
- }
565
-
566
- interface CreateMayaAppWithdrawalInput {
567
- id?: string;
568
- type: 'MAYA_APP';
569
- amount: number;
570
- transactionPassword: string;
571
- }
572
-
573
- type CreateWithdrawalInput =
574
- | CreateBankWithdrawalInput
575
- | CreateGCashWithdrawalInput
576
- | CreateMayaWithdrawalInput
577
- | CreateMayaAppWithdrawalInput;
578
-
579
- type CreateWithdrawalReturn =
580
- | {
581
- ok: true;
582
- data: {
583
- id: string;
584
- };
585
- }
586
- | {
587
- ok: false;
588
- error:
589
- | HttpError
590
- | {
591
- code:
592
- | 'MobileNumberNotVerifiedError'
593
- | 'AccountNotVerifiedError'
594
- | 'InvalidWithdrawalAmountError'
595
- | 'WithdrawalDailyLimitExceededError'
596
- | 'InvalidTransactionPasswordError'
597
- | 'NotEnoughBalanceError';
598
- message: string;
599
- };
600
- };
601
- ```
602
-
603
- - `withdrawalRecords` - Retrieve current user's withdrawal records
604
-
605
- ```ts
606
- withdrawalRecords(input?: WithdrawalRecordsInput): Promise<WithdrawalRecordsReturn>
607
- ```
608
-
609
- ```ts
610
- type WithdrawalRecordType = 'MANUAL' | 'BANK' | 'GCASH' | 'MAYA';
611
- type WithdrawalRecordStatus = 'PENDING' | 'APPROVED' | 'REJECTED' | 'CONFIRMED' | 'CANCELLED';
612
-
613
- interface WithdrawalRecordsInput {
614
- first?: number;
615
- after?: string;
616
- filter?: {
617
- type?: {
618
- equal?: WithdrawalRecordType;
619
- notEqual?: WithdrawalRecordType;
620
- in?: WithdrawalRecordType[];
621
- notIn?: WithdrawalRecordType[];
622
- };
623
- status?: {
624
- equal?: WithdrawalRecordStatus;
625
- notEqual?: WithdrawalRecordStatus;
626
- in?: WithdrawalRecordStatus[];
627
- notIn?: WithdrawalRecordStatus[];
628
- };
629
- reference?: {
630
- equal?: string;
631
- notEqual?: string;
632
- in?: string[];
633
- notIn?: string[];
634
- contains?: string;
635
- startsWith?: string;
636
- };
637
- withdrawalNumber?: {
638
- equal?: string;
639
- notEqual?: string;
640
- in?: string[];
641
- notIn?: string[];
642
- contains?: string;
643
- startsWith?: string;
644
- };
645
- dateTimeCreated?: {
646
- equal?: Date | string;
647
- notEqual?: Date | string;
648
- in?: Date | string[];
649
- notIn?: Date | string[];
650
- lesserThan?: Date | string;
651
- lesserThanOrEqual?: Date | string;
652
- greaterThan?: Date | string;
653
- greaterThanOrEqual?: Date | string;
654
- };
655
- dateTimeLastUpdated?: {
656
- equal?: Date | string;
657
- notEqual?: Date | string;
658
- in?: Date | string[];
659
- notIn?: Date | string[];
660
- lesserThan?: Date | string;
661
- lesserThanOrEqual?: Date | string;
662
- greaterThan?: Date | string;
663
- greaterThanOrEqual?: Date | string;
664
- };
665
- };
666
- }
667
-
668
- interface WithdrawalRecord {
669
- id: string;
670
- type: WithdrawalRecordType;
671
- bank?: 'AUBKPHMM' | 'MBTCPHMM' | 'BNORPHMM' | 'MKRUPHM1';
672
- fee: number;
673
- amount: number;
674
- netAmount: number;
675
- status: WithdrawalRecordStatus;
676
- reference?: string;
677
- withdrawalNumber: string;
678
- recipientMobileNumber?: string;
679
- dateTimeConfirmed?: Date;
680
- dateTimeCreated: Date;
681
- dateTimeLastUpdated: Date;
682
- }
683
-
684
- type WithdrawalRecordsReturn =
685
- | {
686
- ok: true;
687
- data: {
688
- withdrawalRecords: (WithdrawalRecord & { cursor: string })[];
689
- totalCount: number;
690
- hasNextPage: boolean;
691
- nextCursor?: string;
692
- };
693
- }
694
- | {
695
- ok: false;
696
- error: HttpError;
697
- };
698
- ```
699
-
700
- - `remainingDailyWithdrawalsCount` - Retrieve current user's remaining daily withdrawals count
701
-
702
- ```ts
703
- remainingDailyWithdrawalsCount(): Promise<RemainingDailyWithdrawalsCountReturn>
704
- ```
705
-
706
- ```ts
707
- type RemainingDailyWithdrawalsCountReturn =
708
- | {
709
- ok: true;
710
- data: number;
711
- }
712
- | {
713
- ok: false;
714
- error: HttpError;
715
- };
716
- ```
717
-
718
- - `createDeposit` - Create new deposit request
719
-
720
- ```ts
721
- createDeposit(input: CreateDepositInput): Promise<CreateDepositReturn>
722
- ```
723
-
724
- ```ts
725
- interface CreateMayaDepositInput {
726
- id?: string;
727
- type: 'MAYA';
728
- amount: number;
729
- promo?: string;
730
- }
731
-
732
- interface CreateGCashDepositInput {
733
- id?: string;
734
- type: 'GCASH';
735
- amount: number;
736
- promo?: string;
737
- }
738
-
739
- interface CreateMayaAppDepositInput {
740
- id?: string;
741
- type: 'MAYA_APP';
742
- amount: number;
743
- promo?: string;
744
- }
745
-
746
- type CreateDepositInput =
747
- | CreateMayaDepositInput
748
- | CreateGCashDepositInput
749
- | CreateMayaAppDepositInput;
750
-
751
- type CreateDepositReturn =
752
- | {
753
- ok: true;
754
- data: {
755
- id: string;
756
- };
757
- }
758
- | {
759
- ok: false;
760
- error:
761
- | HttpError
762
- | {
763
- code:
764
- | 'DepositPromoMaximumAmountExceededError'
765
- | 'DepositPromoMinimumAmountNotMetError'
766
- | 'HasActiveBonusError'
767
- | 'MaximumDepositAmountExceededError'
768
- | 'MinimumDepositAmountNotMetError'
769
- | 'MinimumFirstDepositAmountNotMetError'
770
- | 'PromoNotEnabledError'
771
- | 'WalletDoesNotExistError';
772
- message: string;
773
- };
774
- };
775
- ```
776
-
777
- - `deposit` - Retrieve deposit details
778
-
779
- ```ts
780
- deposit(id: string): Promise<DepositReturn>
781
- ```
782
-
783
- ```ts
784
- interface Deposit {
785
- id: string;
786
- type: 'BANK' | 'GCASH' | 'MANUAL' | 'MAYA' | 'MAYA_APP';
787
- status: 'PENDING' | 'ACCEPTED' | 'APPROVED' | 'REJECTED' | 'CONFIRMED' | 'CANCELLED';
788
- amount: number;
789
- netAmount: number;
790
- fee: number;
791
- reference?: string;
792
- checkoutUrl?: string;
793
- dateTimeCreated: Date;
794
- dateTimeLastUpdated: Date;
795
- }
796
-
797
- type DepositReturn =
798
- | {
799
- ok: true;
800
- data: Deposit | null;
801
- }
802
- | {
803
- ok: false;
804
- error: HttpError;
805
- };
806
- ```
807
-
808
- - `depositRecords` - Retrieve current user's deposit records
809
-
810
- ```ts
811
- depositRecords(input?: DepositRecordsInput): Promise<DepositRecordsReturn>
812
- ```
813
-
814
- ```ts
815
- type DepositRecordType = 'BANK' | 'GCASH' | 'MANUAL' | 'MAYA' | 'MAYA_APP';
816
- type DepositRecordStatus =
817
- | 'PENDING'
818
- | 'ACCEPTED'
819
- | 'APPROVED'
820
- | 'REJECTED'
821
- | 'CONFIRMED'
822
- | 'CANCELLED';
823
-
824
- interface DepositRecordsInput {
825
- first?: number;
826
- after?: string;
827
- filter?: {
828
- type?: {
829
- equal?: DepositRecordType;
830
- notEqual?: DepositRecordType;
831
- in?: DepositRecordType[];
832
- notIn?: DepositRecordType[];
833
- };
834
- status?: {
835
- equal?: DepositRecordStatus;
836
- notEqual?: DepositRecordStatus;
837
- in?: DepositRecordStatus[];
838
- notIn?: DepositRecordStatus[];
839
- };
840
- reference?: {
841
- equal?: string;
842
- notEqual?: string;
843
- in?: string[];
844
- notIn?: string[];
845
- contains?: string;
846
- startsWith?: string;
847
- };
848
- depositNumber?: {
849
- equal?: string;
850
- notEqual?: string;
851
- in?: string[];
852
- notIn?: string[];
853
- contains?: string;
854
- startsWith?: string;
855
- };
856
- dateTimeCreated?: {
857
- equal?: Date | string;
858
- notEqual?: Date | string;
859
- in?: Date | string[];
860
- notIn?: Date | string[];
861
- lesserThan?: Date | string;
862
- lesserThanOrEqual?: Date | string;
863
- greaterThan?: Date | string;
864
- greaterThanOrEqual?: Date | string;
865
- };
866
- dateTimeLastUpdated?: {
867
- equal?: Date | string;
868
- notEqual?: Date | string;
869
- in?: Date | string[];
870
- notIn?: Date | string[];
871
- lesserThan?: Date | string;
872
- lesserThanOrEqual?: Date | string;
873
- greaterThan?: Date | string;
874
- greaterThanOrEqual?: Date | string;
875
- };
876
- };
877
- }
878
-
879
- interface DepositRecord {
880
- id: string;
881
- type: DepositRecordType;
882
- status: DepositRecordStatus;
883
- amount: number;
884
- netAmount: number;
885
- fee: number;
886
- reference?: string;
887
- depositNumber: string;
888
- dateTimeCreated: Date;
889
- dateTimeLastUpdated: Date;
890
- }
891
-
892
- type DepositRecordsReturn =
893
- | {
894
- ok: true;
895
- data: {
896
- depositRecords: (DepositRecord & { cursor: string })[];
897
- totalCount: number;
898
- hasNextPage: boolean;
899
- nextCursor?: string;
900
- };
901
- }
902
- | {
903
- ok: false;
904
- error: HttpError;
905
- };
906
- ```
907
-
908
- - `depositsCount` - Retrieve current user's deposits count
909
-
910
- ```ts
911
- depositsCount(): Promise<DepositsCountReturn>
912
- ```
913
-
914
- ```ts
915
- type DepositsCountReturn =
916
- | {
917
- ok: true;
918
- data: number;
919
- }
920
- | {
921
- ok: false;
922
- error: HttpError;
923
- };
924
- ```
925
-
926
- - `betRecords` - Retrieve current user's bet records
927
-
928
- ```ts
929
- betRecords(input?: BetRecordsInput): Promise<BetRecordsReturn>
930
- ```
931
-
932
- ```ts
933
- type BetRecordStatus = 'STARTED' | 'SETTLED' | 'CANCELLED';
934
-
935
- interface BetRecordsInput {
936
- first?: number;
937
- after?: string;
938
- sort?: SortOrder;
939
- filter?: {
940
- serialCode?: {
941
- equal?: string;
942
- notEqual?: string;
943
- in?: string[];
944
- notIn?: string[];
945
- contains?: string;
946
- startsWith?: string;
947
- };
948
- game?: {
949
- equal?: string;
950
- notEqual?: string;
951
- in?: string[];
952
- notIn?: string[];
953
- };
954
- game__externalId?: {
955
- equal?: string;
956
- notEqual?: string;
957
- in?: string[];
958
- notIn?: string[];
959
- contains?: string;
960
- startsWith?: string;
961
- };
962
- game__type?: {
963
- equal?: GameType;
964
- notEqual?: GameType;
965
- in?: GameType[];
966
- notIn?: GameType[];
967
- };
968
- game__provider?: {
969
- equal?: GameProvider;
970
- notEqual?: GameProvider;
971
- in?: GameProvider[];
972
- notIn?: GameProvider[];
973
- };
974
- dateTimeCreated?: {
975
- equal?: Date | string;
976
- notEqual?: Date | string;
977
- in?: Date | string[];
978
- notIn?: Date | string[];
979
- lesserThan?: Date | string;
980
- lesserThanOrEqual?: Date | string;
981
- greaterThan?: Date | string;
982
- greaterThanOrEqual?: Date | string;
983
- };
984
- vendorRoundId?: {
985
- equal?: string;
986
- notEqual?: string;
987
- in?: string[];
988
- notIn?: string[];
989
- contains?: string;
990
- startsWith?: string;
991
- };
992
- status?: {
993
- equal?: BetRecordStatus;
994
- notEqual?: BetRecordStatus;
995
- in?: BetRecordStatus[];
996
- notIn?: BetRecordStatus[];
997
- };
998
- };
999
- startDateTime?: {
1000
- equal?: Date | string;
1001
- notEqual?: Date | string;
1002
- in?: Date | string[];
1003
- notIn?: Date | string[];
1004
- lesserThan?: Date | string;
1005
- lesserThanOrEqual?: Date | string;
1006
- greaterThan?: Date | string;
1007
- greaterThanOrEqual?: Date | string;
1008
- };
1009
- endDateTime?: {
1010
- equal?: Date | string;
1011
- notEqual?: Date | string;
1012
- in?: Date | string[];
1013
- notIn?: Date | string[];
1014
- lesserThan?: Date | string;
1015
- lesserThanOrEqual?: Date | string;
1016
- greaterThan?: Date | string;
1017
- greaterThanOrEqual?: Date | string;
1018
- };
1019
- }
1020
-
1021
- interface BetRecord {
1022
- id: string;
1023
- game: Game;
1024
- status: BetRecordStatus;
1025
- serialCode: string;
1026
- vendorRoundId?: string;
1027
- bet: number;
1028
- payout: number;
1029
- validBet: number;
1030
- jackpotContribution: number;
1031
- jackpotPayout: number;
1032
- winloss?: number;
1033
- betContent?: string;
1034
- contestName?: string;
1035
- externalCategory?: string;
1036
- dateTimeSettled?: Date;
1037
- dateTimeCreated: Date;
1038
- dateTimeLastUpdated: Date;
1039
- metadata: {
1040
- odds?: string;
1041
- validBet?: number;
1042
- };
1043
- }
1044
-
1045
- type BetRecordsReturn =
1046
- | {
1047
- ok: true;
1048
- data: {
1049
- betRecords: (BetRecord & { cursor: string })[];
1050
- totalCount: number;
1051
- hasNextPage: boolean;
1052
- nextCursor?: string;
1053
- };
1054
- }
1055
- | {
1056
- ok: false;
1057
- error: HttpError;
1058
- };
1059
- ```
1060
-
1061
- - `transactionRecords` - Retrieve current user's transaction records
1062
-
1063
- ```ts
1064
- transactionRecords(input?: TransactionRecordsInput): Promise<TransactionRecordsReturn>
1065
- ```
1066
-
1067
- ```ts
1068
- type TransactionRecordType =
1069
- | 'DEPOSIT'
1070
- | 'PAYOUT'
1071
- | 'WITHDRAWAL_REFUND'
1072
- | 'TRANSFER_IN'
1073
- | 'WITHDRAWAL'
1074
- | 'BET'
1075
- | 'TRANSFER_OUT'
1076
- | 'ROLLBACK'
1077
- | 'BET_REFUND'
1078
- | 'PAYOUT_REFUND'
1079
- | 'CASHBACK_BONUS'
1080
- | 'BONUS'
1081
- | 'RESERVE'
1082
- | 'REJECT_WITHDRAWAL'
1083
- | 'MANUAL_DEPOSIT'
1084
- | 'GCASH_DEPOSIT'
1085
- | 'MANUAL_WITHDRAWAL'
1086
- | 'BANK_WITHDRAWAL'
1087
- | 'GCASH_WITHDRAWAL'
1088
- | 'COMMIT_RESERVE'
1089
- | 'ROLLBACK_PAYOUT'
1090
- | 'ROLLBACK_RESERVE';
1091
-
1092
- interface TransactionRecordsInput {
1093
- first?: number;
1094
- after?: string;
1095
- filter?: {
1096
- type?: {
1097
- equal?: TransactionRecordType;
1098
- notEqual?: TransactionRecordType;
1099
- in?: TransactionRecordType[];
1100
- notIn?: TransactionRecordType[];
1101
- };
1102
- referenceNumber?: {
1103
- equal?: string;
1104
- notEqual?: string;
1105
- in?: string[];
1106
- notIn?: string[];
1107
- contains?: string;
1108
- startsWith?: string;
1109
- };
1110
- dateTimeCreated?: {
1111
- equal?: Date | string;
1112
- notEqual?: Date | string;
1113
- in?: Date | string[];
1114
- notIn?: Date | string[];
1115
- lesserThan?: Date | string;
1116
- lesserThanOrEqual?: Date | string;
1117
- greaterThan?: Date | string;
1118
- greaterThanOrEqual?: Date | string;
1119
- };
1120
- };
1121
- }
1122
-
1123
- interface TransactionRecord {
1124
- id: string;
1125
- type: TransactionRecordType;
1126
- amount: number;
1127
- content?: string;
1128
- currentBalance: number;
1129
- referenceNumber: string;
1130
- dateTimeCreated: Date;
1131
- dateTimeLastUpdated: Date;
1132
- }
1133
-
1134
- type TransactionRecordsReturn =
1135
- | {
1136
- ok: true;
1137
- data: {
1138
- transactionRecords: (TransactionRecord & { cursor: string })[];
1139
- totalCount: number;
1140
- hasNextPage: boolean;
1141
- nextCursor?: string;
1142
- };
1143
- }
1144
- | {
1145
- ok: false;
1146
- error: HttpError;
1147
- };
1148
- ```
1149
-
1150
- - `promos` - Retrieve promos for current platform
1151
-
1152
- ```ts
1153
- promos(): Promise<PromosReturn>
1154
- ```
1155
-
1156
- ```ts
1157
- interface Promo {
1158
- id: string;
1159
- type: 'DEPOSIT';
1160
- name: string;
1161
- banner: {
1162
- id: string;
1163
- url: string;
1164
- status: 'READY';
1165
- dateTimeCreated: Date;
1166
- };
1167
- status: 'ACTIVE' | 'INACTIVE' | 'DISABLED';
1168
- description: string;
1169
- minimumBonusAmount?: number;
1170
- maximumBonusAmount?: number;
1171
- activationStartDateTime: Date;
1172
- activationEndDateTime: Date;
1173
- dateTimeCreated: Date;
1174
- dateTimeLastUpdated: Date;
1175
- }
1176
-
1177
- type PromosReturn =
1178
- | {
1179
- ok: true;
1180
- data: Promo[];
1181
- }
1182
- | {
1183
- ok: false;
1184
- error: HttpError;
1185
- };
1186
- ```
1187
-
1188
- - `availablePromos` - Retrieve available promos for current user
1189
-
1190
- ```ts
1191
- availablePromos(): Promise<PromosReturn>
1192
- ```
1193
-
1194
- - `bonus` - Retrieve current user's bonus details
1195
-
1196
- ```ts
1197
- bonus(): Promise<BonusReturn>
1198
- ```
1199
-
1200
- ```ts
1201
- interface Bonus {
1202
- id: string;
1203
- promo: Promo;
1204
- deposit?: {
1205
- type: DepositRecordType;
1206
- status: DepositRecordStatus;
1207
- amount: number;
1208
- netAmount: number;
1209
- fee: number;
1210
- reference?: string;
1211
- dateTimeCreated: Date;
1212
- dateTimeLastUpdated: Date;
1213
- };
1214
- amount: number;
1215
- balance: number;
1216
- turnoverRequirement: number;
1217
- currentTurnoverRequirementContribution: number;
1218
- currentTurnoverRequirementContributionPercentage: number;
1219
- expiration: Date;
1220
- dateTimeCreated: Date;
1221
- dateTimeLastUpdated: Date;
1222
- }
1223
-
1224
- type BonusReturn =
1225
- | {
1226
- ok: true;
1227
- data: Bonus | null;
1228
- }
1229
- | {
1230
- ok: false;
1231
- error: HttpError;
1232
- };
1233
- ```
1234
-
1235
- - `cashbacks` - Retrieve cashbacks for current platform
1236
-
1237
- ```ts
1238
- cashbacks(): Promise<CashbackReturn>
1239
- ```
1240
-
1241
- ```ts
1242
- interface Cashback {
1243
- id: string;
1244
- name: string;
1245
- banner: {
1246
- id: string;
1247
- url: string;
1248
- status: 'READY';
1249
- dateTimeCreated: Date;
1250
- };
1251
- status: CashbackStatus;
1252
- description: string;
1253
- activationStartDateTime: Date;
1254
- activationEndDateTime: Date;
1255
- dateTimeCreated: Date;
1256
- dateTimeLastUpdated: Date;
1257
- }
1258
-
1259
- type CashbackReturn =
1260
- | {
1261
- ok: true;
1262
- data: Cashback[];
1263
- }
1264
- | {
1265
- ok: false;
1266
- error: HttpError;
1267
- };
1268
- ```
1269
-
1270
- - `cashbackBonuses` - Retrieve current user's cashback bonuses
1271
-
1272
- ```ts
1273
- cashbackBonuses(): Promise<CashbackBonusesReturn>
1274
- ```
1275
-
1276
- ```ts
1277
- interface CashbackBonus {
1278
- id: string;
1279
- balance: number;
1280
- cashback: Cashback;
1281
- dateTimeCreated: Date;
1282
- dateTimeLastUpdated: Date;
1283
- }
1284
-
1285
- type CashbackBonusesReturn =
1286
- | {
1287
- ok: true;
1288
- data: CashbackBonus[];
1289
- }
1290
- | {
1291
- ok: false;
1292
- error: HttpError;
1293
- };
1294
- ```
1295
-
1296
- - `claimCashbackBonus` - Claim cashback bonus
1297
-
1298
- ```ts
1299
- claimCashbackBonus(id: string): Promise<ClaimCashbackBonusReturn>
1300
- ```
1301
-
1302
- ```ts
1303
- type ClaimCashbackBonusReturn =
1304
- | {
1305
- ok: true;
1306
- }
1307
- | {
1308
- ok: false;
1309
- error:
1310
- | HttpError
1311
- | {
1312
- code: 'CashbackBonusDoesNotExistError';
1313
- message: string;
1314
- };
1315
- };
1316
- ```
1317
-
1318
- - `games` - Retrieve games
1319
-
1320
- ```ts
1321
- games(input?: GamesInput): Promise<GamesReturn>
1322
- ```
1323
-
1324
- ```ts
1325
- type GameType = 'SLOTS' | 'SPORTS' | 'BINGO' | 'FISHING' | 'LIVE' | 'GAMES';
1326
- type GameProvider =
1327
- | 'JILI'
1328
- | 'PGSOFT'
1329
- | 'FACHAI'
1330
- | 'PLAYTECH'
1331
- | 'CQ9'
1332
- | 'JDB'
1333
- | 'BOOONGO'
1334
- | 'HABANERO'
1335
- | 'RELAXGAMING'
1336
- | 'DG'
1337
- | 'E2E'
1338
- | 'BTI'
1339
- | 'DARWIN'
1340
- | 'MEGABALL'
1341
- | 'DRBINGO'
1342
- | 'RTG';
1343
-
1344
- interface GamesInput {
1345
- after?: string;
1346
- first?: number;
1347
- filter?: {
1348
- id?: {
1349
- equal?: string;
1350
- notEqual?: string;
1351
- in?: string[];
1352
- notIn?: string[];
1353
- };
1354
- name?: {
1355
- equal?: string;
1356
- notEqual?: string;
1357
- in?: string[];
1358
- notIn?: string[];
1359
- contains?: string;
1360
- startsWith?: string;
1361
- };
1362
- type?: {
1363
- equal?: GameType;
1364
- notEqual?: GameType;
1365
- in?: GameType[];
1366
- notIn?: GameType[];
1367
- };
1368
- provider?: {
1369
- equal?: GameProvider;
1370
- notEqual?: GameProvider;
1371
- in?: GameProvider[];
1372
- notIn?: GameProvider[];
1373
- };
1374
- };
1375
- }
1376
-
1377
- interface Game {
1378
- id: string;
1379
- type: GameType;
1380
- name: string;
1381
- image: string;
1382
- provider: GameProvider;
1383
- }
1384
-
1385
- type GamesReturn =
1386
- | {
1387
- ok: true;
1388
- data: {
1389
- games: (Game & { cursor: string })[];
1390
- totalCount: number;
1391
- hasNextPage: boolean;
1392
- nextCursor?: string;
1393
- };
1394
- }
1395
- | {
1396
- ok: false;
1397
- error: HttpError;
1398
- };
1399
- ```
1400
-
1401
- - `gameSession` - Retrieve game session details
1402
-
1403
- ```ts
1404
- gameSession(id: string): Promise<GameSessionReturn>
1405
- ```
1406
-
1407
- ```ts
1408
- type GameSession =
1409
- | {
1410
- id: string;
1411
- game: Game;
1412
- status: 'READY';
1413
- launchUrl: string;
1414
- dateTimeCreated: Date;
1415
- dateTimeLastUpdated: Date;
1416
- }
1417
- | {
1418
- id: string;
1419
- game: Game;
1420
- status: 'PENDING' | 'STARTING' | 'ENDED' | 'CANCELLED';
1421
- dateTimeCreated: Date;
1422
- dateTimeLastUpdated: Date;
1423
- };
1424
-
1425
- type GameSessionReturn =
1426
- | {
1427
- ok: true;
1428
- data: GameSession | null;
1429
- }
1430
- | {
1431
- ok: false;
1432
- error: HttpError;
1433
- };
1434
- ```
1435
-
1436
- - `createGameSession` - Create new game session
1437
-
1438
- ```ts
1439
- createGameSession(input:CreateGameSessionInput): Promise<CreateGameSessionReturn>
1440
- ```
1441
-
1442
- ```ts
1443
- interface CreateGameSessionInput {
1444
- id?: string;
1445
- game: string;
1446
- }
1447
-
1448
- type CreateGameSessionReturn =
1449
- | {
1450
- ok: true;
1451
- data: {
1452
- id: string;
1453
- };
1454
- }
1455
- | {
1456
- ok: false;
1457
- error:
1458
- | HttpError
1459
- | {
1460
- code: 'GameDoesNotExistError';
1461
- message: string;
1462
- };
1463
- };
1464
- ```
1465
-
1466
- - `endGameSession` - End game session
1467
-
1468
- ```ts
1469
- endGameSession(id: string): Promise<EndGameSessionReturn>
1470
- ```
1471
-
1472
- ```ts
1473
- type EndGameSessionReturn =
1474
- | {
1475
- ok: true;
1476
- }
1477
- | {
1478
- ok: false;
1479
- error: HttpError | UnknownError;
1480
- };
1481
- ```
1482
-
1483
- - `file` - Retrieve file details
1484
-
1485
- ```ts
1486
- file(id: string): Promise<FileReturn>
1487
- ```
1488
-
1489
- ```ts
1490
- type File =
1491
- | {
1492
- id: string;
1493
- url?: never;
1494
- status: 'UPLOADING' | 'FAILED';
1495
- dateTimeCreated: Date;
1496
- }
1497
- | {
1498
- id: string;
1499
- url: string;
1500
- status: 'READY';
1501
- dateTimeCreated: Date;
1502
- }
1503
- | {
1504
- id: string;
1505
- url?: string;
1506
- status: 'DELETED';
1507
- dateTimeCreated: Date;
1508
- };
1509
-
1510
- type FileReturn =
1511
- | {
1512
- ok: true;
1513
- data: File | null;
1514
- }
1515
- | {
1516
- ok: false;
1517
- error: HttpError;
1518
- };
1519
- ```
1520
-
1521
- - `uploadImageFile` - Upload image file
1522
-
1523
- ```ts
1524
- uploadImageFile(input: globalThis.File): Promise<UploadImageFileReturn>
1525
- ```
1526
-
1527
- ```ts
1528
- type UploadImageFileReturn =
1529
- | {
1530
- ok: true;
1531
- data: {
1532
- id: string;
1533
- };
1534
- }
1535
- | {
1536
- ok: false;
1537
- error:
1538
- | HttpError
1539
- | {
1540
- code: 'FileFormatNotSupportedError' | 'FileNameTooLongError' | 'FileSizeTooBigError';
1541
- message: string;
1542
- };
1543
- };
1544
- ```
1545
-
1546
- - `pointsWallet` - Retrieve current user's points wallet details
1547
-
1548
- ```ts
1549
- pointsWallet(): Promise<PointsWalletReturn>
1550
- ```
1551
-
1552
- ```ts
1553
- interface PointsWallet {
1554
- id: string;
1555
- points: number;
1556
- account: string;
1557
- dateTimeCreated: Date;
1558
- }
1559
-
1560
- type PointsWalletReturn =
1561
- | {
1562
- ok: true;
1563
- data: PointsWallet | null;
1564
- }
1565
- | {
1566
- ok: false;
1567
- error: HttpError;
1568
- };
1569
- ```
1570
-
1571
- - `pointsToCashConversion` - Convert points to cash
1572
-
1573
- ```ts
1574
- pointsToCashConversion(amount: number): Promise<PointsToCashConversionReturn>
1575
- ```
1576
-
1577
- ```ts
1578
- type PointsToCashConversionReturn =
1579
- | {
1580
- ok: true;
1581
- }
1582
- | {
1583
- ok: false;
1584
- error:
1585
- | HttpError
1586
- | {
1587
- code: 'InsufficientPointsError';
1588
- message: string;
1589
- };
1590
- };
1591
- ```
1
+ ## Opexa Portal SDK
2
+
3
+ A library that provides a set of functions to interact with Opexa Portal API.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @highoutputventures/opexa-portal-sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ - Create sdk instance
14
+
15
+ ```ts
16
+ // lib/sdk.js
17
+ import Sdk from '@highoutputventures/opexa-portal-sdk';
18
+
19
+ export const sdk = new Sdk({
20
+ platform: 'Z892',
21
+ baseUrl: 'https://portal.development.opexa.io',
22
+ });
23
+ ```
24
+
25
+ - Use sdk instance
26
+
27
+ ```jsx
28
+ import { sdk } from '$lib/sdk';
29
+ import * as React from 'react';
30
+
31
+ function Page() {
32
+ const [account, setAccount] = React.useState();
33
+
34
+ React.useEffect(function () {
35
+ sdk.account().then(setAccount);
36
+ }, []);
37
+
38
+ return (
39
+ <pre>
40
+ <code>{JSON.stringify(account, null, 2)}</code>
41
+ </pre>
42
+ );
43
+ }
44
+ ```
45
+
46
+ ## API
47
+
48
+ ### `Sdk`
49
+
50
+ `Sdk` accepts the following options:
51
+
52
+ - `*platform` - The platform to be used
53
+ - `*environment` - Whether to use production/development api
54
+
55
+ , and returns the following methods:
56
+
57
+ - `signIn` - Start user session
58
+
59
+ ```ts
60
+ signIn(input: SignInInput): Promise<SignInReturn>
61
+ ```
62
+
63
+ ```ts
64
+ type SignInInput =
65
+ | {
66
+ name: string;
67
+ password: string;
68
+ }
69
+ | {
70
+ mobileNumber: string;
71
+ verificationCode: string;
72
+ };
73
+
74
+ type SignInReturn =
75
+ | {
76
+ ok: true;
77
+ }
78
+ | {
79
+ ok: false;
80
+ error:
81
+ | HttpError
82
+ | {
83
+ code: 'AccountNotFound';
84
+ message: string;
85
+ };
86
+ };
87
+ ```
88
+
89
+ - `signOut` - End current user session
90
+
91
+ ```ts
92
+ signOut(): Promise<void>
93
+ ```
94
+
95
+ - `platform` - Retrieve current platform details
96
+
97
+ ```ts
98
+ platform(): Promise<PlatformReturn>
99
+ ```
100
+
101
+ ```ts
102
+ interface Platform {
103
+ paymentSettings: {
104
+ minimumFirstDepositAmount?: number;
105
+ restrictWithdrawalsToVerifiedMembers: boolean;
106
+ depositGateway: {
107
+ bank: GatewaySettings;
108
+ gcash: GatewaySettings;
109
+ maya: GatewaySettings;
110
+ mayaApp: GatewaySettings;
111
+ };
112
+ withdrawalGateway: {
113
+ bank: GatewaySettings;
114
+ gcash: GatewaySettings;
115
+ maya: GatewaySettings;
116
+ mayaApp: GatewaySettings;
117
+ };
118
+ };
119
+ pointsClubSettings: {
120
+ multiplier: number;
121
+ };
122
+ }
123
+
124
+ type PlatformReturn =
125
+ | {
126
+ ok: true;
127
+ data: Platform;
128
+ }
129
+ | {
130
+ ok: false;
131
+ error: HttpError;
132
+ };
133
+ ```
134
+
135
+ - `account` - Retrieve current user's details
136
+
137
+ ```ts
138
+ account(): Promise<AccountReturn>
139
+ ```
140
+
141
+ ```ts
142
+ interface Account {
143
+ id: string;
144
+ name: string;
145
+ status: MemberAccountStatus;
146
+ realName?: string;
147
+ nickName?: string;
148
+ dateOfBirth?: Date;
149
+ validId?: string;
150
+ emailAddress?: string;
151
+ mobileNumber?: string;
152
+ verified: boolean;
153
+ verificationStatus: MemberAccountVerificationStatus;
154
+ mobileNumberVerified: boolean;
155
+ mobileNumberVerificationRequired: boolean;
156
+ transactionPassword: boolean;
157
+ dateTimeLastActive?: Date;
158
+ dateTimeCreated: Date;
159
+ dateTimeLastUpdated: Date;
160
+ }
161
+
162
+ type AccountReturn =
163
+ | {
164
+ ok: true;
165
+ data: Account;
166
+ }
167
+ | {
168
+ ok: false;
169
+ error: HttpError;
170
+ };
171
+ ```
172
+
173
+ - `createAccount` - Create new user account
174
+
175
+ ```ts
176
+ createAccount(input: CreateAccountInput): Promise<CreateAccountReturn>
177
+ ```
178
+
179
+ ```ts
180
+ interface CreateAccountInput {
181
+ id?: string;
182
+ name: string;
183
+ password: string;
184
+ mobileNumber: string;
185
+ dateOfBirth: string;
186
+ btag?: string;
187
+ domain?: string;
188
+ referralCode?: string;
189
+ verificationCode?: string;
190
+ reCAPTCHAResponse?: string;
191
+ }
192
+
193
+ type CreateAccountReturn =
194
+ | {
195
+ ok: true;
196
+ error?: never;
197
+ data: {
198
+ id: string;
199
+ };
200
+ }
201
+ | {
202
+ ok: false;
203
+ data?: never;
204
+ error:
205
+ | HttpError
206
+ | {
207
+ code:
208
+ | 'AccountNameNotAvailableError'
209
+ | 'InvalidPlatformError'
210
+ | 'InvalidReCAPTCHAResponseError'
211
+ | 'InvalidSMSVerificationCodeError'
212
+ | 'MinimumAgeRequirementError'
213
+ | 'MobileNumberNotAvailableError';
214
+ message: string;
215
+ };
216
+ };
217
+ ```
218
+
219
+ - `updateAccount` - Update current user's details
220
+
221
+ ```ts
222
+ updateAccount(input: UpdateAccountInput): Promise<UpdateAccountReturn>
223
+ ```
224
+
225
+ ```ts
226
+ type UpdateAccountReturn =
227
+ | {
228
+ ok: true;
229
+ data?: never;
230
+ error?: never;
231
+ }
232
+ | {
233
+ ok: false;
234
+ data?: never;
235
+ error: {
236
+ code:
237
+ | 'AccountNameNotAvailableError'
238
+ | 'EmailAddressNotAvailableError'
239
+ | 'InvalidTransactionPasswordError'
240
+ | 'MobileNumberNotAvailableError'
241
+ | 'NickNameNotAvailableError'
242
+ | 'RealNameAlreadySetError'
243
+ | 'ValidIdAlreadySetError';
244
+ message: string;
245
+ };
246
+ };
247
+ ```
248
+
249
+ - `deleteAccount` - Delete current user's account
250
+
251
+ ```ts
252
+ deleteAccount(id: string): Promise<DeleteAccountReturn>
253
+ ```
254
+
255
+ ```ts
256
+ type DeleteAccountReturn =
257
+ | {
258
+ ok: true;
259
+ }
260
+ | {
261
+ ok: false;
262
+ error: UnknownError | HttpError;
263
+ };
264
+ ```
265
+
266
+ - `resetPassword` - Reset user's password
267
+
268
+ ```ts
269
+ resetPassword(input: ResetPasswordInput): Promise<ResetPasswordReturn>
270
+ ```
271
+
272
+ ```ts
273
+ interface ResetPasswordInput {
274
+ mobileNumber: string;
275
+ newPassword: string;
276
+ verificationCode: string;
277
+ }
278
+
279
+ type ResetPasswordReturn =
280
+ | {
281
+ ok: true;
282
+ }
283
+ | {
284
+ ok: false;
285
+ error:
286
+ | HttpError
287
+ | {
288
+ code: 'AccountNotFoundError' | 'InvalidVerificationCodeError';
289
+ message: string;
290
+ };
291
+ };
292
+ ```
293
+
294
+ - `verificationDetails` - Retrieve user's verification details
295
+
296
+ ```ts
297
+ verificationDetails(): Promise<VerificationDetailsReturn>
298
+ ```
299
+
300
+ ```ts
301
+ interface VerificationDetails {
302
+ id: string;
303
+ status: MemberVerificationStatus;
304
+ address: string;
305
+ sourceOfIncome: string;
306
+ natureOfWork: string;
307
+ nationality: string;
308
+ placeOfBirth: string;
309
+ idFrontImage: File;
310
+ selfieImage: File;
311
+ }
312
+
313
+ type VerificationDetailsReturn =
314
+ | {
315
+ ok: true;
316
+ data: VerificationDetails;
317
+ }
318
+ | {
319
+ ok: false;
320
+ error: HttpError;
321
+ };
322
+ ```
323
+
324
+ - `submitVerificationDetails` - Submit current user's verification details
325
+
326
+ ```ts
327
+ submitVerificationDetails(input: SubmitVerificationDetailsInput): Promise<SubmitVerificationDetailsReturn>
328
+ ```
329
+
330
+ ```ts
331
+ interface SubmitVerificationDetailsInput {
332
+ id?: string;
333
+ idFrontImage: string;
334
+ selfieImage: string;
335
+ address: string;
336
+ sourceOfIncome: string;
337
+ natureOfWork: string;
338
+ nationality: string;
339
+ placeOfBirth: string;
340
+ }
341
+
342
+ type SubmitVerificationDetailsReturn =
343
+ | {
344
+ ok: true;
345
+ data: {
346
+ id: string;
347
+ };
348
+ }
349
+ | {
350
+ ok: false;
351
+ error:
352
+ | HttpError
353
+ | {
354
+ code:
355
+ | 'FileDoesNotExistError'
356
+ | 'FileNotReadyError'
357
+ | 'MemberVerificationAlreadyExistsError';
358
+ message: string;
359
+ };
360
+ };
361
+ ```
362
+
363
+ - `updateVerificationDetails` - Update current user's verification details
364
+
365
+ ```ts
366
+ updateVerificationDetails(input: UpdateVerificationDetailsInput): Promise<UpdateVerificationDetailsReturn>
367
+ ```
368
+
369
+ ```ts
370
+ interface UpdateVerificationDetailsInput {
371
+ idFrontImage: string;
372
+ selfieImage: string;
373
+ address: string;
374
+ sourceOfIncome: string;
375
+ natureOfWork: string;
376
+ nationality: string;
377
+ placeOfBirth: string;
378
+ }
379
+
380
+ type UpdateVerificationDetailsReturn =
381
+ | {
382
+ ok: true;
383
+ }
384
+ | {
385
+ ok: false;
386
+ error:
387
+ | HttpError
388
+ | {
389
+ code:
390
+ | 'FileDoesNotExistError'
391
+ | 'FileNotReadyError'
392
+ | 'MemberVerificationAlreadyApprovedError'
393
+ | 'MemberVerificationDoesNotExistError';
394
+ message: string;
395
+ };
396
+ };
397
+ ```
398
+
399
+ - `verifyMobileNumber` - Verify current user's mobile number
400
+
401
+ ```ts
402
+ verifyMobileNumber(verificationCode: string): Promise<VerifyMobileNumberReturn>
403
+ ```
404
+
405
+ ```ts
406
+ type VerifyMobileNumberReturn =
407
+ | {
408
+ ok: true;
409
+ }
410
+ | {
411
+ ok: false;
412
+ error:
413
+ | HttpError
414
+ | {
415
+ code: 'InvalidSMSVerificationCodeError' | 'MobileNumberAlreadyVerifiedError';
416
+ message: string;
417
+ };
418
+ };
419
+ ```
420
+
421
+ - `profileCompletion` - Retrieve current user's profile completion status
422
+
423
+ ```ts
424
+ profileCompletion(): Promise<ProfileCompletionReturn>
425
+ ```
426
+
427
+ ```ts
428
+ interface ProfileCompletion {
429
+ completionPercentage: number;
430
+ personalInformation: boolean;
431
+ accountVerification: boolean;
432
+ mobileNumberVerification: boolean;
433
+ transactionPassword: boolean;
434
+ accountPassword: boolean;
435
+ }
436
+
437
+ type ProfileCompletionReturn =
438
+ | {
439
+ ok: true;
440
+ data: ProfileCompletion;
441
+ }
442
+ | {
443
+ ok: false;
444
+ error: HttpError;
445
+ };
446
+ ```
447
+
448
+ - `sendVerificationCode` - Send verification code to mobile number or email address
449
+
450
+ ```ts
451
+ sendVerificationCode(mobileNumber: string): Promise<SendVerificationCodeReturn>
452
+ ```
453
+
454
+ ```ts
455
+ type SendVerificationCodeReturn =
456
+ | {
457
+ ok: true;
458
+ }
459
+ | {
460
+ ok: false;
461
+ error:
462
+ | HttpError
463
+ | {
464
+ code: 'InvalidPlatformError' | 'NotReadyToSendVerficationCodeError';
465
+ message: string;
466
+ };
467
+ };
468
+ ```
469
+
470
+ - `wallet` - Retrieve current user's wallet details
471
+
472
+ ```ts
473
+ wallet(): Promise<WalletReturn>
474
+ ```
475
+
476
+ ```ts
477
+ interface Wallet {
478
+ id: string;
479
+ balance: number;
480
+ currency: Currency;
481
+ dateTimeCreated: Date;
482
+ dateTimeLastUpdated: Date;
483
+ }
484
+
485
+ type WalletReturn =
486
+ | {
487
+ ok: true;
488
+ data: Wallet | null;
489
+ }
490
+ | {
491
+ ok: false;
492
+ error: HttpError;
493
+ };
494
+ ```
495
+
496
+ - `announcements` - Retrieve announcements for current platform
497
+
498
+ ```ts
499
+ announcements(input?: AnnouncementsInput): Promise<AnnouncementsReturn>
500
+ ```
501
+
502
+ ```ts
503
+ interface AnnouncementsInput {
504
+ first?: number;
505
+ after?: string;
506
+ }
507
+
508
+ interface Announcement {
509
+ id: string;
510
+ type: 'RELEASE' | 'SCHEDULED_MAINTENANCE';
511
+ title: string;
512
+ status: 'ACTIVE' | 'INACTIVE';
513
+ message: string;
514
+ activationStartDateTime: Date;
515
+ activationEndDateTime: Date;
516
+ dateTimeCreated: Date;
517
+ dateTimeLastUpdated: Date;
518
+ }
519
+
520
+ type AnnouncementsReturn =
521
+ | {
522
+ ok: true;
523
+ data: {
524
+ announcements: (Announcement & { cursor: string })[];
525
+ totalCount: number;
526
+ hasNextPage: boolean;
527
+ nextCursor?: string;
528
+ };
529
+ }
530
+ | {
531
+ ok: false;
532
+ error: HttpError;
533
+ };
534
+ ```
535
+
536
+ - `createWithdrawal` - Create new withdrawal request
537
+
538
+ ```ts
539
+ createWithdrawal(input: CreateWithdrawalInput): Promise<CreateWithdrawalReturn>
540
+ ```
541
+
542
+ ```ts
543
+ interface CreateBankWithdrawalInput {
544
+ id?: string;
545
+ type: 'BANK';
546
+ amount: number;
547
+ transactionPassword: string;
548
+ }
549
+
550
+ interface CreateGCashWithdrawalInput {
551
+ id?: string;
552
+ type: 'GCASH';
553
+ amount: number;
554
+ transactionPassword: string;
555
+ recipientMobileNumber: string;
556
+ }
557
+
558
+ interface CreateMayaWithdrawalInput {
559
+ id?: string;
560
+ type: 'MAYA';
561
+ amount: number;
562
+ transactionPassword: string;
563
+ recipientMobileNumber: string;
564
+ }
565
+
566
+ interface CreateMayaAppWithdrawalInput {
567
+ id?: string;
568
+ type: 'MAYA_APP';
569
+ amount: number;
570
+ transactionPassword: string;
571
+ }
572
+
573
+ type CreateWithdrawalInput =
574
+ | CreateBankWithdrawalInput
575
+ | CreateGCashWithdrawalInput
576
+ | CreateMayaWithdrawalInput
577
+ | CreateMayaAppWithdrawalInput;
578
+
579
+ type CreateWithdrawalReturn =
580
+ | {
581
+ ok: true;
582
+ data: {
583
+ id: string;
584
+ };
585
+ }
586
+ | {
587
+ ok: false;
588
+ error:
589
+ | HttpError
590
+ | {
591
+ code:
592
+ | 'MobileNumberNotVerifiedError'
593
+ | 'AccountNotVerifiedError'
594
+ | 'InvalidWithdrawalAmountError'
595
+ | 'WithdrawalDailyLimitExceededError'
596
+ | 'InvalidTransactionPasswordError'
597
+ | 'NotEnoughBalanceError';
598
+ message: string;
599
+ };
600
+ };
601
+ ```
602
+
603
+ - `withdrawalRecords` - Retrieve current user's withdrawal records
604
+
605
+ ```ts
606
+ withdrawalRecords(input?: WithdrawalRecordsInput): Promise<WithdrawalRecordsReturn>
607
+ ```
608
+
609
+ ```ts
610
+ type WithdrawalRecordType = 'MANUAL' | 'BANK' | 'GCASH' | 'MAYA';
611
+ type WithdrawalRecordStatus = 'PENDING' | 'APPROVED' | 'REJECTED' | 'CONFIRMED' | 'CANCELLED';
612
+
613
+ interface WithdrawalRecordsInput {
614
+ first?: number;
615
+ after?: string;
616
+ filter?: {
617
+ type?: {
618
+ equal?: WithdrawalRecordType;
619
+ notEqual?: WithdrawalRecordType;
620
+ in?: WithdrawalRecordType[];
621
+ notIn?: WithdrawalRecordType[];
622
+ };
623
+ status?: {
624
+ equal?: WithdrawalRecordStatus;
625
+ notEqual?: WithdrawalRecordStatus;
626
+ in?: WithdrawalRecordStatus[];
627
+ notIn?: WithdrawalRecordStatus[];
628
+ };
629
+ reference?: {
630
+ equal?: string;
631
+ notEqual?: string;
632
+ in?: string[];
633
+ notIn?: string[];
634
+ contains?: string;
635
+ startsWith?: string;
636
+ };
637
+ withdrawalNumber?: {
638
+ equal?: string;
639
+ notEqual?: string;
640
+ in?: string[];
641
+ notIn?: string[];
642
+ contains?: string;
643
+ startsWith?: string;
644
+ };
645
+ dateTimeCreated?: {
646
+ equal?: Date | string;
647
+ notEqual?: Date | string;
648
+ in?: Date | string[];
649
+ notIn?: Date | string[];
650
+ lesserThan?: Date | string;
651
+ lesserThanOrEqual?: Date | string;
652
+ greaterThan?: Date | string;
653
+ greaterThanOrEqual?: Date | string;
654
+ };
655
+ dateTimeLastUpdated?: {
656
+ equal?: Date | string;
657
+ notEqual?: Date | string;
658
+ in?: Date | string[];
659
+ notIn?: Date | string[];
660
+ lesserThan?: Date | string;
661
+ lesserThanOrEqual?: Date | string;
662
+ greaterThan?: Date | string;
663
+ greaterThanOrEqual?: Date | string;
664
+ };
665
+ };
666
+ }
667
+
668
+ interface WithdrawalRecord {
669
+ id: string;
670
+ type: WithdrawalRecordType;
671
+ bank?: 'AUBKPHMM' | 'MBTCPHMM' | 'BNORPHMM' | 'MKRUPHM1';
672
+ fee: number;
673
+ amount: number;
674
+ netAmount: number;
675
+ status: WithdrawalRecordStatus;
676
+ reference?: string;
677
+ withdrawalNumber: string;
678
+ recipientMobileNumber?: string;
679
+ dateTimeConfirmed?: Date;
680
+ dateTimeCreated: Date;
681
+ dateTimeLastUpdated: Date;
682
+ }
683
+
684
+ type WithdrawalRecordsReturn =
685
+ | {
686
+ ok: true;
687
+ data: {
688
+ withdrawalRecords: (WithdrawalRecord & { cursor: string })[];
689
+ totalCount: number;
690
+ hasNextPage: boolean;
691
+ nextCursor?: string;
692
+ };
693
+ }
694
+ | {
695
+ ok: false;
696
+ error: HttpError;
697
+ };
698
+ ```
699
+
700
+ - `remainingDailyWithdrawalsCount` - Retrieve current user's remaining daily withdrawals count
701
+
702
+ ```ts
703
+ remainingDailyWithdrawalsCount(): Promise<RemainingDailyWithdrawalsCountReturn>
704
+ ```
705
+
706
+ ```ts
707
+ type RemainingDailyWithdrawalsCountReturn =
708
+ | {
709
+ ok: true;
710
+ data: number;
711
+ }
712
+ | {
713
+ ok: false;
714
+ error: HttpError;
715
+ };
716
+ ```
717
+
718
+ - `createDeposit` - Create new deposit request
719
+
720
+ ```ts
721
+ createDeposit(input: CreateDepositInput): Promise<CreateDepositReturn>
722
+ ```
723
+
724
+ ```ts
725
+ interface CreateMayaDepositInput {
726
+ id?: string;
727
+ type: 'MAYA';
728
+ amount: number;
729
+ promo?: string;
730
+ }
731
+
732
+ interface CreateGCashDepositInput {
733
+ id?: string;
734
+ type: 'GCASH';
735
+ amount: number;
736
+ promo?: string;
737
+ }
738
+
739
+ interface CreateMayaAppDepositInput {
740
+ id?: string;
741
+ type: 'MAYA_APP';
742
+ amount: number;
743
+ promo?: string;
744
+ }
745
+
746
+ type CreateDepositInput =
747
+ | CreateMayaDepositInput
748
+ | CreateGCashDepositInput
749
+ | CreateMayaAppDepositInput;
750
+
751
+ type CreateDepositReturn =
752
+ | {
753
+ ok: true;
754
+ data: {
755
+ id: string;
756
+ };
757
+ }
758
+ | {
759
+ ok: false;
760
+ error:
761
+ | HttpError
762
+ | {
763
+ code:
764
+ | 'DepositPromoMaximumAmountExceededError'
765
+ | 'DepositPromoMinimumAmountNotMetError'
766
+ | 'HasActiveBonusError'
767
+ | 'MaximumDepositAmountExceededError'
768
+ | 'MinimumDepositAmountNotMetError'
769
+ | 'MinimumFirstDepositAmountNotMetError'
770
+ | 'PromoNotEnabledError'
771
+ | 'WalletDoesNotExistError';
772
+ message: string;
773
+ };
774
+ };
775
+ ```
776
+
777
+ - `deposit` - Retrieve deposit details
778
+
779
+ ```ts
780
+ deposit(id: string): Promise<DepositReturn>
781
+ ```
782
+
783
+ ```ts
784
+ interface Deposit {
785
+ id: string;
786
+ type: 'BANK' | 'GCASH' | 'MANUAL' | 'MAYA' | 'MAYA_APP';
787
+ status: 'PENDING' | 'ACCEPTED' | 'APPROVED' | 'REJECTED' | 'CONFIRMED' | 'CANCELLED';
788
+ amount: number;
789
+ netAmount: number;
790
+ fee: number;
791
+ reference?: string;
792
+ checkoutUrl?: string;
793
+ dateTimeCreated: Date;
794
+ dateTimeLastUpdated: Date;
795
+ }
796
+
797
+ type DepositReturn =
798
+ | {
799
+ ok: true;
800
+ data: Deposit | null;
801
+ }
802
+ | {
803
+ ok: false;
804
+ error: HttpError;
805
+ };
806
+ ```
807
+
808
+ - `depositRecords` - Retrieve current user's deposit records
809
+
810
+ ```ts
811
+ depositRecords(input?: DepositRecordsInput): Promise<DepositRecordsReturn>
812
+ ```
813
+
814
+ ```ts
815
+ type DepositRecordType = 'BANK' | 'GCASH' | 'MANUAL' | 'MAYA' | 'MAYA_APP';
816
+ type DepositRecordStatus =
817
+ | 'PENDING'
818
+ | 'ACCEPTED'
819
+ | 'APPROVED'
820
+ | 'REJECTED'
821
+ | 'CONFIRMED'
822
+ | 'CANCELLED';
823
+
824
+ interface DepositRecordsInput {
825
+ first?: number;
826
+ after?: string;
827
+ filter?: {
828
+ type?: {
829
+ equal?: DepositRecordType;
830
+ notEqual?: DepositRecordType;
831
+ in?: DepositRecordType[];
832
+ notIn?: DepositRecordType[];
833
+ };
834
+ status?: {
835
+ equal?: DepositRecordStatus;
836
+ notEqual?: DepositRecordStatus;
837
+ in?: DepositRecordStatus[];
838
+ notIn?: DepositRecordStatus[];
839
+ };
840
+ reference?: {
841
+ equal?: string;
842
+ notEqual?: string;
843
+ in?: string[];
844
+ notIn?: string[];
845
+ contains?: string;
846
+ startsWith?: string;
847
+ };
848
+ depositNumber?: {
849
+ equal?: string;
850
+ notEqual?: string;
851
+ in?: string[];
852
+ notIn?: string[];
853
+ contains?: string;
854
+ startsWith?: string;
855
+ };
856
+ dateTimeCreated?: {
857
+ equal?: Date | string;
858
+ notEqual?: Date | string;
859
+ in?: Date | string[];
860
+ notIn?: Date | string[];
861
+ lesserThan?: Date | string;
862
+ lesserThanOrEqual?: Date | string;
863
+ greaterThan?: Date | string;
864
+ greaterThanOrEqual?: Date | string;
865
+ };
866
+ dateTimeLastUpdated?: {
867
+ equal?: Date | string;
868
+ notEqual?: Date | string;
869
+ in?: Date | string[];
870
+ notIn?: Date | string[];
871
+ lesserThan?: Date | string;
872
+ lesserThanOrEqual?: Date | string;
873
+ greaterThan?: Date | string;
874
+ greaterThanOrEqual?: Date | string;
875
+ };
876
+ };
877
+ }
878
+
879
+ interface DepositRecord {
880
+ id: string;
881
+ type: DepositRecordType;
882
+ status: DepositRecordStatus;
883
+ amount: number;
884
+ netAmount: number;
885
+ fee: number;
886
+ reference?: string;
887
+ depositNumber: string;
888
+ dateTimeCreated: Date;
889
+ dateTimeLastUpdated: Date;
890
+ }
891
+
892
+ type DepositRecordsReturn =
893
+ | {
894
+ ok: true;
895
+ data: {
896
+ depositRecords: (DepositRecord & { cursor: string })[];
897
+ totalCount: number;
898
+ hasNextPage: boolean;
899
+ nextCursor?: string;
900
+ };
901
+ }
902
+ | {
903
+ ok: false;
904
+ error: HttpError;
905
+ };
906
+ ```
907
+
908
+ - `depositsCount` - Retrieve current user's deposits count
909
+
910
+ ```ts
911
+ depositsCount(): Promise<DepositsCountReturn>
912
+ ```
913
+
914
+ ```ts
915
+ type DepositsCountReturn =
916
+ | {
917
+ ok: true;
918
+ data: number;
919
+ }
920
+ | {
921
+ ok: false;
922
+ error: HttpError;
923
+ };
924
+ ```
925
+
926
+ - `betRecords` - Retrieve current user's bet records
927
+
928
+ ```ts
929
+ betRecords(input?: BetRecordsInput): Promise<BetRecordsReturn>
930
+ ```
931
+
932
+ ```ts
933
+ type BetRecordStatus = 'STARTED' | 'SETTLED' | 'CANCELLED';
934
+
935
+ interface BetRecordsInput {
936
+ first?: number;
937
+ after?: string;
938
+ sort?: SortOrder;
939
+ filter?: {
940
+ serialCode?: {
941
+ equal?: string;
942
+ notEqual?: string;
943
+ in?: string[];
944
+ notIn?: string[];
945
+ contains?: string;
946
+ startsWith?: string;
947
+ };
948
+ game?: {
949
+ equal?: string;
950
+ notEqual?: string;
951
+ in?: string[];
952
+ notIn?: string[];
953
+ };
954
+ game__externalId?: {
955
+ equal?: string;
956
+ notEqual?: string;
957
+ in?: string[];
958
+ notIn?: string[];
959
+ contains?: string;
960
+ startsWith?: string;
961
+ };
962
+ game__type?: {
963
+ equal?: GameType;
964
+ notEqual?: GameType;
965
+ in?: GameType[];
966
+ notIn?: GameType[];
967
+ };
968
+ game__provider?: {
969
+ equal?: GameProvider;
970
+ notEqual?: GameProvider;
971
+ in?: GameProvider[];
972
+ notIn?: GameProvider[];
973
+ };
974
+ dateTimeCreated?: {
975
+ equal?: Date | string;
976
+ notEqual?: Date | string;
977
+ in?: Date | string[];
978
+ notIn?: Date | string[];
979
+ lesserThan?: Date | string;
980
+ lesserThanOrEqual?: Date | string;
981
+ greaterThan?: Date | string;
982
+ greaterThanOrEqual?: Date | string;
983
+ };
984
+ vendorRoundId?: {
985
+ equal?: string;
986
+ notEqual?: string;
987
+ in?: string[];
988
+ notIn?: string[];
989
+ contains?: string;
990
+ startsWith?: string;
991
+ };
992
+ status?: {
993
+ equal?: BetRecordStatus;
994
+ notEqual?: BetRecordStatus;
995
+ in?: BetRecordStatus[];
996
+ notIn?: BetRecordStatus[];
997
+ };
998
+ };
999
+ startDateTime?: {
1000
+ equal?: Date | string;
1001
+ notEqual?: Date | string;
1002
+ in?: Date | string[];
1003
+ notIn?: Date | string[];
1004
+ lesserThan?: Date | string;
1005
+ lesserThanOrEqual?: Date | string;
1006
+ greaterThan?: Date | string;
1007
+ greaterThanOrEqual?: Date | string;
1008
+ };
1009
+ endDateTime?: {
1010
+ equal?: Date | string;
1011
+ notEqual?: Date | string;
1012
+ in?: Date | string[];
1013
+ notIn?: Date | string[];
1014
+ lesserThan?: Date | string;
1015
+ lesserThanOrEqual?: Date | string;
1016
+ greaterThan?: Date | string;
1017
+ greaterThanOrEqual?: Date | string;
1018
+ };
1019
+ }
1020
+
1021
+ interface BetRecord {
1022
+ id: string;
1023
+ game: Game;
1024
+ status: BetRecordStatus;
1025
+ serialCode: string;
1026
+ vendorRoundId?: string;
1027
+ bet: number;
1028
+ payout: number;
1029
+ validBet: number;
1030
+ jackpotContribution: number;
1031
+ jackpotPayout: number;
1032
+ winloss?: number;
1033
+ betContent?: string;
1034
+ contestName?: string;
1035
+ externalCategory?: string;
1036
+ dateTimeSettled?: Date;
1037
+ dateTimeCreated: Date;
1038
+ dateTimeLastUpdated: Date;
1039
+ metadata: {
1040
+ odds?: string;
1041
+ validBet?: number;
1042
+ };
1043
+ }
1044
+
1045
+ type BetRecordsReturn =
1046
+ | {
1047
+ ok: true;
1048
+ data: {
1049
+ betRecords: (BetRecord & { cursor: string })[];
1050
+ totalCount: number;
1051
+ hasNextPage: boolean;
1052
+ nextCursor?: string;
1053
+ };
1054
+ }
1055
+ | {
1056
+ ok: false;
1057
+ error: HttpError;
1058
+ };
1059
+ ```
1060
+
1061
+ - `transactionRecords` - Retrieve current user's transaction records
1062
+
1063
+ ```ts
1064
+ transactionRecords(input?: TransactionRecordsInput): Promise<TransactionRecordsReturn>
1065
+ ```
1066
+
1067
+ ```ts
1068
+ type TransactionRecordType =
1069
+ | 'DEPOSIT'
1070
+ | 'PAYOUT'
1071
+ | 'WITHDRAWAL_REFUND'
1072
+ | 'TRANSFER_IN'
1073
+ | 'WITHDRAWAL'
1074
+ | 'BET'
1075
+ | 'TRANSFER_OUT'
1076
+ | 'ROLLBACK'
1077
+ | 'BET_REFUND'
1078
+ | 'PAYOUT_REFUND'
1079
+ | 'CASHBACK_BONUS'
1080
+ | 'BONUS'
1081
+ | 'RESERVE'
1082
+ | 'REJECT_WITHDRAWAL'
1083
+ | 'MANUAL_DEPOSIT'
1084
+ | 'GCASH_DEPOSIT'
1085
+ | 'MANUAL_WITHDRAWAL'
1086
+ | 'BANK_WITHDRAWAL'
1087
+ | 'GCASH_WITHDRAWAL'
1088
+ | 'COMMIT_RESERVE'
1089
+ | 'ROLLBACK_PAYOUT'
1090
+ | 'ROLLBACK_RESERVE';
1091
+
1092
+ interface TransactionRecordsInput {
1093
+ first?: number;
1094
+ after?: string;
1095
+ filter?: {
1096
+ type?: {
1097
+ equal?: TransactionRecordType;
1098
+ notEqual?: TransactionRecordType;
1099
+ in?: TransactionRecordType[];
1100
+ notIn?: TransactionRecordType[];
1101
+ };
1102
+ referenceNumber?: {
1103
+ equal?: string;
1104
+ notEqual?: string;
1105
+ in?: string[];
1106
+ notIn?: string[];
1107
+ contains?: string;
1108
+ startsWith?: string;
1109
+ };
1110
+ dateTimeCreated?: {
1111
+ equal?: Date | string;
1112
+ notEqual?: Date | string;
1113
+ in?: Date | string[];
1114
+ notIn?: Date | string[];
1115
+ lesserThan?: Date | string;
1116
+ lesserThanOrEqual?: Date | string;
1117
+ greaterThan?: Date | string;
1118
+ greaterThanOrEqual?: Date | string;
1119
+ };
1120
+ };
1121
+ }
1122
+
1123
+ interface TransactionRecord {
1124
+ id: string;
1125
+ type: TransactionRecordType;
1126
+ amount: number;
1127
+ content?: string;
1128
+ currentBalance: number;
1129
+ referenceNumber: string;
1130
+ dateTimeCreated: Date;
1131
+ dateTimeLastUpdated: Date;
1132
+ }
1133
+
1134
+ type TransactionRecordsReturn =
1135
+ | {
1136
+ ok: true;
1137
+ data: {
1138
+ transactionRecords: (TransactionRecord & { cursor: string })[];
1139
+ totalCount: number;
1140
+ hasNextPage: boolean;
1141
+ nextCursor?: string;
1142
+ };
1143
+ }
1144
+ | {
1145
+ ok: false;
1146
+ error: HttpError;
1147
+ };
1148
+ ```
1149
+
1150
+ - `promos` - Retrieve promos for current platform
1151
+
1152
+ ```ts
1153
+ promos(): Promise<PromosReturn>
1154
+ ```
1155
+
1156
+ ```ts
1157
+ interface Promo {
1158
+ id: string;
1159
+ type: 'DEPOSIT';
1160
+ name: string;
1161
+ banner: {
1162
+ id: string;
1163
+ url: string;
1164
+ status: 'READY';
1165
+ dateTimeCreated: Date;
1166
+ };
1167
+ status: 'ACTIVE' | 'INACTIVE' | 'DISABLED';
1168
+ description: string;
1169
+ minimumBonusAmount?: number;
1170
+ maximumBonusAmount?: number;
1171
+ activationStartDateTime: Date;
1172
+ activationEndDateTime: Date;
1173
+ dateTimeCreated: Date;
1174
+ dateTimeLastUpdated: Date;
1175
+ }
1176
+
1177
+ type PromosReturn =
1178
+ | {
1179
+ ok: true;
1180
+ data: Promo[];
1181
+ }
1182
+ | {
1183
+ ok: false;
1184
+ error: HttpError;
1185
+ };
1186
+ ```
1187
+
1188
+ - `availablePromos` - Retrieve available promos for current user
1189
+
1190
+ ```ts
1191
+ availablePromos(): Promise<PromosReturn>
1192
+ ```
1193
+
1194
+ - `bonus` - Retrieve current user's bonus details
1195
+
1196
+ ```ts
1197
+ bonus(): Promise<BonusReturn>
1198
+ ```
1199
+
1200
+ ```ts
1201
+ interface Bonus {
1202
+ id: string;
1203
+ promo: Promo;
1204
+ deposit?: {
1205
+ type: DepositRecordType;
1206
+ status: DepositRecordStatus;
1207
+ amount: number;
1208
+ netAmount: number;
1209
+ fee: number;
1210
+ reference?: string;
1211
+ dateTimeCreated: Date;
1212
+ dateTimeLastUpdated: Date;
1213
+ };
1214
+ amount: number;
1215
+ balance: number;
1216
+ turnoverRequirement: number;
1217
+ currentTurnoverRequirementContribution: number;
1218
+ currentTurnoverRequirementContributionPercentage: number;
1219
+ expiration: Date;
1220
+ dateTimeCreated: Date;
1221
+ dateTimeLastUpdated: Date;
1222
+ }
1223
+
1224
+ type BonusReturn =
1225
+ | {
1226
+ ok: true;
1227
+ data: Bonus | null;
1228
+ }
1229
+ | {
1230
+ ok: false;
1231
+ error: HttpError;
1232
+ };
1233
+ ```
1234
+
1235
+ - `cashbacks` - Retrieve cashbacks for current platform
1236
+
1237
+ ```ts
1238
+ cashbacks(): Promise<CashbackReturn>
1239
+ ```
1240
+
1241
+ ```ts
1242
+ interface Cashback {
1243
+ id: string;
1244
+ name: string;
1245
+ banner: {
1246
+ id: string;
1247
+ url: string;
1248
+ status: 'READY';
1249
+ dateTimeCreated: Date;
1250
+ };
1251
+ status: CashbackStatus;
1252
+ description: string;
1253
+ activationStartDateTime: Date;
1254
+ activationEndDateTime: Date;
1255
+ dateTimeCreated: Date;
1256
+ dateTimeLastUpdated: Date;
1257
+ }
1258
+
1259
+ type CashbackReturn =
1260
+ | {
1261
+ ok: true;
1262
+ data: Cashback[];
1263
+ }
1264
+ | {
1265
+ ok: false;
1266
+ error: HttpError;
1267
+ };
1268
+ ```
1269
+
1270
+ - `cashbackBonuses` - Retrieve current user's cashback bonuses
1271
+
1272
+ ```ts
1273
+ cashbackBonuses(): Promise<CashbackBonusesReturn>
1274
+ ```
1275
+
1276
+ ```ts
1277
+ interface CashbackBonus {
1278
+ id: string;
1279
+ balance: number;
1280
+ cashback: Cashback;
1281
+ dateTimeCreated: Date;
1282
+ dateTimeLastUpdated: Date;
1283
+ }
1284
+
1285
+ type CashbackBonusesReturn =
1286
+ | {
1287
+ ok: true;
1288
+ data: CashbackBonus[];
1289
+ }
1290
+ | {
1291
+ ok: false;
1292
+ error: HttpError;
1293
+ };
1294
+ ```
1295
+
1296
+ - `claimCashbackBonus` - Claim cashback bonus
1297
+
1298
+ ```ts
1299
+ claimCashbackBonus(id: string): Promise<ClaimCashbackBonusReturn>
1300
+ ```
1301
+
1302
+ ```ts
1303
+ type ClaimCashbackBonusReturn =
1304
+ | {
1305
+ ok: true;
1306
+ }
1307
+ | {
1308
+ ok: false;
1309
+ error:
1310
+ | HttpError
1311
+ | {
1312
+ code: 'CashbackBonusDoesNotExistError';
1313
+ message: string;
1314
+ };
1315
+ };
1316
+ ```
1317
+
1318
+ - `games` - Retrieve games
1319
+
1320
+ ```ts
1321
+ games(input?: GamesInput): Promise<GamesReturn>
1322
+ ```
1323
+
1324
+ ```ts
1325
+ type GameType = 'SLOTS' | 'SPORTS' | 'BINGO' | 'FISHING' | 'LIVE' | 'GAMES';
1326
+ type GameProvider =
1327
+ | 'JILI'
1328
+ | 'PGSOFT'
1329
+ | 'FACHAI'
1330
+ | 'PLAYTECH'
1331
+ | 'CQ9'
1332
+ | 'JDB'
1333
+ | 'BOOONGO'
1334
+ | 'HABANERO'
1335
+ | 'RELAXGAMING'
1336
+ | 'DG'
1337
+ | 'E2E'
1338
+ | 'BTI'
1339
+ | 'DARWIN'
1340
+ | 'MEGABALL'
1341
+ | 'DRBINGO'
1342
+ | 'RTG';
1343
+
1344
+ interface GamesInput {
1345
+ after?: string;
1346
+ first?: number;
1347
+ filter?: {
1348
+ id?: {
1349
+ equal?: string;
1350
+ notEqual?: string;
1351
+ in?: string[];
1352
+ notIn?: string[];
1353
+ };
1354
+ name?: {
1355
+ equal?: string;
1356
+ notEqual?: string;
1357
+ in?: string[];
1358
+ notIn?: string[];
1359
+ contains?: string;
1360
+ startsWith?: string;
1361
+ };
1362
+ type?: {
1363
+ equal?: GameType;
1364
+ notEqual?: GameType;
1365
+ in?: GameType[];
1366
+ notIn?: GameType[];
1367
+ };
1368
+ provider?: {
1369
+ equal?: GameProvider;
1370
+ notEqual?: GameProvider;
1371
+ in?: GameProvider[];
1372
+ notIn?: GameProvider[];
1373
+ };
1374
+ };
1375
+ }
1376
+
1377
+ interface Game {
1378
+ id: string;
1379
+ type: GameType;
1380
+ name: string;
1381
+ image: string;
1382
+ provider: GameProvider;
1383
+ }
1384
+
1385
+ type GamesReturn =
1386
+ | {
1387
+ ok: true;
1388
+ data: {
1389
+ games: (Game & { cursor: string })[];
1390
+ totalCount: number;
1391
+ hasNextPage: boolean;
1392
+ nextCursor?: string;
1393
+ };
1394
+ }
1395
+ | {
1396
+ ok: false;
1397
+ error: HttpError;
1398
+ };
1399
+ ```
1400
+
1401
+ - `gameSession` - Retrieve game session details
1402
+
1403
+ ```ts
1404
+ gameSession(id: string): Promise<GameSessionReturn>
1405
+ ```
1406
+
1407
+ ```ts
1408
+ type GameSession =
1409
+ | {
1410
+ id: string;
1411
+ game: Game;
1412
+ status: 'READY';
1413
+ launchUrl: string;
1414
+ dateTimeCreated: Date;
1415
+ dateTimeLastUpdated: Date;
1416
+ }
1417
+ | {
1418
+ id: string;
1419
+ game: Game;
1420
+ status: 'PENDING' | 'STARTING' | 'ENDED' | 'CANCELLED';
1421
+ dateTimeCreated: Date;
1422
+ dateTimeLastUpdated: Date;
1423
+ };
1424
+
1425
+ type GameSessionReturn =
1426
+ | {
1427
+ ok: true;
1428
+ data: GameSession | null;
1429
+ }
1430
+ | {
1431
+ ok: false;
1432
+ error: HttpError;
1433
+ };
1434
+ ```
1435
+
1436
+ - `createGameSession` - Create new game session
1437
+
1438
+ ```ts
1439
+ createGameSession(input:CreateGameSessionInput): Promise<CreateGameSessionReturn>
1440
+ ```
1441
+
1442
+ ```ts
1443
+ interface CreateGameSessionInput {
1444
+ id?: string;
1445
+ game: string;
1446
+ }
1447
+
1448
+ type CreateGameSessionReturn =
1449
+ | {
1450
+ ok: true;
1451
+ data: {
1452
+ id: string;
1453
+ };
1454
+ }
1455
+ | {
1456
+ ok: false;
1457
+ error:
1458
+ | HttpError
1459
+ | {
1460
+ code: 'GameDoesNotExistError';
1461
+ message: string;
1462
+ };
1463
+ };
1464
+ ```
1465
+
1466
+ - `endGameSession` - End game session
1467
+
1468
+ ```ts
1469
+ endGameSession(id: string): Promise<EndGameSessionReturn>
1470
+ ```
1471
+
1472
+ ```ts
1473
+ type EndGameSessionReturn =
1474
+ | {
1475
+ ok: true;
1476
+ }
1477
+ | {
1478
+ ok: false;
1479
+ error: HttpError | UnknownError;
1480
+ };
1481
+ ```
1482
+
1483
+ - `file` - Retrieve file details
1484
+
1485
+ ```ts
1486
+ file(id: string): Promise<FileReturn>
1487
+ ```
1488
+
1489
+ ```ts
1490
+ type File =
1491
+ | {
1492
+ id: string;
1493
+ url?: never;
1494
+ status: 'UPLOADING' | 'FAILED';
1495
+ dateTimeCreated: Date;
1496
+ }
1497
+ | {
1498
+ id: string;
1499
+ url: string;
1500
+ status: 'READY';
1501
+ dateTimeCreated: Date;
1502
+ }
1503
+ | {
1504
+ id: string;
1505
+ url?: string;
1506
+ status: 'DELETED';
1507
+ dateTimeCreated: Date;
1508
+ };
1509
+
1510
+ type FileReturn =
1511
+ | {
1512
+ ok: true;
1513
+ data: File | null;
1514
+ }
1515
+ | {
1516
+ ok: false;
1517
+ error: HttpError;
1518
+ };
1519
+ ```
1520
+
1521
+ - `uploadImageFile` - Upload image file
1522
+
1523
+ ```ts
1524
+ uploadImageFile(input: globalThis.File): Promise<UploadImageFileReturn>
1525
+ ```
1526
+
1527
+ ```ts
1528
+ type UploadImageFileReturn =
1529
+ | {
1530
+ ok: true;
1531
+ data: {
1532
+ id: string;
1533
+ };
1534
+ }
1535
+ | {
1536
+ ok: false;
1537
+ error:
1538
+ | HttpError
1539
+ | {
1540
+ code: 'FileFormatNotSupportedError' | 'FileNameTooLongError' | 'FileSizeTooBigError';
1541
+ message: string;
1542
+ };
1543
+ };
1544
+ ```
1545
+
1546
+ - `pointsWallet` - Retrieve current user's points wallet details
1547
+
1548
+ ```ts
1549
+ pointsWallet(): Promise<PointsWalletReturn>
1550
+ ```
1551
+
1552
+ ```ts
1553
+ interface PointsWallet {
1554
+ id: string;
1555
+ points: number;
1556
+ account: string;
1557
+ dateTimeCreated: Date;
1558
+ }
1559
+
1560
+ type PointsWalletReturn =
1561
+ | {
1562
+ ok: true;
1563
+ data: PointsWallet | null;
1564
+ }
1565
+ | {
1566
+ ok: false;
1567
+ error: HttpError;
1568
+ };
1569
+ ```
1570
+
1571
+ - `pointsToCashConversion` - Convert points to cash
1572
+
1573
+ ```ts
1574
+ pointsToCashConversion(amount: number): Promise<PointsToCashConversionReturn>
1575
+ ```
1576
+
1577
+ ```ts
1578
+ type PointsToCashConversionReturn =
1579
+ | {
1580
+ ok: true;
1581
+ }
1582
+ | {
1583
+ ok: false;
1584
+ error:
1585
+ | HttpError
1586
+ | {
1587
+ code: 'InsufficientPointsError';
1588
+ message: string;
1589
+ };
1590
+ };
1591
+ ```