Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ jobs:
- name: Generate code
run: buf generate proto

- name: Generate dotnet v1alpha
run: buf generate --template buf.gen.dotnet.v1alpha.yaml

- name: Generate dotnet v1beta
run: buf generate --template buf.gen.dotnet.v1beta.yaml

- name: Fix python imports
run:
find gen/python/utxorpc_spec -type f -exec sed -i '' 's@from
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# .NET build files
bin
obj
gen/dotnet/*.cs
gen/dotnet/*
!gen/dotnet/Utxorpc.Spec.csproj
gen/go/utxorpc/
gen/haskell/Proto
gen/node/src/
Expand Down
13 changes: 13 additions & 0 deletions buf.gen.dotnet.v1alpha.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: v2

inputs:
- directory: proto
paths:
- proto/utxorpc/v1alpha

plugins:
- remote: buf.build/grpc/csharp:v1.76.0
out: gen/dotnet/v1alpha

- remote: buf.build/protocolbuffers/csharp:v29.3
out: gen/dotnet/v1alpha
13 changes: 13 additions & 0 deletions buf.gen.dotnet.v1beta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: v2

inputs:
- directory: proto
paths:
- proto/utxorpc/v1beta

plugins:
- remote: buf.build/grpc/csharp:v1.76.0
out: gen/dotnet/v1beta

- remote: buf.build/protocolbuffers/csharp:v29.3
out: gen/dotnet/v1beta
7 changes: 2 additions & 5 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,8 @@ plugins:
out: gen/haskell

# dotnet
- plugin: buf.build/grpc/csharp:v1.68.0
out: gen/dotnet

- plugin: buf.build/protocolbuffers/csharp:v28.3
out: gen/dotnet
# NOTE: C# plugins are run separately via buf generate --path to handle v1alpha/v1beta separation
# See generate.yml workflow for details

# other

Expand Down
8 changes: 4 additions & 4 deletions gen/dotnet/Utxorpc.Spec.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>Utxorpc.Spec</PackageId>
Expand All @@ -22,9 +22,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.28.3" />
<PackageReference Include="Grpc.Net.Client" Version="2.67.0" />
<PackageReference Include="Grpc.Tools" Version="2.67.0">
<PackageReference Include="Google.Protobuf" Version="3.33.4" />
<PackageReference Include="Grpc.Net.Client" Version="2.76.0" />
<PackageReference Include="Grpc.Tools" Version="2.76.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
8 changes: 7 additions & 1 deletion gen/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ ledgers = ["utxorpc-v1alpha-cardano"]
# @@protoc_deletion_point(features)
# This section is automatically generated by protoc-gen-prost-crate.
# Changes in this area may be lost on regeneration.
proto_full = ["utxorpc-v1alpha-bitcoin","utxorpc-v1alpha-cardano","utxorpc-v1alpha-query","utxorpc-v1alpha-submit","utxorpc-v1alpha-sync","utxorpc-v1alpha-watch"]
proto_full = ["utxorpc-v1alpha-bitcoin","utxorpc-v1alpha-cardano","utxorpc-v1alpha-query","utxorpc-v1alpha-submit","utxorpc-v1alpha-sync","utxorpc-v1alpha-watch","utxorpc-v1beta-bitcoin","utxorpc-v1beta-cardano","utxorpc-v1beta-query","utxorpc-v1beta-submit","utxorpc-v1beta-sync","utxorpc-v1beta-watch"]
"utxorpc-v1alpha-bitcoin" = []
"utxorpc-v1alpha-cardano" = []
"utxorpc-v1alpha-query" = ["utxorpc-v1alpha-cardano"]
"utxorpc-v1alpha-submit" = ["utxorpc-v1alpha-cardano"]
"utxorpc-v1alpha-sync" = ["utxorpc-v1alpha-cardano"]
"utxorpc-v1alpha-watch" = ["utxorpc-v1alpha-cardano"]
"utxorpc-v1beta-bitcoin" = []
"utxorpc-v1beta-cardano" = []
"utxorpc-v1beta-query" = ["utxorpc-v1beta-cardano"]
"utxorpc-v1beta-submit" = ["utxorpc-v1beta-cardano"]
"utxorpc-v1beta-sync" = ["utxorpc-v1beta-cardano"]
"utxorpc-v1beta-watch" = ["utxorpc-v1beta-cardano"]
## @@protoc_insertion_point(features)
38 changes: 38 additions & 0 deletions gen/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,42 @@ pub mod utxorpc {
// @@protoc_insertion_point(utxorpc.v1alpha.watch)
}
}
pub mod v1beta {
#[cfg(feature = "utxorpc-v1beta-bitcoin")]
// @@protoc_insertion_point(attribute:utxorpc.v1beta.bitcoin)
pub mod bitcoin {
include!("utxorpc.v1beta.bitcoin.rs");
// @@protoc_insertion_point(utxorpc.v1beta.bitcoin)
}
#[cfg(feature = "utxorpc-v1beta-cardano")]
// @@protoc_insertion_point(attribute:utxorpc.v1beta.cardano)
pub mod cardano {
include!("utxorpc.v1beta.cardano.rs");
// @@protoc_insertion_point(utxorpc.v1beta.cardano)
}
#[cfg(feature = "utxorpc-v1beta-query")]
// @@protoc_insertion_point(attribute:utxorpc.v1beta.query)
pub mod query {
include!("utxorpc.v1beta.query.rs");
// @@protoc_insertion_point(utxorpc.v1beta.query)
}
#[cfg(feature = "utxorpc-v1beta-submit")]
// @@protoc_insertion_point(attribute:utxorpc.v1beta.submit)
pub mod submit {
include!("utxorpc.v1beta.submit.rs");
// @@protoc_insertion_point(utxorpc.v1beta.submit)
}
#[cfg(feature = "utxorpc-v1beta-sync")]
// @@protoc_insertion_point(attribute:utxorpc.v1beta.sync)
pub mod sync {
include!("utxorpc.v1beta.sync.rs");
// @@protoc_insertion_point(utxorpc.v1beta.sync)
}
#[cfg(feature = "utxorpc-v1beta-watch")]
// @@protoc_insertion_point(attribute:utxorpc.v1beta.watch)
pub mod watch {
include!("utxorpc.v1beta.watch.rs");
// @@protoc_insertion_point(utxorpc.v1beta.watch)
}
}
}
3 changes: 3 additions & 0 deletions proto/utxorpc/v1alpha/cardano/cardano.proto
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ message Script {
bytes plutus_v1 = 2; // Plutus V1 script.
bytes plutus_v2 = 3; // Plutus V2 script.
bytes plutus_v3 = 4; // Plutus V3 script.
bytes plutus_v4 = 5; // Plutus V4 script.
}
}

Expand Down Expand Up @@ -592,6 +593,7 @@ message CostModels {
CostModel plutus_v1 = 1;
CostModel plutus_v2 = 2;
CostModel plutus_v3 = 3;
CostModel plutus_v4 = 4;
}

message VotingThresholds {
Expand Down Expand Up @@ -759,6 +761,7 @@ message CostModelMap {
CostModel plutus_v1 = 1;
CostModel plutus_v2 = 2;
CostModel plutus_v3 = 3;
CostModel plutus_v4 = 4;
}

// Unified Genesis configuration containing all parameters from all eras
Expand Down
48 changes: 48 additions & 0 deletions proto/utxorpc/v1beta/bitcoin/bitcoin.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
syntax = "proto3";

package utxorpc.v1beta.bitcoin;

// Represents an input in a Bitcoin transaction.
message TxInput {
optional bytes txid = 1; // Hash of the previous transaction output, corresponds to txid
optional bytes scriptSig = 2; // Unlocking script for spending the UTXO
uint32 sequence = 3; // Used for relative timelocks
optional bytes coinbase = 4; // Coinbase transactions have this instead of txid and scriptSig
repeated bytes txinwitness = 5; // Witness data for SegWit transactions
}

// Represents an output in a Bitcoin transaction.
message TxOutput {
uint64 value = 1; // Amount of Bitcoin in Satoshis
ScriptPubKey scriptPubKey = 2; // Locking script defining spendability
}

// Represents a script pub key in the output.
message ScriptPubKey {
bytes asm = 1; // Script in human-readable format
bytes hex = 2; // Script in hexadecimal format
bytes type = 3;
optional bytes address = 4; // Some outputs have addresses
}

// Represents a transaction in the Bitcoin network.
message Transaction {
uint32 version = 1; // Transaction version number. Currently 1
repeated TxInput vin = 2; // List of transaction inputs
repeated TxOutput vout = 3; // List of transaction outputs
uint32 locktime = 4; // Block height or timestamp when transaction is final
bytes hash = 5; // Hash of the transaction
optional bytes blockhash = 6; // Transactions reference their block
optional uint32 time = 7; // Timestamp of the transaction
}

// Represents a block in the Bitcoin blockchain.
message Block {
uint32 version = 1; // Block version number
optional bytes previousblockhash = 2; // Hash of the previous block
bytes merkleroot = 3; // Root hash of the Merkle tree
uint32 time = 4; // Time when the block was created
uint32 bits = 5; // Target difficulty value
uint32 nonce = 6; // Value used for Proof-of-Work
repeated Transaction tx = 7; // List of transactions included in the block
}
Loading
Loading