v1

package
v0.79.0-preview.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2024 License: AGPL-3.0 Imports: 18 Imported by: 1

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var BlockExplorerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "blockexplorer.api.v1.BlockExplorerService",
	HandlerType: (*BlockExplorerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetTransaction",
			Handler:    _BlockExplorerService_GetTransaction_Handler,
		},
		{
			MethodName: "ListTransactions",
			Handler:    _BlockExplorerService_ListTransactions_Handler,
		},
		{
			MethodName: "Info",
			Handler:    _BlockExplorerService_Info_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "blockexplorer/api/v1/blockexplorer.proto",
}

BlockExplorerService_ServiceDesc is the grpc.ServiceDesc for BlockExplorerService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_blockexplorer_api_v1_blockexplorer_proto protoreflect.FileDescriptor

Functions

func RegisterBlockExplorerServiceHandler

func RegisterBlockExplorerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterBlockExplorerServiceHandler registers the http handlers for service BlockExplorerService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterBlockExplorerServiceHandlerClient

func RegisterBlockExplorerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BlockExplorerServiceClient) error

RegisterBlockExplorerServiceHandlerClient registers the http handlers for service BlockExplorerService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BlockExplorerServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BlockExplorerServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "BlockExplorerServiceClient" to call the correct interceptors.

func RegisterBlockExplorerServiceHandlerFromEndpoint

func RegisterBlockExplorerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterBlockExplorerServiceHandlerFromEndpoint is same as RegisterBlockExplorerServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterBlockExplorerServiceHandlerServer

func RegisterBlockExplorerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BlockExplorerServiceServer) error

RegisterBlockExplorerServiceHandlerServer registers the http handlers for service BlockExplorerService to "mux". UnaryRPC :call BlockExplorerServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBlockExplorerServiceHandlerFromEndpoint instead.

func RegisterBlockExplorerServiceServer

func RegisterBlockExplorerServiceServer(s grpc.ServiceRegistrar, srv BlockExplorerServiceServer)

Types

type BlockExplorerServiceClient

type BlockExplorerServiceClient interface {
	// Get transaction
	//
	// Get a transaction from the Vega blockchain
	GetTransaction(ctx context.Context, in *GetTransactionRequest, opts ...grpc.CallOption) (*GetTransactionResponse, error)
	// List transactions
	//
	// List transactions from the Vega blockchain from the newest to the oldest transactions.
	ListTransactions(ctx context.Context, in *ListTransactionsRequest, opts ...grpc.CallOption) (*ListTransactionsResponse, error)
	// Info
	//
	// Get information about the block explorer.
	// Response contains a semver formatted version of the data node and the commit hash, from which the block explorer was built
	Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
}

BlockExplorerServiceClient is the client API for BlockExplorerService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type BlockExplorerServiceServer

type BlockExplorerServiceServer interface {
	// Get transaction
	//
	// Get a transaction from the Vega blockchain
	GetTransaction(context.Context, *GetTransactionRequest) (*GetTransactionResponse, error)
	// List transactions
	//
	// List transactions from the Vega blockchain from the newest to the oldest transactions.
	ListTransactions(context.Context, *ListTransactionsRequest) (*ListTransactionsResponse, error)
	// Info
	//
	// Get information about the block explorer.
	// Response contains a semver formatted version of the data node and the commit hash, from which the block explorer was built
	Info(context.Context, *InfoRequest) (*InfoResponse, error)
	// contains filtered or unexported methods
}

BlockExplorerServiceServer is the server API for BlockExplorerService service. All implementations must embed UnimplementedBlockExplorerServiceServer for forward compatibility

type GetTransactionRequest

type GetTransactionRequest struct {

	// Hash of the transaction
	Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTransactionRequest) Descriptor deprecated

