diff --git a/packages/core/src/MPEContract.js b/packages/core/src/MPEContract.js index e3ae434..c0fb776 100644 --- a/packages/core/src/MPEContract.js +++ b/packages/core/src/MPEContract.js @@ -237,10 +237,10 @@ class MPEContract { async _fundEscrowAccount(account, amountInCogs) { const address = await account.getAddress(); let currentEscrowBalance = await this.balance(address); - currentEscrowBalance = toBNString(currentEscrowBalance); - amountInCogs = toBNString(amountInCogs); - if(amountInCogs > currentEscrowBalance) { - await account.depositToEscrowAccount(amountInCogs - currentEscrowBalance); + currentEscrowBalance = new BigNumber(currentEscrowBalance); + amountInCogs = new BigNumber(amountInCogs); + if(amountInCogs.isGreaterThan(currentEscrowBalance)) { + await account.depositToEscrowAccount(amountInCogs.minus(currentEscrowBalance)); } } diff --git a/packages/web/package.json b/packages/web/package.json index 637edc4..fa42487 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,6 +1,6 @@ { "name": "snet-sdk-web", - "version": "4.1.1", + "version": "4.1.2", "description": "SingularityNET SDK for Web", "main": "./dist/index.js", "files": [