Skip to content

Commit

Permalink
Simplify payoutCurrency/Amount determination
Browse files Browse the repository at this point in the history
  • Loading branch information
paullinator committed Nov 1, 2024
1 parent a1a28bf commit 7cb6f19
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/partners/thorchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,12 @@ const makeThorchainPlugin = (info: ThorchainInfo): PartnerPlugin => {
continue
}

let payoutCurrency
let payoutAmount = 0
if (txOut != null) {
const [destChainAsset] = txOut.coins[0].asset.split('-')
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [_destChain, destAsset] = destChainAsset.split('.')
payoutCurrency = destAsset
payoutAmount = Number(txOut.coins[0].amount) / THORCHAIN_MULTIPLIER
}
const [destChainAsset] = txOut.coins[0].asset.split('-')
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [_destChain, destAsset] = destChainAsset.split('.')
const payoutCurrency = destAsset
const payoutAmount =
Number(txOut.coins[0].amount) / THORCHAIN_MULTIPLIER

const ssTx: StandardTx = {
status,
Expand Down

0 comments on commit 7cb6f19

Please sign in to comment.