File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -69,30 +69,30 @@ const queryParams = {
69
69
accountIn: connectedAccount,
70
70
accountOut: connectedAccount,
71
71
slippage: " 0.1" , // 0.1%
72
- deadline: String (Date .now () / 1000 + 10 * 60 ), // 10 minutes from now
72
+ deadline: String (Math . floor ( Date .now () / 1000 ) + 10 * 60 ), // 10 minutes from now
73
73
swapperMode: " 2" , // target debt mode
74
74
isRepay: " true" ,
75
75
}
76
76
77
77
const { data: response } = await axios .get (
78
78
` ${ SWAP_API_URL } /swap` ,
79
79
{
80
- params: requstParams ,
80
+ params: queryParams ,
81
81
},
82
82
)
83
83
84
84
// Encode EVC batch
85
- const batchItems =
85
+ const batchItems = [
86
86
// Withdraw collateral to the Swapper contract
87
87
{
88
88
targetContract: collateralVault,
89
89
onBehalfOfAccount: connectedAccount,
90
90
value: 0 ,
91
91
data: encodeFunctionData ({
92
92
abi: EVAULT_ABI ,
93
- functionName: " withdraw"
93
+ functionName: " withdraw" ,
94
94
args: [response .data .amountInMax , response .data .swap .swapperAddress , connectedAccount]
95
- }
95
+ })
96
96
},
97
97
// execute Swapper payload from the API response
98
98
{
@@ -108,7 +108,7 @@ const batchItems =
108
108
value: 0 ,
109
109
data: response .data .verify .verifierData
110
110
},
111
- ))
111
+ ]
112
112
113
113
const evcBatch = encodeFunctionData ({
114
114
abi: EVC_ABI ,
You can’t perform that action at this time.
0 commit comments