Skip to content

Conversation

@ruhil6789
Copy link

@ruhil6789 ruhil6789 commented Jan 15, 2026

Summary

This PR fixes a bug in the Koios provider's fetchUTxOs method where inline datums were not being fetched from the API, causing the OfflineEvaluator to fail when resolving UTxOs with inline datums.

Problem:

  • The fetchUTxOs method was missing the _datums: true parameter in the API request to the Koios tx_info endpoint
  • This meant that inline datums were not included in the API response, even though they exist in the transaction
  • When using OfflineEvaluator with the Koios provider, transactions spending UTxOs with inline datums would fail with "missing required datum" errors
  • The toUTxO method already correctly mapped inline_datum?.bytes to plutusData, but the data was never fetched from the API

Solution:

  • Added _datums: true parameter to the tx_info API request in the fetchUTxOs method
  • This ensures that inline datums are included in the API response and properly mapped to plutusData in the UTxO output
  • The fix is minimal and non-breaking - it only adds the missing parameter that should have been there from the start

Affect components

  • @meshsdk/provider

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Related Issues

Checklist

  • My code is appropriately commented and includes relevant documentation, if necessary
  • I have added tests to cover my changes, if necessary
  • I have updated the documentation, if necessary
  • All new and existing tests pass (i.e. npm run test)
  • The build is pass (i.e. npm run build)

Additional Information

Changes Made:

File: packages/mesh-provider/src/koios.ts

  • Line 440: Added _datums: true parameter to the tx_info POST request in the fetchUTxOs method

**Before:**ypescript
const { data, status } = await this._axiosInstance.post("tx_info", {
_tx_hashes: [hash],
_assets: true,
_scripts: true,
_bytecode: true,
});

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.

Incorrect datum for fetchUtxos() with Koios provider

1 participant