@gateway.fm/gtw-dvf-client-js
Version:
DVF client js lib with gateway.fm rpc endpoints
17 lines (15 loc) • 508 B
JavaScript
module.exports = async (dvf, path, token, amount) => {
const tokenInfo = dvf.token.getTokenInfoOrThrow(token)
const quantizedAmount = dvf.token.toQuantizedAmount(token, amount)
const tempVaultId = dvf.config.DVF.tempStarkVaultId
let starkVaultId = tokenInfo.starkVaultId
const starkWithdrawal = await dvf.stark.ledger.createSignedTransfer(
path,
tokenInfo,
quantizedAmount,
starkVaultId,
tempVaultId
)
starkWithdrawal.starkVaultId = starkVaultId
return starkWithdrawal
}