@jetthai/cuora 1.1.45-1 → 1.1.45
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/CHANGELOG.md +0 -2
- package/dist/bundle.mjs +7 -21
- package/package.json +1 -1
- package/src/machine/withdraw_crypto.js +4 -20
- package/src/machine/withdraw_vn.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
### [1.1.45-1](https://github.com/jetthai/cuora-module/compare/v1.1.45...v1.1.45-1) (2023-02-08)
|
|
6
|
-
|
|
7
5
|
### [1.1.45](https://github.com/jetthai/cuora-module/compare/v1.1.44...v1.1.45) (2023-02-03)
|
|
8
6
|
|
|
9
7
|
### [1.1.44](https://github.com/jetthai/cuora-module/compare/v1.1.43...v1.1.44) (2023-01-20)
|
package/dist/bundle.mjs
CHANGED
|
@@ -14831,7 +14831,6 @@ function withdraw_vn (request) {
|
|
|
14831
14831
|
maximumWithdrawAmount: 0,
|
|
14832
14832
|
enableWithdrawAmount: 0,
|
|
14833
14833
|
enableWithdraw: false,
|
|
14834
|
-
withdrawRules: [],
|
|
14835
14834
|
|
|
14836
14835
|
amount: null,
|
|
14837
14836
|
bank: null,
|
|
@@ -14839,6 +14838,9 @@ function withdraw_vn (request) {
|
|
|
14839
14838
|
accountNumber: null,
|
|
14840
14839
|
holderName: null,
|
|
14841
14840
|
|
|
14841
|
+
withdrawDistance: null,
|
|
14842
|
+
withdrawAmount: null,
|
|
14843
|
+
|
|
14842
14844
|
// otp
|
|
14843
14845
|
requestId: null,
|
|
14844
14846
|
status: null,
|
|
@@ -15318,7 +15320,6 @@ function withdraw_crypto (request) {
|
|
|
15318
15320
|
maxWithdrawAmount: null,
|
|
15319
15321
|
availableWithdrawAmount: null,
|
|
15320
15322
|
enableWithdraw: false,
|
|
15321
|
-
withdrawRules: [],
|
|
15322
15323
|
|
|
15323
15324
|
attachmentType: null, // null | 'withdraw' | 'pool'
|
|
15324
15325
|
|
|
@@ -15641,28 +15642,13 @@ function withdraw_crypto (request) {
|
|
|
15641
15642
|
const { differAmountLimit, enableWithdraw, enableWithdrawAmount, maxWithdrawStatus, maximumWithdrawAmount, minimumWithdrawAmount } =
|
|
15642
15643
|
event.data?.withdrawRule;
|
|
15643
15644
|
|
|
15644
|
-
const withdrawRules = event.data?.withdrawRule?.rules || [];
|
|
15645
|
-
const rules = withdrawRules.filter((rule) => rule.maxWithdrawAmount > 0);
|
|
15646
|
-
|
|
15647
|
-
const { balance } = context;
|
|
15648
|
-
const lastMatchedIndex = findLastIndex_1(rules, (rule) => balance >= rule.greaterEqualThen);
|
|
15649
|
-
|
|
15650
|
-
let maxWithdrawAmount = 0;
|
|
15651
|
-
|
|
15652
|
-
if (lastMatchedIndex > -1) {
|
|
15653
|
-
rules[lastMatchedIndex].match = true;
|
|
15654
|
-
maxWithdrawAmount = rules[lastMatchedIndex].maxWithdrawAmount;
|
|
15655
|
-
} else if (rules.length > 0) {
|
|
15656
|
-
maxWithdrawAmount = rules[0].maxWithdrawAmount;
|
|
15657
|
-
} else {
|
|
15658
|
-
maxWithdrawAmount = balance;
|
|
15659
|
-
}
|
|
15660
|
-
|
|
15661
15645
|
return {
|
|
15662
|
-
maxWithdrawAmount,
|
|
15646
|
+
// maxWithdrawAmount: maximumWithdrawAmount,
|
|
15647
|
+
// availableWithdrawAmount: enableWithdrawAmount,
|
|
15648
|
+
maximumWithdrawAmount: +maximumWithdrawAmount,
|
|
15663
15649
|
enableWithdrawAmount: +enableWithdrawAmount,
|
|
15650
|
+
amount: +enableWithdrawAmount,
|
|
15664
15651
|
enableWithdraw,
|
|
15665
|
-
withdrawRules,
|
|
15666
15652
|
}
|
|
15667
15653
|
|
|
15668
15654
|
// const rules = event.data.rules.filter((rule) => rule.maxWithdrawAmount > 0)
|
package/package.json
CHANGED
|
@@ -25,7 +25,6 @@ export default function (request) {
|
|
|
25
25
|
maxWithdrawAmount: null,
|
|
26
26
|
availableWithdrawAmount: null,
|
|
27
27
|
enableWithdraw: false,
|
|
28
|
-
withdrawRules: [],
|
|
29
28
|
|
|
30
29
|
attachmentType: null, // null | 'withdraw' | 'pool'
|
|
31
30
|
|
|
@@ -348,28 +347,13 @@ export default function (request) {
|
|
|
348
347
|
const { differAmountLimit, enableWithdraw, enableWithdrawAmount, maxWithdrawStatus, maximumWithdrawAmount, minimumWithdrawAmount } =
|
|
349
348
|
event.data?.withdrawRule
|
|
350
349
|
|
|
351
|
-
const withdrawRules = event.data?.withdrawRule?.rules || []
|
|
352
|
-
const rules = withdrawRules.filter((rule) => rule.maxWithdrawAmount > 0)
|
|
353
|
-
|
|
354
|
-
const { balance } = context
|
|
355
|
-
const lastMatchedIndex = findLastIndex(rules, (rule) => balance >= rule.greaterEqualThen)
|
|
356
|
-
|
|
357
|
-
let maxWithdrawAmount = 0
|
|
358
|
-
|
|
359
|
-
if (lastMatchedIndex > -1) {
|
|
360
|
-
rules[lastMatchedIndex].match = true
|
|
361
|
-
maxWithdrawAmount = rules[lastMatchedIndex].maxWithdrawAmount
|
|
362
|
-
} else if (rules.length > 0) {
|
|
363
|
-
maxWithdrawAmount = rules[0].maxWithdrawAmount
|
|
364
|
-
} else {
|
|
365
|
-
maxWithdrawAmount = balance
|
|
366
|
-
}
|
|
367
|
-
|
|
368
350
|
return {
|
|
369
|
-
maxWithdrawAmount,
|
|
351
|
+
// maxWithdrawAmount: maximumWithdrawAmount,
|
|
352
|
+
// availableWithdrawAmount: enableWithdrawAmount,
|
|
353
|
+
maximumWithdrawAmount: +maximumWithdrawAmount,
|
|
370
354
|
enableWithdrawAmount: +enableWithdrawAmount,
|
|
355
|
+
amount: +enableWithdrawAmount,
|
|
371
356
|
enableWithdraw,
|
|
372
|
-
withdrawRules,
|
|
373
357
|
}
|
|
374
358
|
|
|
375
359
|
// const rules = event.data.rules.filter((rule) => rule.maxWithdrawAmount > 0)
|
|
@@ -27,7 +27,6 @@ export default function (request) {
|
|
|
27
27
|
maximumWithdrawAmount: 0,
|
|
28
28
|
enableWithdrawAmount: 0,
|
|
29
29
|
enableWithdraw: false,
|
|
30
|
-
withdrawRules: [],
|
|
31
30
|
|
|
32
31
|
amount: null,
|
|
33
32
|
bank: null,
|
|
@@ -35,6 +34,9 @@ export default function (request) {
|
|
|
35
34
|
accountNumber: null,
|
|
36
35
|
holderName: null,
|
|
37
36
|
|
|
37
|
+
withdrawDistance: null,
|
|
38
|
+
withdrawAmount: null,
|
|
39
|
+
|
|
38
40
|
// otp
|
|
39
41
|
requestId: null,
|
|
40
42
|
status: null,
|