#[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 index: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "3")]
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(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, 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>,
}
#[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(uint64, optional, tag = "1")]
pub command: ::core::option::Option<u64>,
#[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "2")]
pub kind: ::core::option::Option<i32>,
#[prost(uint64, optional, tag = "3")]
pub abort_code: ::core::option::Option<u64>,
#[prost(message, optional, tag = "4")]
pub location: ::core::option::Option<MoveLocation>,
#[prost(message, optional, tag = "5")]
pub size_error: ::core::option::Option<SizeError>,
#[prost(message, optional, tag = "6")]
pub command_argument_error: ::core::option::Option<CommandArgumentError>,
#[prost(message, optional, tag = "7")]
pub type_argument_error: ::core::option::Option<TypeArgumentError>,
#[prost(message, optional, tag = "8")]
pub package_upgrade_error: ::core::option::Option<PackageUpgradeError>,
#[prost(uint32, optional, tag = "9")]
pub index: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "10")]
pub subresult: ::core::option::Option<u32>,
#[prost(string, optional, tag = "11")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "12")]
pub address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "13")]
pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "14")]
pub congested_objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
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,
}
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"
}
}
}
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)
}
_ => None,
}
}
}
}
#[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, 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, 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(uint32, optional, tag = "3")]
pub index: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "4")]
pub subresult: ::core::option::Option<u32>,
}
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,
}
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"
}
}
}
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)
}
_ => 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>,
}
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 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<Object>,
}
#[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 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<ExecutedTransaction>,
}
#[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 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>,
}
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::BoxBody>,
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::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::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.v2beta.LedgerService/GetServiceInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta.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::Object>, 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.v2beta.LedgerService/GetObject",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("sui.rpc.v2beta.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.v2beta.LedgerService/BatchGetObjects",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta.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::ExecutedTransaction>,
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.v2beta.LedgerService/GetTransaction",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta.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.v2beta.LedgerService/BatchGetTransactions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"sui.rpc.v2beta.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::Checkpoint>, 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.v2beta.LedgerService/GetCheckpoint",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta.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::Epoch>, 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.v2beta.LedgerService/GetEpoch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("sui.rpc.v2beta.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::Object>, 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::ExecutedTransaction>,
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::Checkpoint>, tonic::Status>;
async fn get_epoch(
&self,
request: tonic::Request<super::GetEpochRequest>,
) -> std::result::Result<tonic::Response<super::Epoch>, 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::BoxBody>;
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.v2beta.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.v2beta.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::Object;
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.v2beta.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.v2beta.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::ExecutedTransaction;
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.v2beta.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.v2beta.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::Checkpoint;
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.v2beta.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::Epoch;
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(empty_body());
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.v2beta.LedgerService";
impl<T> tonic::server::NamedService for LedgerServiceServer<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, repeated, tag = "9")]
pub modules: ::prost::alloc::vec::Vec<MoveModule>,
#[prost(message, repeated, tag = "10")]
pub type_origin_table: ::prost::alloc::vec::Vec<TypeOrigin>,
#[prost(message, repeated, tag = "11")]
pub linkage_table: ::prost::alloc::vec::Vec<UpgradeInfo>,
#[prost(string, optional, tag = "12")]
pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "13")]
pub storage_rebate: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveModule {
#[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>,
}
#[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 struct_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 UpgradeInfo {
#[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, 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,
}
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",
}
}
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),
_ => 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(bytes = "bytes", optional, tag = "3")]
pub signature: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(bytes = "bytes", optional, tag = "4")]
pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(message, optional, tag = "5")]
pub multisig: ::core::option::Option<MultisigAggregatedSignature>,
#[prost(message, optional, boxed, tag = "6")]
pub zklogin: ::core::option::Option<
::prost::alloc::boxed::Box<ZkLoginAuthenticator>,
>,
#[prost(message, optional, boxed, tag = "7")]
pub passkey: ::core::option::Option<
::prost::alloc::boxed::Box<PasskeyAuthenticator>,
>,
}
#[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>,
}
#[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, boxed, tag = "3")]
pub signature: ::core::option::Option<::prost::alloc::boxed::Box<UserSignature>>,
}
#[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, boxed, tag = "3")]
pub signature: ::core::option::Option<::prost::alloc::boxed::Box<UserSignature>>,
}
#[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 stake: ::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 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 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 CanceledTransactions {
#[prost(message, repeated, tag = "1")]
pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsensusDeterminedVersionAssignments {
#[prost(oneof = "consensus_determined_version_assignments::Kind", tags = "2")]
pub kind: ::core::option::Option<consensus_determined_version_assignments::Kind>,
}
pub mod consensus_determined_version_assignments {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Kind {
#[prost(message, tag = "2")]
CanceledTransactions(super::CanceledTransactions),
}
}
#[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"
)]
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),
}
}
#[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::BoxBody>,
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::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::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.v2beta.TransactionExecutionService/ExecuteTransaction",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"sui.rpc.v2beta.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::BoxBody>;
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.v2beta.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(empty_body());
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.v2beta.TransactionExecutionService";
impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}