Here's a couple of options if you want to share logic:
put model related operations in the model class
put a static method in the controller, if it's controller related logic
create a utility class/package you can share between controllers/models
In any of those scenarios, you won't be able to access this.sender or this.tx inside the functions, so make sure to pass everything you need as a parameter.
Problem: How to pass this.tx or this.sender to the updateBalance method when I make it static? (This must work both when making a call with Hurley and when making a call from the lendBook method).
More in generale how can I specify the parameters passed to the method in the signature when I pass an object?
```
@Param(yup.object())
id: class
@Param(MyClass)
instanceName: MyClass
Others?
```
Same problem in the model how can I define a property as an object?
```
@Validate(MyClass)
public propertyName: MyClass;
Others?
```
Also not clear the difference between this.tx and this.sender
Here's a couple of options if you want to share logic:
In any of those scenarios, you won't be able to access this.sender or this.tx inside the functions, so make sure to pass everything you need as a parameter.
Problem: How to pass this.tx or this.sender to the updateBalance method when I make it static? (This must work both when making a call with Hurley and when making a call from the lendBook method). More in generale how can I specify the parameters passed to the method in the signature when I pass an object?
Same problem in the model how can I define a property as an object?
Also not clear the difference between this.tx and this.sender