Skip to content

feat(morpho-sdk): add Midnight action flows#815

Draft
Rubilmax wants to merge 32 commits into
hermes/tib-midnight-action-output-interfacefrom
hermes/marketv2-action-flows-implementation
Draft

feat(morpho-sdk): add Midnight action flows#815
Rubilmax wants to merge 32 commits into
hermes/tib-midnight-action-output-interfacefrom
hermes/marketv2-action-flows-implementation

Conversation

@Rubilmax

@Rubilmax Rubilmax commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Add the concrete morpho-sdk Midnight action-flow implementation on top of the prerequisite SDK split in #829.

This PR now contains only:

  • client.morpho.midnight(chainId) entity wiring
  • MorphoMidnight action outputs for Midnight flows
  • pure actions/midnight transaction builders and focused unit tests
  • the implementation changeset for the Midnight action flows

The shared SDK prerequisites, Blue requirement-helper refactors, Midnight SDK package changes, and midnight-api re-export path are isolated in #829. The TIB remains isolated in #769.

Stack

  1. TIB-2026-06-03: Midnight action flow implementation #769 - Midnight action-flow TIB
  2. Prepare SDK prerequisites for Midnight action flows #829 - SDK prerequisites for the action flows
  3. feat(morpho-sdk): add Midnight action flows #815 - Concrete Midnight action-flow implementation

Validation

  • pnpm --filter @morpho-org/morpho-sdk build
  • pnpm --filter @morpho-org/morpho-sdk test -- packages/morpho-sdk/src/actions/midnight packages/morpho-sdk/src/entities/midnight was attempted, but the morpho-sdk Vitest project still loads fork-backed suites that require MAINNET_RPC_URL; 364 tests passed before env-gated suites failed during setup.

@Rubilmax Rubilmax self-assigned this Jun 23, 2026
@Rubilmax Rubilmax force-pushed the hermes/tib-midnight-action-output-interface branch from 25013e7 to 1870b00 Compare June 23, 2026 12:42
@Rubilmax Rubilmax force-pushed the hermes/marketv2-action-flows-implementation branch from 05288a6 to e29dfc1 Compare June 23, 2026 12:44
@Rubilmax Rubilmax changed the title feat(morpho-sdk): add MarketV2 action flows feat(morpho-sdk): add Midnight action flows Jun 23, 2026
@Rubilmax Rubilmax closed this Jun 23, 2026
@Rubilmax Rubilmax deleted the hermes/marketv2-action-flows-implementation branch June 23, 2026 12:45
@Rubilmax Rubilmax restored the hermes/marketv2-action-flows-implementation branch June 23, 2026 12:46
@Rubilmax Rubilmax reopened this Jun 23, 2026
@Rubilmax Rubilmax force-pushed the hermes/tib-midnight-action-output-interface branch from 1870b00 to 3e850f2 Compare June 24, 2026 07:41
@Rubilmax Rubilmax force-pushed the hermes/marketv2-action-flows-implementation branch 4 times, most recently from ef6d795 to e070f41 Compare June 24, 2026 08:33
@Rubilmax Rubilmax force-pushed the hermes/tib-midnight-action-output-interface branch from 3e850f2 to 9adf550 Compare June 24, 2026 09:01
@Rubilmax Rubilmax force-pushed the hermes/marketv2-action-flows-implementation branch 3 times, most recently from dad9be6 to 3350d27 Compare June 24, 2026 09:50
params: MidnightBorrowMarketParams,
): Readonly<Transaction<MidnightBorrowMarketAction>> => {
if (params.collateralAssets < 0n) {
throw new NegativeMidnightAmountError(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blue actions use blue-specific errors with blue-specific Market for example. Why? tbd with @Foulks-Plb

@Rubilmax Rubilmax force-pushed the hermes/marketv2-action-flows-implementation branch 2 times, most recently from c7a3132 to ea10f38 Compare June 24, 2026 15:42
Comment thread packages/morpho-sdk/src/actions/midnight/takeBorrow.ts Outdated
Comment thread packages/morpho-sdk/src/constants.ts Outdated

@Rubilmax Rubilmax left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partial review

@Rubilmax Rubilmax force-pushed the hermes/marketv2-action-flows-implementation branch from 6605a9a to c024ee5 Compare June 25, 2026 07:20
@Rubilmax Rubilmax force-pushed the hermes/tib-midnight-action-output-interface branch from 6e6c682 to 4ebc78e Compare June 25, 2026 07:33
@Rubilmax Rubilmax force-pushed the hermes/marketv2-action-flows-implementation branch 2 times, most recently from 9301f31 to ef3d406 Compare June 25, 2026 07:42
@Rubilmax Rubilmax force-pushed the hermes/marketv2-action-flows-implementation branch 3 times, most recently from c80482c to d9f0f44 Compare June 25, 2026 11:18
Rubilmax added 27 commits July 8, 2026 11:29
Comment thread packages/morpho-sdk/src/actions/midnight/types.ts Outdated
Comment thread packages/morpho-sdk/src/actions/midnight/authorization.ts Outdated

@Rubilmax Rubilmax left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants