Skip to content

Commit 27bba4b

Browse files
committed
fix: Readme example params
1 parent 1fea9aa commit 27bba4b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,30 +69,30 @@ const queryParams = {
6969
accountIn: connectedAccount,
7070
accountOut: connectedAccount,
7171
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
7373
swapperMode: "2", // target debt mode
7474
isRepay: "true",
7575
}
7676

7777
const { data: response } = await axios.get(
7878
`${SWAP_API_URL}/swap`,
7979
{
80-
params: requstParams,
80+
params: queryParams,
8181
},
8282
)
8383

8484
// Encode EVC batch
85-
const batchItems =
85+
const batchItems = [
8686
// Withdraw collateral to the Swapper contract
8787
{
8888
targetContract: collateralVault,
8989
onBehalfOfAccount: connectedAccount,
9090
value: 0,
9191
data: encodeFunctionData({
9292
abi: EVAULT_ABI,
93-
functionName: "withdraw"
93+
functionName: "withdraw",
9494
args: [response.data.amountInMax, response.data.swap.swapperAddress, connectedAccount]
95-
}
95+
})
9696
},
9797
// execute Swapper payload from the API response
9898
{
@@ -108,7 +108,7 @@ const batchItems =
108108
value: 0,
109109
data: response.data.verify.verifierData
110110
},
111-
))
111+
]
112112

113113
const evcBatch = encodeFunctionData({
114114
abi: EVC_ABI,

0 commit comments

Comments
 (0)