Skip to content

Conversation

@solidsnakedev
Copy link
Collaborator

Splits DatumOption into dedicated modules for better tree-shaking and cleaner imports.

  • Add `DatumHash` module with `fromHex`, `toHex`, `fromBytes`, `toBytes`
  • Add `InlineDatum` module
  • Refactor `DatumOption` to re-export from new modules
  • Fix `BlockfrostUTxO` schema missing `address` field
  • Update provider implementations

Copilot AI review requested due to automatic review settings January 20, 2026 20:47
Copy link
Contributor

Copilot AI left a 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 DatumHash module with convenience functions (fromHex, toHex, fromBytes, toBytes)
  • Created new InlineDatum module for inline plutus data
  • Refactored DatumOption to re-export from the new modules while maintaining the union type
  • Fixed BlockfrostUTxO schema by adding the missing address field
  • Updated all provider implementations (Blockfrost, Maestro, Kupmios, Koios) to use new imports
  • Updated core modules (Hash.ts, TxOut.ts, TransactionOutput.ts, Provider.ts) to use DatumHash module
  • Added proper exports in index.ts and Cardano.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.

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.

2 participants