@morpho-org/midnight-sdk 2.5.1 → 2.6.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.
@@ -17,8 +17,8 @@ const errors_js_1 = require("../errors.js");
17
17
  const index_js_1 = require("../market/index.js");
18
18
  const index_js_2 = require("../math/index.js");
19
19
  const index_js_3 = require("../offers/index.js");
20
+ const version_js_1 = require("../version.js");
20
21
  const types_js_1 = require("./types.js");
21
- const version_generated_js_1 = require("./version.generated.js");
22
22
  const DEFAULT_MIDNIGHT_API_URL = new URL("/v0/midnight", morpho_ts_1.BLUE_API_BASE_URL);
23
23
  const MAX_UINT256_DECIMAL_LENGTH = viem_1.maxUint256.toString().length;
24
24
  /** @internal Sends one Midnight API request and maps non-2xx responses to SDK errors. */
@@ -51,7 +51,7 @@ async function requestMidnightApi(params) {
51
51
  const headers = new Headers(params.request?.headers);
52
52
  if (params.body !== undefined)
53
53
  headers.set("Content-Type", "application/json");
54
- headers.set("sdk-version", version_generated_js_1.MIDNIGHT_SDK_VERSION);
54
+ headers.set("sdk-version", version_js_1.version);
55
55
  const init = {
56
56
  ...params.request,
57
57
  method: params.method,
@@ -25,3 +25,4 @@ export { Ratifier, RatifierUtils } from "./signatures/Ratifier.js";
25
25
  export type { EcrecoverRatifierDataRequest, EcrecoverRatifierRatifyRequest, EcrecoverRatifierSignRequest, EcrecoverRatifierTypedDataRequest, SetterRatifierDataRequest, SetterRatifierRatifyRequest, } from "./signatures/ratifierRequests.js";
26
26
  export { SetterRatifier, SetterRatifierUtils, } from "./signatures/SetterRatifier.js";
27
27
  export type { AnyTree, AnyTreeSnapshot, EcrecoverTreeCreateRequest, PriceRatifierV1TreeCreateRequest, RateRatifierV1TreeCreateRequest, RatifierKind, RatifierTypes, SetterTreeCreateRequest, TreeCreateRequest, TreeData, TreeEntry, TreeSnapshot, TypedRatifierTreeInput, TypedTreeMempoolValidateParams, } from "./signatures/treeTypes.js";
28
+ export { version } from "./version.js";
package/lib/cjs/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.SetterRatifierUtils = exports.SetterRatifier = exports.RatifierUtils = exports.Ratifier = exports.RateRatifierV1Utils = exports.RateRatifierV1 = exports.PriceRatifierV1Utils = exports.PriceRatifierV1 = exports.Payload = exports.EcrecoverRatifierUtils = exports.EcrecoverRatifier = void 0;
17
+ exports.version = exports.SetterRatifierUtils = exports.SetterRatifier = exports.RatifierUtils = exports.Ratifier = exports.RateRatifierV1Utils = exports.RateRatifierV1 = exports.PriceRatifierV1Utils = exports.PriceRatifierV1 = exports.Payload = exports.EcrecoverRatifierUtils = exports.EcrecoverRatifier = void 0;
18
18
  __exportStar(require("./abis.js"), exports);
19
19
  __exportStar(require("./constants.js"), exports);
20
20
  __exportStar(require("./errors.js"), exports);
@@ -50,3 +50,5 @@ Object.defineProperty(exports, "RatifierUtils", { enumerable: true, get: functio
50
50
  var SetterRatifier_js_1 = require("./signatures/SetterRatifier.js");
51
51
  Object.defineProperty(exports, "SetterRatifier", { enumerable: true, get: function () { return SetterRatifier_js_1.SetterRatifier; } });
52
52
  Object.defineProperty(exports, "SetterRatifierUtils", { enumerable: true, get: function () { return SetterRatifier_js_1.SetterRatifierUtils; } });
53
+ var version_js_1 = require("./version.js");
54
+ Object.defineProperty(exports, "version", { enumerable: true, get: function () { return version_js_1.version; } });
@@ -0,0 +1,2 @@
1
+ /** Installed @morpho-org/midnight-sdk package version. */
2
+ export declare const version = "2.6.0";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // Generated by scripts/generate-package-versions.ts. Do not edit.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.version = void 0;
5
+ /** Installed @morpho-org/midnight-sdk package version. */
6
+ exports.version = "2.6.0";
@@ -4,8 +4,8 @@ import { InvalidMidnightApiResponseError, InvalidOfferParameterError, MidnightAp
4
4
  import { MarketUtils } from "../market/index.js";
5
5
  import { TickLib } from "../math/index.js";
6
6
  import { OfferUtils } from "../offers/index.js";
7
+ import { version } from "../version.js";
7
8
  import { MempoolPayloadValidationRule, } from "./types.js";
8
- import { MIDNIGHT_SDK_VERSION } from "./version.generated.js";
9
9
  const DEFAULT_MIDNIGHT_API_URL = new URL("/v0/midnight", BLUE_API_BASE_URL);
10
10
  const MAX_UINT256_DECIMAL_LENGTH = maxUint256.toString().length;
11
11
  /** @internal Sends one Midnight API request and maps non-2xx responses to SDK errors. */
@@ -38,7 +38,7 @@ export async function requestMidnightApi(params) {
38
38
  const headers = new Headers(params.request?.headers);
39
39
  if (params.body !== undefined)
40
40
  headers.set("Content-Type", "application/json");
41
- headers.set("sdk-version", MIDNIGHT_SDK_VERSION);
41
+ headers.set("sdk-version", version);
42
42
  const init = {
43
43
  ...params.request,
44
44
  method: params.method,
@@ -25,3 +25,4 @@ export { Ratifier, RatifierUtils } from "./signatures/Ratifier.js";
25
25
  export type { EcrecoverRatifierDataRequest, EcrecoverRatifierRatifyRequest, EcrecoverRatifierSignRequest, EcrecoverRatifierTypedDataRequest, SetterRatifierDataRequest, SetterRatifierRatifyRequest, } from "./signatures/ratifierRequests.js";
26
26
  export { SetterRatifier, SetterRatifierUtils, } from "./signatures/SetterRatifier.js";
27
27
  export type { AnyTree, AnyTreeSnapshot, EcrecoverTreeCreateRequest, PriceRatifierV1TreeCreateRequest, RateRatifierV1TreeCreateRequest, RatifierKind, RatifierTypes, SetterTreeCreateRequest, TreeCreateRequest, TreeData, TreeEntry, TreeSnapshot, TypedRatifierTreeInput, TypedTreeMempoolValidateParams, } from "./signatures/treeTypes.js";
28
+ export { version } from "./version.js";
package/lib/esm/index.js CHANGED
@@ -22,3 +22,4 @@ export { PriceRatifierV1, PriceRatifierV1Utils, } from "./signatures/PriceRatifi
22
22
  export { RateRatifierV1, RateRatifierV1Utils, } from "./signatures/RateRatifierV1.js";
23
23
  export { Ratifier, RatifierUtils } from "./signatures/Ratifier.js";
24
24
  export { SetterRatifier, SetterRatifierUtils, } from "./signatures/SetterRatifier.js";
25
+ export { version } from "./version.js";
@@ -0,0 +1,2 @@
1
+ /** Installed @morpho-org/midnight-sdk package version. */
2
+ export declare const version = "2.6.0";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/generate-package-versions.ts. Do not edit.
2
+ /** Installed @morpho-org/midnight-sdk package version. */
3
+ export const version = "2.6.0";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@morpho-org/midnight-sdk",
3
3
  "description": "Viem-based package for Morpho Midnight that exports protocol utilities, fetch helpers, and Midnight API utilities under a dedicated API subpath.",
4
- "version": "2.5.1",
4
+ "version": "2.6.0",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "repository": {
7
7
  "type": "git",
@@ -45,8 +45,8 @@
45
45
  "viem": "^2.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@morpho-org/morpho-ts": "^4.3.1",
49
- "@morpho-org/test": "^2.12.1",
48
+ "@morpho-org/morpho-ts": "^4.4.0",
49
+ "@morpho-org/test": "^2.13.0",
50
50
  "fast-check": "^4.9.0",
51
51
  "typescript": "7.0.2",
52
52
  "viem": "^2.55.10",
@@ -55,10 +55,9 @@
55
55
  "scripts": {
56
56
  "prepublish": "pnpm build",
57
57
  "compile": "node ../../scripts/compile-solidity.ts midnight-sdk",
58
- "build": "pnpm generate:version && tsc --noEmit && pnpm build:cjs && pnpm build:esm",
58
+ "build": "tsc --noEmit && pnpm build:cjs && pnpm build:esm",
59
59
  "build:cjs": "tsc --build tsconfig.build.cjs.json && echo '{\"type\":\"commonjs\"}' > lib/cjs/package.json",
60
60
  "build:esm": "tsc --build tsconfig.build.esm.json && echo '{\"type\":\"module\"}' > lib/esm/package.json",
61
- "generate:version": "node ../../scripts/generate-midnight-package-version.ts",
62
61
  "test": "vitest --root ../.. --project midnight-sdk --project midnight-sdk-fork"
63
62
  },
64
63
  "types": "./lib/esm/index.d.ts"
@@ -1,2 +0,0 @@
1
- /** @internal Installed Midnight SDK package version. */
2
- export declare const MIDNIGHT_SDK_VERSION = "2.5.1";
@@ -1,6 +0,0 @@
1
- "use strict";
2
- // Generated by scripts/generate-midnight-package-version.ts. Do not edit.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.MIDNIGHT_SDK_VERSION = void 0;
5
- /** @internal Installed Midnight SDK package version. */
6
- exports.MIDNIGHT_SDK_VERSION = "2.5.1";
@@ -1,2 +0,0 @@
1
- /** @internal Installed Midnight SDK package version. */
2
- export declare const MIDNIGHT_SDK_VERSION = "2.5.1";
@@ -1,3 +0,0 @@
1
- // Generated by scripts/generate-midnight-package-version.ts. Do not edit.
2
- /** @internal Installed Midnight SDK package version. */
3
- export const MIDNIGHT_SDK_VERSION = "2.5.1";