fix(provider): standardize error handling, fix Blockfrost multi-asset format, accept tag-258/plain CBOR#210
Merged
solidsnakedev merged 6 commits intomainfrom Mar 17, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves provider interoperability by standardizing provider error handling, fixing Blockfrost evaluateTx payload formatting for multi-asset UTxOs, and broadening CBOR decoding compatibility. It also adds provider conformance coverage for evaluateTx using real transaction/UTxO fixtures.
Changes:
- Standardize provider error wrapping to a consistent
catchAll + wrapErrorpattern (Blockfrost, Koios, Kupmios, Maestro). - Fix/extend
evaluateTxsupport: Blockfrost multi-asset additional UTxO formatting; Maestro evaluate endpoint + schema + transformation. - Accept both CBOR tag-258 and plain array encodings when decoding
TransactionBodyinputs-related fields.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/evolution/test/provider/fixtures/evaluateTx.ts | Adds transaction + UTxO fixtures covering multiple redeemer scenarios (spend/mint/reward/cert) for evaluateTx. |
| packages/evolution/test/provider/conformance.ts | Enables conformance tests for evaluateTx using the new fixtures; adjusts awaitTx rejection expectation. |
| packages/evolution/src/sdk/provider/internal/MaestroEffect.ts | Wraps Maestro errors consistently; updates endpoints/response wrappers; implements Maestro evaluateTx request/response handling. |
| packages/evolution/src/sdk/provider/internal/Maestro.ts | Broadens schemas (string-or-number); adds eval result schema + transformation; starts decoding datum options into core types. |
| packages/evolution/src/sdk/provider/internal/KupmiosEffects.ts | Standardizes error handling and improves submitTx error messaging. |
| packages/evolution/src/sdk/provider/internal/KoiosEffect.ts | Standardizes error handling messages/patterns. |
| packages/evolution/src/sdk/provider/internal/BlockfrostEffect.ts | Standardizes error handling; fixes additional UTxO set formatting for multi-assets/reference scripts in evaluateTx. |
| packages/evolution/src/sdk/provider/internal/Blockfrost.ts | Adds JSONWSP fault detection and returns structured ProviderError failures from evaluation parsing. |
| packages/evolution/src/TransactionBody.ts | Decodes both tag-258 and untagged arrays for inputs/collateral/requiredSigners/referenceInputs/proposals. |
| .changeset/fix-provider-error-handling.md | Declares a patch release and summarizes provider fixes and decoding compatibility improvements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+112
to
+117
| const addressStr = | ||
| addressOrCredential instanceof CoreAddress.Address | ||
| ? CoreAddress.toBech32(addressOrCredential) | ||
| : addressOrCredential.hash | ||
|
|
||
| // Filter UTxOs that belong to the specified address/credential | ||
| // Use CoreAddress.toBech32 to convert Core Address to string for comparison | ||
| return transformedUtxos.filter((utxo) => CoreAddress.toBech32(utxo.address) === addressStr) | ||
| const allUtxos = yield* getUtxosWithPagination(`${baseUrl}/addresses/${addressStr}/utxos`, apiKey) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blockfrost
evaluateTxwith multi-asset UTxOs failed with"failed to decode payload from base64 or base16"becausetoBlockfrostValueformatted multi-asset values as a flatassetssub-object with concatenated policy-ID + asset-name keys. The Ogmios endpoint expects each policy ID as a top-level key in the value object mapping to{ assetName: quantity }. Additionally, all four providers used inconsistent error-handling patterns and errors from non-Error causes were silently garbled.Provider error handling
Standardizes all providers to
Effect.catchAll+ a sharedwrapErrorhelper. Adds JSONWSP fault detection to the Blockfrost evaluation response schema so real Ogmios errors surface instead of a generic "no result" message.Blockfrost multi-asset value format
Changes
toBlockfrostValuefrom{ coins, assets: { "<policyId><assetName>": qty } }to{ coins, "<policyId>": { "<assetName>": qty } }.TransactionBody CBOR backward compat
FromCDDLnow accepts both CBOR tag-258 (Conway-era sets) and plain arrays (Babbage-era) for inputs, collateral inputs, required signers, reference inputs, and proposal procedures.Test improvements
Renames eval fixture file to
evaluateTx.tsand gives each conformance test a descriptive name reflecting what it exercises.