// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

// @generated by protobuf-ts 2.9.6 with parameter force_server_none,optimize_code_size,ts_nocheck
// @generated from protobuf file "sui/rpc/v2/ledger_service.proto" (package "sui.rpc.v2", syntax proto3)
// tslint:disable
// @ts-nocheck
//
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
//
import { ServiceType } from '@protobuf-ts/runtime-rpc';
import { MessageType } from '@protobuf-ts/runtime';
import { Epoch } from './epoch.js';
import { Checkpoint } from './checkpoint.js';
import { ExecutedTransaction } from './executed_transaction.js';
import { Status } from '../../../google/rpc/status.js';
import { Object } from './object.js';
import { FieldMask } from '../../../google/protobuf/field_mask.js';
import { Timestamp } from '../../../google/protobuf/timestamp.js';
/**
 * @generated from protobuf message sui.rpc.v2.GetServiceInfoRequest
 */
export interface GetServiceInfoRequest {}
/**
 * @generated from protobuf message sui.rpc.v2.GetServiceInfoResponse
 */
export interface GetServiceInfoResponse {
	/**
	 * The chain identifier of the chain that this node is on.
	 *
	 * The chain identifier is the digest of the genesis checkpoint, the
	 * checkpoint with sequence number 0.
	 *
	 * @generated from protobuf field: optional string chain_id = 1;
	 */
	chainId?: string;
	/**
	 * Human-readable name of the chain that this node is on.
	 *
	 * This is intended to be a human-readable name like `mainnet`, `testnet`, and so on.
	 *
	 * @generated from protobuf field: optional string chain = 2;
	 */
	chain?: string;
	/**
	 * Current epoch of the node based on its highest executed checkpoint.
	 *
	 * @generated from protobuf field: optional uint64 epoch = 3;
	 */
	epoch?: bigint;
	/**
	 * Checkpoint height of the most recently executed checkpoint.
	 *
	 * @generated from protobuf field: optional uint64 checkpoint_height = 4;
	 */
	checkpointHeight?: bigint;
	/**
	 * Unix timestamp of the most recently executed checkpoint.
	 *
	 * @generated from protobuf field: optional google.protobuf.Timestamp timestamp = 5;
	 */
	timestamp?: Timestamp;
	/**
	 * The lowest checkpoint for which checkpoints and transaction data are available.
	 *
	 * @generated from protobuf field: optional uint64 lowest_available_checkpoint = 6;
	 */
	lowestAvailableCheckpoint?: bigint;
	/**
	 * The lowest checkpoint for which object data is available.
	 *
	 * @generated from protobuf field: optional uint64 lowest_available_checkpoint_objects = 7;
	 */
	lowestAvailableCheckpointObjects?: bigint;
	/**
	 * Software version of the service. Similar to the `server` http header.
	 *
	 * @generated from protobuf field: optional string server = 8;
	 */
	server?: string;
}
/**
 * @generated from protobuf message sui.rpc.v2.GetObjectRequest
 */
export interface GetObjectRequest {
	/**
	 * Required. The `ObjectId` of the requested object.
	 *
	 * @generated from protobuf field: optional string object_id = 1;
	 */
	objectId?: string;
	/**
	 * Request a specific version of the object.
	 * If no version is specified, and the object is live, then the latest
	 * version of the object is returned.
	 *
	 * @generated from protobuf field: optional uint64 version = 2;
	 */
	version?: bigint;
	/**
	 * Mask specifying which fields to read.
	 * If no mask is specified, defaults to `object_id,version,digest`.
	 *
	 * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 3;
	 */
	readMask?: FieldMask;
}
/**
 * @generated from protobuf message sui.rpc.v2.GetObjectResponse
 */
export interface GetObjectResponse {
	/**
	 * @generated from protobuf field: optional sui.rpc.v2.Object object = 1;
	 */
	object?: Object;
}
/**
 * @generated from protobuf message sui.rpc.v2.BatchGetObjectsRequest
 */
export interface BatchGetObjectsRequest {
	/**
	 * @generated from protobuf field: repeated sui.rpc.v2.GetObjectRequest requests = 1;
	 */
	requests: GetObjectRequest[];
	/**
	 * Mask specifying which fields to read.
	 * If no mask is specified, defaults to `object_id,version,digest`.
	 *
	 * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 2;
	 */
	readMask?: FieldMask;
}
/**
 * @generated from protobuf message sui.rpc.v2.BatchGetObjectsResponse
 */
export interface BatchGetObjectsResponse {
	/**
	 * @generated from protobuf field: repeated sui.rpc.v2.GetObjectResult objects = 1;
	 */
	objects: GetObjectResult[];
}
/**
 * @generated from protobuf message sui.rpc.v2.GetObjectResult
 */
export interface GetObjectResult {
	/**
	 * @generated from protobuf oneof: result
	 */
	result:
		| {
				oneofKind: 'object';
				/**
				 * @generated from protobuf field: sui.rpc.v2.Object object = 1;
				 */
				object: Object;
		  }
		| {
				oneofKind: 'error';
				/**
				 * @generated from protobuf field: google.rpc.Status error = 2;
				 */
				error: Status;
		  }
		| {
				oneofKind: undefined;
		  };
}
/**
 * @generated from protobuf message sui.rpc.v2.GetTransactionRequest
 */
export interface GetTransactionRequest {
	/**
	 * Required. The digest of the requested transaction.
	 *
	 * @generated from protobuf field: optional string digest = 1;
	 */
	digest?: string;
	/**
	 * Mask specifying which fields to read.
	 * If no mask is specified, defaults to `digest`.
	 *
	 * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 2;
	 */
	readMask?: FieldMask;
}
/**
 * @generated from protobuf message sui.rpc.v2.GetTransactionResponse
 */
export interface GetTransactionResponse {
	/**
	 * @generated from protobuf field: optional sui.rpc.v2.ExecutedTransaction transaction = 1;
	 */
	transaction?: ExecutedTransaction;
}
/**
 * @generated from protobuf message sui.rpc.v2.BatchGetTransactionsRequest
 */
export interface BatchGetTransactionsRequest {
	/**
	 * Required. The digests of the requested transactions.
	 *
	 * @generated from protobuf field: repeated string digests = 1;
	 */
	digests: string[];
	/**
	 * Mask specifying which fields to read.
	 * If no mask is specified, defaults to `digest`.
	 *
	 * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 2;
	 */
	readMask?: FieldMask;
}
/**
 * @generated from protobuf message sui.rpc.v2.BatchGetTransactionsResponse
 */
export interface BatchGetTransactionsResponse {
	/**
	 * @generated from protobuf field: repeated sui.rpc.v2.GetTransactionResult transactions = 1;
	 */
	transactions: GetTransactionResult[];
}
/**
 * @generated from protobuf message sui.rpc.v2.GetTransactionResult
 */
export interface GetTransactionResult {
	/**
	 * @generated from protobuf oneof: result
	 */
	result:
		| {
				oneofKind: 'transaction';
				/**
				 * @generated from protobuf field: sui.rpc.v2.ExecutedTransaction transaction = 1;
				 */
				transaction: ExecutedTransaction;
		  }
		| {
				oneofKind: 'error';
				/**
				 * @generated from protobuf field: google.rpc.Status error = 2;
				 */
				error: Status;
		  }
		| {
				oneofKind: undefined;
		  };
}
/**
 * @generated from protobuf message sui.rpc.v2.GetCheckpointRequest
 */
export interface GetCheckpointRequest {
	/**
	 * @generated from protobuf oneof: checkpoint_id
	 */
	checkpointId:
		| {
				oneofKind: 'sequenceNumber';
				/**
				 * The sequence number of the requested checkpoint.
				 *
				 * @generated from protobuf field: uint64 sequence_number = 1;
				 */
				sequenceNumber: bigint;
		  }
		| {
				oneofKind: 'digest';
				/**
				 * The digest of the requested checkpoint.
				 *
				 * @generated from protobuf field: string digest = 2;
				 */
				digest: string;
		  }
		| {
				oneofKind: undefined;
		  };
	/**
	 * Mask specifying which fields to read.
	 * If no mask is specified, defaults to `sequence_number,digest`.
	 *
	 * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 3;
	 */
	readMask?: FieldMask;
}
/**
 * @generated from protobuf message sui.rpc.v2.GetCheckpointResponse
 */
export interface GetCheckpointResponse {
	/**
	 * @generated from protobuf field: optional sui.rpc.v2.Checkpoint checkpoint = 1;
	 */
	checkpoint?: Checkpoint;
}
/**
 * @generated from protobuf message sui.rpc.v2.GetEpochRequest
 */
export interface GetEpochRequest {
	/**
	 * The requested epoch.
	 * If no epoch is provided the current epoch will be returned.
	 *
	 * @generated from protobuf field: optional uint64 epoch = 1;
	 */
	epoch?: bigint;
	/**
	 * Mask specifying which fields to read.
	 * If no mask is specified, defaults to `epoch`.
	 *
	 * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 2;
	 */
	readMask?: FieldMask;
}
/**
 * @generated from protobuf message sui.rpc.v2.GetEpochResponse
 */
