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

Commit

Permalink
Merge pull request #494 from rhinofi/ENGAGE-555-fix-regular-withdrawal
Browse files Browse the repository at this point in the history
ENGAGE-555 - adapt withdrawOnChain as it doesnt receive a PromiEvent anymore but a Promise
  • Loading branch information
nicob21 authored Jun 13, 2023
2 parents 29a79ad + d2c0077 commit 4d76944
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rhino.fi/client-js",
"version": "5.1.2",
"version": "5.1.3",
"main": "src/index.js",
"files": [
"src",
Expand Down
8 changes: 4 additions & 4 deletions src/api/withdrawOnchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module.exports = async (dvf, token, address) => {
address = dvf.config.starkKeyHex
}

const { status, transactionHash } = await dvf.contract.withdraw(token, address)

if (!status) {
try {
const withdrawal = await dvf.contract.withdraw(token, address)
return { transactionHash: withdrawal.transactionHash }
} catch (error) {
throw new DVFError('ERR_ONCHAIN_WITHDRAW')
}
return { transactionHash }
}

0 comments on commit 4d76944

Please sign in to comment.