@jetthai/cuora 1.1.105 → 1.1.106

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,8 @@
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.106](https://github.com/jetthai/cuora-module/compare/v1.1.105...v1.1.106) (2023-05-29)
6
+
5
7
  ### [1.1.105](https://github.com/jetthai/cuora-module/compare/v1.1.104...v1.1.105) (2023-05-29)
6
8
 
7
9
  ### [1.1.104](https://github.com/jetthai/cuora-module/compare/v1.1.103...v1.1.104) (2023-05-26)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.105",
3
+ "version": "1.1.106",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -16,6 +16,7 @@ export default function (request, context) {
16
16
  cryptos: [],
17
17
  networks: [],
18
18
  sourceAddress: '',
19
+ options: [],
19
20
 
20
21
  selectedCrypto: null,
21
22
  selectedNetwork: null,
@@ -138,6 +139,7 @@ export default function (request, context) {
138
139
  networks: defaultNetworks,
139
140
  selectedCrypto: cryptos[0],
140
141
  selectedNetwork: defaultNetworks[0],
142
+ options: cryptos[0].optional,
141
143
  }
142
144
  }),
143
145
  setCrypto: assign((context, event) => {
@@ -157,14 +159,18 @@ export default function (request, context) {
157
159
  selectedNetwork: networks[0],
158
160
  selectedAmount: null,
159
161
  calculation: null,
162
+ options: selectedCrypto.optional,
160
163
  }
161
164
  }),
162
165
  setNetwork: assign((context, event) => {
163
166
  return { selectedNetwork: event.data }
164
167
  }),
165
168
  setAmount: assign((context, event) => {
166
- return {
167
- selectedAmount: event.data,
169
+ // 現金網可自由填額度,grandTotalEnable 欄位感覺不再需要?
170
+ if (context.selectedCrypto?.grandTotalEnable === 1) {
171
+ return { selectedAmount: parseFloat(context.selectedAmount || 0) + parseFloat(event.data) }
172
+ } else {
173
+ return { selectedAmount: event.data }
168
174
  }
169
175
  }),
170
176
  setAddress: assign((context, event) => {