Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
update interface auth
Browse files Browse the repository at this point in the history
  • Loading branch information
CelestialCrafter committed Dec 8, 2023
1 parent a68cc93 commit 1a4912b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/trading/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default async redis => {

return {
id: bot._id,
privateKey: bot.privateKey(),
auth: { privateKey: bot.privateKey() },
amount: (10 || bot.strengthToUSD) * strength,
strengthToUSD: bot.strengthToUSD,
signal
Expand Down
28 changes: 13 additions & 15 deletions src/trading/uniswap/trade.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,17 @@ const executeTransaction = async (

export default tradeData =>
Promise.allSettled(
tradeData.map(
async ({ id, signal: action, amount: baseAmount, strengthToUSD, privateKey }) => ({
transactions: [
await Promise.allSettled([
executeTransaction(privateKey, {
modToken: tokens.wrapped,
baseAmount,
action
})
]),
...(await executeApproval(privateKey, { strengthToUSD, id }))
],
id
})
)
tradeData.map(async ({ id, signal: action, amount: baseAmount, strengthToUSD, auth }) => ({
transactions: [
await Promise.allSettled([
executeTransaction(auth.privateKey, {
modToken: tokens.wrapped,
baseAmount,
action
})
]),
...(await executeApproval(auth.privateKey, { strengthToUSD, id }))
],
id
}))
);

0 comments on commit 1a4912b

Please sign in to comment.