Socket
Socket
Sign inDemoInstall

connext

Package Overview
Dependencies
307
Maintainers
4
Versions
160
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.1.8 to 4.1.9

14

dist/controllers/WithdrawalController.js

@@ -48,9 +48,13 @@ "use strict";

// TODO: token withdrawals
if (withdrawalStr.weiToSell && withdrawalStr.weiToSell !== '0') {
WithdrawalError(`User exchanging wei at withdrawal is not permitted at this time.`);
if (withdrawalStr.weiToSell && lib_1.toBN(withdrawalStr.weiToSell).gt(channelBN.balanceWeiUser)) {
WithdrawalError(`Cannot sell more wei than exist in your channel.`);
}
// validate withdrawal token user
if (withdrawalStr.withdrawalTokenUser && withdrawalStr.withdrawalTokenUser !== '0') {
WithdrawalError(`User token withdrawals are not permitted at this time.`);
if (withdrawalStr.withdrawalTokenUser && lib_1.toBN(withdrawalStr.withdrawalTokenUser).gt(channelBN.balanceTokenUser)) {
WithdrawalError(`Cannot withdraw more tokens than exist in your channel.`);
}
// cannot do a double exchange, only one way
const sellingWei = withdrawalStr.weiToSell && withdrawalStr.weiToSell !== '0';
if (sellingWei && withdrawalStr.tokensToSell !== '0') {
WithdrawalError(`Cannot sell both wei and tokens simultaneously`);
}
const sync = yield this.hub.requestWithdrawal(withdrawalStr, state_1.getTxCount(this.store.getState()));

@@ -57,0 +61,0 @@ this.connext.syncController.handleHubSync(sync);

{
"name": "connext",
"description": "Shared code between wallet and hub",
"version": "4.1.8",
"version": "4.1.9",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "types": "types/index.d.ts",

@@ -81,11 +81,16 @@ import { ethers as eth } from 'ethers'

// TODO: token withdrawals
if (withdrawalStr.weiToSell && withdrawalStr.weiToSell !== '0') {
WithdrawalError(`User exchanging wei at withdrawal is not permitted at this time.`)
if (withdrawalStr.weiToSell && toBN(withdrawalStr.weiToSell).gt(channelBN.balanceWeiUser)) {
WithdrawalError(`Cannot sell more wei than exist in your channel.`)
}
// validate withdrawal token user
if (withdrawalStr.withdrawalTokenUser && withdrawalStr.withdrawalTokenUser !== '0') {
WithdrawalError(`User token withdrawals are not permitted at this time.`)
if (withdrawalStr.withdrawalTokenUser && toBN(withdrawalStr.withdrawalTokenUser).gt(channelBN.balanceTokenUser)) {
WithdrawalError(`Cannot withdraw more tokens than exist in your channel.`)
}
// cannot do a double exchange, only one way
const sellingWei = withdrawalStr.weiToSell && withdrawalStr.weiToSell !== '0'
if (sellingWei && withdrawalStr.tokensToSell !== '0') {
WithdrawalError(`Cannot sell both wei and tokens simultaneously`)
}
const sync = await this.hub.requestWithdrawal(withdrawalStr, getTxCount(this.store.getState()))

@@ -92,0 +97,0 @@ this.connext.syncController.handleHubSync(sync)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc