@morpho-org/blue-sdk 2.3.1-next.0 → 2.3.2-next.0

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.
@@ -1,8 +1,6 @@
1
1
  import type { Address, BigIntish } from "../types.js";
2
2
  export declare const ERC20_ALLOWANCE_RECIPIENTS: readonly ["morpho", "permit2", "bundler"];
3
- export declare const PERMIT2_ALLOWANCE_RECIPIENTS: readonly ["morpho", "bundler"];
4
3
  export type Erc20AllowanceRecipient = (typeof ERC20_ALLOWANCE_RECIPIENTS)[number];
5
- export type Permit2AllowanceRecipient = (typeof PERMIT2_ALLOWANCE_RECIPIENTS)[number];
6
4
  export interface Permit2Allowance {
7
5
  amount: bigint;
8
6
  expiration: bigint;
@@ -19,9 +17,7 @@ export interface IHolding {
19
17
  erc20Allowances: {
20
18
  [key in Erc20AllowanceRecipient]: bigint;
21
19
  };
22
- permit2Allowances: {
23
- [key in Permit2AllowanceRecipient]: IPermit2Allowance;
24
- };
20
+ permit2BundlerAllowance: IPermit2Allowance;
25
21
  erc2612Nonce?: bigint;
26
22
  canTransfer?: boolean;
27
23
  balance: bigint;
@@ -52,13 +48,11 @@ export declare class Holding implements IHolding {
52
48
  /**
53
49
  * Permit2 allowance for this token from the user to the allowance recipient.
54
50
  */
55
- readonly permit2Allowances: {
56
- [key in Permit2AllowanceRecipient]: Permit2Allowance;
57
- };
51
+ readonly permit2BundlerAllowance: Permit2Allowance;
58
52
  /**
59
53
  * ERC-2612 Permit nonce of the user for this token.
60
54
  * `undefined` if the token does not support ERC-2612.
61
55
  */
62
56
  erc2612Nonce?: bigint;
63
- constructor({ user, token, erc20Allowances, permit2Allowances, balance, erc2612Nonce, canTransfer, }: IHolding);
57
+ constructor({ user, token, erc20Allowances, permit2BundlerAllowance, balance, erc2612Nonce, canTransfer, }: IHolding);
64
58
  }
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Holding = exports.PERMIT2_ALLOWANCE_RECIPIENTS = exports.ERC20_ALLOWANCE_RECIPIENTS = void 0;
3
+ exports.Holding = exports.ERC20_ALLOWANCE_RECIPIENTS = void 0;
4
4
  const morpho_ts_1 = require("@morpho-org/morpho-ts");
5
5
  exports.ERC20_ALLOWANCE_RECIPIENTS = [
6
6
  "morpho",
7
7
  "permit2",
8
8
  "bundler",
9
9
  ];
10
- exports.PERMIT2_ALLOWANCE_RECIPIENTS = [
11
- "morpho",
12
- "bundler",
13
- ];
14
10
  class Holding {
15
11
  /**
16
12
  * The user of this holding.
@@ -35,13 +31,13 @@ class Holding {
35
31
  /**
36
32
  * Permit2 allowance for this token from the user to the allowance recipient.
37
33
  */
38
- permit2Allowances;
34
+ permit2BundlerAllowance;
39
35
  /**
40
36
  * ERC-2612 Permit nonce of the user for this token.
41
37
  * `undefined` if the token does not support ERC-2612.
42
38
  */
43
39
  erc2612Nonce;
44
- constructor({ user, token, erc20Allowances, permit2Allowances, balance, erc2612Nonce, canTransfer, }) {
40
+ constructor({ user, token, erc20Allowances, permit2BundlerAllowance, balance, erc2612Nonce, canTransfer, }) {
45
41
  this.user = user;
46
42
  this.token = token;
47
43
  this.balance = balance;
@@ -50,17 +46,10 @@ class Holding {
50
46
  address,
51
47
  allowance,
52
48
  ]));
53
- this.permit2Allowances = {
54
- morpho: {
55
- amount: BigInt(permit2Allowances.morpho.amount),
56
- expiration: BigInt(permit2Allowances.morpho.expiration),
57
- nonce: BigInt(permit2Allowances.morpho.nonce),
58
- },
59
- bundler: {
60
- amount: BigInt(permit2Allowances.bundler.amount),
61
- expiration: BigInt(permit2Allowances.bundler.expiration),
62
- nonce: BigInt(permit2Allowances.bundler.nonce),
63
- },
49
+ this.permit2BundlerAllowance = {
50
+ amount: BigInt(permit2BundlerAllowance.amount),
51
+ expiration: BigInt(permit2BundlerAllowance.expiration),
52
+ nonce: BigInt(permit2BundlerAllowance.nonce),
64
53
  };
65
54
  if (erc2612Nonce != null)
66
55
  this.erc2612Nonce = erc2612Nonce;
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": "2.3.1-next.0",
4
+ "version": "2.3.2-next.0",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "contributors": [
7
7
  "Rubilmax <rmilon@gmail.com>"
@@ -21,14 +21,14 @@
21
21
  "@noble/hashes": "^1.6.1"
22
22
  },
23
23
  "peerDependencies": {
24
- "@morpho-org/morpho-ts": "^2.0.2-next.0"
24
+ "@morpho-org/morpho-ts": "^2.1.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "typescript": "^5.7.2",
28
28
  "viem": "^2.23.0",
29
29
  "vitest": "^3.0.5",
30
- "@morpho-org/morpho-ts": "^2.0.2-next.0",
31
- "@morpho-org/test": "^2.0.6-next.0"
30
+ "@morpho-org/morpho-ts": "^2.1.0",
31
+ "@morpho-org/test": "^2.0.6"
32
32
  },
33
33
  "scripts": {
34
34
  "prepublish": "$npm_execpath build",