-
Notifications
You must be signed in to change notification settings - Fork 4
Separate DatumOption into DatumHash and InlineDatum modules #135
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: main
Are you sure you want to change the base?
Conversation
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 pull request refactors the DatumOption module by separating it into dedicated DatumHash and InlineDatum modules to enable better tree-shaking and provide cleaner imports.
Changes:
- Created new
DatumHashmodule with convenience functions (fromHex,toHex,fromBytes,toBytes) - Created new
InlineDatummodule for inline plutus data - Refactored
DatumOptionto re-export from the new modules while maintaining the union type - Fixed
BlockfrostUTxOschema by adding the missingaddressfield - Updated all provider implementations (Blockfrost, Maestro, Kupmios, Koios) to use new imports
- Updated core modules (
Hash.ts,TxOut.ts,TransactionOutput.ts,Provider.ts) to useDatumHashmodule - Added proper exports in
index.tsandCardano.ts - Updated documentation with correct navigation orders
Reviewed changes
Copilot reviewed 167 out of 167 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| DatumHash.ts | New module with DatumHash class and convenience functions for encoding/decoding |
| InlineDatum.ts | New module with InlineDatum class for inline plutus data |
| DatumOption.ts | Refactored to import from new modules, maintains backward compatibility |
| Blockfrost.ts | Added missing address field to BlockfrostUTxO schema |
| BlockfrostEffect.ts | Updated to use new modules, fixed address extraction to use utxo.address |
| MaestroEffect.ts | Updated type imports to use DatumHash module |
| KupmiosEffects.ts | Updated to use both DatumHash and InlineDatum modules |
| KoiosEffect.ts | Updated type imports to use DatumHash module |
| Hash.ts | Updated imports and return type for hashPlutusData |
| TxOut.ts | Updated to use DatumHash.FromBytes schema |
| TransactionOutput.ts | Updated to use DatumHash module for types and schemas |
| Provider.ts | Updated getDatum signature to use DatumHash module |
| index.ts, Cardano.ts | Added exports for new modules |
| Documentation files | Updated navigation orders to accommodate new modules |
| .changeset/deep-beds-mate.md | Added changeset documenting the changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Splits DatumOption into dedicated modules for better tree-shaking and cleaner imports.