@morpho-org/blue-sdk 3.0.5 → 3.0.7

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.
@@ -153,6 +153,7 @@ export declare const addressesRegistry: {
153
153
  readonly chainlinkOracleFactory: "0x1ff7895Eb842794c5d07C4c547b6730e61295215";
154
154
  readonly preLiquidationFactory: "0xeDadDe37D76c72b98725614d0b41C20Fe612d304";
155
155
  readonly wNative: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270";
156
+ readonly usdc: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359";
156
157
  };
157
158
  readonly 42161: {
158
159
  readonly morpho: "0x6c247b1F6182318877311737BaC0844bAa518F5e";
package/lib/addresses.js CHANGED
@@ -121,6 +121,8 @@ exports.addressesRegistry = {
121
121
  chainlinkOracleFactory: "0x1ff7895Eb842794c5d07C4c547b6730e61295215",
122
122
  preLiquidationFactory: "0xeDadDe37D76c72b98725614d0b41C20Fe612d304",
123
123
  wNative: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
124
+ // Must implement USDC permit version 2 (otherwise breaks permit signatures).
125
+ usdc: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
124
126
  },
125
127
  [chain_js_1.ChainId.ArbitrumMainnet]: {
126
128
  morpho: "0x6c247b1F6182318877311737BaC0844bAa518F5e",
@@ -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.7",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "contributors": [
7
7
  "Rubilmax <rmilon@gmail.com>"