@opexa/portal-sdk 0.54.5 → 0.54.7
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.
- package/dist/index.cjs +427 -155
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +427 -155
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1792,6 +1792,22 @@ var REGISTER_MAYA_MEMBER_ACCOUNT_MUTATION = gql`
|
|
|
1792
1792
|
}
|
|
1793
1793
|
}
|
|
1794
1794
|
`;
|
|
1795
|
+
var REGISTER_AGENT_ACCOUNT_MUTATION = gql`
|
|
1796
|
+
mutation RegisterAgentAccount($input: RegisterAgentAccountInput!) {
|
|
1797
|
+
registerAgentAccount(input: $input) {
|
|
1798
|
+
__typename
|
|
1799
|
+
... on AccountNameNotAvailableError {
|
|
1800
|
+
message
|
|
1801
|
+
}
|
|
1802
|
+
... on EmailAddressNotAvailableError {
|
|
1803
|
+
message
|
|
1804
|
+
}
|
|
1805
|
+
... on MobileNumberNotAvailableError {
|
|
1806
|
+
message
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
`;
|
|
1795
1811
|
var UPDATE_MEMBER_ACCOUNT_MUTATION = gql`
|
|
1796
1812
|
mutation UpdateMemberAccount($input: UpdateMemberAccountInput!) {
|
|
1797
1813
|
updateMemberAccount(input: $input) {
|
|
@@ -3098,11 +3114,14 @@ var AccountService = class {
|
|
|
3098
3114
|
};
|
|
3099
3115
|
}
|
|
3100
3116
|
async registerMemberAccount(variables) {
|
|
3101
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
3117
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
3102
3118
|
const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_MUTATION, others, {
|
|
3103
3119
|
headers: {
|
|
3104
3120
|
...reCAPTCHAResponse && {
|
|
3105
3121
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
3122
|
+
},
|
|
3123
|
+
...domain && {
|
|
3124
|
+
Domain: domain
|
|
3106
3125
|
}
|
|
3107
3126
|
}
|
|
3108
3127
|
});
|
|
@@ -3118,7 +3137,7 @@ var AccountService = class {
|
|
|
3118
3137
|
};
|
|
3119
3138
|
}
|
|
3120
3139
|
async registerMemberAccountViaMobile(variables) {
|
|
3121
|
-
const { reCAPTCHAResponse, testPass, ...others } = variables;
|
|
3140
|
+
const { reCAPTCHAResponse, domain, testPass, ...others } = variables;
|
|
3122
3141
|
const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_VIA_MOBILE_MUTATION, others, {
|
|
3123
3142
|
headers: {
|
|
3124
3143
|
...reCAPTCHAResponse && {
|
|
@@ -3126,6 +3145,9 @@ var AccountService = class {
|
|
|
3126
3145
|
},
|
|
3127
3146
|
...testPass && {
|
|
3128
3147
|
"test-pass": testPass
|
|
3148
|
+
},
|
|
3149
|
+
...domain && {
|
|
3150
|
+
Domain: domain
|
|
3129
3151
|
}
|
|
3130
3152
|
}
|
|
3131
3153
|
});
|
|
@@ -3143,11 +3165,14 @@ var AccountService = class {
|
|
|
3143
3165
|
};
|
|
3144
3166
|
}
|
|
3145
3167
|
async registerMemberAccount__next(variables) {
|
|
3146
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
3168
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
3147
3169
|
const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_MUTATION__NEXT, others, {
|
|
3148
3170
|
headers: {
|
|
3149
3171
|
...reCAPTCHAResponse && {
|
|
3150
3172
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
3173
|
+
},
|
|
3174
|
+
...domain && {
|
|
3175
|
+
Domain: domain
|
|
3151
3176
|
}
|
|
3152
3177
|
}
|
|
3153
3178
|
});
|
|
@@ -3163,10 +3188,14 @@ var AccountService = class {
|
|
|
3163
3188
|
};
|
|
3164
3189
|
}
|
|
3165
3190
|
async registerMemberAccountByName(variables) {
|
|
3166
|
-
const
|
|
3191
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
3192
|
+
const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_BY_NAME_MUTATION, others, {
|
|
3167
3193
|
headers: {
|
|
3168
|
-
...
|
|
3169
|
-
"google-recaptcha-response":
|
|
3194
|
+
...reCAPTCHAResponse && {
|
|
3195
|
+
"google-recaptcha-response": reCAPTCHAResponse
|
|
3196
|
+
},
|
|
3197
|
+
...domain && {
|
|
3198
|
+
Domain: domain
|
|
3170
3199
|
}
|
|
3171
3200
|
}
|
|
3172
3201
|
});
|
|
@@ -3387,7 +3416,14 @@ var AccountService = class {
|
|
|
3387
3416
|
};
|
|
3388
3417
|
}
|
|
3389
3418
|
async registerMayaMemberAccount(variables) {
|
|
3390
|
-
const
|
|
3419
|
+
const { domain, ...others } = variables;
|
|
3420
|
+
const res = await this.client.request(REGISTER_MAYA_MEMBER_ACCOUNT_MUTATION, others, {
|
|
3421
|
+
headers: {
|
|
3422
|
+
...domain && {
|
|
3423
|
+
Domain: domain
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
});
|
|
3391
3427
|
if (!res.ok) return res;
|
|
3392
3428
|
if (res.data.registerMayaMemberAccount) {
|
|
3393
3429
|
return {
|
|
@@ -3429,7 +3465,7 @@ var AccountService = class {
|
|
|
3429
3465
|
return res.ok ? { ok: true, data: res.data.pointsClubSettings } : res;
|
|
3430
3466
|
}
|
|
3431
3467
|
async registerMemberAccountByMobileNumber(variables) {
|
|
3432
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
3468
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
3433
3469
|
const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER_MUTATION, others, {
|
|
3434
3470
|
headers: {
|
|
3435
3471
|
...variables.reCAPTCHAResponse && {
|
|
@@ -3437,6 +3473,9 @@ var AccountService = class {
|
|
|
3437
3473
|
},
|
|
3438
3474
|
...variables.testPass && {
|
|
3439
3475
|
"test-pass": "true"
|
|
3476
|
+
},
|
|
3477
|
+
...domain && {
|
|
3478
|
+
Domain: domain
|
|
3440
3479
|
}
|
|
3441
3480
|
}
|
|
3442
3481
|
});
|
|
@@ -3473,6 +3512,19 @@ var AccountService = class {
|
|
|
3473
3512
|
data: res.data.requireFirstDeposit
|
|
3474
3513
|
};
|
|
3475
3514
|
}
|
|
3515
|
+
async registerAgentAccount(variables) {
|
|
3516
|
+
const res = await this.client.request(REGISTER_AGENT_ACCOUNT_MUTATION, variables);
|
|
3517
|
+
if (!res.ok) return res;
|
|
3518
|
+
if (res.data?.registerAgentAccount) {
|
|
3519
|
+
return {
|
|
3520
|
+
ok: false,
|
|
3521
|
+
error: createOperationError(
|
|
3522
|
+
res.data.registerAgentAccount.__typename
|
|
3523
|
+
)
|
|
3524
|
+
};
|
|
3525
|
+
}
|
|
3526
|
+
return { ok: true };
|
|
3527
|
+
}
|
|
3476
3528
|
};
|
|
3477
3529
|
|
|
3478
3530
|
// src/utils/status-code-to-operation-error.ts
|
|
@@ -4058,7 +4110,14 @@ var GameService = class {
|
|
|
4058
4110
|
};
|
|
4059
4111
|
}
|
|
4060
4112
|
async createGameSession(variables) {
|
|
4061
|
-
const
|
|
4113
|
+
const { domain, ...others } = variables;
|
|
4114
|
+
const res = await this.client.request(CREATE_GAME_SESSION_MUTATION, others, {
|
|
4115
|
+
headers: {
|
|
4116
|
+
...domain && {
|
|
4117
|
+
Domain: domain
|
|
4118
|
+
}
|
|
4119
|
+
}
|
|
4120
|
+
});
|
|
4062
4121
|
if (!res.ok) return res;
|
|
4063
4122
|
if (res.data.createGameSession) {
|
|
4064
4123
|
return {
|
|
@@ -4475,11 +4534,14 @@ var WalletService = class {
|
|
|
4475
4534
|
return res.ok ? { ok: res.ok, data: res.data.node } : res;
|
|
4476
4535
|
}
|
|
4477
4536
|
async createGCashDeposit(variables) {
|
|
4478
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4537
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4479
4538
|
const res = await this.client.request(CREATE_GCASH_DEPOSIT_MUTATION, others, {
|
|
4480
4539
|
headers: {
|
|
4481
4540
|
...reCAPTCHAResponse && {
|
|
4482
4541
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4542
|
+
},
|
|
4543
|
+
...domain && {
|
|
4544
|
+
Domain: domain
|
|
4483
4545
|
}
|
|
4484
4546
|
}
|
|
4485
4547
|
});
|
|
@@ -4495,11 +4557,14 @@ var WalletService = class {
|
|
|
4495
4557
|
};
|
|
4496
4558
|
}
|
|
4497
4559
|
async createGCashWebpayDeposit(variables) {
|
|
4498
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4560
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4499
4561
|
const res = await this.client.request(CREATE_GCASH_WEBPAY_DEPOSIT_MUTATION, others, {
|
|
4500
4562
|
headers: {
|
|
4501
4563
|
...reCAPTCHAResponse && {
|
|
4502
4564
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4565
|
+
},
|
|
4566
|
+
...domain && {
|
|
4567
|
+
Domain: domain
|
|
4503
4568
|
}
|
|
4504
4569
|
}
|
|
4505
4570
|
});
|
|
@@ -4517,11 +4582,14 @@ var WalletService = class {
|
|
|
4517
4582
|
};
|
|
4518
4583
|
}
|
|
4519
4584
|
async createMayaWebpayDeposit(variables) {
|
|
4520
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4585
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4521
4586
|
const res = await this.client.request(CREATE_MAYA_WEBPAY_DEPOSIT_MUTATION, others, {
|
|
4522
4587
|
headers: {
|
|
4523
4588
|
...reCAPTCHAResponse && {
|
|
4524
4589
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4590
|
+
},
|
|
4591
|
+
...domain && {
|
|
4592
|
+
Domain: domain
|
|
4525
4593
|
}
|
|
4526
4594
|
}
|
|
4527
4595
|
});
|
|
@@ -4539,11 +4607,14 @@ var WalletService = class {
|
|
|
4539
4607
|
};
|
|
4540
4608
|
}
|
|
4541
4609
|
async createMayaDeposit(variables) {
|
|
4542
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4610
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4543
4611
|
const res = await this.client.request(CREATE_MAYA_DEPOSIT_MUTATION, others, {
|
|
4544
4612
|
headers: {
|
|
4545
4613
|
...reCAPTCHAResponse && {
|
|
4546
4614
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4615
|
+
},
|
|
4616
|
+
...domain && {
|
|
4617
|
+
Domain: domain
|
|
4547
4618
|
}
|
|
4548
4619
|
}
|
|
4549
4620
|
});
|
|
@@ -4559,7 +4630,14 @@ var WalletService = class {
|
|
|
4559
4630
|
};
|
|
4560
4631
|
}
|
|
4561
4632
|
async createTestDeposit(variables) {
|
|
4562
|
-
const
|
|
4633
|
+
const { domain, ...others } = variables;
|
|
4634
|
+
const res = await this.client.request(CREATE_TEST_DEPOSIT_MUTATION, others, {
|
|
4635
|
+
headers: {
|
|
4636
|
+
...domain && {
|
|
4637
|
+
Domain: domain
|
|
4638
|
+
}
|
|
4639
|
+
}
|
|
4640
|
+
});
|
|
4563
4641
|
if (!res.ok) return res;
|
|
4564
4642
|
if (res.data.createTestDeposit) {
|
|
4565
4643
|
return {
|
|
@@ -4572,11 +4650,14 @@ var WalletService = class {
|
|
|
4572
4650
|
};
|
|
4573
4651
|
}
|
|
4574
4652
|
async createAIOQRPHDeposit(variables) {
|
|
4575
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4653
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4576
4654
|
const res = await this.client.request(CREATE_AIO_QRPH_DEPOSIT_MUTATION, others, {
|
|
4577
4655
|
headers: {
|
|
4578
4656
|
...reCAPTCHAResponse && {
|
|
4579
4657
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4658
|
+
},
|
|
4659
|
+
...domain && {
|
|
4660
|
+
Domain: domain
|
|
4580
4661
|
}
|
|
4581
4662
|
}
|
|
4582
4663
|
});
|
|
@@ -4592,11 +4673,14 @@ var WalletService = class {
|
|
|
4592
4673
|
};
|
|
4593
4674
|
}
|
|
4594
4675
|
async createAiOGCashDeposit(variables) {
|
|
4595
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4676
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4596
4677
|
const res = await this.client.request(CREATE_AIO_GCASH_DEPOSIT_MUTATION, others, {
|
|
4597
4678
|
headers: {
|
|
4598
4679
|
...reCAPTCHAResponse && {
|
|
4599
4680
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4681
|
+
},
|
|
4682
|
+
...domain && {
|
|
4683
|
+
Domain: domain
|
|
4600
4684
|
}
|
|
4601
4685
|
}
|
|
4602
4686
|
});
|
|
@@ -4612,11 +4696,14 @@ var WalletService = class {
|
|
|
4612
4696
|
};
|
|
4613
4697
|
}
|
|
4614
4698
|
async createAiOPayMayaDeposit(variables) {
|
|
4615
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4699
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4616
4700
|
const res = await this.client.request(CREATE_AIO_PAY_MAYA_DEPOSIT_MUTATION, others, {
|
|
4617
4701
|
headers: {
|
|
4618
4702
|
...reCAPTCHAResponse && {
|
|
4619
4703
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4704
|
+
},
|
|
4705
|
+
...domain && {
|
|
4706
|
+
Domain: domain
|
|
4620
4707
|
}
|
|
4621
4708
|
}
|
|
4622
4709
|
});
|
|
@@ -4634,11 +4721,14 @@ var WalletService = class {
|
|
|
4634
4721
|
};
|
|
4635
4722
|
}
|
|
4636
4723
|
async createAiOGrabPayDeposit(variables) {
|
|
4637
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4724
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4638
4725
|
const res = await this.client.request(CREATE_AIO_GRAB_PAY_DEPOSIT_MUTATION, others, {
|
|
4639
4726
|
headers: {
|
|
4640
4727
|
...reCAPTCHAResponse && {
|
|
4641
4728
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4729
|
+
},
|
|
4730
|
+
...domain && {
|
|
4731
|
+
Domain: domain
|
|
4642
4732
|
}
|
|
4643
4733
|
}
|
|
4644
4734
|
});
|
|
@@ -4656,11 +4746,14 @@ var WalletService = class {
|
|
|
4656
4746
|
};
|
|
4657
4747
|
}
|
|
4658
4748
|
async createAiOPalawanPayDeposit(variables) {
|
|
4659
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4749
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4660
4750
|
const res = await this.client.request(CREATE_AIO_PALAWAN_PAY_DEPOSIT_MUTATION, others, {
|
|
4661
4751
|
headers: {
|
|
4662
4752
|
...reCAPTCHAResponse && {
|
|
4663
4753
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4754
|
+
},
|
|
4755
|
+
...domain && {
|
|
4756
|
+
Domain: domain
|
|
4664
4757
|
}
|
|
4665
4758
|
}
|
|
4666
4759
|
});
|
|
@@ -4678,11 +4771,14 @@ var WalletService = class {
|
|
|
4678
4771
|
};
|
|
4679
4772
|
}
|
|
4680
4773
|
async createAIOOnlineBankDeposit(variables) {
|
|
4681
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4774
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4682
4775
|
const res = await this.client.request(CREATE_AIO_ONLINE_BANK_DEPOSIT_MUTATION, others, {
|
|
4683
4776
|
headers: {
|
|
4684
4777
|
...reCAPTCHAResponse && {
|
|
4685
4778
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4779
|
+
},
|
|
4780
|
+
...domain && {
|
|
4781
|
+
Domain: domain
|
|
4686
4782
|
}
|
|
4687
4783
|
}
|
|
4688
4784
|
});
|
|
@@ -4700,11 +4796,14 @@ var WalletService = class {
|
|
|
4700
4796
|
};
|
|
4701
4797
|
}
|
|
4702
4798
|
async createManualBankDeposit(variables) {
|
|
4703
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4799
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4704
4800
|
const res = await this.client.request(CREATE_MANUAL_BANK_DEPOSIT_MUTATION, others, {
|
|
4705
4801
|
headers: {
|
|
4706
4802
|
...reCAPTCHAResponse && {
|
|
4707
4803
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4804
|
+
},
|
|
4805
|
+
...domain && {
|
|
4806
|
+
Domain: domain
|
|
4708
4807
|
}
|
|
4709
4808
|
}
|
|
4710
4809
|
});
|
|
@@ -4722,11 +4821,14 @@ var WalletService = class {
|
|
|
4722
4821
|
};
|
|
4723
4822
|
}
|
|
4724
4823
|
async createManualUPIDeposit(variables) {
|
|
4725
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4824
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4726
4825
|
const res = await this.client.request(CREATE_MANUAL_UPI_DEPOSIT_MUTATION, others, {
|
|
4727
4826
|
headers: {
|
|
4728
4827
|
...reCAPTCHAResponse && {
|
|
4729
4828
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4829
|
+
},
|
|
4830
|
+
...domain && {
|
|
4831
|
+
Domain: domain
|
|
4730
4832
|
}
|
|
4731
4833
|
}
|
|
4732
4834
|
});
|
|
@@ -4742,11 +4844,14 @@ var WalletService = class {
|
|
|
4742
4844
|
};
|
|
4743
4845
|
}
|
|
4744
4846
|
async createMayaAppDeposit(variables) {
|
|
4745
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4847
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4746
4848
|
const res = await this.client.request(CREATE_MAYA_APP_DEPOSIT_MUTATION, others, {
|
|
4747
4849
|
headers: {
|
|
4748
4850
|
...reCAPTCHAResponse && {
|
|
4749
4851
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4852
|
+
},
|
|
4853
|
+
...domain && {
|
|
4854
|
+
Domain: domain
|
|
4750
4855
|
}
|
|
4751
4856
|
}
|
|
4752
4857
|
});
|
|
@@ -4762,11 +4867,14 @@ var WalletService = class {
|
|
|
4762
4867
|
};
|
|
4763
4868
|
}
|
|
4764
4869
|
async createManualUpiDeposit(variables) {
|
|
4765
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4870
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4766
4871
|
const res = await this.client.request(CREATE_MANUAL_UPI_DEPOSIT_MUTATION, others, {
|
|
4767
4872
|
headers: {
|
|
4768
4873
|
...reCAPTCHAResponse && {
|
|
4769
4874
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4875
|
+
},
|
|
4876
|
+
...domain && {
|
|
4877
|
+
Domain: domain
|
|
4770
4878
|
}
|
|
4771
4879
|
}
|
|
4772
4880
|
});
|
|
@@ -4782,11 +4890,14 @@ var WalletService = class {
|
|
|
4782
4890
|
};
|
|
4783
4891
|
}
|
|
4784
4892
|
async createGCashWithdrawal(variables) {
|
|
4785
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4893
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4786
4894
|
const res = await this.client.request(CREATE_GCASH_WITHDRAWAL_MUTATION, others, {
|
|
4787
4895
|
headers: {
|
|
4788
4896
|
...reCAPTCHAResponse && {
|
|
4789
4897
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4898
|
+
},
|
|
4899
|
+
...domain && {
|
|
4900
|
+
Domain: domain
|
|
4790
4901
|
}
|
|
4791
4902
|
}
|
|
4792
4903
|
});
|
|
@@ -4802,11 +4913,14 @@ var WalletService = class {
|
|
|
4802
4913
|
};
|
|
4803
4914
|
}
|
|
4804
4915
|
async createGCashStandardCashInWithdrawal(variables) {
|
|
4805
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4916
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4806
4917
|
const res = await this.client.request(CREATE_GCASH_STANDARD_CASHIN_WITHDRAWAL_MUTATION, others, {
|
|
4807
4918
|
headers: {
|
|
4808
4919
|
...reCAPTCHAResponse && {
|
|
4809
4920
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4921
|
+
},
|
|
4922
|
+
...domain && {
|
|
4923
|
+
Domain: domain
|
|
4810
4924
|
}
|
|
4811
4925
|
}
|
|
4812
4926
|
});
|
|
@@ -4824,11 +4938,14 @@ var WalletService = class {
|
|
|
4824
4938
|
};
|
|
4825
4939
|
}
|
|
4826
4940
|
async createMayaWithdrawal(variables) {
|
|
4827
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4941
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4828
4942
|
const res = await this.client.request(CREATE_MAYA_WITHDRAWAL_MUTATION, others, {
|
|
4829
4943
|
headers: {
|
|
4830
4944
|
...reCAPTCHAResponse && {
|
|
4831
4945
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4946
|
+
},
|
|
4947
|
+
...domain && {
|
|
4948
|
+
Domain: domain
|
|
4832
4949
|
}
|
|
4833
4950
|
}
|
|
4834
4951
|
});
|
|
@@ -4844,11 +4961,14 @@ var WalletService = class {
|
|
|
4844
4961
|
};
|
|
4845
4962
|
}
|
|
4846
4963
|
async createMayaAppWithdrawal(variables) {
|
|
4847
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4964
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4848
4965
|
const res = await this.client.request(CREATE_MAYA_APP_WITHDRAWAL_MUTATION, others, {
|
|
4849
4966
|
headers: {
|
|
4850
4967
|
...reCAPTCHAResponse && {
|
|
4851
4968
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4969
|
+
},
|
|
4970
|
+
...domain && {
|
|
4971
|
+
Domain: domain
|
|
4852
4972
|
}
|
|
4853
4973
|
}
|
|
4854
4974
|
});
|
|
@@ -4866,11 +4986,14 @@ var WalletService = class {
|
|
|
4866
4986
|
};
|
|
4867
4987
|
}
|
|
4868
4988
|
async createBankWithdrawal(variables) {
|
|
4869
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4989
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4870
4990
|
const res = await this.client.request(CREATE_BANK_WITHDRAWAL_MUTATION, others, {
|
|
4871
4991
|
headers: {
|
|
4872
4992
|
...reCAPTCHAResponse && {
|
|
4873
4993
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4994
|
+
},
|
|
4995
|
+
...domain && {
|
|
4996
|
+
Domain: domain
|
|
4874
4997
|
}
|
|
4875
4998
|
}
|
|
4876
4999
|
});
|
|
@@ -4886,11 +5009,14 @@ var WalletService = class {
|
|
|
4886
5009
|
};
|
|
4887
5010
|
}
|
|
4888
5011
|
async createAIOInstapayWithdrawal(variables) {
|
|
4889
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
5012
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4890
5013
|
const res = await this.client.request(CREATE_AIO_INSTAPAY_WITHDRAWAL_MUTATION, others, {
|
|
4891
5014
|
headers: {
|
|
4892
5015
|
...reCAPTCHAResponse && {
|
|
4893
5016
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
5017
|
+
},
|
|
5018
|
+
...domain && {
|
|
5019
|
+
Domain: domain
|
|
4894
5020
|
}
|
|
4895
5021
|
}
|
|
4896
5022
|
});
|
|
@@ -4908,11 +5034,14 @@ var WalletService = class {
|
|
|
4908
5034
|
};
|
|
4909
5035
|
}
|
|
4910
5036
|
async createAIOInstapayWithdrawal_next(variables) {
|
|
4911
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
5037
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4912
5038
|
const res = await this.client.request(CREATE_AIO_INSTAPAY_WITHDRAWAL_MUTATION_NEXT, others, {
|
|
4913
5039
|
headers: {
|
|
4914
5040
|
...reCAPTCHAResponse && {
|
|
4915
5041
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
5042
|
+
},
|
|
5043
|
+
...domain && {
|
|
5044
|
+
Domain: domain
|
|
4916
5045
|
}
|
|
4917
5046
|
}
|
|
4918
5047
|
});
|
|
@@ -4930,11 +5059,14 @@ var WalletService = class {
|
|
|
4930
5059
|
};
|
|
4931
5060
|
}
|
|
4932
5061
|
async createManualUpiWithdrawal(variables) {
|
|
4933
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
5062
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4934
5063
|
const res = await this.client.request(CREATE_MANUAL_UPI_WITHDRAWAL_MUTATION, others, {
|
|
4935
5064
|
headers: {
|
|
4936
5065
|
...reCAPTCHAResponse && {
|
|
4937
5066
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
5067
|
+
},
|
|
5068
|
+
...domain && {
|
|
5069
|
+
Domain: domain
|
|
4938
5070
|
}
|
|
4939
5071
|
}
|
|
4940
5072
|
});
|
|
@@ -4952,11 +5084,14 @@ var WalletService = class {
|
|
|
4952
5084
|
};
|
|
4953
5085
|
}
|
|
4954
5086
|
async createManualBankWithdrawal(variables) {
|
|
4955
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
5087
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4956
5088
|
const res = await this.client.request(CREATE_MANUAL_BANK_WITHDRAWAL_MUTATION, others, {
|
|
4957
5089
|
headers: {
|
|
4958
5090
|
...reCAPTCHAResponse && {
|
|
4959
5091
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
5092
|
+
},
|
|
5093
|
+
...domain && {
|
|
5094
|
+
Domain: domain
|
|
4960
5095
|
}
|
|
4961
5096
|
}
|
|
4962
5097
|
});
|
|
@@ -5011,7 +5146,14 @@ var WalletService = class {
|
|
|
5011
5146
|
return res.ok ? { ok: true, data: res.data.node } : res;
|
|
5012
5147
|
}
|
|
5013
5148
|
async createGameSession(variables) {
|
|
5014
|
-
const
|
|
5149
|
+
const { domain, ...others } = variables;
|
|
5150
|
+
const res = await this.client.request(CREATE_GAME_SESSION_MUTATION, others, {
|
|
5151
|
+
headers: {
|
|
5152
|
+
...domain && {
|
|
5153
|
+
Domain: domain
|
|
5154
|
+
}
|
|
5155
|
+
}
|
|
5156
|
+
});
|
|
5015
5157
|
if (!res.ok) return res;
|
|
5016
5158
|
if (res.data.createGameSession) {
|
|
5017
5159
|
return {
|
|
@@ -5178,10 +5320,7 @@ var WalletService = class {
|
|
|
5178
5320
|
};
|
|
5179
5321
|
}
|
|
5180
5322
|
async cabinetWithdrawal(variables) {
|
|
5181
|
-
const res = await this.client.request(
|
|
5182
|
-
CABINET_WITHDRAWAL_QUERY,
|
|
5183
|
-
variables
|
|
5184
|
-
);
|
|
5323
|
+
const res = await this.client.request(CABINET_WITHDRAWAL_QUERY, variables);
|
|
5185
5324
|
return res.ok ? { ok: res.ok, data: res.data.node } : res;
|
|
5186
5325
|
}
|
|
5187
5326
|
async redeemVoucher(variables) {
|
|
@@ -5705,8 +5844,8 @@ function pollable(func, config) {
|
|
|
5705
5844
|
};
|
|
5706
5845
|
}
|
|
5707
5846
|
|
|
5708
|
-
// src/sdk/session-manager.ts
|
|
5709
|
-
var
|
|
5847
|
+
// src/sdk/session-manager-cookie.ts
|
|
5848
|
+
var SessionManagerCookie = class {
|
|
5710
5849
|
logger;
|
|
5711
5850
|
storageKey = "session";
|
|
5712
5851
|
platformStorageKey = "session/platform";
|
|
@@ -5717,10 +5856,6 @@ var SessionManager = class {
|
|
|
5717
5856
|
this.authService = config.authService;
|
|
5718
5857
|
this.walletService = config.walletService;
|
|
5719
5858
|
this.logger = config.logger;
|
|
5720
|
-
if (config.sessionPrefix) {
|
|
5721
|
-
this.storageKey = `${config.sessionPrefix}/${this.storageKey}`;
|
|
5722
|
-
this.platformStorageKey = `${config.sessionPrefix}/${this.platformStorageKey}`;
|
|
5723
|
-
}
|
|
5724
5859
|
}
|
|
5725
5860
|
get refreshing() {
|
|
5726
5861
|
return this._refreshing;
|
|
@@ -5729,16 +5864,6 @@ var SessionManager = class {
|
|
|
5729
5864
|
this._refreshing = value;
|
|
5730
5865
|
}
|
|
5731
5866
|
async create(input) {
|
|
5732
|
-
if (this.isServer) {
|
|
5733
|
-
this.logger.warn("'localStorage' is not available on the server.");
|
|
5734
|
-
return {
|
|
5735
|
-
ok: false,
|
|
5736
|
-
error: {
|
|
5737
|
-
name: "UnknownError",
|
|
5738
|
-
message: "Server sign in is not supported."
|
|
5739
|
-
}
|
|
5740
|
-
};
|
|
5741
|
-
}
|
|
5742
5867
|
if (input.type === "MAYA") {
|
|
5743
5868
|
localStorage.setItem(this.platformStorageKey, "MAYA");
|
|
5744
5869
|
const f0 = () => this.walletService.mayaSession({ id: input.sessionId });
|
|
@@ -5765,13 +5890,14 @@ var SessionManager = class {
|
|
|
5765
5890
|
})();
|
|
5766
5891
|
if (!r1.ok) return r1;
|
|
5767
5892
|
const now2 = /* @__PURE__ */ new Date();
|
|
5768
|
-
|
|
5893
|
+
cookies.set(
|
|
5769
5894
|
this.storageKey,
|
|
5770
5895
|
JSON.stringify({
|
|
5771
5896
|
...r1.data,
|
|
5772
5897
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
5773
5898
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
5774
|
-
})
|
|
5899
|
+
}),
|
|
5900
|
+
{ expires: subMinutes(addDays(now2, 30), 2).getTime() }
|
|
5775
5901
|
);
|
|
5776
5902
|
return {
|
|
5777
5903
|
ok: true,
|
|
@@ -5782,13 +5908,16 @@ var SessionManager = class {
|
|
|
5782
5908
|
const res2 = await this.authService.createSession(input);
|
|
5783
5909
|
if (res2.ok) {
|
|
5784
5910
|
const now2 = /* @__PURE__ */ new Date();
|
|
5785
|
-
|
|
5911
|
+
cookies.set(
|
|
5786
5912
|
this.storageKey,
|
|
5787
5913
|
JSON.stringify({
|
|
5788
5914
|
...res2.data,
|
|
5789
5915
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
5790
5916
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
5791
|
-
})
|
|
5917
|
+
}),
|
|
5918
|
+
{
|
|
5919
|
+
expires: subMinutes(addDays(now2, 30), 2).getTime()
|
|
5920
|
+
}
|
|
5792
5921
|
);
|
|
5793
5922
|
return {
|
|
5794
5923
|
ok: true,
|
|
@@ -5800,18 +5929,18 @@ var SessionManager = class {
|
|
|
5800
5929
|
if (input.type === "SOCIALS" || input.type === "TOKEN") {
|
|
5801
5930
|
const res2 = await this.authService.createSession({
|
|
5802
5931
|
type: "SOCIALS",
|
|
5803
|
-
token: input.token
|
|
5804
|
-
channel: input.channel
|
|
5932
|
+
token: input.token
|
|
5805
5933
|
});
|
|
5806
5934
|
if (res2.ok) {
|
|
5807
5935
|
const now2 = /* @__PURE__ */ new Date();
|
|
5808
|
-
|
|
5936
|
+
cookies.set(
|
|
5809
5937
|
this.storageKey,
|
|
5810
5938
|
JSON.stringify({
|
|
5811
5939
|
...res2.data,
|
|
5812
5940
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
5813
5941
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
5814
|
-
})
|
|
5942
|
+
}),
|
|
5943
|
+
{ expires: subMinutes(addDays(now2, 30), 2).getTime() }
|
|
5815
5944
|
);
|
|
5816
5945
|
return {
|
|
5817
5946
|
ok: true,
|
|
@@ -5825,13 +5954,14 @@ var SessionManager = class {
|
|
|
5825
5954
|
const res2 = await this.authService.createSession(input);
|
|
5826
5955
|
if (res2.ok) {
|
|
5827
5956
|
const now2 = /* @__PURE__ */ new Date();
|
|
5828
|
-
|
|
5957
|
+
cookies.set(
|
|
5829
5958
|
this.storageKey,
|
|
5830
5959
|
JSON.stringify({
|
|
5831
5960
|
...res2.data,
|
|
5832
5961
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
5833
5962
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
5834
|
-
})
|
|
5963
|
+
}),
|
|
5964
|
+
{ expires: subMinutes(addDays(now2, 30), 2).getTime() }
|
|
5835
5965
|
);
|
|
5836
5966
|
return {
|
|
5837
5967
|
ok: true,
|
|
@@ -5851,13 +5981,14 @@ var SessionManager = class {
|
|
|
5851
5981
|
};
|
|
5852
5982
|
}
|
|
5853
5983
|
const now = /* @__PURE__ */ new Date();
|
|
5854
|
-
|
|
5984
|
+
cookies.set(
|
|
5855
5985
|
this.storageKey,
|
|
5856
5986
|
JSON.stringify({
|
|
5857
5987
|
...res.data,
|
|
5858
5988
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
5859
5989
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
5860
|
-
})
|
|
5990
|
+
}),
|
|
5991
|
+
{}
|
|
5861
5992
|
);
|
|
5862
5993
|
return {
|
|
5863
5994
|
ok: true,
|
|
@@ -5869,15 +6000,18 @@ var SessionManager = class {
|
|
|
5869
6000
|
if (res.ok) {
|
|
5870
6001
|
const now = /* @__PURE__ */ new Date();
|
|
5871
6002
|
if (this.isServer) {
|
|
5872
|
-
this.logger.warn("'
|
|
6003
|
+
this.logger.warn("'client cookies' is not available on the server.");
|
|
5873
6004
|
} else {
|
|
5874
|
-
|
|
6005
|
+
cookies.set(
|
|
5875
6006
|
this.storageKey,
|
|
5876
6007
|
JSON.stringify({
|
|
5877
6008
|
...res.data,
|
|
5878
6009
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
5879
6010
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
5880
|
-
})
|
|
6011
|
+
}),
|
|
6012
|
+
{
|
|
6013
|
+
expires: subMinutes(addDays(now, 30), 2).getTime()
|
|
6014
|
+
}
|
|
5881
6015
|
);
|
|
5882
6016
|
}
|
|
5883
6017
|
return { ok: true };
|
|
@@ -5887,7 +6021,7 @@ var SessionManager = class {
|
|
|
5887
6021
|
}
|
|
5888
6022
|
async get() {
|
|
5889
6023
|
if (this.isServer) {
|
|
5890
|
-
this.logger.warn("'
|
|
6024
|
+
this.logger.warn("'client cookies' is not available on the server.");
|
|
5891
6025
|
return {
|
|
5892
6026
|
ok: true,
|
|
5893
6027
|
data: null
|
|
@@ -5897,7 +6031,7 @@ var SessionManager = class {
|
|
|
5897
6031
|
await sleep(1e3);
|
|
5898
6032
|
return await this.get();
|
|
5899
6033
|
}
|
|
5900
|
-
const val =
|
|
6034
|
+
const val = cookies.get(this.storageKey);
|
|
5901
6035
|
if (!val) {
|
|
5902
6036
|
return {
|
|
5903
6037
|
ok: true,
|
|
@@ -5911,7 +6045,7 @@ var SessionManager = class {
|
|
|
5911
6045
|
const refreshTokenExpiresAt = new Date(obj.refreshTokenExpiresAt);
|
|
5912
6046
|
if (isAfter(now, refreshTokenExpiresAt)) {
|
|
5913
6047
|
this.logger.warn("Session expired. Logging out..");
|
|
5914
|
-
|
|
6048
|
+
cookies.remove(this.storageKey);
|
|
5915
6049
|
return {
|
|
5916
6050
|
ok: false,
|
|
5917
6051
|
error: {
|
|
@@ -5928,7 +6062,7 @@ var SessionManager = class {
|
|
|
5928
6062
|
if (!res.ok) {
|
|
5929
6063
|
this.logger.error(`Failed to refresh session: ${res.error.message}`);
|
|
5930
6064
|
if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
|
|
5931
|
-
|
|
6065
|
+
cookies.remove(this.storageKey);
|
|
5932
6066
|
return {
|
|
5933
6067
|
ok: false,
|
|
5934
6068
|
error: res.error
|
|
@@ -5949,7 +6083,9 @@ var SessionManager = class {
|
|
|
5949
6083
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
5950
6084
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
5951
6085
|
};
|
|
5952
|
-
|
|
6086
|
+
cookies.set(this.storageKey, JSON.stringify(obj), {
|
|
6087
|
+
expires: subMinutes(addDays(now, 30), 2).getTime()
|
|
6088
|
+
});
|
|
5953
6089
|
}
|
|
5954
6090
|
return {
|
|
5955
6091
|
ok: true,
|
|
@@ -5967,13 +6103,13 @@ var SessionManager = class {
|
|
|
5967
6103
|
}
|
|
5968
6104
|
async refresh() {
|
|
5969
6105
|
if (this.isServer) {
|
|
5970
|
-
this.logger.warn("'
|
|
6106
|
+
this.logger.warn("'client cookies' is not available on the server.");
|
|
5971
6107
|
return {
|
|
5972
6108
|
ok: true,
|
|
5973
6109
|
data: null
|
|
5974
6110
|
};
|
|
5975
6111
|
}
|
|
5976
|
-
const val =
|
|
6112
|
+
const val = cookies.get(this.storageKey);
|
|
5977
6113
|
if (!val) {
|
|
5978
6114
|
return {
|
|
5979
6115
|
ok: true,
|
|
@@ -5990,7 +6126,7 @@ var SessionManager = class {
|
|
|
5990
6126
|
if (!res.ok) {
|
|
5991
6127
|
this.logger.error(`Failed to refresh session: ${res.error.message}`);
|
|
5992
6128
|
if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
|
|
5993
|
-
|
|
6129
|
+
cookies.remove(this.storageKey);
|
|
5994
6130
|
return {
|
|
5995
6131
|
ok: false,
|
|
5996
6132
|
error: res.error
|
|
@@ -6011,7 +6147,9 @@ var SessionManager = class {
|
|
|
6011
6147
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
6012
6148
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
6013
6149
|
};
|
|
6014
|
-
|
|
6150
|
+
cookies.set(this.storageKey, JSON.stringify(obj), {
|
|
6151
|
+
expires: subMinutes(addDays(now, 30), 2).getTime()
|
|
6152
|
+
});
|
|
6015
6153
|
return {
|
|
6016
6154
|
ok: true,
|
|
6017
6155
|
data: obj
|
|
@@ -6028,18 +6166,18 @@ var SessionManager = class {
|
|
|
6028
6166
|
}
|
|
6029
6167
|
async destroy() {
|
|
6030
6168
|
if (this.isServer) {
|
|
6031
|
-
this.logger.warn("'
|
|
6169
|
+
this.logger.warn("'client cookies' is not available on the server.");
|
|
6032
6170
|
return;
|
|
6033
6171
|
}
|
|
6034
6172
|
const res = await this.get();
|
|
6035
6173
|
if (res.data?.accessToken) {
|
|
6036
6174
|
await this.authService.destroySession(res.data.accessToken);
|
|
6037
6175
|
}
|
|
6038
|
-
|
|
6176
|
+
cookies.remove(this.storageKey);
|
|
6039
6177
|
}
|
|
6040
6178
|
async verify() {
|
|
6041
6179
|
if (this.isServer) {
|
|
6042
|
-
this.logger.warn("'
|
|
6180
|
+
this.logger.warn("'client cookies' is not available on the server.");
|
|
6043
6181
|
return true;
|
|
6044
6182
|
}
|
|
6045
6183
|
const s = await this.get();
|
|
@@ -6049,13 +6187,13 @@ var SessionManager = class {
|
|
|
6049
6187
|
if (!s.data) return true;
|
|
6050
6188
|
const v = await this.authService.verifySession(s.data.accessToken);
|
|
6051
6189
|
if (!v) {
|
|
6052
|
-
|
|
6190
|
+
cookies.remove(this.storageKey);
|
|
6053
6191
|
}
|
|
6054
6192
|
return v;
|
|
6055
6193
|
}
|
|
6056
6194
|
get onMaya() {
|
|
6057
6195
|
if (this.isServer) {
|
|
6058
|
-
this.logger.warn("'
|
|
6196
|
+
this.logger.warn("'client cookies' is not available on the server.");
|
|
6059
6197
|
return false;
|
|
6060
6198
|
}
|
|
6061
6199
|
return localStorage.getItem(this.platformStorageKey) === "MAYA";
|
|
@@ -6071,7 +6209,9 @@ var SessionManager = class {
|
|
|
6071
6209
|
return typeof window === "undefined";
|
|
6072
6210
|
}
|
|
6073
6211
|
};
|
|
6074
|
-
|
|
6212
|
+
|
|
6213
|
+
// src/sdk/session-manager.ts
|
|
6214
|
+
var SessionManager = class {
|
|
6075
6215
|
logger;
|
|
6076
6216
|
storageKey = "session";
|
|
6077
6217
|
platformStorageKey = "session/platform";
|
|
@@ -6082,6 +6222,10 @@ var SessionManagerCookie = class {
|
|
|
6082
6222
|
this.authService = config.authService;
|
|
6083
6223
|
this.walletService = config.walletService;
|
|
6084
6224
|
this.logger = config.logger;
|
|
6225
|
+
if (config.sessionPrefix) {
|
|
6226
|
+
this.storageKey = `${config.sessionPrefix}/${this.storageKey}`;
|
|
6227
|
+
this.platformStorageKey = `${config.sessionPrefix}/${this.platformStorageKey}`;
|
|
6228
|
+
}
|
|
6085
6229
|
}
|
|
6086
6230
|
get refreshing() {
|
|
6087
6231
|
return this._refreshing;
|
|
@@ -6090,6 +6234,16 @@ var SessionManagerCookie = class {
|
|
|
6090
6234
|
this._refreshing = value;
|
|
6091
6235
|
}
|
|
6092
6236
|
async create(input) {
|
|
6237
|
+
if (this.isServer) {
|
|
6238
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6239
|
+
return {
|
|
6240
|
+
ok: false,
|
|
6241
|
+
error: {
|
|
6242
|
+
name: "UnknownError",
|
|
6243
|
+
message: "Server sign in is not supported."
|
|
6244
|
+
}
|
|
6245
|
+
};
|
|
6246
|
+
}
|
|
6093
6247
|
if (input.type === "MAYA") {
|
|
6094
6248
|
localStorage.setItem(this.platformStorageKey, "MAYA");
|
|
6095
6249
|
const f0 = () => this.walletService.mayaSession({ id: input.sessionId });
|
|
@@ -6116,14 +6270,13 @@ var SessionManagerCookie = class {
|
|
|
6116
6270
|
})();
|
|
6117
6271
|
if (!r1.ok) return r1;
|
|
6118
6272
|
const now2 = /* @__PURE__ */ new Date();
|
|
6119
|
-
|
|
6273
|
+
localStorage.setItem(
|
|
6120
6274
|
this.storageKey,
|
|
6121
6275
|
JSON.stringify({
|
|
6122
6276
|
...r1.data,
|
|
6123
6277
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
6124
6278
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
6125
|
-
})
|
|
6126
|
-
{ expires: subMinutes(addDays(now2, 30), 2).getTime() }
|
|
6279
|
+
})
|
|
6127
6280
|
);
|
|
6128
6281
|
return {
|
|
6129
6282
|
ok: true,
|
|
@@ -6134,16 +6287,13 @@ var SessionManagerCookie = class {
|
|
|
6134
6287
|
const res2 = await this.authService.createSession(input);
|
|
6135
6288
|
if (res2.ok) {
|
|
6136
6289
|
const now2 = /* @__PURE__ */ new Date();
|
|
6137
|
-
|
|
6290
|
+
localStorage.setItem(
|
|
6138
6291
|
this.storageKey,
|
|
6139
6292
|
JSON.stringify({
|
|
6140
6293
|
...res2.data,
|
|
6141
6294
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
6142
6295
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
6143
|
-
})
|
|
6144
|
-
{
|
|
6145
|
-
expires: subMinutes(addDays(now2, 30), 2).getTime()
|
|
6146
|
-
}
|
|
6296
|
+
})
|
|
6147
6297
|
);
|
|
6148
6298
|
return {
|
|
6149
6299
|
ok: true,
|
|
@@ -6155,18 +6305,18 @@ var SessionManagerCookie = class {
|
|
|
6155
6305
|
if (input.type === "SOCIALS" || input.type === "TOKEN") {
|
|
6156
6306
|
const res2 = await this.authService.createSession({
|
|
6157
6307
|
type: "SOCIALS",
|
|
6158
|
-
token: input.token
|
|
6308
|
+
token: input.token,
|
|
6309
|
+
channel: input.channel
|
|
6159
6310
|
});
|
|
6160
6311
|
if (res2.ok) {
|
|
6161
6312
|
const now2 = /* @__PURE__ */ new Date();
|
|
6162
|
-
|
|
6313
|
+
localStorage.setItem(
|
|
6163
6314
|
this.storageKey,
|
|
6164
6315
|
JSON.stringify({
|
|
6165
6316
|
...res2.data,
|
|
6166
6317
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
6167
6318
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
6168
|
-
})
|
|
6169
|
-
{ expires: subMinutes(addDays(now2, 30), 2).getTime() }
|
|
6319
|
+
})
|
|
6170
6320
|
);
|
|
6171
6321
|
return {
|
|
6172
6322
|
ok: true,
|
|
@@ -6180,14 +6330,13 @@ var SessionManagerCookie = class {
|
|
|
6180
6330
|
const res2 = await this.authService.createSession(input);
|
|
6181
6331
|
if (res2.ok) {
|
|
6182
6332
|
const now2 = /* @__PURE__ */ new Date();
|
|
6183
|
-
|
|
6333
|
+
localStorage.setItem(
|
|
6184
6334
|
this.storageKey,
|
|
6185
6335
|
JSON.stringify({
|
|
6186
6336
|
...res2.data,
|
|
6187
6337
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
6188
6338
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
6189
|
-
})
|
|
6190
|
-
{ expires: subMinutes(addDays(now2, 30), 2).getTime() }
|
|
6339
|
+
})
|
|
6191
6340
|
);
|
|
6192
6341
|
return {
|
|
6193
6342
|
ok: true,
|
|
@@ -6207,14 +6356,13 @@ var SessionManagerCookie = class {
|
|
|
6207
6356
|
};
|
|
6208
6357
|
}
|
|
6209
6358
|
const now = /* @__PURE__ */ new Date();
|
|
6210
|
-
|
|
6359
|
+
localStorage.setItem(
|
|
6211
6360
|
this.storageKey,
|
|
6212
6361
|
JSON.stringify({
|
|
6213
6362
|
...res.data,
|
|
6214
6363
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
6215
6364
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
6216
|
-
})
|
|
6217
|
-
{}
|
|
6365
|
+
})
|
|
6218
6366
|
);
|
|
6219
6367
|
return {
|
|
6220
6368
|
ok: true,
|
|
@@ -6226,18 +6374,15 @@ var SessionManagerCookie = class {
|
|
|
6226
6374
|
if (res.ok) {
|
|
6227
6375
|
const now = /* @__PURE__ */ new Date();
|
|
6228
6376
|
if (this.isServer) {
|
|
6229
|
-
this.logger.warn("'
|
|
6377
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6230
6378
|
} else {
|
|
6231
|
-
|
|
6379
|
+
localStorage.setItem(
|
|
6232
6380
|
this.storageKey,
|
|
6233
6381
|
JSON.stringify({
|
|
6234
6382
|
...res.data,
|
|
6235
6383
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
6236
6384
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
6237
|
-
})
|
|
6238
|
-
{
|
|
6239
|
-
expires: subMinutes(addDays(now, 30), 2).getTime()
|
|
6240
|
-
}
|
|
6385
|
+
})
|
|
6241
6386
|
);
|
|
6242
6387
|
}
|
|
6243
6388
|
return { ok: true };
|
|
@@ -6247,7 +6392,7 @@ var SessionManagerCookie = class {
|
|
|
6247
6392
|
}
|
|
6248
6393
|
async get() {
|
|
6249
6394
|
if (this.isServer) {
|
|
6250
|
-
this.logger.warn("'
|
|
6395
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6251
6396
|
return {
|
|
6252
6397
|
ok: true,
|
|
6253
6398
|
data: null
|
|
@@ -6257,7 +6402,7 @@ var SessionManagerCookie = class {
|
|
|
6257
6402
|
await sleep(1e3);
|
|
6258
6403
|
return await this.get();
|
|
6259
6404
|
}
|
|
6260
|
-
const val =
|
|
6405
|
+
const val = localStorage.getItem(this.storageKey);
|
|
6261
6406
|
if (!val) {
|
|
6262
6407
|
return {
|
|
6263
6408
|
ok: true,
|
|
@@ -6271,7 +6416,7 @@ var SessionManagerCookie = class {
|
|
|
6271
6416
|
const refreshTokenExpiresAt = new Date(obj.refreshTokenExpiresAt);
|
|
6272
6417
|
if (isAfter(now, refreshTokenExpiresAt)) {
|
|
6273
6418
|
this.logger.warn("Session expired. Logging out..");
|
|
6274
|
-
|
|
6419
|
+
localStorage.removeItem(this.storageKey);
|
|
6275
6420
|
return {
|
|
6276
6421
|
ok: false,
|
|
6277
6422
|
error: {
|
|
@@ -6288,7 +6433,7 @@ var SessionManagerCookie = class {
|
|
|
6288
6433
|
if (!res.ok) {
|
|
6289
6434
|
this.logger.error(`Failed to refresh session: ${res.error.message}`);
|
|
6290
6435
|
if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
|
|
6291
|
-
|
|
6436
|
+
localStorage.removeItem(this.storageKey);
|
|
6292
6437
|
return {
|
|
6293
6438
|
ok: false,
|
|
6294
6439
|
error: res.error
|
|
@@ -6309,9 +6454,7 @@ var SessionManagerCookie = class {
|
|
|
6309
6454
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
6310
6455
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
6311
6456
|
};
|
|
6312
|
-
|
|
6313
|
-
expires: subMinutes(addDays(now, 30), 2).getTime()
|
|
6314
|
-
});
|
|
6457
|
+
localStorage.setItem(this.storageKey, JSON.stringify(obj));
|
|
6315
6458
|
}
|
|
6316
6459
|
return {
|
|
6317
6460
|
ok: true,
|
|
@@ -6329,13 +6472,13 @@ var SessionManagerCookie = class {
|
|
|
6329
6472
|
}
|
|
6330
6473
|
async refresh() {
|
|
6331
6474
|
if (this.isServer) {
|
|
6332
|
-
this.logger.warn("'
|
|
6475
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6333
6476
|
return {
|
|
6334
6477
|
ok: true,
|
|
6335
6478
|
data: null
|
|
6336
6479
|
};
|
|
6337
6480
|
}
|
|
6338
|
-
const val =
|
|
6481
|
+
const val = localStorage.getItem(this.storageKey);
|
|
6339
6482
|
if (!val) {
|
|
6340
6483
|
return {
|
|
6341
6484
|
ok: true,
|
|
@@ -6352,7 +6495,7 @@ var SessionManagerCookie = class {
|
|
|
6352
6495
|
if (!res.ok) {
|
|
6353
6496
|
this.logger.error(`Failed to refresh session: ${res.error.message}`);
|
|
6354
6497
|
if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
|
|
6355
|
-
|
|
6498
|
+
localStorage.removeItem(this.storageKey);
|
|
6356
6499
|
return {
|
|
6357
6500
|
ok: false,
|
|
6358
6501
|
error: res.error
|
|
@@ -6373,9 +6516,7 @@ var SessionManagerCookie = class {
|
|
|
6373
6516
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
6374
6517
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
6375
6518
|
};
|
|
6376
|
-
|
|
6377
|
-
expires: subMinutes(addDays(now, 30), 2).getTime()
|
|
6378
|
-
});
|
|
6519
|
+
localStorage.setItem(this.storageKey, JSON.stringify(obj));
|
|
6379
6520
|
return {
|
|
6380
6521
|
ok: true,
|
|
6381
6522
|
data: obj
|
|
@@ -6392,18 +6533,18 @@ var SessionManagerCookie = class {
|
|
|
6392
6533
|
}
|
|
6393
6534
|
async destroy() {
|
|
6394
6535
|
if (this.isServer) {
|
|
6395
|
-
this.logger.warn("'
|
|
6536
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6396
6537
|
return;
|
|
6397
6538
|
}
|
|
6398
6539
|
const res = await this.get();
|
|
6399
6540
|
if (res.data?.accessToken) {
|
|
6400
6541
|
await this.authService.destroySession(res.data.accessToken);
|
|
6401
6542
|
}
|
|
6402
|
-
|
|
6543
|
+
localStorage.removeItem(this.storageKey);
|
|
6403
6544
|
}
|
|
6404
6545
|
async verify() {
|
|
6405
6546
|
if (this.isServer) {
|
|
6406
|
-
this.logger.warn("'
|
|
6547
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6407
6548
|
return true;
|
|
6408
6549
|
}
|
|
6409
6550
|
const s = await this.get();
|
|
@@ -6413,13 +6554,13 @@ var SessionManagerCookie = class {
|
|
|
6413
6554
|
if (!s.data) return true;
|
|
6414
6555
|
const v = await this.authService.verifySession(s.data.accessToken);
|
|
6415
6556
|
if (!v) {
|
|
6416
|
-
|
|
6557
|
+
localStorage.removeItem(this.storageKey);
|
|
6417
6558
|
}
|
|
6418
6559
|
return v;
|
|
6419
6560
|
}
|
|
6420
6561
|
get onMaya() {
|
|
6421
6562
|
if (this.isServer) {
|
|
6422
|
-
this.logger.warn("'
|
|
6563
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6423
6564
|
return false;
|
|
6424
6565
|
}
|
|
6425
6566
|
return localStorage.getItem(this.platformStorageKey) === "MAYA";
|
|
@@ -8157,6 +8298,23 @@ var Sdk = class {
|
|
|
8157
8298
|
get middleware() {
|
|
8158
8299
|
return this._middleware;
|
|
8159
8300
|
}
|
|
8301
|
+
initWebDomain() {
|
|
8302
|
+
if (typeof window === "undefined") return;
|
|
8303
|
+
if (Capacitor.isNativePlatform()) return;
|
|
8304
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
8305
|
+
const hostname = window.location.hostname;
|
|
8306
|
+
const market = searchParams.get("market");
|
|
8307
|
+
if (market) {
|
|
8308
|
+
sessionStorage.setItem("domain", `${hostname}/${market}`);
|
|
8309
|
+
} else if (sessionStorage.getItem("domain") == null) {
|
|
8310
|
+
sessionStorage.setItem("domain", hostname);
|
|
8311
|
+
}
|
|
8312
|
+
}
|
|
8313
|
+
get webDomain() {
|
|
8314
|
+
if (typeof window === "undefined") return null;
|
|
8315
|
+
if (Capacitor.isNativePlatform()) return null;
|
|
8316
|
+
return sessionStorage.getItem("domain");
|
|
8317
|
+
}
|
|
8160
8318
|
/*
|
|
8161
8319
|
*=============================================
|
|
8162
8320
|
* ADS
|
|
@@ -8234,7 +8392,7 @@ var Sdk = class {
|
|
|
8234
8392
|
request.headers.set("Domain", this.memberDomain);
|
|
8235
8393
|
return request;
|
|
8236
8394
|
}
|
|
8237
|
-
const domain = typeof window === "undefined" ?
|
|
8395
|
+
const domain = typeof window === "undefined" ? request.headers.get("Domain") : !Capacitor.isNativePlatform() ? request.headers.get("Domain") : Capacitor.getPlatform() === "ios" ? `ios/${this.config.platform}`.toLowerCase() : Capacitor.getPlatform() === "android" ? `android/${this.config.platform}`.toLowerCase() : request.headers.get("Domain");
|
|
8238
8396
|
if (domain) {
|
|
8239
8397
|
request.headers.set("Domain", domain);
|
|
8240
8398
|
return request;
|
|
@@ -8535,7 +8693,10 @@ var Sdk = class {
|
|
|
8535
8693
|
},
|
|
8536
8694
|
referralCode: input.referralCode,
|
|
8537
8695
|
verificationCode: input.verificationCode,
|
|
8538
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
8696
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
8697
|
+
...this.webDomain && {
|
|
8698
|
+
domain: this.webDomain
|
|
8699
|
+
}
|
|
8539
8700
|
});
|
|
8540
8701
|
return res.ok ? { ok: true, data: { id } } : res;
|
|
8541
8702
|
}
|
|
@@ -8559,7 +8720,10 @@ var Sdk = class {
|
|
|
8559
8720
|
referralCode: input.referralCode,
|
|
8560
8721
|
verificationCode: input.verificationCode,
|
|
8561
8722
|
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
8562
|
-
testPass: input.testPass
|
|
8723
|
+
testPass: input.testPass,
|
|
8724
|
+
...this.webDomain && {
|
|
8725
|
+
domain: this.webDomain
|
|
8726
|
+
}
|
|
8563
8727
|
});
|
|
8564
8728
|
return res2.ok ? { ok: true, data: { id } } : res2;
|
|
8565
8729
|
}
|
|
@@ -8574,7 +8738,10 @@ var Sdk = class {
|
|
|
8574
8738
|
},
|
|
8575
8739
|
mobileNumberVerificationCode: input.mobileVerificationCode,
|
|
8576
8740
|
testPass: input.testPass,
|
|
8577
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
8741
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
8742
|
+
...this.webDomain && {
|
|
8743
|
+
domain: this.webDomain
|
|
8744
|
+
}
|
|
8578
8745
|
}
|
|
8579
8746
|
);
|
|
8580
8747
|
return res2.ok ? { ok: true, data: { id } } : res2;
|
|
@@ -8589,7 +8756,10 @@ var Sdk = class {
|
|
|
8589
8756
|
password: await sha256(input.password),
|
|
8590
8757
|
mobileNumber: input.mobileNumber ? addAreaCode(input.mobileNumber, await this.locale) : void 0
|
|
8591
8758
|
},
|
|
8592
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
8759
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
8760
|
+
...this.webDomain && {
|
|
8761
|
+
domain: this.webDomain
|
|
8762
|
+
}
|
|
8593
8763
|
});
|
|
8594
8764
|
return res2.ok ? { ok: true, data: { id } } : res2;
|
|
8595
8765
|
}
|
|
@@ -8599,7 +8769,10 @@ var Sdk = class {
|
|
|
8599
8769
|
name: input.name,
|
|
8600
8770
|
password: await sha256(input.password)
|
|
8601
8771
|
},
|
|
8602
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
8772
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
8773
|
+
...this.webDomain && {
|
|
8774
|
+
domain: this.webDomain
|
|
8775
|
+
}
|
|
8603
8776
|
});
|
|
8604
8777
|
return res.ok ? { ok: true, data: { id } } : res;
|
|
8605
8778
|
}
|
|
@@ -8609,6 +8782,24 @@ var Sdk = class {
|
|
|
8609
8782
|
name: input.name,
|
|
8610
8783
|
password: await sha256(input.password),
|
|
8611
8784
|
domain: input.domain
|
|
8785
|
+
},
|
|
8786
|
+
...this.webDomain && {
|
|
8787
|
+
domain: this.webDomain
|
|
8788
|
+
}
|
|
8789
|
+
});
|
|
8790
|
+
}
|
|
8791
|
+
async registerAgentAccount(input) {
|
|
8792
|
+
return await this.accountService.registerAgentAccount({
|
|
8793
|
+
input: {
|
|
8794
|
+
name: input.name,
|
|
8795
|
+
firstName: input.firstName,
|
|
8796
|
+
lastName: input.lastName,
|
|
8797
|
+
mobileNumber: input.mobileNumber,
|
|
8798
|
+
emailAddress: input.emailAddress,
|
|
8799
|
+
customProperties: input.customProperties
|
|
8800
|
+
},
|
|
8801
|
+
...this.webDomain && {
|
|
8802
|
+
domain: this.webDomain
|
|
8612
8803
|
}
|
|
8613
8804
|
});
|
|
8614
8805
|
}
|
|
@@ -8807,7 +8998,10 @@ var Sdk = class {
|
|
|
8807
8998
|
amount: input.amount.toString(),
|
|
8808
8999
|
transactionPassword: await sha256(input.transactionPassword)
|
|
8809
9000
|
},
|
|
8810
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9001
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9002
|
+
...this.webDomain && {
|
|
9003
|
+
domain: this.webDomain
|
|
9004
|
+
}
|
|
8811
9005
|
});
|
|
8812
9006
|
if (!res.ok) return res;
|
|
8813
9007
|
}
|
|
@@ -8831,7 +9025,10 @@ var Sdk = class {
|
|
|
8831
9025
|
await this.locale
|
|
8832
9026
|
)
|
|
8833
9027
|
},
|
|
8834
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9028
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9029
|
+
...this.webDomain && {
|
|
9030
|
+
domain: this.webDomain
|
|
9031
|
+
}
|
|
8835
9032
|
});
|
|
8836
9033
|
if (!res.ok) return res;
|
|
8837
9034
|
}
|
|
@@ -8846,7 +9043,10 @@ var Sdk = class {
|
|
|
8846
9043
|
await this.locale
|
|
8847
9044
|
)
|
|
8848
9045
|
},
|
|
8849
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9046
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9047
|
+
...this.webDomain && {
|
|
9048
|
+
domain: this.webDomain
|
|
9049
|
+
}
|
|
8850
9050
|
});
|
|
8851
9051
|
if (!res.ok) return res;
|
|
8852
9052
|
}
|
|
@@ -8861,7 +9061,10 @@ var Sdk = class {
|
|
|
8861
9061
|
await this.locale
|
|
8862
9062
|
)
|
|
8863
9063
|
},
|
|
8864
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9064
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9065
|
+
...this.webDomain && {
|
|
9066
|
+
domain: this.webDomain
|
|
9067
|
+
}
|
|
8865
9068
|
});
|
|
8866
9069
|
if (!res.ok) return res;
|
|
8867
9070
|
}
|
|
@@ -8872,7 +9075,10 @@ var Sdk = class {
|
|
|
8872
9075
|
amount: input.amount.toString(),
|
|
8873
9076
|
transactionPassword: await sha256(input.transactionPassword)
|
|
8874
9077
|
},
|
|
8875
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9078
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9079
|
+
...this.webDomain && {
|
|
9080
|
+
domain: this.webDomain
|
|
9081
|
+
}
|
|
8876
9082
|
});
|
|
8877
9083
|
if (!res.ok) return res;
|
|
8878
9084
|
}
|
|
@@ -8886,7 +9092,10 @@ var Sdk = class {
|
|
|
8886
9092
|
accountName: input.accountName,
|
|
8887
9093
|
transactionPassword: await sha256(input.transactionPassword)
|
|
8888
9094
|
},
|
|
8889
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9095
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9096
|
+
...this.webDomain && {
|
|
9097
|
+
domain: this.webDomain
|
|
9098
|
+
}
|
|
8890
9099
|
});
|
|
8891
9100
|
if (!res.ok) return res;
|
|
8892
9101
|
}
|
|
@@ -8900,7 +9109,10 @@ var Sdk = class {
|
|
|
8900
9109
|
transactionPassword: await sha256(input.transactionPassword),
|
|
8901
9110
|
accountName: input.accountName
|
|
8902
9111
|
},
|
|
8903
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9112
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9113
|
+
...this.webDomain && {
|
|
9114
|
+
domain: this.webDomain
|
|
9115
|
+
}
|
|
8904
9116
|
});
|
|
8905
9117
|
if (!res.ok) return res;
|
|
8906
9118
|
}
|
|
@@ -8911,7 +9123,10 @@ var Sdk = class {
|
|
|
8911
9123
|
amount: input.amount.toString(),
|
|
8912
9124
|
upiId: input.upiId
|
|
8913
9125
|
},
|
|
8914
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9126
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9127
|
+
...this.webDomain && {
|
|
9128
|
+
domain: this.webDomain
|
|
9129
|
+
}
|
|
8915
9130
|
});
|
|
8916
9131
|
if (!res.ok) return res;
|
|
8917
9132
|
}
|
|
@@ -8924,7 +9139,10 @@ var Sdk = class {
|
|
|
8924
9139
|
bankAccountNumber: input.bankAccountNumber,
|
|
8925
9140
|
bankIFSCCode: input.bankIFSCCode
|
|
8926
9141
|
},
|
|
8927
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9142
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9143
|
+
...this.webDomain && {
|
|
9144
|
+
domain: this.webDomain
|
|
9145
|
+
}
|
|
8928
9146
|
});
|
|
8929
9147
|
if (!res.ok) return res;
|
|
8930
9148
|
}
|
|
@@ -8971,6 +9189,9 @@ var Sdk = class {
|
|
|
8971
9189
|
id,
|
|
8972
9190
|
amount: input.amount.toString(),
|
|
8973
9191
|
promo: input.promo
|
|
9192
|
+
},
|
|
9193
|
+
...this.webDomain && {
|
|
9194
|
+
domain: this.webDomain
|
|
8974
9195
|
}
|
|
8975
9196
|
});
|
|
8976
9197
|
if (!res.ok) return res;
|
|
@@ -8982,7 +9203,10 @@ var Sdk = class {
|
|
|
8982
9203
|
amount: input.amount.toString(),
|
|
8983
9204
|
promo: input.promo
|
|
8984
9205
|
},
|
|
8985
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9206
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9207
|
+
...this.webDomain && {
|
|
9208
|
+
domain: this.webDomain
|
|
9209
|
+
}
|
|
8986
9210
|
});
|
|
8987
9211
|
if (!res.ok) return res;
|
|
8988
9212
|
}
|
|
@@ -8993,7 +9217,10 @@ var Sdk = class {
|
|
|
8993
9217
|
amount: input.amount.toString(),
|
|
8994
9218
|
promo: input.promo
|
|
8995
9219
|
},
|
|
8996
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9220
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9221
|
+
...this.webDomain && {
|
|
9222
|
+
domain: this.webDomain
|
|
9223
|
+
}
|
|
8997
9224
|
});
|
|
8998
9225
|
if (!res.ok) return res;
|
|
8999
9226
|
}
|
|
@@ -9004,7 +9231,10 @@ var Sdk = class {
|
|
|
9004
9231
|
amount: input.amount.toString(),
|
|
9005
9232
|
promo: input.promo
|
|
9006
9233
|
},
|
|
9007
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9234
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9235
|
+
...this.webDomain && {
|
|
9236
|
+
domain: this.webDomain
|
|
9237
|
+
}
|
|
9008
9238
|
});
|
|
9009
9239
|
if (!res.ok) return res;
|
|
9010
9240
|
}
|
|
@@ -9016,7 +9246,10 @@ var Sdk = class {
|
|
|
9016
9246
|
promo: input.promo,
|
|
9017
9247
|
redirectUrl: `${ENDPOINTS[environment].opexapay}/aio/success?redirectUrl=${input.redirectUrl}?deposit=${id}`
|
|
9018
9248
|
},
|
|
9019
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9249
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9250
|
+
...this.webDomain && {
|
|
9251
|
+
domain: this.webDomain
|
|
9252
|
+
}
|
|
9020
9253
|
});
|
|
9021
9254
|
if (!res.ok) return res;
|
|
9022
9255
|
}
|
|
@@ -9028,7 +9261,10 @@ var Sdk = class {
|
|
|
9028
9261
|
promo: input.promo,
|
|
9029
9262
|
redirectUrl: `${ENDPOINTS[environment].opexapay}/aio/success?redirectUrl=${input.redirectUrl}?deposit=${id}`
|
|
9030
9263
|
},
|
|
9031
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9264
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9265
|
+
...this.webDomain && {
|
|
9266
|
+
domain: this.webDomain
|
|
9267
|
+
}
|
|
9032
9268
|
});
|
|
9033
9269
|
if (!res.ok) return res;
|
|
9034
9270
|
}
|
|
@@ -9040,7 +9276,10 @@ var Sdk = class {
|
|
|
9040
9276
|
promo: input.promo,
|
|
9041
9277
|
redirectUrl: `${ENDPOINTS[environment].opexapay}/aio/success?redirectUrl=${input.redirectUrl}?deposit=${id}`
|
|
9042
9278
|
},
|
|
9043
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9279
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9280
|
+
...this.webDomain && {
|
|
9281
|
+
domain: this.webDomain
|
|
9282
|
+
}
|
|
9044
9283
|
});
|
|
9045
9284
|
if (!res.ok) return res;
|
|
9046
9285
|
}
|
|
@@ -9052,7 +9291,10 @@ var Sdk = class {
|
|
|
9052
9291
|
promo: input.promo,
|
|
9053
9292
|
redirectUrl: `${ENDPOINTS[environment].opexapay}/aio/success?redirectUrl=${input.redirectUrl}?deposit=${id}`
|
|
9054
9293
|
},
|
|
9055
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9294
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9295
|
+
...this.webDomain && {
|
|
9296
|
+
domain: this.webDomain
|
|
9297
|
+
}
|
|
9056
9298
|
});
|
|
9057
9299
|
if (!res.ok) return res;
|
|
9058
9300
|
}
|
|
@@ -9063,7 +9305,10 @@ var Sdk = class {
|
|
|
9063
9305
|
amount: input.amount.toString(),
|
|
9064
9306
|
promo: input.promo
|
|
9065
9307
|
},
|
|
9066
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9308
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9309
|
+
...this.webDomain && {
|
|
9310
|
+
domain: this.webDomain
|
|
9311
|
+
}
|
|
9067
9312
|
});
|
|
9068
9313
|
if (!res.ok) return res;
|
|
9069
9314
|
}
|
|
@@ -9074,7 +9319,10 @@ var Sdk = class {
|
|
|
9074
9319
|
amount: input.amount.toString(),
|
|
9075
9320
|
promo: input.promo
|
|
9076
9321
|
},
|
|
9077
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9322
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9323
|
+
...this.webDomain && {
|
|
9324
|
+
domain: this.webDomain
|
|
9325
|
+
}
|
|
9078
9326
|
});
|
|
9079
9327
|
if (!res.ok) return res;
|
|
9080
9328
|
}
|
|
@@ -9087,7 +9335,10 @@ var Sdk = class {
|
|
|
9087
9335
|
referenceImage: input.referenceImage,
|
|
9088
9336
|
promo: input.promo
|
|
9089
9337
|
},
|
|
9090
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9338
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9339
|
+
...this.webDomain && {
|
|
9340
|
+
domain: this.webDomain
|
|
9341
|
+
}
|
|
9091
9342
|
});
|
|
9092
9343
|
if (!res.ok) return res;
|
|
9093
9344
|
}
|
|
@@ -9099,7 +9350,10 @@ var Sdk = class {
|
|
|
9099
9350
|
referenceImage: input.referenceId,
|
|
9100
9351
|
promo: input.promo
|
|
9101
9352
|
},
|
|
9102
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9353
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9354
|
+
...this.webDomain && {
|
|
9355
|
+
domain: this.webDomain
|
|
9356
|
+
}
|
|
9103
9357
|
});
|
|
9104
9358
|
if (!res.ok) return res;
|
|
9105
9359
|
}
|
|
@@ -9112,7 +9366,10 @@ var Sdk = class {
|
|
|
9112
9366
|
cancelRedirectionUrl: input.cancelRedirectionUrl,
|
|
9113
9367
|
successRedirectionUrl: input.successRedirectionUrl
|
|
9114
9368
|
},
|
|
9115
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9369
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9370
|
+
...this.webDomain && {
|
|
9371
|
+
domain: this.webDomain
|
|
9372
|
+
}
|
|
9116
9373
|
});
|
|
9117
9374
|
if (!res.ok) return res;
|
|
9118
9375
|
}
|
|
@@ -9124,7 +9381,10 @@ var Sdk = class {
|
|
|
9124
9381
|
promo: input.promo,
|
|
9125
9382
|
redirectUrl: input.redirectUrl
|
|
9126
9383
|
},
|
|
9127
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9384
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9385
|
+
...this.webDomain && {
|
|
9386
|
+
domain: this.webDomain
|
|
9387
|
+
}
|
|
9128
9388
|
});
|
|
9129
9389
|
if (!res.ok) return res;
|
|
9130
9390
|
}
|
|
@@ -9508,12 +9768,18 @@ var Sdk = class {
|
|
|
9508
9768
|
input: {
|
|
9509
9769
|
id,
|
|
9510
9770
|
game: input.reference
|
|
9771
|
+
},
|
|
9772
|
+
...this.webDomain && {
|
|
9773
|
+
domain: this.webDomain
|
|
9511
9774
|
}
|
|
9512
9775
|
}) : await this.gameService.createGameSession({
|
|
9513
9776
|
input: {
|
|
9514
9777
|
id,
|
|
9515
9778
|
game: input.reference,
|
|
9516
9779
|
homepageUrl: typeof window === "undefined" ? void 0 : input.homepageUrl
|
|
9780
|
+
},
|
|
9781
|
+
...this.webDomain && {
|
|
9782
|
+
domain: this.webDomain
|
|
9517
9783
|
}
|
|
9518
9784
|
});
|
|
9519
9785
|
return res.ok ? { ok: true, data: { id } } : res;
|
|
@@ -9546,12 +9812,18 @@ var Sdk = class {
|
|
|
9546
9812
|
}
|
|
9547
9813
|
const { provider, reference } = res0.data;
|
|
9548
9814
|
const res1 = NEW_GAME_PROVIDERS.includes(provider) ? await this.walletService.createGameSession({
|
|
9549
|
-
input: { id, game: reference }
|
|
9815
|
+
input: { id, game: reference },
|
|
9816
|
+
...this.webDomain && {
|
|
9817
|
+
domain: this.webDomain
|
|
9818
|
+
}
|
|
9550
9819
|
}) : await this.gameService.createGameSession({
|
|
9551
9820
|
input: {
|
|
9552
9821
|
id,
|
|
9553
9822
|
game: reference,
|
|
9554
9823
|
homepageUrl: typeof window === "undefined" ? void 0 : input.homepageUrl
|
|
9824
|
+
},
|
|
9825
|
+
...this.webDomain && {
|
|
9826
|
+
domain: this.webDomain
|
|
9555
9827
|
}
|
|
9556
9828
|
});
|
|
9557
9829
|
return res1.ok ? { ok: true, data: { id } } : res1;
|