-
Notifications
You must be signed in to change notification settings - Fork 4
Midnight v1 – 02 Ingestion: contract artifacts + loader #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: midnight/01-wallet
Are you sure you want to change the base?
Conversation
Align runtime deps with export manifest for v1. Keep only @midnight-ntwrk/dapp-connector-api. Remove placeholder Midnight SDK deps from adapter config. Ensures FR-017 dependency sync policy.
…ark Phase 1-2 Mark T001, T002, T003, T005 as done for Phase 1-2.
Ignore node_modules, dist, build, coverage, exports, caches, and generated artifacts.
Add standard ignores: node_modules, dist, build, coverage, exports, caches, CI dirs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements contract ingestion for the Midnight adapter with chain-agnostic artifact support. It introduces the ability to persist and handle additional contract artifacts beyond basic definitions, enabling the Midnight adapter to work with complex contract data structures requiring multiple inputs.
- Adds shared
contractInputs
utilities for adapter-agnostic required field validation - Implements
contractDefinitionArtifacts
across storage, app, and UI layers for chain-agnostic adapter artifacts - Refactors Midnight adapter contract loading into dedicated loader module with metadata support
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
specs/004-add-midnight-adapter/tasks.md | Updates task completion status for contract ingestion milestones |
specs/004-add-midnight-adapter/checklists/parity.md | Marks parity checklist items as completed |
specs/004-add-midnight-adapter/checklists/architecture.md | Marks architecture checklist items as completed |
packages/utils/src/contractInputs.ts | Adds shared utilities for validating required contract inputs |
packages/storage/src/types.ts | Adds contractDefinitionArtifacts field to storage schema |
packages/storage/src/services/ContractUIStorage.ts | Updates storage service to handle artifacts persistence |
packages/builder/src/services/ContractLoader.ts | Integrates shared validation and artifacts support |
packages/builder/src/hooks/useContractDefinition.ts | Updates hook to pass artifacts in callback |
packages/builder/src/components/UIBuilder/hooks/useUIBuilderState.ts | Implements missing required fields check and artifacts handling |
packages/builder/src/components/UIBuilder/hooks/uiBuilderStore.ts | Adds artifacts to state management |
packages/builder/src/components/UIBuilder/hooks/builder/useBuilderLifecycle.ts | Updates lifecycle to handle artifacts |
packages/builder/src/components/UIBuilder/hooks/builder/useAutoSave.ts | Includes artifacts in auto-save functionality |
packages/builder/src/components/UIBuilder/StepContractDefinition/hooks/useFormSync.ts | Adds artifacts sync and form value tracking |
packages/builder/src/components/UIBuilder/StepContractDefinition/hooks/useContractLoader.ts | Removes unnecessary gating comment |
packages/builder/src/components/UIBuilder/StepContractDefinition/hooks/useAutoContractLoad.ts | Updates auto-load logic for better form validation |
packages/builder/src/components/UIBuilder/StepContractDefinition/StepContractDefinition.tsx | Passes adapter and values to form sync |
packages/adapter-midnight/src/utils/artifacts.ts | Fixes error message to reference correct property name |
packages/adapter-midnight/src/types/artifacts.ts | Renames contractSchema to contractDefinition for consistency |
packages/adapter-midnight/src/contract/loader.ts | Adds dedicated contract loading module with metadata support |
packages/adapter-midnight/src/adapter.ts | Refactors to use new loader and updates field names |
packages/adapter-midnight/src/config.ts | Simplifies dependency configuration per FR-017 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Midnight adapter: contract ingestion and chain-agnostic artifacts
Packages affected:
Changeset: .changeset/midnight-contract-ingestion.md