#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Argument {
#[prost(enumeration = "argument::ArgumentKind", optional, tag = "1")]
pub kind: ::core::option::Option<i32>,
#[prost(uint32, optional, tag = "2")]
pub input: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "3")]
pub result: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "4")]
pub subresult: ::core::option::Option<u32>,
}
pub mod argument {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ArgumentKind {
Unknown = 0,
Gas = 1,
Input = 2,
Result = 3,
}
impl ArgumentKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "ARGUMENT_KIND_UNKNOWN",
Self::Gas => "GAS",
Self::Input => "INPUT",
Self::Result => "RESULT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ARGUMENT_KIND_UNKNOWN" => Some(Self::Unknown),
"GAS" => Some(Self::Gas),
"INPUT" => Some(Self::Input),
"RESULT" => Some(Self::Result),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BalanceChange {
#[prost(string, optional, tag = "1")]
pub address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub amount: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bcs {
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bytes = "bytes", optional, tag = "2")]
pub value: ::core::option::Option<::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Checkpoint {
#[prost(uint64, optional, tag = "1")]
pub sequence_number: ::core::option::Option<u64>,
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub summary: ::core::option::Option<CheckpointSummary>,
#[prost(message, optional, tag = "4")]
pub signature: ::core::option::Option<ValidatorAggregatedSignature>,
#[prost(message, optional, tag = "5")]
pub contents: ::core::option::Option<CheckpointContents>,
#[prost(message, repeated, tag = "6")]
pub transactions: ::prost::alloc::vec::Vec<ExecutedTransaction>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckpointContents {
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int32, optional, tag = "3")]
pub version: ::core::option::Option<i32>,
#[prost(message, repeated, tag = "4")]
pub transactions: ::prost::alloc::vec::Vec<CheckpointedTransactionInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckpointedTransactionInfo {
#[prost(string, optional, tag = "1")]
pub transaction: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub effects: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "3")]
pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckpointSummary {
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub epoch: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub sequence_number: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "5")]
pub total_network_transactions: ::core::option::Option<u64>,
#[prost(string, optional, tag = "6")]
pub content_digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "7")]
pub previous_digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub epoch_rolling_gas_cost_summary: ::core::option::Option<GasCostSummary>,
#[prost(message, optional, tag = "9")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, repeated, tag = "10")]
pub commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
#[prost(message, optional, tag = "11")]
pub end_of_epoch_data: ::core::option::Option<EndOfEpochData>,
#[prost(bytes = "bytes", optional, tag = "12")]
pub version_specific_data: ::core::option::Option<::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndOfEpochData {
#[prost(message, repeated, tag = "1")]
pub next_epoch_committee: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
#[prost(uint64, optional, tag = "2")]
pub next_epoch_protocol_version: ::core::option::Option<u64>,
#[prost(message, repeated, tag = "3")]
pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckpointCommitment {
#[prost(
enumeration = "checkpoint_commitment::CheckpointCommitmentKind",
optional,
tag = "1"
)]
pub kind: ::core::option::Option<i32>,
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
}
pub mod checkpoint_commitment {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CheckpointCommitmentKind {
Unknown = 0,
EcmhLiveObjectSet = 1,
}
impl CheckpointCommitmentKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "CHECKPOINT_COMMITMENT_KIND_UNKNOWN",
Self::EcmhLiveObjectSet => "ECMH_LIVE_OBJECT_SET",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CHECKPOINT_COMMITMENT_KIND_UNKNOWN" => Some(Self::Unknown),
"ECMH_LIVE_OBJECT_SET" => Some(Self::EcmhLiveObjectSet),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionEffects {
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int32, optional, tag = "3")]
pub version: ::core::option::Option<i32>,
#[prost(message, optional, tag = "4")]
pub status: ::core::option::Option<ExecutionStatus>,
#[prost(uint64, optional, tag = "5")]
pub epoch: ::core::option::Option<u64>,
#[prost(message, optional, tag = "6")]
pub gas_used: ::core::option::Option<GasCostSummary>,
#[prost(string, optional, tag = "7")]
pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub gas_object: ::core::option::Option<ChangedObject>,
#[prost(string, optional, tag = "9")]
pub events_digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "10")]
pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "11")]
pub lamport_version: ::core::option::Option<u64>,
#[prost(message, repeated, tag = "12")]
pub changed_objects: ::prost::alloc::vec::Vec<ChangedObject>,
#[prost(message, repeated, tag = "13")]
pub unchanged_shared_objects: ::prost::alloc::vec::Vec<UnchangedSharedObject>,
#[prost(string, optional, tag = "14")]
pub auxiliary_data_digest: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangedObject {
#[prost(string, optional, tag = "1")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "changed_object::InputObjectState", optional, tag = "2")]
pub input_state: ::core::option::Option<i32>,
#[prost(uint64, optional, tag = "3")]
pub input_version: ::core::option::Option<u64>,
#[prost(string, optional, tag = "4")]
pub input_digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub input_owner: ::core::option::Option<Owner>,
#[prost(enumeration = "changed_object::OutputObjectState", optional, tag = "6")]
pub output_state: ::core::option::Option<i32>,
#[prost(uint64, optional, tag = "7")]
pub output_version: ::core::option::Option<u64>,
#[prost(string, optional, tag = "8")]
pub output_digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "9")]
pub output_owner: ::core::option::Option<Owner>,
#[prost(enumeration = "changed_object::IdOperation", optional, tag = "10")]
pub id_operation: ::core::option::Option<i32>,
#[prost(string, optional, tag = "11")]
pub object_type: ::core::option::Option<::prost::alloc::string::String>,
}
pub mod changed_object {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum InputObjectState {
Unknown = 0,
DoesNotExist = 1,
Exists = 2,
}
impl InputObjectState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "INPUT_OBJECT_STATE_UNKNOWN",
Self::DoesNotExist => "INPUT_OBJECT_STATE_DOES_NOT_EXIST",
Self::Exists => "INPUT_OBJECT_STATE_EXISTS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
"INPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
"INPUT_OBJECT_STATE_EXISTS" => Some(Self::Exists),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum OutputObjectState {
Unknown = 0,
DoesNotExist = 1,
ObjectWrite = 2,
PackageWrite = 3,
}
impl OutputObjectState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "OUTPUT_OBJECT_STATE_UNKNOWN",
Self::DoesNotExist => "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST",
Self::ObjectWrite => "OUTPUT_OBJECT_STATE_OBJECT_WRITE",
Self::PackageWrite => "OUTPUT_OBJECT_STATE_PACKAGE_WRITE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OUTPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
"OUTPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
"OUTPUT_OBJECT_STATE_OBJECT_WRITE" => Some(Self::ObjectWrite),
"OUTPUT_OBJECT_STATE_PACKAGE_WRITE" => Some(Self::PackageWrite),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum IdOperation {
Unknown = 0,
None = 1,
Created = 2,
Deleted = 3,
}
impl IdOperation {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "ID_OPERATION_UNKNOWN",
Self::None => "NONE",
Self::Created => "CREATED",
Self::Deleted => "DELETED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ID_OPERATION_UNKNOWN" => Some(Self::Unknown),
"NONE" => Some(Self::None),
"CREATED" => Some(Self::Created),
"DELETED" => Some(Self::Deleted),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnchangedSharedObject {
#[prost(
enumeration = "unchanged_shared_object::UnchangedSharedObjectKind",
optional,
tag = "1"
)]
pub kind: ::core::option::Option<i32>,
#[prost(string, optional, tag = "2")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub version: ::core::option::Option<u64>,
#[prost(string, optional, tag = "4")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "5")]
pub object_type: ::core::option::Option<::prost::alloc::string::String>,
}
pub mod unchanged_shared_object {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum UnchangedSharedObjectKind {
Unknown = 0,
ReadOnlyRoot = 1,
MutateDeleted = 2,
ReadDeleted = 3,
Canceled = 4,
PerEpochConfig = 5,
}
impl UnchangedSharedObjectKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNCHANGED_SHARED_OBJECT_KIND_UNKNOWN",
Self::ReadOnlyRoot => "READ_ONLY_ROOT",
Self::MutateDeleted => "MUTATE_DELETED",
Self::ReadDeleted => "READ_DELETED",
Self::Canceled => "CANCELED",
Self::PerEpochConfig => "PER_EPOCH_CONFIG",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNCHANGED_SHARED_OBJECT_KIND_UNKNOWN" => Some(Self::Unknown),
"READ_ONLY_ROOT" => Some(Self::ReadOnlyRoot),
"MUTATE_DELETED" => Some(Self::MutateDeleted),
"READ_DELETED" => Some(Self::ReadDeleted),
"CANCELED" => Some(Self::Canceled),
"PER_EPOCH_CONFIG" => Some(Self::PerEpochConfig),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Epoch {
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
#[prost(message, optional, tag = "2")]
pub committee: ::core::option::Option<ValidatorCommittee>,
#[prost(message, optional, boxed, tag = "3")]
pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
#[prost(uint64, optional, tag = "4")]
pub first_checkpoint: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "5")]
pub last_checkpoint: ::core::option::Option<u64>,
#[prost(message, optional, tag = "6")]
pub start: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub end: ::core::option::Option<::prost_types::Timestamp>,
#[prost(uint64, optional, tag = "8")]
pub reference_gas_price: ::core::option::Option<u64>,
#[prost(message, optional, tag = "9")]
pub protocol_config: ::core::option::Option<ProtocolConfig>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ErrorReason {
Unknown = 0,
FieldInvalid = 1,
FieldMissing = 2,
}
impl ErrorReason {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "ERROR_REASON_UNKNOWN",
Self::FieldInvalid => "FIELD_INVALID",
Self::FieldMissing => "FIELD_MISSING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
"FIELD_INVALID" => Some(Self::FieldInvalid),
"FIELD_MISSING" => Some(Self::FieldMissing),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionEvents {
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "3")]
pub events: ::prost::alloc::vec::Vec<Event>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Event {
#[prost(string, optional, tag = "1")]
pub package_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub module: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub sender: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub event_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub contents: ::core::option::Option<Bcs>,
#[prost(message, optional, boxed, tag = "6")]
pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutedTransaction {
#[prost(string, optional, tag = "1")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub transaction: ::core::option::Option<Transaction>,
#[prost(message, repeated, tag = "3")]
pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
#[prost(message, optional, tag = "4")]
pub effects: ::core::option::Option<TransactionEffects>,
#[prost(message, optional, tag = "5")]
pub events: ::core::option::Option<TransactionEvents>,
#[prost(uint64, optional, tag = "6")]
pub checkpoint: ::core::option::Option<u64>,
#[prost(message, optional, tag = "7")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, repeated, tag = "8")]
pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
#[prost(message, repeated, tag = "10")]
pub input_objects: ::prost::alloc::vec::Vec<Object>,
#[prost(message, repeated, tag = "11")]
pub output_objects: ::prost::alloc::vec::Vec<Object>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionStatus {
#[prost(bool, optional, tag = "1")]
pub success: ::core::option::Option<bool>,
#[prost(message, optional, tag = "2")]
pub error: ::core::option::Option<ExecutionError>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionError {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "2")]
pub command: ::core::option::Option<u64>,
#[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
pub kind: ::core::option::Option<i32>,
#[prost(
oneof = "execution_error::ErrorDetails",
tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
)]
pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
}
pub mod execution_error {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ExecutionErrorKind {
Unknown = 0,
InsufficientGas = 1,
InvalidGasObject = 2,
InvariantViolation = 3,
FeatureNotYetSupported = 4,
ObjectTooBig = 5,
PackageTooBig = 6,
CircularObjectOwnership = 7,
InsufficientCoinBalance = 8,
CoinBalanceOverflow = 9,
PublishErrorNonZeroAddress = 10,
SuiMoveVerificationError = 11,
MovePrimitiveRuntimeError = 12,
MoveAbort = 13,
VmVerificationOrDeserializationError = 14,
VmInvariantViolation = 15,
FunctionNotFound = 16,
ArityMismatch = 17,
TypeArityMismatch = 18,
NonEntryFunctionInvoked = 19,
CommandArgumentError = 20,
TypeArgumentError = 21,
UnusedValueWithoutDrop = 22,
InvalidPublicFunctionReturnType = 23,
InvalidTransferObject = 24,
EffectsTooLarge = 25,
PublishUpgradeMissingDependency = 26,
PublishUpgradeDependencyDowngrade = 27,
PackageUpgradeError = 28,
WrittenObjectsTooLarge = 29,
CertificateDenied = 30,
SuiMoveVerificationTimedout = 31,
SharedObjectOperationNotAllowed = 32,
InputObjectDeleted = 33,
ExecutionCanceledDueToSharedObjectCongestion = 34,
AddressDeniedForCoin = 35,
CoinTypeGlobalPause = 36,
ExecutionCanceledDueToRandomnessUnavailable = 37,
MoveVectorElemTooBig = 38,
MoveRawValueTooBig = 39,
InvalidLinkage = 40,
}
impl ExecutionErrorKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
Self::InsufficientGas => "INSUFFICIENT_GAS",
Self::InvalidGasObject => "INVALID_GAS_OBJECT",
Self::InvariantViolation => "INVARIANT_VIOLATION",
Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
Self::ObjectTooBig => "OBJECT_TOO_BIG",
Self::PackageTooBig => "PACKAGE_TOO_BIG",
Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
Self::MoveAbort => "MOVE_ABORT",
Self::VmVerificationOrDeserializationError => {
"VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
}
Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
Self::ArityMismatch => "ARITY_MISMATCH",
Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
Self::InvalidPublicFunctionReturnType => {
"INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
}
Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
Self::PublishUpgradeMissingDependency => {
"PUBLISH_UPGRADE_MISSING_DEPENDENCY"
}
Self::PublishUpgradeDependencyDowngrade => {
"PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
}
Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
Self::CertificateDenied => "CERTIFICATE_DENIED",
Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
Self::SharedObjectOperationNotAllowed => {
"SHARED_OBJECT_OPERATION_NOT_ALLOWED"
}
Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
Self::ExecutionCanceledDueToSharedObjectCongestion => {
"EXECUTION_CANCELED_DUE_TO_SHARED_OBJECT_CONGESTION"
}
Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
Self::ExecutionCanceledDueToRandomnessUnavailable => {
"EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
}
Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
Self::InvalidLinkage => "INVALID_LINKAGE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
"INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
"INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
"INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
"FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
"OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
"PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
"CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
"INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
"COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
"PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
Some(Self::PublishErrorNonZeroAddress)
}
"SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
"MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
"MOVE_ABORT" => Some(Self::MoveAbort),
"VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
Some(Self::VmVerificationOrDeserializationError)
}
"VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
"FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
"ARITY_MISMATCH" => Some(Self::ArityMismatch),
"TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
"NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
"COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
"TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
"UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
"INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
Some(Self::InvalidPublicFunctionReturnType)
}
"INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
"EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
"PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
Some(Self::PublishUpgradeMissingDependency)
}
"PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
Some(Self::PublishUpgradeDependencyDowngrade)
}
"PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
"WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
"CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
"SUI_MOVE_VERIFICATION_TIMEDOUT" => {
Some(Self::SuiMoveVerificationTimedout)
}
"SHARED_OBJECT_OPERATION_NOT_ALLOWED" => {
Some(Self::SharedObjectOperationNotAllowed)
}
"INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
"EXECUTION_CANCELED_DUE_TO_SHARED_OBJECT_CONGESTION" => {
Some(Self::ExecutionCanceledDueToSharedObjectCongestion)
}
"ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
"COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
"EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
}
"MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
"MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
"INVALID_LINKAGE" => Some(Self::InvalidLinkage),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ErrorDetails {
#[prost(message, tag = "4")]
Abort(super::MoveAbort),
#[prost(message, tag = "5")]
SizeError(super::SizeError),
#[prost(message, tag = "6")]
CommandArgumentError(super::CommandArgumentError),
#[prost(message, tag = "7")]
TypeArgumentError(super::TypeArgumentError),
#[prost(message, tag = "8")]
PackageUpgradeError(super::PackageUpgradeError),
#[prost(message, tag = "9")]
IndexError(super::IndexError),
#[prost(string, tag = "10")]
ObjectId(::prost::alloc::string::String),
#[prost(message, tag = "11")]
CoinDenyListError(super::CoinDenyListError),
#[prost(message, tag = "12")]
CongestedObjects(super::CongestedObjects),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveAbort {
#[prost(uint64, optional, tag = "1")]
pub abort_code: ::core::option::Option<u64>,
#[prost(message, optional, tag = "2")]
pub location: ::core::option::Option<MoveLocation>,
#[prost(message, optional, tag = "3")]
pub clever_error: ::core::option::Option<CleverError>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveLocation {
#[prost(string, optional, tag = "1")]
pub package: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub module: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "3")]
pub function: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "4")]
pub instruction: ::core::option::Option<u32>,
#[prost(string, optional, tag = "5")]
pub function_name: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CleverError {
#[prost(uint64, optional, tag = "1")]
pub error_code: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub line_number: ::core::option::Option<u64>,
#[prost(string, optional, tag = "3")]
pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(oneof = "clever_error::Value", tags = "5, 6")]
pub value: ::core::option::Option<clever_error::Value>,
}
pub mod clever_error {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Value {
#[prost(string, tag = "5")]
Rendered(::prost::alloc::string::String),
#[prost(bytes, tag = "6")]
Raw(::prost::bytes::Bytes),
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SizeError {
#[prost(uint64, optional, tag = "1")]
pub size: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub max_size: ::core::option::Option<u64>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct IndexError {
#[prost(uint32, optional, tag = "1")]
pub index: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "2")]
pub subresult: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CoinDenyListError {
#[prost(string, optional, tag = "1")]
pub address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CongestedObjects {
#[prost(string, repeated, tag = "1")]
pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CommandArgumentError {
#[prost(uint32, optional, tag = "1")]
pub argument: ::core::option::Option<u32>,
#[prost(
enumeration = "command_argument_error::CommandArgumentErrorKind",
optional,
tag = "2"
)]
pub kind: ::core::option::Option<i32>,
#[prost(message, optional, tag = "3")]
pub index_error: ::core::option::Option<IndexError>,
}
pub mod command_argument_error {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CommandArgumentErrorKind {
Unknown = 0,
TypeMismatch = 1,
InvalidBcsBytes = 2,
InvalidUsageOfPureArgument = 3,
InvalidArgumentToPrivateEntryFunction = 4,
IndexOutOfBounds = 5,
SecondaryIndexOutOfBounds = 6,
InvalidResultArity = 7,
InvalidGasCoinUsage = 8,
InvalidValueUsage = 9,
InvalidObjectByValue = 10,
InvalidObjectByMutRef = 11,
SharedObjectOperationNotAllowed = 12,
InvalidArgumentArity = 13,
}
impl CommandArgumentErrorKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
Self::TypeMismatch => "TYPE_MISMATCH",
Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
Self::InvalidArgumentToPrivateEntryFunction => {
"INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
}
Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
Self::InvalidResultArity => "INVALID_RESULT_ARITY",
Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
Self::SharedObjectOperationNotAllowed => {
"SHARED_OBJECT_OPERATION_NOT_ALLOWED"
}
Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
"TYPE_MISMATCH" => Some(Self::TypeMismatch),
"INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
"INVALID_USAGE_OF_PURE_ARGUMENT" => {
Some(Self::InvalidUsageOfPureArgument)
}
"INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
Some(Self::InvalidArgumentToPrivateEntryFunction)
}
"INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
"SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
"INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
"INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
"INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
"INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
"INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
"SHARED_OBJECT_OPERATION_NOT_ALLOWED" => {
Some(Self::SharedObjectOperationNotAllowed)
}
"INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageUpgradeError {
#[prost(
enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
optional,
tag = "1"
)]
pub kind: ::core::option::Option<i32>,
#[prost(string, optional, tag = "2")]
pub package_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "4")]
pub policy: ::core::option::Option<u32>,
#[prost(string, optional, tag = "5")]
pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
}
pub mod package_upgrade_error {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum PackageUpgradeErrorKind {
Unknown = 0,
UnableToFetchPackage = 1,
NotAPackage = 2,
IncompatibleUpgrade = 3,
DigetsDoesNotMatch = 4,
UnknownUpgradePolicy = 5,
PackageIdDoesNotMatch = 6,
}
impl PackageUpgradeErrorKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
Self::NotAPackage => "NOT_A_PACKAGE",
Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
Self::DigetsDoesNotMatch => "DIGETS_DOES_NOT_MATCH",
Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
"UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
"NOT_A_PACKAGE" => Some(Self::NotAPackage),
"INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
"DIGETS_DOES_NOT_MATCH" => Some(Self::DigetsDoesNotMatch),
"UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
"PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
_ => None,
}
}
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TypeArgumentError {
#[prost(uint32, optional, tag = "1")]
pub type_argument: ::core::option::Option<u32>,
#[prost(
enumeration = "type_argument_error::TypeArgumentErrorKind",
optional,
tag = "2"
)]
pub kind: ::core::option::Option<i32>,
}
pub mod type_argument_error {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TypeArgumentErrorKind {
Unknown = 0,
TypeNotFound = 1,
ConstraintNotSatisfied = 2,
}
impl TypeArgumentErrorKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
Self::TypeNotFound => "TYPE_NOT_FOUND",
Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
"TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
"CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
_ => None,
}
}
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GasCostSummary {
#[prost(uint64, optional, tag = "1")]
pub computation_cost: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub storage_cost: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub storage_rebate: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub non_refundable_storage_fee: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Input {
#[prost(enumeration = "input::InputKind", optional, tag = "1")]
pub kind: ::core::option::Option<i32>,
#[prost(bytes = "bytes", optional, tag = "2")]
pub pure: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(string, optional, tag = "3")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "4")]
pub version: ::core::option::Option<u64>,
#[prost(string, optional, tag = "5")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, optional, tag = "6")]
pub mutable: ::core::option::Option<bool>,
#[prost(message, optional, boxed, tag = "1000")]
pub literal: ::core::option::Option<
::prost::alloc::boxed::Box<::prost_types::Value>,
>,
}
pub mod input {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum InputKind {
Unknown = 0,
Pure = 1,
ImmutableOrOwned = 2,
Shared = 3,
Receiving = 4,
}
impl InputKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "INPUT_KIND_UNKNOWN",
Self::Pure => "PURE",
Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
Self::Shared => "SHARED",
Self::Receiving => "RECEIVING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
"PURE" => Some(Self::Pure),
"IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
"SHARED" => Some(Self::Shared),
"RECEIVING" => Some(Self::Receiving),
_ => None,
}
}
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetServiceInfoRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetServiceInfoResponse {
#[prost(string, optional, tag = "1")]
pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub chain: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub epoch: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub checkpoint_height: ::core::option::Option<u64>,
#[prost(message, optional, tag = "5")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(uint64, optional, tag = "6")]
pub lowest_available_checkpoint: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "7")]
pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
#[prost(string, optional, tag = "8")]
pub server_version: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetObjectRequest {
#[prost(string, optional, tag = "1")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "2")]
pub version: ::core::option::Option<u64>,
#[prost(message, optional, tag = "3")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetObjectResponse {
#[prost(message, optional, tag = "1")]
pub object: ::core::option::Option<Object>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetObjectsRequest {
#[prost(message, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetObjectsResponse {
#[prost(message, repeated, tag = "1")]
pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetObjectResult {
#[prost(oneof = "get_object_result::Result", tags = "1, 2")]
pub result: ::core::option::Option<get_object_result::Result>,
}
pub mod get_object_result {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Result {
#[prost(message, tag = "1")]
Object(super::Object),
#[prost(message, tag = "2")]
Error(crate::proto::google::rpc::Status),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTransactionRequest {
#[prost(string, optional, tag = "1")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTransactionResponse {
#[prost(message, optional, tag = "1")]
pub transaction: ::core::option::Option<ExecutedTransaction>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetTransactionsRequest {
#[prost(string, repeated, tag = "1")]
pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetTransactionsResponse {
#[prost(message, repeated, tag = "1")]
pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTransactionResult {
#[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
pub result: ::core::option::Option<get_transaction_result::Result>,
}
pub mod get_transaction_result {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Result {
#[prost(message, tag = "1")]
Transaction(super::ExecutedTransaction),
#[prost(message, tag = "2")]
Error(crate::proto::google::rpc::Status),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCheckpointRequest {
#[prost(message, optional, tag = "3")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
}
pub mod get_checkpoint_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum CheckpointId {
#[prost(uint64, tag = "1")]
SequenceNumber(u64),
#[prost(string, tag = "2")]
Digest(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCheckpointResponse {
#[prost(message, optional, tag = "1")]
pub checkpoint: ::core::option::Option<Checkpoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEpochRequest {
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEpochResponse {
#[prost(message, optional, tag = "1")]
pub epoch: ::core::option::Option<Epoch>,
}
pub mod ledger_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct LedgerServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl LedgerServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> LedgerServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> LedgerServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get_service_info(
&mut self,
request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
) -> std::result::Result<
tonic::Response<super::GetServiceInfoResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LedgerService/GetServiceInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta2.LedgerService", "GetServiceInfo"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_object(
&mut self,
request: impl tonic::IntoRequest<super::GetObjectRequest>,
) -> std::result::Result<
tonic::Response<super::GetObjectResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LedgerService/GetObject",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("sui.rpc.v2beta2.LedgerService", "GetObject"));
self.inner.unary(req, path, codec).await
}
pub async fn batch_get_objects(
&mut self,
request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetObjectsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LedgerService/BatchGetObjects",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta2.LedgerService", "BatchGetObjects"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_transaction(
&mut self,
request: impl tonic::IntoRequest<super::GetTransactionRequest>,
) -> std::result::Result<
tonic::Response<super::GetTransactionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LedgerService/GetTransaction",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta2.LedgerService", "GetTransaction"),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_get_transactions(
&mut self,
request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetTransactionsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LedgerService/BatchGetTransactions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"sui.rpc.v2beta2.LedgerService",
"BatchGetTransactions",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_checkpoint(
&mut self,
request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
) -> std::result::Result<
tonic::Response<super::GetCheckpointResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LedgerService/GetCheckpoint",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta2.LedgerService", "GetCheckpoint"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_epoch(
&mut self,
request: impl tonic::IntoRequest<super::GetEpochRequest>,
) -> std::result::Result<
tonic::Response<super::GetEpochResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LedgerService/GetEpoch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("sui.rpc.v2beta2.LedgerService", "GetEpoch"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod ledger_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
async fn get_service_info(
&self,
request: tonic::Request<super::GetServiceInfoRequest>,
) -> std::result::Result<
tonic::Response<super::GetServiceInfoResponse>,
tonic::Status,
>;
async fn get_object(
&self,
request: tonic::Request<super::GetObjectRequest>,
) -> std::result::Result<
tonic::Response<super::GetObjectResponse>,
tonic::Status,
>;
async fn batch_get_objects(
&self,
request: tonic::Request<super::BatchGetObjectsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetObjectsResponse>,
tonic::Status,
>;
async fn get_transaction(
&self,
request: tonic::Request<super::GetTransactionRequest>,
) -> std::result::Result<
tonic::Response<super::GetTransactionResponse>,
tonic::Status,
>;
async fn batch_get_transactions(
&self,
request: tonic::Request<super::BatchGetTransactionsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetTransactionsResponse>,
tonic::Status,
>;
async fn get_checkpoint(
&self,
request: tonic::Request<super::GetCheckpointRequest>,
) -> std::result::Result<
tonic::Response<super::GetCheckpointResponse>,
tonic::Status,
>;
async fn get_epoch(
&self,
request: tonic::Request<super::GetEpochRequest>,
) -> std::result::Result<
tonic::Response<super::GetEpochResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct LedgerServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> LedgerServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
where
T: LedgerService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/sui.rpc.v2beta2.LedgerService/GetServiceInfo" => {
#[allow(non_camel_case_types)]
struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::GetServiceInfoRequest>
for GetServiceInfoSvc<T> {
type Response = super::GetServiceInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetServiceInfoRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::get_service_info(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetServiceInfoSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.LedgerService/GetObject" => {
#[allow(non_camel_case_types)]
struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::GetObjectRequest>
for GetObjectSvc<T> {
type Response = super::GetObjectResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetObjectRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::get_object(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetObjectSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.LedgerService/BatchGetObjects" => {
#[allow(non_camel_case_types)]
struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::BatchGetObjectsRequest>
for BatchGetObjectsSvc<T> {
type Response = super::BatchGetObjectsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::BatchGetObjectsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::batch_get_objects(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = BatchGetObjectsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.LedgerService/GetTransaction" => {
#[allow(non_camel_case_types)]
struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::GetTransactionRequest>
for GetTransactionSvc<T> {
type Response = super::GetTransactionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetTransactionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::get_transaction(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetTransactionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.LedgerService/BatchGetTransactions" => {
#[allow(non_camel_case_types)]
struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::BatchGetTransactionsRequest>
for BatchGetTransactionsSvc<T> {
type Response = super::BatchGetTransactionsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::BatchGetTransactionsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::batch_get_transactions(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = BatchGetTransactionsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.LedgerService/GetCheckpoint" => {
#[allow(non_camel_case_types)]
struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::GetCheckpointRequest>
for GetCheckpointSvc<T> {
type Response = super::GetCheckpointResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetCheckpointRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::get_checkpoint(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetCheckpointSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.LedgerService/GetEpoch" => {
#[allow(non_camel_case_types)]
struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::GetEpochRequest>
for GetEpochSvc<T> {
type Response = super::GetEpochResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetEpochRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::get_epoch(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetEpochSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for LedgerServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "sui.rpc.v2beta2.LedgerService";
impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCoinInfoRequest {
#[prost(string, optional, tag = "1")]
pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCoinInfoResponse {
#[prost(string, optional, tag = "1")]
pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub metadata: ::core::option::Option<CoinMetadata>,
#[prost(message, optional, tag = "3")]
pub treasury: ::core::option::Option<CoinTreasury>,
#[prost(message, optional, tag = "4")]
pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CoinMetadata {
#[prost(string, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "2")]
pub decimals: ::core::option::Option<u32>,
#[prost(string, optional, tag = "3")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub symbol: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "5")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "6")]
pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CoinTreasury {
#[prost(string, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "2")]
pub total_supply: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RegulatedCoinMetadata {
#[prost(string, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBalanceRequest {
#[prost(string, optional, tag = "1")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBalanceResponse {
#[prost(message, optional, tag = "1")]
pub balance: ::core::option::Option<Balance>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBalancesRequest {
#[prost(string, optional, tag = "1")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "2")]
pub page_size: ::core::option::Option<u32>,
#[prost(bytes = "bytes", optional, tag = "3")]
pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBalancesResponse {
#[prost(message, repeated, tag = "1")]
pub balances: ::prost::alloc::vec::Vec<Balance>,
#[prost(bytes = "bytes", optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Balance {
#[prost(string, optional, tag = "1")]
pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub balance: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDynamicFieldsRequest {
#[prost(string, optional, tag = "1")]
pub parent: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "2")]
pub page_size: ::core::option::Option<u32>,
#[prost(bytes = "bytes", optional, tag = "3")]
pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDynamicFieldsResponse {
#[prost(message, repeated, tag = "1")]
pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
#[prost(bytes = "bytes", optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DynamicField {
#[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
pub kind: ::core::option::Option<i32>,
#[prost(string, optional, tag = "2")]
pub parent: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub field_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub name_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bytes = "bytes", optional, tag = "5")]
pub name_value: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(string, optional, tag = "6")]
pub value_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "7")]
pub dynamic_object_id: ::core::option::Option<::prost::alloc::string::String>,
}
pub mod dynamic_field {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DynamicFieldKind {
Unknown = 0,
Field = 1,
Object = 2,
}
impl DynamicFieldKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
Self::Field => "FIELD",
Self::Object => "OBJECT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
"FIELD" => Some(Self::Field),
"OBJECT" => Some(Self::Object),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimulateTransactionRequest {
#[prost(message, optional, tag = "1")]
pub transaction: ::core::option::Option<Transaction>,
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(
enumeration = "simulate_transaction_request::TransactionChecks",
optional,
tag = "3"
)]
pub checks: ::core::option::Option<i32>,
#[prost(bool, optional, tag = "4")]
pub do_gas_selection: ::core::option::Option<bool>,
}
pub mod simulate_transaction_request {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TransactionChecks {
Enabled = 0,
Disabled = 1,
}
impl TransactionChecks {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Enabled => "ENABLED",
Self::Disabled => "DISABLED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ENABLED" => Some(Self::Enabled),
"DISABLED" => Some(Self::Disabled),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimulateTransactionResponse {
#[prost(message, optional, tag = "1")]
pub transaction: ::core::option::Option<ExecutedTransaction>,
#[prost(message, repeated, tag = "2")]
pub outputs: ::prost::alloc::vec::Vec<CommandResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommandResult {
#[prost(message, repeated, tag = "1")]
pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
#[prost(message, repeated, tag = "2")]
pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommandOutput {
#[prost(message, optional, tag = "1")]
pub argument: ::core::option::Option<Argument>,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<Bcs>,
#[prost(message, optional, boxed, tag = "3")]
pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOwnedObjectsRequest {
#[prost(string, optional, tag = "1")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub object_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "2")]
pub page_size: ::core::option::Option<u32>,
#[prost(bytes = "bytes", optional, tag = "3")]
pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOwnedObjectsResponse {
#[prost(message, repeated, tag = "1")]
pub objects: ::prost::alloc::vec::Vec<OwnedObject>,
#[prost(bytes = "bytes", optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnedObject {
#[prost(string, optional, tag = "2")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub version: ::core::option::Option<u64>,
#[prost(string, optional, tag = "4")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub owner: ::core::option::Option<Owner>,
#[prost(string, optional, tag = "6")]
pub object_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "200")]
pub balance: ::core::option::Option<u64>,
}
pub mod live_data_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct LiveDataServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl LiveDataServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> LiveDataServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> LiveDataServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
LiveDataServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn list_dynamic_fields(
&mut self,
request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
) -> std::result::Result<
tonic::Response<super::ListDynamicFieldsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LiveDataService/ListDynamicFields",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"sui.rpc.v2beta2.LiveDataService",
"ListDynamicFields",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_owned_objects(
&mut self,
request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
) -> std::result::Result<
tonic::Response<super::ListOwnedObjectsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LiveDataService/ListOwnedObjects",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"sui.rpc.v2beta2.LiveDataService",
"ListOwnedObjects",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_coin_info(
&mut self,
request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
) -> std::result::Result<
tonic::Response<super::GetCoinInfoResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LiveDataService/GetCoinInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta2.LiveDataService", "GetCoinInfo"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_balance(
&mut self,
request: impl tonic::IntoRequest<super::GetBalanceRequest>,
) -> std::result::Result<
tonic::Response<super::GetBalanceResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LiveDataService/GetBalance",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta2.LiveDataService", "GetBalance"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_balances(
&mut self,
request: impl tonic::IntoRequest<super::ListBalancesRequest>,
) -> std::result::Result<
tonic::Response<super::ListBalancesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LiveDataService/ListBalances",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta2.LiveDataService", "ListBalances"),
);
self.inner.unary(req, path, codec).await
}
pub async fn simulate_transaction(
&mut self,
request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
) -> std::result::Result<
tonic::Response<super::SimulateTransactionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.LiveDataService/SimulateTransaction",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"sui.rpc.v2beta2.LiveDataService",
"SimulateTransaction",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod live_data_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait LiveDataService: std::marker::Send + std::marker::Sync + 'static {
async fn list_dynamic_fields(
&self,
request: tonic::Request<super::ListDynamicFieldsRequest>,
) -> std::result::Result<
tonic::Response<super::ListDynamicFieldsResponse>,
tonic::Status,
>;
async fn list_owned_objects(
&self,
request: tonic::Request<super::ListOwnedObjectsRequest>,
) -> std::result::Result<
tonic::Response<super::ListOwnedObjectsResponse>,
tonic::Status,
>;
async fn get_coin_info(
&self,
request: tonic::Request<super::GetCoinInfoRequest>,
) -> std::result::Result<
tonic::Response<super::GetCoinInfoResponse>,
tonic::Status,
>;
async fn get_balance(
&self,
request: tonic::Request<super::GetBalanceRequest>,
) -> std::result::Result<
tonic::Response<super::GetBalanceResponse>,
tonic::Status,
>;
async fn list_balances(
&self,
request: tonic::Request<super::ListBalancesRequest>,
) -> std::result::Result<
tonic::Response<super::ListBalancesResponse>,
tonic::Status,
>;
async fn simulate_transaction(
&self,
request: tonic::Request<super::SimulateTransactionRequest>,
) -> std::result::Result<
tonic::Response<super::SimulateTransactionResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct LiveDataServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> LiveDataServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for LiveDataServiceServer<T>
where
T: LiveDataService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/sui.rpc.v2beta2.LiveDataService/ListDynamicFields" => {
#[allow(non_camel_case_types)]
struct ListDynamicFieldsSvc<T: LiveDataService>(pub Arc<T>);
impl<
T: LiveDataService,
> tonic::server::UnaryService<super::ListDynamicFieldsRequest>
for ListDynamicFieldsSvc<T> {
type Response = super::ListDynamicFieldsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListDynamicFieldsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LiveDataService>::list_dynamic_fields(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListDynamicFieldsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.LiveDataService/ListOwnedObjects" => {
#[allow(non_camel_case_types)]
struct ListOwnedObjectsSvc<T: LiveDataService>(pub Arc<T>);
impl<
T: LiveDataService,
> tonic::server::UnaryService<super::ListOwnedObjectsRequest>
for ListOwnedObjectsSvc<T> {
type Response = super::ListOwnedObjectsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListOwnedObjectsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LiveDataService>::list_owned_objects(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListOwnedObjectsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.LiveDataService/GetCoinInfo" => {
#[allow(non_camel_case_types)]
struct GetCoinInfoSvc<T: LiveDataService>(pub Arc<T>);
impl<
T: LiveDataService,
> tonic::server::UnaryService<super::GetCoinInfoRequest>
for GetCoinInfoSvc<T> {
type Response = super::GetCoinInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetCoinInfoRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LiveDataService>::get_coin_info(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetCoinInfoSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.LiveDataService/GetBalance" => {
#[allow(non_camel_case_types)]
struct GetBalanceSvc<T: LiveDataService>(pub Arc<T>);
impl<
T: LiveDataService,
> tonic::server::UnaryService<super::GetBalanceRequest>
for GetBalanceSvc<T> {
type Response = super::GetBalanceResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetBalanceRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LiveDataService>::get_balance(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetBalanceSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.LiveDataService/ListBalances" => {
#[allow(non_camel_case_types)]
struct ListBalancesSvc<T: LiveDataService>(pub Arc<T>);
impl<
T: LiveDataService,
> tonic::server::UnaryService<super::ListBalancesRequest>
for ListBalancesSvc<T> {
type Response = super::ListBalancesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListBalancesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LiveDataService>::list_balances(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListBalancesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.LiveDataService/SimulateTransaction" => {
#[allow(non_camel_case_types)]
struct SimulateTransactionSvc<T: LiveDataService>(pub Arc<T>);
impl<
T: LiveDataService,
> tonic::server::UnaryService<super::SimulateTransactionRequest>
for SimulateTransactionSvc<T> {
type Response = super::SimulateTransactionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SimulateTransactionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LiveDataService>::simulate_transaction(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SimulateTransactionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for LiveDataServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "sui.rpc.v2beta2.LiveDataService";
impl<T> tonic::server::NamedService for LiveDataServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Package {
#[prost(string, optional, tag = "1")]
pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub original_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub version: ::core::option::Option<u64>,
#[prost(message, repeated, tag = "4")]
pub modules: ::prost::alloc::vec::Vec<Module>,
#[prost(message, repeated, tag = "5")]
pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
#[prost(message, repeated, tag = "6")]
pub linkage: ::prost::alloc::vec::Vec<Linkage>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Module {
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bytes = "bytes", optional, tag = "2")]
pub contents: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(message, repeated, tag = "3")]
pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
#[prost(message, repeated, tag = "4")]
pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DatatypeDescriptor {
#[prost(string, optional, tag = "1")]
pub type_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub module: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "Ability", repeated, tag = "5")]
pub abilities: ::prost::alloc::vec::Vec<i32>,
#[prost(message, repeated, tag = "6")]
pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
#[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
pub kind: ::core::option::Option<i32>,
#[prost(message, repeated, tag = "8")]
pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
#[prost(message, repeated, tag = "9")]
pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
}
pub mod datatype_descriptor {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DatatypeKind {
Unknown = 0,
Struct = 1,
Enum = 2,
}
impl DatatypeKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "DATATYPE_KIND_UNKNOWN",
Self::Struct => "STRUCT",
Self::Enum => "ENUM",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
"STRUCT" => Some(Self::Struct),
"ENUM" => Some(Self::Enum),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TypeParameter {
#[prost(enumeration = "Ability", repeated, tag = "1")]
pub constraints: ::prost::alloc::vec::Vec<i32>,
#[prost(bool, optional, tag = "2")]
pub is_phantom: ::core::option::Option<bool>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FieldDescriptor {
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "2")]
pub position: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub r#type: ::core::option::Option<OpenSignatureBody>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VariantDescriptor {
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "2")]
pub position: ::core::option::Option<u32>,
#[prost(message, repeated, tag = "3")]
pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenSignatureBody {
#[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
pub r#type: ::core::option::Option<i32>,
#[prost(string, optional, tag = "2")]
pub type_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "3")]
pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
#[prost(uint32, optional, tag = "4")]
pub type_parameter: ::core::option::Option<u32>,
}
pub mod open_signature_body {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Unknown = 0,
Address = 1,
Bool = 2,
U8 = 3,
U16 = 4,
U32 = 5,
U64 = 6,
U128 = 7,
U256 = 8,
Vector = 9,
Datatype = 10,
Parameter = 11,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "TYPE_UNKNOWN",
Self::Address => "ADDRESS",
Self::Bool => "BOOL",
Self::U8 => "U8",
Self::U16 => "U16",
Self::U32 => "U32",
Self::U64 => "U64",
Self::U128 => "U128",
Self::U256 => "U256",
Self::Vector => "VECTOR",
Self::Datatype => "DATATYPE",
Self::Parameter => "TYPE_PARAMETER",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TYPE_UNKNOWN" => Some(Self::Unknown),
"ADDRESS" => Some(Self::Address),
"BOOL" => Some(Self::Bool),
"U8" => Some(Self::U8),
"U16" => Some(Self::U16),
"U32" => Some(Self::U32),
"U64" => Some(Self::U64),
"U128" => Some(Self::U128),
"U256" => Some(Self::U256),
"VECTOR" => Some(Self::Vector),
"DATATYPE" => Some(Self::Datatype),
"TYPE_PARAMETER" => Some(Self::Parameter),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FunctionDescriptor {
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
pub visibility: ::core::option::Option<i32>,
#[prost(bool, optional, tag = "6")]
pub is_entry: ::core::option::Option<bool>,
#[prost(message, repeated, tag = "7")]
pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
#[prost(message, repeated, tag = "8")]
pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
#[prost(message, repeated, tag = "9")]
pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
}
pub mod function_descriptor {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Visibility {
Unknown = 0,
Private = 1,
Public = 2,
Friend = 3,
}
impl Visibility {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "VISIBILITY_UNKNOWN",
Self::Private => "PRIVATE",
Self::Public => "PUBLIC",
Self::Friend => "FRIEND",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VISIBILITY_UNKNOWN" => Some(Self::Unknown),
"PRIVATE" => Some(Self::Private),
"PUBLIC" => Some(Self::Public),
"FRIEND" => Some(Self::Friend),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenSignature {
#[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
pub reference: ::core::option::Option<i32>,
#[prost(message, optional, tag = "2")]
pub body: ::core::option::Option<OpenSignatureBody>,
}
pub mod open_signature {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Reference {
Unknown = 0,
Immutable = 1,
Mutable = 2,
}
impl Reference {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "REFERENCE_UNKNOWN",
Self::Immutable => "IMMUTABLE",
Self::Mutable => "MUTABLE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"REFERENCE_UNKNOWN" => Some(Self::Unknown),
"IMMUTABLE" => Some(Self::Immutable),
"MUTABLE" => Some(Self::Mutable),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TypeOrigin {
#[prost(string, optional, tag = "1")]
pub module_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub package_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Linkage {
#[prost(string, optional, tag = "1")]
pub original_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub upgraded_version: ::core::option::Option<u64>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Ability {
Unknown = 0,
Copy = 1,
Drop = 2,
Store = 3,
Key = 4,
}
impl Ability {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "ABILITY_UNKNOWN",
Self::Copy => "COPY",
Self::Drop => "DROP",
Self::Store => "STORE",
Self::Key => "KEY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ABILITY_UNKNOWN" => Some(Self::Unknown),
"COPY" => Some(Self::Copy),
"DROP" => Some(Self::Drop),
"STORE" => Some(Self::Store),
"KEY" => Some(Self::Key),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPackageRequest {
#[prost(string, optional, tag = "1")]
pub package_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPackageResponse {
#[prost(message, optional, tag = "1")]
pub package: ::core::option::Option<Package>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDatatypeRequest {
#[prost(string, optional, tag = "1")]
pub package_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub module_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDatatypeResponse {
#[prost(message, optional, tag = "1")]
pub datatype: ::core::option::Option<DatatypeDescriptor>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFunctionRequest {
#[prost(string, optional, tag = "1")]
pub package_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub module_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFunctionResponse {
#[prost(message, optional, tag = "1")]
pub function: ::core::option::Option<FunctionDescriptor>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPackageVersionsRequest {
#[prost(string, optional, tag = "1")]
pub package_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "2")]
pub page_size: ::core::option::Option<u32>,
#[prost(bytes = "bytes", optional, tag = "3")]
pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPackageVersionsResponse {
#[prost(message, repeated, tag = "1")]
pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
#[prost(bytes = "bytes", optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageVersion {
#[prost(string, optional, tag = "1")]
pub package_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "2")]
pub version: ::core::option::Option<u64>,
}
pub mod move_package_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct MovePackageServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MovePackageServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> MovePackageServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> MovePackageServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get_package(
&mut self,
request: impl tonic::IntoRequest<super::GetPackageRequest>,
) -> std::result::Result<
tonic::Response<super::GetPackageResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.MovePackageService/GetPackage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta2.MovePackageService", "GetPackage"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_datatype(
&mut self,
request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
) -> std::result::Result<
tonic::Response<super::GetDatatypeResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.MovePackageService/GetDatatype",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta2.MovePackageService", "GetDatatype"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_function(
&mut self,
request: impl tonic::IntoRequest<super::GetFunctionRequest>,
) -> std::result::Result<
tonic::Response<super::GetFunctionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.MovePackageService/GetFunction",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta2.MovePackageService", "GetFunction"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_package_versions(
&mut self,
request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
) -> std::result::Result<
tonic::Response<super::ListPackageVersionsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.MovePackageService/ListPackageVersions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"sui.rpc.v2beta2.MovePackageService",
"ListPackageVersions",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod move_package_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
async fn get_package(
&self,
request: tonic::Request<super::GetPackageRequest>,
) -> std::result::Result<
tonic::Response<super::GetPackageResponse>,
tonic::Status,
>;
async fn get_datatype(
&self,
request: tonic::Request<super::GetDatatypeRequest>,
) -> std::result::Result<
tonic::Response<super::GetDatatypeResponse>,
tonic::Status,
>;
async fn get_function(
&self,
request: tonic::Request<super::GetFunctionRequest>,
) -> std::result::Result<
tonic::Response<super::GetFunctionResponse>,
tonic::Status,
>;
async fn list_package_versions(
&self,
request: tonic::Request<super::ListPackageVersionsRequest>,
) -> std::result::Result<
tonic::Response<super::ListPackageVersionsResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct MovePackageServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> MovePackageServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
where
T: MovePackageService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/sui.rpc.v2beta2.MovePackageService/GetPackage" => {
#[allow(non_camel_case_types)]
struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
impl<
T: MovePackageService,
> tonic::server::UnaryService<super::GetPackageRequest>
for GetPackageSvc<T> {
type Response = super::GetPackageResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetPackageRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as MovePackageService>::get_package(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetPackageSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.MovePackageService/GetDatatype" => {
#[allow(non_camel_case_types)]
struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
impl<
T: MovePackageService,
> tonic::server::UnaryService<super::GetDatatypeRequest>
for GetDatatypeSvc<T> {
type Response = super::GetDatatypeResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetDatatypeRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as MovePackageService>::get_datatype(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetDatatypeSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.MovePackageService/GetFunction" => {
#[allow(non_camel_case_types)]
struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
impl<
T: MovePackageService,
> tonic::server::UnaryService<super::GetFunctionRequest>
for GetFunctionSvc<T> {
type Response = super::GetFunctionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetFunctionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as MovePackageService>::get_function(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetFunctionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta2.MovePackageService/ListPackageVersions" => {
#[allow(non_camel_case_types)]
struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
impl<
T: MovePackageService,
> tonic::server::UnaryService<super::ListPackageVersionsRequest>
for ListPackageVersionsSvc<T> {
type Response = super::ListPackageVersionsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListPackageVersionsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as MovePackageService>::list_package_versions(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListPackageVersionsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for MovePackageServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "sui.rpc.v2beta2.MovePackageService";
impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Object {
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
#[prost(string, optional, tag = "2")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub version: ::core::option::Option<u64>,
#[prost(string, optional, tag = "4")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub owner: ::core::option::Option<Owner>,
#[prost(string, optional, tag = "6")]
pub object_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, optional, tag = "7")]
pub has_public_transfer: ::core::option::Option<bool>,
#[prost(message, optional, tag = "8")]
pub contents: ::core::option::Option<Bcs>,
#[prost(message, optional, tag = "9")]
pub package: ::core::option::Option<Package>,
#[prost(string, optional, tag = "10")]
pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "11")]
pub storage_rebate: ::core::option::Option<u64>,
#[prost(message, optional, boxed, tag = "100")]
pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ObjectReference {
#[prost(string, optional, tag = "1")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "2")]
pub version: ::core::option::Option<u64>,
#[prost(string, optional, tag = "3")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Owner {
#[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
pub kind: ::core::option::Option<i32>,
#[prost(string, optional, tag = "2")]
pub address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub version: ::core::option::Option<u64>,
}
pub mod owner {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum OwnerKind {
Unknown = 0,
Address = 1,
Object = 2,
Shared = 3,
Immutable = 4,
ConsensusAddress = 5,
}
impl OwnerKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "OWNER_KIND_UNKNOWN",
Self::Address => "ADDRESS",
Self::Object => "OBJECT",
Self::Shared => "SHARED",
Self::Immutable => "IMMUTABLE",
Self::ConsensusAddress => "CONSENSUS_ADDRESS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
"ADDRESS" => Some(Self::Address),
"OBJECT" => Some(Self::Object),
"SHARED" => Some(Self::Shared),
"IMMUTABLE" => Some(Self::Immutable),
"CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProtocolConfig {
#[prost(uint64, optional, tag = "1")]
pub protocol_version: ::core::option::Option<u64>,
#[prost(map = "string, bool", tag = "2")]
pub feature_flags: ::std::collections::HashMap<::prost::alloc::string::String, bool>,
#[prost(map = "string, string", tag = "3")]
pub attributes: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserSignature {
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
#[prost(enumeration = "SignatureScheme", optional, tag = "2")]
pub scheme: ::core::option::Option<i32>,
#[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
pub signature: ::core::option::Option<user_signature::Signature>,
}
pub mod user_signature {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Signature {
#[prost(message, tag = "3")]
Simple(super::SimpleSignature),
#[prost(message, tag = "4")]
Multisig(super::MultisigAggregatedSignature),
#[prost(message, tag = "5")]
Zklogin(super::ZkLoginAuthenticator),
#[prost(message, tag = "6")]
Passkey(super::PasskeyAuthenticator),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimpleSignature {
#[prost(enumeration = "SignatureScheme", optional, tag = "1")]
pub scheme: ::core::option::Option<i32>,
#[prost(bytes = "bytes", optional, tag = "2")]
pub signature: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(bytes = "bytes", optional, tag = "3")]
pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkLoginPublicIdentifier {
#[prost(string, optional, tag = "1")]
pub iss: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultisigMemberPublicKey {
#[prost(enumeration = "SignatureScheme", optional, tag = "1")]
pub scheme: ::core::option::Option<i32>,
#[prost(bytes = "bytes", optional, tag = "2")]
pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(message, optional, tag = "3")]
pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultisigMember {
#[prost(message, optional, tag = "1")]
pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
#[prost(uint32, optional, tag = "2")]
pub weight: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultisigCommittee {
#[prost(message, repeated, tag = "1")]
pub members: ::prost::alloc::vec::Vec<MultisigMember>,
#[prost(uint32, optional, tag = "2")]
pub threshold: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultisigAggregatedSignature {
#[prost(message, repeated, tag = "1")]
pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
#[prost(uint32, optional, tag = "2")]
pub bitmap: ::core::option::Option<u32>,
#[prost(uint32, repeated, tag = "3")]
pub legacy_bitmap: ::prost::alloc::vec::Vec<u32>,
#[prost(message, optional, tag = "4")]
pub committee: ::core::option::Option<MultisigCommittee>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultisigMemberSignature {
#[prost(enumeration = "SignatureScheme", optional, tag = "1")]
pub scheme: ::core::option::Option<i32>,
#[prost(bytes = "bytes", optional, tag = "2")]
pub signature: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(message, optional, tag = "3")]
pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
#[prost(message, optional, tag = "4")]
pub passkey: ::core::option::Option<PasskeyAuthenticator>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkLoginAuthenticator {
#[prost(message, optional, tag = "1")]
pub inputs: ::core::option::Option<ZkLoginInputs>,
#[prost(uint64, optional, tag = "2")]
pub max_epoch: ::core::option::Option<u64>,
#[prost(message, optional, tag = "3")]
pub signature: ::core::option::Option<SimpleSignature>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkLoginInputs {
#[prost(message, optional, tag = "1")]
pub proof_points: ::core::option::Option<ZkLoginProof>,
#[prost(message, optional, tag = "2")]
pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
#[prost(string, optional, tag = "3")]
pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkLoginProof {
#[prost(message, optional, tag = "1")]
pub a: ::core::option::Option<CircomG1>,
#[prost(message, optional, tag = "2")]
pub b: ::core::option::Option<CircomG2>,
#[prost(message, optional, tag = "3")]
pub c: ::core::option::Option<CircomG1>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkLoginClaim {
#[prost(string, optional, tag = "1")]
pub value: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "2")]
pub index_mod_4: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CircomG1 {
#[prost(string, optional, tag = "1")]
pub e0: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub e1: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub e2: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CircomG2 {
#[prost(string, optional, tag = "1")]
pub e00: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub e01: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub e10: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub e11: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "5")]
pub e20: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "6")]
pub e21: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PasskeyAuthenticator {
#[prost(bytes = "bytes", optional, tag = "1")]
pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(string, optional, tag = "2")]
pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub signature: ::core::option::Option<SimpleSignature>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorCommittee {
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
#[prost(message, repeated, tag = "2")]
pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorCommitteeMember {
#[prost(bytes = "bytes", optional, tag = "1")]
pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(uint64, optional, tag = "2")]
pub weight: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorAggregatedSignature {
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
#[prost(bytes = "bytes", optional, tag = "2")]
pub signature: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(uint32, repeated, tag = "3")]
pub bitmap: ::prost::alloc::vec::Vec<u32>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SignatureScheme {
Ed25519 = 0,
Secp256k1 = 1,
Secp256r1 = 2,
Multisig = 3,
Bls12381 = 4,
Zklogin = 5,
Passkey = 6,
}
impl SignatureScheme {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Ed25519 => "ED25519",
Self::Secp256k1 => "SECP256K1",
Self::Secp256r1 => "SECP256R1",
Self::Multisig => "MULTISIG",
Self::Bls12381 => "BLS12381",
Self::Zklogin => "ZKLOGIN",
Self::Passkey => "PASSKEY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ED25519" => Some(Self::Ed25519),
"SECP256K1" => Some(Self::Secp256k1),
"SECP256R1" => Some(Self::Secp256r1),
"MULTISIG" => Some(Self::Multisig),
"BLS12381" => Some(Self::Bls12381),
"ZKLOGIN" => Some(Self::Zklogin),
"PASSKEY" => Some(Self::Passkey),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifySignatureRequest {
#[prost(message, optional, tag = "1")]
pub message: ::core::option::Option<Bcs>,
#[prost(message, optional, tag = "2")]
pub signature: ::core::option::Option<UserSignature>,
#[prost(string, optional, tag = "3")]
pub address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "4")]
pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifySignatureResponse {
#[prost(bool, optional, tag = "1")]
pub is_valid: ::core::option::Option<bool>,
#[prost(string, optional, tag = "2")]
pub reason: ::core::option::Option<::prost::alloc::string::String>,
}
pub mod signature_verification_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct SignatureVerificationServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SignatureVerificationServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SignatureVerificationServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
SignatureVerificationServiceClient::new(
InterceptedService::new(inner, interceptor),
)
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn verify_signature(
&mut self,
request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
) -> std::result::Result<
tonic::Response<super::VerifySignatureResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.SignatureVerificationService/VerifySignature",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"sui.rpc.v2beta2.SignatureVerificationService",
"VerifySignature",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod signature_verification_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
async fn verify_signature(
&self,
request: tonic::Request<super::VerifySignatureRequest>,
) -> std::result::Result<
tonic::Response<super::VerifySignatureResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct SignatureVerificationServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> SignatureVerificationServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>>
for SignatureVerificationServiceServer<T>
where
T: SignatureVerificationService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/sui.rpc.v2beta2.SignatureVerificationService/VerifySignature" => {
#[allow(non_camel_case_types)]
struct VerifySignatureSvc<T: SignatureVerificationService>(
pub Arc<T>,
);
impl<
T: SignatureVerificationService,
> tonic::server::UnaryService<super::VerifySignatureRequest>
for VerifySignatureSvc<T> {
type Response = super::VerifySignatureResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::VerifySignatureRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as SignatureVerificationService>::verify_signature(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = VerifySignatureSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for SignatureVerificationServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "sui.rpc.v2beta2.SignatureVerificationService";
impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeCheckpointsRequest {
#[prost(message, optional, tag = "1")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeCheckpointsResponse {
#[prost(uint64, optional, tag = "1")]
pub cursor: ::core::option::Option<u64>,
#[prost(message, optional, tag = "2")]
pub checkpoint: ::core::option::Option<Checkpoint>,
}
pub mod subscription_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct SubscriptionServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SubscriptionServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SubscriptionServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SubscriptionServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn subscribe_checkpoints(
&mut self,
request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.SubscriptionService/SubscribeCheckpoints",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"sui.rpc.v2beta2.SubscriptionService",
"SubscribeCheckpoints",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
pub mod subscription_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
type SubscribeCheckpointsStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::SubscribeCheckpointsResponse,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn subscribe_checkpoints(
&self,
request: tonic::Request<super::SubscribeCheckpointsRequest>,
) -> std::result::Result<
tonic::Response<Self::SubscribeCheckpointsStream>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct SubscriptionServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> SubscriptionServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
where
T: SubscriptionService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/sui.rpc.v2beta2.SubscriptionService/SubscribeCheckpoints" => {
#[allow(non_camel_case_types)]
struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
impl<
T: SubscriptionService,
> tonic::server::ServerStreamingService<
super::SubscribeCheckpointsRequest,
> for SubscribeCheckpointsSvc<T> {
type Response = super::SubscribeCheckpointsResponse;
type ResponseStream = T::SubscribeCheckpointsStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SubscribeCheckpointsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as SubscriptionService>::subscribe_checkpoints(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SubscribeCheckpointsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for SubscriptionServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "sui.rpc.v2beta2.SubscriptionService";
impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SystemState {
#[prost(uint64, optional, tag = "1")]
pub version: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub epoch: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub protocol_version: ::core::option::Option<u64>,
#[prost(message, optional, tag = "4")]
pub validators: ::core::option::Option<ValidatorSet>,
#[prost(message, optional, tag = "5")]
pub storage_fund: ::core::option::Option<StorageFund>,
#[prost(message, optional, tag = "6")]
pub parameters: ::core::option::Option<SystemParameters>,
#[prost(uint64, optional, tag = "7")]
pub reference_gas_price: ::core::option::Option<u64>,
#[prost(message, repeated, tag = "8")]
pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
#[prost(message, optional, tag = "9")]
pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
#[prost(bool, optional, tag = "10")]
pub safe_mode: ::core::option::Option<bool>,
#[prost(uint64, optional, tag = "11")]
pub safe_mode_storage_rewards: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "12")]
pub safe_mode_computation_rewards: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "13")]
pub safe_mode_storage_rebates: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "14")]
pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "15")]
pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
#[prost(message, optional, tag = "16")]
pub extra_fields: ::core::option::Option<MoveTable>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorReportRecord {
#[prost(string, optional, tag = "1")]
pub reported: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SystemParameters {
#[prost(uint64, optional, tag = "1")]
pub epoch_duration_ms: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub min_validator_count: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub max_validator_count: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "5")]
pub min_validator_joining_stake: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "6")]
pub validator_low_stake_threshold: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "7")]
pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "8")]
pub validator_low_stake_grace_period: ::core::option::Option<u64>,
#[prost(message, optional, tag = "9")]
pub extra_fields: ::core::option::Option<MoveTable>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveTable {
#[prost(string, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "2")]
pub size: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StakeSubsidy {
#[prost(uint64, optional, tag = "1")]
pub balance: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub distribution_counter: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub current_distribution_amount: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub stake_subsidy_period_length: ::core::option::Option<u64>,
#[prost(uint32, optional, tag = "5")]
pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
#[prost(message, optional, tag = "6")]
pub extra_fields: ::core::option::Option<MoveTable>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StorageFund {
#[prost(uint64, optional, tag = "1")]
pub total_object_storage_rebates: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub non_refundable_balance: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorSet {
#[prost(uint64, optional, tag = "1")]
pub total_stake: ::core::option::Option<u64>,
#[prost(message, repeated, tag = "2")]
pub active_validators: ::prost::alloc::vec::Vec<Validator>,
#[prost(message, optional, tag = "3")]
pub pending_active_validators: ::core::option::Option<MoveTable>,
#[prost(uint64, repeated, tag = "4")]
pub pending_removals: ::prost::alloc::vec::Vec<u64>,
#[prost(message, optional, tag = "5")]
pub staking_pool_mappings: ::core::option::Option<MoveTable>,
#[prost(message, optional, tag = "6")]
pub inactive_validators: ::core::option::Option<MoveTable>,
#[prost(message, optional, tag = "7")]
pub validator_candidates: ::core::option::Option<MoveTable>,
#[prost(map = "string, uint64", tag = "8")]
pub at_risk_validators: ::std::collections::HashMap<
::prost::alloc::string::String,
u64,
>,
#[prost(message, optional, tag = "9")]
pub extra_fields: ::core::option::Option<MoveTable>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Validator {
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub image_url: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "5")]
pub project_url: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bytes = "bytes", optional, tag = "7")]
pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(bytes = "bytes", optional, tag = "8")]
pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(bytes = "bytes", optional, tag = "10")]
pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(bytes = "bytes", optional, tag = "12")]
pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(string, optional, tag = "13")]
pub network_address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "14")]
pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "15")]
pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "16")]
pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bytes = "bytes", optional, tag = "18")]
pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(bytes = "bytes", optional, tag = "19")]
pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(bytes = "bytes", optional, tag = "21")]
pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(bytes = "bytes", optional, tag = "23")]
pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(string, optional, tag = "24")]
pub next_epoch_network_address: ::core::option::Option<
::prost::alloc::string::String,
>,
#[prost(string, optional, tag = "25")]
pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "26")]
pub next_epoch_primary_address: ::core::option::Option<
::prost::alloc::string::String,
>,
#[prost(string, optional, tag = "27")]
pub next_epoch_worker_address: ::core::option::Option<
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "28")]
pub metadata_extra_fields: ::core::option::Option<MoveTable>,
#[prost(uint64, optional, tag = "29")]
pub voting_power: ::core::option::Option<u64>,
#[prost(string, optional, tag = "30")]
pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "31")]
pub gas_price: ::core::option::Option<u64>,
#[prost(message, optional, tag = "32")]
pub staking_pool: ::core::option::Option<StakingPool>,
#[prost(uint64, optional, tag = "33")]
pub commission_rate: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "34")]
pub next_epoch_stake: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "35")]
pub next_epoch_gas_price: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "36")]
pub next_epoch_commission_rate: ::core::option::Option<u64>,
#[prost(message, optional, tag = "37")]
pub extra_fields: ::core::option::Option<MoveTable>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StakingPool {
#[prost(string, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "2")]
pub activation_epoch: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub deactivation_epoch: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub sui_balance: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "5")]
pub rewards_pool: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "6")]
pub pool_token_balance: ::core::option::Option<u64>,
#[prost(message, optional, tag = "7")]
pub exchange_rates: ::core::option::Option<MoveTable>,
#[prost(uint64, optional, tag = "8")]
pub pending_stake: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "9")]
pub pending_total_sui_withdraw: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "10")]
pub pending_pool_token_withdraw: ::core::option::Option<u64>,
#[prost(message, optional, tag = "11")]
pub extra_fields: ::core::option::Option<MoveTable>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Transaction {
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int32, optional, tag = "3")]
pub version: ::core::option::Option<i32>,
#[prost(message, optional, tag = "4")]
pub kind: ::core::option::Option<TransactionKind>,
#[prost(string, optional, tag = "5")]
pub sender: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub gas_payment: ::core::option::Option<GasPayment>,
#[prost(message, optional, tag = "7")]
pub expiration: ::core::option::Option<TransactionExpiration>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GasPayment {
#[prost(message, repeated, tag = "1")]
pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
#[prost(string, optional, tag = "2")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub price: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub budget: ::core::option::Option<u64>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TransactionExpiration {
#[prost(
enumeration = "transaction_expiration::TransactionExpirationKind",
optional,
tag = "1"
)]
pub kind: ::core::option::Option<i32>,
#[prost(uint64, optional, tag = "2")]
pub epoch: ::core::option::Option<u64>,
}
pub mod transaction_expiration {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TransactionExpirationKind {
Unknown = 0,
None = 1,
Epoch = 2,
}
impl TransactionExpirationKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
Self::None => "NONE",
Self::Epoch => "EPOCH",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
"NONE" => Some(Self::None),
"EPOCH" => Some(Self::Epoch),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionKind {
#[prost(
oneof = "transaction_kind::Kind",
tags = "2, 100, 101, 102, 103, 104, 105, 106, 107, 108"
)]
pub kind: ::core::option::Option<transaction_kind::Kind>,
}
pub mod transaction_kind {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Kind {
#[prost(message, tag = "2")]
ProgrammableTransaction(super::ProgrammableTransaction),
#[prost(message, tag = "100")]
ChangeEpoch(super::ChangeEpoch),
#[prost(message, tag = "101")]
Genesis(super::GenesisTransaction),
#[prost(message, tag = "102")]
ConsensusCommitPrologueV1(super::ConsensusCommitPrologue),
#[prost(message, tag = "103")]
AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
#[prost(message, tag = "104")]
EndOfEpoch(super::EndOfEpochTransaction),
#[prost(message, tag = "105")]
RandomnessStateUpdate(super::RandomnessStateUpdate),
#[prost(message, tag = "106")]
ConsensusCommitPrologueV2(super::ConsensusCommitPrologue),
#[prost(message, tag = "107")]
ConsensusCommitPrologueV3(super::ConsensusCommitPrologue),
#[prost(message, tag = "108")]
ConsensusCommitPrologueV4(super::ConsensusCommitPrologue),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProgrammableTransaction {
#[prost(message, repeated, tag = "1")]
pub inputs: ::prost::alloc::vec::Vec<Input>,
#[prost(message, repeated, tag = "2")]
pub commands: ::prost::alloc::vec::Vec<Command>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Command {
#[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
pub command: ::core::option::Option<command::Command>,
}
pub mod command {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Command {
#[prost(message, tag = "1")]
MoveCall(super::MoveCall),
#[prost(message, tag = "2")]
TransferObjects(super::TransferObjects),
#[prost(message, tag = "3")]
SplitCoins(super::SplitCoins),
#[prost(message, tag = "4")]
MergeCoins(super::MergeCoins),
#[prost(message, tag = "5")]
Publish(super::Publish),
#[prost(message, tag = "6")]
MakeMoveVector(super::MakeMoveVector),
#[prost(message, tag = "7")]
Upgrade(super::Upgrade),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveCall {
#[prost(string, optional, tag = "1")]
pub package: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub module: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub function: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "4")]
pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "5")]
pub arguments: ::prost::alloc::vec::Vec<Argument>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransferObjects {
#[prost(message, repeated, tag = "1")]
pub objects: ::prost::alloc::vec::Vec<Argument>,
#[prost(message, optional, tag = "2")]
pub address: ::core::option::Option<Argument>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SplitCoins {
#[prost(message, optional, tag = "1")]
pub coin: ::core::option::Option<Argument>,
#[prost(message, repeated, tag = "2")]
pub amounts: ::prost::alloc::vec::Vec<Argument>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MergeCoins {
#[prost(message, optional, tag = "1")]
pub coin: ::core::option::Option<Argument>,
#[prost(message, repeated, tag = "2")]
pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Publish {
#[prost(bytes = "bytes", repeated, tag = "1")]
pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
#[prost(string, repeated, tag = "2")]
pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MakeMoveVector {
#[prost(string, optional, tag = "1")]
pub element_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "2")]
pub elements: ::prost::alloc::vec::Vec<Argument>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Upgrade {
#[prost(bytes = "bytes", repeated, tag = "1")]
pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
#[prost(string, repeated, tag = "2")]
pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub package: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub ticket: ::core::option::Option<Argument>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RandomnessStateUpdate {
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub randomness_round: ::core::option::Option<u64>,
#[prost(bytes = "bytes", optional, tag = "3")]
pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(uint64, optional, tag = "4")]
pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangeEpoch {
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub protocol_version: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub storage_charge: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub computation_charge: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "5")]
pub storage_rebate: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "6")]
pub non_refundable_storage_fee: ::core::option::Option<u64>,
#[prost(message, optional, tag = "7")]
pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, repeated, tag = "8")]
pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SystemPackage {
#[prost(uint64, optional, tag = "1")]
pub version: ::core::option::Option<u64>,
#[prost(bytes = "bytes", repeated, tag = "2")]
pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
#[prost(string, repeated, tag = "3")]
pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisTransaction {
#[prost(message, repeated, tag = "1")]
pub objects: ::prost::alloc::vec::Vec<Object>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsensusCommitPrologue {
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub round: ::core::option::Option<u64>,
#[prost(message, optional, tag = "3")]
pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, optional, tag = "4")]
pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "5")]
pub sub_dag_index: ::core::option::Option<u64>,
#[prost(message, optional, tag = "6")]
pub consensus_determined_version_assignments: ::core::option::Option<
ConsensusDeterminedVersionAssignments,
>,
#[prost(string, optional, tag = "7")]
pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VersionAssignment {
#[prost(string, optional, tag = "1")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "2")]
pub start_version: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub version: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CanceledTransaction {
#[prost(string, optional, tag = "1")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "2")]
pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsensusDeterminedVersionAssignments {
#[prost(int32, optional, tag = "1")]
pub version: ::core::option::Option<i32>,
#[prost(message, repeated, tag = "3")]
pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthenticatorStateUpdate {
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub round: ::core::option::Option<u64>,
#[prost(message, repeated, tag = "3")]
pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
#[prost(uint64, optional, tag = "4")]
pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActiveJwk {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<JwkId>,
#[prost(message, optional, tag = "2")]
pub jwk: ::core::option::Option<Jwk>,
#[prost(uint64, optional, tag = "3")]
pub epoch: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JwkId {
#[prost(string, optional, tag = "1")]
pub iss: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub kid: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Jwk {
#[prost(string, optional, tag = "1")]
pub kty: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub e: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub n: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub alg: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndOfEpochTransaction {
#[prost(message, repeated, tag = "1")]
pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndOfEpochTransactionKind {
#[prost(
oneof = "end_of_epoch_transaction_kind::Kind",
tags = "2, 3, 4, 200, 201, 202, 203, 204, 205"
)]
pub kind: ::core::option::Option<end_of_epoch_transaction_kind::Kind>,
}
pub mod end_of_epoch_transaction_kind {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Kind {
#[prost(message, tag = "2")]
ChangeEpoch(super::ChangeEpoch),
#[prost(message, tag = "3")]
AuthenticatorStateExpire(super::AuthenticatorStateExpire),
#[prost(message, tag = "4")]
ExecutionTimeObservations(super::ExecutionTimeObservations),
#[prost(message, tag = "200")]
AuthenticatorStateCreate(()),
#[prost(message, tag = "201")]
RandomnessStateCreate(()),
#[prost(message, tag = "202")]
DenyListStateCreate(()),
#[prost(string, tag = "203")]
BridgeStateCreate(::prost::alloc::string::String),
#[prost(uint64, tag = "204")]
BridgeCommitteeInit(u64),
#[prost(message, tag = "205")]
AccumulatorRootCreate(()),
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AuthenticatorStateExpire {
#[prost(uint64, optional, tag = "1")]
pub min_epoch: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionTimeObservations {
#[prost(int32, optional, tag = "1")]
pub version: ::core::option::Option<i32>,
#[prost(message, repeated, tag = "2")]
pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionTimeObservation {
#[prost(
enumeration = "execution_time_observation::ExecutionTimeObservationKind",
optional,
tag = "1"
)]
pub kind: ::core::option::Option<i32>,
#[prost(message, optional, tag = "2")]
pub move_entry_point: ::core::option::Option<MoveCall>,
#[prost(message, repeated, tag = "3")]
pub validator_observations: ::prost::alloc::vec::Vec<
ValidatorExecutionTimeObservation,
>,
}
pub mod execution_time_observation {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ExecutionTimeObservationKind {
Unknown = 0,
MoveEntryPoint = 1,
TransferObjects = 2,
SplitCoins = 3,
MergeCoins = 4,
Publish = 5,
MakeMoveVector = 6,
Upgrade = 7,
}
impl ExecutionTimeObservationKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
Self::TransferObjects => "TRANSFER_OBJECTS",
Self::SplitCoins => "SPLIT_COINS",
Self::MergeCoins => "MERGE_COINS",
Self::Publish => "PUBLISH",
Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
Self::Upgrade => "UPGRADE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
"MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
"TRANSFER_OBJECTS" => Some(Self::TransferObjects),
"SPLIT_COINS" => Some(Self::SplitCoins),
"MERGE_COINS" => Some(Self::MergeCoins),
"PUBLISH" => Some(Self::Publish),
"MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
"UPGRADE" => Some(Self::Upgrade),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorExecutionTimeObservation {
#[prost(bytes = "bytes", optional, tag = "1")]
pub validator: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(message, optional, tag = "2")]
pub duration: ::core::option::Option<::prost_types::Duration>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteTransactionRequest {
#[prost(message, optional, tag = "1")]
pub transaction: ::core::option::Option<Transaction>,
#[prost(message, repeated, tag = "2")]
pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
#[prost(message, optional, tag = "3")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteTransactionResponse {
#[prost(message, optional, tag = "1")]
pub finality: ::core::option::Option<TransactionFinality>,
#[prost(message, optional, tag = "2")]
pub transaction: ::core::option::Option<ExecutedTransaction>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionFinality {
#[prost(oneof = "transaction_finality::Finality", tags = "1, 2, 3")]
pub finality: ::core::option::Option<transaction_finality::Finality>,
}
pub mod transaction_finality {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Finality {
#[prost(message, tag = "1")]
Certified(super::ValidatorAggregatedSignature),
#[prost(uint64, tag = "2")]
Checkpointed(u64),
#[prost(message, tag = "3")]
QuorumExecuted(()),
}
}
pub mod transaction_execution_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct TransactionExecutionServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl TransactionExecutionServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> TransactionExecutionServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
TransactionExecutionServiceClient::new(
InterceptedService::new(inner, interceptor),
)
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn execute_transaction(
&mut self,
request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
) -> std::result::Result<
tonic::Response<super::ExecuteTransactionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta2.TransactionExecutionService/ExecuteTransaction",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"sui.rpc.v2beta2.TransactionExecutionService",
"ExecuteTransaction",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod transaction_execution_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
async fn execute_transaction(
&self,
request: tonic::Request<super::ExecuteTransactionRequest>,
) -> std::result::Result<
tonic::Response<super::ExecuteTransactionResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct TransactionExecutionServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> TransactionExecutionServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>>
for TransactionExecutionServiceServer<T>
where
T: TransactionExecutionService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/sui.rpc.v2beta2.TransactionExecutionService/ExecuteTransaction" => {
#[allow(non_camel_case_types)]
struct ExecuteTransactionSvc<T: TransactionExecutionService>(
pub Arc<T>,
);
impl<
T: TransactionExecutionService,
> tonic::server::UnaryService<super::ExecuteTransactionRequest>
for ExecuteTransactionSvc<T> {
type Response = super::ExecuteTransactionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ExecuteTransactionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TransactionExecutionService>::execute_transaction(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ExecuteTransactionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for TransactionExecutionServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "sui.rpc.v2beta2.TransactionExecutionService";
impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}