Skip to content

Commit

Permalink
feat(sdks): make it all compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Oct 8, 2024
1 parent 831c663 commit dcac764
Show file tree
Hide file tree
Showing 22 changed files with 58 additions and 43 deletions.
2 changes: 1 addition & 1 deletion packages/blue-api-sdk/src/cache.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MarketStateReward, VaultAllocation } from "./types";
import type { MarketStateReward, VaultAllocation } from "./types.js";

type ReadFieldFunction = <T, K extends keyof T = keyof T>(
fieldName: K,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@morpho-org/blue-sdk-viem-bundler",
"name": "@morpho-org/bundler-sdk",
"version": "2.0.0-alpha.6",
"author": "Morpho Association <contact@morpho.org>",
"license": "MIT",
Expand All @@ -19,15 +19,15 @@
"@morpho-org/blue-sdk": "workspace:^",
"@morpho-org/blue-sdk-viem": "workspace:^",
"@morpho-org/morpho-ts": "workspace:^",
"@morpho-org/simulation-sdk-wagmi": "workspace:^",
"@morpho-org/simulation-sdk": "workspace:^",
"viem": "^2.0.0"
},
"devDependencies": {
"@morpho-org/blue-sdk": "workspace:^",
"@morpho-org/blue-sdk-viem": "workspace:^",
"@morpho-org/morpho-test": "workspace:^",
"@morpho-org/morpho-ts": "workspace:^",
"@morpho-org/simulation-sdk-wagmi": "workspace:^",
"@morpho-org/simulation-sdk": "workspace:^",
"@types/lodash": "^4.17.7",
"@types/node": "^22.2.0",
"lodash": "^4.17.21",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SimulationResult } from "@morpho-org/simulation-sdk-wagmi";
import type { SimulationResult } from "@morpho-org/simulation-sdk";

import type { InputBundlerOperation } from "./types/index.js";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
type SimulationResult,
type SimulationState,
simulateOperation,
} from "@morpho-org/simulation-sdk-wagmi";
} from "@morpho-org/simulation-sdk";

import {
blueAbi,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
handleOperations,
produceImmutable,
simulateOperation,
} from "@morpho-org/simulation-sdk-wagmi";
} from "@morpho-org/simulation-sdk";

import { maxUint256 } from "viem";
import { BundlerErrors } from "../errors.js";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
} from "viem";

import type { Address, MarketConfig } from "@morpho-org/blue-sdk";
import type { SimulationResult } from "@morpho-org/simulation-sdk-wagmi";
import type { SimulationResult } from "@morpho-org/simulation-sdk";

export type MarketParams = Pick<
MarketConfig,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
OperationArgs,
OperationType,
WithOperationArgs,
} from "@morpho-org/simulation-sdk-wagmi";
} from "@morpho-org/simulation-sdk";

