@rhino.fi/client-js
Version:
24 lines (18 loc) • 543 B
JavaScript
const DVFError = require('../../lib/dvf/DVFError')
module.exports = async (dvf, token, tradingKey) => {
const { starkVaultId } = dvf.token.getTokenInfo(token)
tradingKey = tradingKey || dvf.config.starkKeyHex
const args = [tradingKey, starkVaultId]
const action = 'fullWithdrawalRequest'
try {
return dvf.eth.send(
dvf.contract.abi.getStarkEx(),
dvf.config.DVF.starkExContractAddress,
action,
args,
)
} catch (e) {
console.log(e)
throw new DVFError('ERR_FULL_WITHDRAWAL_REQUEST')
}
}