Skip to content

Fix Blockfrost OverlappingAdditionalUtxo error in mint transaction build#28

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-blockfrost-evaluation-error
Closed

Fix Blockfrost OverlappingAdditionalUtxo error in mint transaction build#28
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-blockfrost-evaluation-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 1, 2026

The mint transaction's .build() call fails with a Blockfrost evaluation error because deployChain.available contains both on-chain wallet UTxOs and off-chain chained UTxOs. Passing on-chain UTxOs to Blockfrost as "additional" UTxOs triggers OverlappingAdditionalUtxo.

Changes

  • Custom evaluator: Replaces passAdditionalUtxos: true with an explicit evaluator passed to .build() that filters additionalUtxos to exclude any UTxO already present in wallet.utxos before calling client.evaluateTx()
  • New imports: Effect, Transaction from main SDK; EvaluationError from @evolution-sdk/evolution/sdk/builders/TransactionBuilder
const evaluator = {
  evaluate: (tx, additionalUtxos, _context) =>
    Effect.tryPromise({
      try: () => {
        const offChainUtxos = (additionalUtxos ?? []).filter(
          (u) => !wallet.utxos.some(
            (w) =>
              TransactionHash.toHex(w.transactionId) === TransactionHash.toHex(u.transactionId) &&
              w.index === u.index
          )
        );
        return client.evaluateTx(tx, offChainUtxos as UTxO.UTxO[]);
      },
      catch: (error) => new EvaluationError({ message: String(error), cause: error }),
    }),
};

Blockfrost receives only the truly off-chain UTxOs (outputs of the chained setup/deploy transactions), giving it the context needed to evaluate the Plutus script without the overlap conflict.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com>
Comment thread src/mint.ts
Comment thread src/mint.ts
Copilot AI changed the title [WIP] Fix Blockfrost evaluation error in mint.ts Fix Blockfrost OverlappingAdditionalUtxo error in mint transaction build Mar 1, 2026
@SynthLuvr SynthLuvr closed this Mar 1, 2026
@SynthLuvr SynthLuvr deleted the copilot/fix-blockfrost-evaluation-error branch March 1, 2026 19:14
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