diff --git a/.github/workflows/validate-protos-version.yml b/.github/workflows/validate-protos-version.yml index 854c2a6b..0e6ca167 100644 --- a/.github/workflows/validate-protos-version.yml +++ b/.github/workflows/validate-protos-version.yml @@ -5,10 +5,11 @@ on: branches: - capabilities-development pull_request: + branches: + - capabilities-development jobs: validate-protos-version: - if: github.event_name == 'push' || github.base_ref == 'capabilities-development' permissions: contents: read runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index f702faf6..407e4d93 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ update-capabilities: # Override if you wish to test against a branch. # Alternatively, you can override the directory in chainlink-common to point to this repository -COMMON_VERSION ?= cre-std-tests@0.6.0 +COMMON_VERSION ?= f0dfd6b71e78f7e21b85d55d7a858b02b7459024 MODULE := github.com/smartcontractkit/chainlink-common # Override on Windows if you aren't using a Unix-like shell: diff --git a/capabilities/blockchain/aptos/client.pb.go b/capabilities/blockchain/aptos/client.pb.go new file mode 100644 index 00000000..8770a267 --- /dev/null +++ b/capabilities/blockchain/aptos/client.pb.go @@ -0,0 +1,1592 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v5.29.3 +// source: capabilities/blockchain/aptos/v1alpha/client.proto + +package aptos + +import ( + sdk "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" + _ "github.com/smartcontractkit/chainlink-protos/cre/go/tools/generator" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + 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) +) + +// Transaction execution status returned by the forwarder. +type TxStatus int32 + +const ( + TxStatus_TX_STATUS_FATAL TxStatus = 0 // unrecoverable failure + TxStatus_TX_STATUS_ABORTED TxStatus = 1 // not executed / dropped + TxStatus_TX_STATUS_SUCCESS TxStatus = 2 // executed successfully +) + +// Enum value maps for TxStatus. +var ( + TxStatus_name = map[int32]string{ + 0: "TX_STATUS_FATAL", + 1: "TX_STATUS_ABORTED", + 2: "TX_STATUS_SUCCESS", + } + TxStatus_value = map[string]int32{ + "TX_STATUS_FATAL": 0, + "TX_STATUS_ABORTED": 1, + "TX_STATUS_SUCCESS": 2, + } +) + +func (x TxStatus) Enum() *TxStatus { + p := new(TxStatus) + *p = x + return p +} + +func (x TxStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TxStatus) Descriptor() protoreflect.EnumDescriptor { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_enumTypes[0].Descriptor() +} + +func (TxStatus) Type() protoreflect.EnumType { + return &file_capabilities_blockchain_aptos_v1alpha_client_proto_enumTypes[0] +} + +func (x TxStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TxStatus.Descriptor instead. +func (TxStatus) EnumDescriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{0} +} + +type TypeTagKind int32 + +const ( + TypeTagKind_TYPE_TAG_KIND_BOOL TypeTagKind = 0 + TypeTagKind_TYPE_TAG_KIND_U8 TypeTagKind = 1 + TypeTagKind_TYPE_TAG_KIND_U16 TypeTagKind = 2 + TypeTagKind_TYPE_TAG_KIND_U32 TypeTagKind = 3 + TypeTagKind_TYPE_TAG_KIND_U64 TypeTagKind = 4 + TypeTagKind_TYPE_TAG_KIND_U128 TypeTagKind = 5 + TypeTagKind_TYPE_TAG_KIND_U256 TypeTagKind = 6 + TypeTagKind_TYPE_TAG_KIND_ADDRESS TypeTagKind = 7 + TypeTagKind_TYPE_TAG_KIND_SIGNER TypeTagKind = 8 + TypeTagKind_TYPE_TAG_KIND_VECTOR TypeTagKind = 9 + TypeTagKind_TYPE_TAG_KIND_STRUCT TypeTagKind = 10 + TypeTagKind_TYPE_TAG_KIND_GENERIC TypeTagKind = 11 +) + +// Enum value maps for TypeTagKind. +var ( + TypeTagKind_name = map[int32]string{ + 0: "TYPE_TAG_KIND_BOOL", + 1: "TYPE_TAG_KIND_U8", + 2: "TYPE_TAG_KIND_U16", + 3: "TYPE_TAG_KIND_U32", + 4: "TYPE_TAG_KIND_U64", + 5: "TYPE_TAG_KIND_U128", + 6: "TYPE_TAG_KIND_U256", + 7: "TYPE_TAG_KIND_ADDRESS", + 8: "TYPE_TAG_KIND_SIGNER", + 9: "TYPE_TAG_KIND_VECTOR", + 10: "TYPE_TAG_KIND_STRUCT", + 11: "TYPE_TAG_KIND_GENERIC", + } + TypeTagKind_value = map[string]int32{ + "TYPE_TAG_KIND_BOOL": 0, + "TYPE_TAG_KIND_U8": 1, + "TYPE_TAG_KIND_U16": 2, + "TYPE_TAG_KIND_U32": 3, + "TYPE_TAG_KIND_U64": 4, + "TYPE_TAG_KIND_U128": 5, + "TYPE_TAG_KIND_U256": 6, + "TYPE_TAG_KIND_ADDRESS": 7, + "TYPE_TAG_KIND_SIGNER": 8, + "TYPE_TAG_KIND_VECTOR": 9, + "TYPE_TAG_KIND_STRUCT": 10, + "TYPE_TAG_KIND_GENERIC": 11, + } +) + +func (x TypeTagKind) Enum() *TypeTagKind { + p := new(TypeTagKind) + *p = x + return p +} + +func (x TypeTagKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TypeTagKind) Descriptor() protoreflect.EnumDescriptor { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_enumTypes[1].Descriptor() +} + +func (TypeTagKind) Type() protoreflect.EnumType { + return &file_capabilities_blockchain_aptos_v1alpha_client_proto_enumTypes[1] +} + +func (x TypeTagKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TypeTagKind.Descriptor instead. +func (TypeTagKind) EnumDescriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{1} +} + +type TransactionVariant int32 + +const ( + TransactionVariant_TRANSACTION_VARIANT_PENDING TransactionVariant = 0 + TransactionVariant_TRANSACTION_VARIANT_USER TransactionVariant = 1 + TransactionVariant_TRANSACTION_VARIANT_GENESIS TransactionVariant = 2 + TransactionVariant_TRANSACTION_VARIANT_BLOCK_METADATA TransactionVariant = 3 + TransactionVariant_TRANSACTION_VARIANT_BLOCK_EPILOGUE TransactionVariant = 4 + TransactionVariant_TRANSACTION_VARIANT_STATE_CHECKPOINT TransactionVariant = 5 + TransactionVariant_TRANSACTION_VARIANT_VALIDATOR TransactionVariant = 6 + TransactionVariant_TRANSACTION_VARIANT_UNKNOWN TransactionVariant = 7 +) + +// Enum value maps for TransactionVariant. +var ( + TransactionVariant_name = map[int32]string{ + 0: "TRANSACTION_VARIANT_PENDING", + 1: "TRANSACTION_VARIANT_USER", + 2: "TRANSACTION_VARIANT_GENESIS", + 3: "TRANSACTION_VARIANT_BLOCK_METADATA", + 4: "TRANSACTION_VARIANT_BLOCK_EPILOGUE", + 5: "TRANSACTION_VARIANT_STATE_CHECKPOINT", + 6: "TRANSACTION_VARIANT_VALIDATOR", + 7: "TRANSACTION_VARIANT_UNKNOWN", + } + TransactionVariant_value = map[string]int32{ + "TRANSACTION_VARIANT_PENDING": 0, + "TRANSACTION_VARIANT_USER": 1, + "TRANSACTION_VARIANT_GENESIS": 2, + "TRANSACTION_VARIANT_BLOCK_METADATA": 3, + "TRANSACTION_VARIANT_BLOCK_EPILOGUE": 4, + "TRANSACTION_VARIANT_STATE_CHECKPOINT": 5, + "TRANSACTION_VARIANT_VALIDATOR": 6, + "TRANSACTION_VARIANT_UNKNOWN": 7, + } +) + +func (x TransactionVariant) Enum() *TransactionVariant { + p := new(TransactionVariant) + *p = x + return p +} + +func (x TransactionVariant) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TransactionVariant) Descriptor() protoreflect.EnumDescriptor { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_enumTypes[2].Descriptor() +} + +func (TransactionVariant) Type() protoreflect.EnumType { + return &file_capabilities_blockchain_aptos_v1alpha_client_proto_enumTypes[2] +} + +func (x TransactionVariant) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TransactionVariant.Descriptor instead. +func (TransactionVariant) EnumDescriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{2} +} + +type AccountAPTBalanceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 32-byte address + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AccountAPTBalanceRequest) Reset() { + *x = AccountAPTBalanceRequest{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AccountAPTBalanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountAPTBalanceRequest) ProtoMessage() {} + +func (x *AccountAPTBalanceRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_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 AccountAPTBalanceRequest.ProtoReflect.Descriptor instead. +func (*AccountAPTBalanceRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{0} +} + +func (x *AccountAPTBalanceRequest) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +type AccountAPTBalanceReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AccountAPTBalanceReply) Reset() { + *x = AccountAPTBalanceReply{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AccountAPTBalanceReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountAPTBalanceReply) ProtoMessage() {} + +func (x *AccountAPTBalanceReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_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 AccountAPTBalanceReply.ProtoReflect.Descriptor instead. +func (*AccountAPTBalanceReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{1} +} + +func (x *AccountAPTBalanceReply) GetValue() uint64 { + if x != nil { + return x.Value + } + return 0 +} + +type ViewRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Payload *ViewPayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + LedgerVersion *uint64 `protobuf:"varint,2,opt,name=ledger_version,json=ledgerVersion,proto3,oneof" json:"ledger_version,omitempty"` // nil means use latest ledger version + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ViewRequest) Reset() { + *x = ViewRequest{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ViewRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ViewRequest) ProtoMessage() {} + +func (x *ViewRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_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 ViewRequest.ProtoReflect.Descriptor instead. +func (*ViewRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{2} +} + +func (x *ViewRequest) GetPayload() *ViewPayload { + if x != nil { + return x.Payload + } + return nil +} + +func (x *ViewRequest) GetLedgerVersion() uint64 { + if x != nil && x.LedgerVersion != nil { + return *x.LedgerVersion + } + return 0 +} + +type ViewReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ViewReply) Reset() { + *x = ViewReply{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ViewReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ViewReply) ProtoMessage() {} + +func (x *ViewReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_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 ViewReply.ProtoReflect.Descriptor instead. +func (*ViewReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{3} +} + +func (x *ViewReply) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type ViewPayload struct { + state protoimpl.MessageState `protogen:"open.v1"` + Module *ModuleID `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` + Function string `protobuf:"bytes,2,opt,name=function,proto3" json:"function,omitempty"` + ArgTypes []*TypeTag `protobuf:"bytes,3,rep,name=arg_types,json=argTypes,proto3" json:"arg_types,omitempty"` + Args [][]byte `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ViewPayload) Reset() { + *x = ViewPayload{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ViewPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ViewPayload) ProtoMessage() {} + +func (x *ViewPayload) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_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 ViewPayload.ProtoReflect.Descriptor instead. +func (*ViewPayload) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{4} +} + +func (x *ViewPayload) GetModule() *ModuleID { + if x != nil { + return x.Module + } + return nil +} + +func (x *ViewPayload) GetFunction() string { + if x != nil { + return x.Function + } + return "" +} + +func (x *ViewPayload) GetArgTypes() []*TypeTag { + if x != nil { + return x.ArgTypes + } + return nil +} + +func (x *ViewPayload) GetArgs() [][]byte { + if x != nil { + return x.Args + } + return nil +} + +type ModuleID struct { + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 32-byte address + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ModuleID) Reset() { + *x = ModuleID{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ModuleID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModuleID) ProtoMessage() {} + +func (x *ModuleID) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_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 ModuleID.ProtoReflect.Descriptor instead. +func (*ModuleID) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{5} +} + +func (x *ModuleID) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *ModuleID) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type TypeTag struct { + state protoimpl.MessageState `protogen:"open.v1"` + Kind TypeTagKind `protobuf:"varint,1,opt,name=kind,proto3,enum=capabilities.blockchain.aptos.v1alpha.TypeTagKind" json:"kind,omitempty"` + // Types that are valid to be assigned to Value: + // + // *TypeTag_Vector + // *TypeTag_Struct + // *TypeTag_Generic + Value isTypeTag_Value `protobuf_oneof:"value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TypeTag) Reset() { + *x = TypeTag{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TypeTag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TypeTag) ProtoMessage() {} + +func (x *TypeTag) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_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 TypeTag.ProtoReflect.Descriptor instead. +func (*TypeTag) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{6} +} + +func (x *TypeTag) GetKind() TypeTagKind { + if x != nil { + return x.Kind + } + return TypeTagKind_TYPE_TAG_KIND_BOOL +} + +func (x *TypeTag) GetValue() isTypeTag_Value { + if x != nil { + return x.Value + } + return nil +} + +func (x *TypeTag) GetVector() *VectorTag { + if x != nil { + if x, ok := x.Value.(*TypeTag_Vector); ok { + return x.Vector + } + } + return nil +} + +func (x *TypeTag) GetStruct() *StructTag { + if x != nil { + if x, ok := x.Value.(*TypeTag_Struct); ok { + return x.Struct + } + } + return nil +} + +func (x *TypeTag) GetGeneric() *GenericTag { + if x != nil { + if x, ok := x.Value.(*TypeTag_Generic); ok { + return x.Generic + } + } + return nil +} + +type isTypeTag_Value interface { + isTypeTag_Value() +} + +type TypeTag_Vector struct { + Vector *VectorTag `protobuf:"bytes,2,opt,name=vector,proto3,oneof"` +} + +type TypeTag_Struct struct { + Struct *StructTag `protobuf:"bytes,3,opt,name=struct,proto3,oneof"` +} + +type TypeTag_Generic struct { + Generic *GenericTag `protobuf:"bytes,4,opt,name=generic,proto3,oneof"` +} + +func (*TypeTag_Vector) isTypeTag_Value() {} + +func (*TypeTag_Struct) isTypeTag_Value() {} + +func (*TypeTag_Generic) isTypeTag_Value() {} + +type VectorTag struct { + state protoimpl.MessageState `protogen:"open.v1"` + ElementType *TypeTag `protobuf:"bytes,1,opt,name=element_type,json=elementType,proto3" json:"element_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VectorTag) Reset() { + *x = VectorTag{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VectorTag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VectorTag) ProtoMessage() {} + +func (x *VectorTag) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_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 VectorTag.ProtoReflect.Descriptor instead. +func (*VectorTag) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{7} +} + +func (x *VectorTag) GetElementType() *TypeTag { + if x != nil { + return x.ElementType + } + return nil +} + +type StructTag struct { + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 32-byte address + Module string `protobuf:"bytes,2,opt,name=module,proto3" json:"module,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + TypeParams []*TypeTag `protobuf:"bytes,4,rep,name=type_params,json=typeParams,proto3" json:"type_params,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StructTag) Reset() { + *x = StructTag{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StructTag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StructTag) ProtoMessage() {} + +func (x *StructTag) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_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 StructTag.ProtoReflect.Descriptor instead. +func (*StructTag) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{8} +} + +func (x *StructTag) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *StructTag) GetModule() string { + if x != nil { + return x.Module + } + return "" +} + +func (x *StructTag) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *StructTag) GetTypeParams() []*TypeTag { + if x != nil { + return x.TypeParams + } + return nil +} + +type GenericTag struct { + state protoimpl.MessageState `protogen:"open.v1"` + Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GenericTag) Reset() { + *x = GenericTag{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GenericTag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenericTag) ProtoMessage() {} + +func (x *GenericTag) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_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 GenericTag.ProtoReflect.Descriptor instead. +func (*GenericTag) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{9} +} + +func (x *GenericTag) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} + +type TransactionByHashRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // Transaction hash (hex string with 0x prefix) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransactionByHashRequest) Reset() { + *x = TransactionByHashRequest{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransactionByHashRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionByHashRequest) ProtoMessage() {} + +func (x *TransactionByHashRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[10] + 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 TransactionByHashRequest.ProtoReflect.Descriptor instead. +func (*TransactionByHashRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{10} +} + +func (x *TransactionByHashRequest) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + +type TransactionByHashReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3,oneof" json:"transaction,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransactionByHashReply) Reset() { + *x = TransactionByHashReply{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransactionByHashReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionByHashReply) ProtoMessage() {} + +func (x *TransactionByHashReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[11] + 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 TransactionByHashReply.ProtoReflect.Descriptor instead. +func (*TransactionByHashReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{11} +} + +func (x *TransactionByHashReply) GetTransaction() *Transaction { + if x != nil { + return x.Transaction + } + return nil +} + +type Transaction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type TransactionVariant `protobuf:"varint,1,opt,name=type,proto3,enum=capabilities.blockchain.aptos.v1alpha.TransactionVariant" json:"type,omitempty"` + Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` + Version *uint64 `protobuf:"varint,3,opt,name=version,proto3,oneof" json:"version,omitempty"` // nil for pending transactions + Success *bool `protobuf:"varint,4,opt,name=success,proto3,oneof" json:"success,omitempty"` // nil for pending/genesis transactions + Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` // Raw transaction data + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Transaction) Reset() { + *x = Transaction{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Transaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Transaction) ProtoMessage() {} + +func (x *Transaction) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[12] + 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 Transaction.ProtoReflect.Descriptor instead. +func (*Transaction) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{12} +} + +func (x *Transaction) GetType() TransactionVariant { + if x != nil { + return x.Type + } + return TransactionVariant_TRANSACTION_VARIANT_PENDING +} + +func (x *Transaction) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + +func (x *Transaction) GetVersion() uint64 { + if x != nil && x.Version != nil { + return *x.Version + } + return 0 +} + +func (x *Transaction) GetSuccess() bool { + if x != nil && x.Success != nil { + return *x.Success + } + return false +} + +func (x *Transaction) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type AccountTransactionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 32-byte address + Start *uint64 `protobuf:"varint,2,opt,name=start,proto3,oneof" json:"start,omitempty"` // Starting version number; nil for most recent + Limit *uint64 `protobuf:"varint,3,opt,name=limit,proto3,oneof" json:"limit,omitempty"` // Number of transactions to return; nil for default (~100) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AccountTransactionsRequest) Reset() { + *x = AccountTransactionsRequest{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AccountTransactionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountTransactionsRequest) ProtoMessage() {} + +func (x *AccountTransactionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[13] + 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 AccountTransactionsRequest.ProtoReflect.Descriptor instead. +func (*AccountTransactionsRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{13} +} + +func (x *AccountTransactionsRequest) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *AccountTransactionsRequest) GetStart() uint64 { + if x != nil && x.Start != nil { + return *x.Start + } + return 0 +} + +func (x *AccountTransactionsRequest) GetLimit() uint64 { + if x != nil && x.Limit != nil { + return *x.Limit + } + return 0 +} + +type AccountTransactionsReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Transactions []*Transaction `protobuf:"bytes,1,rep,name=transactions,proto3" json:"transactions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AccountTransactionsReply) Reset() { + *x = AccountTransactionsReply{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AccountTransactionsReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountTransactionsReply) ProtoMessage() {} + +func (x *AccountTransactionsReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[14] + 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 AccountTransactionsReply.ProtoReflect.Descriptor instead. +func (*AccountTransactionsReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{14} +} + +func (x *AccountTransactionsReply) GetTransactions() []*Transaction { + if x != nil { + return x.Transactions + } + return nil +} + +type SubmitTransactionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ReceiverModuleId *ModuleID `protobuf:"bytes,1,opt,name=receiver_module_id,json=receiverModuleId,proto3" json:"receiver_module_id,omitempty"` + EncodedPayload []byte `protobuf:"bytes,2,opt,name=encoded_payload,json=encodedPayload,proto3" json:"encoded_payload,omitempty"` + GasConfig *GasConfig `protobuf:"bytes,3,opt,name=gas_config,json=gasConfig,proto3,oneof" json:"gas_config,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SubmitTransactionRequest) Reset() { + *x = SubmitTransactionRequest{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SubmitTransactionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitTransactionRequest) ProtoMessage() {} + +func (x *SubmitTransactionRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[15] + 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 SubmitTransactionRequest.ProtoReflect.Descriptor instead. +func (*SubmitTransactionRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{15} +} + +func (x *SubmitTransactionRequest) GetReceiverModuleId() *ModuleID { + if x != nil { + return x.ReceiverModuleId + } + return nil +} + +func (x *SubmitTransactionRequest) GetEncodedPayload() []byte { + if x != nil { + return x.EncodedPayload + } + return nil +} + +func (x *SubmitTransactionRequest) GetGasConfig() *GasConfig { + if x != nil { + return x.GasConfig + } + return nil +} + +type SubmitTransactionReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + TxStatus TxStatus `protobuf:"varint,1,opt,name=tx_status,json=txStatus,proto3,enum=capabilities.blockchain.aptos.v1alpha.TxStatus" json:"tx_status,omitempty"` + TxHash string `protobuf:"bytes,2,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` + TxIdempotencyKey string `protobuf:"bytes,3,opt,name=tx_idempotency_key,json=txIdempotencyKey,proto3" json:"tx_idempotency_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SubmitTransactionReply) Reset() { + *x = SubmitTransactionReply{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SubmitTransactionReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitTransactionReply) ProtoMessage() {} + +func (x *SubmitTransactionReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[16] + 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 SubmitTransactionReply.ProtoReflect.Descriptor instead. +func (*SubmitTransactionReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{16} +} + +func (x *SubmitTransactionReply) GetTxStatus() TxStatus { + if x != nil { + return x.TxStatus + } + return TxStatus_TX_STATUS_FATAL +} + +func (x *SubmitTransactionReply) GetTxHash() string { + if x != nil { + return x.TxHash + } + return "" +} + +func (x *SubmitTransactionReply) GetTxIdempotencyKey() string { + if x != nil { + return x.TxIdempotencyKey + } + return "" +} + +type GasConfig struct { + state protoimpl.MessageState `protogen:"open.v1"` + MaxGasAmount uint64 `protobuf:"varint,1,opt,name=max_gas_amount,json=maxGasAmount,proto3" json:"max_gas_amount,omitempty"` // Maximum gas units willing to pay + GasUnitPrice uint64 `protobuf:"varint,2,opt,name=gas_unit_price,json=gasUnitPrice,proto3" json:"gas_unit_price,omitempty"` // Price per gas unit in octas + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GasConfig) Reset() { + *x = GasConfig{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GasConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GasConfig) ProtoMessage() {} + +func (x *GasConfig) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[17] + 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 GasConfig.ProtoReflect.Descriptor instead. +func (*GasConfig) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{17} +} + +func (x *GasConfig) GetMaxGasAmount() uint64 { + if x != nil { + return x.MaxGasAmount + } + return 0 +} + +func (x *GasConfig) GetGasUnitPrice() uint64 { + if x != nil { + return x.GasUnitPrice + } + return 0 +} + +type WriteReportRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Receiver []byte `protobuf:"bytes,1,opt,name=receiver,proto3" json:"receiver,omitempty"` // 32-byte Aptos account address of the receiver module + GasConfig *GasConfig `protobuf:"bytes,2,opt,name=gas_config,json=gasConfig,proto3,oneof" json:"gas_config,omitempty"` // optional gas configuration + Report *sdk.ReportResponse `protobuf:"bytes,3,opt,name=report,proto3" json:"report,omitempty"` // signed report from consensus + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteReportRequest) Reset() { + *x = WriteReportRequest{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteReportRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteReportRequest) ProtoMessage() {} + +func (x *WriteReportRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[18] + 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 WriteReportRequest.ProtoReflect.Descriptor instead. +func (*WriteReportRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{18} +} + +func (x *WriteReportRequest) GetReceiver() []byte { + if x != nil { + return x.Receiver + } + return nil +} + +func (x *WriteReportRequest) GetGasConfig() *GasConfig { + if x != nil { + return x.GasConfig + } + return nil +} + +func (x *WriteReportRequest) GetReport() *sdk.ReportResponse { + if x != nil { + return x.Report + } + return nil +} + +type WriteReportReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + TxStatus TxStatus `protobuf:"varint,1,opt,name=tx_status,json=txStatus,proto3,enum=capabilities.blockchain.aptos.v1alpha.TxStatus" json:"tx_status,omitempty"` + TxHash *string `protobuf:"bytes,2,opt,name=tx_hash,json=txHash,proto3,oneof" json:"tx_hash,omitempty"` // transaction hash (hex string with 0x prefix) + TransactionFee *uint64 `protobuf:"varint,3,opt,name=transaction_fee,json=transactionFee,proto3,oneof" json:"transaction_fee,omitempty"` // gas used in octas + ErrorMessage *string `protobuf:"bytes,4,opt,name=error_message,json=errorMessage,proto3,oneof" json:"error_message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteReportReply) Reset() { + *x = WriteReportReply{} + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteReportReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteReportReply) ProtoMessage() {} + +func (x *WriteReportReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[19] + 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 WriteReportReply.ProtoReflect.Descriptor instead. +func (*WriteReportReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP(), []int{19} +} + +func (x *WriteReportReply) GetTxStatus() TxStatus { + if x != nil { + return x.TxStatus + } + return TxStatus_TX_STATUS_FATAL +} + +func (x *WriteReportReply) GetTxHash() string { + if x != nil && x.TxHash != nil { + return *x.TxHash + } + return "" +} + +func (x *WriteReportReply) GetTransactionFee() uint64 { + if x != nil && x.TransactionFee != nil { + return *x.TransactionFee + } + return 0 +} + +func (x *WriteReportReply) GetErrorMessage() string { + if x != nil && x.ErrorMessage != nil { + return *x.ErrorMessage + } + return "" +} + +var File_capabilities_blockchain_aptos_v1alpha_client_proto protoreflect.FileDescriptor + +const file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDesc = "" + + "\n" + + "2capabilities/blockchain/aptos/v1alpha/client.proto\x12%capabilities.blockchain.aptos.v1alpha\x1a\x15sdk/v1alpha/sdk.proto\x1a*tools/generator/v1alpha/cre_metadata.proto\"4\n" + + "\x18AccountAPTBalanceRequest\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\".\n" + + "\x16AccountAPTBalanceReply\x12\x14\n" + + "\x05value\x18\x01 \x01(\x04R\x05value\"\x9a\x01\n" + + "\vViewRequest\x12L\n" + + "\apayload\x18\x01 \x01(\v22.capabilities.blockchain.aptos.v1alpha.ViewPayloadR\apayload\x12*\n" + + "\x0eledger_version\x18\x02 \x01(\x04H\x00R\rledgerVersion\x88\x01\x01B\x11\n" + + "\x0f_ledger_version\"\x1f\n" + + "\tViewReply\x12\x12\n" + + "\x04data\x18\x01 \x01(\fR\x04data\"\xd3\x01\n" + + "\vViewPayload\x12G\n" + + "\x06module\x18\x01 \x01(\v2/.capabilities.blockchain.aptos.v1alpha.ModuleIDR\x06module\x12\x1a\n" + + "\bfunction\x18\x02 \x01(\tR\bfunction\x12K\n" + + "\targ_types\x18\x03 \x03(\v2..capabilities.blockchain.aptos.v1alpha.TypeTagR\bargTypes\x12\x12\n" + + "\x04args\x18\x04 \x03(\fR\x04args\"8\n" + + "\bModuleID\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\"\xc1\x02\n" + + "\aTypeTag\x12F\n" + + "\x04kind\x18\x01 \x01(\x0e22.capabilities.blockchain.aptos.v1alpha.TypeTagKindR\x04kind\x12J\n" + + "\x06vector\x18\x02 \x01(\v20.capabilities.blockchain.aptos.v1alpha.VectorTagH\x00R\x06vector\x12J\n" + + "\x06struct\x18\x03 \x01(\v20.capabilities.blockchain.aptos.v1alpha.StructTagH\x00R\x06struct\x12M\n" + + "\ageneric\x18\x04 \x01(\v21.capabilities.blockchain.aptos.v1alpha.GenericTagH\x00R\agenericB\a\n" + + "\x05value\"^\n" + + "\tVectorTag\x12Q\n" + + "\felement_type\x18\x01 \x01(\v2..capabilities.blockchain.aptos.v1alpha.TypeTagR\velementType\"\xa2\x01\n" + + "\tStructTag\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x16\n" + + "\x06module\x18\x02 \x01(\tR\x06module\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12O\n" + + "\vtype_params\x18\x04 \x03(\v2..capabilities.blockchain.aptos.v1alpha.TypeTagR\n" + + "typeParams\"\"\n" + + "\n" + + "GenericTag\x12\x14\n" + + "\x05index\x18\x01 \x01(\rR\x05index\".\n" + + "\x18TransactionByHashRequest\x12\x12\n" + + "\x04hash\x18\x01 \x01(\tR\x04hash\"\x83\x01\n" + + "\x16TransactionByHashReply\x12Y\n" + + "\vtransaction\x18\x01 \x01(\v22.capabilities.blockchain.aptos.v1alpha.TransactionH\x00R\vtransaction\x88\x01\x01B\x0e\n" + + "\f_transaction\"\xda\x01\n" + + "\vTransaction\x12M\n" + + "\x04type\x18\x01 \x01(\x0e29.capabilities.blockchain.aptos.v1alpha.TransactionVariantR\x04type\x12\x12\n" + + "\x04hash\x18\x02 \x01(\tR\x04hash\x12\x1d\n" + + "\aversion\x18\x03 \x01(\x04H\x00R\aversion\x88\x01\x01\x12\x1d\n" + + "\asuccess\x18\x04 \x01(\bH\x01R\asuccess\x88\x01\x01\x12\x12\n" + + "\x04data\x18\x05 \x01(\fR\x04dataB\n" + + "\n" + + "\b_versionB\n" + + "\n" + + "\b_success\"\x80\x01\n" + + "\x1aAccountTransactionsRequest\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x19\n" + + "\x05start\x18\x02 \x01(\x04H\x00R\x05start\x88\x01\x01\x12\x19\n" + + "\x05limit\x18\x03 \x01(\x04H\x01R\x05limit\x88\x01\x01B\b\n" + + "\x06_startB\b\n" + + "\x06_limit\"r\n" + + "\x18AccountTransactionsReply\x12V\n" + + "\ftransactions\x18\x01 \x03(\v22.capabilities.blockchain.aptos.v1alpha.TransactionR\ftransactions\"\x87\x02\n" + + "\x18SubmitTransactionRequest\x12]\n" + + "\x12receiver_module_id\x18\x01 \x01(\v2/.capabilities.blockchain.aptos.v1alpha.ModuleIDR\x10receiverModuleId\x12'\n" + + "\x0fencoded_payload\x18\x02 \x01(\fR\x0eencodedPayload\x12T\n" + + "\n" + + "gas_config\x18\x03 \x01(\v20.capabilities.blockchain.aptos.v1alpha.GasConfigH\x00R\tgasConfig\x88\x01\x01B\r\n" + + "\v_gas_config\"\xad\x01\n" + + "\x16SubmitTransactionReply\x12L\n" + + "\ttx_status\x18\x01 \x01(\x0e2/.capabilities.blockchain.aptos.v1alpha.TxStatusR\btxStatus\x12\x17\n" + + "\atx_hash\x18\x02 \x01(\tR\x06txHash\x12,\n" + + "\x12tx_idempotency_key\x18\x03 \x01(\tR\x10txIdempotencyKey\"W\n" + + "\tGasConfig\x12$\n" + + "\x0emax_gas_amount\x18\x01 \x01(\x04R\fmaxGasAmount\x12$\n" + + "\x0egas_unit_price\x18\x02 \x01(\x04R\fgasUnitPrice\"\xca\x01\n" + + "\x12WriteReportRequest\x12\x1a\n" + + "\breceiver\x18\x01 \x01(\fR\breceiver\x12T\n" + + "\n" + + "gas_config\x18\x02 \x01(\v20.capabilities.blockchain.aptos.v1alpha.GasConfigH\x00R\tgasConfig\x88\x01\x01\x123\n" + + "\x06report\x18\x03 \x01(\v2\x1b.sdk.v1alpha.ReportResponseR\x06reportB\r\n" + + "\v_gas_config\"\x88\x02\n" + + "\x10WriteReportReply\x12L\n" + + "\ttx_status\x18\x01 \x01(\x0e2/.capabilities.blockchain.aptos.v1alpha.TxStatusR\btxStatus\x12\x1c\n" + + "\atx_hash\x18\x02 \x01(\tH\x00R\x06txHash\x88\x01\x01\x12,\n" + + "\x0ftransaction_fee\x18\x03 \x01(\x04H\x01R\x0etransactionFee\x88\x01\x01\x12(\n" + + "\rerror_message\x18\x04 \x01(\tH\x02R\ferrorMessage\x88\x01\x01B\n" + + "\n" + + "\b_tx_hashB\x12\n" + + "\x10_transaction_feeB\x10\n" + + "\x0e_error_message*M\n" + + "\bTxStatus\x12\x13\n" + + "\x0fTX_STATUS_FATAL\x10\x00\x12\x15\n" + + "\x11TX_STATUS_ABORTED\x10\x01\x12\x15\n" + + "\x11TX_STATUS_SUCCESS\x10\x02*\xb4\x02\n" + + "\vTypeTagKind\x12\x16\n" + + "\x12TYPE_TAG_KIND_BOOL\x10\x00\x12\x14\n" + + "\x10TYPE_TAG_KIND_U8\x10\x01\x12\x15\n" + + "\x11TYPE_TAG_KIND_U16\x10\x02\x12\x15\n" + + "\x11TYPE_TAG_KIND_U32\x10\x03\x12\x15\n" + + "\x11TYPE_TAG_KIND_U64\x10\x04\x12\x16\n" + + "\x12TYPE_TAG_KIND_U128\x10\x05\x12\x16\n" + + "\x12TYPE_TAG_KIND_U256\x10\x06\x12\x19\n" + + "\x15TYPE_TAG_KIND_ADDRESS\x10\a\x12\x18\n" + + "\x14TYPE_TAG_KIND_SIGNER\x10\b\x12\x18\n" + + "\x14TYPE_TAG_KIND_VECTOR\x10\t\x12\x18\n" + + "\x14TYPE_TAG_KIND_STRUCT\x10\n" + + "\x12\x19\n" + + "\x15TYPE_TAG_KIND_GENERIC\x10\v*\xb2\x02\n" + + "\x12TransactionVariant\x12\x1f\n" + + "\x1bTRANSACTION_VARIANT_PENDING\x10\x00\x12\x1c\n" + + "\x18TRANSACTION_VARIANT_USER\x10\x01\x12\x1f\n" + + "\x1bTRANSACTION_VARIANT_GENESIS\x10\x02\x12&\n" + + "\"TRANSACTION_VARIANT_BLOCK_METADATA\x10\x03\x12&\n" + + "\"TRANSACTION_VARIANT_BLOCK_EPILOGUE\x10\x04\x12(\n" + + "$TRANSACTION_VARIANT_STATE_CHECKPOINT\x10\x05\x12!\n" + + "\x1dTRANSACTION_VARIANT_VALIDATOR\x10\x06\x12\x1f\n" + + "\x1bTRANSACTION_VARIANT_UNKNOWN\x10\a2\xa2\x06\n" + + "\x06Client\x12\x93\x01\n" + + "\x11AccountAPTBalance\x12?.capabilities.blockchain.aptos.v1alpha.AccountAPTBalanceRequest\x1a=.capabilities.blockchain.aptos.v1alpha.AccountAPTBalanceReply\x12l\n" + + "\x04View\x122.capabilities.blockchain.aptos.v1alpha.ViewRequest\x1a0.capabilities.blockchain.aptos.v1alpha.ViewReply\x12\x93\x01\n" + + "\x11TransactionByHash\x12?.capabilities.blockchain.aptos.v1alpha.TransactionByHashRequest\x1a=.capabilities.blockchain.aptos.v1alpha.TransactionByHashReply\x12\x99\x01\n" + + "\x13AccountTransactions\x12A.capabilities.blockchain.aptos.v1alpha.AccountTransactionsRequest\x1a?.capabilities.blockchain.aptos.v1alpha.AccountTransactionsReply\x12\x81\x01\n" + + "\vWriteReport\x129.capabilities.blockchain.aptos.v1alpha.WriteReportRequest\x1a7.capabilities.blockchain.aptos.v1alpha.WriteReportReply\x1a^\x82\xb5\x18Z\b\x01\x12\vaptos@1.0.0\x1aI\n" + + "\rChainSelector\x128\x126\n" + + "\x19\n" + + "\raptos-mainnet\x10\ued42\x90\x9b\x99\xbd\xe6A\n" + + "\x19\n" + + "\raptos-testnet\x10\x95҆\x9e\xe3\xfd\x94\xa8\n" + + "b\x06proto3" + +var ( + file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescOnce sync.Once + file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescData []byte +) + +func file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescGZIP() []byte { + file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescOnce.Do(func() { + file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDesc), len(file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDesc))) + }) + return file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDescData +} + +var file_capabilities_blockchain_aptos_v1alpha_client_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_capabilities_blockchain_aptos_v1alpha_client_proto_goTypes = []any{ + (TxStatus)(0), // 0: capabilities.blockchain.aptos.v1alpha.TxStatus + (TypeTagKind)(0), // 1: capabilities.blockchain.aptos.v1alpha.TypeTagKind + (TransactionVariant)(0), // 2: capabilities.blockchain.aptos.v1alpha.TransactionVariant + (*AccountAPTBalanceRequest)(nil), // 3: capabilities.blockchain.aptos.v1alpha.AccountAPTBalanceRequest + (*AccountAPTBalanceReply)(nil), // 4: capabilities.blockchain.aptos.v1alpha.AccountAPTBalanceReply + (*ViewRequest)(nil), // 5: capabilities.blockchain.aptos.v1alpha.ViewRequest + (*ViewReply)(nil), // 6: capabilities.blockchain.aptos.v1alpha.ViewReply + (*ViewPayload)(nil), // 7: capabilities.blockchain.aptos.v1alpha.ViewPayload + (*ModuleID)(nil), // 8: capabilities.blockchain.aptos.v1alpha.ModuleID + (*TypeTag)(nil), // 9: capabilities.blockchain.aptos.v1alpha.TypeTag + (*VectorTag)(nil), // 10: capabilities.blockchain.aptos.v1alpha.VectorTag + (*StructTag)(nil), // 11: capabilities.blockchain.aptos.v1alpha.StructTag + (*GenericTag)(nil), // 12: capabilities.blockchain.aptos.v1alpha.GenericTag + (*TransactionByHashRequest)(nil), // 13: capabilities.blockchain.aptos.v1alpha.TransactionByHashRequest + (*TransactionByHashReply)(nil), // 14: capabilities.blockchain.aptos.v1alpha.TransactionByHashReply + (*Transaction)(nil), // 15: capabilities.blockchain.aptos.v1alpha.Transaction + (*AccountTransactionsRequest)(nil), // 16: capabilities.blockchain.aptos.v1alpha.AccountTransactionsRequest + (*AccountTransactionsReply)(nil), // 17: capabilities.blockchain.aptos.v1alpha.AccountTransactionsReply + (*SubmitTransactionRequest)(nil), // 18: capabilities.blockchain.aptos.v1alpha.SubmitTransactionRequest + (*SubmitTransactionReply)(nil), // 19: capabilities.blockchain.aptos.v1alpha.SubmitTransactionReply + (*GasConfig)(nil), // 20: capabilities.blockchain.aptos.v1alpha.GasConfig + (*WriteReportRequest)(nil), // 21: capabilities.blockchain.aptos.v1alpha.WriteReportRequest + (*WriteReportReply)(nil), // 22: capabilities.blockchain.aptos.v1alpha.WriteReportReply + (*sdk.ReportResponse)(nil), // 23: sdk.v1alpha.ReportResponse +} +var file_capabilities_blockchain_aptos_v1alpha_client_proto_depIdxs = []int32{ + 7, // 0: capabilities.blockchain.aptos.v1alpha.ViewRequest.payload:type_name -> capabilities.blockchain.aptos.v1alpha.ViewPayload + 8, // 1: capabilities.blockchain.aptos.v1alpha.ViewPayload.module:type_name -> capabilities.blockchain.aptos.v1alpha.ModuleID + 9, // 2: capabilities.blockchain.aptos.v1alpha.ViewPayload.arg_types:type_name -> capabilities.blockchain.aptos.v1alpha.TypeTag + 1, // 3: capabilities.blockchain.aptos.v1alpha.TypeTag.kind:type_name -> capabilities.blockchain.aptos.v1alpha.TypeTagKind + 10, // 4: capabilities.blockchain.aptos.v1alpha.TypeTag.vector:type_name -> capabilities.blockchain.aptos.v1alpha.VectorTag + 11, // 5: capabilities.blockchain.aptos.v1alpha.TypeTag.struct:type_name -> capabilities.blockchain.aptos.v1alpha.StructTag + 12, // 6: capabilities.blockchain.aptos.v1alpha.TypeTag.generic:type_name -> capabilities.blockchain.aptos.v1alpha.GenericTag + 9, // 7: capabilities.blockchain.aptos.v1alpha.VectorTag.element_type:type_name -> capabilities.blockchain.aptos.v1alpha.TypeTag + 9, // 8: capabilities.blockchain.aptos.v1alpha.StructTag.type_params:type_name -> capabilities.blockchain.aptos.v1alpha.TypeTag + 15, // 9: capabilities.blockchain.aptos.v1alpha.TransactionByHashReply.transaction:type_name -> capabilities.blockchain.aptos.v1alpha.Transaction + 2, // 10: capabilities.blockchain.aptos.v1alpha.Transaction.type:type_name -> capabilities.blockchain.aptos.v1alpha.TransactionVariant + 15, // 11: capabilities.blockchain.aptos.v1alpha.AccountTransactionsReply.transactions:type_name -> capabilities.blockchain.aptos.v1alpha.Transaction + 8, // 12: capabilities.blockchain.aptos.v1alpha.SubmitTransactionRequest.receiver_module_id:type_name -> capabilities.blockchain.aptos.v1alpha.ModuleID + 20, // 13: capabilities.blockchain.aptos.v1alpha.SubmitTransactionRequest.gas_config:type_name -> capabilities.blockchain.aptos.v1alpha.GasConfig + 0, // 14: capabilities.blockchain.aptos.v1alpha.SubmitTransactionReply.tx_status:type_name -> capabilities.blockchain.aptos.v1alpha.TxStatus + 20, // 15: capabilities.blockchain.aptos.v1alpha.WriteReportRequest.gas_config:type_name -> capabilities.blockchain.aptos.v1alpha.GasConfig + 23, // 16: capabilities.blockchain.aptos.v1alpha.WriteReportRequest.report:type_name -> sdk.v1alpha.ReportResponse + 0, // 17: capabilities.blockchain.aptos.v1alpha.WriteReportReply.tx_status:type_name -> capabilities.blockchain.aptos.v1alpha.TxStatus + 3, // 18: capabilities.blockchain.aptos.v1alpha.Client.AccountAPTBalance:input_type -> capabilities.blockchain.aptos.v1alpha.AccountAPTBalanceRequest + 5, // 19: capabilities.blockchain.aptos.v1alpha.Client.View:input_type -> capabilities.blockchain.aptos.v1alpha.ViewRequest + 13, // 20: capabilities.blockchain.aptos.v1alpha.Client.TransactionByHash:input_type -> capabilities.blockchain.aptos.v1alpha.TransactionByHashRequest + 16, // 21: capabilities.blockchain.aptos.v1alpha.Client.AccountTransactions:input_type -> capabilities.blockchain.aptos.v1alpha.AccountTransactionsRequest + 21, // 22: capabilities.blockchain.aptos.v1alpha.Client.WriteReport:input_type -> capabilities.blockchain.aptos.v1alpha.WriteReportRequest + 4, // 23: capabilities.blockchain.aptos.v1alpha.Client.AccountAPTBalance:output_type -> capabilities.blockchain.aptos.v1alpha.AccountAPTBalanceReply + 6, // 24: capabilities.blockchain.aptos.v1alpha.Client.View:output_type -> capabilities.blockchain.aptos.v1alpha.ViewReply + 14, // 25: capabilities.blockchain.aptos.v1alpha.Client.TransactionByHash:output_type -> capabilities.blockchain.aptos.v1alpha.TransactionByHashReply + 17, // 26: capabilities.blockchain.aptos.v1alpha.Client.AccountTransactions:output_type -> capabilities.blockchain.aptos.v1alpha.AccountTransactionsReply + 22, // 27: capabilities.blockchain.aptos.v1alpha.Client.WriteReport:output_type -> capabilities.blockchain.aptos.v1alpha.WriteReportReply + 23, // [23:28] is the sub-list for method output_type + 18, // [18:23] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name +} + +func init() { file_capabilities_blockchain_aptos_v1alpha_client_proto_init() } +func file_capabilities_blockchain_aptos_v1alpha_client_proto_init() { + if File_capabilities_blockchain_aptos_v1alpha_client_proto != nil { + return + } + file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[2].OneofWrappers = []any{} + file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[6].OneofWrappers = []any{ + (*TypeTag_Vector)(nil), + (*TypeTag_Struct)(nil), + (*TypeTag_Generic)(nil), + } + file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[11].OneofWrappers = []any{} + file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[12].OneofWrappers = []any{} + file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[13].OneofWrappers = []any{} + file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[15].OneofWrappers = []any{} + file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[18].OneofWrappers = []any{} + file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes[19].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDesc), len(file_capabilities_blockchain_aptos_v1alpha_client_proto_rawDesc)), + NumEnums: 3, + NumMessages: 20, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_capabilities_blockchain_aptos_v1alpha_client_proto_goTypes, + DependencyIndexes: file_capabilities_blockchain_aptos_v1alpha_client_proto_depIdxs, + EnumInfos: file_capabilities_blockchain_aptos_v1alpha_client_proto_enumTypes, + MessageInfos: file_capabilities_blockchain_aptos_v1alpha_client_proto_msgTypes, + }.Build() + File_capabilities_blockchain_aptos_v1alpha_client_proto = out.File + file_capabilities_blockchain_aptos_v1alpha_client_proto_goTypes = nil + file_capabilities_blockchain_aptos_v1alpha_client_proto_depIdxs = nil +} diff --git a/capabilities/blockchain/aptos/client_sdk_gen.go b/capabilities/blockchain/aptos/client_sdk_gen.go new file mode 100644 index 00000000..5ea7cc38 --- /dev/null +++ b/capabilities/blockchain/aptos/client_sdk_gen.go @@ -0,0 +1,214 @@ +// Code generated by github.com/smartcontractkit/cre-sdk-go/generator/protoc-gen-cre, DO NOT EDIT. + +package aptos + +import ( + "errors" + "fmt" + "strconv" + + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" + + sdkpb "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" + "github.com/smartcontractkit/cre-sdk-go/cre" +) + +type Client struct { + ChainSelector uint64 + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 allow defaults for capabilities +} + +func (c *Client) AccountAPTBalance(runtime cre.Runtime, input *AccountAPTBalanceRequest) cre.Promise[*AccountAPTBalanceReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*AccountAPTBalanceReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "aptos" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "AccountAPTBalance", + }), func(i *sdkpb.CapabilityResponse) (*AccountAPTBalanceReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &AccountAPTBalanceReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +func (c *Client) View(runtime cre.Runtime, input *ViewRequest) cre.Promise[*ViewReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*ViewReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "aptos" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "View", + }), func(i *sdkpb.CapabilityResponse) (*ViewReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &ViewReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +func (c *Client) TransactionByHash(runtime cre.Runtime, input *TransactionByHashRequest) cre.Promise[*TransactionByHashReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*TransactionByHashReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "aptos" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "TransactionByHash", + }), func(i *sdkpb.CapabilityResponse) (*TransactionByHashReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &TransactionByHashReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +func (c *Client) AccountTransactions(runtime cre.Runtime, input *AccountTransactionsRequest) cre.Promise[*AccountTransactionsReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*AccountTransactionsReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "aptos" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "AccountTransactions", + }), func(i *sdkpb.CapabilityResponse) (*AccountTransactionsReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &AccountTransactionsReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +type WriteCreReportRequest struct { + Receiver []byte // 32-byte Aptos account address of the receiver module + + GasConfig *GasConfig // optional gas configuration + + Report *cre.Report // signed report from consensus + +} + +// X_GeneratedCodeOnly_WrapWriteCreReportRequest is only meant to be used by the generated code. +func X_GeneratedCodeOnly_Wrap_WriteCreReportRequest(i *WriteReportRequest) (*WriteCreReportRequest, error) { //nolint + + receiver := i.Receiver + + gasConfig := i.GasConfig + + report, err := cre.X_GeneratedCodeOnly_WrapReport(i.Report) + if err != nil { + return nil, fmt.Errorf("failed to wrap report for field %s: %w", "Report", err) + } + + return &WriteCreReportRequest{ + + Receiver: receiver, + GasConfig: gasConfig, + Report: report, + }, nil +} + +// X_GeneratedCodeOnly_Unwrap is only meant to be used by the generated code. +func (i *WriteCreReportRequest) X_GeneratedCodeOnly_Unwrap() *WriteReportRequest { //nolint + return &WriteReportRequest{ + + Receiver: i.Receiver, + GasConfig: i.GasConfig, + Report: i.Report.X_GeneratedCodeOnly_Unwrap(), + } +} + +func (c *Client) WriteReport(runtime cre.Runtime, input *WriteCreReportRequest) cre.Promise[*WriteReportReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input.X_GeneratedCodeOnly_Unwrap(), proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*WriteReportReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "aptos" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "WriteReport", + }), func(i *sdkpb.CapabilityResponse) (*WriteReportReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &WriteReportReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +const AptosMainnet = 4741433654826277614 + +const AptosTestnet = 743186221051783445 + +func ChainSelectorFromName(name string) (uint64, error) { + switch name { + case "aptos-mainnet": + return AptosMainnet, nil + case "aptos-testnet": + return AptosTestnet, nil + default: + return 0, errors.New("unknown ChainSelector" + name) + } +} diff --git a/capabilities/blockchain/aptos/generate.go b/capabilities/blockchain/aptos/generate.go new file mode 100644 index 00000000..c0edc453 --- /dev/null +++ b/capabilities/blockchain/aptos/generate.go @@ -0,0 +1,2 @@ +//go:generate go run ./generate +package aptos diff --git a/capabilities/blockchain/aptos/generate/main.go b/capabilities/blockchain/aptos/generate/main.go new file mode 100644 index 00000000..5a576c3e --- /dev/null +++ b/capabilities/blockchain/aptos/generate/main.go @@ -0,0 +1,24 @@ +package main + +import ( + "github.com/smartcontractkit/chainlink-protos/cre/go/installer/pkg" + "github.com/smartcontractkit/cre-sdk-go/generator/protos" +) + +func main() { + gen, err := protos.NewGeneratorAndInstallToolsForCapability() + if err != nil { + panic(err) + } + if err := gen.Generate(&pkg.CapabilityConfig{ + Category: "blockchain", + Pkg: "aptos", + MajorVersion: 1, + PreReleaseTag: "alpha", + Files: []string{ + "client.proto", + }, + }); err != nil { + panic(err) + } +} diff --git a/capabilities/blockchain/aptos/go.mod b/capabilities/blockchain/aptos/go.mod new file mode 100644 index 00000000..58da4b95 --- /dev/null +++ b/capabilities/blockchain/aptos/go.mod @@ -0,0 +1,14 @@ +module github.com/smartcontractkit/cre-sdk-go/capabilities/blockchain/aptos + +go 1.25.3 + +require ( + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260312152957-059f906b6597 + github.com/smartcontractkit/cre-sdk-go v1.0.1-0.20251111122439-00032d582c18 + google.golang.org/protobuf v1.36.8 +) + +require ( + github.com/go-viper/mapstructure/v2 v2.4.0 // indirect + github.com/shopspring/decimal v1.4.0 // indirect +) diff --git a/capabilities/blockchain/aptos/go.sum b/capabilities/blockchain/aptos/go.sum new file mode 100644 index 00000000..2453f1c9 --- /dev/null +++ b/capabilities/blockchain/aptos/go.sum @@ -0,0 +1,20 @@ +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= +github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260312152957-059f906b6597 h1:0k5sfKsr3rG2l3HS6o6b6BYg4PaamD6HZ9MUAxP+0Ik= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260312152957-059f906b6597/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/cre-sdk-go v1.0.1-0.20251111122439-00032d582c18 h1:x8NX+vQzScvg4XbKDA0NF8hfxpruOjR78fag3SxhwOo= +github.com/smartcontractkit/cre-sdk-go v1.0.1-0.20251111122439-00032d582c18/go.mod h1:sgiRyHUiPcxp1e/EMnaJ+ddMFL4MbE3UMZ2MORAAS9U= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc= +google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/capabilities/blockchain/aptos/mock/client_mock_gen.go b/capabilities/blockchain/aptos/mock/client_mock_gen.go new file mode 100644 index 00000000..0839b032 --- /dev/null +++ b/capabilities/blockchain/aptos/mock/client_mock_gen.go @@ -0,0 +1,172 @@ +// Code generated by github.com/smartcontractkit/cre-sdk-go/generator/protoc-gen-cre, DO NOT EDIT. + +package aptosmock + +import ( + "context" + "fmt" + "strconv" + "testing" + + "google.golang.org/protobuf/types/known/anypb" + + "github.com/smartcontractkit/cre-sdk-go/capabilities/blockchain/aptos" + + sdkpb "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" + "github.com/smartcontractkit/cre-sdk-go/cre/testutils/registry" +) + +// avoid unused imports +var _ = registry.Registry{} + +func NewClientCapability(ChainSelector uint64, t testing.TB) (*ClientCapability, error) { + c := &ClientCapability{ + ChainSelector: ChainSelector, + } + reg := registry.GetRegistry(t) + err := reg.RegisterCapability(c) + return c, err +} + +type ClientCapability struct { + ChainSelector uint64 + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + AccountAPTBalance func(ctx context.Context, input *aptos.AccountAPTBalanceRequest) (*aptos.AccountAPTBalanceReply, error) + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + View func(ctx context.Context, input *aptos.ViewRequest) (*aptos.ViewReply, error) + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + TransactionByHash func(ctx context.Context, input *aptos.TransactionByHashRequest) (*aptos.TransactionByHashReply, error) + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + AccountTransactions func(ctx context.Context, input *aptos.AccountTransactionsRequest) (*aptos.AccountTransactionsReply, error) + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + WriteReport func(ctx context.Context, input *aptos.WriteReportRequest) (*aptos.WriteReportReply, error) +} + +func (c *ClientCapability) Invoke(ctx context.Context, request *sdkpb.CapabilityRequest) *sdkpb.CapabilityResponse { + capResp := &sdkpb.CapabilityResponse{} + switch request.Method { + case "AccountAPTBalance": + input := &aptos.AccountAPTBalanceRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.AccountAPTBalance == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for AccountAPTBalance"} + break + } + resp, err := c.AccountAPTBalance(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + case "View": + input := &aptos.ViewRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.View == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for View"} + break + } + resp, err := c.View(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + case "TransactionByHash": + input := &aptos.TransactionByHashRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.TransactionByHash == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for TransactionByHash"} + break + } + resp, err := c.TransactionByHash(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + case "AccountTransactions": + input := &aptos.AccountTransactionsRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.AccountTransactions == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for AccountTransactions"} + break + } + resp, err := c.AccountTransactions(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + case "WriteReport": + input := &aptos.WriteReportRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.WriteReport == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for WriteReport"} + break + } + resp, err := c.WriteReport(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + default: + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: fmt.Sprintf("method %s not found", request.Method)} + } + + return capResp +} + +func (c *ClientCapability) ID() string { + return "aptos" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0" +} diff --git a/capabilities/blockchain/evm/go.mod b/capabilities/blockchain/evm/go.mod index 7bbb478c..c88aa2fa 100644 --- a/capabilities/blockchain/evm/go.mod +++ b/capabilities/blockchain/evm/go.mod @@ -4,7 +4,7 @@ go 1.25.3 require ( github.com/ethereum/go-ethereum v1.16.9 - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260320153346-314ec8dbe5a4 + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260325181729-0cac87f98cd4 github.com/smartcontractkit/cre-sdk-go v1.0.1-0.20251111122439-00032d582c18 github.com/stretchr/testify v1.11.1 google.golang.org/protobuf v1.36.8 diff --git a/capabilities/blockchain/evm/go.sum b/capabilities/blockchain/evm/go.sum index 9466551a..a57cc5e3 100644 --- a/capabilities/blockchain/evm/go.sum +++ b/capabilities/blockchain/evm/go.sum @@ -45,8 +45,8 @@ github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1 github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260320153346-314ec8dbe5a4 h1:fkS5FJpSozwxL2FA6OJDi7az2DrtMNiK1X5DWuHDyfA= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260320153346-314ec8dbe5a4/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260325181729-0cac87f98cd4 h1:kqdSsgt2OzJnAk0io8GsA2lJE5hKlLM2EY4uy+R6H9Y= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260325181729-0cac87f98cd4/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/cre-sdk-go v1.0.1-0.20251111122439-00032d582c18 h1:x8NX+vQzScvg4XbKDA0NF8hfxpruOjR78fag3SxhwOo= github.com/smartcontractkit/cre-sdk-go v1.0.1-0.20251111122439-00032d582c18/go.mod h1:sgiRyHUiPcxp1e/EMnaJ+ddMFL4MbE3UMZ2MORAAS9U= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= diff --git a/capabilities/blockchain/solana/bindings/common.go b/capabilities/blockchain/solana/bindings/common.go new file mode 100644 index 00000000..01ab25b3 --- /dev/null +++ b/capabilities/blockchain/solana/bindings/common.go @@ -0,0 +1,57 @@ +package bindings + +import ( + "bytes" + "crypto/sha256" + "fmt" + + binary "github.com/gagliardetto/binary" + + "github.com/smartcontractkit/cre-sdk-go/capabilities/blockchain/solana" +) + +// ForwarderReport represents the Borsh-serialized report format expected by +// the Solana keystone-forwarder program's on_report instruction. +type ForwarderReport struct { + AccountHash [32]byte + Payload []byte +} + +// MarshalWithEncoder serializes the ForwarderReport using the provided Borsh encoder. +func (obj ForwarderReport) MarshalWithEncoder(encoder *binary.Encoder) (err error) { + // Serialize `AccountHash`: + err = encoder.Encode(obj.AccountHash) + if err != nil { + return fmt.Errorf("field AccountHash: %w", err) + } + // Serialize `Payload`: + err = encoder.Encode(obj.Payload) + if err != nil { + return fmt.Errorf("field Payload: %w", err) + } + return nil +} + +// Marshal serializes the ForwarderReport into Borsh-encoded bytes. +func (obj ForwarderReport) Marshal() ([]byte, error) { + buf := bytes.NewBuffer(nil) + encoder := binary.NewBorshEncoder(buf) + err := obj.MarshalWithEncoder(encoder) + if err != nil { + return nil, fmt.Errorf("error while encoding ForwarderReport: %w", err) + } + return buf.Bytes(), nil +} + +// CalculateAccountsHash computes the SHA-256 hash of the concatenated public +// keys of the given accounts, matching the on-chain account hash verification. +func CalculateAccountsHash(accs []*solana.AccountMeta) [32]byte { + accounts := make([]byte, 0, len(accs)*32) + for _, acc := range accs { + if acc == nil { + continue + } + accounts = append(accounts, acc.PublicKey...) + } + return sha256.Sum256(accounts) +} diff --git a/capabilities/blockchain/solana/bindings/common_test.go b/capabilities/blockchain/solana/bindings/common_test.go new file mode 100644 index 00000000..e9087597 --- /dev/null +++ b/capabilities/blockchain/solana/bindings/common_test.go @@ -0,0 +1,133 @@ +package bindings + +import ( + "crypto/sha256" + "encoding/binary" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/cre-sdk-go/capabilities/blockchain/solana" +) + +func TestForwarderReport_Marshal(t *testing.T) { + t.Run("encodes to expected Borsh format", func(t *testing.T) { + hash := [32]byte{ + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, + } + payload := []byte("hello solana") + + report := ForwarderReport{ + AccountHash: hash, + Payload: payload, + } + + data, err := report.Marshal() + require.NoError(t, err) + + // Borsh format: account_hash(32) | payload_len(u32 LE) | payload + expectedLen := 32 + 4 + len(payload) + require.Len(t, data, expectedLen) + + // First 32 bytes: account hash + assert.Equal(t, hash[:], data[:32]) + + // Next 4 bytes: little-endian u32 payload length + payloadLen := binary.LittleEndian.Uint32(data[32:36]) + assert.Equal(t, uint32(len(payload)), payloadLen) + + // Remaining bytes: payload + assert.Equal(t, payload, data[36:]) + }) +} + +func TestCalculateAccountsHash(t *testing.T) { + t.Run("single account", func(t *testing.T) { + key := make([]byte, 32) + for i := range key { + key[i] = byte(i) + } + + accs := []*solana.AccountMeta{ + {PublicKey: key}, + } + + got := CalculateAccountsHash(accs) + expected := sha256.Sum256(key) + assert.Equal(t, expected, got) + }) + + t.Run("multiple accounts", func(t *testing.T) { + key1 := make([]byte, 32) + key2 := make([]byte, 32) + for i := range key1 { + key1[i] = byte(i) + key2[i] = byte(i + 32) + } + + accs := []*solana.AccountMeta{ + {PublicKey: key1}, + {PublicKey: key2}, + } + + got := CalculateAccountsHash(accs) + + // Hash should be SHA-256 of concatenated keys + concat := append(key1, key2...) + expected := sha256.Sum256(concat) + assert.Equal(t, expected, got) + }) + + t.Run("empty slice", func(t *testing.T) { + got := CalculateAccountsHash([]*solana.AccountMeta{}) + expected := sha256.Sum256([]byte{}) + assert.Equal(t, expected, got) + }) + + t.Run("nil slice", func(t *testing.T) { + got := CalculateAccountsHash(nil) + expected := sha256.Sum256([]byte{}) + assert.Equal(t, expected, got) + }) + + t.Run("skips nil entries", func(t *testing.T) { + key := make([]byte, 32) + for i := range key { + key[i] = byte(i + 100) + } + + accs := []*solana.AccountMeta{ + nil, + {PublicKey: key}, + nil, + } + + got := CalculateAccountsHash(accs) + expected := sha256.Sum256(key) + assert.Equal(t, expected, got) + }) + + t.Run("order matters", func(t *testing.T) { + key1 := make([]byte, 32) + key2 := make([]byte, 32) + for i := range key1 { + key1[i] = byte(i) + key2[i] = byte(i + 32) + } + + hash12 := CalculateAccountsHash([]*solana.AccountMeta{ + {PublicKey: key1}, + {PublicKey: key2}, + }) + hash21 := CalculateAccountsHash([]*solana.AccountMeta{ + {PublicKey: key2}, + {PublicKey: key1}, + }) + + assert.NotEqual(t, hash12, hash21, "hash should depend on account order") + }) +} diff --git a/capabilities/blockchain/solana/client.pb.go b/capabilities/blockchain/solana/client.pb.go new file mode 100644 index 00000000..3120d05d --- /dev/null +++ b/capabilities/blockchain/solana/client.pb.go @@ -0,0 +1,3847 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v5.29.3 +// source: capabilities/blockchain/solana/v1alpha/client.proto + +package solana + +import ( + sdk "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" + _ "github.com/smartcontractkit/chainlink-protos/cre/go/tools/generator" + pb "github.com/smartcontractkit/chainlink-protos/cre/go/values/pb" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + 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) +) + +// Account/tx data encodings. +type EncodingType int32 + +const ( + EncodingType_ENCODING_TYPE_NONE EncodingType = 0 + EncodingType_ENCODING_TYPE_BASE58 EncodingType = 1 // for data <129 bytes + EncodingType_ENCODING_TYPE_BASE64 EncodingType = 2 // any size + EncodingType_ENCODING_TYPE_BASE64_ZSTD EncodingType = 3 // zstd-compressed, base64-wrapped + EncodingType_ENCODING_TYPE_JSON_PARSED EncodingType = 4 // program parsers; fallback to base64 if unknown + EncodingType_ENCODING_TYPE_JSON EncodingType = 5 // raw JSON (rare; prefer JSON_PARSED) +) + +// Enum value maps for EncodingType. +var ( + EncodingType_name = map[int32]string{ + 0: "ENCODING_TYPE_NONE", + 1: "ENCODING_TYPE_BASE58", + 2: "ENCODING_TYPE_BASE64", + 3: "ENCODING_TYPE_BASE64_ZSTD", + 4: "ENCODING_TYPE_JSON_PARSED", + 5: "ENCODING_TYPE_JSON", + } + EncodingType_value = map[string]int32{ + "ENCODING_TYPE_NONE": 0, + "ENCODING_TYPE_BASE58": 1, + "ENCODING_TYPE_BASE64": 2, + "ENCODING_TYPE_BASE64_ZSTD": 3, + "ENCODING_TYPE_JSON_PARSED": 4, + "ENCODING_TYPE_JSON": 5, + } +) + +func (x EncodingType) Enum() *EncodingType { + p := new(EncodingType) + *p = x + return p +} + +func (x EncodingType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EncodingType) Descriptor() protoreflect.EnumDescriptor { + return file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes[0].Descriptor() +} + +func (EncodingType) Type() protoreflect.EnumType { + return &file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes[0] +} + +func (x EncodingType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EncodingType.Descriptor instead. +func (EncodingType) EnumDescriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{0} +} + +// Read consistency of queried state. +type CommitmentType int32 + +const ( + CommitmentType_COMMITMENT_TYPE_NONE CommitmentType = 0 + CommitmentType_COMMITMENT_TYPE_FINALIZED CommitmentType = 1 // cluster-finalized + CommitmentType_COMMITMENT_TYPE_CONFIRMED CommitmentType = 2 // voted by supermajority + CommitmentType_COMMITMENT_TYPE_PROCESSED CommitmentType = 3 // node’s latest +) + +// Enum value maps for CommitmentType. +var ( + CommitmentType_name = map[int32]string{ + 0: "COMMITMENT_TYPE_NONE", + 1: "COMMITMENT_TYPE_FINALIZED", + 2: "COMMITMENT_TYPE_CONFIRMED", + 3: "COMMITMENT_TYPE_PROCESSED", + } + CommitmentType_value = map[string]int32{ + "COMMITMENT_TYPE_NONE": 0, + "COMMITMENT_TYPE_FINALIZED": 1, + "COMMITMENT_TYPE_CONFIRMED": 2, + "COMMITMENT_TYPE_PROCESSED": 3, + } +) + +func (x CommitmentType) Enum() *CommitmentType { + p := new(CommitmentType) + *p = x + return p +} + +func (x CommitmentType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CommitmentType) Descriptor() protoreflect.EnumDescriptor { + return file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes[1].Descriptor() +} + +func (CommitmentType) Type() protoreflect.EnumType { + return &file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes[1] +} + +func (x CommitmentType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CommitmentType.Descriptor instead. +func (CommitmentType) EnumDescriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{1} +} + +// Cluster confirmation status of a tx/signature. +type ConfirmationStatusType int32 + +const ( + ConfirmationStatusType_CONFIRMATION_STATUS_TYPE_NONE ConfirmationStatusType = 0 + ConfirmationStatusType_CONFIRMATION_STATUS_TYPE_PROCESSED ConfirmationStatusType = 1 + ConfirmationStatusType_CONFIRMATION_STATUS_TYPE_CONFIRMED ConfirmationStatusType = 2 + ConfirmationStatusType_CONFIRMATION_STATUS_TYPE_FINALIZED ConfirmationStatusType = 3 +) + +// Enum value maps for ConfirmationStatusType. +var ( + ConfirmationStatusType_name = map[int32]string{ + 0: "CONFIRMATION_STATUS_TYPE_NONE", + 1: "CONFIRMATION_STATUS_TYPE_PROCESSED", + 2: "CONFIRMATION_STATUS_TYPE_CONFIRMED", + 3: "CONFIRMATION_STATUS_TYPE_FINALIZED", + } + ConfirmationStatusType_value = map[string]int32{ + "CONFIRMATION_STATUS_TYPE_NONE": 0, + "CONFIRMATION_STATUS_TYPE_PROCESSED": 1, + "CONFIRMATION_STATUS_TYPE_CONFIRMED": 2, + "CONFIRMATION_STATUS_TYPE_FINALIZED": 3, + } +) + +func (x ConfirmationStatusType) Enum() *ConfirmationStatusType { + p := new(ConfirmationStatusType) + *p = x + return p +} + +func (x ConfirmationStatusType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ConfirmationStatusType) Descriptor() protoreflect.EnumDescriptor { + return file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes[2].Descriptor() +} + +func (ConfirmationStatusType) Type() protoreflect.EnumType { + return &file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes[2] +} + +func (x ConfirmationStatusType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ConfirmationStatusType.Descriptor instead. +func (ConfirmationStatusType) EnumDescriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{2} +} + +// Transaction execution status returned by submitters/simulations. +type TxStatus int32 + +const ( + TxStatus_TX_STATUS_FATAL TxStatus = 0 // unrecoverable failure + TxStatus_TX_STATUS_ABORTED TxStatus = 1 // not executed / dropped + TxStatus_TX_STATUS_SUCCESS TxStatus = 2 // executed successfully +) + +// Enum value maps for TxStatus. +var ( + TxStatus_name = map[int32]string{ + 0: "TX_STATUS_FATAL", + 1: "TX_STATUS_ABORTED", + 2: "TX_STATUS_SUCCESS", + } + TxStatus_value = map[string]int32{ + "TX_STATUS_FATAL": 0, + "TX_STATUS_ABORTED": 1, + "TX_STATUS_SUCCESS": 2, + } +) + +func (x TxStatus) Enum() *TxStatus { + p := new(TxStatus) + *p = x + return p +} + +func (x TxStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TxStatus) Descriptor() protoreflect.EnumDescriptor { + return file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes[3].Descriptor() +} + +func (TxStatus) Type() protoreflect.EnumType { + return &file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes[3] +} + +func (x TxStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TxStatus.Descriptor instead. +func (TxStatus) EnumDescriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{3} +} + +type ComparisonOperator int32 + +const ( + ComparisonOperator_COMPARISON_OPERATOR_EQ ComparisonOperator = 0 + ComparisonOperator_COMPARISON_OPERATOR_NEQ ComparisonOperator = 1 + ComparisonOperator_COMPARISON_OPERATOR_GT ComparisonOperator = 2 + ComparisonOperator_COMPARISON_OPERATOR_LT ComparisonOperator = 3 + ComparisonOperator_COMPARISON_OPERATOR_GTE ComparisonOperator = 4 + ComparisonOperator_COMPARISON_OPERATOR_LTE ComparisonOperator = 5 +) + +// Enum value maps for ComparisonOperator. +var ( + ComparisonOperator_name = map[int32]string{ + 0: "COMPARISON_OPERATOR_EQ", + 1: "COMPARISON_OPERATOR_NEQ", + 2: "COMPARISON_OPERATOR_GT", + 3: "COMPARISON_OPERATOR_LT", + 4: "COMPARISON_OPERATOR_GTE", + 5: "COMPARISON_OPERATOR_LTE", + } + ComparisonOperator_value = map[string]int32{ + "COMPARISON_OPERATOR_EQ": 0, + "COMPARISON_OPERATOR_NEQ": 1, + "COMPARISON_OPERATOR_GT": 2, + "COMPARISON_OPERATOR_LT": 3, + "COMPARISON_OPERATOR_GTE": 4, + "COMPARISON_OPERATOR_LTE": 5, + } +) + +func (x ComparisonOperator) Enum() *ComparisonOperator { + p := new(ComparisonOperator) + *p = x + return p +} + +func (x ComparisonOperator) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ComparisonOperator) Descriptor() protoreflect.EnumDescriptor { + return file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes[4].Descriptor() +} + +func (ComparisonOperator) Type() protoreflect.EnumType { + return &file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes[4] +} + +func (x ComparisonOperator) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ComparisonOperator.Descriptor instead. +func (ComparisonOperator) EnumDescriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{4} +} + +type ReceiverContractExecutionStatus int32 + +const ( + ReceiverContractExecutionStatus_RECEIVER_CONTRACT_EXECUTION_STATUS_SUCCESS ReceiverContractExecutionStatus = 0 + ReceiverContractExecutionStatus_RECEIVER_CONTRACT_EXECUTION_STATUS_REVERTED ReceiverContractExecutionStatus = 1 +) + +// Enum value maps for ReceiverContractExecutionStatus. +var ( + ReceiverContractExecutionStatus_name = map[int32]string{ + 0: "RECEIVER_CONTRACT_EXECUTION_STATUS_SUCCESS", + 1: "RECEIVER_CONTRACT_EXECUTION_STATUS_REVERTED", + } + ReceiverContractExecutionStatus_value = map[string]int32{ + "RECEIVER_CONTRACT_EXECUTION_STATUS_SUCCESS": 0, + "RECEIVER_CONTRACT_EXECUTION_STATUS_REVERTED": 1, + } +) + +func (x ReceiverContractExecutionStatus) Enum() *ReceiverContractExecutionStatus { + p := new(ReceiverContractExecutionStatus) + *p = x + return p +} + +func (x ReceiverContractExecutionStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ReceiverContractExecutionStatus) Descriptor() protoreflect.EnumDescriptor { + return file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes[5].Descriptor() +} + +func (ReceiverContractExecutionStatus) Type() protoreflect.EnumType { + return &file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes[5] +} + +func (x ReceiverContractExecutionStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ReceiverContractExecutionStatus.Descriptor instead. +func (ReceiverContractExecutionStatus) EnumDescriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{5} +} + +// On-chain account state. +type Account struct { + state protoimpl.MessageState `protogen:"open.v1"` + Lamports uint64 `protobuf:"varint,1,opt,name=lamports,proto3" json:"lamports,omitempty"` // balance in lamports (1e-9 SOL) + Owner []byte `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` // 32-byte program id (Pubkey) + Data *DataBytesOrJSON `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // account data (encoded or JSON) + Executable bool `protobuf:"varint,4,opt,name=executable,proto3" json:"executable,omitempty"` // true if this is a program account + RentEpoch *pb.BigInt `protobuf:"bytes,5,opt,name=rent_epoch,json=rentEpoch,proto3" json:"rent_epoch,omitempty"` // next rent epoch + Space uint64 `protobuf:"varint,6,opt,name=space,proto3" json:"space,omitempty"` // data length in bytes + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Account) Reset() { + *x = Account{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Account) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Account) ProtoMessage() {} + +func (x *Account) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_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 Account.ProtoReflect.Descriptor instead. +func (*Account) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{0} +} + +func (x *Account) GetLamports() uint64 { + if x != nil { + return x.Lamports + } + return 0 +} + +func (x *Account) GetOwner() []byte { + if x != nil { + return x.Owner + } + return nil +} + +func (x *Account) GetData() *DataBytesOrJSON { + if x != nil { + return x.Data + } + return nil +} + +func (x *Account) GetExecutable() bool { + if x != nil { + return x.Executable + } + return false +} + +func (x *Account) GetRentEpoch() *pb.BigInt { + if x != nil { + return x.RentEpoch + } + return nil +} + +func (x *Account) GetSpace() uint64 { + if x != nil { + return x.Space + } + return 0 +} + +// Compute budget configuration when submitting txs. +type ComputeConfig struct { + state protoimpl.MessageState `protogen:"open.v1"` + ComputeLimit uint32 `protobuf:"varint,1,opt,name=compute_limit,json=computeLimit,proto3" json:"compute_limit,omitempty"` // max CUs (approx per-tx limit) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ComputeConfig) Reset() { + *x = ComputeConfig{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ComputeConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComputeConfig) ProtoMessage() {} + +func (x *ComputeConfig) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_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 ComputeConfig.ProtoReflect.Descriptor instead. +func (*ComputeConfig) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{1} +} + +func (x *ComputeConfig) GetComputeLimit() uint32 { + if x != nil { + return x.ComputeLimit + } + return 0 +} + +// Raw bytes vs parsed JSON (as returned by RPC). +type DataBytesOrJSON struct { + state protoimpl.MessageState `protogen:"open.v1"` + Encoding EncodingType `protobuf:"varint,1,opt,name=encoding,proto3,enum=capabilities.blockchain.solana.v1alpha.EncodingType" json:"encoding,omitempty"` + // Types that are valid to be assigned to Body: + // + // *DataBytesOrJSON_Raw + // *DataBytesOrJSON_Json + Body isDataBytesOrJSON_Body `protobuf_oneof:"body"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DataBytesOrJSON) Reset() { + *x = DataBytesOrJSON{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DataBytesOrJSON) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataBytesOrJSON) ProtoMessage() {} + +func (x *DataBytesOrJSON) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_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 DataBytesOrJSON.ProtoReflect.Descriptor instead. +func (*DataBytesOrJSON) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{2} +} + +func (x *DataBytesOrJSON) GetEncoding() EncodingType { + if x != nil { + return x.Encoding + } + return EncodingType_ENCODING_TYPE_NONE +} + +func (x *DataBytesOrJSON) GetBody() isDataBytesOrJSON_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *DataBytesOrJSON) GetRaw() []byte { + if x != nil { + if x, ok := x.Body.(*DataBytesOrJSON_Raw); ok { + return x.Raw + } + } + return nil +} + +func (x *DataBytesOrJSON) GetJson() []byte { + if x != nil { + if x, ok := x.Body.(*DataBytesOrJSON_Json); ok { + return x.Json + } + } + return nil +} + +type isDataBytesOrJSON_Body interface { + isDataBytesOrJSON_Body() +} + +type DataBytesOrJSON_Raw struct { + Raw []byte `protobuf:"bytes,2,opt,name=raw,proto3,oneof"` // program data (node’s base64/base58 decoded) +} + +type DataBytesOrJSON_Json struct { + Json []byte `protobuf:"bytes,3,opt,name=json,proto3,oneof"` // json: UTF-8 bytes of the jsonParsed payload. +} + +func (*DataBytesOrJSON_Raw) isDataBytesOrJSON_Body() {} + +func (*DataBytesOrJSON_Json) isDataBytesOrJSON_Body() {} + +// Return a slice of account data. +type DataSlice struct { + state protoimpl.MessageState `protogen:"open.v1"` + Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` // start byte + Length uint64 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` // number of bytes + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DataSlice) Reset() { + *x = DataSlice{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DataSlice) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataSlice) ProtoMessage() {} + +func (x *DataSlice) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_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 DataSlice.ProtoReflect.Descriptor instead. +func (*DataSlice) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{3} +} + +func (x *DataSlice) GetOffset() uint64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *DataSlice) GetLength() uint64 { + if x != nil { + return x.Length + } + return 0 +} + +// Options for GetAccountInfo. +type GetAccountInfoOpts struct { + state protoimpl.MessageState `protogen:"open.v1"` + Encoding EncodingType `protobuf:"varint,1,opt,name=encoding,proto3,enum=capabilities.blockchain.solana.v1alpha.EncodingType" json:"encoding,omitempty"` // data encoding + Commitment CommitmentType `protobuf:"varint,2,opt,name=commitment,proto3,enum=capabilities.blockchain.solana.v1alpha.CommitmentType" json:"commitment,omitempty"` // read consistency + DataSlice *DataSlice `protobuf:"bytes,3,opt,name=data_slice,json=dataSlice,proto3" json:"data_slice,omitempty"` // optional slice window + MinContextSlot uint64 `protobuf:"varint,4,opt,name=min_context_slot,json=minContextSlot,proto3" json:"min_context_slot,omitempty"` // lower bound slot + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAccountInfoOpts) Reset() { + *x = GetAccountInfoOpts{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAccountInfoOpts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountInfoOpts) ProtoMessage() {} + +func (x *GetAccountInfoOpts) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_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 GetAccountInfoOpts.ProtoReflect.Descriptor instead. +func (*GetAccountInfoOpts) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{4} +} + +func (x *GetAccountInfoOpts) GetEncoding() EncodingType { + if x != nil { + return x.Encoding + } + return EncodingType_ENCODING_TYPE_NONE +} + +func (x *GetAccountInfoOpts) GetCommitment() CommitmentType { + if x != nil { + return x.Commitment + } + return CommitmentType_COMMITMENT_TYPE_NONE +} + +func (x *GetAccountInfoOpts) GetDataSlice() *DataSlice { + if x != nil { + return x.DataSlice + } + return nil +} + +func (x *GetAccountInfoOpts) GetMinContextSlot() uint64 { + if x != nil { + return x.MinContextSlot + } + return 0 +} + +// Reply for GetAccountInfoWithOpts. +type GetAccountInfoWithOptsReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value *Account `protobuf:"bytes,2,opt,name=value,proto3,oneof" json:"value,omitempty"` // account (may be empty) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAccountInfoWithOptsReply) Reset() { + *x = GetAccountInfoWithOptsReply{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAccountInfoWithOptsReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountInfoWithOptsReply) ProtoMessage() {} + +func (x *GetAccountInfoWithOptsReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_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 GetAccountInfoWithOptsReply.ProtoReflect.Descriptor instead. +func (*GetAccountInfoWithOptsReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{5} +} + +func (x *GetAccountInfoWithOptsReply) GetValue() *Account { + if x != nil { + return x.Value + } + return nil +} + +// Request for GetAccountInfoWithOpts. +type GetAccountInfoWithOptsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` // 32-byte Pubkey + Opts *GetAccountInfoOpts `protobuf:"bytes,2,opt,name=opts,proto3" json:"opts,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAccountInfoWithOptsRequest) Reset() { + *x = GetAccountInfoWithOptsRequest{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAccountInfoWithOptsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountInfoWithOptsRequest) ProtoMessage() {} + +func (x *GetAccountInfoWithOptsRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_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 GetAccountInfoWithOptsRequest.ProtoReflect.Descriptor instead. +func (*GetAccountInfoWithOptsRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{6} +} + +func (x *GetAccountInfoWithOptsRequest) GetAccount() []byte { + if x != nil { + return x.Account + } + return nil +} + +func (x *GetAccountInfoWithOptsRequest) GetOpts() *GetAccountInfoOpts { + if x != nil { + return x.Opts + } + return nil +} + +// Reply for GetBalance. +type GetBalanceReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` // lamports + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetBalanceReply) Reset() { + *x = GetBalanceReply{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBalanceReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBalanceReply) ProtoMessage() {} + +func (x *GetBalanceReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_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 GetBalanceReply.ProtoReflect.Descriptor instead. +func (*GetBalanceReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{7} +} + +func (x *GetBalanceReply) GetValue() uint64 { + if x != nil { + return x.Value + } + return 0 +} + +// Request for GetBalance. +type GetBalanceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Addr []byte `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` // 32-byte Pubkey + Commitment CommitmentType `protobuf:"varint,2,opt,name=commitment,proto3,enum=capabilities.blockchain.solana.v1alpha.CommitmentType" json:"commitment,omitempty"` // read consistency + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetBalanceRequest) Reset() { + *x = GetBalanceRequest{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBalanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBalanceRequest) ProtoMessage() {} + +func (x *GetBalanceRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_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 GetBalanceRequest.ProtoReflect.Descriptor instead. +func (*GetBalanceRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{8} +} + +func (x *GetBalanceRequest) GetAddr() []byte { + if x != nil { + return x.Addr + } + return nil +} + +func (x *GetBalanceRequest) GetCommitment() CommitmentType { + if x != nil { + return x.Commitment + } + return CommitmentType_COMMITMENT_TYPE_NONE +} + +// Options for GetBlock. +type GetBlockOpts struct { + state protoimpl.MessageState `protogen:"open.v1"` + Commitment CommitmentType `protobuf:"varint,4,opt,name=commitment,proto3,enum=capabilities.blockchain.solana.v1alpha.CommitmentType" json:"commitment,omitempty"` // read consistency + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetBlockOpts) Reset() { + *x = GetBlockOpts{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBlockOpts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlockOpts) ProtoMessage() {} + +func (x *GetBlockOpts) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_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 GetBlockOpts.ProtoReflect.Descriptor instead. +func (*GetBlockOpts) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{9} +} + +func (x *GetBlockOpts) GetCommitment() CommitmentType { + if x != nil { + return x.Commitment + } + return CommitmentType_COMMITMENT_TYPE_NONE +} + +// Block response. +type GetBlockReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Blockhash []byte `protobuf:"bytes,1,opt,name=blockhash,proto3" json:"blockhash,omitempty"` // 32-byte block hash + PreviousBlockhash []byte `protobuf:"bytes,2,opt,name=previous_blockhash,json=previousBlockhash,proto3" json:"previous_blockhash,omitempty"` // 32-byte parent hash + ParentSlot uint64 `protobuf:"varint,3,opt,name=parent_slot,json=parentSlot,proto3" json:"parent_slot,omitempty"` + BlockTime *int64 `protobuf:"varint,4,opt,name=block_time,json=blockTime,proto3,oneof" json:"block_time,omitempty"` // unix seconds, node may not report it + BlockHeight uint64 `protobuf:"varint,5,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` // chain height + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetBlockReply) Reset() { + *x = GetBlockReply{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBlockReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlockReply) ProtoMessage() {} + +func (x *GetBlockReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[10] + 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 GetBlockReply.ProtoReflect.Descriptor instead. +func (*GetBlockReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{10} +} + +func (x *GetBlockReply) GetBlockhash() []byte { + if x != nil { + return x.Blockhash + } + return nil +} + +func (x *GetBlockReply) GetPreviousBlockhash() []byte { + if x != nil { + return x.PreviousBlockhash + } + return nil +} + +func (x *GetBlockReply) GetParentSlot() uint64 { + if x != nil { + return x.ParentSlot + } + return 0 +} + +func (x *GetBlockReply) GetBlockTime() int64 { + if x != nil && x.BlockTime != nil { + return *x.BlockTime + } + return 0 +} + +func (x *GetBlockReply) GetBlockHeight() uint64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +// Request for GetBlock. +type GetBlockRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` // target slot + Opts *GetBlockOpts `protobuf:"bytes,2,opt,name=opts,proto3" json:"opts,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetBlockRequest) Reset() { + *x = GetBlockRequest{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlockRequest) ProtoMessage() {} + +func (x *GetBlockRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[11] + 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 GetBlockRequest.ProtoReflect.Descriptor instead. +func (*GetBlockRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{11} +} + +func (x *GetBlockRequest) GetSlot() uint64 { + if x != nil { + return x.Slot + } + return 0 +} + +func (x *GetBlockRequest) GetOpts() *GetBlockOpts { + if x != nil { + return x.Opts + } + return nil +} + +// Fee quote for a base58-encoded Message. +type GetFeeForMessageReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Fee uint64 `protobuf:"varint,1,opt,name=fee,proto3" json:"fee,omitempty"` // lamports + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFeeForMessageReply) Reset() { + *x = GetFeeForMessageReply{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFeeForMessageReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFeeForMessageReply) ProtoMessage() {} + +func (x *GetFeeForMessageReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[12] + 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 GetFeeForMessageReply.ProtoReflect.Descriptor instead. +func (*GetFeeForMessageReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{12} +} + +func (x *GetFeeForMessageReply) GetFee() uint64 { + if x != nil { + return x.Fee + } + return 0 +} + +type GetFeeForMessageRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // must be base58-encoded Message + Commitment CommitmentType `protobuf:"varint,2,opt,name=commitment,proto3,enum=capabilities.blockchain.solana.v1alpha.CommitmentType" json:"commitment,omitempty"` // read consistency + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFeeForMessageRequest) Reset() { + *x = GetFeeForMessageRequest{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFeeForMessageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFeeForMessageRequest) ProtoMessage() {} + +func (x *GetFeeForMessageRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[13] + 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 GetFeeForMessageRequest.ProtoReflect.Descriptor instead. +func (*GetFeeForMessageRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{13} +} + +func (x *GetFeeForMessageRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *GetFeeForMessageRequest) GetCommitment() CommitmentType { + if x != nil { + return x.Commitment + } + return CommitmentType_COMMITMENT_TYPE_NONE +} + +// Options for GetMultipleAccounts. +type GetMultipleAccountsOpts struct { + state protoimpl.MessageState `protogen:"open.v1"` + Encoding EncodingType `protobuf:"varint,1,opt,name=encoding,proto3,enum=capabilities.blockchain.solana.v1alpha.EncodingType" json:"encoding,omitempty"` + Commitment CommitmentType `protobuf:"varint,2,opt,name=commitment,proto3,enum=capabilities.blockchain.solana.v1alpha.CommitmentType" json:"commitment,omitempty"` + DataSlice *DataSlice `protobuf:"bytes,3,opt,name=data_slice,json=dataSlice,proto3" json:"data_slice,omitempty"` + MinContextSlot uint64 `protobuf:"varint,4,opt,name=min_context_slot,json=minContextSlot,proto3" json:"min_context_slot,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMultipleAccountsOpts) Reset() { + *x = GetMultipleAccountsOpts{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMultipleAccountsOpts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMultipleAccountsOpts) ProtoMessage() {} + +func (x *GetMultipleAccountsOpts) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[14] + 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 GetMultipleAccountsOpts.ProtoReflect.Descriptor instead. +func (*GetMultipleAccountsOpts) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{14} +} + +func (x *GetMultipleAccountsOpts) GetEncoding() EncodingType { + if x != nil { + return x.Encoding + } + return EncodingType_ENCODING_TYPE_NONE +} + +func (x *GetMultipleAccountsOpts) GetCommitment() CommitmentType { + if x != nil { + return x.Commitment + } + return CommitmentType_COMMITMENT_TYPE_NONE +} + +func (x *GetMultipleAccountsOpts) GetDataSlice() *DataSlice { + if x != nil { + return x.DataSlice + } + return nil +} + +func (x *GetMultipleAccountsOpts) GetMinContextSlot() uint64 { + if x != nil { + return x.MinContextSlot + } + return 0 +} + +type OptionalAccountWrapper struct { + state protoimpl.MessageState `protogen:"open.v1"` + Account *Account `protobuf:"bytes,1,opt,name=account,proto3,oneof" json:"account,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OptionalAccountWrapper) Reset() { + *x = OptionalAccountWrapper{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OptionalAccountWrapper) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionalAccountWrapper) ProtoMessage() {} + +func (x *OptionalAccountWrapper) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[15] + 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 OptionalAccountWrapper.ProtoReflect.Descriptor instead. +func (*OptionalAccountWrapper) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{15} +} + +func (x *OptionalAccountWrapper) GetAccount() *Account { + if x != nil { + return x.Account + } + return nil +} + +// Reply for GetMultipleAccountsWithOpts. +type GetMultipleAccountsWithOptsReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value []*OptionalAccountWrapper `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` // accounts (nil entries allowed) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMultipleAccountsWithOptsReply) Reset() { + *x = GetMultipleAccountsWithOptsReply{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMultipleAccountsWithOptsReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMultipleAccountsWithOptsReply) ProtoMessage() {} + +func (x *GetMultipleAccountsWithOptsReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[16] + 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 GetMultipleAccountsWithOptsReply.ProtoReflect.Descriptor instead. +func (*GetMultipleAccountsWithOptsReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{16} +} + +func (x *GetMultipleAccountsWithOptsReply) GetValue() []*OptionalAccountWrapper { + if x != nil { + return x.Value + } + return nil +} + +// Request for GetMultipleAccountsWithOpts. +type GetMultipleAccountsWithOptsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Accounts [][]byte `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` // list of 32-byte Pubkeys + Opts *GetMultipleAccountsOpts `protobuf:"bytes,2,opt,name=opts,proto3" json:"opts,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMultipleAccountsWithOptsRequest) Reset() { + *x = GetMultipleAccountsWithOptsRequest{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMultipleAccountsWithOptsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMultipleAccountsWithOptsRequest) ProtoMessage() {} + +func (x *GetMultipleAccountsWithOptsRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[17] + 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 GetMultipleAccountsWithOptsRequest.ProtoReflect.Descriptor instead. +func (*GetMultipleAccountsWithOptsRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{17} +} + +func (x *GetMultipleAccountsWithOptsRequest) GetAccounts() [][]byte { + if x != nil { + return x.Accounts + } + return nil +} + +func (x *GetMultipleAccountsWithOptsRequest) GetOpts() *GetMultipleAccountsOpts { + if x != nil { + return x.Opts + } + return nil +} + +// Reply for GetSignatureStatuses. +type GetSignatureStatusesReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Results []*GetSignatureStatusesResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` // 1:1 with input + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSignatureStatusesReply) Reset() { + *x = GetSignatureStatusesReply{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSignatureStatusesReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSignatureStatusesReply) ProtoMessage() {} + +func (x *GetSignatureStatusesReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[18] + 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 GetSignatureStatusesReply.ProtoReflect.Descriptor instead. +func (*GetSignatureStatusesReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{18} +} + +func (x *GetSignatureStatusesReply) GetResults() []*GetSignatureStatusesResult { + if x != nil { + return x.Results + } + return nil +} + +// Request for GetSignatureStatuses. +type GetSignatureStatusesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Sigs [][]byte `protobuf:"bytes,1,rep,name=sigs,proto3" json:"sigs,omitempty"` // 64-byte signatures + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSignatureStatusesRequest) Reset() { + *x = GetSignatureStatusesRequest{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSignatureStatusesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSignatureStatusesRequest) ProtoMessage() {} + +func (x *GetSignatureStatusesRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[19] + 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 GetSignatureStatusesRequest.ProtoReflect.Descriptor instead. +func (*GetSignatureStatusesRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{19} +} + +func (x *GetSignatureStatusesRequest) GetSigs() [][]byte { + if x != nil { + return x.Sigs + } + return nil +} + +// Per-signature status. +type GetSignatureStatusesResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` // processed slot + Confirmations *uint64 `protobuf:"varint,2,opt,name=confirmations,proto3,oneof" json:"confirmations,omitempty"` // null->0 here + Err string `protobuf:"bytes,3,opt,name=err,proto3" json:"err,omitempty"` // error JSON string (empty on success) + ConfirmationStatus ConfirmationStatusType `protobuf:"varint,4,opt,name=confirmation_status,json=confirmationStatus,proto3,enum=capabilities.blockchain.solana.v1alpha.ConfirmationStatusType" json:"confirmation_status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSignatureStatusesResult) Reset() { + *x = GetSignatureStatusesResult{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSignatureStatusesResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSignatureStatusesResult) ProtoMessage() {} + +func (x *GetSignatureStatusesResult) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[20] + 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 GetSignatureStatusesResult.ProtoReflect.Descriptor instead. +func (*GetSignatureStatusesResult) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{20} +} + +func (x *GetSignatureStatusesResult) GetSlot() uint64 { + if x != nil { + return x.Slot + } + return 0 +} + +func (x *GetSignatureStatusesResult) GetConfirmations() uint64 { + if x != nil && x.Confirmations != nil { + return *x.Confirmations + } + return 0 +} + +func (x *GetSignatureStatusesResult) GetErr() string { + if x != nil { + return x.Err + } + return "" +} + +func (x *GetSignatureStatusesResult) GetConfirmationStatus() ConfirmationStatusType { + if x != nil { + return x.ConfirmationStatus + } + return ConfirmationStatusType_CONFIRMATION_STATUS_TYPE_NONE +} + +// Current “height” (blocks below latest). +type GetSlotHeightReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSlotHeightReply) Reset() { + *x = GetSlotHeightReply{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSlotHeightReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSlotHeightReply) ProtoMessage() {} + +func (x *GetSlotHeightReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[21] + 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 GetSlotHeightReply.ProtoReflect.Descriptor instead. +func (*GetSlotHeightReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{21} +} + +func (x *GetSlotHeightReply) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +type GetSlotHeightRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Commitment CommitmentType `protobuf:"varint,1,opt,name=commitment,proto3,enum=capabilities.blockchain.solana.v1alpha.CommitmentType" json:"commitment,omitempty"` // read consistency + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSlotHeightRequest) Reset() { + *x = GetSlotHeightRequest{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSlotHeightRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSlotHeightRequest) ProtoMessage() {} + +func (x *GetSlotHeightRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[22] + 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 GetSlotHeightRequest.ProtoReflect.Descriptor instead. +func (*GetSlotHeightRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{22} +} + +func (x *GetSlotHeightRequest) GetCommitment() CommitmentType { + if x != nil { + return x.Commitment + } + return CommitmentType_COMMITMENT_TYPE_NONE +} + +// Message header counts. +type MessageHeader struct { + state protoimpl.MessageState `protogen:"open.v1"` + NumRequiredSignatures uint32 `protobuf:"varint,1,opt,name=num_required_signatures,json=numRequiredSignatures,proto3" json:"num_required_signatures,omitempty"` // signer count + NumReadonlySignedAccounts uint32 `protobuf:"varint,2,opt,name=num_readonly_signed_accounts,json=numReadonlySignedAccounts,proto3" json:"num_readonly_signed_accounts,omitempty"` // trailing signed RO + NumReadonlyUnsignedAccounts uint32 `protobuf:"varint,3,opt,name=num_readonly_unsigned_accounts,json=numReadonlyUnsignedAccounts,proto3" json:"num_readonly_unsigned_accounts,omitempty"` // trailing unsigned RO + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MessageHeader) Reset() { + *x = MessageHeader{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MessageHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageHeader) ProtoMessage() {} + +func (x *MessageHeader) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[23] + 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 MessageHeader.ProtoReflect.Descriptor instead. +func (*MessageHeader) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{23} +} + +func (x *MessageHeader) GetNumRequiredSignatures() uint32 { + if x != nil { + return x.NumRequiredSignatures + } + return 0 +} + +func (x *MessageHeader) GetNumReadonlySignedAccounts() uint32 { + if x != nil { + return x.NumReadonlySignedAccounts + } + return 0 +} + +func (x *MessageHeader) GetNumReadonlyUnsignedAccounts() uint32 { + if x != nil { + return x.NumReadonlyUnsignedAccounts + } + return 0 +} + +// Parsed message (no address tables). +type ParsedMessage struct { + state protoimpl.MessageState `protogen:"open.v1"` + RecentBlockhash []byte `protobuf:"bytes,1,opt,name=recent_blockhash,json=recentBlockhash,proto3" json:"recent_blockhash,omitempty"` // 32-byte Hash + AccountKeys [][]byte `protobuf:"bytes,2,rep,name=account_keys,json=accountKeys,proto3" json:"account_keys,omitempty"` // list of 32-byte Pubkeys + Header *MessageHeader `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` + Instructions []*CompiledInstruction `protobuf:"bytes,4,rep,name=instructions,proto3" json:"instructions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ParsedMessage) Reset() { + *x = ParsedMessage{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ParsedMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ParsedMessage) ProtoMessage() {} + +func (x *ParsedMessage) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[24] + 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 ParsedMessage.ProtoReflect.Descriptor instead. +func (*ParsedMessage) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{24} +} + +func (x *ParsedMessage) GetRecentBlockhash() []byte { + if x != nil { + return x.RecentBlockhash + } + return nil +} + +func (x *ParsedMessage) GetAccountKeys() [][]byte { + if x != nil { + return x.AccountKeys + } + return nil +} + +func (x *ParsedMessage) GetHeader() *MessageHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *ParsedMessage) GetInstructions() []*CompiledInstruction { + if x != nil { + return x.Instructions + } + return nil +} + +// Parsed transaction (signatures + message). +type ParsedTransaction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` // 64-byte signatures + Message *ParsedMessage `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ParsedTransaction) Reset() { + *x = ParsedTransaction{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ParsedTransaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ParsedTransaction) ProtoMessage() {} + +func (x *ParsedTransaction) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[25] + 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 ParsedTransaction.ProtoReflect.Descriptor instead. +func (*ParsedTransaction) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{25} +} + +func (x *ParsedTransaction) GetSignatures() [][]byte { + if x != nil { + return x.Signatures + } + return nil +} + +func (x *ParsedTransaction) GetMessage() *ParsedMessage { + if x != nil { + return x.Message + } + return nil +} + +// Token amount (UI-friendly). +type UiTokenAmount struct { + state protoimpl.MessageState `protogen:"open.v1"` + Amount string `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` // raw integer string + Decimals uint32 `protobuf:"varint,2,opt,name=decimals,proto3" json:"decimals,omitempty"` // mint decimals + UiAmountString string `protobuf:"bytes,4,opt,name=ui_amount_string,json=uiAmountString,proto3" json:"ui_amount_string,omitempty"` // amount / 10^decimals + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UiTokenAmount) Reset() { + *x = UiTokenAmount{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UiTokenAmount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UiTokenAmount) ProtoMessage() {} + +func (x *UiTokenAmount) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[26] + 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 UiTokenAmount.ProtoReflect.Descriptor instead. +func (*UiTokenAmount) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{26} +} + +func (x *UiTokenAmount) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +func (x *UiTokenAmount) GetDecimals() uint32 { + if x != nil { + return x.Decimals + } + return 0 +} + +func (x *UiTokenAmount) GetUiAmountString() string { + if x != nil { + return x.UiAmountString + } + return "" +} + +// SPL token balance entry. +type TokenBalance struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccountIndex uint32 `protobuf:"varint,1,opt,name=account_index,json=accountIndex,proto3" json:"account_index,omitempty"` // index in account_keys + Owner []byte `protobuf:"bytes,2,opt,name=owner,proto3,oneof" json:"owner,omitempty"` // 32-byte owner (optional) + ProgramId []byte `protobuf:"bytes,3,opt,name=program_id,json=programId,proto3,oneof" json:"program_id,omitempty"` // 32-byte token program (optional) + Mint []byte `protobuf:"bytes,4,opt,name=mint,proto3" json:"mint,omitempty"` // 32-byte mint + Ui *UiTokenAmount `protobuf:"bytes,5,opt,name=ui,proto3" json:"ui,omitempty"` // formatted amounts + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TokenBalance) Reset() { + *x = TokenBalance{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TokenBalance) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenBalance) ProtoMessage() {} + +func (x *TokenBalance) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[27] + 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 TokenBalance.ProtoReflect.Descriptor instead. +func (*TokenBalance) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{27} +} + +func (x *TokenBalance) GetAccountIndex() uint32 { + if x != nil { + return x.AccountIndex + } + return 0 +} + +func (x *TokenBalance) GetOwner() []byte { + if x != nil { + return x.Owner + } + return nil +} + +func (x *TokenBalance) GetProgramId() []byte { + if x != nil { + return x.ProgramId + } + return nil +} + +func (x *TokenBalance) GetMint() []byte { + if x != nil { + return x.Mint + } + return nil +} + +func (x *TokenBalance) GetUi() *UiTokenAmount { + if x != nil { + return x.Ui + } + return nil +} + +// Inner instruction list at a given outer instruction index. +type InnerInstruction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` // outer ix index + Instructions []*CompiledInstruction `protobuf:"bytes,2,rep,name=instructions,proto3" json:"instructions,omitempty"` // invoked ixs + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InnerInstruction) Reset() { + *x = InnerInstruction{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InnerInstruction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InnerInstruction) ProtoMessage() {} + +func (x *InnerInstruction) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[28] + 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 InnerInstruction.ProtoReflect.Descriptor instead. +func (*InnerInstruction) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{28} +} + +func (x *InnerInstruction) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *InnerInstruction) GetInstructions() []*CompiledInstruction { + if x != nil { + return x.Instructions + } + return nil +} + +// Address table lookups expanded by loader. +type LoadedAddresses struct { + state protoimpl.MessageState `protogen:"open.v1"` + Readonly [][]byte `protobuf:"bytes,1,rep,name=readonly,proto3" json:"readonly,omitempty"` // 32-byte Pubkeys + Writable [][]byte `protobuf:"bytes,2,rep,name=writable,proto3" json:"writable,omitempty"` // 32-byte Pubkeys + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LoadedAddresses) Reset() { + *x = LoadedAddresses{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LoadedAddresses) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadedAddresses) ProtoMessage() {} + +func (x *LoadedAddresses) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[29] + 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 LoadedAddresses.ProtoReflect.Descriptor instead. +func (*LoadedAddresses) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{29} +} + +func (x *LoadedAddresses) GetReadonly() [][]byte { + if x != nil { + return x.Readonly + } + return nil +} + +func (x *LoadedAddresses) GetWritable() [][]byte { + if x != nil { + return x.Writable + } + return nil +} + +// Compiled (program) instruction. +type CompiledInstruction struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProgramIdIndex uint32 `protobuf:"varint,1,opt,name=program_id_index,json=programIdIndex,proto3" json:"program_id_index,omitempty"` // index into account_keys + Accounts []uint32 `protobuf:"varint,2,rep,packed,name=accounts,proto3" json:"accounts,omitempty"` // indices into account_keys + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // program input bytes + StackHeight uint32 `protobuf:"varint,4,opt,name=stack_height,json=stackHeight,proto3" json:"stack_height,omitempty"` // if recorded by node + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CompiledInstruction) Reset() { + *x = CompiledInstruction{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CompiledInstruction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompiledInstruction) ProtoMessage() {} + +func (x *CompiledInstruction) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[30] + 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 CompiledInstruction.ProtoReflect.Descriptor instead. +func (*CompiledInstruction) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{30} +} + +func (x *CompiledInstruction) GetProgramIdIndex() uint32 { + if x != nil { + return x.ProgramIdIndex + } + return 0 +} + +func (x *CompiledInstruction) GetAccounts() []uint32 { + if x != nil { + return x.Accounts + } + return nil +} + +func (x *CompiledInstruction) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *CompiledInstruction) GetStackHeight() uint32 { + if x != nil { + return x.StackHeight + } + return 0 +} + +// Raw bytes with encoding tag. +type Data struct { + state protoimpl.MessageState `protogen:"open.v1"` + Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` // raw bytes + Encoding EncodingType `protobuf:"varint,2,opt,name=encoding,proto3,enum=capabilities.blockchain.solana.v1alpha.EncodingType" json:"encoding,omitempty"` // how it was encoded originally + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Data) Reset() { + *x = Data{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Data) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Data) ProtoMessage() {} + +func (x *Data) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[31] + 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 Data.ProtoReflect.Descriptor instead. +func (*Data) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{31} +} + +func (x *Data) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + +func (x *Data) GetEncoding() EncodingType { + if x != nil { + return x.Encoding + } + return EncodingType_ENCODING_TYPE_NONE +} + +// Program return data. +type ReturnData struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProgramId []byte `protobuf:"bytes,1,opt,name=program_id,json=programId,proto3" json:"program_id,omitempty"` // 32-byte Pubkey + Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // raw return bytes + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReturnData) Reset() { + *x = ReturnData{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReturnData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReturnData) ProtoMessage() {} + +func (x *ReturnData) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[32] + 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 ReturnData.ProtoReflect.Descriptor instead. +func (*ReturnData) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{32} +} + +func (x *ReturnData) GetProgramId() []byte { + if x != nil { + return x.ProgramId + } + return nil +} + +func (x *ReturnData) GetData() *Data { + if x != nil { + return x.Data + } + return nil +} + +// Transaction execution metadata. +type TransactionMeta struct { + state protoimpl.MessageState `protogen:"open.v1"` + ErrJson string `protobuf:"bytes,1,opt,name=err_json,json=errJson,proto3" json:"err_json,omitempty"` // error JSON (empty on success) + Fee uint64 `protobuf:"varint,2,opt,name=fee,proto3" json:"fee,omitempty"` // lamports + PreBalances []uint64 `protobuf:"varint,3,rep,packed,name=pre_balances,json=preBalances,proto3" json:"pre_balances,omitempty"` // lamports per account + PostBalances []uint64 `protobuf:"varint,4,rep,packed,name=post_balances,json=postBalances,proto3" json:"post_balances,omitempty"` // lamports per account + LogMessages []string `protobuf:"bytes,5,rep,name=log_messages,json=logMessages,proto3" json:"log_messages,omitempty"` // runtime logs + PreTokenBalances []*TokenBalance `protobuf:"bytes,6,rep,name=pre_token_balances,json=preTokenBalances,proto3" json:"pre_token_balances,omitempty"` + PostTokenBalances []*TokenBalance `protobuf:"bytes,7,rep,name=post_token_balances,json=postTokenBalances,proto3" json:"post_token_balances,omitempty"` + InnerInstructions []*InnerInstruction `protobuf:"bytes,8,rep,name=inner_instructions,json=innerInstructions,proto3" json:"inner_instructions,omitempty"` + LoadedAddresses *LoadedAddresses `protobuf:"bytes,9,opt,name=loaded_addresses,json=loadedAddresses,proto3" json:"loaded_addresses,omitempty"` + ReturnData *ReturnData `protobuf:"bytes,10,opt,name=return_data,json=returnData,proto3" json:"return_data,omitempty"` + ComputeUnitsConsumed *uint64 `protobuf:"varint,11,opt,name=compute_units_consumed,json=computeUnitsConsumed,proto3,oneof" json:"compute_units_consumed,omitempty"` // CUs + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransactionMeta) Reset() { + *x = TransactionMeta{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransactionMeta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionMeta) ProtoMessage() {} + +func (x *TransactionMeta) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[33] + 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 TransactionMeta.ProtoReflect.Descriptor instead. +func (*TransactionMeta) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{33} +} + +func (x *TransactionMeta) GetErrJson() string { + if x != nil { + return x.ErrJson + } + return "" +} + +func (x *TransactionMeta) GetFee() uint64 { + if x != nil { + return x.Fee + } + return 0 +} + +func (x *TransactionMeta) GetPreBalances() []uint64 { + if x != nil { + return x.PreBalances + } + return nil +} + +func (x *TransactionMeta) GetPostBalances() []uint64 { + if x != nil { + return x.PostBalances + } + return nil +} + +func (x *TransactionMeta) GetLogMessages() []string { + if x != nil { + return x.LogMessages + } + return nil +} + +func (x *TransactionMeta) GetPreTokenBalances() []*TokenBalance { + if x != nil { + return x.PreTokenBalances + } + return nil +} + +func (x *TransactionMeta) GetPostTokenBalances() []*TokenBalance { + if x != nil { + return x.PostTokenBalances + } + return nil +} + +func (x *TransactionMeta) GetInnerInstructions() []*InnerInstruction { + if x != nil { + return x.InnerInstructions + } + return nil +} + +func (x *TransactionMeta) GetLoadedAddresses() *LoadedAddresses { + if x != nil { + return x.LoadedAddresses + } + return nil +} + +func (x *TransactionMeta) GetReturnData() *ReturnData { + if x != nil { + return x.ReturnData + } + return nil +} + +func (x *TransactionMeta) GetComputeUnitsConsumed() uint64 { + if x != nil && x.ComputeUnitsConsumed != nil { + return *x.ComputeUnitsConsumed + } + return 0 +} + +// Transaction envelope: raw bytes or parsed struct. +type TransactionEnvelope struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Transaction: + // + // *TransactionEnvelope_Raw + // *TransactionEnvelope_Parsed + Transaction isTransactionEnvelope_Transaction `protobuf_oneof:"transaction"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransactionEnvelope) Reset() { + *x = TransactionEnvelope{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransactionEnvelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionEnvelope) ProtoMessage() {} + +func (x *TransactionEnvelope) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[34] + 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 TransactionEnvelope.ProtoReflect.Descriptor instead. +func (*TransactionEnvelope) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{34} +} + +func (x *TransactionEnvelope) GetTransaction() isTransactionEnvelope_Transaction { + if x != nil { + return x.Transaction + } + return nil +} + +func (x *TransactionEnvelope) GetRaw() []byte { + if x != nil { + if x, ok := x.Transaction.(*TransactionEnvelope_Raw); ok { + return x.Raw + } + } + return nil +} + +func (x *TransactionEnvelope) GetParsed() *ParsedTransaction { + if x != nil { + if x, ok := x.Transaction.(*TransactionEnvelope_Parsed); ok { + return x.Parsed + } + } + return nil +} + +type isTransactionEnvelope_Transaction interface { + isTransactionEnvelope_Transaction() +} + +type TransactionEnvelope_Raw struct { + Raw []byte `protobuf:"bytes,1,opt,name=raw,proto3,oneof"` // raw tx bytes (for RAW/base64) +} + +type TransactionEnvelope_Parsed struct { + Parsed *ParsedTransaction `protobuf:"bytes,2,opt,name=parsed,proto3,oneof"` // parsed tx (for JSON_PARSED) +} + +func (*TransactionEnvelope_Raw) isTransactionEnvelope_Transaction() {} + +func (*TransactionEnvelope_Parsed) isTransactionEnvelope_Transaction() {} + +// GetTransaction reply. +type GetTransactionReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` // processed slot + BlockTime *int64 `protobuf:"varint,2,opt,name=block_time,json=blockTime,proto3,oneof" json:"block_time,omitempty"` // unix seconds + Transaction *TransactionEnvelope `protobuf:"bytes,3,opt,name=transaction,proto3,oneof" json:"transaction,omitempty"` // tx bytes or parsed + Meta *TransactionMeta `protobuf:"bytes,4,opt,name=meta,proto3,oneof" json:"meta,omitempty"` // may be omitted by node + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetTransactionReply) Reset() { + *x = GetTransactionReply{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetTransactionReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTransactionReply) ProtoMessage() {} + +func (x *GetTransactionReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[35] + 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 GetTransactionReply.ProtoReflect.Descriptor instead. +func (*GetTransactionReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{35} +} + +func (x *GetTransactionReply) GetSlot() uint64 { + if x != nil { + return x.Slot + } + return 0 +} + +func (x *GetTransactionReply) GetBlockTime() int64 { + if x != nil && x.BlockTime != nil { + return *x.BlockTime + } + return 0 +} + +func (x *GetTransactionReply) GetTransaction() *TransactionEnvelope { + if x != nil { + return x.Transaction + } + return nil +} + +func (x *GetTransactionReply) GetMeta() *TransactionMeta { + if x != nil { + return x.Meta + } + return nil +} + +// GetTransaction request. +type GetTransactionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` // 64-byte signature + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetTransactionRequest) Reset() { + *x = GetTransactionRequest{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetTransactionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTransactionRequest) ProtoMessage() {} + +func (x *GetTransactionRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[36] + 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 GetTransactionRequest.ProtoReflect.Descriptor instead. +func (*GetTransactionRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{36} +} + +func (x *GetTransactionRequest) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// Simulation options. +type SimulateTXOpts struct { + state protoimpl.MessageState `protogen:"open.v1"` + SigVerify bool `protobuf:"varint,1,opt,name=sig_verify,json=sigVerify,proto3" json:"sig_verify,omitempty"` // verify sigs + Commitment CommitmentType `protobuf:"varint,2,opt,name=commitment,proto3,enum=capabilities.blockchain.solana.v1alpha.CommitmentType" json:"commitment,omitempty"` // read consistency + ReplaceRecentBlockhash bool `protobuf:"varint,3,opt,name=replace_recent_blockhash,json=replaceRecentBlockhash,proto3" json:"replace_recent_blockhash,omitempty"` // refresh blockhash + Accounts *SimulateTransactionAccountsOpts `protobuf:"bytes,4,opt,name=accounts,proto3" json:"accounts,omitempty"` // return accounts + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SimulateTXOpts) Reset() { + *x = SimulateTXOpts{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SimulateTXOpts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SimulateTXOpts) ProtoMessage() {} + +func (x *SimulateTXOpts) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[37] + 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 SimulateTXOpts.ProtoReflect.Descriptor instead. +func (*SimulateTXOpts) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{37} +} + +func (x *SimulateTXOpts) GetSigVerify() bool { + if x != nil { + return x.SigVerify + } + return false +} + +func (x *SimulateTXOpts) GetCommitment() CommitmentType { + if x != nil { + return x.Commitment + } + return CommitmentType_COMMITMENT_TYPE_NONE +} + +func (x *SimulateTXOpts) GetReplaceRecentBlockhash() bool { + if x != nil { + return x.ReplaceRecentBlockhash + } + return false +} + +func (x *SimulateTXOpts) GetAccounts() *SimulateTransactionAccountsOpts { + if x != nil { + return x.Accounts + } + return nil +} + +// Simulation result. +type SimulateTXReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` // empty on success + Logs []string `protobuf:"bytes,2,rep,name=logs,proto3" json:"logs,omitempty"` // runtime logs + Accounts []*Account `protobuf:"bytes,3,rep,name=accounts,proto3" json:"accounts,omitempty"` // returned accounts + UnitsConsumed uint64 `protobuf:"varint,4,opt,name=units_consumed,json=unitsConsumed,proto3" json:"units_consumed,omitempty"` // CUs + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SimulateTXReply) Reset() { + *x = SimulateTXReply{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SimulateTXReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SimulateTXReply) ProtoMessage() {} + +func (x *SimulateTXReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[38] + 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 SimulateTXReply.ProtoReflect.Descriptor instead. +func (*SimulateTXReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{38} +} + +func (x *SimulateTXReply) GetErr() string { + if x != nil { + return x.Err + } + return "" +} + +func (x *SimulateTXReply) GetLogs() []string { + if x != nil { + return x.Logs + } + return nil +} + +func (x *SimulateTXReply) GetAccounts() []*Account { + if x != nil { + return x.Accounts + } + return nil +} + +func (x *SimulateTXReply) GetUnitsConsumed() uint64 { + if x != nil { + return x.UnitsConsumed + } + return 0 +} + +// Simulation request. +type SimulateTXRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Receiver []byte `protobuf:"bytes,1,opt,name=receiver,proto3" json:"receiver,omitempty"` // 32-byte program id (target) + EncodedTransaction string `protobuf:"bytes,2,opt,name=encoded_transaction,json=encodedTransaction,proto3" json:"encoded_transaction,omitempty"` // base64/base58 tx + Opts *SimulateTXOpts `protobuf:"bytes,3,opt,name=opts,proto3" json:"opts,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SimulateTXRequest) Reset() { + *x = SimulateTXRequest{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SimulateTXRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SimulateTXRequest) ProtoMessage() {} + +func (x *SimulateTXRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[39] + 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 SimulateTXRequest.ProtoReflect.Descriptor instead. +func (*SimulateTXRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{39} +} + +func (x *SimulateTXRequest) GetReceiver() []byte { + if x != nil { + return x.Receiver + } + return nil +} + +func (x *SimulateTXRequest) GetEncodedTransaction() string { + if x != nil { + return x.EncodedTransaction + } + return "" +} + +func (x *SimulateTXRequest) GetOpts() *SimulateTXOpts { + if x != nil { + return x.Opts + } + return nil +} + +// Accounts to return during simulation. +type SimulateTransactionAccountsOpts struct { + state protoimpl.MessageState `protogen:"open.v1"` + Encoding EncodingType `protobuf:"varint,1,opt,name=encoding,proto3,enum=capabilities.blockchain.solana.v1alpha.EncodingType" json:"encoding,omitempty"` // account data encoding + Addresses [][]byte `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"` // 32-byte Pubkeys + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SimulateTransactionAccountsOpts) Reset() { + *x = SimulateTransactionAccountsOpts{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SimulateTransactionAccountsOpts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SimulateTransactionAccountsOpts) ProtoMessage() {} + +func (x *SimulateTransactionAccountsOpts) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[40] + 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 SimulateTransactionAccountsOpts.ProtoReflect.Descriptor instead. +func (*SimulateTransactionAccountsOpts) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{40} +} + +func (x *SimulateTransactionAccountsOpts) GetEncoding() EncodingType { + if x != nil { + return x.Encoding + } + return EncodingType_ENCODING_TYPE_NONE +} + +func (x *SimulateTransactionAccountsOpts) GetAddresses() [][]byte { + if x != nil { + return x.Addresses + } + return nil +} + +type ValueComparator struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Operator ComparisonOperator `protobuf:"varint,2,opt,name=operator,proto3,enum=capabilities.blockchain.solana.v1alpha.ComparisonOperator" json:"operator,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValueComparator) Reset() { + *x = ValueComparator{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValueComparator) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValueComparator) ProtoMessage() {} + +func (x *ValueComparator) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[41] + 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 ValueComparator.ProtoReflect.Descriptor instead. +func (*ValueComparator) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{41} +} + +func (x *ValueComparator) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *ValueComparator) GetOperator() ComparisonOperator { + if x != nil { + return x.Operator + } + return ComparisonOperator_COMPARISON_OPERATOR_EQ +} + +type SubkeyConfig struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path []string `protobuf:"bytes,1,rep,name=path,proto3" json:"path,omitempty"` + Comparers []*ValueComparator `protobuf:"bytes,2,rep,name=comparers,proto3" json:"comparers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SubkeyConfig) Reset() { + *x = SubkeyConfig{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SubkeyConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubkeyConfig) ProtoMessage() {} + +func (x *SubkeyConfig) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[42] + 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 SubkeyConfig.ProtoReflect.Descriptor instead. +func (*SubkeyConfig) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{42} +} + +func (x *SubkeyConfig) GetPath() []string { + if x != nil { + return x.Path + } + return nil +} + +func (x *SubkeyConfig) GetComparers() []*ValueComparator { + if x != nil { + return x.Comparers + } + return nil +} + +type CPIFilterConfig struct { + state protoimpl.MessageState `protogen:"open.v1"` + DestAddress []byte `protobuf:"bytes,1,opt,name=dest_address,json=destAddress,proto3" json:"dest_address,omitempty"` + MethodName []byte `protobuf:"bytes,2,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CPIFilterConfig) Reset() { + *x = CPIFilterConfig{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CPIFilterConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CPIFilterConfig) ProtoMessage() {} + +func (x *CPIFilterConfig) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[43] + 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 CPIFilterConfig.ProtoReflect.Descriptor instead. +func (*CPIFilterConfig) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{43} +} + +func (x *CPIFilterConfig) GetDestAddress() []byte { + if x != nil { + return x.DestAddress + } + return nil +} + +func (x *CPIFilterConfig) GetMethodName() []byte { + if x != nil { + return x.MethodName + } + return nil +} + +type FilterLogTriggerRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Address []byte `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // Solana PublicKey (32 bytes) + EventName string `protobuf:"bytes,3,opt,name=event_name,json=eventName,proto3" json:"event_name,omitempty"` + ContractIdlJson []byte `protobuf:"bytes,4,opt,name=contract_idl_json,json=contractIdlJson,proto3" json:"contract_idl_json,omitempty"` + Subkeys []*SubkeyConfig `protobuf:"bytes,5,rep,name=subkeys,proto3" json:"subkeys,omitempty"` + CpiFilterConfig *CPIFilterConfig `protobuf:"bytes,6,opt,name=cpi_filter_config,json=cpiFilterConfig,proto3,oneof" json:"cpi_filter_config,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FilterLogTriggerRequest) Reset() { + *x = FilterLogTriggerRequest{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FilterLogTriggerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FilterLogTriggerRequest) ProtoMessage() {} + +func (x *FilterLogTriggerRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[44] + 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 FilterLogTriggerRequest.ProtoReflect.Descriptor instead. +func (*FilterLogTriggerRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{44} +} + +func (x *FilterLogTriggerRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FilterLogTriggerRequest) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *FilterLogTriggerRequest) GetEventName() string { + if x != nil { + return x.EventName + } + return "" +} + +func (x *FilterLogTriggerRequest) GetContractIdlJson() []byte { + if x != nil { + return x.ContractIdlJson + } + return nil +} + +func (x *FilterLogTriggerRequest) GetSubkeys() []*SubkeyConfig { + if x != nil { + return x.Subkeys + } + return nil +} + +func (x *FilterLogTriggerRequest) GetCpiFilterConfig() *CPIFilterConfig { + if x != nil { + return x.CpiFilterConfig + } + return nil +} + +type Log struct { + state protoimpl.MessageState `protogen:"open.v1"` + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Chain identifier + LogIndex int64 `protobuf:"varint,2,opt,name=log_index,json=logIndex,proto3" json:"log_index,omitempty"` // Index of the log within the block + BlockHash []byte `protobuf:"bytes,3,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` // 32-byte block hash + BlockNumber int64 `protobuf:"varint,4,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` // Block/slot number + BlockTimestamp uint64 `protobuf:"varint,5,opt,name=block_timestamp,json=blockTimestamp,proto3" json:"block_timestamp,omitempty"` // Unix timestamp of the block + Address []byte `protobuf:"bytes,6,opt,name=address,proto3" json:"address,omitempty"` // 32-byte program PublicKey + EventSig []byte `protobuf:"bytes,7,opt,name=event_sig,json=eventSig,proto3" json:"event_sig,omitempty"` // 8-byte event signature + TxHash []byte `protobuf:"bytes,8,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` // 64-byte transaction signature + Data []byte `protobuf:"bytes,9,opt,name=data,proto3" json:"data,omitempty"` // Decoded event data + SequenceNum int64 `protobuf:"varint,10,opt,name=sequence_num,json=sequenceNum,proto3" json:"sequence_num,omitempty"` // Sequence number for ordering + Error *string `protobuf:"bytes,11,opt,name=error,proto3,oneof" json:"error,omitempty"` // Error message if log processing failed + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Log) Reset() { + *x = Log{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Log) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Log) ProtoMessage() {} + +func (x *Log) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[45] + 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 Log.ProtoReflect.Descriptor instead. +func (*Log) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{45} +} + +func (x *Log) GetChainId() string { + if x != nil { + return x.ChainId + } + return "" +} + +func (x *Log) GetLogIndex() int64 { + if x != nil { + return x.LogIndex + } + return 0 +} + +func (x *Log) GetBlockHash() []byte { + if x != nil { + return x.BlockHash + } + return nil +} + +func (x *Log) GetBlockNumber() int64 { + if x != nil { + return x.BlockNumber + } + return 0 +} + +func (x *Log) GetBlockTimestamp() uint64 { + if x != nil { + return x.BlockTimestamp + } + return 0 +} + +func (x *Log) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *Log) GetEventSig() []byte { + if x != nil { + return x.EventSig + } + return nil +} + +func (x *Log) GetTxHash() []byte { + if x != nil { + return x.TxHash + } + return nil +} + +func (x *Log) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *Log) GetSequenceNum() int64 { + if x != nil { + return x.SequenceNum + } + return 0 +} + +func (x *Log) GetError() string { + if x != nil && x.Error != nil { + return *x.Error + } + return "" +} + +// All metas are non-signers. +type AccountMeta struct { + state protoimpl.MessageState `protogen:"open.v1"` + PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // 32 bytes account public key + IsWritable bool `protobuf:"varint,2,opt,name=is_writable,json=isWritable,proto3" json:"is_writable,omitempty"` // write flag + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AccountMeta) Reset() { + *x = AccountMeta{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AccountMeta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountMeta) ProtoMessage() {} + +func (x *AccountMeta) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[46] + 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 AccountMeta.ProtoReflect.Descriptor instead. +func (*AccountMeta) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{46} +} + +func (x *AccountMeta) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *AccountMeta) GetIsWritable() bool { + if x != nil { + return x.IsWritable + } + return false +} + +type WriteReportRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RemainingAccounts []*AccountMeta `protobuf:"bytes,1,rep,name=remaining_accounts,json=remainingAccounts,proto3" json:"remaining_accounts,omitempty"` // accounts that are required by the receiver to accept the report + Receiver []byte `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"` // 32 bytes receiver + ComputeConfig *ComputeConfig `protobuf:"bytes,3,opt,name=compute_config,json=computeConfig,proto3,oneof" json:"compute_config,omitempty"` + Report *sdk.ReportResponse `protobuf:"bytes,4,opt,name=report,proto3" json:"report,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteReportRequest) Reset() { + *x = WriteReportRequest{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteReportRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteReportRequest) ProtoMessage() {} + +func (x *WriteReportRequest) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[47] + 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 WriteReportRequest.ProtoReflect.Descriptor instead. +func (*WriteReportRequest) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{47} +} + +func (x *WriteReportRequest) GetRemainingAccounts() []*AccountMeta { + if x != nil { + return x.RemainingAccounts + } + return nil +} + +func (x *WriteReportRequest) GetReceiver() []byte { + if x != nil { + return x.Receiver + } + return nil +} + +func (x *WriteReportRequest) GetComputeConfig() *ComputeConfig { + if x != nil { + return x.ComputeConfig + } + return nil +} + +func (x *WriteReportRequest) GetReport() *sdk.ReportResponse { + if x != nil { + return x.Report + } + return nil +} + +type WriteReportReply struct { + state protoimpl.MessageState `protogen:"open.v1"` + TxStatus TxStatus `protobuf:"varint,1,opt,name=tx_status,json=txStatus,proto3,enum=capabilities.blockchain.solana.v1alpha.TxStatus" json:"tx_status,omitempty"` + ReceiverContractExecutionStatus *ReceiverContractExecutionStatus `protobuf:"varint,2,opt,name=receiver_contract_execution_status,json=receiverContractExecutionStatus,proto3,enum=capabilities.blockchain.solana.v1alpha.ReceiverContractExecutionStatus,oneof" json:"receiver_contract_execution_status,omitempty"` + TxSignature []byte `protobuf:"bytes,3,opt,name=tx_signature,json=txSignature,proto3,oneof" json:"tx_signature,omitempty"` + TransactionFee *uint64 `protobuf:"varint,4,opt,name=transaction_fee,json=transactionFee,proto3,oneof" json:"transaction_fee,omitempty"` + ErrorMessage *string `protobuf:"bytes,5,opt,name=error_message,json=errorMessage,proto3,oneof" json:"error_message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteReportReply) Reset() { + *x = WriteReportReply{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteReportReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteReportReply) ProtoMessage() {} + +func (x *WriteReportReply) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[48] + 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 WriteReportReply.ProtoReflect.Descriptor instead. +func (*WriteReportReply) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{48} +} + +func (x *WriteReportReply) GetTxStatus() TxStatus { + if x != nil { + return x.TxStatus + } + return TxStatus_TX_STATUS_FATAL +} + +func (x *WriteReportReply) GetReceiverContractExecutionStatus() ReceiverContractExecutionStatus { + if x != nil && x.ReceiverContractExecutionStatus != nil { + return *x.ReceiverContractExecutionStatus + } + return ReceiverContractExecutionStatus_RECEIVER_CONTRACT_EXECUTION_STATUS_SUCCESS +} + +func (x *WriteReportReply) GetTxSignature() []byte { + if x != nil { + return x.TxSignature + } + return nil +} + +func (x *WriteReportReply) GetTransactionFee() uint64 { + if x != nil && x.TransactionFee != nil { + return *x.TransactionFee + } + return 0 +} + +func (x *WriteReportReply) GetErrorMessage() string { + if x != nil && x.ErrorMessage != nil { + return *x.ErrorMessage + } + return "" +} + +var File_capabilities_blockchain_solana_v1alpha_client_proto protoreflect.FileDescriptor + +const file_capabilities_blockchain_solana_v1alpha_client_proto_rawDesc = "" + + "\n" + + "3capabilities/blockchain/solana/v1alpha/client.proto\x12&capabilities.blockchain.solana.v1alpha\x1a\x15sdk/v1alpha/sdk.proto\x1a*tools/generator/v1alpha/cre_metadata.proto\x1a\x16values/v1/values.proto\"\xf0\x01\n" + + "\aAccount\x12\x1a\n" + + "\blamports\x18\x01 \x01(\x04R\blamports\x12\x14\n" + + "\x05owner\x18\x02 \x01(\fR\x05owner\x12K\n" + + "\x04data\x18\x03 \x01(\v27.capabilities.blockchain.solana.v1alpha.DataBytesOrJSONR\x04data\x12\x1e\n" + + "\n" + + "executable\x18\x04 \x01(\bR\n" + + "executable\x120\n" + + "\n" + + "rent_epoch\x18\x05 \x01(\v2\x11.values.v1.BigIntR\trentEpoch\x12\x14\n" + + "\x05space\x18\x06 \x01(\x04R\x05space\"4\n" + + "\rComputeConfig\x12#\n" + + "\rcompute_limit\x18\x01 \x01(\rR\fcomputeLimit\"\x95\x01\n" + + "\x0fDataBytesOrJSON\x12P\n" + + "\bencoding\x18\x01 \x01(\x0e24.capabilities.blockchain.solana.v1alpha.EncodingTypeR\bencoding\x12\x12\n" + + "\x03raw\x18\x02 \x01(\fH\x00R\x03raw\x12\x14\n" + + "\x04json\x18\x03 \x01(\fH\x00R\x04jsonB\x06\n" + + "\x04body\";\n" + + "\tDataSlice\x12\x16\n" + + "\x06offset\x18\x01 \x01(\x04R\x06offset\x12\x16\n" + + "\x06length\x18\x02 \x01(\x04R\x06length\"\xba\x02\n" + + "\x12GetAccountInfoOpts\x12P\n" + + "\bencoding\x18\x01 \x01(\x0e24.capabilities.blockchain.solana.v1alpha.EncodingTypeR\bencoding\x12V\n" + + "\n" + + "commitment\x18\x02 \x01(\x0e26.capabilities.blockchain.solana.v1alpha.CommitmentTypeR\n" + + "commitment\x12P\n" + + "\n" + + "data_slice\x18\x03 \x01(\v21.capabilities.blockchain.solana.v1alpha.DataSliceR\tdataSlice\x12(\n" + + "\x10min_context_slot\x18\x04 \x01(\x04R\x0eminContextSlot\"s\n" + + "\x1bGetAccountInfoWithOptsReply\x12J\n" + + "\x05value\x18\x02 \x01(\v2/.capabilities.blockchain.solana.v1alpha.AccountH\x00R\x05value\x88\x01\x01B\b\n" + + "\x06_value\"\x89\x01\n" + + "\x1dGetAccountInfoWithOptsRequest\x12\x18\n" + + "\aaccount\x18\x01 \x01(\fR\aaccount\x12N\n" + + "\x04opts\x18\x02 \x01(\v2:.capabilities.blockchain.solana.v1alpha.GetAccountInfoOptsR\x04opts\"'\n" + + "\x0fGetBalanceReply\x12\x14\n" + + "\x05value\x18\x01 \x01(\x04R\x05value\"\x7f\n" + + "\x11GetBalanceRequest\x12\x12\n" + + "\x04addr\x18\x01 \x01(\fR\x04addr\x12V\n" + + "\n" + + "commitment\x18\x02 \x01(\x0e26.capabilities.blockchain.solana.v1alpha.CommitmentTypeR\n" + + "commitment\"f\n" + + "\fGetBlockOpts\x12V\n" + + "\n" + + "commitment\x18\x04 \x01(\x0e26.capabilities.blockchain.solana.v1alpha.CommitmentTypeR\n" + + "commitment\"\xd3\x01\n" + + "\rGetBlockReply\x12\x1c\n" + + "\tblockhash\x18\x01 \x01(\fR\tblockhash\x12-\n" + + "\x12previous_blockhash\x18\x02 \x01(\fR\x11previousBlockhash\x12\x1f\n" + + "\vparent_slot\x18\x03 \x01(\x04R\n" + + "parentSlot\x12\"\n" + + "\n" + + "block_time\x18\x04 \x01(\x03H\x00R\tblockTime\x88\x01\x01\x12!\n" + + "\fblock_height\x18\x05 \x01(\x04R\vblockHeightB\r\n" + + "\v_block_time\"o\n" + + "\x0fGetBlockRequest\x12\x12\n" + + "\x04slot\x18\x01 \x01(\x04R\x04slot\x12H\n" + + "\x04opts\x18\x02 \x01(\v24.capabilities.blockchain.solana.v1alpha.GetBlockOptsR\x04opts\")\n" + + "\x15GetFeeForMessageReply\x12\x10\n" + + "\x03fee\x18\x01 \x01(\x04R\x03fee\"\x8b\x01\n" + + "\x17GetFeeForMessageRequest\x12\x18\n" + + "\amessage\x18\x01 \x01(\tR\amessage\x12V\n" + + "\n" + + "commitment\x18\x02 \x01(\x0e26.capabilities.blockchain.solana.v1alpha.CommitmentTypeR\n" + + "commitment\"\xbf\x02\n" + + "\x17GetMultipleAccountsOpts\x12P\n" + + "\bencoding\x18\x01 \x01(\x0e24.capabilities.blockchain.solana.v1alpha.EncodingTypeR\bencoding\x12V\n" + + "\n" + + "commitment\x18\x02 \x01(\x0e26.capabilities.blockchain.solana.v1alpha.CommitmentTypeR\n" + + "commitment\x12P\n" + + "\n" + + "data_slice\x18\x03 \x01(\v21.capabilities.blockchain.solana.v1alpha.DataSliceR\tdataSlice\x12(\n" + + "\x10min_context_slot\x18\x04 \x01(\x04R\x0eminContextSlot\"t\n" + + "\x16OptionalAccountWrapper\x12N\n" + + "\aaccount\x18\x01 \x01(\v2/.capabilities.blockchain.solana.v1alpha.AccountH\x00R\aaccount\x88\x01\x01B\n" + + "\n" + + "\b_account\"x\n" + + " GetMultipleAccountsWithOptsReply\x12T\n" + + "\x05value\x18\x02 \x03(\v2>.capabilities.blockchain.solana.v1alpha.OptionalAccountWrapperR\x05value\"\x95\x01\n" + + "\"GetMultipleAccountsWithOptsRequest\x12\x1a\n" + + "\baccounts\x18\x01 \x03(\fR\baccounts\x12S\n" + + "\x04opts\x18\x02 \x01(\v2?.capabilities.blockchain.solana.v1alpha.GetMultipleAccountsOptsR\x04opts\"y\n" + + "\x19GetSignatureStatusesReply\x12\\\n" + + "\aresults\x18\x01 \x03(\v2B.capabilities.blockchain.solana.v1alpha.GetSignatureStatusesResultR\aresults\"1\n" + + "\x1bGetSignatureStatusesRequest\x12\x12\n" + + "\x04sigs\x18\x01 \x03(\fR\x04sigs\"\xf0\x01\n" + + "\x1aGetSignatureStatusesResult\x12\x12\n" + + "\x04slot\x18\x01 \x01(\x04R\x04slot\x12)\n" + + "\rconfirmations\x18\x02 \x01(\x04H\x00R\rconfirmations\x88\x01\x01\x12\x10\n" + + "\x03err\x18\x03 \x01(\tR\x03err\x12o\n" + + "\x13confirmation_status\x18\x04 \x01(\x0e2>.capabilities.blockchain.solana.v1alpha.ConfirmationStatusTypeR\x12confirmationStatusB\x10\n" + + "\x0e_confirmations\",\n" + + "\x12GetSlotHeightReply\x12\x16\n" + + "\x06height\x18\x01 \x01(\x04R\x06height\"n\n" + + "\x14GetSlotHeightRequest\x12V\n" + + "\n" + + "commitment\x18\x01 \x01(\x0e26.capabilities.blockchain.solana.v1alpha.CommitmentTypeR\n" + + "commitment\"\xcd\x01\n" + + "\rMessageHeader\x126\n" + + "\x17num_required_signatures\x18\x01 \x01(\rR\x15numRequiredSignatures\x12?\n" + + "\x1cnum_readonly_signed_accounts\x18\x02 \x01(\rR\x19numReadonlySignedAccounts\x12C\n" + + "\x1enum_readonly_unsigned_accounts\x18\x03 \x01(\rR\x1bnumReadonlyUnsignedAccounts\"\x8d\x02\n" + + "\rParsedMessage\x12)\n" + + "\x10recent_blockhash\x18\x01 \x01(\fR\x0frecentBlockhash\x12!\n" + + "\faccount_keys\x18\x02 \x03(\fR\vaccountKeys\x12M\n" + + "\x06header\x18\x03 \x01(\v25.capabilities.blockchain.solana.v1alpha.MessageHeaderR\x06header\x12_\n" + + "\finstructions\x18\x04 \x03(\v2;.capabilities.blockchain.solana.v1alpha.CompiledInstructionR\finstructions\"\x84\x01\n" + + "\x11ParsedTransaction\x12\x1e\n" + + "\n" + + "signatures\x18\x01 \x03(\fR\n" + + "signatures\x12O\n" + + "\amessage\x18\x02 \x01(\v25.capabilities.blockchain.solana.v1alpha.ParsedMessageR\amessage\"m\n" + + "\rUiTokenAmount\x12\x16\n" + + "\x06amount\x18\x01 \x01(\tR\x06amount\x12\x1a\n" + + "\bdecimals\x18\x02 \x01(\rR\bdecimals\x12(\n" + + "\x10ui_amount_string\x18\x04 \x01(\tR\x0euiAmountString\"\xe6\x01\n" + + "\fTokenBalance\x12#\n" + + "\raccount_index\x18\x01 \x01(\rR\faccountIndex\x12\x19\n" + + "\x05owner\x18\x02 \x01(\fH\x00R\x05owner\x88\x01\x01\x12\"\n" + + "\n" + + "program_id\x18\x03 \x01(\fH\x01R\tprogramId\x88\x01\x01\x12\x12\n" + + "\x04mint\x18\x04 \x01(\fR\x04mint\x12E\n" + + "\x02ui\x18\x05 \x01(\v25.capabilities.blockchain.solana.v1alpha.UiTokenAmountR\x02uiB\b\n" + + "\x06_ownerB\r\n" + + "\v_program_id\"\x89\x01\n" + + "\x10InnerInstruction\x12\x14\n" + + "\x05index\x18\x01 \x01(\rR\x05index\x12_\n" + + "\finstructions\x18\x02 \x03(\v2;.capabilities.blockchain.solana.v1alpha.CompiledInstructionR\finstructions\"I\n" + + "\x0fLoadedAddresses\x12\x1a\n" + + "\breadonly\x18\x01 \x03(\fR\breadonly\x12\x1a\n" + + "\bwritable\x18\x02 \x03(\fR\bwritable\"\x92\x01\n" + + "\x13CompiledInstruction\x12(\n" + + "\x10program_id_index\x18\x01 \x01(\rR\x0eprogramIdIndex\x12\x1a\n" + + "\baccounts\x18\x02 \x03(\rR\baccounts\x12\x12\n" + + "\x04data\x18\x03 \x01(\fR\x04data\x12!\n" + + "\fstack_height\x18\x04 \x01(\rR\vstackHeight\"r\n" + + "\x04Data\x12\x18\n" + + "\acontent\x18\x01 \x01(\fR\acontent\x12P\n" + + "\bencoding\x18\x02 \x01(\x0e24.capabilities.blockchain.solana.v1alpha.EncodingTypeR\bencoding\"m\n" + + "\n" + + "ReturnData\x12\x1d\n" + + "\n" + + "program_id\x18\x01 \x01(\fR\tprogramId\x12@\n" + + "\x04data\x18\x02 \x01(\v2,.capabilities.blockchain.solana.v1alpha.DataR\x04data\"\xeb\x05\n" + + "\x0fTransactionMeta\x12\x19\n" + + "\berr_json\x18\x01 \x01(\tR\aerrJson\x12\x10\n" + + "\x03fee\x18\x02 \x01(\x04R\x03fee\x12!\n" + + "\fpre_balances\x18\x03 \x03(\x04R\vpreBalances\x12#\n" + + "\rpost_balances\x18\x04 \x03(\x04R\fpostBalances\x12!\n" + + "\flog_messages\x18\x05 \x03(\tR\vlogMessages\x12b\n" + + "\x12pre_token_balances\x18\x06 \x03(\v24.capabilities.blockchain.solana.v1alpha.TokenBalanceR\x10preTokenBalances\x12d\n" + + "\x13post_token_balances\x18\a \x03(\v24.capabilities.blockchain.solana.v1alpha.TokenBalanceR\x11postTokenBalances\x12g\n" + + "\x12inner_instructions\x18\b \x03(\v28.capabilities.blockchain.solana.v1alpha.InnerInstructionR\x11innerInstructions\x12b\n" + + "\x10loaded_addresses\x18\t \x01(\v27.capabilities.blockchain.solana.v1alpha.LoadedAddressesR\x0floadedAddresses\x12S\n" + + "\vreturn_data\x18\n" + + " \x01(\v22.capabilities.blockchain.solana.v1alpha.ReturnDataR\n" + + "returnData\x129\n" + + "\x16compute_units_consumed\x18\v \x01(\x04H\x00R\x14computeUnitsConsumed\x88\x01\x01B\x19\n" + + "\x17_compute_units_consumed\"\x8d\x01\n" + + "\x13TransactionEnvelope\x12\x12\n" + + "\x03raw\x18\x01 \x01(\fH\x00R\x03raw\x12S\n" + + "\x06parsed\x18\x02 \x01(\v29.capabilities.blockchain.solana.v1alpha.ParsedTransactionH\x00R\x06parsedB\r\n" + + "\vtransaction\"\xab\x02\n" + + "\x13GetTransactionReply\x12\x12\n" + + "\x04slot\x18\x01 \x01(\x04R\x04slot\x12\"\n" + + "\n" + + "block_time\x18\x02 \x01(\x03H\x00R\tblockTime\x88\x01\x01\x12b\n" + + "\vtransaction\x18\x03 \x01(\v2;.capabilities.blockchain.solana.v1alpha.TransactionEnvelopeH\x01R\vtransaction\x88\x01\x01\x12P\n" + + "\x04meta\x18\x04 \x01(\v27.capabilities.blockchain.solana.v1alpha.TransactionMetaH\x02R\x04meta\x88\x01\x01B\r\n" + + "\v_block_timeB\x0e\n" + + "\f_transactionB\a\n" + + "\x05_meta\"5\n" + + "\x15GetTransactionRequest\x12\x1c\n" + + "\tsignature\x18\x01 \x01(\fR\tsignature\"\xa6\x02\n" + + "\x0eSimulateTXOpts\x12\x1d\n" + + "\n" + + "sig_verify\x18\x01 \x01(\bR\tsigVerify\x12V\n" + + "\n" + + "commitment\x18\x02 \x01(\x0e26.capabilities.blockchain.solana.v1alpha.CommitmentTypeR\n" + + "commitment\x128\n" + + "\x18replace_recent_blockhash\x18\x03 \x01(\bR\x16replaceRecentBlockhash\x12c\n" + + "\baccounts\x18\x04 \x01(\v2G.capabilities.blockchain.solana.v1alpha.SimulateTransactionAccountsOptsR\baccounts\"\xab\x01\n" + + "\x0fSimulateTXReply\x12\x10\n" + + "\x03err\x18\x01 \x01(\tR\x03err\x12\x12\n" + + "\x04logs\x18\x02 \x03(\tR\x04logs\x12K\n" + + "\baccounts\x18\x03 \x03(\v2/.capabilities.blockchain.solana.v1alpha.AccountR\baccounts\x12%\n" + + "\x0eunits_consumed\x18\x04 \x01(\x04R\runitsConsumed\"\xac\x01\n" + + "\x11SimulateTXRequest\x12\x1a\n" + + "\breceiver\x18\x01 \x01(\fR\breceiver\x12/\n" + + "\x13encoded_transaction\x18\x02 \x01(\tR\x12encodedTransaction\x12J\n" + + "\x04opts\x18\x03 \x01(\v26.capabilities.blockchain.solana.v1alpha.SimulateTXOptsR\x04opts\"\x91\x01\n" + + "\x1fSimulateTransactionAccountsOpts\x12P\n" + + "\bencoding\x18\x01 \x01(\x0e24.capabilities.blockchain.solana.v1alpha.EncodingTypeR\bencoding\x12\x1c\n" + + "\taddresses\x18\x02 \x03(\fR\taddresses\"\x7f\n" + + "\x0fValueComparator\x12\x14\n" + + "\x05value\x18\x01 \x01(\fR\x05value\x12V\n" + + "\boperator\x18\x02 \x01(\x0e2:.capabilities.blockchain.solana.v1alpha.ComparisonOperatorR\boperator\"y\n" + + "\fSubkeyConfig\x12\x12\n" + + "\x04path\x18\x01 \x03(\tR\x04path\x12U\n" + + "\tcomparers\x18\x02 \x03(\v27.capabilities.blockchain.solana.v1alpha.ValueComparatorR\tcomparers\"U\n" + + "\x0fCPIFilterConfig\x12!\n" + + "\fdest_address\x18\x01 \x01(\fR\vdestAddress\x12\x1f\n" + + "\vmethod_name\x18\x02 \x01(\fR\n" + + "methodName\"\xe2\x02\n" + + "\x17FilterLogTriggerRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + + "\aaddress\x18\x02 \x01(\fR\aaddress\x12\x1d\n" + + "\n" + + "event_name\x18\x03 \x01(\tR\teventName\x12*\n" + + "\x11contract_idl_json\x18\x04 \x01(\fR\x0fcontractIdlJson\x12N\n" + + "\asubkeys\x18\x05 \x03(\v24.capabilities.blockchain.solana.v1alpha.SubkeyConfigR\asubkeys\x12h\n" + + "\x11cpi_filter_config\x18\x06 \x01(\v27.capabilities.blockchain.solana.v1alpha.CPIFilterConfigH\x00R\x0fcpiFilterConfig\x88\x01\x01B\x14\n" + + "\x12_cpi_filter_config\"\xd4\x02\n" + + "\x03Log\x12\x19\n" + + "\bchain_id\x18\x01 \x01(\tR\achainId\x12\x1b\n" + + "\tlog_index\x18\x02 \x01(\x03R\blogIndex\x12\x1d\n" + + "\n" + + "block_hash\x18\x03 \x01(\fR\tblockHash\x12!\n" + + "\fblock_number\x18\x04 \x01(\x03R\vblockNumber\x12'\n" + + "\x0fblock_timestamp\x18\x05 \x01(\x04R\x0eblockTimestamp\x12\x18\n" + + "\aaddress\x18\x06 \x01(\fR\aaddress\x12\x1b\n" + + "\tevent_sig\x18\a \x01(\fR\beventSig\x12\x17\n" + + "\atx_hash\x18\b \x01(\fR\x06txHash\x12\x12\n" + + "\x04data\x18\t \x01(\fR\x04data\x12!\n" + + "\fsequence_num\x18\n" + + " \x01(\x03R\vsequenceNum\x12\x19\n" + + "\x05error\x18\v \x01(\tH\x00R\x05error\x88\x01\x01B\b\n" + + "\x06_error\"M\n" + + "\vAccountMeta\x12\x1d\n" + + "\n" + + "public_key\x18\x01 \x01(\fR\tpublicKey\x12\x1f\n" + + "\vis_writable\x18\x02 \x01(\bR\n" + + "isWritable\"\xbf\x02\n" + + "\x12WriteReportRequest\x12b\n" + + "\x12remaining_accounts\x18\x01 \x03(\v23.capabilities.blockchain.solana.v1alpha.AccountMetaR\x11remainingAccounts\x12\x1a\n" + + "\breceiver\x18\x02 \x01(\fR\breceiver\x12a\n" + + "\x0ecompute_config\x18\x03 \x01(\v25.capabilities.blockchain.solana.v1alpha.ComputeConfigH\x00R\rcomputeConfig\x88\x01\x01\x123\n" + + "\x06report\x18\x04 \x01(\v2\x1b.sdk.v1alpha.ReportResponseR\x06reportB\x11\n" + + "\x0f_compute_config\"\xdb\x03\n" + + "\x10WriteReportReply\x12M\n" + + "\ttx_status\x18\x01 \x01(\x0e20.capabilities.blockchain.solana.v1alpha.TxStatusR\btxStatus\x12\x99\x01\n" + + "\"receiver_contract_execution_status\x18\x02 \x01(\x0e2G.capabilities.blockchain.solana.v1alpha.ReceiverContractExecutionStatusH\x00R\x1freceiverContractExecutionStatus\x88\x01\x01\x12&\n" + + "\ftx_signature\x18\x03 \x01(\fH\x01R\vtxSignature\x88\x01\x01\x12,\n" + + "\x0ftransaction_fee\x18\x04 \x01(\x04H\x02R\x0etransactionFee\x88\x01\x01\x12(\n" + + "\rerror_message\x18\x05 \x01(\tH\x03R\ferrorMessage\x88\x01\x01B%\n" + + "#_receiver_contract_execution_statusB\x0f\n" + + "\r_tx_signatureB\x12\n" + + "\x10_transaction_feeB\x10\n" + + "\x0e_error_message*\xb0\x01\n" + + "\fEncodingType\x12\x16\n" + + "\x12ENCODING_TYPE_NONE\x10\x00\x12\x18\n" + + "\x14ENCODING_TYPE_BASE58\x10\x01\x12\x18\n" + + "\x14ENCODING_TYPE_BASE64\x10\x02\x12\x1d\n" + + "\x19ENCODING_TYPE_BASE64_ZSTD\x10\x03\x12\x1d\n" + + "\x19ENCODING_TYPE_JSON_PARSED\x10\x04\x12\x16\n" + + "\x12ENCODING_TYPE_JSON\x10\x05*\x87\x01\n" + + "\x0eCommitmentType\x12\x18\n" + + "\x14COMMITMENT_TYPE_NONE\x10\x00\x12\x1d\n" + + "\x19COMMITMENT_TYPE_FINALIZED\x10\x01\x12\x1d\n" + + "\x19COMMITMENT_TYPE_CONFIRMED\x10\x02\x12\x1d\n" + + "\x19COMMITMENT_TYPE_PROCESSED\x10\x03*\xb3\x01\n" + + "\x16ConfirmationStatusType\x12!\n" + + "\x1dCONFIRMATION_STATUS_TYPE_NONE\x10\x00\x12&\n" + + "\"CONFIRMATION_STATUS_TYPE_PROCESSED\x10\x01\x12&\n" + + "\"CONFIRMATION_STATUS_TYPE_CONFIRMED\x10\x02\x12&\n" + + "\"CONFIRMATION_STATUS_TYPE_FINALIZED\x10\x03*M\n" + + "\bTxStatus\x12\x13\n" + + "\x0fTX_STATUS_FATAL\x10\x00\x12\x15\n" + + "\x11TX_STATUS_ABORTED\x10\x01\x12\x15\n" + + "\x11TX_STATUS_SUCCESS\x10\x02*\xbf\x01\n" + + "\x12ComparisonOperator\x12\x1a\n" + + "\x16COMPARISON_OPERATOR_EQ\x10\x00\x12\x1b\n" + + "\x17COMPARISON_OPERATOR_NEQ\x10\x01\x12\x1a\n" + + "\x16COMPARISON_OPERATOR_GT\x10\x02\x12\x1a\n" + + "\x16COMPARISON_OPERATOR_LT\x10\x03\x12\x1b\n" + + "\x17COMPARISON_OPERATOR_GTE\x10\x04\x12\x1b\n" + + "\x17COMPARISON_OPERATOR_LTE\x10\x05*\x82\x01\n" + + "\x1fReceiverContractExecutionStatus\x12.\n" + + "*RECEIVER_CONTRACT_EXECUTION_STATUS_SUCCESS\x10\x00\x12/\n" + + "+RECEIVER_CONTRACT_EXECUTION_STATUS_REVERTED\x10\x012\x80\f\n" + + "\x06Client\x12\xa4\x01\n" + + "\x16GetAccountInfoWithOpts\x12E.capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsRequest\x1aC.capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsReply\x12\x80\x01\n" + + "\n" + + "GetBalance\x129.capabilities.blockchain.solana.v1alpha.GetBalanceRequest\x1a7.capabilities.blockchain.solana.v1alpha.GetBalanceReply\x12z\n" + + "\bGetBlock\x127.capabilities.blockchain.solana.v1alpha.GetBlockRequest\x1a5.capabilities.blockchain.solana.v1alpha.GetBlockReply\x12\x92\x01\n" + + "\x10GetFeeForMessage\x12?.capabilities.blockchain.solana.v1alpha.GetFeeForMessageRequest\x1a=.capabilities.blockchain.solana.v1alpha.GetFeeForMessageReply\x12\xb3\x01\n" + + "\x1bGetMultipleAccountsWithOpts\x12J.capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsRequest\x1aH.capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsReply\x12\x9e\x01\n" + + "\x14GetSignatureStatuses\x12C.capabilities.blockchain.solana.v1alpha.GetSignatureStatusesRequest\x1aA.capabilities.blockchain.solana.v1alpha.GetSignatureStatusesReply\x12\x89\x01\n" + + "\rGetSlotHeight\x12<.capabilities.blockchain.solana.v1alpha.GetSlotHeightRequest\x1a:.capabilities.blockchain.solana.v1alpha.GetSlotHeightReply\x12\x8c\x01\n" + + "\x0eGetTransaction\x12=.capabilities.blockchain.solana.v1alpha.GetTransactionRequest\x1a;.capabilities.blockchain.solana.v1alpha.GetTransactionReply\x12|\n" + + "\n" + + "LogTrigger\x12?.capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest\x1a+.capabilities.blockchain.solana.v1alpha.Log0\x01\x12\x83\x01\n" + + "\vWriteReport\x12:.capabilities.blockchain.solana.v1alpha.WriteReportRequest\x1a8.capabilities.blockchain.solana.v1alpha.WriteReportReply\x1aE\x82\xb5\x18A\b\x01\x12\fsolana@1.0.0\x1a/\n" + + "\rChainSelector\x12\x1e\x12\x1c\n" + + "\x1a\n" + + "\rsolana-devnet\x10\xdf\uf327\xa9\xfc\xb1\xf6\xe3\x01b\x06proto3" + +var ( + file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescOnce sync.Once + file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescData []byte +) + +func file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP() []byte { + file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescOnce.Do(func() { + file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_capabilities_blockchain_solana_v1alpha_client_proto_rawDesc), len(file_capabilities_blockchain_solana_v1alpha_client_proto_rawDesc))) + }) + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescData +} + +var file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes = make([]protoimpl.MessageInfo, 49) +var file_capabilities_blockchain_solana_v1alpha_client_proto_goTypes = []any{ + (EncodingType)(0), // 0: capabilities.blockchain.solana.v1alpha.EncodingType + (CommitmentType)(0), // 1: capabilities.blockchain.solana.v1alpha.CommitmentType + (ConfirmationStatusType)(0), // 2: capabilities.blockchain.solana.v1alpha.ConfirmationStatusType + (TxStatus)(0), // 3: capabilities.blockchain.solana.v1alpha.TxStatus + (ComparisonOperator)(0), // 4: capabilities.blockchain.solana.v1alpha.ComparisonOperator + (ReceiverContractExecutionStatus)(0), // 5: capabilities.blockchain.solana.v1alpha.ReceiverContractExecutionStatus + (*Account)(nil), // 6: capabilities.blockchain.solana.v1alpha.Account + (*ComputeConfig)(nil), // 7: capabilities.blockchain.solana.v1alpha.ComputeConfig + (*DataBytesOrJSON)(nil), // 8: capabilities.blockchain.solana.v1alpha.DataBytesOrJSON + (*DataSlice)(nil), // 9: capabilities.blockchain.solana.v1alpha.DataSlice + (*GetAccountInfoOpts)(nil), // 10: capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts + (*GetAccountInfoWithOptsReply)(nil), // 11: capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsReply + (*GetAccountInfoWithOptsRequest)(nil), // 12: capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsRequest + (*GetBalanceReply)(nil), // 13: capabilities.blockchain.solana.v1alpha.GetBalanceReply + (*GetBalanceRequest)(nil), // 14: capabilities.blockchain.solana.v1alpha.GetBalanceRequest + (*GetBlockOpts)(nil), // 15: capabilities.blockchain.solana.v1alpha.GetBlockOpts + (*GetBlockReply)(nil), // 16: capabilities.blockchain.solana.v1alpha.GetBlockReply + (*GetBlockRequest)(nil), // 17: capabilities.blockchain.solana.v1alpha.GetBlockRequest + (*GetFeeForMessageReply)(nil), // 18: capabilities.blockchain.solana.v1alpha.GetFeeForMessageReply + (*GetFeeForMessageRequest)(nil), // 19: capabilities.blockchain.solana.v1alpha.GetFeeForMessageRequest + (*GetMultipleAccountsOpts)(nil), // 20: capabilities.blockchain.solana.v1alpha.GetMultipleAccountsOpts + (*OptionalAccountWrapper)(nil), // 21: capabilities.blockchain.solana.v1alpha.OptionalAccountWrapper + (*GetMultipleAccountsWithOptsReply)(nil), // 22: capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsReply + (*GetMultipleAccountsWithOptsRequest)(nil), // 23: capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsRequest + (*GetSignatureStatusesReply)(nil), // 24: capabilities.blockchain.solana.v1alpha.GetSignatureStatusesReply + (*GetSignatureStatusesRequest)(nil), // 25: capabilities.blockchain.solana.v1alpha.GetSignatureStatusesRequest + (*GetSignatureStatusesResult)(nil), // 26: capabilities.blockchain.solana.v1alpha.GetSignatureStatusesResult + (*GetSlotHeightReply)(nil), // 27: capabilities.blockchain.solana.v1alpha.GetSlotHeightReply + (*GetSlotHeightRequest)(nil), // 28: capabilities.blockchain.solana.v1alpha.GetSlotHeightRequest + (*MessageHeader)(nil), // 29: capabilities.blockchain.solana.v1alpha.MessageHeader + (*ParsedMessage)(nil), // 30: capabilities.blockchain.solana.v1alpha.ParsedMessage + (*ParsedTransaction)(nil), // 31: capabilities.blockchain.solana.v1alpha.ParsedTransaction + (*UiTokenAmount)(nil), // 32: capabilities.blockchain.solana.v1alpha.UiTokenAmount + (*TokenBalance)(nil), // 33: capabilities.blockchain.solana.v1alpha.TokenBalance + (*InnerInstruction)(nil), // 34: capabilities.blockchain.solana.v1alpha.InnerInstruction + (*LoadedAddresses)(nil), // 35: capabilities.blockchain.solana.v1alpha.LoadedAddresses + (*CompiledInstruction)(nil), // 36: capabilities.blockchain.solana.v1alpha.CompiledInstruction + (*Data)(nil), // 37: capabilities.blockchain.solana.v1alpha.Data + (*ReturnData)(nil), // 38: capabilities.blockchain.solana.v1alpha.ReturnData + (*TransactionMeta)(nil), // 39: capabilities.blockchain.solana.v1alpha.TransactionMeta + (*TransactionEnvelope)(nil), // 40: capabilities.blockchain.solana.v1alpha.TransactionEnvelope + (*GetTransactionReply)(nil), // 41: capabilities.blockchain.solana.v1alpha.GetTransactionReply + (*GetTransactionRequest)(nil), // 42: capabilities.blockchain.solana.v1alpha.GetTransactionRequest + (*SimulateTXOpts)(nil), // 43: capabilities.blockchain.solana.v1alpha.SimulateTXOpts + (*SimulateTXReply)(nil), // 44: capabilities.blockchain.solana.v1alpha.SimulateTXReply + (*SimulateTXRequest)(nil), // 45: capabilities.blockchain.solana.v1alpha.SimulateTXRequest + (*SimulateTransactionAccountsOpts)(nil), // 46: capabilities.blockchain.solana.v1alpha.SimulateTransactionAccountsOpts + (*ValueComparator)(nil), // 47: capabilities.blockchain.solana.v1alpha.ValueComparator + (*SubkeyConfig)(nil), // 48: capabilities.blockchain.solana.v1alpha.SubkeyConfig + (*CPIFilterConfig)(nil), // 49: capabilities.blockchain.solana.v1alpha.CPIFilterConfig + (*FilterLogTriggerRequest)(nil), // 50: capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest + (*Log)(nil), // 51: capabilities.blockchain.solana.v1alpha.Log + (*AccountMeta)(nil), // 52: capabilities.blockchain.solana.v1alpha.AccountMeta + (*WriteReportRequest)(nil), // 53: capabilities.blockchain.solana.v1alpha.WriteReportRequest + (*WriteReportReply)(nil), // 54: capabilities.blockchain.solana.v1alpha.WriteReportReply + (*pb.BigInt)(nil), // 55: values.v1.BigInt + (*sdk.ReportResponse)(nil), // 56: sdk.v1alpha.ReportResponse +} +var file_capabilities_blockchain_solana_v1alpha_client_proto_depIdxs = []int32{ + 8, // 0: capabilities.blockchain.solana.v1alpha.Account.data:type_name -> capabilities.blockchain.solana.v1alpha.DataBytesOrJSON + 55, // 1: capabilities.blockchain.solana.v1alpha.Account.rent_epoch:type_name -> values.v1.BigInt + 0, // 2: capabilities.blockchain.solana.v1alpha.DataBytesOrJSON.encoding:type_name -> capabilities.blockchain.solana.v1alpha.EncodingType + 0, // 3: capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts.encoding:type_name -> capabilities.blockchain.solana.v1alpha.EncodingType + 1, // 4: capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts.commitment:type_name -> capabilities.blockchain.solana.v1alpha.CommitmentType + 9, // 5: capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts.data_slice:type_name -> capabilities.blockchain.solana.v1alpha.DataSlice + 6, // 6: capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsReply.value:type_name -> capabilities.blockchain.solana.v1alpha.Account + 10, // 7: capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsRequest.opts:type_name -> capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts + 1, // 8: capabilities.blockchain.solana.v1alpha.GetBalanceRequest.commitment:type_name -> capabilities.blockchain.solana.v1alpha.CommitmentType + 1, // 9: capabilities.blockchain.solana.v1alpha.GetBlockOpts.commitment:type_name -> capabilities.blockchain.solana.v1alpha.CommitmentType + 15, // 10: capabilities.blockchain.solana.v1alpha.GetBlockRequest.opts:type_name -> capabilities.blockchain.solana.v1alpha.GetBlockOpts + 1, // 11: capabilities.blockchain.solana.v1alpha.GetFeeForMessageRequest.commitment:type_name -> capabilities.blockchain.solana.v1alpha.CommitmentType + 0, // 12: capabilities.blockchain.solana.v1alpha.GetMultipleAccountsOpts.encoding:type_name -> capabilities.blockchain.solana.v1alpha.EncodingType + 1, // 13: capabilities.blockchain.solana.v1alpha.GetMultipleAccountsOpts.commitment:type_name -> capabilities.blockchain.solana.v1alpha.CommitmentType + 9, // 14: capabilities.blockchain.solana.v1alpha.GetMultipleAccountsOpts.data_slice:type_name -> capabilities.blockchain.solana.v1alpha.DataSlice + 6, // 15: capabilities.blockchain.solana.v1alpha.OptionalAccountWrapper.account:type_name -> capabilities.blockchain.solana.v1alpha.Account + 21, // 16: capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsReply.value:type_name -> capabilities.blockchain.solana.v1alpha.OptionalAccountWrapper + 20, // 17: capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsRequest.opts:type_name -> capabilities.blockchain.solana.v1alpha.GetMultipleAccountsOpts + 26, // 18: capabilities.blockchain.solana.v1alpha.GetSignatureStatusesReply.results:type_name -> capabilities.blockchain.solana.v1alpha.GetSignatureStatusesResult + 2, // 19: capabilities.blockchain.solana.v1alpha.GetSignatureStatusesResult.confirmation_status:type_name -> capabilities.blockchain.solana.v1alpha.ConfirmationStatusType + 1, // 20: capabilities.blockchain.solana.v1alpha.GetSlotHeightRequest.commitment:type_name -> capabilities.blockchain.solana.v1alpha.CommitmentType + 29, // 21: capabilities.blockchain.solana.v1alpha.ParsedMessage.header:type_name -> capabilities.blockchain.solana.v1alpha.MessageHeader + 36, // 22: capabilities.blockchain.solana.v1alpha.ParsedMessage.instructions:type_name -> capabilities.blockchain.solana.v1alpha.CompiledInstruction + 30, // 23: capabilities.blockchain.solana.v1alpha.ParsedTransaction.message:type_name -> capabilities.blockchain.solana.v1alpha.ParsedMessage + 32, // 24: capabilities.blockchain.solana.v1alpha.TokenBalance.ui:type_name -> capabilities.blockchain.solana.v1alpha.UiTokenAmount + 36, // 25: capabilities.blockchain.solana.v1alpha.InnerInstruction.instructions:type_name -> capabilities.blockchain.solana.v1alpha.CompiledInstruction + 0, // 26: capabilities.blockchain.solana.v1alpha.Data.encoding:type_name -> capabilities.blockchain.solana.v1alpha.EncodingType + 37, // 27: capabilities.blockchain.solana.v1alpha.ReturnData.data:type_name -> capabilities.blockchain.solana.v1alpha.Data + 33, // 28: capabilities.blockchain.solana.v1alpha.TransactionMeta.pre_token_balances:type_name -> capabilities.blockchain.solana.v1alpha.TokenBalance + 33, // 29: capabilities.blockchain.solana.v1alpha.TransactionMeta.post_token_balances:type_name -> capabilities.blockchain.solana.v1alpha.TokenBalance + 34, // 30: capabilities.blockchain.solana.v1alpha.TransactionMeta.inner_instructions:type_name -> capabilities.blockchain.solana.v1alpha.InnerInstruction + 35, // 31: capabilities.blockchain.solana.v1alpha.TransactionMeta.loaded_addresses:type_name -> capabilities.blockchain.solana.v1alpha.LoadedAddresses + 38, // 32: capabilities.blockchain.solana.v1alpha.TransactionMeta.return_data:type_name -> capabilities.blockchain.solana.v1alpha.ReturnData + 31, // 33: capabilities.blockchain.solana.v1alpha.TransactionEnvelope.parsed:type_name -> capabilities.blockchain.solana.v1alpha.ParsedTransaction + 40, // 34: capabilities.blockchain.solana.v1alpha.GetTransactionReply.transaction:type_name -> capabilities.blockchain.solana.v1alpha.TransactionEnvelope + 39, // 35: capabilities.blockchain.solana.v1alpha.GetTransactionReply.meta:type_name -> capabilities.blockchain.solana.v1alpha.TransactionMeta + 1, // 36: capabilities.blockchain.solana.v1alpha.SimulateTXOpts.commitment:type_name -> capabilities.blockchain.solana.v1alpha.CommitmentType + 46, // 37: capabilities.blockchain.solana.v1alpha.SimulateTXOpts.accounts:type_name -> capabilities.blockchain.solana.v1alpha.SimulateTransactionAccountsOpts + 6, // 38: capabilities.blockchain.solana.v1alpha.SimulateTXReply.accounts:type_name -> capabilities.blockchain.solana.v1alpha.Account + 43, // 39: capabilities.blockchain.solana.v1alpha.SimulateTXRequest.opts:type_name -> capabilities.blockchain.solana.v1alpha.SimulateTXOpts + 0, // 40: capabilities.blockchain.solana.v1alpha.SimulateTransactionAccountsOpts.encoding:type_name -> capabilities.blockchain.solana.v1alpha.EncodingType + 4, // 41: capabilities.blockchain.solana.v1alpha.ValueComparator.operator:type_name -> capabilities.blockchain.solana.v1alpha.ComparisonOperator + 47, // 42: capabilities.blockchain.solana.v1alpha.SubkeyConfig.comparers:type_name -> capabilities.blockchain.solana.v1alpha.ValueComparator + 48, // 43: capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest.subkeys:type_name -> capabilities.blockchain.solana.v1alpha.SubkeyConfig + 49, // 44: capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest.cpi_filter_config:type_name -> capabilities.blockchain.solana.v1alpha.CPIFilterConfig + 52, // 45: capabilities.blockchain.solana.v1alpha.WriteReportRequest.remaining_accounts:type_name -> capabilities.blockchain.solana.v1alpha.AccountMeta + 7, // 46: capabilities.blockchain.solana.v1alpha.WriteReportRequest.compute_config:type_name -> capabilities.blockchain.solana.v1alpha.ComputeConfig + 56, // 47: capabilities.blockchain.solana.v1alpha.WriteReportRequest.report:type_name -> sdk.v1alpha.ReportResponse + 3, // 48: capabilities.blockchain.solana.v1alpha.WriteReportReply.tx_status:type_name -> capabilities.blockchain.solana.v1alpha.TxStatus + 5, // 49: capabilities.blockchain.solana.v1alpha.WriteReportReply.receiver_contract_execution_status:type_name -> capabilities.blockchain.solana.v1alpha.ReceiverContractExecutionStatus + 12, // 50: capabilities.blockchain.solana.v1alpha.Client.GetAccountInfoWithOpts:input_type -> capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsRequest + 14, // 51: capabilities.blockchain.solana.v1alpha.Client.GetBalance:input_type -> capabilities.blockchain.solana.v1alpha.GetBalanceRequest + 17, // 52: capabilities.blockchain.solana.v1alpha.Client.GetBlock:input_type -> capabilities.blockchain.solana.v1alpha.GetBlockRequest + 19, // 53: capabilities.blockchain.solana.v1alpha.Client.GetFeeForMessage:input_type -> capabilities.blockchain.solana.v1alpha.GetFeeForMessageRequest + 23, // 54: capabilities.blockchain.solana.v1alpha.Client.GetMultipleAccountsWithOpts:input_type -> capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsRequest + 25, // 55: capabilities.blockchain.solana.v1alpha.Client.GetSignatureStatuses:input_type -> capabilities.blockchain.solana.v1alpha.GetSignatureStatusesRequest + 28, // 56: capabilities.blockchain.solana.v1alpha.Client.GetSlotHeight:input_type -> capabilities.blockchain.solana.v1alpha.GetSlotHeightRequest + 42, // 57: capabilities.blockchain.solana.v1alpha.Client.GetTransaction:input_type -> capabilities.blockchain.solana.v1alpha.GetTransactionRequest + 50, // 58: capabilities.blockchain.solana.v1alpha.Client.LogTrigger:input_type -> capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest + 53, // 59: capabilities.blockchain.solana.v1alpha.Client.WriteReport:input_type -> capabilities.blockchain.solana.v1alpha.WriteReportRequest + 11, // 60: capabilities.blockchain.solana.v1alpha.Client.GetAccountInfoWithOpts:output_type -> capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsReply + 13, // 61: capabilities.blockchain.solana.v1alpha.Client.GetBalance:output_type -> capabilities.blockchain.solana.v1alpha.GetBalanceReply + 16, // 62: capabilities.blockchain.solana.v1alpha.Client.GetBlock:output_type -> capabilities.blockchain.solana.v1alpha.GetBlockReply + 18, // 63: capabilities.blockchain.solana.v1alpha.Client.GetFeeForMessage:output_type -> capabilities.blockchain.solana.v1alpha.GetFeeForMessageReply + 22, // 64: capabilities.blockchain.solana.v1alpha.Client.GetMultipleAccountsWithOpts:output_type -> capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsReply + 24, // 65: capabilities.blockchain.solana.v1alpha.Client.GetSignatureStatuses:output_type -> capabilities.blockchain.solana.v1alpha.GetSignatureStatusesReply + 27, // 66: capabilities.blockchain.solana.v1alpha.Client.GetSlotHeight:output_type -> capabilities.blockchain.solana.v1alpha.GetSlotHeightReply + 41, // 67: capabilities.blockchain.solana.v1alpha.Client.GetTransaction:output_type -> capabilities.blockchain.solana.v1alpha.GetTransactionReply + 51, // 68: capabilities.blockchain.solana.v1alpha.Client.LogTrigger:output_type -> capabilities.blockchain.solana.v1alpha.Log + 54, // 69: capabilities.blockchain.solana.v1alpha.Client.WriteReport:output_type -> capabilities.blockchain.solana.v1alpha.WriteReportReply + 60, // [60:70] is the sub-list for method output_type + 50, // [50:60] is the sub-list for method input_type + 50, // [50:50] is the sub-list for extension type_name + 50, // [50:50] is the sub-list for extension extendee + 0, // [0:50] is the sub-list for field type_name +} + +func init() { file_capabilities_blockchain_solana_v1alpha_client_proto_init() } +func file_capabilities_blockchain_solana_v1alpha_client_proto_init() { + if File_capabilities_blockchain_solana_v1alpha_client_proto != nil { + return + } + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[2].OneofWrappers = []any{ + (*DataBytesOrJSON_Raw)(nil), + (*DataBytesOrJSON_Json)(nil), + } + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[5].OneofWrappers = []any{} + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[10].OneofWrappers = []any{} + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[15].OneofWrappers = []any{} + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[20].OneofWrappers = []any{} + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[27].OneofWrappers = []any{} + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[33].OneofWrappers = []any{} + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[34].OneofWrappers = []any{ + (*TransactionEnvelope_Raw)(nil), + (*TransactionEnvelope_Parsed)(nil), + } + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[35].OneofWrappers = []any{} + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[44].OneofWrappers = []any{} + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[45].OneofWrappers = []any{} + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[47].OneofWrappers = []any{} + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[48].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_capabilities_blockchain_solana_v1alpha_client_proto_rawDesc), len(file_capabilities_blockchain_solana_v1alpha_client_proto_rawDesc)), + NumEnums: 6, + NumMessages: 49, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_capabilities_blockchain_solana_v1alpha_client_proto_goTypes, + DependencyIndexes: file_capabilities_blockchain_solana_v1alpha_client_proto_depIdxs, + EnumInfos: file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes, + MessageInfos: file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes, + }.Build() + File_capabilities_blockchain_solana_v1alpha_client_proto = out.File + file_capabilities_blockchain_solana_v1alpha_client_proto_goTypes = nil + file_capabilities_blockchain_solana_v1alpha_client_proto_depIdxs = nil +} diff --git a/capabilities/blockchain/solana/client_sdk_gen.go b/capabilities/blockchain/solana/client_sdk_gen.go new file mode 100644 index 00000000..e66525dc --- /dev/null +++ b/capabilities/blockchain/solana/client_sdk_gen.go @@ -0,0 +1,364 @@ +// Code generated by github.com/smartcontractkit/cre-sdk-go/generator/protoc-gen-cre, DO NOT EDIT. + +package solana + +import ( + "errors" + "fmt" + "strconv" + + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" + + sdkpb "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" + "github.com/smartcontractkit/cre-sdk-go/cre" +) + +type Client struct { + ChainSelector uint64 + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 allow defaults for capabilities +} + +func (c *Client) GetAccountInfoWithOpts(runtime cre.Runtime, input *GetAccountInfoWithOptsRequest) cre.Promise[*GetAccountInfoWithOptsReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*GetAccountInfoWithOptsReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "solana" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "GetAccountInfoWithOpts", + }), func(i *sdkpb.CapabilityResponse) (*GetAccountInfoWithOptsReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &GetAccountInfoWithOptsReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +func (c *Client) GetBalance(runtime cre.Runtime, input *GetBalanceRequest) cre.Promise[*GetBalanceReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*GetBalanceReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "solana" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "GetBalance", + }), func(i *sdkpb.CapabilityResponse) (*GetBalanceReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &GetBalanceReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +func (c *Client) GetBlock(runtime cre.Runtime, input *GetBlockRequest) cre.Promise[*GetBlockReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*GetBlockReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "solana" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "GetBlock", + }), func(i *sdkpb.CapabilityResponse) (*GetBlockReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &GetBlockReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +func (c *Client) GetFeeForMessage(runtime cre.Runtime, input *GetFeeForMessageRequest) cre.Promise[*GetFeeForMessageReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*GetFeeForMessageReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "solana" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "GetFeeForMessage", + }), func(i *sdkpb.CapabilityResponse) (*GetFeeForMessageReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &GetFeeForMessageReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +func (c *Client) GetMultipleAccountsWithOpts(runtime cre.Runtime, input *GetMultipleAccountsWithOptsRequest) cre.Promise[*GetMultipleAccountsWithOptsReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*GetMultipleAccountsWithOptsReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "solana" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "GetMultipleAccountsWithOpts", + }), func(i *sdkpb.CapabilityResponse) (*GetMultipleAccountsWithOptsReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &GetMultipleAccountsWithOptsReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +func (c *Client) GetSignatureStatuses(runtime cre.Runtime, input *GetSignatureStatusesRequest) cre.Promise[*GetSignatureStatusesReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*GetSignatureStatusesReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "solana" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "GetSignatureStatuses", + }), func(i *sdkpb.CapabilityResponse) (*GetSignatureStatusesReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &GetSignatureStatusesReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +func (c *Client) GetSlotHeight(runtime cre.Runtime, input *GetSlotHeightRequest) cre.Promise[*GetSlotHeightReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*GetSlotHeightReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "solana" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "GetSlotHeight", + }), func(i *sdkpb.CapabilityResponse) (*GetSlotHeightReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &GetSlotHeightReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +func (c *Client) GetTransaction(runtime cre.Runtime, input *GetTransactionRequest) cre.Promise[*GetTransactionReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*GetTransactionReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "solana" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "GetTransaction", + }), func(i *sdkpb.CapabilityResponse) (*GetTransactionReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &GetTransactionReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +func LogTrigger(chainSelector uint64, config *FilterLogTriggerRequest) cre.Trigger[*Log, *Log] { + configAny := &anypb.Any{} + _ = anypb.MarshalFrom(configAny, config, proto.MarshalOptions{Deterministic: true}) + return &clientLogTrigger{ + ChainSelector: chainSelector, + + config: configAny, + } +} + +type clientLogTrigger struct { + config *anypb.Any + ChainSelector uint64 +} + +func (*clientLogTrigger) IsTrigger() {} + +func (*clientLogTrigger) NewT() *Log { + return &Log{} +} + +func (c *clientLogTrigger) CapabilityID() string { + return "solana" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0" +} + +func (*clientLogTrigger) Method() string { + return "LogTrigger" +} + +func (t *clientLogTrigger) ConfigAsAny() *anypb.Any { + return t.config +} + +func (t *clientLogTrigger) Adapt(trigger *Log) (*Log, error) { + return trigger, nil +} + +type WriteCreReportRequest struct { + RemainingAccounts []*AccountMeta // accounts that are required by the receiver to accept the report + + Receiver []byte // 32 bytes receiver + + ComputeConfig *ComputeConfig + + Report *cre.Report +} + +// X_GeneratedCodeOnly_WrapWriteCreReportRequest is only meant to be used by the generated code. +func X_GeneratedCodeOnly_Wrap_WriteCreReportRequest(i *WriteReportRequest) (*WriteCreReportRequest, error) { //nolint + + remainingAccounts := i.RemainingAccounts + + receiver := i.Receiver + + computeConfig := i.ComputeConfig + + report, err := cre.X_GeneratedCodeOnly_WrapReport(i.Report) + if err != nil { + return nil, fmt.Errorf("failed to wrap report for field %s: %w", "Report", err) + } + + return &WriteCreReportRequest{ + + RemainingAccounts: remainingAccounts, + Receiver: receiver, + ComputeConfig: computeConfig, + Report: report, + }, nil +} + +// X_GeneratedCodeOnly_Unwrap is only meant to be used by the generated code. +func (i *WriteCreReportRequest) X_GeneratedCodeOnly_Unwrap() *WriteReportRequest { //nolint + return &WriteReportRequest{ + + RemainingAccounts: i.RemainingAccounts, + Receiver: i.Receiver, + ComputeConfig: i.ComputeConfig, + Report: i.Report.X_GeneratedCodeOnly_Unwrap(), + } +} + +func (c *Client) WriteReport(runtime cre.Runtime, input *WriteCreReportRequest) cre.Promise[*WriteReportReply] { + wrapped := &anypb.Any{} + err := anypb.MarshalFrom(wrapped, input.X_GeneratedCodeOnly_Unwrap(), proto.MarshalOptions{Deterministic: true}) + if err != nil { + return cre.PromiseFromResult[*WriteReportReply](nil, err) + } + + capCallResponse := cre.Then(runtime.CallCapability(&sdkpb.CapabilityRequest{ + Id: "solana" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0", + Payload: wrapped, + Method: "WriteReport", + }), func(i *sdkpb.CapabilityResponse) (*WriteReportReply, error) { + switch payload := i.Response.(type) { + case *sdkpb.CapabilityResponse_Error: + return nil, errors.New(payload.Error) + case *sdkpb.CapabilityResponse_Payload: + output := &WriteReportReply{} + err = payload.Payload.UnmarshalTo(output) + return output, err + default: + return nil, errors.New("unexpected response type") + } + }) + + return capCallResponse + +} + +const SolanaDevnet = 16423721717087811551 + +func ChainSelectorFromName(name string) (uint64, error) { + switch name { + case "solana-devnet": + return SolanaDevnet, nil + default: + return 0, errors.New("unknown ChainSelector" + name) + } +} diff --git a/capabilities/blockchain/solana/generate.go b/capabilities/blockchain/solana/generate.go new file mode 100644 index 00000000..874e6fb9 --- /dev/null +++ b/capabilities/blockchain/solana/generate.go @@ -0,0 +1,2 @@ +//go:generate go run ./generate +package solana diff --git a/capabilities/blockchain/solana/generate/main.go b/capabilities/blockchain/solana/generate/main.go new file mode 100644 index 00000000..8c02d9ad --- /dev/null +++ b/capabilities/blockchain/solana/generate/main.go @@ -0,0 +1,24 @@ +package main + +import ( + "github.com/smartcontractkit/chainlink-protos/cre/go/installer/pkg" + "github.com/smartcontractkit/cre-sdk-go/generator/protos" +) + +func main() { + gen, err := protos.NewGeneratorAndInstallToolsForCapability() + if err != nil { + panic(err) + } + if err := gen.Generate(&pkg.CapabilityConfig{ + Category: "blockchain", + Pkg: "solana", + MajorVersion: 1, + PreReleaseTag: "alpha", + Files: []string{ + "client.proto", + }, + }); err != nil { + panic(err) + } +} diff --git a/capabilities/blockchain/solana/go.mod b/capabilities/blockchain/solana/go.mod new file mode 100644 index 00000000..8d06f910 --- /dev/null +++ b/capabilities/blockchain/solana/go.mod @@ -0,0 +1,29 @@ +module github.com/smartcontractkit/cre-sdk-go/capabilities/blockchain/solana + +go 1.25.3 + +require ( + github.com/gagliardetto/binary v0.8.0 + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260528173858-e8efb307513b + github.com/smartcontractkit/cre-sdk-go v1.0.0 + github.com/stretchr/testify v1.11.1 + google.golang.org/protobuf v1.36.7 +) + +require ( + github.com/blendle/zapdriver v1.3.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/go-viper/mapstructure/v2 v2.4.0 // indirect + github.com/logrusorgru/aurora v2.0.3+incompatible // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/shopspring/decimal v1.4.0 // indirect + github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect + go.uber.org/atomic v1.7.0 // indirect + go.uber.org/multierr v1.6.0 // indirect + go.uber.org/zap v1.21.0 // indirect + golang.org/x/crypto v0.48.0 // indirect + golang.org/x/sys v0.41.0 // indirect + golang.org/x/term v0.40.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/capabilities/blockchain/solana/go.sum b/capabilities/blockchain/solana/go.sum new file mode 100644 index 00000000..ce1a53db --- /dev/null +++ b/capabilities/blockchain/solana/go.sum @@ -0,0 +1,105 @@ +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= +github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= +github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= +github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= +github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= +github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260528173858-e8efb307513b h1:K0/ns9gFEJWxMLdlWTCYI2KxeoSCJdkzVsw3ICeX9iM= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260528173858-e8efb307513b/go.mod h1:vTFHTCbLui4Vn8fTmAadfE3rdnvfrDwOmMujmW857D0= +github.com/smartcontractkit/cre-sdk-go v1.0.0 h1:O52/QDmw/W8SJ7HQ9ASlVx7alSMGsewjL0Y8WZmgf5w= +github.com/smartcontractkit/cre-sdk-go v1.0.0/go.mod h1:CQY8hCISjctPmt8ViDVgFm4vMGLs5fYI198QhkBS++Y= +github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 h1:RN5mrigyirb8anBEtdjtHFIufXdacyTi6i4KBfeNXeo= +github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= +github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= +golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= +golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.36.7 h1:IgrO7UwFQGJdRNXH/sQux4R1Dj1WAKcLElzeeRaXV2A= +google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/capabilities/blockchain/solana/mock/client_mock_gen.go b/capabilities/blockchain/solana/mock/client_mock_gen.go new file mode 100644 index 00000000..87a33c56 --- /dev/null +++ b/capabilities/blockchain/solana/mock/client_mock_gen.go @@ -0,0 +1,272 @@ +// Code generated by github.com/smartcontractkit/cre-sdk-go/generator/protoc-gen-cre, DO NOT EDIT. + +package solanamock + +import ( + "context" + "fmt" + "strconv" + "testing" + + "google.golang.org/protobuf/types/known/anypb" + + "github.com/smartcontractkit/cre-sdk-go/capabilities/blockchain/solana" + + sdkpb "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" + "github.com/smartcontractkit/cre-sdk-go/cre/testutils/registry" +) + +// avoid unused imports +var _ = registry.Registry{} + +func NewClientCapability(ChainSelector uint64, t testing.TB) (*ClientCapability, error) { + c := &ClientCapability{ + ChainSelector: ChainSelector, + } + reg := registry.GetRegistry(t) + err := reg.RegisterCapability(c) + return c, err +} + +type ClientCapability struct { + ChainSelector uint64 + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + GetAccountInfoWithOpts func(ctx context.Context, input *solana.GetAccountInfoWithOptsRequest) (*solana.GetAccountInfoWithOptsReply, error) + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + GetBalance func(ctx context.Context, input *solana.GetBalanceRequest) (*solana.GetBalanceReply, error) + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + GetBlock func(ctx context.Context, input *solana.GetBlockRequest) (*solana.GetBlockReply, error) + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + GetFeeForMessage func(ctx context.Context, input *solana.GetFeeForMessageRequest) (*solana.GetFeeForMessageReply, error) + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + GetMultipleAccountsWithOpts func(ctx context.Context, input *solana.GetMultipleAccountsWithOptsRequest) (*solana.GetMultipleAccountsWithOptsReply, error) + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + GetSignatureStatuses func(ctx context.Context, input *solana.GetSignatureStatusesRequest) (*solana.GetSignatureStatusesReply, error) + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + GetSlotHeight func(ctx context.Context, input *solana.GetSlotHeightRequest) (*solana.GetSlotHeightReply, error) + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + GetTransaction func(ctx context.Context, input *solana.GetTransactionRequest) (*solana.GetTransactionReply, error) + // TODO: https://smartcontract-it.atlassian.net/browse/CAPPL-799 add the default to the call + + WriteReport func(ctx context.Context, input *solana.WriteReportRequest) (*solana.WriteReportReply, error) +} + +func (c *ClientCapability) Invoke(ctx context.Context, request *sdkpb.CapabilityRequest) *sdkpb.CapabilityResponse { + capResp := &sdkpb.CapabilityResponse{} + switch request.Method { + case "GetAccountInfoWithOpts": + input := &solana.GetAccountInfoWithOptsRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.GetAccountInfoWithOpts == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for GetAccountInfoWithOpts"} + break + } + resp, err := c.GetAccountInfoWithOpts(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + case "GetBalance": + input := &solana.GetBalanceRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.GetBalance == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for GetBalance"} + break + } + resp, err := c.GetBalance(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + case "GetBlock": + input := &solana.GetBlockRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.GetBlock == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for GetBlock"} + break + } + resp, err := c.GetBlock(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + case "GetFeeForMessage": + input := &solana.GetFeeForMessageRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.GetFeeForMessage == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for GetFeeForMessage"} + break + } + resp, err := c.GetFeeForMessage(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + case "GetMultipleAccountsWithOpts": + input := &solana.GetMultipleAccountsWithOptsRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.GetMultipleAccountsWithOpts == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for GetMultipleAccountsWithOpts"} + break + } + resp, err := c.GetMultipleAccountsWithOpts(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + case "GetSignatureStatuses": + input := &solana.GetSignatureStatusesRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.GetSignatureStatuses == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for GetSignatureStatuses"} + break + } + resp, err := c.GetSignatureStatuses(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + case "GetSlotHeight": + input := &solana.GetSlotHeightRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.GetSlotHeight == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for GetSlotHeight"} + break + } + resp, err := c.GetSlotHeight(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + case "GetTransaction": + input := &solana.GetTransactionRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.GetTransaction == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for GetTransaction"} + break + } + resp, err := c.GetTransaction(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + case "WriteReport": + input := &solana.WriteReportRequest{} + if err := request.Payload.UnmarshalTo(input); err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + break + } + + if c.WriteReport == nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: "no stub provided for WriteReport"} + break + } + resp, err := c.WriteReport(ctx, input) + if err != nil { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } else { + payload, err := anypb.New(resp) + if err == nil { + capResp.Response = &sdkpb.CapabilityResponse_Payload{Payload: payload} + } else { + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: err.Error()} + } + } + default: + capResp.Response = &sdkpb.CapabilityResponse_Error{Error: fmt.Sprintf("method %s not found", request.Method)} + } + + return capResp +} + +func (c *ClientCapability) ID() string { + return "solana" + ":ChainSelector:" + strconv.FormatUint(c.ChainSelector, 10) + "@1.0.0" +} diff --git a/cre/execution_handler.go b/cre/execution_handler.go index 30c446c6..b40e8a4a 100644 --- a/cre/execution_handler.go +++ b/cre/execution_handler.go @@ -1,6 +1,7 @@ package cre import ( + "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" ) @@ -14,13 +15,34 @@ type ExecutionHandler[C, R any] interface { Callback() func(config C, runtime R, payload *anypb.Any) (any, error) } +type ExecutionHandlerWithRequirements[C, R any] interface { + ExecutionHandler[C, R] + Requirements() *sdk.Requirements +} + // Handler creates a coupling of a Trigger and a callback function to be used by the SDK. // The coupling ensures that when the Trigger is invoked, the callback function is called with the appropriate parameters. func Handler[C any, M proto.Message, T any, O any](trigger Trigger[M, T], callback func(config C, runtime Runtime, payload T) (O, error)) ExecutionHandler[C, Runtime] { - return handler(trigger, callback) + return handler(trigger, callback, nil) } -func handler[R, C any, M proto.Message, T any, O any](trigger Trigger[M, T], callback func(config C, runtime R, payload T) (O, error)) ExecutionHandler[C, R] { +// HandlerInTee creates a coupling of a Trigger and a callback function to be used in TEE (Trusted Execution Environment) mode. +// The coupling ensures that when the Trigger is invoked, the callback function is called with a TeeRuntime. +func HandlerInTee[C any, M proto.Message, T any, O any](trigger Trigger[M, T], callback func(config C, runtime TeeRuntime, payload T) (O, error), tees TeeConstraint) ExecutionHandler[C, Runtime] { + return handler(trigger, wrapTeeCallback(callback), tees.toRequirements()) +} + +func wrapTeeCallback[C any, T any, O any](callback func(config C, runtime TeeRuntime, payload T) (O, error)) func(config C, runtime Runtime, payload T) (O, error) { + return func(config C, runtime Runtime, t T) (O, error) { + helper, ok := runtime.(interface{ Tee() TeeRuntime }) + if !ok { + panic("Runner did not provide an extractable TEERuntime. If you wrapped the runtime, wrap the method Tee() TeeRuntime instead.") + } + return callback(config, helper.Tee(), t) + } +} + +func handler[R, C any, M proto.Message, T any, O any](trigger Trigger[M, T], callback func(config C, runtime R, payload T) (O, error), requirements *sdk.Requirements) ExecutionHandler[C, R] { wrapped := func(config C, runtime R, payload *anypb.Any) (any, error) { unwrappedTrigger := trigger.NewT() if err := payload.UnmarshalTo(unwrappedTrigger); err != nil { @@ -32,10 +54,17 @@ func handler[R, C any, M proto.Message, T any, O any](trigger Trigger[M, T], cal } return callback(config, runtime, input) } - return &executionHandlerImpl[C, R, M, T]{ + + eh := &executionHandlerImpl[C, R, M, T]{ Trigger: trigger, fn: wrapped, } + + if requirements == nil { + return eh + } + + return &executionHandlerWithRequirementsImpl[C, R]{ExecutionHandler: eh, requirements: requirements} } type executionHandlerImpl[C, R any, M proto.Message, T any] struct { @@ -52,3 +81,14 @@ func (h *executionHandlerImpl[C, R, M, T]) TriggerCfg() *anypb.Any { func (h *executionHandlerImpl[C, R, M, T]) Callback() func(config C, runtime R, payload *anypb.Any) (any, error) { return h.fn } + +type executionHandlerWithRequirementsImpl[C, R any] struct { + ExecutionHandler[C, R] + requirements *sdk.Requirements +} + +var _ ExecutionHandlerWithRequirements[any, any] = (*executionHandlerWithRequirementsImpl[any, any])(nil) + +func (h *executionHandlerWithRequirementsImpl[C, R]) Requirements() *sdk.Requirements { + return h.requirements +} diff --git a/cre/maps.go b/cre/maps.go new file mode 100644 index 00000000..fccf5338 --- /dev/null +++ b/cre/maps.go @@ -0,0 +1,36 @@ +package cre + +import ( + "cmp" + "iter" + "maps" + "slices" +) + +// OrderedEntries returns a sequence that iterates over the entries in the map in the natural sorted order of the keys. +// For keys which do not implement cmp.Ordered, use OrderedEntriesFunc. +func OrderedEntries[K cmp.Ordered, V any](m map[K]V) iter.Seq2[K, V] { + keys := slices.Collect(maps.Keys(m)) + slices.Sort(keys) + return func(yield func(K, V) bool) { + for _, k := range keys { + if !yield(k, m[k]) { + return + } + } + } +} + +// OrderedEntriesFunc returns a sequence that iterates over the entries in the map based on sorting keys with the cmp func. +// For naturally cmp.Ordered keys, use OrderedEntries. +func OrderedEntriesFunc[K comparable, V any](m map[K]V, cmp func(a, b K) int) iter.Seq2[K, V] { + keys := slices.Collect(maps.Keys(m)) + slices.SortFunc(keys, cmp) + return func(yield func(K, V) bool) { + for _, k := range keys { + if !yield(k, m[k]) { + return + } + } + } +} diff --git a/cre/maps_test.go b/cre/maps_test.go new file mode 100644 index 00000000..8d17713e --- /dev/null +++ b/cre/maps_test.go @@ -0,0 +1,35 @@ +package cre + +import ( + "cmp" + "fmt" +) + +func ExampleOrderedEntries() { + m := map[string]int{"a": 1, "b": 2, "c": 3, "d": 4, "e": 5} + for _, v := range OrderedEntries(m) { + fmt.Println(v) + } + // Output: + // 1 + // 2 + // 3 + // 4 + // 5 +} + +func ExampleOrderedEntriesFunc() { + type k struct{ f string } + m := map[k]int{{"a"}: 1, {"b"}: 2, {"c"}: 3, {"d"}: 4, {"e"}: 5} + for _, v := range OrderedEntriesFunc(m, func(a, b k) int { + return cmp.Compare(a.f, b.f) + }) { + fmt.Println(v) + } + // Output: + // 1 + // 2 + // 3 + // 4 + // 5 +} diff --git a/cre/runner.go b/cre/runner.go index 3baf21e0..bd4d1d2e 100644 --- a/cre/runner.go +++ b/cre/runner.go @@ -2,10 +2,12 @@ package cre import "log/slog" +type InitFn[C any] = func(config C, logger *slog.Logger, secretsProvider SecretsProvider) (Workflow[C], error) + // Runner is the entry point to running a CRE workflow. type Runner[C any] interface { // Run creates the workflow and starts it. // Upon registration of a workflow, a run is used to register to `Trigger`s. // Upon receiving a trigger, the appropriate handler's callback is invoked. - Run(initFn func(config C, logger *slog.Logger, secretsProvider SecretsProvider) (Workflow[C], error)) + Run(initFn InitFn[C]) } diff --git a/cre/runtime.go b/cre/runtime.go index 46da95dd..ed41de67 100644 --- a/cre/runtime.go +++ b/cre/runtime.go @@ -46,6 +46,23 @@ type NodeRuntime interface { IsNodeRuntime() } +// TeeRuntime provides access to TEE (Trusted Execution Environment) capabilities. +// Requests made through this runtime run inside the TEE, while requests via UsingTheDons +// are routed outside of the TEE to the CRE DONs. +// It is not thread safe and must not be used concurrently. +type TeeRuntime interface { + RuntimeBase + SecretsProvider + + // ReportFromDon generates a report from the DON. + // Data requested through this method will be routed outside the TEE. + ReportFromDon(*ReportRequest) Promise[*Report] + + // UsingTheDons returns the DON runtime. + // Requests made through this runtime can therefore be routed outside the TEE. + UsingTheDons() Runtime +} + // Runtime provides access to DON capabilities and allows NodeRuntime use with consensus. // It is not thread safe and must not be used concurrently. type Runtime interface { diff --git a/cre/tee_constraints.go b/cre/tee_constraints.go new file mode 100644 index 00000000..251be12d --- /dev/null +++ b/cre/tee_constraints.go @@ -0,0 +1,242 @@ +package cre + +import ( + "bytes" + "encoding/json" + "fmt" + + "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" +) + +// TeeConstraint describes the set of (TEE, region) pairs a handler will accept. +// Sealed via the unexported toRequirements method: only AnyTee, AnyTeeInRegions, +// and OneOfTees (declared in this package) can implement it. +type TeeConstraint interface { + toRequirements() *sdk.Requirements +} + +// Tees is the config-friendly wrapper around a TeeConstraint. Its UnmarshalJSON +// inspects the JSON shape and produces the matching variant; null and unknown +// shapes are rejected to fail closed. Use *Tees in config structs when the +// field is optional. +type Tees struct { + TeeConstraint +} + +// AnyTee accepts any TEE in any region. JSON form: {}. +type AnyTee struct{} + +func (AnyTee) toRequirements() *sdk.Requirements { + return &sdk.Requirements{Tee: &sdk.Tee{Item: &sdk.Tee_AnyRegions{AnyRegions: &sdk.Regions{}}}} +} + +// AnyTeeInRegions accepts any TEE provided it runs in one of the listed regions. +// JSON form: {"regions": [...]}. +type AnyTeeInRegions struct { + Regions []Region `json:"regions"` +} + +func (a AnyTeeInRegions) toRequirements() *sdk.Requirements { + regs := make([]string, len(a.Regions)) + for i, r := range a.Regions { + regs[i] = string(r) + } + return &sdk.Requirements{Tee: &sdk.Tee{Item: &sdk.Tee_AnyRegions{AnyRegions: &sdk.Regions{Regions: regs}}}} +} + +// OneOfTees accepts any of the listed per-TEE bindings. Each binding may carry +// its own region set. JSON form: [{"tee": "...", "regions": [...]}, ...]. +type OneOfTees []TeeBinding + +func (o OneOfTees) toRequirements() *sdk.Requirements { + out := make([]*sdk.TeeTypeAndRegions, len(o)) + for i, b := range o { + out[i] = b.teeTypeAndRegions() + } + return &sdk.Requirements{Tee: &sdk.Tee{Item: &sdk.Tee_TeeTypesAndRegions{TeeTypesAndRegions: &sdk.TeeTypesAndRegions{TeeTypeAndRegions: out}}}} +} + +// TeeBinding is the sealed interface for a single entry inside OneOfTees. Each +// implementing type owns the enum of regions that TEE supports (e.g. Nitro <-> +// NitroRegion) so a region for the wrong TEE is a compile-time error. Sealed +// via the unexported teeTypeAndRegions method. +type TeeBinding interface { + teeTypeAndRegions() *sdk.TeeTypeAndRegions +} + +// Nitro is the AWS Nitro TEE. JSON tag: "nitro". +type Nitro struct { + Regions []NitroRegion `json:"regions,omitempty"` +} + +func (n Nitro) teeTypeAndRegions() *sdk.TeeTypeAndRegions { + var regs []string + if n.Regions != nil { + regs = make([]string, len(n.Regions)) + for i, r := range n.Regions { + regs[i] = string(r) + } + } + return &sdk.TeeTypeAndRegions{Type: sdk.TeeType_TEE_TYPE_AWS_NITRO, Regions: regs} +} + +// Region is the global region enum used by AnyTeeInRegions, where no specific +// TEE is pinned. Add a new region by adding a const plus a case in UnmarshalText. +type Region string + +const ( + AwsUsWest2 Region = "us-west-2" +) + +func (r *Region) UnmarshalText(b []byte) error { + switch v := Region(b); v { + case AwsUsWest2: + *r = v + return nil + default: + return fmt.Errorf("unknown region %q", b) + } +} + +// NitroRegion enumerates the regions AWS Nitro is supported in. Distinct from +// Region so that a non-Nitro region cannot appear inside a Nitro binding. +type NitroRegion string + +const ( + NitroUsWest2 = NitroRegion(AwsUsWest2) +) + +func (r *NitroRegion) UnmarshalText(b []byte) error { + switch v := NitroRegion(b); v { + case NitroUsWest2: + *r = v + return nil + default: + return fmt.Errorf("aws nitro does not support region %q", b) + } +} + +// teeBindingFactories maps the JSON "tee" discriminator to a fresh binding to +// unmarshal into. Add a new TEE by registering it here. +var teeBindingFactories = map[string]func() teeBindingUnmarshaler{ + "nitro": func() teeBindingUnmarshaler { return &Nitro{} }, +} + +// teeBindingUnmarshaler is the concrete pointer type that both implements +// TeeBinding and can be json.Unmarshal'd into. asValue returns the value form +// of the binding, which is what gets stored in OneOfTees. +type teeBindingUnmarshaler interface { + TeeBinding + json.Unmarshaler + asValue() TeeBinding +} + +func (n *Nitro) asValue() TeeBinding { return *n } + +func (n *Nitro) UnmarshalJSON(b []byte) error { + type raw struct { + Tee string `json:"tee"` + Regions json.RawMessage `json:"regions"` + } + dec := json.NewDecoder(bytes.NewReader(b)) + dec.DisallowUnknownFields() + var r raw + if err := dec.Decode(&r); err != nil { + return err + } + if len(r.Regions) == 0 { + n.Regions = nil + return nil + } + var regions []NitroRegion + if err := json.Unmarshal(r.Regions, ®ions); err != nil { + return err + } + if len(regions) == 0 { + return fmt.Errorf(`"regions" must not be empty`) + } + n.Regions = regions + return nil +} + +// UnmarshalJSON dispatches on the JSON shape: {} -> AnyTee, {"regions":[...]} -> +// AnyTeeInRegions, [...] -> OneOfTees. null and any other shape error. +func (t *Tees) UnmarshalJSON(b []byte) error { + b = bytes.TrimSpace(b) + if len(b) == 0 || bytes.Equal(b, []byte("null")) { + return fmt.Errorf("tee constraint is required; use *Tees for optional fields") + } + switch b[0] { + case '[': + return t.decodeArray(b) + case '{': + return t.decodeObject(b) + default: + return fmt.Errorf("tee constraint must be an object or array, got: %s", b) + } +} + +func (t *Tees) decodeArray(b []byte) error { + var raw []json.RawMessage + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if len(raw) == 0 { + return fmt.Errorf("tee constraint list must not be empty") + } + out := make(OneOfTees, 0, len(raw)) + for i, entry := range raw { + bind, err := unmarshalBinding(entry) + if err != nil { + return fmt.Errorf("tee constraint[%d]: %w", i, err) + } + out = append(out, bind) + } + t.TeeConstraint = out + return nil +} + +func (t *Tees) decodeObject(b []byte) error { + var raw map[string]json.RawMessage + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if len(raw) == 0 { + t.TeeConstraint = AnyTee{} + return nil + } + regionsRaw, ok := raw["regions"] + if !ok || len(raw) != 1 { + return fmt.Errorf(`unrecognized tee constraint object; expected {} or {"regions":[...]}`) + } + var regions []Region + if err := json.Unmarshal(regionsRaw, ®ions); err != nil { + return err + } + if len(regions) == 0 { + return fmt.Errorf(`"regions" must not be empty`) + } + t.TeeConstraint = AnyTeeInRegions{Regions: regions} + return nil +} + +func unmarshalBinding(b []byte) (TeeBinding, error) { + var probe struct { + Tee string `json:"tee"` + } + if err := json.Unmarshal(b, &probe); err != nil { + return nil, err + } + if probe.Tee == "" { + return nil, fmt.Errorf(`missing "tee" discriminator`) + } + factory, ok := teeBindingFactories[probe.Tee] + if !ok { + return nil, fmt.Errorf("unknown tee %q", probe.Tee) + } + target := factory() + if err := target.UnmarshalJSON(b); err != nil { + return nil, err + } + return target.asValue(), nil +} diff --git a/cre/tee_constraints_test.go b/cre/tee_constraints_test.go new file mode 100644 index 00000000..33c559ef --- /dev/null +++ b/cre/tee_constraints_test.go @@ -0,0 +1,197 @@ +package cre + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + + "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" +) + +func TestRegionUnmarshalText(t *testing.T) { + t.Run("known region", func(t *testing.T) { + var r Region + require.NoError(t, r.UnmarshalText([]byte("us-west-2"))) + assert.Equal(t, AwsUsWest2, r) + }) + + t.Run("unknown region", func(t *testing.T) { + var r Region + err := r.UnmarshalText([]byte("mars-central-1")) + assert.ErrorContains(t, err, `unknown region "mars-central-1"`) + }) +} + +func TestNitroRegionUnmarshalText(t *testing.T) { + t.Run("known region", func(t *testing.T) { + var r NitroRegion + require.NoError(t, r.UnmarshalText([]byte("us-west-2"))) + assert.Equal(t, NitroUsWest2, r) + }) + + t.Run("unknown region", func(t *testing.T) { + var r NitroRegion + err := r.UnmarshalText([]byte("eu-central-1")) + assert.ErrorContains(t, err, `aws nitro does not support region "eu-central-1"`) + }) +} + +func TestAnyTeeToRequirements(t *testing.T) { + got := AnyTee{}.toRequirements() + want := &sdk.Requirements{Tee: &sdk.Tee{Item: &sdk.Tee_AnyRegions{AnyRegions: &sdk.Regions{}}}} + assert.True(t, proto.Equal(want, got), "got %v want %v", got, want) +} + +func TestAnyTeeInRegionsToRequirements(t *testing.T) { + t.Run("with regions", func(t *testing.T) { + got := AnyTeeInRegions{Regions: []Region{AwsUsWest2}}.toRequirements() + want := &sdk.Requirements{Tee: &sdk.Tee{Item: &sdk.Tee_AnyRegions{AnyRegions: &sdk.Regions{Regions: []string{"us-west-2"}}}}} + assert.True(t, proto.Equal(want, got)) + }) + + t.Run("nil regions emits empty slice", func(t *testing.T) { + got := AnyTeeInRegions{}.toRequirements() + regions := got.Tee.GetAnyRegions().GetRegions() + assert.Empty(t, regions) + }) +} + +func TestOneOfTeesToRequirements(t *testing.T) { + t.Run("nitro with regions", func(t *testing.T) { + got := OneOfTees{Nitro{Regions: []NitroRegion{NitroUsWest2}}}.toRequirements() + want := &sdk.Requirements{Tee: &sdk.Tee{Item: &sdk.Tee_TeeTypesAndRegions{ + TeeTypesAndRegions: &sdk.TeeTypesAndRegions{TeeTypeAndRegions: []*sdk.TeeTypeAndRegions{ + {Type: sdk.TeeType_TEE_TYPE_AWS_NITRO, Regions: []string{"us-west-2"}}, + }}, + }}} + assert.True(t, proto.Equal(want, got), "got %v want %v", got, want) + }) + + t.Run("nitro without regions emits nil region slice", func(t *testing.T) { + got := OneOfTees{Nitro{}}.toRequirements() + entries := got.Tee.GetTeeTypesAndRegions().TeeTypeAndRegions + require.Len(t, entries, 1) + assert.Equal(t, sdk.TeeType_TEE_TYPE_AWS_NITRO, entries[0].Type) + assert.Nil(t, entries[0].Regions) + }) +} + +// Sealing of TeeConstraint and TeeBinding is enforced at compile time via the +// unexported toRequirements / teeTypeAndRegions methods. These assertions exist +// purely to fail compilation if a future change accidentally breaks the seal. +var ( + _ TeeConstraint = AnyTee{} + _ TeeConstraint = AnyTeeInRegions{} + _ TeeConstraint = OneOfTees{} + _ TeeBinding = Nitro{} +) + +func TestDecodeArrayDirectJSONError(t *testing.T) { + // Outer json.Unmarshal would normally reject malformed JSON before our + // UnmarshalJSON sees it; we call decodeArray directly to exercise its + // inner-parse error path. + var got Tees + err := got.decodeArray([]byte("not-json")) + require.Error(t, err) +} + +func TestDecodeObjectDirectJSONError(t *testing.T) { + var got Tees + err := got.decodeObject([]byte("not-json")) + require.Error(t, err) +} + +func TestTeesUnmarshalJSON_AnyTee(t *testing.T) { + var got Tees + require.NoError(t, json.Unmarshal([]byte(`{}`), &got)) + assert.Equal(t, AnyTee{}, got.TeeConstraint) +} + +func TestTeesUnmarshalJSON_AnyTeeInRegions(t *testing.T) { + var got Tees + require.NoError(t, json.Unmarshal([]byte(`{"regions":["us-west-2"]}`), &got)) + assert.Equal(t, AnyTeeInRegions{Regions: []Region{AwsUsWest2}}, got.TeeConstraint) +} + +func TestTeesUnmarshalJSON_OneOfTees(t *testing.T) { + t.Run("nitro with regions", func(t *testing.T) { + var got Tees + require.NoError(t, json.Unmarshal([]byte(`[{"tee":"nitro","regions":["us-west-2"]}]`), &got)) + assert.Equal(t, OneOfTees{Nitro{Regions: []NitroRegion{NitroUsWest2}}}, got.TeeConstraint) + }) + + t.Run("nitro without regions", func(t *testing.T) { + var got Tees + require.NoError(t, json.Unmarshal([]byte(`[{"tee":"nitro"}]`), &got)) + assert.Equal(t, OneOfTees{Nitro{}}, got.TeeConstraint) + }) + +} + +func TestTeesUnmarshalJSON_Errors(t *testing.T) { + cases := []struct { + name string + input string + want string + }{ + {"null fails closed", `null`, "tee constraint is required"}, + {"binding regions explicit null", `[{"tee":"nitro","regions":null}]`, `"regions" must not be empty`}, + {"bare string", `"any"`, "must be an object or array"}, + {"bare number", `123`, "must be an object or array"}, + {"empty list", `[]`, "list must not be empty"}, + {"invalid array json", `[`, "unexpected end of JSON input"}, + {"binding missing tee key", `[{}]`, `missing "tee" discriminator`}, + {"binding unknown tee", `[{"tee":"sgx"}]`, `unknown tee "sgx"`}, + {"binding probe json error", `[{"tee":3}]`, "cannot unmarshal"}, + {"binding regions parse error", `[{"tee":"nitro","regions":["eu-central-1"]}]`, "aws nitro does not support region"}, + {"binding regions empty", `[{"tee":"nitro","regions":[]}]`, `"regions" must not be empty`}, + {"binding unknown field", `[{"tee":"nitro","extra":1}]`, `unknown field "extra"`}, + {"binding nitro json error", `[{"tee":"nitro","regions":"not-an-array"}]`, "cannot unmarshal"}, + {"object unknown shape", `{"foo":1}`, "unrecognized tee constraint object"}, + {"object with regions plus extra", `{"regions":["us-west-2"],"extra":1}`, "unrecognized tee constraint object"}, + {"object regions bad type", `{"regions":"not-array"}`, "cannot unmarshal"}, + {"object regions unknown", `{"regions":["mars-central-1"]}`, "unknown region"}, + {"object regions empty", `{"regions":[]}`, `"regions" must not be empty`}, + {"object invalid json", `{`, "unexpected end of JSON input"}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + var got Tees + err := json.Unmarshal([]byte(tc.input), &got) + require.Error(t, err) + assert.Contains(t, err.Error(), tc.want) + }) + } +} + +func TestTeesPointerNullIsNil(t *testing.T) { + type cfg struct { + Tees *Tees `json:"tees"` + } + var c cfg + require.NoError(t, json.Unmarshal([]byte(`{"tees":null}`), &c)) + assert.Nil(t, c.Tees) +} + +func TestTeesPointerOmittedIsNil(t *testing.T) { + type cfg struct { + Tees *Tees `json:"tees"` + } + var c cfg + require.NoError(t, json.Unmarshal([]byte(`{}`), &c)) + assert.Nil(t, c.Tees) +} + +func TestTeesEmbedInConfigStruct(t *testing.T) { + type cfg struct { + Name string `json:"name"` + Tees Tees `json:"tees"` + } + var c cfg + require.NoError(t, json.Unmarshal([]byte(`{"name":"x","tees":[{"tee":"nitro","regions":["us-west-2"]}]}`), &c)) + assert.Equal(t, "x", c.Name) + assert.Equal(t, OneOfTees{Nitro{Regions: []NitroRegion{NitroUsWest2}}}, c.Tees.TeeConstraint) +} diff --git a/cre/testutils/runtime.go b/cre/testutils/runtime.go index 2c4f7c40..fb8fa300 100644 --- a/cre/testutils/runtime.go +++ b/cre/testutils/runtime.go @@ -275,3 +275,22 @@ func (rh *runtimeHelpers) SwitchModes(_ sdk.Mode) {} func (rh *runtimeHelpers) Now() time.Time { return rh.timeProvider() } + +// NewTeeRuntime creates a new TestTeeRuntime for use in tests. +// A nil Secrets map is treated as an empty map, but entries cannot be added later. +func NewTeeRuntime(tb testing.TB, secrets Secrets) *TestTeeRuntime { + inner := NewRuntime(tb, secrets) + return &TestTeeRuntime{ + TestRuntime: inner, + TeeRuntime: sdkimpl.NewTeeRuntime(&inner.Runtime), + } +} + +// TestTeeRuntime is a TeeRuntime implementation for use in unit tests. +// Note that it should always be constructed via NewTeeRuntime. +type TestTeeRuntime struct { + *TestRuntime + *sdkimpl.TeeRuntime +} + +var _ cre.TeeRuntime = (*TestTeeRuntime)(nil) diff --git a/cre/wasm/runner.go b/cre/wasm/runner.go index 676f1a99..c3f12d81 100644 --- a/cre/wasm/runner.go +++ b/cre/wasm/runner.go @@ -6,12 +6,11 @@ import ( "log/slog" "unsafe" + "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" + "github.com/smartcontractkit/chainlink-protos/cre/go/values" "github.com/smartcontractkit/cre-sdk-go/cre" "github.com/smartcontractkit/cre-sdk-go/internal/sdkimpl" "google.golang.org/protobuf/proto" - - "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" - "github.com/smartcontractkit/chainlink-protos/cre/go/values" ) type Config any @@ -42,6 +41,7 @@ func newRunner[C Config](parse func(configBytes []byte) (C, error), runnerIntern &runner[C, cre.Runtime]{ sp: drt, runtime: drt, + switchRuntime: &switchRuntimeWrapper{Runtime: drt}, runnerInternals: runnerInternals, setRuntime: func(maxResponseSize uint64) { drt.MaxResponseSize = maxResponseSize @@ -53,12 +53,13 @@ func newRunner[C Config](parse func(configBytes []byte) (C, error), runnerIntern type runner[C, T any] struct { runnerInternals - trigger *sdk.Trigger - id string - runtime T - setRuntime func(maxResponseSize uint64) - config C - sp cre.SecretsProvider + trigger *sdk.Trigger + id string + runtime T + switchRuntime T + setRuntime func(maxResponseSize uint64) + config C + sp cre.SecretsProvider } var _ baseRunner[any, cre.Runtime] = (*runner[any, cre.Runtime])(nil) @@ -72,9 +73,15 @@ func (r *runner[C, T]) secretsProvider() cre.SecretsProvider { } func (r *runner[C, T]) run(wfs []cre.ExecutionHandler[C, T]) { + runtime := r.runtime for idx, handler := range wfs { if uint64(idx) == r.trigger.Id { - response, err := handler.Callback()(r.config, r.runtime, r.trigger.Payload) + if _, ok := handler.(cre.ExecutionHandlerWithRequirements[C, T]); ok { + runtime = r.switchRuntime + } + + response, err := handler.Callback()(r.config, runtime, r.trigger.Payload) + if err == nil { wrapped, err := values.Wrap(response) if err != nil { @@ -110,11 +117,15 @@ func (s *subscriber[C, T]) secretsProvider() cre.SecretsProvider { func (s *subscriber[C, T]) run(wfs []cre.ExecutionHandler[C, T]) { subscriptions := make([]*sdk.TriggerSubscription, len(wfs)) for i, handler := range wfs { - subscriptions[i] = &sdk.TriggerSubscription{ + sub := &sdk.TriggerSubscription{ Id: handler.CapabilityID(), Payload: handler.TriggerCfg(), Method: handler.Method(), } + if reqsProvider, ok := handler.(cre.ExecutionHandlerWithRequirements[C, T]); ok { + sub.Requirements = reqsProvider.Requirements() + } + subscriptions[i] = sub } triggerSubscription := &sdk.TriggerSubscriptionRequest{Subscriptions: subscriptions} @@ -204,3 +215,13 @@ func (r runnerWrapper[C]) Run(initFn func(config C, logger *slog.Logger, secrets wfs := r.getWorkflows(r.baseRunner.cfg(), r.secretsProvider(), initFn) r.baseRunner.run(wfs) } + +type switchRuntimeWrapper struct { + // used to implement the runtime, but will be discarded + *sdkimpl.Runtime +} + +func (s *switchRuntimeWrapper) Tee() cre.TeeRuntime { + return sdkimpl.NewTeeRuntime(s.Runtime) +} + diff --git a/cre/wasm/runner_test.go b/cre/wasm/runner_test.go index 4158180c..e41e9566 100644 --- a/cre/wasm/runner_test.go +++ b/cre/wasm/runner_test.go @@ -154,6 +154,134 @@ func TestRunner_Run(t *testing.T) { }) } +func TestHandlerInTee(t *testing.T) { + t.Run("specified list sets requirements on subscription", func(t *testing.T) { + acceptedTees := cre.OneOfTees{cre.Nitro{Regions: []cre.NitroRegion{cre.NitroUsWest2}}} + + internals := testRunnerInternals(t, subscribeRequest) + dr := newRunner(func(b []byte) (string, error) { return string(b), nil }, internals, testRuntimeInternals(t)) + + dr.Run(func(string, *slog.Logger, cre.SecretsProvider) (cre.Workflow[string], error) { + return cre.Workflow[string]{ + cre.HandlerInTee( + basictrigger.Trigger(testworkflow.TestWorkflowTriggerConfig()), + func(_ string, _ cre.TeeRuntime, _ *basictrigger.Outputs) (string, error) { + return "tee-result", nil + }, + acceptedTees, + ), + }, nil + }) + + actual := &sdk.ExecutionResult{} + require.NoError(t, proto.Unmarshal(internals.sentResponse, actual)) + switch result := actual.Result.(type) { + case *sdk.ExecutionResult_TriggerSubscriptions: + subs := result.TriggerSubscriptions.Subscriptions + require.Len(t, subs, 1) + expected := &sdk.Requirements{ + Tee: &sdk.Tee{Item: &sdk.Tee_TeeTypesAndRegions{TeeTypesAndRegions: &sdk.TeeTypesAndRegions{TeeTypeAndRegions: []*sdk.TeeTypeAndRegions{{Type: sdk.TeeType_TEE_TYPE_AWS_NITRO, Regions: []string{"us-west-2"}}}}}}, + } + assert.True(t, proto.Equal(expected, subs[0].Requirements)) + default: + assert.Fail(t, "unexpected result type", result) + } + }) + + t.Run("any tee sets requirements on subscription", func(t *testing.T) { + internals := testRunnerInternals(t, subscribeRequest) + dr := newRunner(func(b []byte) (string, error) { return string(b), nil }, internals, testRuntimeInternals(t)) + + dr.Run(func(string, *slog.Logger, cre.SecretsProvider) (cre.Workflow[string], error) { + return cre.Workflow[string]{ + cre.HandlerInTee( + basictrigger.Trigger(testworkflow.TestWorkflowTriggerConfig()), + func(_ string, _ cre.TeeRuntime, _ *basictrigger.Outputs) (string, error) { + return "tee-result", nil + }, + cre.AnyTeeInRegions{Regions: []cre.Region{cre.AwsUsWest2}}, + ), + }, nil + }) + + actual := &sdk.ExecutionResult{} + require.NoError(t, proto.Unmarshal(internals.sentResponse, actual)) + switch result := actual.Result.(type) { + case *sdk.ExecutionResult_TriggerSubscriptions: + subs := result.TriggerSubscriptions.Subscriptions + require.Len(t, subs, 1) + expected := &sdk.Requirements{ + Tee: &sdk.Tee{Item: &sdk.Tee_AnyRegions{AnyRegions: &sdk.Regions{Regions: []string{"us-west-2"}}}}, + } + assert.True(t, proto.Equal(expected, subs[0].Requirements)) + default: + assert.Fail(t, "unexpected result type", result) + } + }) + + t.Run("regular handler has no requirements on subscription", func(t *testing.T) { + internals := testRunnerInternals(t, subscribeRequest) + dr := newRunner(func(b []byte) (string, error) { return string(b), nil }, internals, testRuntimeInternals(t)) + + dr.Run(func(string, *slog.Logger, cre.SecretsProvider) (cre.Workflow[string], error) { + return cre.Workflow[string]{ + cre.Handler( + basictrigger.Trigger(testworkflow.TestWorkflowTriggerConfig()), + func(_ string, _ cre.Runtime, _ *basictrigger.Outputs) (string, error) { + return "no-tee", nil + }, + ), + }, nil + }) + + actual := &sdk.ExecutionResult{} + require.NoError(t, proto.Unmarshal(internals.sentResponse, actual)) + switch result := actual.Result.(type) { + case *sdk.ExecutionResult_TriggerSubscriptions: + subs := result.TriggerSubscriptions.Subscriptions + require.Len(t, subs, 1) + assert.Nil(t, subs[0].Requirements) + default: + assert.Fail(t, "unexpected result type", result) + } + }) + + t.Run("tee handler callback receives TeeRuntime", func(t *testing.T) { + acceptedTees := cre.OneOfTees{cre.Nitro{Regions: []cre.NitroRegion{cre.NitroUsWest2}}} + + triggerReq := &sdk.ExecuteRequest{ + Config: anyConfig, + MaxResponseSize: anyMaxResponseSize, + Request: &sdk.ExecuteRequest_Trigger{ + Trigger: &sdk.Trigger{ + Id: 0, + Payload: mustAny(testworkflow.TestWorkflowTrigger()), + }, + }, + } + + internals := testRunnerInternals(t, triggerReq) + dr := newRunner(func(b []byte) (string, error) { return string(b), nil }, internals, testRuntimeInternals(t)) + + callbackInvoked := false + dr.Run(func(string, *slog.Logger, cre.SecretsProvider) (cre.Workflow[string], error) { + return cre.Workflow[string]{ + cre.HandlerInTee( + basictrigger.Trigger(testworkflow.TestWorkflowTriggerConfig()), + func(_ string, rt cre.TeeRuntime, _ *basictrigger.Outputs) (string, error) { + callbackInvoked = true + assert.NotNil(t, rt, "TeeRuntime should not be nil") + return "done", nil + }, + acceptedTees, + ), + }, nil + }) + + assert.True(t, callbackInvoked, "tee callback should have been invoked") + }) +} + func assertEnv(t *testing.T, r cre.Runner[string]) { ran := false verifyEnv := func(config string, logger *slog.Logger, secretsProvider cre.SecretsProvider) (cre.Workflow[string], error) { diff --git a/cre/wasm/runner_wasip1.go b/cre/wasm/runner_wasip1.go index a28dac09..f0f07991 100644 --- a/cre/wasm/runner_wasip1.go +++ b/cre/wasm/runner_wasip1.go @@ -19,6 +19,9 @@ func switchModes(mode int32) //go:wasmimport env now func now(response unsafe.Pointer) int32 +//go:wasmimport env requirements +func requirements(data unsafe.Pointer, dataLen int32) + // NewRunner creates a new cre.Runner instance with the provided function to parse config. func NewRunner[C Config](parse func(configBytes []byte) (C, error)) cre.Runner[C] { return newRunner[C](parse, runnerInternalsImpl{}, runtimeInternalsImpl{}) @@ -51,3 +54,7 @@ func (r runnerInternalsImpl) now(response unsafe.Pointer) int32 { func (r runnerInternalsImpl) exit() { os.Exit(0) } + +func (r runnerInternalsImpl) requirements(data unsafe.Pointer, dataLen int32) { + requirements(data, dataLen) +} diff --git a/generator/protoc-gen-cre/go.mod b/generator/protoc-gen-cre/go.mod index 8bef8eb0..ca76ab9f 100644 --- a/generator/protoc-gen-cre/go.mod +++ b/generator/protoc-gen-cre/go.mod @@ -1,18 +1,18 @@ module github.com/smartcontractkit/cre-sdk-go/generator/protoc-gen-cre -go 1.25.3 +go 1.26.2 require ( github.com/iancoleman/strcase v0.3.0 - github.com/smartcontractkit/chainlink-common v0.9.6-0.20251022160007-d6110172508f - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251021010742-3f8d3dba17d8 - google.golang.org/protobuf v1.36.8 + github.com/smartcontractkit/chainlink-common v0.11.2-0.20260601162433-5b4f632b33c8 + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260526195338-adcf8013a1b7 + google.golang.org/protobuf v1.36.11 ) require ( github.com/shopspring/decimal v1.4.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect - golang.org/x/mod v0.26.0 // indirect - golang.org/x/sync v0.16.0 // indirect - golang.org/x/tools v0.35.0 // indirect + golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a // indirect + golang.org/x/mod v0.36.0 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/tools v0.45.0 // indirect ) diff --git a/generator/protoc-gen-cre/go.sum b/generator/protoc-gen-cre/go.sum index 302af76e..542595ce 100644 --- a/generator/protoc-gen-cre/go.sum +++ b/generator/protoc-gen-cre/go.sum @@ -4,17 +4,17 @@ github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSAS github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20251022160007-d6110172508f h1:WcaG6FfzSf05VEqTJvPyqtuKcyKkX1Ie5rhYTqOjnvE= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20251022160007-d6110172508f/go.mod h1:bweMpOLYCumPXnYBIPRAH4dbvVRtPmyVB+8TSzh0ILY= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251021010742-3f8d3dba17d8 h1:hPeEwcvRVtwhyNXH45qbzqmscqlbygu94cROwbjyzNQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251021010742-3f8d3dba17d8/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= -golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= -golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= -golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= -golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= -golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= -google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc= -google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= +github.com/smartcontractkit/chainlink-common v0.11.2-0.20260601162433-5b4f632b33c8 h1:GwXAdj3+ufswtFFbIfnzkmUtckTXFWZnE2KDC8qxvps= +github.com/smartcontractkit/chainlink-common v0.11.2-0.20260601162433-5b4f632b33c8/go.mod h1:noBAXFIyadzhElKzb6a7pngnRsVTtV91muoeDqNnuUg= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260526195338-adcf8013a1b7 h1:iljEJss3WOwcsMkWy72Yn2zvjw7Gyxc+RXL7r8YKM6g= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260526195338-adcf8013a1b7/go.mod h1:vTFHTCbLui4Vn8fTmAadfE3rdnvfrDwOmMujmW857D0= +golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a h1:+3jdDGGB8NGb1Zktc737jlt3/A5f6UlwSzmvqUuufxw= +golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a/go.mod h1:d2fgXJLVs4dYDHUk5lwMIfzRzSrWCfGZb0ZqeLa/Vcw= +golang.org/x/mod v0.36.0 h1:JJjpVx6myfUsUdAzZuOSTTmRE0PfZeNWzzvKrP7amb4= +golang.org/x/mod v0.36.0/go.mod h1:moc6ELqsWcOw5Ef3xVprK5ul/MvtVvkIXLziUOICjUQ= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/tools v0.45.0 h1:18qN3FAooORvApf5XjCXgsuayZOEtXf6JK18I3+ONa8= +golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/generator/protoc-gen-cre/pkg/templates/sdk_action.go.tmpl b/generator/protoc-gen-cre/pkg/templates/sdk_action.go.tmpl index 7ce243fa..f3cb8186 100644 --- a/generator/protoc-gen-cre/pkg/templates/sdk_action.go.tmpl +++ b/generator/protoc-gen-cre/pkg/templates/sdk_action.go.tmpl @@ -33,6 +33,17 @@ func {{.Method.GoName}}[C, T any]( {{ if .Method.Comments.Leading.String }}//{{.Method.GoName}} {{CleanComments .Method.Comments.Leading.String}} {{ end }} func (c *{{.Service.GoName}}) {{.Method.GoName}}(runtime cre.{{.Mode}}Runtime, input *{{name $inputIdent .GoPackageName}}) cre.Promise[*{{name $outputIdent .GoPackageName}}] { {{- if .Comments.Trailing.String }}// {{CleanComments .Comments.Trailing.String}} {{ end }} + return c.{{LowerFirst .Method.GoName}}(runtime, input) +} +{{ $teeEnabled := TeeEnabled .Service }} +{{ if $teeEnabled }} +//{{.Method.GoName}}InTee is the same as {{.Method.GoName}} but accepts a cre.TeeRuntime. +func (c *{{.Service.GoName}}) {{.Method.GoName}}InTee(runtime cre.TeeRuntime, input *{{name $inputIdent .GoPackageName}}) cre.Promise[*{{name $outputIdent .GoPackageName}}] { + return c.{{LowerFirst .Method.GoName}}(runtime, input) +} +{{ end }} + +func (c *{{.Service.GoName}}) {{LowerFirst .Method.GoName}}(runtime cre.RuntimeBase, input *{{name $inputIdent .GoPackageName}}) cre.Promise[*{{name $outputIdent .GoPackageName}}] { wrapped := &anypb.Any{} err := anypb.MarshalFrom(wrapped, input{{- if ne $inputIdent .InputType -}}.X_GeneratedCodeOnly_Unwrap(){{- end -}}, proto.MarshalOptions{Deterministic: true}) if err != nil { diff --git a/generator/protoc-gen-cre/protoc-gen-cre b/generator/protoc-gen-cre/protoc-gen-cre new file mode 100755 index 00000000..1eaf0806 Binary files /dev/null and b/generator/protoc-gen-cre/protoc-gen-cre differ diff --git a/generator/protos/utils.go b/generator/protos/utils.go index d9637f6f..6350a94f 100644 --- a/generator/protos/utils.go +++ b/generator/protos/utils.go @@ -33,8 +33,15 @@ func newGeneratorAndInstallTools(install func() error) (*pkg.ProtocGen, error) { }, nil } -// installFromMod installs the protoc-gen-cre plugin from the same commit as the SDK you're using +// installFromMod installs the protoc-gen-cre plugin from the same commit as the SDK you're using. +// If the current module's go.mod has a replace directive for the plugin pointing to a local directory, +// the plugin is built directly from that local directory instead of being downloaded. func installFromMod() error { + if localDir := getLocalReplaceDir(plugin); localDir != "" { + fmt.Printf("Using local replace for %s at %s\n", plugin, localDir) + return buildPlugin(localDir) + } + fmt.Printf("Finding version to use for %s\n.", sdk) pluginVersion, err := getVersion(sdk, ".") if err != nil { @@ -49,6 +56,25 @@ func installFromMod() error { return buildPlugin(pluginDir) } +// getLocalReplaceDir returns the local directory for a module's replace directive, or empty string if none. +func getLocalReplaceDir(modulePath string) string { + cmd := exec.Command("go", "list", "-m", "-json", modulePath) + out, err := cmd.Output() + if err != nil { + return "" + } + + var mod struct { + Replace *struct { + Dir string + } + } + if err = json.Unmarshal(out, &mod); err != nil || mod.Replace == nil { + return "" + } + return mod.Replace.Dir +} + // buildProtocGenLocally builds against the local protoc-gen-cre source code. // Installing it from the same commit won't work well if you modify the protor generator, // since it will first generate without the changes, then on commit, generate with them. diff --git a/go.md b/go.md index bdaf36c4..548c444f 100644 --- a/go.md +++ b/go.md @@ -8,6 +8,7 @@ flowchart LR chainlink-common --> chainlink-protos/billing/go chainlink-common --> chainlink-protos/cre/go chainlink-common --> chainlink-protos/linking-service/go + chainlink-common --> chainlink-protos/node-platform chainlink-common --> chainlink-protos/storage-service chainlink-common --> chainlink-protos/workflows/go chainlink-common --> freeport @@ -22,14 +23,20 @@ flowchart LR click chainlink-protos/cre/go href "https://github.com/smartcontractkit/chainlink-protos" chainlink-protos/linking-service/go click chainlink-protos/linking-service/go href "https://github.com/smartcontractkit/chainlink-protos" + chainlink-protos/node-platform + click chainlink-protos/node-platform href "https://github.com/smartcontractkit/chainlink-protos" chainlink-protos/storage-service click chainlink-protos/storage-service href "https://github.com/smartcontractkit/chainlink-protos" chainlink-protos/workflows/go click chainlink-protos/workflows/go href "https://github.com/smartcontractkit/chainlink-protos" cre-sdk-go --> chainlink-protos/cre/go click cre-sdk-go href "https://github.com/smartcontractkit/cre-sdk-go" + cre-sdk-go/capabilities/blockchain/aptos --> cre-sdk-go + click cre-sdk-go/capabilities/blockchain/aptos href "https://github.com/smartcontractkit/cre-sdk-go" cre-sdk-go/capabilities/blockchain/evm --> cre-sdk-go click cre-sdk-go/capabilities/blockchain/evm href "https://github.com/smartcontractkit/cre-sdk-go" + cre-sdk-go/capabilities/blockchain/solana --> cre-sdk-go + click cre-sdk-go/capabilities/blockchain/solana href "https://github.com/smartcontractkit/cre-sdk-go" cre-sdk-go/capabilities/networking/confidentialhttp --> cre-sdk-go click cre-sdk-go/capabilities/networking/confidentialhttp href "https://github.com/smartcontractkit/cre-sdk-go" cre-sdk-go/capabilities/networking/http --> cre-sdk-go @@ -55,6 +62,7 @@ flowchart LR chainlink-protos/billing/go chainlink-protos/cre/go chainlink-protos/linking-service/go + chainlink-protos/node-platform chainlink-protos/storage-service chainlink-protos/workflows/go end @@ -62,7 +70,9 @@ flowchart LR subgraph cre-sdk-go-repo[cre-sdk-go] cre-sdk-go + cre-sdk-go/capabilities/blockchain/aptos cre-sdk-go/capabilities/blockchain/evm + cre-sdk-go/capabilities/blockchain/solana cre-sdk-go/capabilities/networking/confidentialhttp cre-sdk-go/capabilities/networking/http cre-sdk-go/capabilities/scheduler/cron diff --git a/go.mod b/go.mod index 40f10094..25d77d36 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.25.3 require ( github.com/ethereum/go-ethereum v1.17.2 github.com/shopspring/decimal v1.4.0 - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260528173858-e8efb307513b github.com/stretchr/testify v1.11.1 google.golang.org/protobuf v1.36.11 ) diff --git a/go.sum b/go.sum index a4fdb171..ef55b2c0 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,8 @@ github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0t github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f h1:MHlgzqiDPyDV397bZkzS9TtWXb3FR9Pb8FR9cP9h0As= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260528173858-e8efb307513b h1:K0/ns9gFEJWxMLdlWTCYI2KxeoSCJdkzVsw3ICeX9iM= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260528173858-e8efb307513b/go.mod h1:vTFHTCbLui4Vn8fTmAadfE3rdnvfrDwOmMujmW857D0= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= diff --git a/internal/sdkimpl/runtime.go b/internal/sdkimpl/runtime.go index c2d93b7e..25c7394e 100644 --- a/internal/sdkimpl/runtime.go +++ b/internal/sdkimpl/runtime.go @@ -225,3 +225,41 @@ type NodeRuntime struct { var _ cre.NodeRuntime = &NodeRuntime{} func (n *NodeRuntime) IsNodeRuntime() {} + +type TeeRuntime struct { + don *Runtime +} + +var _ cre.TeeRuntime = &TeeRuntime{} + +func NewTeeRuntime(don *Runtime) *TeeRuntime { + return &TeeRuntime{don: don} +} + +func (t *TeeRuntime) CallCapability(request *sdk.CapabilityRequest) cre.Promise[*sdk.CapabilityResponse] { + return t.don.CallCapability(request) +} + +func (t *TeeRuntime) Rand() (*rand.Rand, error) { + return t.don.Rand() +} + +func (t *TeeRuntime) Now() time.Time { + return t.don.Now() +} + +func (t *TeeRuntime) Logger() *slog.Logger { + return t.don.Logger() +} + +func (t *TeeRuntime) GetSecret(req *sdk.SecretRequest) cre.Promise[*sdk.Secret] { + return t.don.GetSecret(req) +} + +func (t *TeeRuntime) ReportFromDon(request *cre.ReportRequest) cre.Promise[*cre.Report] { + return t.don.GenerateReport(request) +} + +func (t *TeeRuntime) UsingTheDons() cre.Runtime { + return t.don +} diff --git a/internal_testing/capabilities/actionandtrigger/action_and_trigger_sdk_gen.go b/internal_testing/capabilities/actionandtrigger/action_and_trigger_sdk_gen.go index 233159cc..f3c739a4 100644 --- a/internal_testing/capabilities/actionandtrigger/action_and_trigger_sdk_gen.go +++ b/internal_testing/capabilities/actionandtrigger/action_and_trigger_sdk_gen.go @@ -17,6 +17,10 @@ type Basic struct { } func (c *Basic) Action(runtime cre.Runtime, input *Input) cre.Promise[*Output] { + return c.action(runtime, input) +} + +func (c *Basic) action(runtime cre.RuntimeBase, input *Input) cre.Promise[*Output] { wrapped := &anypb.Any{} err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) if err != nil { diff --git a/internal_testing/capabilities/basicaction/basic_action_sdk_gen.go b/internal_testing/capabilities/basicaction/basic_action_sdk_gen.go index 0803ade5..2c63bf2d 100644 --- a/internal_testing/capabilities/basicaction/basic_action_sdk_gen.go +++ b/internal_testing/capabilities/basicaction/basic_action_sdk_gen.go @@ -19,6 +19,10 @@ type BasicAction struct { // PerformAction This comment tests the generator's ability to handle leading comments on methods. func (c *BasicAction) PerformAction(runtime cre.Runtime, input *Inputs) cre.Promise[*Outputs] { + return c.performAction(runtime, input) +} + +func (c *BasicAction) performAction(runtime cre.RuntimeBase, input *Inputs) cre.Promise[*Outputs] { wrapped := &anypb.Any{} err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) if err != nil { diff --git a/internal_testing/capabilities/consensus/consensus_sdk_gen.go b/internal_testing/capabilities/consensus/consensus_sdk_gen.go index 76ec8f04..9a75cc71 100644 --- a/internal_testing/capabilities/consensus/consensus_sdk_gen.go +++ b/internal_testing/capabilities/consensus/consensus_sdk_gen.go @@ -19,6 +19,10 @@ type Consensus struct { } func (c *Consensus) Simple(runtime cre.Runtime, input *sdk.SimpleConsensusInputs) cre.Promise[*pb.Value] { + return c.simple(runtime, input) +} + +func (c *Consensus) simple(runtime cre.RuntimeBase, input *sdk.SimpleConsensusInputs) cre.Promise[*pb.Value] { wrapped := &anypb.Any{} err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) if err != nil { @@ -47,6 +51,10 @@ func (c *Consensus) Simple(runtime cre.Runtime, input *sdk.SimpleConsensusInputs } func (c *Consensus) Report(runtime cre.Runtime, input *sdk.ReportRequest) cre.Promise[*cre.Report] { + return c.report(runtime, input) +} + +func (c *Consensus) report(runtime cre.RuntimeBase, input *sdk.ReportRequest) cre.Promise[*cre.Report] { wrapped := &anypb.Any{} err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) if err != nil { diff --git a/internal_testing/capabilities/importclash/clash_sdk_gen.go b/internal_testing/capabilities/importclash/clash_sdk_gen.go index a5780237..8e9f4573 100644 --- a/internal_testing/capabilities/importclash/clash_sdk_gen.go +++ b/internal_testing/capabilities/importclash/clash_sdk_gen.go @@ -19,6 +19,10 @@ type BasicAction struct { } func (c *BasicAction) PerformAction(runtime cre.Runtime, input *p1.Item) cre.Promise[*p2.Item] { + return c.performAction(runtime, input) +} + +func (c *BasicAction) performAction(runtime cre.RuntimeBase, input *p1.Item) cre.Promise[*p2.Item] { wrapped := &anypb.Any{} err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) if err != nil { diff --git a/internal_testing/capabilities/nodeaction/node_action_sdk_gen.go b/internal_testing/capabilities/nodeaction/node_action_sdk_gen.go index d0bf802a..54df91ea 100644 --- a/internal_testing/capabilities/nodeaction/node_action_sdk_gen.go +++ b/internal_testing/capabilities/nodeaction/node_action_sdk_gen.go @@ -42,6 +42,10 @@ func PerformAction[C, T any]( } func (c *BasicAction) PerformAction(runtime cre.NodeRuntime, input *NodeInputs) cre.Promise[*NodeOutputs] { + return c.performAction(runtime, input) +} + +func (c *BasicAction) performAction(runtime cre.RuntimeBase, input *NodeInputs) cre.Promise[*NodeOutputs] { wrapped := &anypb.Any{} err := anypb.MarshalFrom(wrapped, input, proto.MarshalOptions{Deterministic: true}) if err != nil { diff --git a/standard_tests/tee_runtime/main_wasip1.go b/standard_tests/tee_runtime/main_wasip1.go new file mode 100644 index 00000000..43002e40 --- /dev/null +++ b/standard_tests/tee_runtime/main_wasip1.go @@ -0,0 +1,38 @@ +package main + +import ( + "log/slog" + + "github.com/smartcontractkit/cre-sdk-go/cre" + "github.com/smartcontractkit/cre-sdk-go/cre/wasm" + "github.com/smartcontractkit/cre-sdk-go/internal_testing/capabilities/basictrigger" +) + +var teeRequirements = cre.OneOfTees{cre.Nitro{Regions: []cre.NitroRegion{cre.NitroUsWest2}}} + +func subscribe(_ []byte, _ *slog.Logger, _ cre.SecretsProvider) (cre.Workflow[[]byte], error) { + return cre.Workflow[[]byte]{ + cre.HandlerInTee( + basictrigger.Trigger(&basictrigger.Config{Name: "first-trigger", Number: 100}), + teeTrigger, + teeRequirements, + ), + cre.Handler( + basictrigger.Trigger(&basictrigger.Config{Name: "second-trigger", Number: 200}), + regularTrigger, + ), + }, nil +} + +func teeTrigger(_ []byte, _ cre.TeeRuntime, _ *basictrigger.Outputs) (int32, error) { + return 0, nil +} + +func regularTrigger(_ []byte, _ cre.Runtime, _ *basictrigger.Outputs) (int32, error) { + return 0, nil +} + +func main() { + runner := wasm.NewRunner(func(configBytes []byte) ([]byte, error) { return configBytes, nil }) + runner.Run(subscribe) +}