File tree 3 files changed +11
-11
lines changed
3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -6,20 +6,20 @@ function TradingController() {
6
6
const { userAddress, sharkAddress, fromToken, toToken } =
7
7
req . body ;
8
8
9
- let { usdAmount } = req . body ;
9
+ let { ethAmount } = req . body ;
10
10
11
- if ( ! usdAmount ) usdAmount = null ;
11
+ if ( ! ethAmount ) ethAmount = null ;
12
12
else {
13
- usdAmount = _ . toNumber ( usdAmount ) ;
13
+ ethAmount = _ . toNumber ( ethAmount ) ;
14
14
15
- if ( _ . isNaN ( usdAmount ) ) usdAmount = null ;
15
+ if ( _ . isNaN ( ethAmount ) ) ethAmount = null ;
16
16
}
17
17
const tradingDetail = await saveAutoTrading (
18
18
userAddress ,
19
19
sharkAddress ,
20
20
fromToken ,
21
21
toToken ,
22
- usdAmount
22
+ ethAmount
23
23
) ;
24
24
25
25
tradingDetail . isSaved
Original file line number Diff line number Diff line change @@ -737,7 +737,7 @@ export const saveAutoTrading = async (
737
737
sharkAddress ,
738
738
fromToken ,
739
739
toToken ,
740
- usdAmount
740
+ ethAmount
741
741
) => {
742
742
try {
743
743
let isExistedWallet = await checkExistedWalletAddress ( userAddress ) ;
@@ -755,7 +755,7 @@ export const saveAutoTrading = async (
755
755
message : "save-failed" ,
756
756
error : "shark-not-found"
757
757
} ;
758
- if ( _ . isNull ( usdAmount ) )
758
+ if ( _ . isNull ( ethAmount ) )
759
759
return {
760
760
isSaved : false ,
761
761
message : "save-failed" ,
@@ -765,7 +765,7 @@ export const saveAutoTrading = async (
765
765
sharkAddress : sharkAddress ,
766
766
fromToken : fromToken ,
767
767
toToken : toToken ,
768
- usdAmount : usdAmount
768
+ ethAmount : ethAmount
769
769
} ;
770
770
771
771
const user = await UserModel . findOneAndUpdate (
Original file line number Diff line number Diff line change 15
15
- toToken
16
16
- sharkAddress
17
17
- userAddress
18
- - usdAmount
18
+ - ethAmount
19
19
properties :
20
20
fromToken :
21
21
type : string
25
25
type : string
26
26
userAddress :
27
27
type : string
28
- usdAmount :
28
+ ethAmount :
29
29
type : string
30
30
example :
31
31
fromToken : " 0x..."
32
32
toToken : " 0x..."
33
33
sharkAddress : " 0x..."
34
34
userAddress : " 0x..."
35
- usdAmount : " 1000 "
35
+ ethAmount : " 0.001 "
36
36
responses :
37
37
200 :
38
38
description : Successfully
You can’t perform that action at this time.
0 commit comments