Add endpoint to expose sponsor UTXOs before transaction building#123
Open
welson-ai wants to merge 2 commits into
Open
Add endpoint to expose sponsor UTXOs before transaction building#123welson-ai wants to merge 2 commits into
welson-ai wants to merge 2 commits into
Conversation
added 2 commits
February 28, 2026 16:16
Crypto Butler is a conversational DeFi agent that allows users to describe their financial goals in plain English. The system deploys three specialized AI agents that: 1. Research live yield opportunities from DeFiLlama 2. Analyze user risk tolerance and goals 3. Build personalized portfolio allocation strategies Features: - Multi-agent AI system using Anthropic Claude - UTXOs.dev iframe-based wallet integration - Dual wallet support (social login + CIP-30 native) - Cardano Preprod testnet simulation - Real-time yield data from DeFiLlama - Interactive charts and transaction logs This example demonstrates proper UTXOs.dev integration patterns for Next.js applications, including iframe-based wallet connection and postMessage communication.
Ari4ka
approved these changes
Jun 9, 2026
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.
We were building Crypto Butler, a DeFi wealth management app targeting everyday users in Kenya who have never touched crypto before. The whole point of the app is that these users have no ADA for gas fees, so we needed transaction sponsorship to work — without it our users literally cannot do anything on chain. So we integrated UTXOs.dev sponsorship and started testing, and that is when things got weird. Transactions were failing silently. No clear error, no obvious reason, just broken. After a lot of digging we traced it back to how the SDK handles the sponsored UTXO — it builds the transaction first and then swaps in the real sponsor UTXO at the very end as a final step. The problem is that by the time that swap happens, the smart contract has already done its validation using the original input order. Cardano orders inputs lexicographically, so when a new UTXO gets swapped in, the entire input order can shift, and anything that referenced a specific input index in the redeemer is now pointing at the wrong thing. For a simple transfer this does not matter. But the moment you are doing anything remotely interesting on chain — minting, interacting with a script, referencing an input index — the swap silently breaks your transaction and you have no idea why. We spent a long time debugging something that should have just worked. Our fix is straightforward — add an endpoint that lets developers ask the SDK which UTXO it plans to use for sponsorship before they build the transaction. That way you build the transaction with the correct input from the start, the input ordering is right, the redeemer references the right index, and the whole thing actually validates when you submit it. It is a small change on the SDK side but it is the difference between sponsorship being usable in real applications and being a feature that quietly breaks production transactions.