(Object liquidation, Object... optionalArgs)
| 6943 | } |
| 6944 | |
| 6945 | public Object safeLiquidation(Object liquidation, Object... optionalArgs) |
| 6946 | { |
| 6947 | Object market = Helpers.getArg(optionalArgs, 0, null); |
| 6948 | Object contracts = this.safeString(liquidation, "contracts"); |
| 6949 | Object contractSize = this.safeString(market, "contractSize"); |
| 6950 | Object price = this.safeString(liquidation, "price"); |
| 6951 | Object baseValue = this.safeString(liquidation, "baseValue"); |
| 6952 | Object quoteValue = this.safeString(liquidation, "quoteValue"); |
| 6953 | if (Helpers.isTrue(Helpers.isTrue(Helpers.isTrue(Helpers.isTrue((Helpers.isEqual(baseValue, null))) && Helpers.isTrue((!Helpers.isEqual(contracts, null)))) && Helpers.isTrue((!Helpers.isEqual(contractSize, null)))) && Helpers.isTrue((!Helpers.isEqual(price, null))))) |
| 6954 | { |
| 6955 | baseValue = Precise.stringMul(contracts, contractSize); |
| 6956 | } |
| 6957 | if (Helpers.isTrue(Helpers.isTrue(Helpers.isTrue((Helpers.isEqual(quoteValue, null))) && Helpers.isTrue((!Helpers.isEqual(baseValue, null)))) && Helpers.isTrue((!Helpers.isEqual(price, null))))) |
| 6958 | { |
| 6959 | quoteValue = Precise.stringMul(baseValue, price); |
| 6960 | } |
| 6961 | Helpers.addElementToObject(liquidation, "contracts", this.parseNumber(contracts)); |
| 6962 | Helpers.addElementToObject(liquidation, "contractSize", this.parseNumber(contractSize)); |
| 6963 | Helpers.addElementToObject(liquidation, "price", this.parseNumber(price)); |
| 6964 | Helpers.addElementToObject(liquidation, "baseValue", this.parseNumber(baseValue)); |
| 6965 | Helpers.addElementToObject(liquidation, "quoteValue", this.parseNumber(quoteValue)); |
| 6966 | return liquidation; |
| 6967 | } |
| 6968 | |
| 6969 | public Object safeTrade(Object trade, Object... optionalArgs) |
| 6970 | { |
no test coverage detected