diff --git a/go/gen/stellar/v1/contract_events.pb.go b/go/gen/stellar/v1/contract_events.pb.go index 7100a78..1f3b442 100644 --- a/go/gen/stellar/v1/contract_events.pb.go +++ b/go/gen/stellar/v1/contract_events.pb.go @@ -340,6 +340,51 @@ func (x *GetContractEventsRequest) GetIncludeDiagnostics() bool { return false } +// ContractEventBatch represents a batch of contract events from a single ledger +type ContractEventBatch struct { + state protoimpl.MessageState `protogen:"open.v1"` + Events []*ContractEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContractEventBatch) Reset() { + *x = ContractEventBatch{} + mi := &file_stellar_v1_contract_events_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContractEventBatch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContractEventBatch) ProtoMessage() {} + +func (x *ContractEventBatch) ProtoReflect() protoreflect.Message { + mi := &file_stellar_v1_contract_events_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContractEventBatch.ProtoReflect.Descriptor instead. +func (*ContractEventBatch) Descriptor() ([]byte, []int) { + return file_stellar_v1_contract_events_proto_rawDescGZIP(), []int{4} +} + +func (x *ContractEventBatch) GetEvents() []*ContractEvent { + if x != nil { + return x.Events + } + return nil +} + var File_stellar_v1_contract_events_proto protoreflect.FileDescriptor const file_stellar_v1_contract_events_proto_rawDesc = "" + @@ -377,7 +422,9 @@ const file_stellar_v1_contract_events_proto_rawDesc = "" + "\vevent_types\x18\x04 \x03(\tR\n" + "eventTypes\x12%\n" + "\x0einclude_failed\x18\x05 \x01(\bR\rincludeFailed\x12/\n" + - "\x13include_diagnostics\x18\x06 \x01(\bR\x12includeDiagnostics2\xfc\x01\n" + + "\x13include_diagnostics\x18\x06 \x01(\bR\x12includeDiagnostics\"G\n" + + "\x12ContractEventBatch\x121\n" + + "\x06events\x18\x01 \x03(\v2\x19.stellar.v1.ContractEventR\x06events2\xfc\x01\n" + "\x14ContractEventService\x12<\n" + "\aGetInfo\x12\x16.google.protobuf.Empty\x1a\x19.flowctl.v1.ComponentInfo\x12N\n" + "\vHealthCheck\x12\x1e.flowctl.v1.HealthCheckRequest\x1a\x1f.flowctl.v1.HealthCheckResponse\x12V\n" + @@ -395,32 +442,34 @@ func file_stellar_v1_contract_events_proto_rawDescGZIP() []byte { return file_stellar_v1_contract_events_proto_rawDescData } -var file_stellar_v1_contract_events_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_stellar_v1_contract_events_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_stellar_v1_contract_events_proto_goTypes = []any{ (*EventMeta)(nil), // 0: stellar.v1.EventMeta (*ScValue)(nil), // 1: stellar.v1.ScValue (*ContractEvent)(nil), // 2: stellar.v1.ContractEvent (*GetContractEventsRequest)(nil), // 3: stellar.v1.GetContractEventsRequest - (*emptypb.Empty)(nil), // 4: google.protobuf.Empty - (*v1.HealthCheckRequest)(nil), // 5: flowctl.v1.HealthCheckRequest - (*v1.ComponentInfo)(nil), // 6: flowctl.v1.ComponentInfo - (*v1.HealthCheckResponse)(nil), // 7: flowctl.v1.HealthCheckResponse + (*ContractEventBatch)(nil), // 4: stellar.v1.ContractEventBatch + (*emptypb.Empty)(nil), // 5: google.protobuf.Empty + (*v1.HealthCheckRequest)(nil), // 6: flowctl.v1.HealthCheckRequest + (*v1.ComponentInfo)(nil), // 7: flowctl.v1.ComponentInfo + (*v1.HealthCheckResponse)(nil), // 8: flowctl.v1.HealthCheckResponse } var file_stellar_v1_contract_events_proto_depIdxs = []int32{ 0, // 0: stellar.v1.ContractEvent.meta:type_name -> stellar.v1.EventMeta 1, // 1: stellar.v1.ContractEvent.topics:type_name -> stellar.v1.ScValue 1, // 2: stellar.v1.ContractEvent.data:type_name -> stellar.v1.ScValue - 4, // 3: stellar.v1.ContractEventService.GetInfo:input_type -> google.protobuf.Empty - 5, // 4: stellar.v1.ContractEventService.HealthCheck:input_type -> flowctl.v1.HealthCheckRequest - 3, // 5: stellar.v1.ContractEventService.GetContractEvents:input_type -> stellar.v1.GetContractEventsRequest - 6, // 6: stellar.v1.ContractEventService.GetInfo:output_type -> flowctl.v1.ComponentInfo - 7, // 7: stellar.v1.ContractEventService.HealthCheck:output_type -> flowctl.v1.HealthCheckResponse - 2, // 8: stellar.v1.ContractEventService.GetContractEvents:output_type -> stellar.v1.ContractEvent - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 2, // 3: stellar.v1.ContractEventBatch.events:type_name -> stellar.v1.ContractEvent + 5, // 4: stellar.v1.ContractEventService.GetInfo:input_type -> google.protobuf.Empty + 6, // 5: stellar.v1.ContractEventService.HealthCheck:input_type -> flowctl.v1.HealthCheckRequest + 3, // 6: stellar.v1.ContractEventService.GetContractEvents:input_type -> stellar.v1.GetContractEventsRequest + 7, // 7: stellar.v1.ContractEventService.GetInfo:output_type -> flowctl.v1.ComponentInfo + 8, // 8: stellar.v1.ContractEventService.HealthCheck:output_type -> flowctl.v1.HealthCheckResponse + 2, // 9: stellar.v1.ContractEventService.GetContractEvents:output_type -> stellar.v1.ContractEvent + 7, // [7:10] is the sub-list for method output_type + 4, // [4:7] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_stellar_v1_contract_events_proto_init() } @@ -435,7 +484,7 @@ func file_stellar_v1_contract_events_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_stellar_v1_contract_events_proto_rawDesc), len(file_stellar_v1_contract_events_proto_rawDesc)), NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 1, }, diff --git a/go/gen/stellar/v1/token_transfers.pb.go b/go/gen/stellar/v1/token_transfers.pb.go new file mode 100644 index 0000000..0038efd --- /dev/null +++ b/go/gen/stellar/v1/token_transfers.pb.go @@ -0,0 +1,900 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: stellar/v1/token_transfers.proto + +package stellarv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EventMeta contains metadata about the token transfer event +type TokenTransferEventMeta struct { + state protoimpl.MessageState `protogen:"open.v1"` + LedgerSequence uint32 `protobuf:"varint,1,opt,name=ledger_sequence,json=ledgerSequence,proto3" json:"ledger_sequence,omitempty"` + ClosedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=closed_at,json=closedAt,proto3" json:"closed_at,omitempty"` + TxHash string `protobuf:"bytes,3,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` + TransactionIndex uint32 `protobuf:"varint,4,opt,name=transaction_index,json=transactionIndex,proto3" json:"transaction_index,omitempty"` // 1-indexed as per SEP-35 + OperationIndex *uint32 `protobuf:"varint,5,opt,name=operation_index,json=operationIndex,proto3,oneof" json:"operation_index,omitempty"` // 1-indexed as per SEP-35, optional for contract events + ContractAddress string `protobuf:"bytes,6,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` // ContractID derived from asset or emitting contract + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TokenTransferEventMeta) Reset() { + *x = TokenTransferEventMeta{} + mi := &file_stellar_v1_token_transfers_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TokenTransferEventMeta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenTransferEventMeta) ProtoMessage() {} + +func (x *TokenTransferEventMeta) ProtoReflect() protoreflect.Message { + mi := &file_stellar_v1_token_transfers_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokenTransferEventMeta.ProtoReflect.Descriptor instead. +func (*TokenTransferEventMeta) Descriptor() ([]byte, []int) { + return file_stellar_v1_token_transfers_proto_rawDescGZIP(), []int{0} +} + +func (x *TokenTransferEventMeta) GetLedgerSequence() uint32 { + if x != nil { + return x.LedgerSequence + } + return 0 +} + +func (x *TokenTransferEventMeta) GetClosedAt() *timestamppb.Timestamp { + if x != nil { + return x.ClosedAt + } + return nil +} + +func (x *TokenTransferEventMeta) GetTxHash() string { + if x != nil { + return x.TxHash + } + return "" +} + +func (x *TokenTransferEventMeta) GetTransactionIndex() uint32 { + if x != nil { + return x.TransactionIndex + } + return 0 +} + +func (x *TokenTransferEventMeta) GetOperationIndex() uint32 { + if x != nil && x.OperationIndex != nil { + return *x.OperationIndex + } + return 0 +} + +func (x *TokenTransferEventMeta) GetContractAddress() string { + if x != nil { + return x.ContractAddress + } + return "" +} + +// Asset represents a Stellar asset (native, issued, or custom/Soroban) +type Asset struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Asset: + // + // *Asset_Native + // *Asset_Issued + // *Asset_ContractId + Asset isAsset_Asset `protobuf_oneof:"asset"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Asset) Reset() { + *x = Asset{} + mi := &file_stellar_v1_token_transfers_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Asset) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Asset) ProtoMessage() {} + +func (x *Asset) ProtoReflect() protoreflect.Message { + mi := &file_stellar_v1_token_transfers_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Asset.ProtoReflect.Descriptor instead. +func (*Asset) Descriptor() ([]byte, []int) { + return file_stellar_v1_token_transfers_proto_rawDescGZIP(), []int{1} +} + +func (x *Asset) GetAsset() isAsset_Asset { + if x != nil { + return x.Asset + } + return nil +} + +func (x *Asset) GetNative() bool { + if x != nil { + if x, ok := x.Asset.(*Asset_Native); ok { + return x.Native + } + } + return false +} + +func (x *Asset) GetIssued() *IssuedAsset { + if x != nil { + if x, ok := x.Asset.(*Asset_Issued); ok { + return x.Issued + } + } + return nil +} + +func (x *Asset) GetContractId() string { + if x != nil { + if x, ok := x.Asset.(*Asset_ContractId); ok { + return x.ContractId + } + } + return "" +} + +type isAsset_Asset interface { + isAsset_Asset() +} + +type Asset_Native struct { + // Native XLM + Native bool `protobuf:"varint,1,opt,name=native,proto3,oneof"` +} + +type Asset_Issued struct { + // Issued asset (classic Stellar asset) + Issued *IssuedAsset `protobuf:"bytes,2,opt,name=issued,proto3,oneof"` +} + +type Asset_ContractId struct { + // Custom/Soroban asset (contract-based) + ContractId string `protobuf:"bytes,3,opt,name=contract_id,json=contractId,proto3,oneof"` +} + +func (*Asset_Native) isAsset_Asset() {} + +func (*Asset_Issued) isAsset_Asset() {} + +func (*Asset_ContractId) isAsset_Asset() {} + +type IssuedAsset struct { + state protoimpl.MessageState `protogen:"open.v1"` + AssetCode string `protobuf:"bytes,1,opt,name=asset_code,json=assetCode,proto3" json:"asset_code,omitempty"` + AssetIssuer string `protobuf:"bytes,2,opt,name=asset_issuer,json=assetIssuer,proto3" json:"asset_issuer,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IssuedAsset) Reset() { + *x = IssuedAsset{} + mi := &file_stellar_v1_token_transfers_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IssuedAsset) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IssuedAsset) ProtoMessage() {} + +func (x *IssuedAsset) ProtoReflect() protoreflect.Message { + mi := &file_stellar_v1_token_transfers_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IssuedAsset.ProtoReflect.Descriptor instead. +func (*IssuedAsset) Descriptor() ([]byte, []int) { + return file_stellar_v1_token_transfers_proto_rawDescGZIP(), []int{2} +} + +func (x *IssuedAsset) GetAssetCode() string { + if x != nil { + return x.AssetCode + } + return "" +} + +func (x *IssuedAsset) GetAssetIssuer() string { + if x != nil { + return x.AssetIssuer + } + return "" +} + +// Transfer represents a token transfer from one account to another +type Transfer struct { + state protoimpl.MessageState `protogen:"open.v1"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` // Strkey representation + To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` // Strkey representation + Asset *Asset `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"` + Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` // String representation for precision + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Transfer) Reset() { + *x = Transfer{} + mi := &file_stellar_v1_token_transfers_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Transfer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Transfer) ProtoMessage() {} + +func (x *Transfer) ProtoReflect() protoreflect.Message { + mi := &file_stellar_v1_token_transfers_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Transfer.ProtoReflect.Descriptor instead. +func (*Transfer) Descriptor() ([]byte, []int) { + return file_stellar_v1_token_transfers_proto_rawDescGZIP(), []int{3} +} + +func (x *Transfer) GetFrom() string { + if x != nil { + return x.From + } + return "" +} + +func (x *Transfer) GetTo() string { + if x != nil { + return x.To + } + return "" +} + +func (x *Transfer) GetAsset() *Asset { + if x != nil { + return x.Asset + } + return nil +} + +func (x *Transfer) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +// Mint represents token creation/minting +type Mint struct { + state protoimpl.MessageState `protogen:"open.v1"` + To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` // Strkey representation + Asset *Asset `protobuf:"bytes,2,opt,name=asset,proto3" json:"asset,omitempty"` + Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Mint) Reset() { + *x = Mint{} + mi := &file_stellar_v1_token_transfers_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Mint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mint) ProtoMessage() {} + +func (x *Mint) ProtoReflect() protoreflect.Message { + mi := &file_stellar_v1_token_transfers_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Mint.ProtoReflect.Descriptor instead. +func (*Mint) Descriptor() ([]byte, []int) { + return file_stellar_v1_token_transfers_proto_rawDescGZIP(), []int{4} +} + +func (x *Mint) GetTo() string { + if x != nil { + return x.To + } + return "" +} + +func (x *Mint) GetAsset() *Asset { + if x != nil { + return x.Asset + } + return nil +} + +func (x *Mint) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +// Burn represents token destruction/burning +type Burn struct { + state protoimpl.MessageState `protogen:"open.v1"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` // Strkey representation + Asset *Asset `protobuf:"bytes,2,opt,name=asset,proto3" json:"asset,omitempty"` + Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Burn) Reset() { + *x = Burn{} + mi := &file_stellar_v1_token_transfers_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Burn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Burn) ProtoMessage() {} + +func (x *Burn) ProtoReflect() protoreflect.Message { + mi := &file_stellar_v1_token_transfers_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Burn.ProtoReflect.Descriptor instead. +func (*Burn) Descriptor() ([]byte, []int) { + return file_stellar_v1_token_transfers_proto_rawDescGZIP(), []int{5} +} + +func (x *Burn) GetFrom() string { + if x != nil { + return x.From + } + return "" +} + +func (x *Burn) GetAsset() *Asset { + if x != nil { + return x.Asset + } + return nil +} + +func (x *Burn) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +// Clawback represents asset clawback by issuer +type Clawback struct { + state protoimpl.MessageState `protogen:"open.v1"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` // Strkey representation + Asset *Asset `protobuf:"bytes,2,opt,name=asset,proto3" json:"asset,omitempty"` + Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Clawback) Reset() { + *x = Clawback{} + mi := &file_stellar_v1_token_transfers_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Clawback) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Clawback) ProtoMessage() {} + +func (x *Clawback) ProtoReflect() protoreflect.Message { + mi := &file_stellar_v1_token_transfers_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Clawback.ProtoReflect.Descriptor instead. +func (*Clawback) Descriptor() ([]byte, []int) { + return file_stellar_v1_token_transfers_proto_rawDescGZIP(), []int{6} +} + +func (x *Clawback) GetFrom() string { + if x != nil { + return x.From + } + return "" +} + +func (x *Clawback) GetAsset() *Asset { + if x != nil { + return x.Asset + } + return nil +} + +func (x *Clawback) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +// Fee represents transaction fee payment +type Fee struct { + state protoimpl.MessageState `protogen:"open.v1"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` // Strkey representation + Asset *Asset `protobuf:"bytes,2,opt,name=asset,proto3" json:"asset,omitempty"` + Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Fee) Reset() { + *x = Fee{} + mi := &file_stellar_v1_token_transfers_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Fee) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Fee) ProtoMessage() {} + +func (x *Fee) ProtoReflect() protoreflect.Message { + mi := &file_stellar_v1_token_transfers_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Fee.ProtoReflect.Descriptor instead. +func (*Fee) Descriptor() ([]byte, []int) { + return file_stellar_v1_token_transfers_proto_rawDescGZIP(), []int{7} +} + +func (x *Fee) GetFrom() string { + if x != nil { + return x.From + } + return "" +} + +func (x *Fee) GetAsset() *Asset { + if x != nil { + return x.Asset + } + return nil +} + +func (x *Fee) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +// TokenTransferEvent represents a single token transfer event +type TokenTransferEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + Meta *TokenTransferEventMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` + // Types that are valid to be assigned to Event: + // + // *TokenTransferEvent_Transfer + // *TokenTransferEvent_Mint + // *TokenTransferEvent_Burn + // *TokenTransferEvent_Clawback + // *TokenTransferEvent_Fee + Event isTokenTransferEvent_Event `protobuf_oneof:"event"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TokenTransferEvent) Reset() { + *x = TokenTransferEvent{} + mi := &file_stellar_v1_token_transfers_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TokenTransferEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenTransferEvent) ProtoMessage() {} + +func (x *TokenTransferEvent) ProtoReflect() protoreflect.Message { + mi := &file_stellar_v1_token_transfers_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokenTransferEvent.ProtoReflect.Descriptor instead. +func (*TokenTransferEvent) Descriptor() ([]byte, []int) { + return file_stellar_v1_token_transfers_proto_rawDescGZIP(), []int{8} +} + +func (x *TokenTransferEvent) GetMeta() *TokenTransferEventMeta { + if x != nil { + return x.Meta + } + return nil +} + +func (x *TokenTransferEvent) GetEvent() isTokenTransferEvent_Event { + if x != nil { + return x.Event + } + return nil +} + +func (x *TokenTransferEvent) GetTransfer() *Transfer { + if x != nil { + if x, ok := x.Event.(*TokenTransferEvent_Transfer); ok { + return x.Transfer + } + } + return nil +} + +func (x *TokenTransferEvent) GetMint() *Mint { + if x != nil { + if x, ok := x.Event.(*TokenTransferEvent_Mint); ok { + return x.Mint + } + } + return nil +} + +func (x *TokenTransferEvent) GetBurn() *Burn { + if x != nil { + if x, ok := x.Event.(*TokenTransferEvent_Burn); ok { + return x.Burn + } + } + return nil +} + +func (x *TokenTransferEvent) GetClawback() *Clawback { + if x != nil { + if x, ok := x.Event.(*TokenTransferEvent_Clawback); ok { + return x.Clawback + } + } + return nil +} + +func (x *TokenTransferEvent) GetFee() *Fee { + if x != nil { + if x, ok := x.Event.(*TokenTransferEvent_Fee); ok { + return x.Fee + } + } + return nil +} + +type isTokenTransferEvent_Event interface { + isTokenTransferEvent_Event() +} + +type TokenTransferEvent_Transfer struct { + Transfer *Transfer `protobuf:"bytes,2,opt,name=transfer,proto3,oneof"` +} + +type TokenTransferEvent_Mint struct { + Mint *Mint `protobuf:"bytes,3,opt,name=mint,proto3,oneof"` +} + +type TokenTransferEvent_Burn struct { + Burn *Burn `protobuf:"bytes,4,opt,name=burn,proto3,oneof"` +} + +type TokenTransferEvent_Clawback struct { + Clawback *Clawback `protobuf:"bytes,5,opt,name=clawback,proto3,oneof"` +} + +type TokenTransferEvent_Fee struct { + Fee *Fee `protobuf:"bytes,6,opt,name=fee,proto3,oneof"` +} + +func (*TokenTransferEvent_Transfer) isTokenTransferEvent_Event() {} + +func (*TokenTransferEvent_Mint) isTokenTransferEvent_Event() {} + +func (*TokenTransferEvent_Burn) isTokenTransferEvent_Event() {} + +func (*TokenTransferEvent_Clawback) isTokenTransferEvent_Event() {} + +func (*TokenTransferEvent_Fee) isTokenTransferEvent_Event() {} + +// TokenTransferBatch represents a batch of token transfer events from a single ledger +type TokenTransferBatch struct { + state protoimpl.MessageState `protogen:"open.v1"` + Events []*TokenTransferEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TokenTransferBatch) Reset() { + *x = TokenTransferBatch{} + mi := &file_stellar_v1_token_transfers_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TokenTransferBatch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenTransferBatch) ProtoMessage() {} + +func (x *TokenTransferBatch) ProtoReflect() protoreflect.Message { + mi := &file_stellar_v1_token_transfers_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokenTransferBatch.ProtoReflect.Descriptor instead. +func (*TokenTransferBatch) Descriptor() ([]byte, []int) { + return file_stellar_v1_token_transfers_proto_rawDescGZIP(), []int{9} +} + +func (x *TokenTransferBatch) GetEvents() []*TokenTransferEvent { + if x != nil { + return x.Events + } + return nil +} + +var File_stellar_v1_token_transfers_proto protoreflect.FileDescriptor + +const file_stellar_v1_token_transfers_proto_rawDesc = "" + + "\n" + + " stellar/v1/token_transfers.proto\x12\n" + + "stellar.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xad\x02\n" + + "\x16TokenTransferEventMeta\x12'\n" + + "\x0fledger_sequence\x18\x01 \x01(\rR\x0eledgerSequence\x127\n" + + "\tclosed_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\bclosedAt\x12\x17\n" + + "\atx_hash\x18\x03 \x01(\tR\x06txHash\x12+\n" + + "\x11transaction_index\x18\x04 \x01(\rR\x10transactionIndex\x12,\n" + + "\x0foperation_index\x18\x05 \x01(\rH\x00R\x0eoperationIndex\x88\x01\x01\x12)\n" + + "\x10contract_address\x18\x06 \x01(\tR\x0fcontractAddressB\x12\n" + + "\x10_operation_index\"\x80\x01\n" + + "\x05Asset\x12\x18\n" + + "\x06native\x18\x01 \x01(\bH\x00R\x06native\x121\n" + + "\x06issued\x18\x02 \x01(\v2\x17.stellar.v1.IssuedAssetH\x00R\x06issued\x12!\n" + + "\vcontract_id\x18\x03 \x01(\tH\x00R\n" + + "contractIdB\a\n" + + "\x05asset\"O\n" + + "\vIssuedAsset\x12\x1d\n" + + "\n" + + "asset_code\x18\x01 \x01(\tR\tassetCode\x12!\n" + + "\fasset_issuer\x18\x02 \x01(\tR\vassetIssuer\"o\n" + + "\bTransfer\x12\x12\n" + + "\x04from\x18\x01 \x01(\tR\x04from\x12\x0e\n" + + "\x02to\x18\x02 \x01(\tR\x02to\x12'\n" + + "\x05asset\x18\x03 \x01(\v2\x11.stellar.v1.AssetR\x05asset\x12\x16\n" + + "\x06amount\x18\x04 \x01(\tR\x06amount\"W\n" + + "\x04Mint\x12\x0e\n" + + "\x02to\x18\x01 \x01(\tR\x02to\x12'\n" + + "\x05asset\x18\x02 \x01(\v2\x11.stellar.v1.AssetR\x05asset\x12\x16\n" + + "\x06amount\x18\x03 \x01(\tR\x06amount\"[\n" + + "\x04Burn\x12\x12\n" + + "\x04from\x18\x01 \x01(\tR\x04from\x12'\n" + + "\x05asset\x18\x02 \x01(\v2\x11.stellar.v1.AssetR\x05asset\x12\x16\n" + + "\x06amount\x18\x03 \x01(\tR\x06amount\"_\n" + + "\bClawback\x12\x12\n" + + "\x04from\x18\x01 \x01(\tR\x04from\x12'\n" + + "\x05asset\x18\x02 \x01(\v2\x11.stellar.v1.AssetR\x05asset\x12\x16\n" + + "\x06amount\x18\x03 \x01(\tR\x06amount\"Z\n" + + "\x03Fee\x12\x12\n" + + "\x04from\x18\x01 \x01(\tR\x04from\x12'\n" + + "\x05asset\x18\x02 \x01(\v2\x11.stellar.v1.AssetR\x05asset\x12\x16\n" + + "\x06amount\x18\x03 \x01(\tR\x06amount\"\xb2\x02\n" + + "\x12TokenTransferEvent\x126\n" + + "\x04meta\x18\x01 \x01(\v2\".stellar.v1.TokenTransferEventMetaR\x04meta\x122\n" + + "\btransfer\x18\x02 \x01(\v2\x14.stellar.v1.TransferH\x00R\btransfer\x12&\n" + + "\x04mint\x18\x03 \x01(\v2\x10.stellar.v1.MintH\x00R\x04mint\x12&\n" + + "\x04burn\x18\x04 \x01(\v2\x10.stellar.v1.BurnH\x00R\x04burn\x122\n" + + "\bclawback\x18\x05 \x01(\v2\x14.stellar.v1.ClawbackH\x00R\bclawback\x12#\n" + + "\x03fee\x18\x06 \x01(\v2\x0f.stellar.v1.FeeH\x00R\x03feeB\a\n" + + "\x05event\"L\n" + + "\x12TokenTransferBatch\x126\n" + + "\x06events\x18\x01 \x03(\v2\x1e.stellar.v1.TokenTransferEventR\x06eventsB>Z google.protobuf.Timestamp + 2, // 1: stellar.v1.Asset.issued:type_name -> stellar.v1.IssuedAsset + 1, // 2: stellar.v1.Transfer.asset:type_name -> stellar.v1.Asset + 1, // 3: stellar.v1.Mint.asset:type_name -> stellar.v1.Asset + 1, // 4: stellar.v1.Burn.asset:type_name -> stellar.v1.Asset + 1, // 5: stellar.v1.Clawback.asset:type_name -> stellar.v1.Asset + 1, // 6: stellar.v1.Fee.asset:type_name -> stellar.v1.Asset + 0, // 7: stellar.v1.TokenTransferEvent.meta:type_name -> stellar.v1.TokenTransferEventMeta + 3, // 8: stellar.v1.TokenTransferEvent.transfer:type_name -> stellar.v1.Transfer + 4, // 9: stellar.v1.TokenTransferEvent.mint:type_name -> stellar.v1.Mint + 5, // 10: stellar.v1.TokenTransferEvent.burn:type_name -> stellar.v1.Burn + 6, // 11: stellar.v1.TokenTransferEvent.clawback:type_name -> stellar.v1.Clawback + 7, // 12: stellar.v1.TokenTransferEvent.fee:type_name -> stellar.v1.Fee + 8, // 13: stellar.v1.TokenTransferBatch.events:type_name -> stellar.v1.TokenTransferEvent + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_stellar_v1_token_transfers_proto_init() } +func file_stellar_v1_token_transfers_proto_init() { + if File_stellar_v1_token_transfers_proto != nil { + return + } + file_stellar_v1_token_transfers_proto_msgTypes[0].OneofWrappers = []any{} + file_stellar_v1_token_transfers_proto_msgTypes[1].OneofWrappers = []any{ + (*Asset_Native)(nil), + (*Asset_Issued)(nil), + (*Asset_ContractId)(nil), + } + file_stellar_v1_token_transfers_proto_msgTypes[8].OneofWrappers = []any{ + (*TokenTransferEvent_Transfer)(nil), + (*TokenTransferEvent_Mint)(nil), + (*TokenTransferEvent_Burn)(nil), + (*TokenTransferEvent_Clawback)(nil), + (*TokenTransferEvent_Fee)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stellar_v1_token_transfers_proto_rawDesc), len(file_stellar_v1_token_transfers_proto_rawDesc)), + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_stellar_v1_token_transfers_proto_goTypes, + DependencyIndexes: file_stellar_v1_token_transfers_proto_depIdxs, + MessageInfos: file_stellar_v1_token_transfers_proto_msgTypes, + }.Build() + File_stellar_v1_token_transfers_proto = out.File + file_stellar_v1_token_transfers_proto_goTypes = nil + file_stellar_v1_token_transfers_proto_depIdxs = nil +} diff --git a/proto/stellar/v1/contract_events.proto b/proto/stellar/v1/contract_events.proto index efa8d9a..b0af09f 100644 --- a/proto/stellar/v1/contract_events.proto +++ b/proto/stellar/v1/contract_events.proto @@ -60,3 +60,8 @@ message GetContractEventsRequest { bool include_failed = 5; // Include events from failed transactions bool include_diagnostics = 6; // Include diagnostic events } + +// ContractEventBatch represents a batch of contract events from a single ledger +message ContractEventBatch { + repeated ContractEvent events = 1; +} diff --git a/proto/stellar/v1/token_transfers.proto b/proto/stellar/v1/token_transfers.proto new file mode 100644 index 0000000..27e6012 --- /dev/null +++ b/proto/stellar/v1/token_transfers.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; + +package stellar.v1; + +option go_package = "github.com/withObsrvr/flow-proto/go/gen/stellar/v1;stellarv1"; + +import "google/protobuf/timestamp.proto"; + +// TokenTransfer events follow SEP-41 (Token Transfer Events) +// These events represent token movements on Stellar (native, issued assets, and Soroban tokens) + +// EventMeta contains metadata about the token transfer event +message TokenTransferEventMeta { + uint32 ledger_sequence = 1; + google.protobuf.Timestamp closed_at = 2; + string tx_hash = 3; + uint32 transaction_index = 4; // 1-indexed as per SEP-35 + optional uint32 operation_index = 5; // 1-indexed as per SEP-35, optional for contract events + string contract_address = 6; // ContractID derived from asset or emitting contract +} + +// Asset represents a Stellar asset (native, issued, or custom/Soroban) +message Asset { + oneof asset { + // Native XLM + bool native = 1; + + // Issued asset (classic Stellar asset) + IssuedAsset issued = 2; + + // Custom/Soroban asset (contract-based) + string contract_id = 3; + } +} + +message IssuedAsset { + string asset_code = 1; + string asset_issuer = 2; +} + +// Transfer represents a token transfer from one account to another +message Transfer { + string from = 1; // Strkey representation + string to = 2; // Strkey representation + Asset asset = 3; + string amount = 4; // String representation for precision +} + +// Mint represents token creation/minting +message Mint { + string to = 1; // Strkey representation + Asset asset = 2; + string amount = 3; +} + +// Burn represents token destruction/burning +message Burn { + string from = 1; // Strkey representation + Asset asset = 2; + string amount = 3; +} + +// Clawback represents asset clawback by issuer +message Clawback { + string from = 1; // Strkey representation + Asset asset = 2; + string amount = 3; +} + +// Fee represents transaction fee payment +message Fee { + string from = 1; // Strkey representation + Asset asset = 2; + string amount = 3; +} + +// TokenTransferEvent represents a single token transfer event +message TokenTransferEvent { + TokenTransferEventMeta meta = 1; + + oneof event { + Transfer transfer = 2; + Mint mint = 3; + Burn burn = 4; + Clawback clawback = 5; + Fee fee = 6; + } +} + +// TokenTransferBatch represents a batch of token transfer events from a single ledger +message TokenTransferBatch { + repeated TokenTransferEvent events = 1; +}