-
-
Notifications
You must be signed in to change notification settings - Fork 67
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raw tx: how to configure change address with exact calculation #57
Comments
Unfortunately, the library doesn't have a function to calculate the change from an unbalanced transaction. There is a private function under txbuilder, |
Yea I saw the source code in builder but didn't fully follow. I'll study a
bit more. Tell me if I'm off.. I should add up all Lovelace going out,
calculate tx fee (help me here: based on byte size of all inputs, outputs,
metadata, signatures, and min tx fee?) Then make sure some output exists to
take the leftover Lovelace and tokens as change from used inputs.
Is that correct or what's missing?
I think a change and fee helper would be an awesome feature to consider
exposing as a standalone method.
…On Thu, Jun 30, 2022 at 11:55 PM Jerry ***@***.***> wrote:
Unfortunately, the library doesn't have a function to calculate the change
from an unbalanced transaction. There is a private function under
txbuilder, _add_change_and_fee, but it relies on private fields in the
txbuilder, so it is hard to use it without txbuilder.
—
Reply to this email directly, view it on GitHub
<https://github.com/cffls/pycardano/issues/57#issuecomment-1171539492>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AATSTIFZHXGHKMYH5WR3E63VRXRABANCNFSM52KGCWZQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
txbuilder is the ultimate interface that helps you to automatically compute change and tx fee. I don't think there is a more straightforward way than using txbuilder itself to provide change and fee computation. |
Hey I started to roll my own transaction builder to address edge cases that kept coming up. It has a lot to do with utxos with low balances that I'm wrestling with, including a problem of blockfrost sending multiple utxos for the same transaction id if a token was minted, no doubt reflecting the lovelace dumped in a token but still creating code complexities of what's available and what to return. I'm deep in this rabbit hole now.. i've kept my original createtx function that uses your builder so will respond with the code to reproduce in some time. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hi Jer, while waiting to see about the other issue, I've begun creation of a raw tx to send tokens. My script is building fine but I'm getting a
ValueNotConservedUTxO
error for not including a change address with the correct calculation. I assume that as long as the outputs are equal to the outputs + fee we're good to go but unsure how to calc and what should be done about other assets from the same tx but not going to the recipient. Can you give a bit of guidance this please? I don't see this in the raw examples for token or tx.Many thanks!
The text was updated successfully, but these errors were encountered: