@jetthai/cuora 1.1.236 → 1.1.238
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
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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.238](https://github.com/jetthai/cuora-module/compare/v1.1.237...v1.1.238) (2024-03-28)
|
|
6
|
+
|
|
7
|
+
### [1.1.237](https://github.com/jetthai/cuora-module/compare/v1.1.236...v1.1.237) (2024-03-27)
|
|
8
|
+
|
|
5
9
|
### [1.1.236](https://github.com/jetthai/cuora-module/compare/v1.1.235...v1.1.236) (2024-03-25)
|
|
6
10
|
|
|
7
11
|
### [1.1.235](https://github.com/jetthai/cuora-module/compare/v1.1.234...v1.1.235) (2024-03-25)
|
package/package.json
CHANGED
|
@@ -15,6 +15,8 @@ export default function (request, context) {
|
|
|
15
15
|
// 領獎後得到的資訊
|
|
16
16
|
amount: null,
|
|
17
17
|
message: null,
|
|
18
|
+
canReceiveQuantity: null,
|
|
19
|
+
receivedQuantity: null,
|
|
18
20
|
},
|
|
19
21
|
initial: 'idle',
|
|
20
22
|
states: {
|
|
@@ -69,7 +71,7 @@ export default function (request, context) {
|
|
|
69
71
|
receivable: {
|
|
70
72
|
after: {
|
|
71
73
|
0: {
|
|
72
|
-
target: '
|
|
74
|
+
target: 'loaded',
|
|
73
75
|
},
|
|
74
76
|
},
|
|
75
77
|
},
|
|
@@ -103,10 +105,12 @@ export default function (request, context) {
|
|
|
103
105
|
}
|
|
104
106
|
}),
|
|
105
107
|
setAward: assign((context, event) => {
|
|
106
|
-
const { amount, message } = event.data
|
|
108
|
+
const { amount, message, canReceiveQuantity, receivedQuantity } = event.data
|
|
107
109
|
return {
|
|
108
110
|
amount,
|
|
109
111
|
message,
|
|
112
|
+
canReceiveQuantity,
|
|
113
|
+
receivedQuantity,
|
|
110
114
|
}
|
|
111
115
|
}),
|
|
112
116
|
setCallback: assign((context, event) => {
|
|
@@ -11,19 +11,13 @@ export default function (request) {
|
|
|
11
11
|
context: {
|
|
12
12
|
paymentDetails: [],
|
|
13
13
|
|
|
14
|
-
channels: [],
|
|
15
14
|
cryptos: [],
|
|
16
15
|
networks: [],
|
|
17
|
-
sourceAddress: '',
|
|
18
|
-
|
|
19
|
-
houseBanks: [],
|
|
20
|
-
banks: [],
|
|
21
16
|
|
|
22
17
|
amount: null,
|
|
23
|
-
selectedHouseBank: null,
|
|
24
|
-
selectedChannel: null,
|
|
25
18
|
selectedCrypto: null,
|
|
26
19
|
selectedNetwork: null,
|
|
20
|
+
selectedBank: null,
|
|
27
21
|
|
|
28
22
|
currentCategory: 'cryptoBank',
|
|
29
23
|
currentPayment: null,
|
|
@@ -125,10 +119,6 @@ export default function (request) {
|
|
|
125
119
|
fail: {},
|
|
126
120
|
},
|
|
127
121
|
on: {
|
|
128
|
-
SET_CHANNEL: {
|
|
129
|
-
target: '.loaded',
|
|
130
|
-
actions: 'setChannel',
|
|
131
|
-
},
|
|
132
122
|
SET_CRYPTO: {
|
|
133
123
|
target: '.loaded',
|
|
134
124
|
actions: 'setCrypto',
|
|
@@ -137,9 +127,6 @@ export default function (request) {
|
|
|
137
127
|
target: '.loaded',
|
|
138
128
|
actions: 'setNetwork',
|
|
139
129
|
},
|
|
140
|
-
SET_ADDRESS: {
|
|
141
|
-
actions: 'setAddress',
|
|
142
|
-
},
|
|
143
130
|
SET_AMOUNT: {
|
|
144
131
|
target: '.loaded',
|
|
145
132
|
actions: ['setAmount', 'clearCalculation'],
|
|
@@ -166,12 +153,13 @@ export default function (request) {
|
|
|
166
153
|
event.data
|
|
167
154
|
.filter((element) => element.category === context.currentCategory)
|
|
168
155
|
.map?.((crypto) => ({ ...crypto, label: crypto.channel, value: crypto.method, icon: crypto.channel })) || []
|
|
169
|
-
const currentPayment = cryptos.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
156
|
+
const currentPayment = cryptos[0].networkName.map((value, i) => {
|
|
157
|
+
return {
|
|
158
|
+
label: cryptos[0].networkOptional?.[i],
|
|
159
|
+
value,
|
|
160
|
+
icon: value,
|
|
161
|
+
}
|
|
173
162
|
})
|
|
174
|
-
const channels = cryptos.map((item, i) => ({ ...item, label: `Channel ${padStart(String(i + 1), 2, '0')}`, icon: 'channel' }))
|
|
175
163
|
const defaultNetworks =
|
|
176
164
|
cryptos[0].networkName.map((value, i) => {
|
|
177
165
|
return {
|
|
@@ -180,81 +168,46 @@ export default function (request) {
|
|
|
180
168
|
icon: value,
|
|
181
169
|
}
|
|
182
170
|
}) || []
|
|
183
|
-
const
|
|
171
|
+
const selectedBank = (cryptos[0]?.banks || []).find((item) => item.network === defaultNetworks[0].value)
|
|
172
|
+
|
|
184
173
|
return {
|
|
185
|
-
channels,
|
|
186
174
|
cryptos,
|
|
187
175
|
networks: defaultNetworks,
|
|
188
|
-
selectedChannel: channels[0],
|
|
189
176
|
selectedCrypto: cryptos[0],
|
|
190
177
|
selectedNetwork: defaultNetworks[0],
|
|
178
|
+
selectedBank: selectedBank,
|
|
179
|
+
options: cryptos[0].optional,
|
|
191
180
|
currentPayment,
|
|
192
|
-
houseBanks,
|
|
193
|
-
selectedHouseBank,
|
|
194
181
|
processing: currentPayment.processing?.[0],
|
|
195
182
|
}
|
|
196
183
|
}),
|
|
197
|
-
|
|
184
|
+
setCrypto: assign((context, event) => {
|
|
198
185
|
const { cryptos } = context
|
|
199
186
|
const selectedCrypto = cryptos.find((crypto) => crypto.method === event.data.value)
|
|
200
|
-
const networks =
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}) || []
|
|
187
|
+
const networks = selectedCrypto?.networkName.map((value, i) => {
|
|
188
|
+
return {
|
|
189
|
+
label: selectedCrypto?.networkOptional?.[i],
|
|
190
|
+
value,
|
|
191
|
+
icon: value,
|
|
192
|
+
}
|
|
193
|
+
})
|
|
208
194
|
return {
|
|
209
195
|
networks,
|
|
210
|
-
selectedChannel: event.data,
|
|
211
196
|
selectedCrypto: selectedCrypto,
|
|
212
197
|
selectedNetwork: networks[0],
|
|
213
|
-
|
|
198
|
+
selectedAmount: null,
|
|
214
199
|
calculation: null,
|
|
200
|
+
options: selectedCrypto.optional,
|
|
215
201
|
}
|
|
216
202
|
}),
|
|
217
|
-
setCrypto: assign((context, event) => {
|
|
218
|
-
const { cryptos, selectedNetwork } = context
|
|
219
|
-
const method = cryptos.find((crypto) => crypto.method === event.data.value)
|
|
220
|
-
const networks =
|
|
221
|
-
method?.networkName.map((value, i) => {
|
|
222
|
-
return {
|
|
223
|
-
label: method?.networkOptional?.[i],
|
|
224
|
-
value,
|
|
225
|
-
icon: value,
|
|
226
|
-
}
|
|
227
|
-
}) || []
|
|
228
|
-
|
|
229
|
-
const properties = {
|
|
230
|
-
selectedCrypto: event.data,
|
|
231
|
-
networks,
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
if (!networks.includes(selectedNetwork)) {
|
|
235
|
-
properties.selectedNetwork = null
|
|
236
|
-
properties.amount = null
|
|
237
|
-
properties.calculation = null
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
return properties
|
|
241
|
-
}),
|
|
242
203
|
setNetwork: assign((context, event) => {
|
|
243
|
-
|
|
244
|
-
const currentNetwork = houseBanks.find((element) => element.network === event.data.value) || houseBanks[0]
|
|
245
|
-
|
|
246
|
-
return { selectedNetwork: event.data, selectedHouseBank: currentNetwork }
|
|
204
|
+
return { selectedNetwork: event.data }
|
|
247
205
|
}),
|
|
248
206
|
setAmount: assign((context, event) => {
|
|
249
207
|
return {
|
|
250
208
|
amount: event.data,
|
|
251
209
|
}
|
|
252
210
|
}),
|
|
253
|
-
setAddress: assign((context, event) => {
|
|
254
|
-
return {
|
|
255
|
-
sourceAddress: event.data,
|
|
256
|
-
}
|
|
257
|
-
}),
|
|
258
211
|
setCalculation: assign((context, event) => {
|
|
259
212
|
return {
|
|
260
213
|
calculation: event.data,
|