export const BUNDLER_OPERATIONS = [
"Blue_SetAuthorization",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { Address, ChainId, VaultConfig, addresses } from "@morpho-org/blue-sdk";
import {
type Address,
ChainId,
VaultConfig,
addresses,
} from "@morpho-org/blue-sdk";

export const steakUsdc = new VaultConfig({
address: "0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { ERC20__factory, MorphoBlue__factory } from "ethers-types";
import { ethers } from "hardhat";
import { deal } from "hardhat-deal";

import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import type { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import { setBalance } from "@nomicfoundation/hardhat-network-helpers";

import {
Address,
type Address,
MarketConfig,
NATIVE_ADDRESS,
UnknownMarketConfigError,
Expand All @@ -19,15 +19,15 @@ import { assertApproxEqAbs, mine } from "@morpho-org/morpho-test";
import { keys } from "@morpho-org/morpho-ts";

import {
BundlingOptions,
InputBundlerOperation,
type BundlingOptions,
type InputBundlerOperation,
encodeBundle,
finalizeBundle,
populateBundle,
} from "../../src";
} from "../src/index.js";

import { SimulationState } from "@morpho-org/simulation-sdk-wagmi";
import { WITH_SIMPLE_PERMIT } from "./fixtures";
import type { SimulationState } from "@morpho-org/simulation-sdk";
import { WITH_SIMPLE_PERMIT } from "./fixtures.js";

export const donate =
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ethers } from "hardhat";
import { deal } from "hardhat-deal";
import _omit from "lodash/omit";

import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import type { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";

import { BlueService, ChainService } from "@morpho-org/blue-core-sdk";
import { MetaMorphoService } from "@morpho-org/blue-metamorpho-sdk";
Expand Down Expand Up @@ -34,7 +34,7 @@ import {
reset,
} from "@morpho-org/morpho-test";

import { BundlerService } from "../../../src";
import { BundlerService } from "../../src/index.js";
import { bbETH, bbUSDT, bbUsdc, re7WETH, steakUsdc } from "../fixtures";
import { donate, setupBundle } from "../helpers";

Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions packages/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"typescript": "^5.6.2",
"viem": "^2.21.19",
"viem-deal": "^1.0.5",
"vitest": "^2.1.2",
"wagmi": "^2.12.17"
},
"publishConfig": {
Expand Down
8 changes: 8 additions & 0 deletions vitest.workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,12 @@ export default defineWorkspace([
testTimeout: 30_000,
},
},
{
test: {
name: "bundler-sdk",
include: ["packages/bundler-sdk/**/*.test.ts"],
environment: "happy-dom",
testTimeout: 30_000,
},
},
]);
49 changes: 25 additions & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3125,29 +3125,6 @@ __metadata:
languageName: unknown
linkType: soft

"@morpho-org/blue-sdk-viem-bundler@workspace:packages/blue-sdk-viem-bundler":
version: 0.0.0-use.local
resolution: "@morpho-org/blue-sdk-viem-bundler@workspace:packages/blue-sdk-viem-bundler"
dependencies:
"@morpho-org/blue-sdk": "workspace:^"
"@morpho-org/blue-sdk-viem": "workspace:^"
"@morpho-org/morpho-test": "workspace:^"
"@morpho-org/morpho-ts": "workspace:^"
"@morpho-org/simulation-sdk-wagmi": "workspace:^"
"@types/lodash": "npm:^4.17.7"
"@types/node": "npm:^22.2.0"
lodash: "npm:^4.17.21"
typescript: "npm:^5.6.2"
viem: "npm:^2.21.19"
peerDependencies:
"@morpho-org/blue-sdk": "workspace:^"
"@morpho-org/blue-sdk-viem": "workspace:^"
"@morpho-org/morpho-ts": "workspace:^"
"@morpho-org/simulation-sdk-wagmi": "workspace:^"
viem: ^2.0.0
languageName: unknown
linkType: soft

"@morpho-org/blue-sdk-viem@workspace:^, @morpho-org/blue-sdk-viem@workspace:packages/blue-sdk-viem":
version: 0.0.0-use.local
resolution: "@morpho-org/blue-sdk-viem@workspace:packages/blue-sdk-viem"
Expand Down Expand Up @@ -3218,6 +3195,29 @@ __metadata:
languageName: unknown
linkType: soft

"@morpho-org/bundler-sdk@workspace:packages/bundler-sdk":
version: 0.0.0-use.local
resolution: "@morpho-org/bundler-sdk@workspace:packages/bundler-sdk"
dependencies:
"@morpho-org/blue-sdk": "workspace:^"
"@morpho-org/blue-sdk-viem": "workspace:^"
"@morpho-org/morpho-test": "workspace:^"
"@morpho-org/morpho-ts": "workspace:^"
"@morpho-org/simulation-sdk": "workspace:^"
"@types/lodash": "npm:^4.17.7"
"@types/node": "npm:^22.2.0"
lodash: "npm:^4.17.21"
typescript: "npm:^5.6.2"
viem: "npm:^2.21.19"
peerDependencies:
"@morpho-org/blue-sdk": "workspace:^"
"@morpho-org/blue-sdk-viem": "workspace:^"
"@morpho-org/morpho-ts": "workspace:^"
"@morpho-org/simulation-sdk": "workspace:^"
viem: ^2.0.0
languageName: unknown
linkType: soft

"@morpho-org/morpho-test@workspace:^, @morpho-org/morpho-test@workspace:packages/morpho-test":
version: 0.0.0-use.local
resolution: "@morpho-org/morpho-test@workspace:packages/morpho-test"
Expand Down Expand Up @@ -3260,7 +3260,7 @@ __metadata:
languageName: unknown
linkType: soft

"@morpho-org/simulation-sdk-wagmi@workspace:^, @morpho-org/simulation-sdk-wagmi@workspace:packages/simulation-sdk-wagmi":
"@morpho-org/simulation-sdk-wagmi@workspace:packages/simulation-sdk-wagmi":
version: 0.0.0-use.local
resolution: "@morpho-org/simulation-sdk-wagmi@workspace:packages/simulation-sdk-wagmi"
dependencies:
Expand Down Expand Up @@ -3342,6 +3342,7 @@ __metadata:
typescript: "npm:^5.6.2"
viem: "npm:^2.21.19"
viem-deal: "npm:^1.0.5"
vitest: "npm:^2.1.2"
wagmi: "npm:^2.12.17"
peerDependencies:
viem: ^2.21.10
Expand Down

0 comments on commit dcac764

Please sign in to comment.