UNPKG

@gateway.fm/gtw-dvf-client-js

Version:

DVF client js lib with gateway.fm rpc endpoints

24 lines (18 loc) 542 B
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') } }