Skip to content

Commit

Permalink
Add Remove liquidity parser
Browse files Browse the repository at this point in the history
  • Loading branch information
JIOjosBG committed Apr 29, 2024
1 parent cd13805 commit 24c9918
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/lib/humanReadableTransactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,29 @@ function parseActions(actions){
i++
continue
}



if(
// are valid [obj]
actions[i].length==2 &&
actions[i+1].length==2 &&
Array.isArray(actions[i]) &&
Array.isArray(actions[i+1]) &&
// are actual Unwrap and Sweep
typeof actions[i][0] === 'string' &&
actions[i][0].startsWith('Unwrap') &&
actions[i][1].type==='token' &&
typeof actions[i+1][0] === 'string' &&
actions[i+1][0].startsWith('Sweep') &&
actions[i+1][1].type==='token'
){
result.push(["Remove liquidity and withdraw", actions[i][1], actions[i+1][1]])
// skip next ccall, since two were merged
i++
continue
}

result.push(actions[i])
continue
}
Expand Down

0 comments on commit 24c9918

Please sign in to comment.