func (*GetTransactionRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetTransactionRequest.ProtoReflect.Descriptor instead.

func (*GetTransactionRequest) GetHash

func (x *GetTransactionRequest) GetHash() string

func (*GetTransactionRequest) ProtoMessage

func (*GetTransactionRequest) ProtoMessage()

func (*GetTransactionRequest) ProtoReflect

func (x *GetTransactionRequest) ProtoReflect() protoreflect.Message

func (*GetTransactionRequest) Reset

func (x *GetTransactionRequest) Reset()

func (*GetTransactionRequest) String

func (x *GetTransactionRequest) String() string

type GetTransactionResponse

type GetTransactionResponse struct {

	// Transaction corresponding to the hash
	Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTransactionResponse) Descriptor deprecated

func (*GetTransactionResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetTransactionResponse.ProtoReflect.Descriptor instead.

func (*GetTransactionResponse) GetTransaction

func (x *GetTransactionResponse) GetTransaction() *Transaction

func (*GetTransactionResponse) ProtoMessage

func (*GetTransactionResponse) ProtoMessage()

func (*GetTransactionResponse) ProtoReflect

func (x *GetTransactionResponse) ProtoReflect() protoreflect.Message

func (*GetTransactionResponse) Reset

func (x *GetTransactionResponse) Reset()

func (*GetTransactionResponse) String

func (x *GetTransactionResponse) String() string

type InfoRequest

type InfoRequest struct {
	// contains filtered or unexported fields
}

node information

func (*InfoRequest) Descriptor deprecated

func (*InfoRequest) Descriptor() ([]byte, []int)

Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead.

func (*InfoRequest) ProtoMessage

func (*InfoRequest) ProtoMessage()

func (*InfoRequest) ProtoReflect

func (x *InfoRequest) ProtoReflect() protoreflect.Message

func (*InfoRequest) Reset

func (x *InfoRequest) Reset()

func (*InfoRequest) String

func (x *InfoRequest) String() string

type InfoResponse

type InfoResponse struct {

	// Semver formatted version of the data node
	Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	// Commit hash from which the data node was built
	CommitHash string `protobuf:"bytes,2,opt,name=commit_hash,json=commitHash,proto3" json:"commit_hash,omitempty"`
	// contains filtered or unexported fields
}

func (*InfoResponse) Descriptor deprecated

func (*InfoResponse) Descriptor() ([]byte, []int)

Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead.

func (*InfoResponse) GetCommitHash

func (x *InfoResponse) GetCommitHash() string

func (*InfoResponse) GetVersion

func (x *InfoResponse) GetVersion() string

func (*InfoResponse) ProtoMessage

func (*InfoResponse) ProtoMessage()

func (*InfoResponse) ProtoReflect

func (x *InfoResponse) ProtoReflect() protoreflect.Message

func (*InfoResponse) Reset

func (x *InfoResponse) Reset()

func (*InfoResponse) String

func (x *InfoResponse) String() string

type ListTransactionsRequest

type ListTransactionsRequest struct {

	// Cursor to paginate the request. It can be used in conjunction with the `after` cursor.
	Before *string `protobuf:"bytes,2,opt,name=before,proto3,oneof" json:"before,omitempty"`
	// Cursor to paginate the request. It can be used in conjunction with the `before` cursor.
	After *string `protobuf:"bytes,3,opt,name=after,proto3,oneof" json:"after,omitempty"`
	// Filters to apply to the request
	Filters map[string]string `` /* 155-byte string literal not displayed */
	// Transaction command types filter, for listing transactions with specified command types
	CmdTypes []string `protobuf:"bytes,5,rep,name=cmd_types,json=cmdTypes,proto3" json:"cmd_types,omitempty"`
	// Transaction command types exclusion filter, for listing all the transactions except the ones with specified command types
	ExcludeCmdTypes []string `protobuf:"bytes,6,rep,name=exclude_cmd_types,json=excludeCmdTypes,proto3" json:"exclude_cmd_types,omitempty"`
	// Party IDs filter, can be sender or receiver
	Parties []string `protobuf:"bytes,7,rep,name=parties,proto3" json:"parties,omitempty"`
	// Number of transactions to be returned from the blockchain.
	// Use in conjunction with the `after` cursor to paginate forwards. Paginating forwards means toward the most recent
	// transactions.
	// It cannot be used in conjunction with the `before` cursor.
	// On its own, this will return the `first` most recent transactions.
	First uint32 `protobuf:"varint,8,opt,name=first,proto3" json:"first,omitempty"`
	// Number of transactions to be returned from the blockchain.
	// Use in conjunction with the `before` cursor to paginate backwards. Paginating forwards means toward the least recent
	// transactions.
	// It cannot be used in conjunction with the `after` cursor.
	// On its own, this will return the `last` oldest transactions.
	Last uint32 `protobuf:"varint,9,opt,name=last,proto3" json:"last,omitempty"`
	// contains filtered or unexported fields
}

func (*ListTransactionsRequest) Descriptor deprecated

func (*ListTransactionsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListTransactionsRequest.ProtoReflect.Descriptor instead.

func (*ListTransactionsRequest) GetAfter

func (x *ListTransactionsRequest) GetAfter() string

func (*ListTransactionsRequest) GetBefore

func (x *ListTransactionsRequest) GetBefore() string

func (*ListTransactionsRequest) GetCmdTypes added in v0.72.0

func (x *ListTransactionsRequest) GetCmdTypes() []string

func (*ListTransactionsRequest) GetExcludeCmdTypes added in v0.72.0

func (x *ListTransactionsRequest) GetExcludeCmdTypes() []string

func (*ListTransactionsRequest) GetFilters

func (x *ListTransactionsRequest) GetFilters() map[string]string

func (*ListTransactionsRequest) GetFirst added in v0.72.0

func (x *ListTransactionsRequest) GetFirst() uint32

func (*ListTransactionsRequest) GetLast added in v0.72.0

func (x *ListTransactionsRequest) GetLast() uint32

func (*ListTransactionsRequest) GetParties added in v0.72.0

func (x *ListTransactionsRequest) GetParties() []string

func (*ListTransactionsRequest) ProtoMessage

func (*ListTransactionsRequest) ProtoMessage()

func (*ListTransactionsRequest) ProtoReflect

func (x *ListTransactionsRequest) ProtoReflect() protoreflect.Message

func (*ListTransactionsRequest) Reset

func (x *ListTransactionsRequest) Reset()

func (*ListTransactionsRequest) String

func (x *ListTransactionsRequest) String() string

type ListTransactionsResponse

type ListTransactionsResponse struct {

	// Transaction corresponding to the specific request and filters
	Transactions []*Transaction `protobuf:"bytes,3,rep,name=transactions,proto3" json:"transactions,omitempty"`
	// contains filtered or unexported fields
}

func (*ListTransactionsResponse) Descriptor deprecated

func (*ListTransactionsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListTransactionsResponse.ProtoReflect.Descriptor instead.

func (*ListTransactionsResponse) GetTransactions

func (x *ListTransactionsResponse) GetTransactions() []*Transaction

func (*ListTransactionsResponse) ProtoMessage

func (*ListTransactionsResponse) ProtoMessage()

func (*ListTransactionsResponse) ProtoReflect

func (x *ListTransactionsResponse) ProtoReflect() protoreflect.Message

func (*ListTransactionsResponse) Reset

func (x *ListTransactionsResponse) Reset()

func (*ListTransactionsResponse) String

func (x *ListTransactionsResponse) String() string

type Transaction

type Transaction struct {

	// Height of the block the transaction was found in
	Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"`
	// Index of the transaction in the block
	Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
	// Hash of the transaction
	Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"`
	// Vega public key of the transaction's submitter
	Submitter string `protobuf:"bytes,4,opt,name=submitter,proto3" json:"submitter,omitempty"`
	// Type of transaction
	Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"`
	// Results code of the transaction. 0 indicates the transaction was successful
	Code uint32 `protobuf:"varint,6,opt,name=code,proto3" json:"code,omitempty"`
	// Cursor for this transaction. This is used for paginating results
	Cursor string `protobuf:"bytes,7,opt,name=cursor,proto3" json:"cursor,omitempty"`
	// Actual command of the transaction
	Command *v1.InputData `protobuf:"bytes,8,opt,name=command,proto3" json:"command,omitempty"`
	// Signature generated by the submitter for the transaction
	Signature *v1.Signature `protobuf:"bytes,9,opt,name=signature,proto3" json:"signature,omitempty"`
	// Optional error happening when processing / checking the transaction
	// This should be set if error code is not 0
	Error *string `protobuf:"bytes,10,opt,name=error,proto3,oneof" json:"error,omitempty"`
	// Timestamp when the transaction happened, using RFC3399 format.
	CreatedAt string `protobuf:"bytes,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// Version format of the transaction
	Version v1.TxVersion `protobuf:"varint,12,opt,name=version,proto3,enum=vega.commands.v1.TxVersion" json:"version,omitempty"`
	// Proof of Work parameters of the transaction
	Pow *v1.ProofOfWork `protobuf:"bytes,13,opt,name=pow,proto3" json:"pow,omitempty"`
	// contains filtered or unexported fields
}

func (*Transaction) Descriptor deprecated

func (*Transaction) Descriptor() ([]byte, []int)

Deprecated: Use Transaction.ProtoReflect.Descriptor instead.

func (*Transaction) GetBlock

func (x *Transaction) GetBlock() uint64

func (*Transaction) GetCode

func (x *Transaction) GetCode() uint32

func (*Transaction) GetCommand

func (x *Transaction) GetCommand() *v1.InputData

func (*Transaction) GetCreatedAt added in v0.73.0

func (x *Transaction) GetCreatedAt() string

func (*Transaction) GetCursor

func (x *Transaction) GetCursor() string

func (*Transaction) GetError

func (x *Transaction) GetError() string

func (*Transaction) GetHash

func (x *Transaction) GetHash() string

func (*Transaction) GetIndex

func (x *Transaction) GetIndex() uint32

func (*Transaction) GetPow added in v0.73.0

func (x *Transaction) GetPow() *v1.ProofOfWork

func (*Transaction) GetSignature

func (x *Transaction) GetSignature() *v1.Signature

func (*Transaction) GetSubmitter

func (x *Transaction) GetSubmitter() string

func (*Transaction) GetType

func (x *Transaction) GetType() string

func (*Transaction) GetVersion added in v0.73.0

func (x *Transaction) GetVersion() v1.TxVersion

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) ProtoReflect

func (x *Transaction) ProtoReflect() protoreflect.Message

func (*Transaction) Reset

func (x *Transaction) Reset()

func (*Transaction) String

func (x *Transaction) String() string

type UnimplementedBlockExplorerServiceServer

type UnimplementedBlockExplorerServiceServer struct {
}

UnimplementedBlockExplorerServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedBlockExplorerServiceServer) GetTransaction

func (UnimplementedBlockExplorerServiceServer) Info

func (UnimplementedBlockExplorerServiceServer) ListTransactions

type UnsafeBlockExplorerServiceServer

type UnsafeBlockExplorerServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeBlockExplorerServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BlockExplorerServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL