#![allow(dead_code)]
use crate::{ParquetSchema, ParquetValue};
use serde::Serialize;
use strum_macros::Display;
use sui_analytics_indexer_derive::SerializeParquet;
use sui_types::dynamic_field::DynamicFieldType;
#[derive(Serialize, Clone, SerializeParquet)]
pub(crate) struct CheckpointEntry {
pub(crate) checkpoint_digest: String,
pub(crate) sequence_number: u64,
pub(crate) epoch: u64,
pub(crate) timestamp_ms: u64,
pub(crate) previous_checkpoint_digest: Option<String>,
pub(crate) end_of_epoch: bool,
pub(crate) total_gas_cost: i64,
pub(crate) computation_cost: u64,
pub(crate) storage_cost: u64,
pub(crate) storage_rebate: u64,
pub(crate) non_refundable_storage_fee: u64,
pub(crate) total_transaction_blocks: u64,
pub(crate) total_transactions: u64,
pub(crate) total_successful_transaction_blocks: u64,
pub(crate) total_successful_transactions: u64,
pub(crate) network_total_transaction: u64,
pub(crate) validator_signature: String,
}
#[derive(Serialize, Clone, SerializeParquet)]
pub(crate) struct TransactionEntry {
pub(crate) transaction_digest: String,
pub(crate) checkpoint: u64,
pub(crate) epoch: u64,
pub(crate) timestamp_ms: u64,
pub(crate) sender: String,
pub(crate) transaction_kind: String,
pub(crate) is_system_txn: bool,
pub(crate) is_sponsored_tx: bool,
pub(crate) transaction_count: u64,
pub(crate) execution_success: bool,
pub(crate) input: u64,
pub(crate) shared_input: u64,
pub(crate) gas_coins: u64,
pub(crate) created: u64,
pub(crate) mutated: u64,
pub(crate) deleted: u64,
pub(crate) transfers: u64,
pub(crate) split_coins: u64,
pub(crate) merge_coins: u64,
pub(crate) publish: u64,
pub(crate) upgrade: u64,
pub(crate) others: u64,
pub(crate) move_calls: u64,
pub(crate) packages: String,
pub(crate) gas_owner: String,
pub(crate) gas_object_id: String,
pub(crate) gas_object_sequence: u64,
pub(crate) gas_object_digest: String,
pub(crate) gas_budget: u64,
pub(crate) total_gas_cost: i64,
pub(crate) computation_cost: u64,
pub(crate) storage_cost: u64,
pub(crate) storage_rebate: u64,
pub(crate) non_refundable_storage_fee: u64,
pub(crate) gas_price: u64,
pub(crate) raw_transaction: String,
pub(crate) has_zklogin_sig: bool,
pub(crate) has_upgraded_multisig: bool,
pub(crate) transaction_json: Option<String>,
pub(crate) effects_json: Option<String>,
}
#[derive(Serialize, Clone, SerializeParquet)]
pub(crate) struct EventEntry {
pub(crate) transaction_digest: String,
pub(crate) event_index: u64,
pub(crate) checkpoint: u64,
pub(crate) epoch: u64,
pub(crate) timestamp_ms: u64,
pub(crate) sender: String,
pub(crate) package: String,
pub(crate) module: String,
pub(crate) event_type: String,
pub(crate) bcs: String,
pub(crate) event_json: String,
}
#[derive(Serialize, Clone, Display)]
pub enum InputObjectKind {
Input,
SharedInput,
GasCoin,
}
#[derive(Serialize, Clone, Display)]
pub enum ObjectStatus {
Created,
Mutated,
Deleted,
}
#[derive(Serialize, Clone, Display)]
pub enum OwnerType {
AddressOwner,
ObjectOwner,
Shared,
Immutable,
}
#[derive(Serialize, Clone, SerializeParquet)]
pub(crate) struct ObjectEntry {
pub(crate) object_id: String,
pub(crate) version: u64,
pub(crate) digest: String,
pub(crate) type_: Option<String>, pub(crate) checkpoint: u64,
pub(crate) epoch: u64,
pub(crate) timestamp_ms: u64,
pub(crate) owner_type: Option<OwnerType>,
pub(crate) owner_address: Option<String>,
pub(crate) object_status: ObjectStatus,
pub(crate) initial_shared_version: Option<u64>,
pub(crate) previous_transaction: String,
pub(crate) has_public_transfer: bool,
pub(crate) storage_rebate: Option<u64>,
pub(crate) bcs: Option<String>,
pub(crate) coin_type: Option<String>,
pub(crate) coin_balance: Option<u64>,
pub(crate) struct_tag: Option<String>,
pub(crate) object_json: Option<String>,
}
#[derive(Serialize, Clone, SerializeParquet)]
pub(crate) struct TransactionObjectEntry {
pub(crate) object_id: String,
pub(crate) version: Option<u64>,
pub(crate) transaction_digest: String,
pub(crate) checkpoint: u64,
pub(crate) epoch: u64,
pub(crate) timestamp_ms: u64,
pub(crate) input_kind: Option<InputObjectKind>,
pub(crate) object_status: Option<ObjectStatus>,
}
#[derive(Serialize, Clone, SerializeParquet)]
pub(crate) struct MoveCallEntry {
pub(crate) transaction_digest: String,
pub(crate) checkpoint: u64,
pub(crate) epoch: u64,
pub(crate) timestamp_ms: u64,
pub(crate) package: String,
pub(crate) module: String,
pub(crate) function: String,
}
#[derive(Serialize, Clone, SerializeParquet)]
pub(crate) struct MovePackageEntry {
pub(crate) package_id: String,
pub(crate) checkpoint: u64,
pub(crate) epoch: u64,
pub(crate) timestamp_ms: u64,
pub(crate) bcs: String,
pub(crate) transaction_digest: String,
pub(crate) package_version: Option<u64>,
pub(crate) original_package_id: Option<String>,
}
#[derive(Serialize, Clone, SerializeParquet)]
pub(crate) struct DynamicFieldEntry {
pub(crate) parent_object_id: String,
pub(crate) transaction_digest: String,
pub(crate) checkpoint: u64,
pub(crate) epoch: u64,
pub(crate) timestamp_ms: u64,
pub(crate) name: String,
pub(crate) bcs_name: String,
pub(crate) type_: DynamicFieldType,
pub(crate) object_id: String,
pub(crate) version: u64,
pub(crate) digest: String,
pub(crate) object_type: String,
}
#[derive(Serialize, Clone, SerializeParquet)]
pub(crate) struct WrappedObjectEntry {
pub(crate) object_id: Option<String>,
pub(crate) root_object_id: String,
pub(crate) root_object_version: u64,
pub(crate) checkpoint: u64,
pub(crate) epoch: u64,
pub(crate) timestamp_ms: u64,
pub(crate) json_path: String,
pub(crate) struct_tag: Option<String>,
}