@morpho-org/blue-sdk 3.0.5 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,10 +31,6 @@ export declare class Holding implements IHolding {
31
31
  * The token in which this holding is denominated.
32
32
  */
33
33
  readonly token: Address;
34
- /**
35
- * The balance of the user for this token.
36
- */
37
- balance: bigint;
38
34
  /**
39
35
  * Whether the user is allowed to transfer this holding's balance.
40
36
  */
@@ -54,5 +50,14 @@ export declare class Holding implements IHolding {
54
50
  * `undefined` if the token does not support ERC-2612.
55
51
  */
56
52
  erc2612Nonce?: bigint;
53
+ /**
54
+ * Allows to customize the setter behavior in child classes.
55
+ */
56
+ protected _balance: bigint;
57
57
  constructor({ user, token, erc20Allowances, permit2BundlerAllowance, balance, erc2612Nonce, canTransfer, }: IHolding);
58
+ /**
59
+ * The balance of the user for this token.
60
+ */
61
+ get balance(): bigint;
62
+ set balance(value: bigint);
58
63
  }
@@ -16,10 +16,6 @@ class Holding {
16
16
  * The token in which this holding is denominated.
17
17
  */
18
18
  token;
19
- /**
20
- * The balance of the user for this token.
21
- */
22
- balance;
23
19
  /**
24
20
  * Whether the user is allowed to transfer this holding's balance.
25
21
  */
@@ -37,10 +33,14 @@ class Holding {
37
33
  * `undefined` if the token does not support ERC-2612.
38
34
  */
39
35
  erc2612Nonce;
36
+ /**
37
+ * Allows to customize the setter behavior in child classes.
38
+ */
39
+ _balance;
40
40
  constructor({ user, token, erc20Allowances, permit2BundlerAllowance, balance, erc2612Nonce, canTransfer, }) {
41
41
  this.user = user;
42
42
  this.token = token;
43
- this.balance = balance;
43
+ this._balance = balance;
44
44
  this.canTransfer = canTransfer;
45
45
  this.erc20Allowances = (0, morpho_ts_1.fromEntries)((0, morpho_ts_1.entries)(erc20Allowances).map(([address, allowance]) => [
46
46
  address,
@@ -54,5 +54,14 @@ class Holding {
54
54
  if (erc2612Nonce != null)
55
55
  this.erc2612Nonce = erc2612Nonce;
56
56
  }
57
+ /**
58
+ * The balance of the user for this token.
59
+ */
60
+ get balance() {
61
+ return this._balance;
62
+ }
63
+ set balance(value) {
64
+ this._balance = value;
65
+ }
57
66
  }
58
67
  exports.Holding = Holding;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@morpho-org/blue-sdk",
3
3
  "description": "Framework-agnostic package that defines Morpho-related entity classes (such as `Market`, `Token`, `Vault`).",
4
- "version": "3.0.5",
4
+ "version": "3.0.6",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "contributors": [
7
7
  "Rubilmax <rmilon@gmail.com>"