Skip to content

feat(cardano): simplify Asset type#182

Merged
scarmuega merged 1 commit intoutxorpc:chore/initialize-v1betafrom
carbolymer:simplify-asset-message
Jan 5, 2026
Merged

feat(cardano): simplify Asset type#182
scarmuega merged 1 commit intoutxorpc:chore/initialize-v1betafrom
carbolymer:simplify-asset-message

Conversation

@carbolymer
Copy link
Contributor

Since currently both of the variants of quantity can store negative values, there is no point of having them both if they serve the same purpose.

There is a problem though: BigInt can store negative values, which do not make sense in case of assets in transaction outputs. One way to approach this would be to keep sum type quantity but use two different types: BigInt and some new type representing only positive values for example:

message BigUInt {
  oneof big_uint {
    uint64 int = 1;
    bytes big_u_int = 2;
  }
}

The question is if the introduced complexity justifies the gain in type safety.

@carbolymer carbolymer force-pushed the simplify-asset-message branch from 8be138e to ff92997 Compare November 28, 2025 19:43
@carbolymer carbolymer changed the base branch from main to chore/initialize-v1beta December 23, 2025 14:13
Since currently both of the variants of `quantity` can store negative
values, there is no point of having them both if they serve the same
purpose.
@carbolymer carbolymer force-pushed the simplify-asset-message branch from ff92997 to 77abd77 Compare December 23, 2025 14:14
@scarmuega scarmuega merged commit 4562752 into utxorpc:chore/initialize-v1beta Jan 5, 2026
Mercurial pushed a commit that referenced this pull request Feb 2, 2026
* chore: initialize v1beta version

* fix(cardano): Remove redundant redeemer field from Multiasset (#178)

* feat(cardano): Add `InfoAction` type representing info action governance action (#179)

* feat(cardano): Rename `NativeScript.script_pubkey` to `script_pubkey_hash` (#180)

Other fields containing hashes have `_hash` prefix. This change renames
the field to follow the suit.

* feat(cardano): Add `BootstrapWitness` and `Redeemer` fields to `WitnessSet` (#181)

* feat(cardano): simplify `Asset` type by unifying quantity fields (#182)

Since currently both of the variants of `quantity` can store negative
values, there is no point of having them both if they serve the same
purpose.

* feat(cardano): Improve optional fields and update Plutus versions (#177)

* feat(cardano): Mark optional fields in TxOutput hierarchy optional in proto definition
* feat(cardano): Add Plutus V4 fields to proto definition
* chore(cardano): Add comments to `BigInt` and `TreasuryWithdrawalsAction.withdrawals`

* chore(cardano): Add missing `;` (#185)

---------

Co-authored-by: Mateusz Galazyn <228866+carbolymer@users.noreply.github.com>
Mercurial added a commit that referenced this pull request Feb 2, 2026
* chore: initialize v1beta version

* fix(cardano): Remove redundant redeemer field from Multiasset (#178)

* feat(cardano): Add `InfoAction` type representing info action governance action (#179)

* feat(cardano): Rename `NativeScript.script_pubkey` to `script_pubkey_hash` (#180)

Other fields containing hashes have `_hash` prefix. This change renames
the field to follow the suit.

* feat(cardano): Add `BootstrapWitness` and `Redeemer` fields to `WitnessSet` (#181)

* feat(cardano): simplify `Asset` type by unifying quantity fields (#182)

Since currently both of the variants of `quantity` can store negative
values, there is no point of having them both if they serve the same
purpose.

* feat(cardano): Improve optional fields and update Plutus versions (#177)

* feat(cardano): Mark optional fields in TxOutput hierarchy optional in proto definition
* feat(cardano): Add Plutus V4 fields to proto definition
* chore(cardano): Add comments to `BigInt` and `TreasuryWithdrawalsAction.withdrawals`

* chore(cardano): Add missing `;` (#185)

* feat(v1alpha): add plutus v4 (#184)

Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>

* fix(dotnet): separate codegen for v1alpha and v1beta

The C# protobuf generator outputs flat .cs files where filename = proto
filename. When both v1alpha and v1beta have the same proto files, they
collide (e.g., both generate Query.cs).

This fix:
- Adds separate buf.gen.dotnet.v1alpha.yaml and v1beta.yaml (v2 format)
- Generates to subdirectories: gen/dotnet/v1alpha/ and v1beta/
- Updates .csproj to .NET 10 and latest packages
- Updates CI workflow to run both dotnet codegen steps
- Updates .gitignore to exclude generated C# files

This matches industry standards (Google Cloud APIs, Microsoft gRPC, AIP-185).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
Co-authored-by: Santiago Carmuega <santiago@carmuega.me>
Co-authored-by: Mateusz Galazyn <228866+carbolymer@users.noreply.github.com>
Co-authored-by: Chris Gianelloni <wolf31o2@blinklabs.io>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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