From 150986a544b5fe86055544bd913ff6a93d1bb654 Mon Sep 17 00:00:00 2001 From: ilija Date: Mon, 11 May 2026 21:30:53 +0200 Subject: [PATCH 1/2] Add stellar client protos --- .../blockchain/stellar/v1alpha/client.proto | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 cre/capabilities/blockchain/stellar/v1alpha/client.proto diff --git a/cre/capabilities/blockchain/stellar/v1alpha/client.proto b/cre/capabilities/blockchain/stellar/v1alpha/client.proto new file mode 100644 index 00000000..e36f337f --- /dev/null +++ b/cre/capabilities/blockchain/stellar/v1alpha/client.proto @@ -0,0 +1,89 @@ +syntax = "proto3"; +package capabilities.blockchain.stellar.v1alpha; + +import "sdk/v1alpha/sdk.proto"; +import "tools/generator/v1alpha/cre_metadata.proto"; + +enum TxStatus { + TX_STATUS_FATAL = 0; + TX_STATUS_REVERTED = 1; + TX_STATUS_SUCCESS = 2; +} + + +message ReadContractRequest { + string contract_id = 1; + string function = 2; + repeated bytes args = 3; + // Optional: 0 = latest + uint32 ledger_sequence = 4; +} + +message ReadContractResponse { + bytes result = 1; + // Ledger actually used for simulation + uint32 ledger_sequence = 2; + // Response + string error = 3; +} + +// ========== GetLatestLedger ========== + +message GetLatestLedgerRequest {} + +message GetLatestLedgerResponse { + bytes hash = 1; // 32-byte raw ledger hash + uint32 protocol_version = 2; + uint32 sequence = 3; + int64 ledger_close_time = 4; + bytes ledger_header_xdr = 5; // LedgerHeader binary XDR + bytes ledger_metadata_xdr = 6; // LedgerCloseMetaV2 binary XDR +} + +// ========== WriteReport ========== + +message WriteReportRequest { + string contract_id = 1; // Stellar contract address (C… StrKey) + sdk.v1alpha.ReportResponse report = 2; // signed report from consensus +} + +enum ReceiverContractExecutionStatus { + RECEIVER_CONTRACT_EXECUTION_STATUS_SUCCESS = 0; + RECEIVER_CONTRACT_EXECUTION_STATUS_REVERTED = 1; +} + +message WriteReportReply { + TxStatus tx_status = 1; + optional ReceiverContractExecutionStatus receiver_contract_execution_status = 2; + optional string tx_hash = 3; + optional uint64 transaction_fee = 4; // total fee paid in stroops + optional uint32 ledger_sequence = 5; +} + +service Client { + option (tools.generator.v1alpha.capability) = { + mode: MODE_DON + capability_id: "stellar@1.0.0" + labels: { + key: "ChainSelector" + value: { + uint64_label: { + defaults: [ + { + key: "stellar-mainnet" + value: 17783245649066640917 + }, + { + key: "stellar-testnet" + value: 4894814558906953166 + } + ] + } + } + } + }; + + rpc GetLatestLedger(GetLatestLedgerRequest) returns (GetLatestLedgerResponse); + rpc ReadContract(ReadContractRequest) returns (ReadContractResponse); + rpc WriteReport(WriteReportRequest) returns (WriteReportReply); +} From 058d44e7c82c895405e151459608379e4718ba20 Mon Sep 17 00:00:00 2001 From: "app-token-issuer-engops[bot]" <144731339+app-token-issuer-engops[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 19:32:29 +0000 Subject: [PATCH 2/2] Auto-fix: buf format, gofmt, go generate, go mod tidy --- .../blockchain/stellar/v1alpha/client.proto | 17 ++-- cre/go/installer/pkg/embedded_gen.go | 94 +++++++++++++++++++ 2 files changed, 102 insertions(+), 9 deletions(-) diff --git a/cre/capabilities/blockchain/stellar/v1alpha/client.proto b/cre/capabilities/blockchain/stellar/v1alpha/client.proto index e36f337f..272aeaed 100644 --- a/cre/capabilities/blockchain/stellar/v1alpha/client.proto +++ b/cre/capabilities/blockchain/stellar/v1alpha/client.proto @@ -5,12 +5,11 @@ import "sdk/v1alpha/sdk.proto"; import "tools/generator/v1alpha/cre_metadata.proto"; enum TxStatus { - TX_STATUS_FATAL = 0; - TX_STATUS_REVERTED = 1; - TX_STATUS_SUCCESS = 2; + TX_STATUS_FATAL = 0; + TX_STATUS_REVERTED = 1; + TX_STATUS_SUCCESS = 2; } - message ReadContractRequest { string contract_id = 1; string function = 2; @@ -32,18 +31,18 @@ message ReadContractResponse { message GetLatestLedgerRequest {} message GetLatestLedgerResponse { - bytes hash = 1; // 32-byte raw ledger hash + bytes hash = 1; // 32-byte raw ledger hash uint32 protocol_version = 2; uint32 sequence = 3; - int64 ledger_close_time = 4; - bytes ledger_header_xdr = 5; // LedgerHeader binary XDR - bytes ledger_metadata_xdr = 6; // LedgerCloseMetaV2 binary XDR + int64 ledger_close_time = 4; + bytes ledger_header_xdr = 5; // LedgerHeader binary XDR + bytes ledger_metadata_xdr = 6; // LedgerCloseMetaV2 binary XDR } // ========== WriteReport ========== message WriteReportRequest { - string contract_id = 1; // Stellar contract address (C… StrKey) + string contract_id = 1; // Stellar contract address (C… StrKey) sdk.v1alpha.ReportResponse report = 2; // signed report from consensus } diff --git a/cre/go/installer/pkg/embedded_gen.go b/cre/go/installer/pkg/embedded_gen.go index c52246cd..569350c9 100755 --- a/cre/go/installer/pkg/embedded_gen.go +++ b/cre/go/installer/pkg/embedded_gen.go @@ -418,6 +418,96 @@ message WriteReportReply { } ` +const blockchainStellarV1alphaClientEmbedded = `syntax = "proto3"; +package capabilities.blockchain.stellar.v1alpha; + +import "sdk/v1alpha/sdk.proto"; +import "tools/generator/v1alpha/cre_metadata.proto"; + +enum TxStatus { + TX_STATUS_FATAL = 0; + TX_STATUS_REVERTED = 1; + TX_STATUS_SUCCESS = 2; +} + +message ReadContractRequest { + string contract_id = 1; + string function = 2; + repeated bytes args = 3; + // Optional: 0 = latest + uint32 ledger_sequence = 4; +} + +message ReadContractResponse { + bytes result = 1; + // Ledger actually used for simulation + uint32 ledger_sequence = 2; + // Response + string error = 3; +} + +// ========== GetLatestLedger ========== + +message GetLatestLedgerRequest {} + +message GetLatestLedgerResponse { + bytes hash = 1; // 32-byte raw ledger hash + uint32 protocol_version = 2; + uint32 sequence = 3; + int64 ledger_close_time = 4; + bytes ledger_header_xdr = 5; // LedgerHeader binary XDR + bytes ledger_metadata_xdr = 6; // LedgerCloseMetaV2 binary XDR +} + +// ========== WriteReport ========== + +message WriteReportRequest { + string contract_id = 1; // Stellar contract address (C… StrKey) + sdk.v1alpha.ReportResponse report = 2; // signed report from consensus +} + +enum ReceiverContractExecutionStatus { + RECEIVER_CONTRACT_EXECUTION_STATUS_SUCCESS = 0; + RECEIVER_CONTRACT_EXECUTION_STATUS_REVERTED = 1; +} + +message WriteReportReply { + TxStatus tx_status = 1; + optional ReceiverContractExecutionStatus receiver_contract_execution_status = 2; + optional string tx_hash = 3; + optional uint64 transaction_fee = 4; // total fee paid in stroops + optional uint32 ledger_sequence = 5; +} + +service Client { + option (tools.generator.v1alpha.capability) = { + mode: MODE_DON + capability_id: "stellar@1.0.0" + labels: { + key: "ChainSelector" + value: { + uint64_label: { + defaults: [ + { + key: "stellar-mainnet" + value: 17783245649066640917 + }, + { + key: "stellar-testnet" + value: 4894814558906953166 + } + ] + } + } + } + }; + + rpc GetLatestLedger(GetLatestLedgerRequest) returns (GetLatestLedgerResponse); + rpc ReadContract(ReadContractRequest) returns (ReadContractResponse); + rpc WriteReport(WriteReportRequest) returns (WriteReportReply); +} +` + const computeConfidentialworkflowV1alphaClientEmbedded = `syntax = "proto3"; package capabilities.compute.confidentialworkflow.v1alpha; @@ -1319,6 +1409,10 @@ var allFiles = []*embeddedFile{ name: "capabilities/blockchain/evm/v1alpha/client.proto", content: blockchainEvmV1alphaClientEmbedded, }, + { + name: "capabilities/blockchain/stellar/v1alpha/client.proto", + content: blockchainStellarV1alphaClientEmbedded, + }, { name: "capabilities/compute/confidentialworkflow/v1alpha/client.proto", content: computeConfidentialworkflowV1alphaClientEmbedded,