export interface GetEpochResponse {
	/**
	 * @generated from protobuf field: optional sui.rpc.v2.Epoch epoch = 1;
	 */
	epoch?: Epoch;
}
// @generated message type with reflection information, may provide speed optimized methods
class GetServiceInfoRequest$Type extends MessageType<GetServiceInfoRequest> {
	constructor() {
		super('sui.rpc.v2.GetServiceInfoRequest', []);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.GetServiceInfoRequest
 */
export const GetServiceInfoRequest = new GetServiceInfoRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetServiceInfoResponse$Type extends MessageType<GetServiceInfoResponse> {
	constructor() {
		super('sui.rpc.v2.GetServiceInfoResponse', [
			{ no: 1, name: 'chain_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
			{ no: 2, name: 'chain', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
			{
				no: 3,
				name: 'epoch',
				kind: 'scalar',
				opt: true,
				T: 4 /*ScalarType.UINT64*/,
				L: 0 /*LongType.BIGINT*/,
			},
			{
				no: 4,
				name: 'checkpoint_height',
				kind: 'scalar',
				opt: true,
				T: 4 /*ScalarType.UINT64*/,
				L: 0 /*LongType.BIGINT*/,
			},
			{ no: 5, name: 'timestamp', kind: 'message', T: () => Timestamp },
			{
				no: 6,
				name: 'lowest_available_checkpoint',
				kind: 'scalar',
				opt: true,
				T: 4 /*ScalarType.UINT64*/,
				L: 0 /*LongType.BIGINT*/,
			},
			{
				no: 7,
				name: 'lowest_available_checkpoint_objects',
				kind: 'scalar',
				opt: true,
				T: 4 /*ScalarType.UINT64*/,
				L: 0 /*LongType.BIGINT*/,
			},
			{ no: 8, name: 'server', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.GetServiceInfoResponse
 */
export const GetServiceInfoResponse = new GetServiceInfoResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetObjectRequest$Type extends MessageType<GetObjectRequest> {
	constructor() {
		super('sui.rpc.v2.GetObjectRequest', [
			{ no: 1, name: 'object_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
			{
				no: 2,
				name: 'version',
				kind: 'scalar',
				opt: true,
				T: 4 /*ScalarType.UINT64*/,
				L: 0 /*LongType.BIGINT*/,
			},
			{ no: 3, name: 'read_mask', kind: 'message', T: () => FieldMask },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.GetObjectRequest
 */
export const GetObjectRequest = new GetObjectRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetObjectResponse$Type extends MessageType<GetObjectResponse> {
	constructor() {
		super('sui.rpc.v2.GetObjectResponse', [
			{ no: 1, name: 'object', kind: 'message', T: () => Object },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.GetObjectResponse
 */
export const GetObjectResponse = new GetObjectResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class BatchGetObjectsRequest$Type extends MessageType<BatchGetObjectsRequest> {
	constructor() {
		super('sui.rpc.v2.BatchGetObjectsRequest', [
			{
				no: 1,
				name: 'requests',
				kind: 'message',
				repeat: 1 /*RepeatType.PACKED*/,
				T: () => GetObjectRequest,
			},
			{ no: 2, name: 'read_mask', kind: 'message', T: () => FieldMask },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.BatchGetObjectsRequest
 */
export const BatchGetObjectsRequest = new BatchGetObjectsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class BatchGetObjectsResponse$Type extends MessageType<BatchGetObjectsResponse> {
	constructor() {
		super('sui.rpc.v2.BatchGetObjectsResponse', [
			{
				no: 1,
				name: 'objects',
				kind: 'message',
				repeat: 1 /*RepeatType.PACKED*/,
				T: () => GetObjectResult,
			},
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.BatchGetObjectsResponse
 */
export const BatchGetObjectsResponse = new BatchGetObjectsResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetObjectResult$Type extends MessageType<GetObjectResult> {
	constructor() {
		super('sui.rpc.v2.GetObjectResult', [
			{ no: 1, name: 'object', kind: 'message', oneof: 'result', T: () => Object },
			{ no: 2, name: 'error', kind: 'message', oneof: 'result', T: () => Status },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.GetObjectResult
 */
export const GetObjectResult = new GetObjectResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetTransactionRequest$Type extends MessageType<GetTransactionRequest> {
	constructor() {
		super('sui.rpc.v2.GetTransactionRequest', [
			{ no: 1, name: 'digest', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
			{ no: 2, name: 'read_mask', kind: 'message', T: () => FieldMask },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.GetTransactionRequest
 */
export const GetTransactionRequest = new GetTransactionRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetTransactionResponse$Type extends MessageType<GetTransactionResponse> {
	constructor() {
		super('sui.rpc.v2.GetTransactionResponse', [
			{ no: 1, name: 'transaction', kind: 'message', T: () => ExecutedTransaction },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.GetTransactionResponse
 */
export const GetTransactionResponse = new GetTransactionResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class BatchGetTransactionsRequest$Type extends MessageType<BatchGetTransactionsRequest> {
	constructor() {
		super('sui.rpc.v2.BatchGetTransactionsRequest', [
			{
				no: 1,
				name: 'digests',
				kind: 'scalar',
				repeat: 2 /*RepeatType.UNPACKED*/,
				T: 9 /*ScalarType.STRING*/,
			},
			{ no: 2, name: 'read_mask', kind: 'message', T: () => FieldMask },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.BatchGetTransactionsRequest
 */
export const BatchGetTransactionsRequest = new BatchGetTransactionsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class BatchGetTransactionsResponse$Type extends MessageType<BatchGetTransactionsResponse> {
	constructor() {
		super('sui.rpc.v2.BatchGetTransactionsResponse', [
			{
				no: 1,
				name: 'transactions',
				kind: 'message',
				repeat: 1 /*RepeatType.PACKED*/,
				T: () => GetTransactionResult,
			},
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.BatchGetTransactionsResponse
 */
export const BatchGetTransactionsResponse = new BatchGetTransactionsResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetTransactionResult$Type extends MessageType<GetTransactionResult> {
	constructor() {
		super('sui.rpc.v2.GetTransactionResult', [
			{
				no: 1,
				name: 'transaction',
				kind: 'message',
				oneof: 'result',
				T: () => ExecutedTransaction,
			},
			{ no: 2, name: 'error', kind: 'message', oneof: 'result', T: () => Status },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.GetTransactionResult
 */
export const GetTransactionResult = new GetTransactionResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetCheckpointRequest$Type extends MessageType<GetCheckpointRequest> {
	constructor() {
		super('sui.rpc.v2.GetCheckpointRequest', [
			{
				no: 1,
				name: 'sequence_number',
				kind: 'scalar',
				oneof: 'checkpointId',
				T: 4 /*ScalarType.UINT64*/,
				L: 0 /*LongType.BIGINT*/,
			},
			{ no: 2, name: 'digest', kind: 'scalar', oneof: 'checkpointId', T: 9 /*ScalarType.STRING*/ },
			{ no: 3, name: 'read_mask', kind: 'message', T: () => FieldMask },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.GetCheckpointRequest
 */
export const GetCheckpointRequest = new GetCheckpointRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetCheckpointResponse$Type extends MessageType<GetCheckpointResponse> {
	constructor() {
		super('sui.rpc.v2.GetCheckpointResponse', [
			{ no: 1, name: 'checkpoint', kind: 'message', T: () => Checkpoint },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.GetCheckpointResponse
 */
export const GetCheckpointResponse = new GetCheckpointResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetEpochRequest$Type extends MessageType<GetEpochRequest> {
	constructor() {
		super('sui.rpc.v2.GetEpochRequest', [
			{
				no: 1,
				name: 'epoch',
				kind: 'scalar',
				opt: true,
				T: 4 /*ScalarType.UINT64*/,
				L: 0 /*LongType.BIGINT*/,
			},
			{ no: 2, name: 'read_mask', kind: 'message', T: () => FieldMask },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.GetEpochRequest
 */
export const GetEpochRequest = new GetEpochRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetEpochResponse$Type extends MessageType<GetEpochResponse> {
	constructor() {
		super('sui.rpc.v2.GetEpochResponse', [
			{ no: 1, name: 'epoch', kind: 'message', T: () => Epoch },
		]);
	}
}
/**
 * @generated MessageType for protobuf message sui.rpc.v2.GetEpochResponse
 */
export const GetEpochResponse = new GetEpochResponse$Type();
/**
 * @generated ServiceType for protobuf service sui.rpc.v2.LedgerService
 */
export const LedgerService = new ServiceType('sui.rpc.v2.LedgerService', [
	{ name: 'GetServiceInfo', options: {}, I: GetServiceInfoRequest, O: GetServiceInfoResponse },
	{ name: 'GetObject', options: {}, I: GetObjectRequest, O: GetObjectResponse },
	{ name: 'BatchGetObjects', options: {}, I: BatchGetObjectsRequest, O: BatchGetObjectsResponse },
	{ name: 'GetTransaction', options: {}, I: GetTransactionRequest, O: GetTransactionResponse },
	{
		name: 'BatchGetTransactions',
		options: {},
		I: BatchGetTransactionsRequest,
		O: BatchGetTransactionsResponse,
	},
	{ name: 'GetCheckpoint', options: {}, I: GetCheckpointRequest, O: GetCheckpointResponse },
	{ name: 'GetEpoch', options: {}, I: GetEpochRequest, O: GetEpochResponse },
]);
